Skip to content

refactor(storage): drop the service.mjs naming workaround (#71 handles it)#77

Merged
wmadden-electric merged 1 commit into
mainfrom
claude/storage-service-naming-c7e9ae
Jul 15, 2026
Merged

refactor(storage): drop the service.mjs naming workaround (#71 handles it)#77
wmadden-electric merged 1 commit into
mainfrom
claude/storage-service-naming-c7e9ae

Conversation

@wmadden-electric

Copy link
Copy Markdown
Contributor

After #69 shipped, storage carried a per-module workaround (D5): it bundled its service file to service.mjs (via a named tsdown entry keyed service) so it matched assemble()'s /^service\.m?js$/ lookup. #71 fixed that lookup at the root — assemble() re-bundles build.module with a named entry { service }, so the wrapper is always service.mjs whatever the source file is called. The workaround is now redundant.

What this does

Revert storage to the plain convention every other module uses (cron ships scheduler-service.mjs):

  • tsdown.config.ts — entry key servicestorage-service, so the source storage-service.ts bundles to storage-service.mjs.
  • storage-service.tsbuild.module./storage-service.mjs.
  • package.json./service export → ./storage-service.
  • compose-prisma-cloud/tsdown.config.ts — the public re-emit follows.

No functional change — assemble() still produces the service.mjs/main.mjs wrapper.

Guard the fix

assemble.test.ts only ever built a service.ts fixture, so nothing caught a regression of #71. Added a test that assembles a module file not named service.* and asserts the wrapper is produced. It fails with tsdown produced no service.js under the old positional entry, passes under the named-entry fix.

Verification

  • Full topological pnpm build green (24/24); storage emits dist/storage-service.mjs, public emits dist/storage/storage-service.mjs, no stale service.mjs, every bundled build.module URL resolves.
  • Typecheck (storage + public) and tests green; node package 10 pass.
  • Ran assemble() against storage's real built storage-service.mjs — the exact deploy path — and confirmed it emits the main.mjs wrapper whose default export has the run function the bootstrap calls. No cloud re-deploy needed to confirm.

🤖 Generated with Claude Code

@pkg-pr-new

pkg-pr-new Bot commented Jul 15, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@prisma/compose@77
npm i https://pkg.pr.new/@prisma/compose-prisma-cloud@77

commit: 6c7d390

…s it)

D5 made storage bundle its service file to `service.mjs` (via a named
tsdown entry keyed `service`) so it matched assemble()'s
/^service\.m?js$/ lookup. #71 fixed that lookup at the root: assemble()
re-bundles build.module with a named entry `{ service }`, so the wrapper
is always the same whatever the source file is called. The per-module
workaround is now redundant.

Revert storage to the plain convention every other module uses (cron
ships `scheduler-service.mjs`): source `storage-service.ts` bundles to
`storage-service.mjs`, build.module points at `./storage-service.mjs`,
and the public re-emit + package export follow. No functional change —
assemble() still produces the wrapper.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@wmadden-electric wmadden-electric force-pushed the claude/storage-service-naming-c7e9ae branch from 6c7d390 to b5e4ab3 Compare July 15, 2026 14:55
@wmadden-electric wmadden-electric merged commit c39779b into main Jul 15, 2026
11 checks passed
@wmadden-electric wmadden-electric deleted the claude/storage-service-naming-c7e9ae branch July 15, 2026 14:56
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