feat: use project references to build dependencies efficiently

This commit is contained in:
wancat committed 2024-02-28 23:32:06 +08:00
1 parent fb69cb4e10
commit 0644783cc4
10 files changed
+24 -8

No files matched your search

+6 -1
View File
@@ -22,5 +22,10 @@
"noFallthroughCasesInSwitch": true
},
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.js"],
"references": [{ "path": "./tsconfig.node.json" }]
"references": [
{ "path": "./tsconfig.node.json" },
{ "path": "../packages/utils" },
{ "path": "../packages/constants" },
{ "path": "../packages/file-graph" }
]
}
+1 -3
View File
@@ -13,9 +13,7 @@
],
"scripts": {
"app": "yarn workspace app dev",
"build:deps": "concurrently \"yarn workspace @linux-odyssey/constants build\" \"yarn workspace @linux-odyssey/file-graph build\" \"yarn workspace @linux-odyssey/models build\" \"yarn workspace @linux-odyssey/utils build\"",
"build:apps": "concurrently \"yarn workspace app build\" \"yarn workspace server build\" \"yarn workspace analytics build\"",
"build": "yarn build:deps && yarn build:apps",
"build": "yarn workspace server build && yarn workspace app build && yarn workspace analytics build",
"dev": "concurrently -n \"App,Server\" -c \"bgBlue.bold,bgGreen.bold\" \"yarn workspace app dev\" \"yarn workspace server dev\"",
"server": "yarn workspace server dev",
"cli": "yarn workspace client start",
+1
View File
@@ -1,6 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"outDir": "./dist"
},
"include": ["*.js", "*.ts"],
+1
View File
@@ -2,6 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"composite": true,
"outDir": "./dist"
},
"include": ["src"],
+2
View File
@@ -15,3 +15,5 @@ export default async function connectDB(uri: string) {
const db = await mongoose.connect(uri)
return db.connection.getClient()
}
console.log('Loaded models package')
+1
View File
@@ -2,6 +2,7 @@
"extends": "../../tsconfig.json",
"compilerOptions": {
"rootDir": "src",
"composite": true,
"outDir": "./dist"
},
"include": ["src"],
+1
View File
@@ -3,6 +3,7 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "./dist",
"composite": true,
"allowJs": false
},
"include": ["src"],
+2 -2
View File
@@ -7,8 +7,8 @@
"start": "node dist/index.js",
"setup": "node dist/cli/setup.js",
"clean": "node dist/cli/clean.js",
"build": "tsc",
"dev": "concurrently \"tsc -w\" \"sleep 5 && nodemon\"",
"build": "tsc -b",
"dev": "concurrently \"tsc -b --watch\" \"sleep 5 && nodemon\"",
"build:quests": "node dist/cli/build.js"
},
"dependencies": {
+7 -1
View File
@@ -4,5 +4,11 @@
"outDir": "./dist"
},
"include": ["src"],
"exclude": ["node_modules", "src/*.test.js", "dist"]
"exclude": ["node_modules", "src/*.test.js", "dist"],
"references": [
{ "path": "../packages/constants" },
{ "path": "../packages/file-graph" },
{ "path": "../packages/models" },
{ "path": "../packages/utils" }
]
}
+2 -1
View File
@@ -8,6 +8,7 @@
"strict": true,
"skipLibCheck": true,
"sourceMap": true,
"declaration": true
"declaration": true,
"declarationMap": true
}
}