Repository navigation
[experimental] export --reverse: use the project's own copy of an aliased file, or restore the page's copy with its paths entry - #12322
josephfarina wants to merge 3 commits into
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.
An engineering owner needs to decide the new alias handling before this can be approved, and two defects need fixing.
- Owner decision: no current record decides how
experimental render --reversehandles an alias target outside the new folder (reuse a byte-identical project file, restore a differing one withpathsadvice, find a target by path suffix when the file has no alias record) or the four new experimentalRenderAliasedfields; an engineering owner records that decision by commenting/approve-spec <full head SHA>on this pull request (the author may do so as an engineering owner), or names the governing clause. - A reused alias file's relative imports are never compared (
packages/cli/api/render/_adapter.mjs:912-916), so when a helper it imports changed in the project, the restored page silently renders the changed helper, the answer still saysexact: true, and the carried helper is written where nothing imports it. - The
pathsentry printed in thedifferscase (_adapter.mjs:637-640,render.mjs:136-149) applies to the whole project, so pasting it makes every other file that imports that name, such as another page, build against the restored page's old copy, and the text, type doc and render guide do not say so.
For the first defect, reuse a file only when every file it reaches by relative imports also matches the project, else restore it as differs, and add that case to the round-trip test; for the second, state the project-wide effect or advise a relative import instead.
Claims and files checked
Review mode: full; reason: no-earlier-review
Claims:
- Reverse gives back an aliased page whose alias leads outside the new folder instead of refusing it: verified (the four alias tests fail against the base code, which refuses these pages, and pass on the head).
- A byte-identical project file is used and its copy not written: verified for that file (
_adapter.mjs:912-916); its relative imports are not compared (defect 1). - Render, reverse, edit and render again work in the page's own project: verified by the round-trip test; an edited dependency changes the page silently (defect 1).
- A differing or missing file comes back in the page's layout inside the new folder, never into an existing folder: verified (
_adapter.mjs:917,:934-944;render.test.mjs:688-701). - The answer names the project's file and the
pathsentry that leads the import to the copy: verified (render.test.mjs:728-764); the entry's project-wide effect is not stated (defect 2). - A file with no alias record gets the same
pathsentry from the carried file the import ends with: verified (embedded-imports.mjs:504-505;render.test.mjs:766-789). configandpathsappear only whenimportsis not empty: verified (_adapter.mjs:926-933).- The base refused these pages, so the round trip broke after one pass: verified (the same tests fail against the base code).
- A reverse never writes into an existing folder: verified (
_adapter.mjs:934-944). - A restored page never uses a different file without saying so: false (defect 1).
- Maintainers decided this direction: no record states it (owner decision above).
- A frozen canary sweep passes every case after and none before: not verifiable, as the harness is not in the pull request.
- The two earlier refusal tests now check the new behaviour and two tests are added: verified.
- The command is experimental: verified (experimental namespace,
@experimentaltype, experimental patch changeset). - The listed test command: the two render test files pass at the head (178 tests).
Files:
.changeset/render-reverse-alias-in-project.md: clear (claims above).packages/cli/api/render/_adapter.mjs: defects 1 and 2.packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear; it lacks the changed-dependency case (defect 1).packages/cli/api/render/render.type.mjs: four experimental fields wait on the owner decision; thediffersdoc omits the project-wide effect (defect 2).packages/cli/assets/docs/tree/render-pages.doc.mjs: omits the project-wide effect (defect 2).packages/cli/clients/cli/commands/experimental/render.mjs: defect 2.packages/cli/foundation/render/embedded-imports.mjs: clear.
There was a problem hiding this comment.
An engineering owner needs to decide the new alias handling before this can be approved, and the two defects from the last review still need fixing; the new commit adds a test but changes neither.
- Owner decision: no current record decides how
experimental render --reversehandles an alias target outside the new folder (reuse a byte-identical project file, restore a differing one withpathsadvice, find a target by path suffix when the file has no alias record) or the four new experimentalRenderAliasedfields, so an engineering owner names the governing clause or records the decision by commenting/approve-spec <full head SHA>on this pull request (the author may do so as an engineering owner). - A reused alias file's relative imports are never compared (
packages/cli/api/render/_adapter.mjs:912-916), so when a helper it imports changed in the project, the restored page silently renders the changed helper, the answer still saysexact: true, and the carried helper is written where nothing imports it. - The
pathsentry printed in thedifferscase (_adapter.mjs:637-640,render.mjs:136-149) applies to the whole project, so pasting it makes every other file that imports that name build against the restored page's old copy, and neither the CLI text, the type doc nor the render guide says so.
For the first, reuse a file only when every carried file it reaches by relative imports also matches the project, else restore it as differs, and add that case to the round-trip test; for the second, state the project-wide effect or advise a relative import instead.
Claims and files checked
Review mode: incremental; reason: none
changed rules (0): none
Claims:
- Reverse gives back an aliased page whose alias leads outside the new folder instead of refusing it: verified (the alias tests at this head; the base refused these pages with a path-traversal error).
- A byte-identical project file is used and its copy is not written: verified for that file (
_adapter.mjs:912-916); its relative imports are not compared (defect 1). - Render, reverse, edit and render again work in the page's own project, again and again: verified by
render.test.mjs:728-764; a changed dependency of a reused file changes the page silently (defect 1). - A differing or missing file comes back in the page's own layout inside the new folder, never into an existing folder: verified (
_adapter.mjs:917,:934-948;render.test.mjs:688-701). - The answer names the file the alias reaches today and the
pathsentry that leads the import to the copy: verified (render.test.mjs:766-808); the entry's project-wide effect is not stated (defect 2). - A file with no alias record gets the same
pathsentry from the carried file the import's path ends with: verified (embedded-imports.mjs:504-505;render.test.mjs:810-833). aliased.configandaliased.pathsappear only whenaliased.importsis not empty: verified (_adapter.mjs:926-933).- A reverse never writes into an existing folder: verified (
_adapter.mjs:934-948). - A restored page never uses a different file without saying so: false (defect 1).
- The maintainers decided this direction: no current record states it (owner decision above).
- A frozen set of canary round trips passes every case after and none before: not verifiable, as its harness is not in the pull request.
- The two earlier refusal tests now check the new behaviour and two named tests are added: verified; a third test, that no tsconfig.json is edited, is also added.
- The command is experimental: verified (experimental namespace,
@experimentaltype, experimental patch changeset). - The listed test command passes at this head: verified.
Files:
.changeset/render-reverse-alias-in-project.md: clear (claims above).packages/cli/api/render/_adapter.mjs: defects 1 and 2.packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear; it lacks the changed-dependency case (defect 1).packages/cli/api/render/render.type.mjs: four experimental fields wait on the owner decision; thediffersdoc omits the project-wide effect (defect 2).packages/cli/assets/docs/tree/render-pages.doc.mjs: omits the project-wide effect (defect 2).packages/cli/clients/cli/commands/experimental/render.mjs: defect 2.packages/cli/foundation/render/embedded-imports.mjs: clear.
a5344d0 to
ec2b3e2
Compare
PR Analysis Report🔎 Preview ·
|
| Package | Where | Signature | Usage | |
|---|---|---|---|---|
| + | cli |
./api/experimental · Types · type RenderAliased |
differs?: { import: string; project: string; exists: boolean; file: string; changed?: string[]; projectWide: true; instead: { file: string; import: string }[] }[] | undefined |
import type {RenderAliased} from '@astryxdesign/cli/api/experimental'; const x: RenderAliased = {differs: …} |
| + | cli |
./api/experimental · Types · type RenderAliased |
sameAsProject?: { import: string; file: string }[] | undefined |
import type {RenderAliased} from '@astryxdesign/cli/api/experimental'; const x: RenderAliased = {sameAsProject: …} |
| ~ | cli |
./api/experimental · Types · type RenderAliased |
config: string → config?: string | undefined |
import type {RenderAliased} from '@astryxdesign/cli/api/experimental'; const x: RenderAliased = {config: …} |
| ~ | cli |
./api/experimental · Types · type RenderAliased |
paths: Record<string, string[]> → paths?: Record<string, string[]> | undefined |
import type {RenderAliased} from '@astryxdesign/cli/api/experimental'; const x: RenderAliased = {paths: …} |
Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.
Generated by PR Enrichment workflow | View full report
There was a problem hiding this comment.
An engineering owner needs to decide the new alias handling before this can be approved, and two defects need fixing; the latest push rebases the same two commits and changes neither.
- Owner decision: no current record decides how
experimental render --reversehandles an alias target outside the new folder (reuse a byte-identical project file, restore a differing or missing one withpathsadvice, find a target by path suffix when the file has no alias record) or the four new experimentalRenderAliasedfields, so an engineering owner names the governing clause or records the decision by commenting/approve-spec <full head SHA>on this pull request (the author may do so as an engineering owner). - A reused alias file's relative imports are never compared (
packages/cli/api/render/_adapter.mjs:912-916), so when a file it imports changed in the project, the restored page silently renders the changed file, the answer still saysexact: true, and the carried copy is written where nothing imports it. - The
pathsentry printed in thedifferscase (_adapter.mjs:637-640,render.mjs:136-146) applies to the whole project, so pasting it makes every other file that imports that name build against the restored page's old copy, and neither the CLI text, the type doc nor the render guide says so.
For the first, reuse a file only when every carried file it reaches through relative imports also matches the project, else restore it as differs, and add that case to the round-trip test; for the second, state the project-wide effect or advise a relative import instead.
Claims and files checked
Review mode: full; reason: rebase
Claims:
- Reverse gives back an aliased page whose alias leads outside the new folder instead of refusing it: verified (
render.test.mjs:367-379,:728-764; the base refused these pages with a path-traversal error). - Before this change the round trip worked once and then broke: verified from the base, which refused every alias target outside the new folder.
- A byte-identical project file is used and its copy is not written: verified for that file (
_adapter.mjs:912-916); its relative imports are not compared (defect 1). - Render, reverse, edit and render again work in the page's own project, again and again: verified by
render.test.mjs:728-764; a changed dependency of a reused file changes the page silently (defect 1). - A differing or missing file comes back in the page's own layout inside the new folder, never into an existing folder: verified (
_adapter.mjs:917,:934-948;render.test.mjs:688-701). - The answer names the file the alias reaches today and the
pathsentry that leads the import to the copy: verified (render.test.mjs:766-808); the entry's project-wide effect is not stated (defect 2). - A file with no alias record gets the same
pathsentry from the one carried file the import's path ends with: verified (embedded-imports.mjs:329-337,:504-505;render.test.mjs:810-833). aliased.configandaliased.pathsappear only whenaliased.importsis not empty: verified (_adapter.mjs:926-933).- A reverse never writes into an existing folder: verified (
_adapter.mjs:934-948). - A restored page never uses a different file without saying so: false (defect 1).
- The maintainers decided this direction: no current record states it (owner decision above).
- A frozen set of canary round trips passes every case after the change and none before: not verifiable, as its harness is not in the pull request.
- The two earlier refusal tests now check the new behaviour and two named tests are added: verified; a third test, that no tsconfig.json is edited, is also added.
- The command is experimental and no new public API is hidden under the fix: verified (experimental namespace,
@experimentaltype,[experimental]patch changeset that names the four fields), with those fields waiting on the owner decision. - The listed test command passes: verified (307 passed, 3 skipped).
Files:
.changeset/render-reverse-alias-in-project.md: clear (claims above).packages/cli/api/render/_adapter.mjs: defects 1 and 2.packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear; it lacks the changed-dependency case (defect 1).packages/cli/api/render/render.type.mjs: four experimental fields wait on the owner decision; thediffersdoc omits the project-wide effect (defect 2).packages/cli/assets/docs/tree/render-pages.doc.mjs: omits the project-wide effect (defect 2).packages/cli/clients/cli/commands/experimental/render.mjs: defect 2.packages/cli/foundation/render/embedded-imports.mjs: clear.
|
Owner decision (engineering owner, covering this pull request): |
|
/approve-spec 31041e4 |
There was a problem hiding this comment.
An engineering owner needs to decide the new alias handling before this can be approved, and two new defects need fixing; the two defects from the last review are fixed.
- Owner decision: no current record decides how
experimental render --reversehandles an alias target outside the new folder (use a matching project file, restore a differing one withpathsand relative-import advice, find a target by path suffix when the file has no alias record) or the four experimentalRenderAliasedfields, so an engineering owner names the governing clause or records the decision by commenting/approve-spec <full head SHA>on this pull request (the author may do so as an engineering owner). reachableFilesnow takes areusedoption that its JSDoc options type (packages/cli/foundation/render/embedded-imports.mjs:285) does not declare, so the CLI's declaration build fails with TS2353 and TS2339 and CI's typecheck, build-storybook, docsite-build and test-ui (1/4) jobs fail on it.insteadkeeps only the page and files reached by a relative import (packages/cli/api/render/_adapter.mjs:967-968), so when a restored copy imports another differing file through the alias, that import gets no relative-import advice and following "change only the restored page" silently renders the project's changed file.
Add reused?: Set<string> to the options type; build instead from every restored copy that makes the import, and add the chained case (the page imports Header, Header imports Icon, both through the alias) to the round-trip test.
Claims and files checked
Review mode: incremental; reason: none
Claims:
- Reverse gives back an aliased page whose alias leads outside the new folder instead of refusing it: verified (
render.test.mjs:367-379,:728-817; the base refused these pages with a path-traversal error). - Before this change the round trip worked once and then broke: verified from the base, which refused every alias target outside the new folder.
- A project file with the page's bytes, and every carried file it imports, is used and their copies are not written: verified (
_adapter.mjs:888-916;render.test.mjs:728-817). - Render, reverse, edit and render again work in the page's own project, again and again: verified (
render.test.mjs:728-817). - A differing or missing file comes back in the page's own layout inside the new folder, never into an existing folder: verified (
_adapter.mjs:959-961,:991-1001;render.test.mjs:688-701). - The answer names the file the alias reaches today, any file below it that differs, and the
pathsentry: verified (render.test.mjs:789-806,:819-869). - The answer says the entry applies to the whole project: verified (
render.mjs:140). - The answer gives the relative import of the copy for each restored file that makes the import: false for a restored copy reached through the alias (defect 2).
- A file with no alias record gets the same
pathsentry from the one carried file the import's path ends with: verified (embedded-imports.mjs:333-341,:518-519;render.test.mjs:871-894). aliased.configandaliased.pathsappear only whenaliased.importsis not empty: verified (_adapter.mjs:983-990).- A restored page never uses a different file without saying so: holds for the reverse's own answer; following its narrower advice can (defect 2).
- The maintainers decided this direction: no current record states it (owner decision above).
- A frozen set of canary round trips passes every case after the change and none before: not verifiable, as its harness is not in the pull request.
- The two earlier refusal tests now check the new behaviour and two named tests are added: verified; a third test, that no tsconfig.json is edited, is also added.
- The command is experimental and no new public API is hidden under the fix: verified (experimental namespace,
@experimentaltype,[experimental]patch changeset that names the fields), with those fields waiting on the owner decision. - The listed test command passes: verified (307 passed, 3 skipped); the declaration build fails (defect 1).
Files:
.changeset/render-reverse-alias-in-project.md: theinsteadsentence is false (defect 2); the rest verified.packages/cli/api/render/_adapter.mjs: defect 2.packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear; it lacks the chained alias case (defect 2).packages/cli/api/render/render.type.mjs: four experimental fields wait on the owner decision; thediffersdoc'sinsteadsentence (defect 2).packages/cli/assets/docs/tree/render-pages.doc.mjs: theinsteadsentence (defect 2).packages/cli/clients/cli/commands/experimental/render.mjs: clear.packages/cli/foundation/render/embedded-imports.mjs: defect 1.
|
/approve-spec c37e5a7 |
There was a problem hiding this comment.
Changes requested: an engineering owner's decision on this pull request now settles the alias direction, and two gaps against it need fixing.
insteadkeeps only the page and files reached by a relative import (packages/cli/api/render/_adapter.mjs:967-968), so when a restored copy imports another differing file through the alias, that import gets no relative-import advice and following "change only the restored page" silently renders the project's changed file.- Miss: when the project does not have the aliased file, the CLI prints a
pathsentry that reaches the whole project without saying so and without the relative import the JSON'sinsteadalready holds (packages/cli/clients/cli/commands/experimental/render.mjs:139-144), although the changeset says the answer for a target that "differs or is not there" says the entry applies to the whole project and gives the narrower fix.
Build instead from every restored copy that makes the import and add the chained case (the page imports Header, Header imports Icon, both through the alias) to the round-trip test; for a missing file, print instead and the project-wide note too, or narrow the changeset's sentence. The declaration-build failure from the last review is fixed.
Claims and files checked
Review mode: incremental; reason: none
Claims:
- Before this change a reverse refused an aliased page whose alias leads outside the new folder, so the round trip broke after one pass: verified (the base's path-traversal refusal; the rewritten tests at
render.test.mjs:367-379and:674-726). - A byte-identical project file is used and its copy not written: verified, and stricter, since every carried file it reaches must match too (
_adapter.mjs:893-916;render.test.mjs:728-817). - Render, reverse, edit and render again work in the page's own project, again and again: verified (
render.test.mjs:728-817). - A differing or missing file comes back in the page's own layout inside the new folder, never into an existing folder: verified (
_adapter.mjs:959-961,:991-1001;render.test.mjs:674-726). - The answer names the file the alias reaches today, any differing file below it, and the
pathsentry: verified (render.test.mjs:728-869). - The answer says the entry applies to the whole project: false for a missing project file (second finding).
- The answer gives the relative import of the copy for each restored file that makes the import: false for a restored copy reached through the alias (first finding).
- A file with no alias record gets the same
pathsentry from the one carried file its import names: verified (embedded-imports.mjs:334-341,:519;render.test.mjs:871-894). aliased.configandaliased.pathsappear only whenaliased.importsis not empty: verified (_adapter.mjs:983-990).- The maintainers decided never to write into an existing folder or let a restored page use a different file unannounced: an engineering owner's decision on this pull request states it; the first finding shows the relative-import advice can still lead there.
- The command and its result type are experimental: verified (experimental namespace,
[experimental]patch changeset). - The named tests exist and pass, and the two refusal tests now check the new behaviour: verified (the render and render-foundation suites pass).
- 272 of 272 round trips across published canaries: not checkable; that corpus is not in the repository.
- No new public API hidden under a bug-fix label, and no internal context in public text: verified; the
RenderAliasedchange is declared in the title and changeset.
Files:
.changeset/render-reverse-alias-in-project.md: two false sentences (both findings).packages/cli/api/render/_adapter.mjs: first finding (:967-968); noprojectWidefor a missing file (:977, second finding).packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear; the chained case is missing (first finding).packages/cli/api/render/render.type.mjs: thediffersdoc repeats the first finding's claim.packages/cli/assets/docs/tree/render-pages.doc.mjs: the guide repeats the first finding's claim.packages/cli/clients/cli/commands/experimental/render.mjs: second finding (:139-144).packages/cli/foundation/render/embedded-imports.mjs: clear; thereusedoption is now typed.
|
/approve-spec 8d8b04a |
There was a problem hiding this comment.
Changes requested: one duplicated helper needs to call the existing one. The two gaps from the last review are fixed, and an engineering owner's decision, approved for this head, settles the alias direction.
- Miss:
relativeImportinpackages/cli/api/render/_adapter.mjs:979-982reimplementsrelativeSpecifierBetweenfrompackages/cli/api/swizzle/_moduleGraph.mjs:897-903(the two already differ on.d.tsfiles), so call that helper, or move it to a shared module both commands import, and delete the copy.
The CI run for this head was cancelled before its jobs ran because CI was full, so re-run it with the fix.
Claims and files checked
Review mode: incremental; reason: none
Claims:
- Before this change a reverse refused an aliased page whose alias leads outside the new folder, so the round trip broke after one pass: verified (the removed refusal in
_adapter.mjs; the rewritten tests atrender.test.mjs:367-379and:685-701). - When the aliased file and every carried file it imports match the project's, the page uses the project's files and their copies are not written: verified (
_adapter.mjs:888-916,:958-961;render.test.mjs:728-817). - Render, reverse, edit and render again work in the page's own project, again and again: verified (
render.test.mjs:728-817). - A differing or missing file comes back in the page's own layout inside the new folder, never into an existing folder: verified (
_adapter.mjs:962-964,:1000-1010;render.test.mjs:685-701,:819-889). - The answer names the file the alias reaches today, any differing file below it, and the
pathsentry: verified (render.test.mjs:785-806,:819-889). - The answer says the entry applies to the whole project: verified for a differing, changed-below and missing file (
render.mjs:136-140;render.test.mjs:864-889). - The answer gives the relative import of the copy for each restored file that makes the import: verified, chains of restored copies included (
_adapter.mjs:975-989;render.test.mjs:819-863). - A file with no alias record gets the same
pathsentry from the one carried file its import names: verified (embedded-imports.mjs:333-341,:518-519;render.test.mjs:944-967). aliased.configandaliased.pathsappear only whenaliased.importsis not empty: verified (_adapter.mjs:992-999).- The maintainers decided never to write into an existing folder or let a restored page use a different file unannounced: an engineering owner's decision on this pull request states it, and the tests above hold it.
- The command and its result type are experimental, released as an experimental patch: verified (experimental namespace;
[experimental]patch changeset). - The named tests exist and pass, and the earlier refusal tests now check the new behaviour: verified (the render and render-foundation suites pass).
- 272 of 272 round trips across published canaries: not checkable; that corpus is not in the repository.
- No new public API hidden under a bug-fix label, and no internal context in public text: verified; the
RenderAliasedchange is declared in the title and changeset.
Files:
.changeset/render-reverse-alias-in-project.md: clear.packages/cli/api/render/_adapter.mjs: the duplicated helper (:979-982).packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear.packages/cli/api/render/render.type.mjs: clear.packages/cli/assets/docs/tree/render-pages.doc.mjs: clear.packages/cli/clients/cli/commands/experimental/render.mjs: clear.packages/cli/foundation/render/embedded-imports.mjs: clear.
|
/approve-spec c51b01d |
There was a problem hiding this comment.
Approved pending CI: CI has not run its full checks on this head yet, because the run was turned away when CI was full, so re-run all jobs before merging.
The duplicated relative-import helper from the last review now lives once in packages/cli/foundation/fs/relative-specifier.mjs, and both render reverse and swizzle copy call it. An engineering owner's decision, approved for this head, settles the alias direction, and no other finding remains.
Claims and files checked
Review mode: incremental; reason: none
Claims:
- Before this change a reverse refused an aliased page whose alias leads outside the new folder, so the round trip broke after one pass: verified (the removed refusal in
_adapter.mjs; the rewritten tests atrender.test.mjs:367-379and:685-701). - When the aliased file and every carried file it imports match the project's, the page uses the project's files and their copies are not written: verified (
_adapter.mjs:889-917,:959-961;render.test.mjs:728-817). - Render, reverse, edit and render again work in the page's own project, again and again: verified (
render.test.mjs:728-817). - A differing or missing file comes back in the page's own layout inside the new folder, never into an existing folder: verified (
_adapter.mjs:962-973;render.test.mjs:685-701,:819-890). - The answer names the file the alias reaches today, any differing file below it, and the
pathsentry: verified (render.test.mjs:785-806,:819-890). - The answer says the entry applies to the whole project and gives the relative import of the copy for each restored file that makes the import: verified, chains of restored copies and a missing file included (
render.mjs:138;_adapter.mjs:980-986;render.test.mjs:819-890). - A file with no alias record gets the same
pathsentry from the one carried file its import names: verified (embedded-imports.mjs:334-341,:518-519;render.test.mjs:944-967). aliased.configandaliased.pathsappear only whenaliased.importsis not empty: verified (_adapter.mjs:989-996).- The maintainers decided that a reverse never writes into an existing folder or lets a restored page use a different file without saying so: an engineering owner's decision on this pull request states it, and the tests above hold it.
- The command and its result type are experimental, released as an experimental patch: verified (experimental namespace;
[experimental]patch changeset). - The named tests exist and pass, and the earlier refusal tests now check the new behaviour: verified (the render, render-foundation and swizzle suites pass).
- 272 of 272 round trips across published canaries: not checkable, because that corpus is not in the repository.
- No new public API is hidden under a bug-fix label, and public text holds no internal context: verified; the
RenderAliasedchange is declared in the title and changeset. - The smallest-restoration list: accurate for the render change. It does not name the relative-import helper now shared in
foundation/fs, a refactor that leaves swizzle's output unchanged. - The testing command passes: verified.
Files:
.changeset/render-reverse-alias-in-project.md: clear.packages/cli/api/render/_adapter.mjs: clear (calls the shared helper at:985).packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear.packages/cli/api/render/render.type.mjs: clear.packages/cli/api/swizzle/_adapter.mjs: clear (the re-export it drops is not reachable from the package's exports).packages/cli/api/swizzle/_moduleGraph.mjs: clear (the copy is removed).packages/cli/api/swizzle/copy/copy.mjs: clear (imports the shared helper).packages/cli/assets/docs/tree/render-pages.doc.mjs: clear.packages/cli/clients/cli/commands/experimental/render.mjs: clear.packages/cli/foundation/fs/relative-specifier.mjs: clear (the same output as swizzle's former helper).packages/cli/foundation/render/embedded-imports.mjs: clear.
c51b01d to
9645820
Compare
|
/approve-spec 9645820 |
There was a problem hiding this comment.
Approved pending CI: an engineering owner approved the alias direction for this exact head, and no defect remains. CI has not run on this head yet.
Before it can land, rebase onto main: #12404 changed the same lines in packages/cli/api/render/_adapter.mjs (the reachableFiles call in reverseToFile) and render.type.mjs (the data.exact and data.missing docs), so GitHub reports a conflict. Keep both changes when you resolve it. The rebased head needs a new review and its own /approve-spec.
Claims and files checked
Review mode: incremental; reason: none
Claims:
- Before this change, a reverse refused an aliased page whose alias leads outside the new folder (its own project, the same project after an upgrade, a new project after pasting the printed entry), so the round trip broke after one pass: verified (the base exits 1 in all three fixture cases; the rewritten tests at
render.test.mjs:368-380and:685-702). - When the aliased file and every carried file below it match, the page uses the project's files and the copies are not written: verified (
_adapter.mjs:937-957,:999-1001;render.test.mjs:729-818). - When that file differs or is missing, the page's copy comes back in its own layout inside the new folder, never into a folder that exists: verified (
_adapter.mjs:1003-1013,:1037-1046;render.test.mjs:685-702,:820-891). - The answer names the file the alias reaches today, says it differs or is not there, and gives the
pathsentry that leads the import to the copy: verified (export.mjs:172-185; head transcripts). - A file with no alias record gets the same entry from the one carried file the import names: verified (
embedded-imports.mjs:339-346,:523-524;render.test.mjs:945-968). - The command is experimental: verified; it sits under the
experimentalgroup. - The maintainers decided that a reverse never writes into an existing folder or lets a restored page use a different file without saying so: an engineering owner's decision on this pull request states it, approved for this head.
- The smallest-restoration list: accurate for the reverse change; it does not name the relative-import helper now shared with swizzle, whose output is unchanged.
- The named tests exist and pass, and the two earlier refusal tests now check the new behaviour: verified (
render.test.mjs:368,:685,:729,:945). - The testing command passes: verified.
- 272 of 272 round trips across published canaries: not checkable, because that corpus is not in the repository.
- No new public API hidden under a bug-fix label, and no internal context in public text: verified; the
RenderAliasedchange is declared in the changeset. - Changeset: every sentence matches the code and tests above,
aliased.configandaliased.pathsappear only withimports(_adapter.mjs:1029-1036), and it ships as an experimental patch.
Files:
.changeset/render-reverse-alias-in-project.md: clear.packages/cli/api/render/_adapter.mjs: clear (conflicts withmain).packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear.packages/cli/api/render/render.type.mjs: clear (conflicts withmain).packages/cli/api/swizzle/_adapter.mjs: clear (the dropped re-export is not reachable from the package's exports).packages/cli/api/swizzle/_moduleGraph.mjs: clear.packages/cli/api/swizzle/copy/copy.mjs: clear.packages/cli/assets/docs/tree/export-pages.doc.mjs: clear.packages/cli/clients/cli/commands/experimental/export.mjs: clear.packages/cli/foundation/fs/relative-specifier.mjs: clear (the same output as swizzle's former helper).packages/cli/foundation/render/embedded-imports.mjs: clear.
2930cb9 to
6603a51
Compare
|
/approve-spec 6603a51 |
There was a problem hiding this comment.
Approval waits on an engineering owner's decision for this head. No current record decides how astryx experimental export --reverse handles a path-alias import whose project file lies outside the new folder: reusing an identical project file (aliased.sameAsProject), restoring the page's copy with a project-wide paths entry and relative-import alternatives (aliased.differs), finding an unrecorded import's target by path suffix, and the four changed rows of the experimental RenderAliased type. The owner decision on this pull request was approved for earlier heads; this head rebases the same change, so an engineering owner records it again by commenting /approve-spec <full head SHA> (the author may do so as an engineering owner).
No defect was found, and the new tests fail on the base and pass on this head.
Claims and files checked
Review mode: full; reason: rebase
Claims:
- Before this change, a reverse refused an aliased page whose alias leads outside the new folder (its own project, the same project later, a new project after pasting the printed entry), so the round trip broke after one pass: verified (the base exits 1 in each of those cases; the head's new tests fail on the base code).
- When the aliased file and every carried file below it match, the page uses the project's files and the copies are not written: verified (
_adapter.mjs:957-977,:1019-1022;render.test.mjs:729-818). - When that file differs or is missing, the page's copy comes back in its own layout inside the new folder, never into a folder that exists: verified (
_adapter.mjs:1023-1033,:1057-1067;render.test.mjs:686-702,:820-891). - The answer names the file the alias reaches today, says it differs or is not there, and gives the
pathsentry that leads the import to the copy: verified (export.mjs:172-185;render.test.mjs:820-943). - A file with no alias record gets the same entry from the one carried file the import names: verified (
embedded-imports.mjs:343-350,:524-529;render.test.mjs:945-968). - The command is experimental: verified; it sits under the
experimentalgroup. - The maintainers decided that a reverse never writes into an existing folder and never lets a restored page use a different file without saying so: an engineering owner's decision on this pull request states it, approved for earlier heads only.
- The smallest-restoration list: accurate for the reverse change; it does not name the relative-import helper now shared with swizzle, whose output is unchanged.
- The named tests exist and pass, and the two earlier refusal tests now check the new behaviour: verified (
render.test.mjs:368,:686,:729,:945). - The testing command passes: verified (one environmental temp-folder test in a neighbouring suite fails the same way on the base).
- 272 of 272 round trips across published canaries: not checkable, because that corpus is not in the repository.
- No new public API hidden under a bug-fix label, and no internal context in public text: verified; the
RenderAliasedchange is declared in the changeset. - Changeset: every sentence matches the code and tests above,
aliased.configandaliased.pathsappear only withimports(_adapter.mjs:1049-1056), and it ships as an experimental patch.
Files:
.changeset/render-reverse-alias-in-project.md: clear.packages/cli/api/render/_adapter.mjs: clear (the rebase keepsmain'smissingrule).packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear.packages/cli/api/render/render.type.mjs: clear; its four rows wait on the owner decision.packages/cli/api/swizzle/_adapter.mjs: clear (the dropped re-export is not reachable from the package's exports).packages/cli/api/swizzle/_moduleGraph.mjs: clear.packages/cli/api/swizzle/copy/copy.mjs: clear.packages/cli/assets/docs/tree/export-pages.doc.mjs: clear.packages/cli/clients/cli/commands/experimental/export.mjs: clear.packages/cli/foundation/fs/relative-specifier.mjs: clear (the same output as swizzle's former helper).packages/cli/foundation/render/embedded-imports.mjs: clear.
|
Owner decision update (engineering owner, covering this pull request at its current head): when |
|
/approve-spec 5d29d1b |
There was a problem hiding this comment.
Approved pending CI: an engineering owner approved the alias direction for this exact head and no defect was found, but CI has not run on this head yet.
- Regression: the branch now conflicts with
main, whereexperimental importmoved the reverse's text output intoprintRestoredinrender-output.mjs, which callsObject.entries(d.aliased.paths)wheneveraliasedis set, so the rebase has to carry thesameAsProjectanddifferslines and theirimports.length && pathsguard fromexport.mjsthere, or a reuse-only result crashes with aTypeError.
The rebased head needs a new review and approval, and a CLI-text test of the reuse-only answer would catch that crash.
Claims and files checked
Review mode: incremental; reason: none
Changed rules (0): none.
Claims:
- Before this change, a reverse refused an aliased page whose alias leads outside the new folder (its own project, the same project later, a new project after pasting the printed entry), so the round trip broke after one pass: verified (the base exits 1 in each of those cases; the head's new tests fail on the base code).
- The cause was that the reverse treated such an alias as unsafe and refused: verified (the base's refusal says the alias points outside the folder the restore creates).
- When the aliased file and every carried file below it match, the page uses the project's files and the copies are not written: verified (
_adapter.mjs:957-977,:1019-1022;render.test.mjs:729-818). - When that file differs or is missing, the page's copy comes back in its own layout inside the new folder, never into a folder that exists: verified (
_adapter.mjs:1023-1033,:1057-1070;render.test.mjs:675-702,:820-891). - The answer names the file the alias reaches today, says it differs or is not there, and gives the
pathsentry that leads the import to the copy: verified (export.mjs:172-185;render.test.mjs:893-943). - A file with no alias record gets the same entry from the one carried file the import names: verified (
embedded-imports.mjs:343-350,:527-528;render.test.mjs:945-968). - The command is experimental: verified; it sits under the
experimentalgroup. - The maintainers decided that a reverse never writes into an existing folder and never lets a restored page use a different file without saying so: verified; an engineering owner's decision on this pull request, approved for this head, states the direction, and every write stays inside the new folder.
- The smallest-restoration list: accurate for the reverse change; it does not name the relative-import helper now shared with swizzle, whose output is unchanged.
- The named tests exist and pass, and the two earlier refusal tests now check the new behaviour: verified (
render.test.mjs:368,:675,:729,:945). - The testing command passes: verified (one temp-folder test in a neighbouring suite fails the same way on the base).
- 272 of 272 round trips across published canaries: not checkable, because that corpus is not in the repository.
- No new public API hidden under a bug-fix label, and no internal context in public text: verified; the
RenderAliasedchange is declared in the changeset. - Changeset: every sentence matches the code and tests above,
aliased.configandaliased.pathsappear only withimports(_adapter.mjs:1049-1056), and it ships as an experimental patch.
Files:
.changeset/render-reverse-alias-in-project.md: clear.packages/cli/api/render/_adapter.mjs: clear.packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear.packages/cli/api/render/render.type.mjs: clear; its four rows are covered by the owner decision.packages/cli/api/swizzle/_adapter.mjs: clear (the dropped re-export is not reachable from the package's exports).packages/cli/api/swizzle/_moduleGraph.mjs: clear.packages/cli/api/swizzle/copy/copy.mjs: clear.packages/cli/assets/docs/tree/export-pages.doc.mjs: clear.packages/cli/clients/cli/commands/experimental/export.mjs: clear at this head; it conflicts withmain, as above.packages/cli/foundation/fs/relative-specifier.mjs: clear (the same output as swizzle's former helper).packages/cli/foundation/render/embedded-imports.mjs: clear.
5d29d1b to
64ed337
Compare
|
/approve-spec 64ed337 |
There was a problem hiding this comment.
Approved pending CI: an engineering owner approved the alias direction for this exact head, and no defect remains. CI has not finished on this head yet: the node test shards, one UI test shard, the build test and the docsite build were still running, with nothing failing so far.
The rebase onto main carries the reuse and differs text, with its paths guard, into the output that experimental import and export --reverse now share, so a reuse-only answer no longer fails. A CLI-text assertion for the reuse-only answer would keep that path covered.
Claims and files checked
Review mode: full; reason: rebase
Description claims:
- Before this change, the reverse refused an aliased page whose alias leads outside the new folder, so the round trip broke after one pass: verified (the base exits 1 when the project's file is unchanged, changed, changed below or missing; the six alias tests fail on the base code).
- The cause was that the reverse treated such an alias as unsafe and refused: verified (the base's refusal says the alias points outside the folder the restore creates).
- When the aliased file and every carried file below it match, the page uses the project's files and the copies are not written: verified (
_adapter.mjs:957-977,:1019-1021;render.test.mjs:368,:729-818). - When that file differs or is missing, the page's copy comes back in its own layout inside the new folder, never into a folder that exists: verified (
_adapter.mjs:1023-1033,:1057-1067;render.test.mjs:689-702,:820-891). - The answer names the file the alias reaches, says it differs or is not there, and gives the
pathsentry that leads the import to the copy: verified (render-output.mjs:145-163;render.test.mjs:809-812,:886-889,:938-940). - A file with no alias record gets the same entry from the one carried file the import names: verified (
embedded-imports.mjs:343-350,:517-528;render.test.mjs:945-968). - The command is experimental: verified; it is registered under the
experimentalgroup. - The maintainers decided that a reverse never writes into an existing folder and never lets a restored page use a different file without saying so: verified; an engineering owner's decision on this pull request, approved for this head, states the direction, and every write stays inside the new folder.
- The smallest-restoration list: accurate for the reverse change; it does not name the relative-import helper now shared with swizzle, whose output is unchanged.
- The named tests exist and pass, and the two earlier refusal tests now check the new behaviour: verified (
render.test.mjs:368,:675,:729,:945). - The testing command passes: verified.
- 272 of 272 round trips across published canaries: not checkable, because that corpus is not in the repository.
- No new public API hidden under the bug-fix label, and no internal context in public text: verified; the
RenderAliasedchange is declared in the changeset.
Changeset claims:
- The reverse gives such a page back instead of refusing it, and reuses the project's files when the aliased file and the carried files it imports match, so export, reverse, edit and export again keep working: verified (
render.test.mjs:729-818). - Otherwise the page's copy comes back inside the new folder, and the answer names the file the alias reaches and any file below it that differs: verified (
_adapter.mjs:1023-1030). - The answer says the entry applies to the whole project and gives the relative import for each restored file that makes the import: verified (
render.test.mjs:820-891). - A file from a CLI that recorded no alias imports gets the same entry from the carried file the import's path ends with: verified (
render.test.mjs:945-968). aliased.configandaliased.pathsappear only whenaliased.importsis not empty: verified (_adapter.mjs:1053).- It ships as an experimental patch: verified; the changeset check passes.
Files:
.changeset/render-reverse-alias-in-project.md: clear.packages/cli/api/render/_adapter.mjs: clear.packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear.packages/cli/api/render/render.type.mjs: clear.packages/cli/api/swizzle/_adapter.mjs: clear.packages/cli/api/swizzle/_moduleGraph.mjs: clear.packages/cli/api/swizzle/copy/copy.mjs: clear.packages/cli/assets/docs/tree/export-pages.doc.mjs: clear.packages/cli/clients/cli/commands/experimental/render-output.mjs: clear.packages/cli/foundation/fs/relative-specifier.mjs: clear.packages/cli/foundation/render/embedded-imports.mjs: clear.
…r restores the page's copy with the paths entry, instead of refusing
64ed337 to
01ea722
Compare
|
/approve-spec 01ea722 |
There was a problem hiding this comment.
Approved pending CI: an engineering owner approved the alias direction for this exact head, and no defect remains. CI has not finished on this head yet: two node test shards, the build test, the node browser contracts and the docsite browser check were still running, with nothing failing so far.
- Non-blocking: when a file the alias reaches names an image from the site root (
/logo.png) and the project'spublic/logo.pngdiffers, the reverse declines reuse and offerspathsand relative imports, but the restored copy still loads the project's image, so that advice cannot bring the carried image back (packages/cli/api/render/_adapter.mjs:960).
Claims and files checked
Review mode: full; reason: rebase
Changeset claims:
- The reverse gives back a page whose alias leads outside the new folder instead of refusing it: verified (
_adapter.mjs:1008-1035;render.test.mjs:368,:729). - When the aliased file and every carried file it imports match, the page uses the project's files and their copies are not written: verified (
_adapter.mjs:957-977,:1019-1022;render.test.mjs:368,:729). - Export, reverse, edit and export again keep working in the page's own project: verified (
render.test.mjs:729). - When that file differs or is missing, the page's copy comes back in its own layout inside the new folder, never into a folder that exists: verified (
_adapter.mjs:1023-1033,:1057-1067;render.test.mjs:675,:820). - The answer names the file the alias reaches and any file below it that differs, with the
pathsentry that leads the import to the copy: verified (render-output.mjs:145-163;render.test.mjs:729,:893). - The answer says that entry applies to the whole project and gives the relative import for each restored file that makes the import: verified (
_adapter.mjs:1040-1046;render.test.mjs:820). - A file from a CLI that recorded no alias imports gets the same entry from the carried file the import's path ends with: verified (
embedded-imports.mjs:344-351,:556-571;render.test.mjs:945). aliased.configandaliased.pathsappear only whenaliased.importsis not empty: verified (_adapter.mjs:1049-1056).
Description claims:
- Before this change the reverse refused such a page, so the round trip worked once and then broke: verified (the six changed alias tests fail against the base code with its refusal).
- The cause was that the reverse treated an alias leading outside the new folder as unsafe: verified (the base's refusal message says so).
- Reuse when the aliased file and every carried file below it match; otherwise restore the page's copy with its
pathsentry, also for an early file with no alias record: verified (as above). - The command is experimental: verified (it sits in the
experimentalcommand group, and the type is tagged experimental). - The maintainers decided that a reverse never writes into an existing folder and never uses a different file without saying so: verified (an engineering owner's decision on this pull request, approved for this head;
_adapter.mjs:1057-1067). - The smallest-restoration file list: accurate for the reverse change; it does not name the relative-import helper now shared with swizzle, whose output is unchanged.
- The named tests exist and pass, and the two earlier refusal tests now check the new behaviour: verified (
render.test.mjs:368,:675,:729,:945). - The testing command passes: verified for the render tests (205 of 205).
- 272 of 272 round trips across published canaries: not checkable, because that set is not in the repository.
- No new public API hidden under the bug-fix label, and no internal context in public text: verified; the
RenderAliasedchange is declared in the changeset.
Files:
.changeset/render-reverse-alias-in-project.md: clear.packages/cli/api/render/_adapter.mjs: clear; one non-blocking note above.packages/cli/api/render/render.doc.mjs: clear.packages/cli/api/render/render.test.mjs: clear.packages/cli/api/render/render.type.mjs: clear.packages/cli/api/swizzle/_adapter.mjs: clear.packages/cli/api/swizzle/_moduleGraph.mjs: clear.packages/cli/api/swizzle/copy/copy.mjs: clear.packages/cli/assets/docs/tree/export-pages.doc.mjs: clear.packages/cli/clients/cli/commands/experimental/render-output.mjs: clear.packages/cli/foundation/fs/relative-specifier.mjs: clear.packages/cli/foundation/render/embedded-imports.mjs: clear.
| for (const [p, r] of reached) { | ||
| for (const abs of r.aliased) { | ||
| if (abs === target || within(abs) || reused.has(abs) || changedBelow.has(abs) || !sameFile(abs, carried(p))) continue; | ||
| const sub = reachableFiles([/** @type {{path: string, base64: string}} */ (byPath.get(p)), ...source.files.filter(f => f.path !== p)], {aliases, recorded: {}, publicDir: source.publicDir}); |
There was a problem hiding this comment.
Non-blocking: with publicDir, this walk also reaches images a carried file names from the site root (/logo.png → public/logo.png). When that image changed in the project, reuse is declined, the answer says files it imports differ, and it offers paths and instead. The restored copy still loads /logo.png from the project's public/, because the page's copy lands under the new folder, which the site does not serve. Leaving site-root images out of this comparison, or naming them as served by the project, would keep the advice accurate.
- #12072 fix(templates): payment form and checkout wrap the summary below the form on a narrow first paint Author: Joey Farina <[email protected]> - #12274 fix(core): cap the Selector family's trigger-width list minimum at the viewport Author: josephfarina <[email protected]> - #12215 fix(cli): advise keeping one dependency when two packages declare one provider ID Author: Joey <[email protected]> - #12322 [experimental] export --reverse: use the project's own copy of an aliased file, or restore the page's copy with its paths entry Author: josephfarina <[email protected]> - #12403 docs(core): Text's as and PowerSearch's statusVariant list every value their types allow Author: Joey Farina <[email protected]> - #12494 fix(templates): dashboard templates use page sections, not cards, for page regions Author: Joey Farina <[email protected]> - #12282 fix(cli): theme build --check and doctor ignore which CLI release, and which command name, built a theme Author: Joey Farina <[email protected]> - #12420 fix(Chat): ChatToolCalls and ChatDictationButton without a required prop name it and the fix in development Author: Joey Farina <[email protected]> - #12205 fix(cli): equally scored icons put first one whose id the query names in full Author: Joey Farina <[email protected]> - #12455 fix(core): a theme sets the room between a checkbox or a switch and its label Author: josephfarina <[email protected]> - #12658 perf(cli): the first theme build after a CLI upgrade reuses the JavaScript it compiled from a theme's local modules Author: Joey <[email protected]> - #12323 [experimental] export: React logs no render timings while the export draws a page Author: Joey Farina <[email protected]>
|
Landed in #12713. |
User impact
A page that imports through a path alias (
@/components/Hello, with tsconfigpaths) could not be given back in a project where that alias leads outside the new folder. That is the page's own project, the same project after a Core upgrade, or a new project after the caller pasted thepathsentry an earlier reverse printed.--reverserefused it, so render, reverse, edit and render again worked once and then broke.Problem and solution fit
When the file the alias reaches is byte for byte the page's copy, and so is every carried file below it, the page uses the project's files and the copies are not written (
aliased.sameAsProject). When that file differs or is not there, the page's copy comes back in its own layout inside the new folder, never into a folder that exists. The answer names the file the alias reaches today and says it differs or is not there (aliased.differs), with thepathsentry that leads the import to the copy. A file from an early canary that has no alias record gets the same entry, from the one carried file the import names.Expected behavior and authority
astryx experimental exportis experimental (spec:AST-017FR27). The maintainers decided that a reverse never writes into an existing folder and never lets a restored page use a different file without saying so.Smallest restoration
foundation/render/embedded-imports.mjs,api/render/_adapter.mjs,api/render/render.type.mjsand the reverse text: the decision and its report.render()docs.Evidence
api/render/render.test.mjs: "restores an aliased page in its own project again and again" (same, changed, paste, render) and "names the paths for an alias import from a file that records none"; the two earlier refusal tests now check the new behavior.Scope
Testing
pnpm exec vitest run --project node packages/cli/api/render packages/cli/foundation/render.