init: turbo repo entrypoint with api
This commit is contained in:
parent
88db89acca
commit
f30474533a
12 changed files with 1690 additions and 0 deletions
44
.gitignore
vendored
Normal file
44
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
# Dependencies
|
||||
node_modules/
|
||||
**/node_modules/
|
||||
|
||||
# Turborepo
|
||||
.turbo/
|
||||
**/.turbo/
|
||||
|
||||
# Build outputs
|
||||
.next/
|
||||
**/.next/
|
||||
dist/
|
||||
**/dist/
|
||||
build/
|
||||
**/build/
|
||||
out/
|
||||
**/out/
|
||||
*.tsbuildinfo
|
||||
|
||||
# Environment files (keep the example)
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
# Logs
|
||||
*.log
|
||||
npm-debug.log*
|
||||
|
||||
# Testing
|
||||
coverage/
|
||||
|
||||
# Docker overrides (local only)
|
||||
docker-compose.override.yml
|
||||
|
||||
# OS / editor
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
.vscode/*
|
||||
!.vscode/settings.json
|
||||
!.vscode/extensions.json
|
||||
.idea/
|
||||
|
||||
# Vercel (if you deploy there)
|
||||
.vercel/
|
||||
17
apps/api/package.json
Normal file
17
apps/api/package.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "api",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"dev": "tsx watch src/index.ts",
|
||||
"start": "node dist/index.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"@repo/shared": "*",
|
||||
"express": "^5.2.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"tsx": "^4.19.0"
|
||||
}
|
||||
}
|
||||
9
apps/api/src/index.ts
Normal file
9
apps/api/src/index.ts
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import express from "express";
|
||||
import { greet } from "@repo/shared";
|
||||
|
||||
const app = express();
|
||||
const port = Number(process.env.PORT) || 4000;
|
||||
|
||||
app.get("/", (_req, res) => res.json({ message: greet("Turborepo") }));
|
||||
|
||||
app.listen(port, () => console.log(`api listening on ${port}`));
|
||||
0
docker-compose.dev.yml
Normal file
0
docker-compose.dev.yml
Normal file
0
docker-compose.yml
Normal file
0
docker-compose.yml
Normal file
1550
package-lock.json
generated
Normal file
1550
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
17
package.json
Normal file
17
package.json
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"name": "nugget-of-wisdom",
|
||||
"private": true,
|
||||
"packageManager": "npm@10.9.0",
|
||||
"workspaces": [
|
||||
"apps/*",
|
||||
"packages/*"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "turbo run build",
|
||||
"dev": "turbo run dev"
|
||||
},
|
||||
"devDependencies": {
|
||||
"turbo": "^2.3.0",
|
||||
"typescript": "^5.6.0"
|
||||
}
|
||||
}
|
||||
11
packages/shared/package.json
Normal file
11
packages/shared/package.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"name": "@repo/shared",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"dev": "tsc --watch"
|
||||
}
|
||||
}
|
||||
1
packages/shared/src/index.ts
Normal file
1
packages/shared/src/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export const greet = (name: string) => `Hello, ${name}!`;
|
||||
11
packages/shared/tsconfig.json
Normal file
11
packages/shared/tsconfig.json
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"declaration": true
|
||||
},
|
||||
"include": [
|
||||
"src"
|
||||
]
|
||||
}
|
||||
10
tsconfig.base.json
Normal file
10
tsconfig.base.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2022",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
}
|
||||
20
turbo.json
Normal file
20
turbo.json
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"tasks": {
|
||||
"build": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"outputs": [
|
||||
"dist/**"
|
||||
]
|
||||
},
|
||||
"dev": {
|
||||
"dependsOn": [
|
||||
"^build"
|
||||
],
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue