fix(scripts): ship generate-* shims at package root for tsx drop-in#168
Open
tlgimenes wants to merge 1 commit into
Open
fix(scripts): ship generate-* shims at package root for tsx drop-in#168tlgimenes wants to merge 1 commit into
tlgimenes wants to merge 1 commit into
Conversation
Existing storefronts run `tsx node_modules/@decocms/start/scripts/generate-X.ts`
from their package.json build script. 5.1.1 only shipped `dist/scripts/*.cjs`,
breaking the path. Move the generator sources to `scripts/_impl/` (build-only)
and ship 5 thin tsx shims at `scripts/generate-{blocks,sections,loaders,schema,invoke}.ts`
that createRequire the bundled CJS. Verified end-to-end against a fake consumer
layout.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
dist/scripts/*.cjs, so existing sites runningtsx node_modules/@decocms/start/scripts/generate-X.tsfrom their build script throwERR_MODULE_NOT_FOUND. This restores drop-in compatibility with the 5.0.x build command.scripts/_impl/(build-only); 5 thin shims now live atscripts/generate-{blocks,sections,loaders,schema,invoke}.tsand `createRequire` the bundleddist/scripts/*.cjs. `tsup.config.ts` switched to named entries so output paths stay at `dist/scripts/.cjs`, and `package.json` `files` ships the 5 shim files.Test plan
🤖 Generated with Claude Code
Summary by cubic
Restores drop-in
tsxexecution of generator scripts fromnode_modules/@decocms/start/scripts/generate-*.tsby shipping thin shims at the package root. FixesERR_MODULE_NOT_FOUNDintroduced in 5.1.1 while keeping outputs atdist/scripts/*.cjs.scripts/generate-{blocks,sections,loaders,schema,invoke}.tsthatcreateRequirethe bundled CJS, matching 5.0.x commands liketsx node_modules/@decocms/start/scripts/generate-blocks.ts.scripts/_impl/and switchtsupto named entries so outputs staydist/scripts/<name>.cjs; include the shims inpackage.json#filesfor publish.Written for commit c30af54. Summary will update on new commits.