Skip to content

Consistently use build/ directory for built code - #1231

Open
ThisIsMissEm wants to merge 2 commits into
mainfrom
emelia/use-build-directory
Open

ThisIsMissEm wants to merge 2 commits into
mainfrom
emelia/use-build-directory

Conversation

@ThisIsMissEm

@ThisIsMissEm ThisIsMissEm commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Context & Requests for Reviewers

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.

This is a precursor to being able to use import maps, and normally just how the build output of tsc is structured.

Changes:

  • 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.

I also caught a few cases where the package.json license was set to ISC despite the entire project being Apache-2.0

There will be a follow up PR that makes the server/build/ hermetic, such that the package.json is inside the build/ directory in the docker image, which allows import maps to fully work.

Tests

Full suite run, and passed. Also worked with the container to ensure it started up correctly.

(Optional) Rollout Plan

n/a

Checklist

Only check items that apply to this PR; leave the rest unchecked.

  • If you changed anything user-facing (i.e. user interface or APIs):
    Did you update related docs?

  • If the change is notable (refer to Keep a Changelog conventions):
    Did you update CHANGELOG.md?

  • If you changed db/src/scripts/** and used CREATE TABLE, ADD COLUMN, or ALTER COLUMN:
    Are as many columns marked NOT NULL as possible? If some columns can sometimes be null depending on other columns, are there CHECK constraints capturing those relationships, and are these also reflected using unions in the associated Kysely types?

  • If you added a new signal in server/services/signalsService/signals/**:
    Did you classify every error case as a permanent error (SignalPermanentError, no retry) or a normal error (retryable)? Any case where the signal can't determine a score should be a SignalPermanentError.

Summary by CodeRabbit

  • Build and Deployment

    • Standardized compiled application and package output under the build directory.
    • Updated container images, server startup commands, and automated end-to-end workflows to use the new build output.
    • Improved packaging so generated artifacts and required package metadata are included where needed.
  • Package Updates

    • Updated package exports, entry points, and build test paths to reference the new output structure.
    • Updated package licensing to Apache-2.0.
    • Marked the instrumentation package as private.

@ThisIsMissEm
ThisIsMissEm requested a review from a team as a code owner September 16, 2026 20:10
@coderabbitai

coderabbitai Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: ef35da9e-0df6-4440-9b3f-a6f786740fad

📥 Commits

Reviewing files that changed from the base of the PR and between 6433e39 and 8a19a84.

⛔ Files ignored due to path filters (6)
  • client/package-lock.json is excluded by !**/package-lock.json
  • db/package-lock.json is excluded by !**/package-lock.json
  • migrator/package-lock.json is excluded by !**/package-lock.json
  • nodejs-instrumentation/package-lock.json is excluded by !**/package-lock.json
  • server/package-lock.json is excluded by !**/package-lock.json
  • types/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (21)
  • .dockerignore
  • .github/workflows/e2e.yaml
  • .gitignore
  • Dockerfile
  • client/package.json
  • db/package.json
  • migrator/package.json
  • nodejs-instrumentation/Dockerfile
  • nodejs-instrumentation/package.json
  • nodejs-instrumentation/tsconfig.json
  • server/.eslintrc.cjs
  • server/.gitignore
  • server/e2e/fixtures/coop.ts
  • server/eslint.config.mjs
  • server/jest.config.cjs
  • server/jest.integ.config.cjs
  • server/package.json
  • server/tsconfig.json
  • types/.gitignore
  • types/package.json
  • types/tsconfig.json
💤 Files with no reviewable changes (4)
  • .gitignore
  • .dockerignore
  • server/.gitignore
  • types/.gitignore
🚧 Files skipped from review as they are similar to previous changes (4)
  • server/.eslintrc.cjs
  • nodejs-instrumentation/tsconfig.json
  • client/package.json
  • db/package.json

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The project changes compiled output paths from transpiled to build across TypeScript configuration, package metadata, runtime commands, Dockerfiles, E2E fixtures, and development tooling.

Changes

Build output directory migration

