chore: build rolldown-plugin before tsdown to avoid install race#78
Open
sam-goodwin wants to merge 1 commit into
Open
chore: build rolldown-plugin before tsdown to avoid install race#78sam-goodwin wants to merge 1 commit into
sam-goodwin wants to merge 1 commit into
Conversation
… install race tsdown.config.ts imports @distilled.cloud/cloudflare-rolldown-plugin, which resolves to dist/plugin.js. When built via bun run --filter (as the alchemy repo's prepare script does), bun orders workspace scripts by dependencies but not devDependencies, so the runtime's build could start before the plugin's dist existed, failing config load with "Cannot find module .../dist/plugin.js". Build the plugin explicitly first; under turbo this is an incremental tsc no-op since ^build already ran. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
|
Install the packages built from this commit: @distilled.cloud/cloudflare-rolldown-plugin bun add https://pkg.distilled.cloud/cloudflare-rolldown-plugin/816e7e8@distilled.cloud/cloudflare-runtime bun add https://pkg.distilled.cloud/cloudflare-runtime/816e7e8@distilled.cloud/cloudflare-vite-plugin bun add https://pkg.distilled.cloud/cloudflare-vite-plugin/816e7e8 |
Collaborator
|
This seems like something that should be handled by turbo? Dev dependencies are still dependency-ordered for tasks unless turbo isn't running |
Contributor
Author
|
Might be an issue of git submodule in alchemy. I don't use turbo in alchemy |
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.
packages/cloudflare-runtime/tsdown.config.tsimports@distilled.cloud/cloudflare-rolldown-plugin, which resolves todist/plugin.js. When the workspace is built withbun run --filter(as the alchemy repo'spreparescript does onbun install), bun orders workspace scripts bydependenciesbut notdevDependencies— the plugin is only a devDependency of the runtime, so the runtime's build can start before the plugin'sdistexists:(Seen intermittently in alchemy's website.yml "Install dependencies" step, e.g. run 29860893544.
cloudflare-vite-plugindoesn't race because it lists the plugin as a regular dependency.)Fix: build the plugin explicitly before tsdown:
Under turbo this is an incremental
tscno-op since^buildalready built the plugin. Verified by deleting the plugin'sdist+.cacheand runningbun run --filter '@distilled.cloud/cloudflare-runtime' buildfrom the alchemy repo root — the plugin now builds first and the runtime build completes.🤖 Generated with Claude Code