fix(flows): let the local kit preflight find an installed relayflows - #97
Merged
Merged
Conversation
relayflows@2.0.15 publishes only a bin (no "main", no "exports"), so the
preflight's bare resolve("relayflows") threw MODULE_NOT_FOUND even after
step 2's install, blocking every local run with "relayflows is not
installed in this repository". Resolve relayflows/package.json instead,
which exists for any install.
The positive-control test passed only because its fake package declared
a "main" the real one does not; it now mirrors the published shape, and
fails against the old check.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 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. Comment |
Contributor
|
Preview deployed!
This is a Cloudflare Workers preview version of this PR's build. |
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.
Problem
The generated local kit's
relay-preflight.mjsblocked every run at START-HERE step 4 with:even after step 2's
npm install --save-dev relayflows@2.0.15 @relayflows/surface@2.0.15had run.relayflows@2.0.15publishes only a bin ({"bin":{"flows":"./bin/flows.js"},"type":"module"}, nomain, noexports), socreateRequire(...).resolve("relayflows")throwsMODULE_NOT_FOUNDfor every real install.Reproduced in a checkout of AgentWorkforce/relay: preflight failed while
npx flows check software-factory.flow.mtspassed from the same directory.Fix
web/lib/flow-local.ts: resolverelayflows/package.json, which exists for any install (and is resolvable because the package has noexportsmap).web/lib/test/flow-local.test.ts: the "passes once step 2 has run" positive control used a fake package with"main": "index.js", which is why it passed while real installs failed. The fake now mirrors the published shape (bin only).Verification
npx vitest run lib/test/flow-local.test.ts: 30/30 pass.resolve("relayflows")restored against the corrected fake,passes the same check once step 2 has run in that repositoryfails, so the test now catches this.Preconditions met. Starting the flow.in the relay checkout.🤖 Generated with Claude Code
Note
Low Risk
Localized change to local-kit preflight dependency detection and matching tests; no auth, data, or production runtime paths.
Overview
Fixes a false relayflows is not installed block in the local kit preflight after a real
npm installofrelayflows@2.0.15.The generated
relay-preflight.mjsnow checks install presence withcreateRequire(...).resolve("relayflows/package.json")instead ofresolve("relayflows"), because the published package is CLI-only (bin, nomain/exports) and the bare name never resolves.Tests were updated so the fake
node_modules/relayflowsmatches that published shape (bin entry only, no fakemain), and the positive preflight test asserts the new resolve string so the suite would catch regressions.Reviewed by Cursor Bugbot for commit abbbf43. Bugbot is set up for automated code reviews on this repo. Configure here.