Layer / File(s) Summary
Compiled output and package contracts
nodejs-instrumentation/tsconfig.json, nodejs-instrumentation/package.json, server/tsconfig.json, types/tsconfig.json, types/package.json, client/package.json, db/package.json, migrator/package.json
TypeScript output, package entry points, exports, test paths, published files, package privacy, and package licenses now use the updated configuration. The server configuration adds rootDir: ".".
Runtime and container paths
Dockerfile, nodejs-instrumentation/Dockerfile, server/package.json, .github/workflows/e2e.yaml, server/e2e/fixtures/coop.ts
Docker copies, server startup commands, E2E startup, instrumentation loading, and dynamic imports now reference build. The instrumentation image uses /autoinstrumentation paths and copies package manifests into the final image.
Tooling and ignore rules
.dockerignore, .gitignore, server/.gitignore, types/.gitignore, server/.eslintrc.cjs, server/eslint.config.mjs, server/jest.config.cjs, server/jest.integ.config.cjs
Ignore and test discovery rules now target build or no longer ignore transpiled. The Docker build context no longer excludes transpiled.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~15 minutes

Change: Refactor

Suggested reviewers: juanmrad

Merge Risk: ⚪ Minimal · up to 8a19a

The build-output migration is internally consistent across runtime, packaging, container, and workflow paths.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. (12 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: replacing the transpiled output directory with the build directory across the project.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 5 files. (12 skipped: 12 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

We've triggered an ultrareview automatically — This cross-cutting build-output rename touches Dockerfiles, CI, tsconfig/jest/eslint configs, and package exports across three packages, so a missed reference or a subtle rootDir/outDir interaction could break builds and production deploys; a deep multi-pass review is worth it.. I'll post findings when complete.

An ultrareview is cubic's deepest review, catching hard-to-find bugs in the most critical PRs. It runs a longer, multi-pass analysis using cubic's most capable review models, and typically takes around 30 minutes. It consumes your team's reviewed-lines allowance at 3× the standard rate.

Automated ultrareviews are disabled by default. We triggered this run as part of your trial. Want cubic to do this for every high-risk PR? Enable auto-ultrareview in your settings.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ultrareview completed in 2m 21s

All reported issues were addressed across 18 files

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread types/package.json

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 11 files (changes from recent commits).

Reply with feedback, questions, or to request a fix.

Fix all with cubic | Re-trigger cubic

Comment thread migrator/package.json
Comment thread db/package.json
Comment thread client/package.json
@ThisIsMissEm
ThisIsMissEm added this pull request to stack #1236 September 16, 2026 22:26
@ThisIsMissEm

Copy link
Copy Markdown
Contributor Author

@cubic-dev-ai all the license changes were in accordance with the LICENSE at the root of the repository, so the old ISC license was actually incorrect.

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 16, 2026

Copy link
Copy Markdown
Contributor

@cubic-dev-ai all the license changes were in accordance with the LICENSE at the root of the repository, so the old ISC license was actually incorrect.

@ThisIsMissEm You’re right—the license changes are correct if the repository’s root LICENSE is authoritative. The existing ISC values were inconsistent metadata, so updating the package manifests and lockfiles to Apache-2.0 is appropriate. I withdraw any concern about those changes.

Tip: get faster answers by chatting with cubic’s review copilot in the review UI

@ThisIsMissEm
ThisIsMissEm force-pushed the emelia/use-build-directory branch from 0054be4 to 6433e39 Compare September 17, 2026 03:48
ThisIsMissEm and others added 2 commits September 17, 2026 18:11
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) <noreply@anthropic.com>
@ThisIsMissEm
ThisIsMissEm force-pushed the emelia/use-build-directory branch from 6433e39 to 8a19a84 Compare September 17, 2026 16:11

@juanmrad juanmrad left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. one minor comment.

Comment thread types/package.json
@@ -3,12 +3,12 @@
"type": "module",
"version": "2.4.0",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we should bump the version given the change.

@ThisIsMissEm ThisIsMissEm Sep 20, 2026 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't sure how version is happening for the package, hence leaving it. Normally I use release tooling that handles versioning automatically. What would we define the version bump as? major, minor or patch?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

patch I would guess 🤔 it does change license and exports, but may be ok.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants