diff --git a/.vscode/launch.json b/.vscode/launch.json index 39394521d..2e2b1e7ce 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -19,7 +19,7 @@ "--loader", "ts-node/esm", "--experimental-specifier-resolution=node", - "${workspaceFolder}/src/server/Server.ts" + "${workspaceFolder}/packages/server/src/Server.ts" ], "env": { "GAME_ENV": "dev" diff --git a/Dockerfile b/Dockerfile index e5e01590e..4c6b312ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,19 +5,22 @@ WORKDIR /usr/src/app # Build stage - install ALL dependencies and build FROM base AS build ENV HUSKY=0 -# Copy package files first for better caching +# Copy package files first for better caching. The per-package package.json +# files are required for the workspace install, so packages/ must be present +# before `npm ci`. COPY package*.json ./ +COPY packages ./packages RUN --mount=type=cache,target=/root/.npm \ npm ci # Copy only what's needed for build COPY tsconfig.json ./ +COPY tsconfig.base.json ./ COPY vite.config.ts ./ COPY eslint.config.js ./ COPY index.html ./ COPY resources ./resources COPY proprietary ./proprietary -COPY src ./src ARG GIT_COMMIT=unknown ENV GIT_COMMIT="$GIT_COMMIT" @@ -28,6 +31,7 @@ FROM base AS prod-deps ENV HUSKY=0 ENV NPM_CONFIG_IGNORE_SCRIPTS=1 COPY package*.json ./ +COPY packages ./packages RUN --mount=type=cache,target=/root/.npm \ npm ci --omit=dev @@ -66,7 +70,8 @@ COPY resources ./resources # Remove maps because they are not used by the server. RUN rm -rf ./resources/maps COPY tsconfig.json ./ -COPY src ./src +COPY tsconfig.base.json ./ +COPY packages ./packages ARG GIT_COMMIT=unknown diff --git a/eslint.config.js b/eslint.config.js index 3168893d5..784b3acf4 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -13,7 +13,12 @@ const gitignorePath = path.resolve(__dirname, ".gitignore"); /** @type {import('eslint').Linter.Config[]} */ export default [ includeIgnoreFile(gitignorePath), - { ignores: ["src/server/gatekeeper/**", "tests/pathfinding/playground/**"] }, + { + ignores: [ + "packages/server/src/gatekeeper/**", + "tests/pathfinding/playground/**", + ], + }, { files: ["**/*.{js,mjs,cjs,ts}"] }, { languageOptions: { globals: { ...globals.browser, ...globals.node } } }, pluginJs.configs.recommended, diff --git a/index.html b/index.html index 4af07ad2d..c248ddfcf 100644 --- a/index.html +++ b/index.html @@ -440,7 +440,7 @@ src="https://static.cloudflareinsights.com/beacon.min.js" data-cf-beacon='{"token": "03d93e6fefb349c28ee69b408fa25a13"}' > - +