Merge branch 'ts-project-refs' into game

This commit is contained in:
wancat committed 2024-03-06 22:39:49 +08:00
commit a8a19ca902
18 files changed
+1017 -75

No files matched your search

+1 -3
View File
@@ -20,9 +20,7 @@ COPY packages/file-graph ./packages/file-graph
COPY packages/utils ./packages/utils COPY packages/utils ./packages/utils
COPY packages/constants ./packages/constants COPY packages/constants ./packages/constants
COPY app ./app COPY app ./app
RUN yarn workspace @linux-odyssey/file-graph build RUN yarn workspace app build:refs
RUN yarn workspace @linux-odyssey/utils build
RUN yarn workspace @linux-odyssey/constants build
RUN yarn workspace app build RUN yarn workspace app build
# Production stage # Production stage
+1
View File
@@ -7,6 +7,7 @@
"dev": "vite", "dev": "vite",
"dev:docker": "API_TARGET=http://backend:3000 vite", "dev:docker": "API_TARGET=http://backend:3000 vite",
"build": "vite build", "build": "vite build",
"build:refs": "tsc --build",
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
+5 -1
View File
@@ -22,5 +22,9 @@
"noFallthroughCasesInSwitch": true "noFallthroughCasesInSwitch": true
}, },
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.js"], "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue", "src/**/*.js"],
"references": [{ "path": "./tsconfig.node.json" }] "references": [
{ "path": "../packages/utils" },
{ "path": "../packages/constants" },
{ "path": "../packages/file-graph" }
]
} }
-10
View File
@@ -1,10 +0,0 @@
{
"compilerOptions": {
"composite": true,
"skipLibCheck": true,
"module": "ESNext",
"moduleResolution": "bundler",
"allowSyntheticDefaultImports": true
},
"include": ["vite.config.ts"]
}
+6
View File
@@ -0,0 +1,6 @@
module.exports = {
presets: [
['@babel/preset-env', { targets: { node: 'current' } }],
'@babel/preset-typescript',
],
}
-1
View File
@@ -6,7 +6,6 @@
import type { Config } from 'jest' import type { Config } from 'jest'
const config: Config = { const config: Config = {
preset: 'ts-jest/presets/default-esm',
// All imported modules in your tests should be mocked automatically // All imported modules in your tests should be mocked automatically
// automock: false, // automock: false,
+5 -4
View File
@@ -13,9 +13,7 @@
], ],
"scripts": { "scripts": {
"app": "yarn workspace app dev", "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": "yarn workspace server build && yarn workspace app build && yarn workspace analytics build",
"build:apps": "concurrently \"yarn workspace app build\" \"yarn workspace server build\" \"yarn workspace analytics build\"",
"build": "yarn build:deps && yarn build:apps",
"dev": "concurrently -n \"App,Server\" -c \"bgBlue.bold,bgGreen.bold\" \"yarn workspace app dev\" \"yarn workspace server dev\"", "dev": "concurrently -n \"App,Server\" -c \"bgBlue.bold,bgGreen.bold\" \"yarn workspace app dev\" \"yarn workspace server dev\"",
"server": "yarn workspace server dev", "server": "yarn workspace server dev",
"cli": "yarn workspace client start", "cli": "yarn workspace client start",
@@ -30,12 +28,16 @@
"build:quests": "yarn workspace server build:quests" "build:quests": "yarn workspace server build:quests"
}, },
"devDependencies": { "devDependencies": {
"@babel/core": "^7.24.0",
"@babel/preset-env": "^7.24.0",
"@babel/preset-typescript": "^7.23.3",
"@jest/globals": "^29.7.0", "@jest/globals": "^29.7.0",
"@types/jest": "^29.5.12", "@types/jest": "^29.5.12",
"@types/node": "^20.10.4", "@types/node": "^20.10.4",
"@typescript-eslint/eslint-plugin": "^6.14.0", "@typescript-eslint/eslint-plugin": "^6.14.0",
"@typescript-eslint/parser": "^6.14.0", "@typescript-eslint/parser": "^6.14.0",
"@vue/eslint-config-prettier": "^7.1.0", "@vue/eslint-config-prettier": "^7.1.0",
"babel-jest": "^29.7.0",
"concurrently": "^8.2.2", "concurrently": "^8.2.2",
"eslint": "^8.44.0", "eslint": "^8.44.0",
"eslint-config-airbnb-base": "^15.0.0", "eslint-config-airbnb-base": "^15.0.0",
@@ -48,7 +50,6 @@
"eslint-plugin-vue": "^9.15.1", "eslint-plugin-vue": "^9.15.1",
"jest": "^29.7.0", "jest": "^29.7.0",
"prettier": "^3.0.0", "prettier": "^3.0.0",
"ts-jest": "^29.1.1",
"ts-node": "^10.9.2", "ts-node": "^10.9.2",
"typescript": "^5.3.3" "typescript": "^5.3.3"
} }
+1
View File
@@ -1,6 +1,7 @@
{ {
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"composite": true,
"outDir": "./dist" "outDir": "./dist"
}, },
"include": ["*.js", "*.ts"], "include": ["*.js", "*.ts"],
+1
View File
@@ -2,6 +2,7 @@
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"rootDir": "src", "rootDir": "src",
"composite": true,
"outDir": "./dist" "outDir": "./dist"
}, },
"include": ["src"], "include": ["src"],
+2
View File
@@ -15,3 +15,5 @@ export default async function connectDB(uri: string) {
const db = await mongoose.connect(uri) const db = await mongoose.connect(uri)
return db.connection.getClient() return db.connection.getClient()
} }
console.log('Loaded models package')
+1
View File
@@ -2,6 +2,7 @@
"extends": "../../tsconfig.json", "extends": "../../tsconfig.json",
"compilerOptions": { "compilerOptions": {
"rootDir": "src", "rootDir": "src",
"composite": true,
"outDir": "./dist" "outDir": "./dist"
}, },
"include": ["src"], "include": ["src"],
+1
View File
@@ -3,6 +3,7 @@
"compilerOptions": { "compilerOptions": {
"rootDir": "src", "rootDir": "src",
"outDir": "./dist", "outDir": "./dist",
"composite": true,
"allowJs": false "allowJs": false
}, },
"include": ["src"], "include": ["src"],
-4
View File
@@ -26,10 +26,6 @@ COPY server ./server
COPY quests ./quests COPY quests ./quests
ENV NODE_ENV=production ENV NODE_ENV=production
RUN yarn workspace @linux-odyssey/file-graph build
RUN yarn workspace @linux-odyssey/utils build
RUN yarn workspace @linux-odyssey/models build
RUN yarn workspace @linux-odyssey/constants build
RUN yarn workspace server build RUN yarn workspace server build
WORKDIR /app/server WORKDIR /app/server
CMD [ "yarn", "start" ] CMD [ "yarn", "start" ]
+2 -3
View File
@@ -1,6 +1,5 @@
{ {
"watch": ["dist", "swagger.yaml", "../quests", "../packages"], "watch": ["src", "swagger.yaml", "../quests", "../packages"],
"ext": "js,ts,yaml,yml", "ext": "js,ts,yaml,yml",
"exec": "node -r source-map-support/register dist/index.js", "exec": "node --loader ts-node/esm src/index.js"
"delay": 200
} }
+6 -2
View File
@@ -7,8 +7,8 @@
"start": "node dist/index.js", "start": "node dist/index.js",
"setup": "node dist/cli/setup.js", "setup": "node dist/cli/setup.js",
"clean": "node dist/cli/clean.js", "clean": "node dist/cli/clean.js",
"build": "tsc", "build": "tsc -b",
"dev": "concurrently \"tsc -w\" \"sleep 5 && nodemon\"", "dev": "nodemon",
"build:quests": "node dist/cli/build.js" "build:quests": "node dist/cli/build.js"
}, },
"dependencies": { "dependencies": {
@@ -44,6 +44,8 @@
"yaml": "^2.3.1" "yaml": "^2.3.1"
}, },
"devDependencies": { "devDependencies": {
"@swc/core": "^1.4.2",
"@swc/helpers": "^0.5.6",
"@types/bcrypt": "^5.0.2", "@types/bcrypt": "^5.0.2",
"@types/dockerode": "^3.3.23", "@types/dockerode": "^3.3.23",
"@types/express": "^4.17.21", "@types/express": "^4.17.21",
@@ -62,7 +64,9 @@
"concurrently": "^8.2.2", "concurrently": "^8.2.2",
"jest": "^29.6.1", "jest": "^29.6.1",
"nodemon": "^3.0.1", "nodemon": "^3.0.1",
"regenerator-runtime": "^0.14.1",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"ts-node": "^10.9.2",
"typescript": "^5.3.3" "typescript": "^5.3.3"
} }
} }
+10 -1
View File
@@ -4,5 +4,14 @@
"outDir": "./dist" "outDir": "./dist"
}, },
"include": ["src"], "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" }
],
"ts-node": {
"swc": true
}
} }
+2 -1
View File
@@ -8,6 +8,7 @@
"strict": true, "strict": true,
"skipLibCheck": true, "skipLibCheck": true,
"sourceMap": true, "sourceMap": true,
"declaration": true "declaration": true,
"declarationMap": true
} }
} }
+973 -45
View File
File diff suppressed because it is too large. Load diff