빌드 선언 생성 병목과 Vue 중복 타입 검사를 개선

This commit is contained in:
2026-10-23 01:33:34 +09:00
parent b377250fb9
commit af51968782
31 changed files with 436 additions and 109 deletions
+5 -1
View File
@@ -3,7 +3,11 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"composite": false
"composite": false,
"paths": {
"@sammo-ts/game-api": ["./src/index.ts"],
"@sammo-ts/game-api/*": ["./src/*"]
}
},
"include": ["src"]
}
+6 -3
View File
@@ -3,8 +3,11 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"composite": false
"composite": false,
"paths": {
"@sammo-ts/game-engine": ["./src/index.ts"],
"@sammo-ts/game-engine/*": ["./src/*"]
}
},
"include": ["src"],
"references": [{ "path": "../../packages/common" }, { "path": "../../packages/logic" }]
"include": ["src"]
}
+3 -3
View File
@@ -1,4 +1,5 @@
import { defineConfig } from 'tsdown';
import { emitDeclarations } from '../../tools/build-scripts/emit-declarations.mjs';
export default defineConfig({
entry: {
@@ -30,9 +31,8 @@ export default defineConfig({
},
format: 'es',
outDir: 'dist',
dts: {
build: true,
},
dts: false,
hooks: { 'build:done': emitDeclarations },
sourcemap: true,
target: 'node22',
platform: 'node',
+12 -6
View File
@@ -2,7 +2,7 @@ import { randomUUID } from 'node:crypto';
import { expect, test, type Browser, type Page } from '@playwright/test';
import { encryptGameSessionToken } from '../../../packages/common/dist/auth/gameToken.js';
import { createGamePostgresConnector } from '../../../packages/infra/dist/index.js';
import { createGamePostgresConnector, GamePrisma } from '../../../packages/infra/dist/index.js';
const databaseUrl = process.env.CHIEF_CENTER_LIVE_DATABASE_URL;
const gameTokenSecret = process.env.CHIEF_CENTER_LIVE_GAME_SECRET;
@@ -174,7 +174,13 @@ test('persists one chief command and exposes it to a normal nation user and anot
await transaction.nationTurn.deleteMany({
where: { nationId: editor.nationId, officerLevel: editor.officerLevel },
});
if (originalTurns.length) await transaction.nationTurn.createMany({ data: originalTurns });
if (originalTurns.length)
await transaction.nationTurn.createMany({
data: originalTurns.map((row: (typeof originalTurns)[number]) => ({
...row,
arg: row.arg ?? GamePrisma.JsonNull,
})),
});
await transaction.nationTurnRevision.deleteMany({
where: { nationId: editor.nationId, officerLevel: editor.officerLevel },
});
@@ -185,8 +191,8 @@ test('persists one chief command and exposes it to a normal nation user and anot
userId: viewer.userId,
officerLevel: viewer.officerLevel,
npcState: viewer.npcState,
meta: viewer.meta,
penalty: viewer.penalty,
meta: viewer.meta ?? GamePrisma.JsonNull,
penalty: viewer.penalty ?? GamePrisma.JsonNull,
},
});
await transaction.general.update({
@@ -195,8 +201,8 @@ test('persists one chief command and exposes it to a normal nation user and anot
userId: otherChief.userId,
officerLevel: otherChief.officerLevel,
npcState: otherChief.npcState,
meta: otherChief.meta,
penalty: otherChief.penalty,
meta: otherChief.meta ?? GamePrisma.JsonNull,
penalty: otherChief.penalty ?? GamePrisma.JsonNull,
},
});
});
@@ -1,6 +1,6 @@
import { readFile } from 'node:fs/promises';
import { expect, test, type Locator, type Page } from '@playwright/test';
import { createGamePostgresConnector } from '../../../packages/infra/dist/index.js';
import { createGamePostgresConnector, GamePrisma } from '../../../packages/infra/dist/index.js';
const bootstrapFile = process.env.COMMAND_PANEL_LIVE_BOOTSTRAP_FILE;
const databaseUrl = process.env.DATABASE_URL;
@@ -166,14 +166,26 @@ test('reserves every requested general and chief command through Chromium and re
} finally {
await db.$transaction(async (transaction) => {
await transaction.generalTurn.deleteMany({ where: { generalId: general.id } });
if (originalGeneralTurns.length) await transaction.generalTurn.createMany({ data: originalGeneralTurns });
if (originalGeneralTurns.length)
await transaction.generalTurn.createMany({
data: originalGeneralTurns.map((row: (typeof originalGeneralTurns)[number]) => ({
...row,
arg: row.arg ?? GamePrisma.JsonNull,
})),
});
await transaction.generalTurnRevision.deleteMany({ where: { generalId: general.id } });
if (originalGeneralRevision)
await transaction.generalTurnRevision.create({ data: originalGeneralRevision });
await transaction.nationTurn.deleteMany({
where: { nationId: general.nationId, officerLevel: general.officerLevel },
});
if (originalNationTurns.length) await transaction.nationTurn.createMany({ data: originalNationTurns });
if (originalNationTurns.length)
await transaction.nationTurn.createMany({
data: originalNationTurns.map((row: (typeof originalNationTurns)[number]) => ({
...row,
arg: row.arg ?? GamePrisma.JsonNull,
})),
});
await transaction.nationTurnRevision.deleteMany({
where: { nationId: general.nationId, officerLevel: general.officerLevel },
});
+3 -3
View File
@@ -5,9 +5,9 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc && vite build",
"build": "node ../../tools/vue-typecheck.mjs && vite build",
"build:release": "vite build --outDir .release-build",
"typecheck:release": "vue-tsc --noEmit",
"typecheck:release": "node ../../tools/vue-typecheck.mjs --noEmit",
"preview": "vite preview",
"test": "pnpm test:unit",
"test:unit": "node --test test/**/*.test.ts",
@@ -30,7 +30,7 @@
"test:e2e:default-recruit-commands-live": "pnpm --filter @sammo-ts/infra prisma:generate && pnpm --filter @sammo-ts/common build && pnpm --filter @sammo-ts/logic build && pnpm --filter @sammo-ts/infra build && pnpm --filter @sammo-ts/game-engine build && pnpm --filter @sammo-ts/game-api build && playwright test --config e2e/defaultRecruitCommands.live.playwright.config.mjs --tsconfig e2e/playwright.live.tsconfig.json",
"lint": "pnpm -w lint:target app/game-frontend",
"lint:fix": "pnpm -w lint:target:fix app/game-frontend",
"typecheck": "vue-tsc --noEmit"
"typecheck": "node ../../tools/vue-typecheck.mjs --noEmit"
},
"dependencies": {
"@sammo-ts/common": "workspace:*",
+4 -9
View File
@@ -30,16 +30,11 @@
"@sammo-ts/game-api/*": ["../../app/game-api/src/*"],
"@sammo-ts/gateway-api": ["../../app/gateway-api/src/index.ts"],
"@sammo-ts/gateway-api/*": ["../../app/gateway-api/src/*"]
}
},
"declaration": false,
"declarationMap": false
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.vue",
"test/**/*.ts",
"e2e/**/*.ts"
],
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "test/**/*.ts", "e2e/**/*.ts"],
"references": [
{
"path": "./tsconfig.node.json"
+5 -1
View File
@@ -3,7 +3,11 @@
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"composite": false
"composite": false,
"paths": {
"@sammo-ts/gateway-api": ["./src/index.ts"],
"@sammo-ts/gateway-api/*": ["./src/*"]
}
},
"include": ["src"]
}
@@ -152,6 +152,7 @@ const installGameFixture = async (page: Page, profile: ProfileFixture, userCnt:
}
if (operation === 'lobby.info') {
return response({
scenarioTitle: '공개 지도 테스트 시나리오',
year: 200,
month: profile.profile === 'che' ? 1 : 2,
userCnt,
@@ -448,8 +449,7 @@ test('renders the Gateway profile order returned by the API', async ({ page }, t
await page.setViewportSize({ width: 1200, height: 900 });
await page.goto('lobby');
const renderedProfiles = await page.locator('tbody tr td:first-child > div:first-child').allTextContents();
expect(renderedProfiles.map((name) => name.trim())).toEqual([
await expect(page.locator('tbody tr td:first-child > div:first-child')).toHaveText([
'체섭',
'퀘섭',
'풰섭',
+3 -3
View File
@@ -9,13 +9,13 @@
"test:e2e:operations": "playwright test --config e2e/playwright.config.mjs",
"test:e2e:hwe-lifecycle": "playwright test --config e2e/hwe-lifecycle.playwright.config.mjs",
"test:e2e:general-icons": "playwright test --config e2e/general-icon-lifecycle.playwright.config.mjs",
"build": "vue-tsc && vite build",
"build": "node ../../tools/vue-typecheck.mjs && vite build",
"build:release": "vite build",
"typecheck:release": "vue-tsc --noEmit",
"typecheck:release": "node ../../tools/vue-typecheck.mjs --noEmit",
"preview": "vite preview",
"lint": "pnpm -w lint:target app/gateway-frontend",
"lint:fix": "pnpm -w lint:target:fix app/gateway-frontend",
"typecheck": "vue-tsc --noEmit"
"typecheck": "node ../../tools/vue-typecheck.mjs --noEmit"
},
"dependencies": {
"@sammo-ts/common": "workspace:*",
+18 -53
View File
@@ -4,11 +4,7 @@
"target": "ESNext",
"useDefineForClassFields": true,
"module": "ESNext",
"lib": [
"ESNext",
"DOM",
"DOM.Iterable"
],
"lib": ["ESNext", "DOM", "DOM.Iterable"],
"skipLibCheck": true,
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
@@ -21,55 +17,24 @@
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"paths": {
"@/*": [
"./src/*"
],
"@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/*"
],
"@sammo-ts/game-engine": [
"../../app/game-engine/src/index.ts"
],
"@sammo-ts/game-engine/*": [
"../../app/game-engine/src/*"
],
"@sammo-ts/game-api": [
"../../app/game-api/src/index.ts"
],
"@sammo-ts/game-api/*": [
"../../app/game-api/src/*"
],
"@sammo-ts/gateway-api": [
"../../app/gateway-api/src/index.ts"
],
"@sammo-ts/gateway-api/*": [
"../../app/gateway-api/src/*"
]
}
"@/*": ["./src/*"],
"@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/*"],
"@sammo-ts/game-engine": ["../../app/game-engine/src/index.ts"],
"@sammo-ts/game-engine/*": ["../../app/game-engine/src/*"],
"@sammo-ts/game-api": ["../../app/game-api/src/index.ts"],
"@sammo-ts/game-api/*": ["../../app/game-api/src/*"],
"@sammo-ts/gateway-api": ["../../app/gateway-api/src/index.ts"],
"@sammo-ts/gateway-api/*": ["../../app/gateway-api/src/*"]
},
"declaration": false,
"declarationMap": false
},
"include": [
"src/**/*.ts",
"src/**/*.d.ts",
"src/**/*.tsx",
"src/**/*.vue",
"test/**/*.ts",
"e2e/**/*.ts"
],
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "test/**/*.ts", "e2e/**/*.ts"],
"references": [
{
"path": "./tsconfig.node.json"
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"rootDir": "src",
"outDir": "dist",
"composite": false,
"paths": {
"@sammo-ts/release-controller": ["./src/index.ts"],
"@sammo-ts/release-controller/*": ["./src/*"]
}
},
"include": ["src"]
}