refactor(storage): drop the service.mjs naming workaround (#71 handles it)#77
Merged
Merged
Conversation
commit: |
wmadden
approved these changes
Jul 15, 2026
…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>
6c7d390 to
b5e4ab3
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After #69 shipped, storage carried a per-module workaround (D5): it bundled its service file to
service.mjs(via a named tsdown entry keyedservice) so it matchedassemble()'s/^service\.m?js$/lookup. #71 fixed that lookup at the root —assemble()re-bundlesbuild.modulewith a named entry{ service }, so the wrapper is alwaysservice.mjswhatever 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 keyservice→storage-service, so the sourcestorage-service.tsbundles tostorage-service.mjs.storage-service.ts—build.module→./storage-service.mjs.package.json—./serviceexport →./storage-service.compose-prisma-cloud/tsdown.config.ts— the public re-emit follows.No functional change —
assemble()still produces theservice.mjs/main.mjswrapper.Guard the fix
assemble.test.tsonly ever built aservice.tsfixture, so nothing caught a regression of #71. Added a test that assembles a module file not namedservice.*and asserts the wrapper is produced. It fails withtsdown produced no service.jsunder the old positional entry, passes under the named-entry fix.Verification
pnpm buildgreen (24/24); storage emitsdist/storage-service.mjs, public emitsdist/storage/storage-service.mjs, no staleservice.mjs, every bundledbuild.moduleURL resolves.10 pass.assemble()against storage's real builtstorage-service.mjs— the exact deploy path — and confirmed it emits themain.mjswrapper whose default export has therunfunction the bootstrap calls. No cloud re-deploy needed to confirm.🤖 Generated with Claude Code