diff --git a/app/game-api/tsconfig.json b/app/game-api/tsconfig.json index 2c11d91..f94e66c 100644 --- a/app/game-api/tsconfig.json +++ b/app/game-api/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "baseUrl": "../..", "outDir": "dist", "rootDir": "src", "composite": true diff --git a/app/game-engine/tsconfig.json b/app/game-engine/tsconfig.json index 2c11d91..f94e66c 100644 --- a/app/game-engine/tsconfig.json +++ b/app/game-engine/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "baseUrl": "../..", "outDir": "dist", "rootDir": "src", "composite": true diff --git a/app/game-frontend/tsconfig.json b/app/game-frontend/tsconfig.json index a18b41c..28799f0 100644 --- a/app/game-frontend/tsconfig.json +++ b/app/game-frontend/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "baseUrl": "../..", "outDir": "dist", "rootDir": "src", "composite": true, diff --git a/app/gateway-api/tsconfig.json b/app/gateway-api/tsconfig.json index 2c11d91..f94e66c 100644 --- a/app/gateway-api/tsconfig.json +++ b/app/gateway-api/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "baseUrl": "../..", "outDir": "dist", "rootDir": "src", "composite": true diff --git a/app/gateway-frontend/tsconfig.json b/app/gateway-frontend/tsconfig.json index a18b41c..28799f0 100644 --- a/app/gateway-frontend/tsconfig.json +++ b/app/gateway-frontend/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "baseUrl": "../..", "outDir": "dist", "rootDir": "src", "composite": true, diff --git a/packages/common/tsconfig.json b/packages/common/tsconfig.json index 2c11d91..f94e66c 100644 --- a/packages/common/tsconfig.json +++ b/packages/common/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "baseUrl": "../..", "outDir": "dist", "rootDir": "src", "composite": true diff --git a/packages/infra/tsconfig.json b/packages/infra/tsconfig.json index 2c11d91..f94e66c 100644 --- a/packages/infra/tsconfig.json +++ b/packages/infra/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "baseUrl": "../..", "outDir": "dist", "rootDir": "src", "composite": true diff --git a/packages/logic/package.json b/packages/logic/package.json index af8cc4f..150b580 100644 --- a/packages/logic/package.json +++ b/packages/logic/package.json @@ -12,7 +12,7 @@ } }, "scripts": { - "build": "tsc -p tsconfig.json", + "build": "tsc -b tsconfig.build.json", "dev": "node -e \"console.log('dev not configured')\"", "lint": "node -e \"console.log('lint not configured')\"", "test": "vitest run --config vitest.config.ts" @@ -21,6 +21,7 @@ "@sammo-ts/common": "workspace:*" }, "devDependencies": { + "vite-tsconfig-paths": "^4.3.2", "vitest": "^4.0.16" } } diff --git a/packages/logic/tsconfig.build.json b/packages/logic/tsconfig.build.json new file mode 100644 index 0000000..96de654 --- /dev/null +++ b/packages/logic/tsconfig.build.json @@ -0,0 +1,9 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "paths": {} + }, + "references": [ + { "path": "../common" } + ] +} diff --git a/packages/logic/tsconfig.json b/packages/logic/tsconfig.json index 00ee3aa..c126b9f 100644 --- a/packages/logic/tsconfig.json +++ b/packages/logic/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "baseUrl": "../..", "outDir": "dist", "rootDir": "src", "composite": true, diff --git a/packages/logic/vitest.config.ts b/packages/logic/vitest.config.ts index 69a4a8a..b39b7b9 100644 --- a/packages/logic/vitest.config.ts +++ b/packages/logic/vitest.config.ts @@ -1,13 +1,14 @@ import path from 'node:path'; import { defineConfig } from 'vitest/config'; +import tsconfigPaths from 'vite-tsconfig-paths'; export default defineConfig({ - resolve: { - alias: { - '@sammo-ts/common': path.resolve(__dirname, '../common/src/index.ts'), - }, - }, + plugins: [ + tsconfigPaths({ + projects: [path.resolve(__dirname, '../../tsconfig.base.json')], + }), + ], test: { environment: 'node', globals: true, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 01ce7c7..e3d322a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,6 +30,12 @@ importers: app/gateway-frontend: {} packages/common: + dependencies: + js-sha512: + specifier: ^0.9.0 + version: 0.9.0 + + packages/infra: dependencies: '@prisma/client': specifier: ^5.18.0 @@ -44,10 +50,13 @@ importers: packages/logic: dependencies: - js-sha512: - specifier: ^0.9.0 - version: 0.9.0 + '@sammo-ts/common': + specifier: workspace:* + version: link:../common devDependencies: + vite-tsconfig-paths: + specifier: ^4.3.2 + version: 4.3.2(typescript@5.9.3)(vite@7.3.0(@types/node@20.19.27)) vitest: specifier: ^4.0.16 version: 4.0.16(@types/node@20.19.27) @@ -434,6 +443,15 @@ packages: resolution: {integrity: sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==} engines: {node: '>=0.10.0'} + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + es-module-lexer@1.7.0: resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} @@ -467,12 +485,18 @@ packages: resolution: {integrity: sha512-hymDOu5B53XvN4QT9dBmZxPX4CWhBPPLguTZ9MMFeFa/Kg0xWVfylOVNlJji/E7yTZWFd/q9GO5TxDLq156D7g==} engines: {node: '>= 4'} + globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + js-sha512@0.9.0: resolution: {integrity: sha512-mirki9WS/SUahm+1TbAPkqvbCiCfOAAsyXeHxK1UkullnJVVqoJG2pL9ObvT05CN+tM7fxhfYm0NbXn+1hWoZg==} magic-string@0.30.21: resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==} + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + nanoid@3.3.11: resolution: {integrity: sha512-N8SpfPUnUp1bK+PMYW8qSWdl9U+wwNWI4QKxOYDy9JAro3WMX7p2OeVRF9v+347pnakNevPmiHhNmZ2HbFA76w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -536,6 +560,16 @@ packages: resolution: {integrity: sha512-PSkbLUoxOFRzJYjjxHJt9xro7D+iilgMX/C9lawzVuYiIdcihh9DXmVibBe8lmcFrRi/VzlPjBxbN7rH24q8/Q==} engines: {node: '>=14.0.0'} + tsconfck@3.1.6: + resolution: {integrity: sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==} + engines: {node: ^18 || >=20} + hasBin: true + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -544,6 +578,14 @@ packages: undici-types@6.21.0: resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + vite-tsconfig-paths@4.3.2: + resolution: {integrity: sha512-0Vd/a6po6Q+86rPlntHye7F31zA2URZMbH8M3saAZ/xR9QoGN/L21bxEGfXdWmFdNkqPpRdxFT7nmNe12e9/uA==} + peerDependencies: + vite: '*' + peerDependenciesMeta: + vite: + optional: true + vite@7.3.0: resolution: {integrity: sha512-dZwN5L1VlUBewiP6H9s2+B3e3Jg96D0vzN+Ry73sOefebhYr9f94wwkMNN/9ouoU8pV1BqA1d1zGk8928cx0rg==} engines: {node: ^20.19.0 || >=22.12.0} @@ -885,6 +927,10 @@ snapshots: cluster-key-slot@1.1.2: {} + debug@4.4.3: + dependencies: + ms: 2.1.3 + es-module-lexer@1.7.0: {} esbuild@0.27.2: @@ -931,12 +977,16 @@ snapshots: generic-pool@3.9.0: {} + globrex@0.1.2: {} + js-sha512@0.9.0: {} magic-string@0.30.21: dependencies: '@jridgewell/sourcemap-codec': 1.5.5 + ms@2.1.3: {} + nanoid@3.3.11: {} obug@2.1.1: {} @@ -1015,10 +1065,25 @@ snapshots: tinyrainbow@3.0.3: {} + tsconfck@3.1.6(typescript@5.9.3): + optionalDependencies: + typescript: 5.9.3 + typescript@5.9.3: {} undici-types@6.21.0: {} + vite-tsconfig-paths@4.3.2(typescript@5.9.3)(vite@7.3.0(@types/node@20.19.27)): + dependencies: + debug: 4.4.3 + globrex: 0.1.2 + tsconfck: 3.1.6(typescript@5.9.3) + optionalDependencies: + vite: 7.3.0(@types/node@20.19.27) + transitivePeerDependencies: + - supports-color + - typescript + vite@7.3.0(@types/node@20.19.27): dependencies: esbuild: 0.27.2 diff --git a/tools/build-scripts/tsconfig.json b/tools/build-scripts/tsconfig.json index 2c11d91..f94e66c 100644 --- a/tools/build-scripts/tsconfig.json +++ b/tools/build-scripts/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "baseUrl": "../..", "outDir": "dist", "rootDir": "src", "composite": true diff --git a/tools/test-dbms/tsconfig.json b/tools/test-dbms/tsconfig.json index 3af198e..c3edd9a 100644 --- a/tools/test-dbms/tsconfig.json +++ b/tools/test-dbms/tsconfig.json @@ -1,6 +1,7 @@ { "extends": "../../tsconfig.base.json", "compilerOptions": { + "baseUrl": "../..", "noEmit": true, "types": ["node"] }, diff --git a/tsconfig.base.json b/tsconfig.base.json index ac7e186..d91e5f8 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -4,6 +4,15 @@ "module": "NodeNext", "moduleResolution": "NodeNext", "lib": ["ES2022"], + "baseUrl": ".", + "paths": { + "@sammo-ts/common": ["packages/common/src/index.ts"], + "@sammo-ts/common/*": ["packages/common/src/*"], + "@sammo-ts/infra": ["packages/infra/src/index.ts"], + "@sammo-ts/infra/*": ["packages/infra/src/*"], + "@sammo-ts/logic": ["packages/logic/src/index.ts"], + "@sammo-ts/logic/*": ["packages/logic/src/*"] + }, "strict": true, "esModuleInterop": true, "forceConsistentCasingInFileNames": true,