Repository navigation
[experimental] render: the missing-package refusal offers no install line that would install in the wrong place - #12429
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approval waits on an engineering owner's decision, and one fix is needed.
- The note shown when lockfiles disagree names their folder relative to the page instead of the folder render runs from, so rendering
src/app/page.tsxfrom a project root that holdspnpm-lock.yamlandpackage-lock.jsonsays "the lockfiles in ../.. disagree" (packages/cli/api/render/_adapter.mjs:431passes the page's folder toinstallStepFor); name the folder from the run folder and add a test with a page in a subfolder.
What must be settled: no current record yet states which install line astryx experimental render suggests inside a project, since spec:AST-048 FR17-FR19 cover only template.copy and build, so an engineering owner needs to confirm that render follows those clauses (including no command when lockfiles disagree, and the CLI's own version ranges such as recharts@"^3.10.1") or name the rule it should follow, by commenting /approve-spec <full head SHA> or adding a record clause; the author may record it as an engineering owner. The outside-a-project change matches spec:AST-081 FR3, and its tests fail before the change and pass after it. Two small points: the changeset and the error description could mention the version ranges, and the test title at render.test.mjs:2536 still says "with one install line" although the test now expects none.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Description: the refusal always suggested
npm install, also in pnpm, Yarn and Bun projects and outside any package.json: verified (the changed tests fail on the base withnpm install ...). - Description:
templateandbuildalready pick the project's package manager and print no install outside a package.json: verified (template-needs.mjs:383-403). - Description: inside a project the suggestion is one line for every missing package in the project's package manager, by the rule
templateandbuilduse: verified for pnpm, npm, Yarn and Bun; false when lockfiles disagree, where render printsnpm installwith a note andtemplateandbuildprint no command. - Description: outside a package.json the message says to install in the project that uses the page, with no suggestion: verified (
render.test.mjs:2551-2553). - Description: the suggestion rests on
spec:AST-048FR17: that clause coverstemplate.copyandbuildonly; an owner decision is open. - Description: an install outside a package.json would make the folder a project, which
spec:AST-081FR3 rules out: verified; render answers outside a project as in a new project. - Description: the command is experimental: verified.
- Description: tests show the pnpm, npm and no-package.json results: verified (
render.test.mjs:2107-2125,:2536-2604). - Description: no new public API, default or interaction model, and no internal context: verified.
- Description: the stated test command, typecheck, ESLint and the knowledge check pass: verified on the head (481 tests).
- Changeset: the install line uses the project's package manager, as
templateandbuilddo, where it always saidnpm install: verified, except when lockfiles disagree. - Changeset: outside a package.json the message names the project that uses the page and suggests no install: verified.
.changeset/render-missing-package-advice.md: clear; does not mention the version ranges.packages/cli/api/render/_adapter.mjs: blocking finding (lockfile folder at line 431).packages/cli/api/render/render.doc.mjs: clear; consistent with the adapter apart from the version ranges.packages/cli/api/render/render.test.mjs: clear; stale test title at line 2536.
PR Analysis Report🔎 Preview ·
|
|
Owner decision (engineering owner, covering this pull request): inside a project, the missing-package suggestion of |
|
/approve-spec dccfce8 |
There was a problem hiding this comment.
Changes requested: one fix remains before approval.
- Newly live check: a page whose nearest
package.jsonis not the one of the folderrenderruns from gets an install line (decided atpackages/cli/api/render/_adapter.mjs:434) that, run as printed, adds the packages to the run folder's package instead of the page's, as the test atpackages/cli/api/render/render.test.mjs:2107shows by renderingpnpm-app/page.tsxfrom its parent package and expectingpnpm add …, whichspec:AST-048FR18 (now adopted for render) rules out; print a line that installs into the page's package from the run folder (for examplepnpm --dir pnpm-app add …) or none with that folder named, and pin it with a test rendered from each side.
The owner decision settles which rule render follows, and the earlier lockfile-folder issue is fixed: disagreeing lockfiles now get no command and a reason that names their folder from the run folder. The outside-a-project, package-manager and disagreeing-lockfiles results are each covered by tests that fail before the change and pass after it.
Claims and files checked
Review mode: incremental; reason: none
- Description: the refusal always suggested
npm install, also in pnpm, Yarn and Bun projects and outside anypackage.json: verified (the seven changed or new tests fail on the base). - Description:
templateandbuildalready pick the project's package manager and print no install outside apackage.json: verified (template-needs.mjs:385-405). - Description: in a project the suggestion is one line for every missing package, in the project's package manager with the CLI's version ranges, by the rule
templateandbuilduse: verified for pnpm, npm, Yarn, Bun andrecharts@"^3.10.1"; for a page outside the run folder's package the line installs into the wrong package (finding above). - Description: disagreeing lockfiles give no line, and the message names their folder from the run folder and the lockfiles: verified (
render.test.mjs:2128-2148). - Description: outside a
package.jsonthe message says to install in the project that uses the page, with no suggestion: verified (render.test.mjs:2555-2620). - Description: the expected behavior is the build-recommendation record's install clauses, with the outside-a-project case resting on the global-mode record, and an owner decision is needed for
render: verified; that decision is now recorded for this head. - Description: the command is experimental: verified.
- Description: the change touches the render adapter, the shared install helper, the error description and a changeset: verified (plus the tests).
- Description: the tests show the pnpm, npm, outside-a-project and nested disagreeing-lockfiles results: verified.
- Description: no new public API, default or interaction model, and no internal context: verified.
- Description: the stated test command, typecheck, ESLint and the knowledge check pass: verified on the head (482 tests passed).
- Changeset: the line uses the project's package manager and the CLI's version ranges, as
templateandbuilddo, where it always saidnpm install: verified, except for a page outside the run folder's package. - Changeset: when lockfiles disagree the message says so and suggests none: verified.
- Changeset: outside a
package.jsonthe message says to install in the project that uses the page and suggests no install: verified. .changeset/render-missing-package-advice.md: clear.packages/cli/api/render/_adapter.mjs: finding above (line 434).packages/cli/api/render/render.doc.mjs: clear; matches the adapter.packages/cli/api/render/render.test.mjs: the test at line 2107 pins the line of the finding; the rest clear.packages/cli/foundation/discovery/template-needs.mjs: clear; the other callers keep two arguments, so their output is unchanged.
|
/approve-spec aa07056 |
There was a problem hiding this comment.
Approved pending CI: the CI run found no room under its ceiling and was cancelled, so typecheck, the node tests and the build have not run on this head yet; re-run the CI jobs so they do.
The missing-package refusal of astryx experimental render now suggests one install in the page project's package manager with the CLI's version ranges, and for a page in another package than the folder render runs from it names that package and the line to run there, so it no longer prints a line that would install into the wrong package. The new and changed refusal tests fail on the base and pass on this head, and the earlier finding is fixed.
Claims and files checked
Review mode: incremental; reason: none
- changed rules (0): none
- Claim, release note: the suggested install uses the project's package manager and the CLI's version ranges, as
astryx templateandastryx builddo, where it always saidnpm install: verified (packages/cli/api/render/_adapter.mjs:435-441,render.test.mjs:2107, head checks for Yarn, Bun and arechartsrange). - Claim, release note: when the project's lockfiles disagree, the message says so and suggests none: verified (
render.test.mjs:2140). - Claim, release note: for a page in another package than the run folder, the message names that package and the line to run there: verified (
_adapter.mjs:442-447,render.test.mjs:2121). - Claim, release note: in a folder that no
package.jsonholds, the message says to install in the project that uses the page, with no install: verified (_adapter.mjs:426-430,render.test.mjs:2567-2635). - Claim, description: the line comes through the rule
templateandbuilduse, and the lockfile folder is named from where the render runs: verified (template-needs.mjs:294,:310,render.test.mjs:2140). - Claim, description:
installCommandFortakes the folder its reason names others from, and the error description is updated: verified (template-needs.mjs:294,render.doc.mjs:100). - Claim, description: the listed tests, the typecheck, ESLint on the changed files and the knowledge check pass: verified (re-run on this head).
- Claim, description: no new public API, and no internal context in public text: verified (no export, command, option or error code changes; no such text in the added lines).
- File
.changeset/render-missing-package-advice.md: clear. - File
packages/cli/api/render/_adapter.mjs: clear. - File
packages/cli/api/render/render.doc.mjs: clear. - File
packages/cli/api/render/render.test.mjs: clear. - File
packages/cli/foundation/discovery/template-needs.mjs: clear.
…l-command rule, with the page's package named when it is not the run folder's Rebased onto main as one commit after the integration install guidance landed: the guidance still comes first, then the command the render named. Otherwise the line is installCommandFor's, as template and build give it (the project's package manager, the CLI's version ranges, none when lockfiles disagree); outside a project the message names the project to install in; for a page in another package than the run folder's, the message names that package and the line to run there.
aa07056 to
2f9dca5
Compare
|
/approve-spec 2f9dca5 |
There was a problem hiding this comment.
Changes requested: the code changes are owner-decided and tested, but the pull request's text credits it with a change the base already has.
- Regression: the title, description and changeset say the refusal moves from a fixed
npm installto the project's package manager with the CLI's version ranges, but since the integration install-guidance change landed onmainthe base already printspnpm add,yarn add,bun addornpm installwith those ranges (this pull request's own pnpm and npm test cases pass on the base), so please describe only what changes here: no install line when the lockfiles disagree or nopackage.jsonholds the page, and the page's package named when it is not the run folder's.
Editing the changeset makes a new commit, so an engineering owner's /approve-spec for that new head is needed again.
Claims and files checked
Review mode: full; reason: history
- Claim: the refusal now uses the project's package manager and the CLI's ranges instead of a fixed
npm install(title, description, changeset): false, the base already does this. - Claim: integration install guidance still comes first: verified in
_adapter.mjs. - Claim: disagreeing lockfiles give no install line and a message naming the folder and its lockfiles: verified, the new test fails on the base and passes here.
- Claim: a page in another package than the run folder's gets a message naming that package and the line to run there: verified by test and a workspace-root check.
- Claim: a folder with no
package.jsongets no install line and is told to install in the project that uses the page: verified, five tests fail on the base and pass here. - Claim: the shared install helper names the lockfile folder from the run folder: verified.
- Claim: the pnpm and npm cases in the evidence: true, but they already pass on the base.
- Claim: no new public API and no internal context: verified.
- File
.changeset/render-missing-package-advice.md: finding above. - File
packages/cli/api/render/_adapter.mjs: clear. - File
packages/cli/api/render/render.doc.mjs: clear. - File
packages/cli/api/render/render.test.mjs: clear. - File
packages/cli/foundation/discovery/template-needs.mjs: clear.
|
/approve-spec e8cbe60 |
There was a problem hiding this comment.
Changes requested: the earlier wording fix landed, but the new title and the changeset's opening sentence claim more than the code does.
- The title and
.changeset/render-missing-package-advice.mdsay no install line is offered where running it would install in the wrong place, but when the folder you run from loads an integration that declaresinstallGuidance, that integration's line is still the suggestion for a page in another package (packages/cli/api/render/_adapter.mjs:427and:431-432), so please either say that this line still comes first from the folder you run from, or put it through the same page-package check as the package-manager line (:446) with a test (the changeset's sentence about a page in another package has the same gap, which the last review missed).
Any fix makes a new commit, so an engineering owner's /approve-spec for that new head is needed again.
Claims and files checked
Review mode: incremental; reason: none
- Changed rules since the last review: none.
- Claim: the refusal offers no install line that would install in the wrong place (title, changeset): false for a loaded integration's line from the folder you run from.
- Claim: the page's own package decides the package manager: verified.
- Claim: with disagreeing lockfiles the message names them and suggests no install, where it used to suggest
npm install: verified, the test fails on the base and passes here. - Claim: a page in another package gets a message naming that package and the line to run there: verified without integration guidance, false with it.
- Claim: a folder no
package.jsonholds gets no install and is told to install in the project that uses the page: verified, five tests fail on the base and pass here. - Claim: on the base the line came from the run folder's install step, with
npm installand a note for disagreeing lockfiles: verified. - Claim: an integration's own line still comes first (description): verified.
- Claim: the shared install helper names the lockfile folder from the run folder: verified.
- Claim: the listed tests and test command: verified, they pass on this head.
- Claim: no new public API and no internal context: verified.
- File
.changeset/render-missing-package-advice.md: finding above. - File
packages/cli/api/render/_adapter.mjs: clear; the integration branch is unchanged from the base. - File
packages/cli/api/render/render.doc.mjs: clear. - File
packages/cli/api/render/render.test.mjs: clear. - File
packages/cli/foundation/discovery/template-needs.mjs: clear.
…a page in the run folder's package For a page in another package, that line would add the packages to the run folder's project, so the message names the page's package and the line from the page's own package instead.
|
/approve-spec 1096982 |
There was a problem hiding this comment.
Approved pending CI: the remaining test-node shards had not finished on this head when this review was written.
The refusal now gates both the package-manager line and the run folder's integration line on the page's own package, and each changed outcome is pinned by a test that fails on the base and passes here.
- Non-blocking: the
ERR_RENDER_MISSING_DEPENDENCYdescription inpackages/cli/api/render/render.doc.mjssays the suggestion is a package-manager line with the CLI's ranges and none when lockfiles disagree, but when a loaded integration declaresinstallGuidancethe suggestion is that integration's line; consider adding "or the line a loaded integration gives for adding packages".
Claims and files checked
Review mode: incremental; reason: none
- Changeset: the suggested line follows the page's own package: verified (
_adapter.mjs:445). - Changeset: no line is offered where running it would install in the wrong place: verified (
_adapter.mjs:431-454;render.test.mjs:2108,:2140). - Changeset: the page's package decides the package manager: verified (
_adapter.mjs:445). - Changeset: with disagreeing lockfiles the message names them and suggests no install, where it suggested
npm install: verified (render.test.mjs:2173, which fails on the base). - Changeset: for a page in another package the message names that package and the line to run there: verified (
render.test.mjs:2108,:2140). - Changeset: in a folder no
package.jsonholds, the message points to the project that uses the page and suggests no install: verified (render.test.mjs:2600-2667). - Description: the base's wrong-place lines (
npm installwith disagreeing lockfiles, an install in a folder with nopackage.json, the run folder's package for another package's page): verified by the base code and the head's tests failing on the base. - Description: the run folder's integration line comes first only for a page in the run folder's package: verified (
_adapter.mjs:432,render.test.mjs:2108). - Description: otherwise the page's package decides the line, with the CLI's ranges, through the rule
templateandbuilduse: verified (template-needs.mjs:297). - Description: disagreeing lockfiles get no line, and the message names their folder from where the render runs: verified (
template-needs.mjs:316,render.test.mjs:2173). - Description: a page in another package gets no suggestion and a message naming its package and line: verified (
_adapter.mjs:449-454). - Description: a folder no
package.jsonholds gets a message and no suggestion: verified (_adapter.mjs:437-441). - Description: the files listed under the smallest restoration and the test evidence bullets: verified against the diff and the test file.
- Description: no new public API: verified (no export, command, option or response field changes).
- Description: the listed test command, ESLint and typecheck pass: verified (486 tests pass here, ESLint is clean on the changed files, typecheck is green in CI); the knowledge check was not rerun, as no record changes.
- File
.changeset/render-missing-package-advice.md: clear. - File
packages/cli/api/render/_adapter.mjs: clear. - File
packages/cli/api/render/render.doc.mjs: the non-blocking note above. - File
packages/cli/api/render/render.test.mjs: clear. - File
packages/cli/foundation/discovery/template-needs.mjs: clear.
| {code: 'ERR_RENDER_COMPILE', when: 'the page does not compile, or a stylesheet it imports is not valid CSS (the message names the file)'}, | ||
| {code: 'ERR_RENDER_NO_DEFAULT_EXPORT', when: 'the page has no default export'}, | ||
| {code: 'ERR_RENDER_MISSING_DEPENDENCY', when: "the page imports a package that is not installed (the suggestion is the install line), or the esbuild the CLI depends on is missing from its install"}, | ||
| {code: 'ERR_RENDER_MISSING_DEPENDENCY', when: "the page imports a package that is not installed (the suggestion is one install line for every such package, in the project's package manager and with the CLI's version ranges (such as `recharts@\"^3.10.1\"`), and none when the project's lockfiles disagree, which the message then says; for a page in another package than the folder the render runs from, the message names that package and the line to run there; in a folder that no package.json holds, the message says to install them in the project that uses the page, with no install line), or the esbuild the CLI depends on is missing from its install"}, |
There was a problem hiding this comment.
Non-blocking: for a page in the run folder's package whose loaded integration declares installGuidance, the suggestion is that integration's line with bare names (acme add not-real-a-xyz in the test at render.test.mjs:2108), also when the lockfiles disagree (_adapter.mjs:432-434). This description says the suggestion is a package-manager line with the CLI's ranges and none when the lockfiles disagree. Consider adding "or the line a loaded integration gives for adding packages" after "one install line for every such package".
User impact
When a page imports packages that are not installed,
astryx experimental renderrefuses it and suggests an install line in the package manager of the folder the render runs from. That line could install in the wrong place: when the project's lockfiles disagree it still saidnpm install; in a folder that nopackage.jsonholds, running it would make the folder a project; and for a page in another package than the run folder, it added the packages to the run folder'spackage.json, not the page's.Problem and solution fit
npm installwith a note, rather than from the page's own package with the ruleastryx templateandastryx buildfollow.npm installin a pnpm project writes a second lockfile, in a scratch folder it makes a project there, and in the wrong package it leaves the page's import missing.When the run folder's integrations give their own line for adding packages, that line still comes first for a page in the run folder's package, then a command the render named; for a page in another package it is not offered, since it would add the packages to the run folder's project. Otherwise the page's own package decides the line, with the CLI's version ranges, through the rule
templateandbuilduse. When its lockfiles disagree, there is no install line, and the message names the folder, from where the render runs, and its lockfiles. For a page in another package than the folder the render runs from, the message names the page's package and the line to run there, with no suggestion (spec:AST-048FR18). In a folder that nopackage.jsonholds, the message says to install them in the project that uses the page, and suggests no install.Expected behavior and authority
spec:AST-048FR17–FR19 (one install command, in the project's package manager, none when the package manager is ambiguous, and none in a folder nopackage.jsonholds, since an install would make it a project,spec:AST-081FR3). No record yet saysrenderfollows them; this change asks for that owner decision.astryx experimental renderis experimental (spec:AST-017FR27).Smallest restoration
api/render/_adapter.mjs: the refusal's suggestion and message.foundation/discovery/template-needs.mjs:installCommandFortakes the folder its reason names others from.api/render/render.doc.mjs: the error's description.Evidence
api/render/render.test.mjs: a page in a pnpm project getspnpm add not-real-a-xyz not-real-b-xyz, one in an npm projectnpm install not-real-a-xyz; a page in a folder nopackage.jsonholds gets "… which are not installed. Install them in the project that uses this page." and no suggestion; a page in a subfolder of a project whose lockfiles disagree gets no suggestion, and the message names the lockfiles' folder (.) from where the render runs; a page in a pnpm package rendered from that package getspnpm add …, and rendered from the package above gets no suggestion, with a message namingpnpm-appand the line to run there. With an integration line declared for the run folder, a page there gets that line, and a page in another package gets no suggestion and a message with that package's own line.Scope
Testing
pnpm exec vitest run --project node packages/cli/api/render packages/cli/foundation/render packages/cli/foundation/doc-compiler/doc-loads.test.mjs packages/cli/test/lazy-dependencies.test.mjs packages/cli/foundation/discovery/template-needs.test.mjs.pnpm check:knowledge.