From 82d76e982700515173529b37edd604a3c11b2efa Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Wed, 16 Sep 2026 21:33:13 +0200 Subject: [PATCH 1/2] Consistently use build/ directory for built code Rename the TypeScript output directory from transpiled/ to build/ across server, nodejs-instrumentation and @roostorg/coop-types, so every package emits to the same place. - server: outDir, both start scripts, Dockerfile, the e2e workflow, both jest configs, both eslint configs, the e2e fixture constant, and the three ignore files. Also adds rootDir so the layout under outDir is explicit rather than inferred from the common ancestor of the input files. - nodejs-instrumentation: outDir, clean script, Dockerfile, and the start:trace reference from server. Also drops a dead main (nothing resolves this package by name, and the image flattens build/ into /autoinstrumentation, so that path does not exist there) and marks the package private. - @roostorg/coop-types: outDir plus module, typings, files and exports. Consumer-invisible, because exports declares only ".", so deep imports into transpiled/ were never reachable. build/ was already ignored by .gitignore and .dockerignore, so this mostly removes the transpiled entries rather than adding new ones. Co-Authored-By: Claude Opus 5 (1M context) --- .dockerignore | 1 - .github/workflows/e2e.yaml | 2 +- .gitignore | 1 - Dockerfile | 2 +- nodejs-instrumentation/Dockerfile | 9 +++++---- nodejs-instrumentation/package.json | 4 ++-- nodejs-instrumentation/tsconfig.json | 2 +- server/.eslintrc.cjs | 2 +- server/.gitignore | 1 - server/e2e/fixtures/coop.ts | 20 ++++++++++---------- server/eslint.config.mjs | 2 +- server/jest.config.cjs | 2 +- server/jest.integ.config.cjs | 2 +- server/package.json | 4 ++-- server/tsconfig.json | 7 ++++++- types/.gitignore | 1 - types/package.json | 14 +++++++------- types/tsconfig.json | 4 ++-- 18 files changed, 41 insertions(+), 39 deletions(-) delete mode 100644 types/.gitignore diff --git a/.dockerignore b/.dockerignore index 1c07c0272..bfcccceef 100644 --- a/.dockerignore +++ b/.dockerignore @@ -18,6 +18,5 @@ coop.code-workspace server/coverage **/node_modules/ server/reports -**/transpiled/ models-service **/build diff --git a/.github/workflows/e2e.yaml b/.github/workflows/e2e.yaml index 71700bf24..2b894e43f 100644 --- a/.github/workflows/e2e.yaml +++ b/.github/workflows/e2e.yaml @@ -110,7 +110,7 @@ jobs: # Redirect output to files so the backgrounded processes don't hold this # step's stdout pipe open (which would hang the step). run: | - (cd server && node --env-file=.env transpiled/bin/www.js) > /tmp/server.log 2>&1 & + (cd server && node --env-file=.env build/bin/www.js) > /tmp/server.log 2>&1 & (cd client && npm start) > /tmp/client.log 2>&1 & # Wait (up to 120s) for the API (tcp 8080) and client (http 3000) to be # ready. A built-in shell loop avoids fetching an undeclared dependency diff --git a/.gitignore b/.gitignore index 905492c66..f5757353c 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,6 @@ yarn-error.log* db/build .idea/ -transpiled build/ .eslintcache *.tsbuildinfo diff --git a/Dockerfile b/Dockerfile index 4296e2853..393a51116 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ WORKDIR /app RUN apt-get update && apt-get install -y --no-install-recommends dumb-init && rm -rf /var/lib/apt/lists/* COPY --from=build_backend ["/app/package.json", "/app/package-lock.json", "./"] RUN npm ci --omit=dev -COPY --from=build_backend /app/transpiled ./ +COPY --from=build_backend /app/build ./ # See https://github.com/Yelp/dumb-init ENTRYPOINT ["/usr/bin/dumb-init", "--"] diff --git a/nodejs-instrumentation/Dockerfile b/nodejs-instrumentation/Dockerfile index 4744ca684..46d91c5fe 100644 --- a/nodejs-instrumentation/Dockerfile +++ b/nodejs-instrumentation/Dockerfile @@ -11,9 +11,9 @@ # used and must be availabe in the image. FROM node:24.21.0 AS build -WORKDIR /operator-build +WORKDIR /autoinstrumentation -COPY package*.json . +COPY ["package.json", "package-lock.json", "./"] RUN --mount=type=cache,target=/root/.npm npm ci --prefer-offline @@ -25,8 +25,9 @@ RUN npm prune --omit=dev FROM busybox:1.38.0 -COPY --from=build /operator-build/node_modules /autoinstrumentation/node_modules -COPY --from=build /operator-build/transpiled/ /autoinstrumentation +COPY --from=build /autoinstrumentation/node_modules /autoinstrumentation/node_modules +COPY --from=build /autoinstrumentation/build/ /autoinstrumentation +COPY --from=build /autoinstrumentation/package*.json /autoinstrumentation/ RUN chmod -R go+r /autoinstrumentation diff --git a/nodejs-instrumentation/package.json b/nodejs-instrumentation/package.json index 68601bee5..2ab2ce8d5 100644 --- a/nodejs-instrumentation/package.json +++ b/nodejs-instrumentation/package.json @@ -2,10 +2,10 @@ "name": "nodejs-instrumentation", "version": "1.1.0", "description": "", - "main": "transpiled/autoinstrumentation.js", + "private": true, "scripts": { "build": "tsc", - "clean": "rm -rf transpiled *.tsbuildinfo" + "clean": "rm -rf build *.tsbuildinfo" }, "author": "Roostorg", "license": "ISC", diff --git a/nodejs-instrumentation/tsconfig.json b/nodejs-instrumentation/tsconfig.json index ffbf8b5a3..541e31179 100644 --- a/nodejs-instrumentation/tsconfig.json +++ b/nodejs-instrumentation/tsconfig.json @@ -5,7 +5,7 @@ "moduleResolution": "NodeNext", "lib": ["ES2022"], "rootDir": "src", - "outDir": "transpiled", + "outDir": "build", "composite": true, "declaration": true, "declarationMap": true, diff --git a/server/.eslintrc.cjs b/server/.eslintrc.cjs index 1e7230047..15ec558b3 100644 --- a/server/.eslintrc.cjs +++ b/server/.eslintrc.cjs @@ -392,7 +392,7 @@ module.exports = { '*.d.ts', '.eslintrc.cjs', '.eslintformat.js', - 'transpiled/', + 'build/', 'coverage/', ], plugins: [ diff --git a/server/.gitignore b/server/.gitignore index bb3551c5d..95abdac5f 100644 --- a/server/.gitignore +++ b/server/.gitignore @@ -1,7 +1,6 @@ node_modules/ build/ .eslintcache -transpiled/ reports # Playwright e2e artifacts diff --git a/server/e2e/fixtures/coop.ts b/server/e2e/fixtures/coop.ts index 05e017850..091a8f1db 100644 --- a/server/e2e/fixtures/coop.ts +++ b/server/e2e/fixtures/coop.ts @@ -7,14 +7,14 @@ import { jsonStringify } from '../../utils/encoding.js'; export { jsonStringify }; /** - * Server runtime is loaded from the COMPILED output (`transpiled/`), not the TS + * Server runtime is loaded from the COMPILED output (`build/`), not the TS * source, so we have to do some ugly type casting here. */ -const TRANSPILED = '../../transpiled'; +const BUILD_DIR = '../../build'; async function importIocContainer() { return (await import( - `${TRANSPILED}/iocContainer/index.js` + `${BUILD_DIR}/iocContainer/index.js` )) as typeof import('../../iocContainer/index.js'); } @@ -28,27 +28,27 @@ async function importSeedHelpers() { createMrtQueue, itemSubmissionQueue, ] = await Promise.all([ - import(`${TRANSPILED}/test/fixtureHelpers/createOrg.js`) as Promise< + import(`${BUILD_DIR}/test/fixtureHelpers/createOrg.js`) as Promise< typeof import('../../test/fixtureHelpers/createOrg.js') >, - import(`${TRANSPILED}/services/userManagementService/index.js`) as Promise< + import(`${BUILD_DIR}/services/userManagementService/index.js`) as Promise< typeof import('../../services/userManagementService/index.js') >, import( - `${TRANSPILED}/graphql/datasources/userKyselyPersistence.js` + `${BUILD_DIR}/graphql/datasources/userKyselyPersistence.js` ) as Promise< typeof import('../../graphql/datasources/userKyselyPersistence.js') >, - import(`${TRANSPILED}/graphql/datasources/rolePersistence.js`) as Promise< + import(`${BUILD_DIR}/graphql/datasources/rolePersistence.js`) as Promise< typeof import('../../graphql/datasources/rolePersistence.js') >, - import(`${TRANSPILED}/test/fixtureHelpers/createRule.js`) as Promise< + import(`${BUILD_DIR}/test/fixtureHelpers/createRule.js`) as Promise< typeof import('../../test/fixtureHelpers/createRule.js') >, - import(`${TRANSPILED}/test/fixtureHelpers/createMrtQueue.js`) as Promise< + import(`${BUILD_DIR}/test/fixtureHelpers/createMrtQueue.js`) as Promise< typeof import('../../test/fixtureHelpers/createMrtQueue.js') >, - import(`${TRANSPILED}/queues/itemSubmissionQueue.js`) as Promise< + import(`${BUILD_DIR}/queues/itemSubmissionQueue.js`) as Promise< typeof import('../../queues/itemSubmissionQueue.js') >, ]); diff --git a/server/eslint.config.mjs b/server/eslint.config.mjs index 5b9b389e2..afac0b84b 100644 --- a/server/eslint.config.mjs +++ b/server/eslint.config.mjs @@ -29,7 +29,7 @@ export default [ 'eslint.config.mjs', '.eslintrc.cjs', '.eslintformat.js', - 'transpiled/**', + 'build/**', 'coverage/**', 'lib/cache/**', ], diff --git a/server/jest.config.cjs b/server/jest.config.cjs index b1f40228b..89b766db9 100644 --- a/server/jest.config.cjs +++ b/server/jest.config.cjs @@ -122,7 +122,7 @@ module.exports = { // `/e2e/` holds Playwright specs (their own runner); never run them under jest. testPathIgnorePatterns: [ '/node_modules/', - '/transpiled/', + '/build/', '/e2e/', '.integ.test.ts$', ], diff --git a/server/jest.integ.config.cjs b/server/jest.integ.config.cjs index a4a617094..1dec74c93 100644 --- a/server/jest.integ.config.cjs +++ b/server/jest.integ.config.cjs @@ -121,7 +121,7 @@ module.exports = { // An array of regexp pattern strings that are matched against all test paths, matched tests are skipped // We ignore integration tests here, as they should only be run explicitly. // `/e2e/` holds Playwright specs (their own runner); never run them under jest. - testPathIgnorePatterns: ['/node_modules/', '/transpiled/', '/e2e/'], + testPathIgnorePatterns: ['/node_modules/', '/build/', '/e2e/'], // This option allows the use of a custom results processor // testResultsProcessor: undefined, diff --git a/server/package.json b/server/package.json index c7f96508b..ad1ac839b 100644 --- a/server/package.json +++ b/server/package.json @@ -5,8 +5,8 @@ "type": "module", "scripts": { "build": "tsc", - "start": "tsc-watch --onSuccess \"node --trace-warnings --env-file-if-exists=.env ./transpiled/bin/www.js\"", - "start:trace": "tsc-watch --onSuccess \"node --trace-warnings --env-file-if-exists=.env --require ../nodejs-instrumentation/transpiled/autoinstrumentation.js ./transpiled/bin/www.js\"", + "start": "tsc-watch --onSuccess \"node --trace-warnings --env-file-if-exists=.env ./build/bin/www.js\"", + "start:trace": "tsc-watch --onSuccess \"node --trace-warnings --env-file-if-exists=.env --require ../nodejs-instrumentation/build/autoinstrumentation.js ./build/bin/www.js\"", "test": "npm run test:local", "test:local": "NODE_OPTIONS=\"--no-warnings --loader ts-node/esm\" node --env-file-if-exists=.env node_modules/.bin/jest --watch --detectOpenHandles", "test:prepush": "NODE_OPTIONS=\"--no-warnings --loader ts-node/esm\" node --env-file-if-exists=.env node_modules/.bin/jest --detectOpenHandles --no-cache --forceExit", diff --git a/server/tsconfig.json b/server/tsconfig.json index 248ae4fc0..594969d53 100644 --- a/server/tsconfig.json +++ b/server/tsconfig.json @@ -7,7 +7,12 @@ "ES2022", "DOM" /* needed for s3 sdk, which references dom readablestream */ ], - "outDir": "./transpiled", + "outDir": "./build", + // Pin the source root so the layout under `outDir` is explicit rather than + // inferred from the common ancestor of the input files (which shifts if a + // file is ever added outside the current root). Also required once + // `package.json` `imports` entries are resolved against `outDir`. + "rootDir": ".", "declaration": false, "strict": true, "esModuleInterop": true, diff --git a/types/.gitignore b/types/.gitignore deleted file mode 100644 index 8ddf9676d..000000000 --- a/types/.gitignore +++ /dev/null @@ -1 +0,0 @@ -transpiled/ diff --git a/types/package.json b/types/package.json index 946bfc1f1..15170c58b 100644 --- a/types/package.json +++ b/types/package.json @@ -3,12 +3,12 @@ "type": "module", "version": "2.4.0", "description": "Shared TypeScript types for Coop: schema primitives, signal data maps, and integration contracts.", - "module": "transpiled/index.js", - "typings": "./transpiled/index.d.ts", + "module": "build/index.js", + "typings": "./build/index.d.ts", "scripts": { "build": "tsc", "prepublishOnly": "npm run build", - "test": "npm run build && node --test transpiled/test_scripts/" + "test": "npm run build && node --test build/test_scripts/" }, "repository": { "type": "git", @@ -17,9 +17,9 @@ }, "author": "Roostorg", "files": [ - "transpiled" + "build" ], - "license": "ISC", + "license": "Apache-2.0", "devDependencies": { "@types/node": "^20.3.1", "typescript": "^4.9.3" @@ -29,8 +29,8 @@ }, "exports": { ".": { - "import": "./transpiled/index.js", - "types": "./transpiled/index.d.ts" + "import": "./build/index.js", + "types": "./build/index.d.ts" } }, "dependencies": { diff --git a/types/tsconfig.json b/types/tsconfig.json index 4aea0cae4..49e9a210f 100644 --- a/types/tsconfig.json +++ b/types/tsconfig.json @@ -4,7 +4,7 @@ "module": "NodeNext", "moduleResolution": "NodeNext", "lib": ["ES2022"], - "outDir": "./transpiled", + "outDir": "./build", "declaration": true, "strict": true, "esModuleInterop": true, @@ -18,5 +18,5 @@ "typeRoots": ["./node_modules/@types"] }, "include": ["./**/*.ts", "./**/*.cts", "./**/*.mts"], - "exclude": ["node_modules", "package.json", "package-lock.json", "transpiled"] + "exclude": ["node_modules", "package.json", "package-lock.json", "build"] } From 8a19a84ab3e181691dd66b947b44f6c664e78ae2 Mon Sep 17 00:00:00 2001 From: Emelia Smith Date: Wed, 16 Sep 2026 22:18:56 +0200 Subject: [PATCH 2/2] Fix package.json license field to align with repository LICENSE --- client/package-lock.json | 2 +- client/package.json | 2 +- db/package-lock.json | 2 +- db/package.json | 2 +- migrator/package-lock.json | 2 +- migrator/package.json | 2 +- nodejs-instrumentation/package-lock.json | 2 +- nodejs-instrumentation/package.json | 2 +- server/package-lock.json | 2 +- server/package.json | 2 +- types/package-lock.json | 2 +- 11 files changed, 11 insertions(+), 11 deletions(-) diff --git a/client/package-lock.json b/client/package-lock.json index 67e362b06..fc5465272 100644 --- a/client/package-lock.json +++ b/client/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "client", "version": "1.0.0", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@apollo/client": "^3.14.1", "@googlemaps/js-api-loader": "^1.16.10", diff --git a/client/package.json b/client/package.json index e0a1d312f..1ab0cf49c 100644 --- a/client/package.json +++ b/client/package.json @@ -16,7 +16,7 @@ "knip": "knip" }, "author": "Roostorg", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@apollo/client": "^3.14.1", "@googlemaps/js-api-loader": "^1.16.10", diff --git a/db/package-lock.json b/db/package-lock.json index 891df581a..8cb9121b5 100644 --- a/db/package-lock.json +++ b/db/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "coop-data-migrator", "version": "1.0.0", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@clickhouse/client": "^1.23.1", "@roostorg/db-migrator": "^1.1.1", diff --git a/db/package.json b/db/package.json index 39fb9b7c8..b44e94ce6 100644 --- a/db/package.json +++ b/db/package.json @@ -16,7 +16,7 @@ "knip": "knip" }, "author": "Roostorg", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@clickhouse/client": "^1.23.1", "@roostorg/db-migrator": "^1.1.1", diff --git a/migrator/package-lock.json b/migrator/package-lock.json index 781e0a43f..f09b01d69 100644 --- a/migrator/package-lock.json +++ b/migrator/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "@roostorg/db-migrator", "version": "1.1.1", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@total-typescript/ts-reset": "^0.6.1", "cassandra-driver": "^4.8.0", diff --git a/migrator/package.json b/migrator/package.json index 45c5481de..1906cf8d2 100644 --- a/migrator/package.json +++ b/migrator/package.json @@ -23,7 +23,7 @@ "directory": "migrator" }, "author": "Roostorg", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@total-typescript/ts-reset": "^0.6.1", "cassandra-driver": "^4.8.0", diff --git a/nodejs-instrumentation/package-lock.json b/nodejs-instrumentation/package-lock.json index 026805b6f..b1614bb65 100644 --- a/nodejs-instrumentation/package-lock.json +++ b/nodejs-instrumentation/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "nodejs-instrumentation", "version": "1.1.0", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.9.0", "@opentelemetry/auto-instrumentations-node": "^0.80.0", diff --git a/nodejs-instrumentation/package.json b/nodejs-instrumentation/package.json index 2ab2ce8d5..bab9e1551 100644 --- a/nodejs-instrumentation/package.json +++ b/nodejs-instrumentation/package.json @@ -8,7 +8,7 @@ "clean": "rm -rf build *.tsbuildinfo" }, "author": "Roostorg", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@opentelemetry/api": "^1.9.0", "@opentelemetry/auto-instrumentations-node": "^0.80.0", diff --git a/server/package-lock.json b/server/package-lock.json index a91b2a854..2ec9fb01a 100644 --- a/server/package-lock.json +++ b/server/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "server", "version": "1.0.0", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@apollo/server": "^5.5.0", "@as-integrations/express5": "^1.1.2", diff --git a/server/package.json b/server/package.json index ad1ac839b..c8aae2025 100644 --- a/server/package.json +++ b/server/package.json @@ -25,7 +25,7 @@ "knip": "knip" }, "author": "Roostorg", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "@apollo/server": "^5.5.0", "@as-integrations/express5": "^1.1.2", diff --git a/types/package-lock.json b/types/package-lock.json index 457f16680..19e0416c0 100644 --- a/types/package-lock.json +++ b/types/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "@roostorg/coop-types", "version": "2.4.0", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "date-fns": "^2.29.3", "type-fest": "^4.3.2"