Repository navigation
[experimental] export: a path from the site's root reads public/ only, and its images come back with --reverse - #12275
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
e2b259d to
513ef70
Compare
513ef70 to
c0699ac
Compare
There was a problem hiding this comment.
Changes requested: an image named from the site's root now finds a site folder's public/ and comes back with --reverse, but seven defects need fixing, and both new behaviors need an engineering owner's decision before approval.
- The site-root lookup never stops when the folder the page's files are carried from is the filesystem root, so a render run from
/outside a project (or in a project whosepackage.jsonsits at/with nopublic/) hangs with no output; stop the walk at that folder or at the filesystem root and add a test (render-page.mjs:158). - An image drawn only after the first paint is resolved from the naming module's folder but rewritten by its string alone, so two components in different folders that each name
./photo.pngboth show the first one's file; resolve the string from the page's folder as the first paint does and add a two-folder test (render-page.mjs:1387-1398). --reversepicks the nearest carriedpublic/while the render read the project'spublic/first, so a page that also carries a file from a nearerpublic/comes back reported as not exact, naming as missing a file it restored; record thepublic/the render read and have the reverse use it (embedded-imports.mjs:343-353).- The changeset and title present
/images from the project'spublic/as newly shown although the base already shows them, and say a file outsidepublic/warns "as before" although the base shows a/file at the project or page root, so reword them to say what changes (.changeset/render-public-images.md:5). - A
/path to a file outsidepublic/warns that it "was not found next to the page" even when the file sits next to the page, so namepublic/as the folder that was searched (render-page.mjs:882). - The description says each new test fails on the base, but the test that expects nothing without a
public/passes there, so correct that claim (embedded-imports.test.mjs:66). - Miss: the description says the base looked for
public/in the page's own folder only, but it looked in the project's folder first and in the page's folder only outside a project, so correct that cause.
No current spec decides where experimental render reads a / path or what its script shows for images the first paint does not draw, so approval also needs an engineering owner to settle both (public/ only with the project's public/ first and else the nearest one, root-level files no longer read, these images carried for --reverse, and later-drawn images written into the script as carried data) by commenting /approve-spec followed by the full head SHA on the pull request, which the author may do as an engineering owner. GitHub still compares this pull request with the last commit of the branch it used to target, so it lists 121 files and the review-signal job refuses to classify it; the change itself is the seven files listed below. Non-blocking: the theme editor's image notes and starter-app check share the resolver and now report a theme url(/...) file at the project root as missing, which is worth a line in the changeset.
Claims and files checked
Review mode: full; reason: rebase
- Changeset: an image named from the site's root shows, read from the project's
public/: true at this head, but the base already shows it, so false as a change (changeset finding). - Changeset: with no
public/in the project folder, the nearestpublic/above the page inside the project, or outside a project inside the folder you run from: verified (render-page.mjs:152-162; shared-site and outside-project tests). - Changeset: the image is carried, so
--reverserestores it underpublic/at the same path: verified (render-page.mjs:910; outside-project test), apart from the nearer-public/case (reverse finding). - Changeset: a path that leaves
public/is not read: verified (render-page.mjs:827-828; climb test). - Changeset: a file not in
public/gets the missing-image warning as before: false for a file at the project or page root, which the base shows (changeset finding). - Changeset: the credit line names the author: verified.
- Description: a
/image shows broken whenpublic/is not in the folder of the project'spackage.json: verified (seven new tests fail on the base). - Description: the base looked for
public/in the page's own folder only: false, it looked in the project's folder first (cause finding). - Description: resolution from the project's
public/, else the nearest above the page inside the carried folder: verified. - Description: only inside
public/; a climb names no file and a root file outsidepublic/is no longer read: verified (climb test). - Description:
--reverserestores the image underpublic/and the script shows the same carried data: verified (interactive and outside-project tests). - Description: an image named in code but not drawn in the first paint is carried and shows once drawn: verified for the tested page, false for same-named relative images in different folders (later-drawn finding).
- Description: a
/path to no file keeps the missing-image warning: verified (/gone.pngcase). - Description: only the image resolver reads the site folder; tsconfig, StyleX and message paths keep the project folder: verified (
render-page.mjs:1008,:1027,:1485against:1011,:1099,:1384). - Description: the command is experimental and no record changes: verified (only the experimental render and theme editor reach the changed code; no record in the change).
- Description: the maintainers decided the rule: no decision is recorded on the pull request (held for an owner).
- Description: a frozen set of 22 pages goes from 1 to 22 exact: not checked, the set is not in the pull request.
- Description: each new test fails on the base: false, seven of eight do (test-claim finding).
- Description: the listed test run passes: verified; at this head it counts 1387 passed and 3 skipped, one more than stated, from a test the rebase brought in.
- Description: public text holds no internal context: verified.
- File
.changeset/render-public-images.md: changeset finding; theme-editor note. - File
packages/cli/foundation/render/render-page.mjs: hang, later-drawn and warning findings. - File
packages/cli/foundation/render/embedded-imports.mjs: reverse finding. - File
packages/cli/foundation/render/embedded-imports.test.mjs: test-claim finding. - File
packages/cli/api/render/render.test.mjs: asserts the warning finding's message; no filesystem-root case. - File
packages/cli/api/render/render.interactive.test.mjs: no two-folder case for the later-drawn finding; otherwise clear. - File
packages/cli/assets/docs/tree/render-pages.doc.mjs: clear. - The other 114 files GitHub lists come from
maincommits already onmainand are not part of this change.
PR Analysis Report🔎 Preview ·
|
|
Owner decision (engineering owner, covering this pull request): an image a page names from the site root ( |
|
/approve-spec 947c2ba |
There was a problem hiding this comment.
Changes requested: an image named from the site's root now resolves only from public/ and comes back with --reverse, an engineering owner has decided that rule on this head, and the earlier points are fixed; one warning still needs a fix.
- A
/url in a stylesheet outside the page's folder gets a missing-image warning whosepublic/path starts at the stylesheet, so a page insrc/pages/p/that importssrc/styles/a.cssis told../../public/for the stylesheet's url and../../../public/for its own markup's, the same folder; build the path from the page's folder inpublicFolderOfand add a stylesheet-in-another-folder case (render-page.mjs:895).
Non-blocking: the experimental theme editor's image notes share the resolver and now report a theme url(/…) file at the project root as missing; a changeset line would tell its users.
Claims and files checked
Review mode: incremental; reason: none
- Changeset: more
/images show in the file and come back with--reverse: verified (shared-site and outside-a-project tests, both failing on the merge base). - Changeset: with no
public/in the project, the nearest one above the page inside the project, or outside a project inside the folder you run from: verified (render-page.mjs:152-164). - Changeset: each such image is carried, and
--reverserestores it into thepublic/the render read: verified (render-page.mjs:924,:1534-1549;embedded-imports.mjs:349-359; a project page beside a nearerpublic/restores exact). - Changeset: an image named this way but drawn later is carried and shown from carried data: verified (interactive click test).
- Changeset: only
public/is read, root-level files are no longer read, and a climbing path is not read: verified (render-page.mjs:823-831; climb test). - Changeset: the missing-image warning names the
public/folder searched: true for markup; false for a stylesheet outside the page's folder (finding). - Changeset: the credit line names the author: verified.
- Description: the base showed broken images when
public/was not where it looked (a site folder below a sharedpackage.json, a page outside a project): verified (base resolver; those tests fail on the merge base). - Description: the base looked in the project's
public/, then the project's folder: verified (baseassetRefcandidates). - Description: a
/path resolves only frompublic/, the project's first, else the nearest above the page, stopping at the scope or the filesystem root: verified. - Description: a climbing path names no file and a root file outside
public/is no longer read: verified (climb test). - Description: the source record names the
public/read, optional and with no format change, and--reverseputs the image back there: verified (readers check only the version, entry and files). - Description: a later-drawn image is carried, the script shows the page folder's file, and a file beside the naming module is still carried: verified (two-folder test; a module-only file restores exact).
- Description: a
/path to no file warns namingpublic/: verified for markup; the stylesheet case is the finding. - Description: only the image resolver reads the site's folder; tsconfig, StyleX and messages keep the project's: verified (
render-page.mjs:1022,:1041,:1110). - Description: experimental under the experimental-isolation rule, with no record change: verified.
- Description: the maintainers decided the rule: verified (an engineering owner's decision comment and approval on this head).
- Description: the file list: verified; its
--reverseline describes the fallback (the recordedpublic/wins first, as the Solution says), and the adapter and source-record files also change. - Description: the listed tests (outside-a-project markup and CSS, climb, shared site, script string, click, unit tests, two folders, recorded
public/): verified, all pass. - Description: a frozen set of 22 pages goes from 1 to 22 exact: not checked, the set is not in the pull request.
- Description: the outside-a-project test fails on the base and the traversal and no-
public/unit test passes there: verified (9 of the 12 new tests fail on the merge base). - Description: a render run from
/finishes and warns: verified (about 1.5 s); the 60 s hang was in this pull request's earlier revision, not the base. - Description: the listed test run passes with 1,391 passed and 3 skipped: verified.
- Description: public text holds no internal context: verified.
.changeset/render-public-images.md: clear.packages/cli/foundation/render/render-page.mjs: stylesheet warning finding.packages/cli/foundation/render/embedded-imports.mjs: clear.packages/cli/foundation/render/source-block.mjs: clear.packages/cli/api/render/_adapter.mjs: clear.packages/cli/api/render/render.test.mjs: no stylesheet-in-another-folder case (finding); otherwise clear.packages/cli/api/render/render.interactive.test.mjs: clear.packages/cli/foundation/render/embedded-imports.test.mjs: clear.packages/cli/assets/docs/tree/render-pages.doc.mjs: clear.- The other 113 files GitHub lists come from
mainand are not part of this change.
|
/approve-spec 5c08362 |
5c08362 to
a8f7a2c
Compare
|
/approve-spec a8f7a2c |
There was a problem hiding this comment.
Approved pending CI: an image named from the site's root (/pics/shoe.png) now resolves only from the site's public/ folder, is carried in the rendered file and comes back with --reverse, and the engineering owner's /approve-spec covers the current revision.
CI found no room for this head and cancelled its test jobs: re-run all CI jobs once it has room, since the merge guard waits for them to pass.
Two small wording points, neither blocking: the theme editor's missing-image note still says a theme's url(/…) file "was not found beside the theme" although it is looked for in public/ (packages/cli/api/theme-edit/_context.mjs:879), and the description's "(it ran into the 60 s limit before)" reads as if the base hung, while only an earlier revision of this pull request did.
Claims and files checked
Review mode: full; reason: rebase
-
The release note's first claim, that more images named from the site's root show in the file and come back with
--reverse: verified (render.test.mjs:950,:2403; a live render of each side). -
Without a project
public/, the nearestpublic/above the page inside the project, or outside a project inside the run folder: verified (render-page.mjs:152-164;render.test.mjs:950,:2403). -
Each such image is carried and
--reverseputs it back in thepublic/the render read: verified (render.test.mjs:2403;embedded-imports.test.mjs:82). -
An image drawn only later is carried and shown from the carried data: verified (
render.interactive.test.mjs:358). -
Only
public/is read; a root-level file and a climbing path are not; the warning names thepublic/searched: verified (render-page.mjs:823-831,:896;render.test.mjs:2436,:2458). -
The theme editor's image notes read a theme's
url(/…)the same way: verified (api/theme-edit/_context.mjs:864-880uses the shared resolver). -
The base looked in the project's
public/, then the project's folder: verified (the base's resolver). -
A site folder below a shared
package.json, and a page outside a project withpublic/above it, lost their images on the base: verified (both cases fail on the base). -
A
/path resolves only from apublic/folder and the search stops at the carry scope or the filesystem root: verified (render-page.mjs:158-162;render.test.mjs:2479). -
The source record names the
public/read, as an optional field with no format change: verified (render-page.mjs:1538-1553;source-block.mjs:83). -
A later-drawn relative string shows the page folder's file, and each module's own file is still carried: verified (
render.interactive.test.mjs:408). -
The missing-image warning text: verified (
render.test.mjs:2436). -
Only the image resolver reads the site's folder; tsconfig, StyleX and message paths keep the project's: verified (
render-page.mjs:1023,:1042,:1117,:1512). -
No record changes, and the render guide names where a
/path comes from: verified (render-pages.doc.mjs:59). -
An engineering owner decided the rule: verified (the owner's decision comment and approval at this head).
-
The listed render, script, click, two-folder and unit tests: verified (all pass at this head).
-
The 22-page before and after set: not reproduced (the set is not in the pull request); the in-tree tests cover each layout it names.
-
The outside-a-project test fails on the base and the no-
public/unit test passes there: verified (10 of 13 new cases fail on the base). -
A render run from
/finishes and warns: verified (render.test.mjs:2479); the hang it mentions was in an earlier revision, not the base. -
The test command passes: verified (1,403 passed, 3 skipped at this head; the stated count predates the rebase).
-
No new public API, and no internal context in public text: verified.
-
.changeset/render-public-images.md: clear. -
packages/cli/api/render/_adapter.mjs: clear. -
packages/cli/api/render/render.interactive.test.mjs: clear. -
packages/cli/api/render/render.test.mjs: clear. -
packages/cli/assets/docs/tree/render-pages.doc.mjs: clear. -
packages/cli/foundation/render/embedded-imports.mjs: clear. -
packages/cli/foundation/render/embedded-imports.test.mjs: clear. -
packages/cli/foundation/render/render-page.mjs: clear. -
packages/cli/foundation/render/source-block.mjs: clear.
a8f7a2c to
5c58bcd
Compare
|
/approve-spec 5c58bcd |
There was a problem hiding this comment.
Approved pending CI: an image named from the site's root (/pics/shoe.png) now resolves only from the site's public/ folder, is carried in the rendered file and comes back with --reverse, and the engineering owner's /approve-spec covers this revision.
CI found no room for this revision and cancelled its test jobs: re-run all jobs once it has room, since the merge guard waits for them to pass.
Three small wording points, none blocking:
- The theme editor's missing-image note still says a theme's
url(/…)file "was not found beside the theme" although it is looked for inpublic/(packages/cli/api/theme-edit/_context.mjs:879). - The description's "(it ran into the 60 s limit before)" reads as if the base hung, while only an earlier revision of this pull request did.
- The description's test count (1,391 passed) predates the rebase; the same command now gives 1,472 passed, 3 skipped.
Claims and files checked
Review mode: full; reason: rebase
-
The release note's first claim, that more images named from the site's root show in the file and come back with
--reverse: verified (render.test.mjs:951,:2725; a live render on each side). -
Without a project
public/, the nearestpublic/above the page inside the project, or outside a project inside the run folder: verified (render-page.mjs:153-164;render.test.mjs:951,:2725). -
Each such image is carried and
--reverseputs it back in thepublic/the render read: verified (render.test.mjs:2725;embedded-imports.test.mjs:82). -
An image drawn only later is carried and shown from the carried data: verified (
render.interactive.test.mjs:420). -
Only
public/is read; a root-level file and a climbing path are not; the warning names thepublic/searched: verified (render-page.mjs:848-856,:921;render.test.mjs:2758,:2780). -
The theme editor's image notes read a theme's
url(/…)the same way: verified (api/theme-edit/_context.mjs:864-880uses the shared resolver). -
The base looked in the project's
public/, then the project's folder: verified (the base's resolver). -
A site folder below a shared
package.json, and a page outside a project withpublic/above it, lost their images on the base: verified (both cases fail on the base). -
A
/path resolves only from apublic/folder and the search stops at the carry scope or the filesystem root: verified (render-page.mjs:159-163;render.test.mjs:2801). -
The source record names the
public/read, as an optional field with no format change: verified (render-page.mjs:1639-1651;source-block.mjs:83). -
A later-drawn relative string shows the page folder's file, and each module's own file is still carried: verified (
render.interactive.test.mjs:470). -
The missing-image warning text: verified (
render.test.mjs:2758). -
Only the image resolver reads the site's folder; tsconfig, StyleX and message paths keep the project's: verified (
render-page.mjs:1048,:1067,:1142,:1609). -
No record changes, and the render guide names where a
/path comes from: verified (render-pages.doc.mjs:59). -
An engineering owner decided the rule: verified (the owner's decision comment and approval at this revision).
-
The listed render, script, click, two-folder and unit tests: verified (all pass at this revision).
-
The 22-page before and after set: not reproduced (the set is not in the pull request); the in-tree tests cover each layout it names.
-
The outside-a-project test fails on the base and the no-
public/unit test passes there: verified (10 of 13 new cases fail on the base). -
A render run from
/finishes and warns: verified (render.test.mjs:2801); the hang it mentions was in an earlier revision, not the base. -
The test command passes: verified (1,472 passed, 3 skipped at this revision; the stated 1,391 predates the rebase).
-
No new public API, and no internal context in public text: verified.
-
.changeset/render-public-images.md: clear. -
packages/cli/api/render/_adapter.mjs: clear. -
packages/cli/api/render/render.interactive.test.mjs: clear. -
packages/cli/api/render/render.test.mjs: clear. -
packages/cli/assets/docs/tree/render-pages.doc.mjs: clear. -
packages/cli/foundation/render/embedded-imports.mjs: clear. -
packages/cli/foundation/render/embedded-imports.test.mjs: clear. -
packages/cli/foundation/render/render-page.mjs: clear. -
packages/cli/foundation/render/source-block.mjs: clear.
5c58bcd to
b0567fe
Compare
|
/approve-spec b0567fe |
There was a problem hiding this comment.
Changes requested: the code, tests and release note look right, and the engineering owner's /approve-spec covers this revision; only the pull request description needs an update.
- Regression: since
mainrenamed the command, the description namesastryx experimental render(which now fails withERR_UNKNOWN_SUBCOMMAND) andassets/docs/tree/render-pages.doc.mjs, while this change governsastryx experimental exportand editsexport-pages.doc.mjs, so please update those names, the title'srender:scope and the Testing line's count (1,473 passed, 3 skipped at this revision).
Editing the description needs no new commit. Two small points, not blocking: the theme editor's missing-image note still says a theme's url(/…) file was not found beside the theme although it is looked for in public/ (packages/cli/api/theme-edit/_context.mjs:879), and the description's "(it ran into the 60 s limit before)" reads as if the base hung, while only an earlier revision did. CI found no room for this revision and cancelled its test jobs, so they need a re-run.
Claims and files checked
Review mode: full; reason: rebase
-
Release note, more images named from the site's root show in the file and come back with
--reverse: verified (render.test.mjs:951,:2747; an export on each side). -
Release note, without a project
public/the nearestpublic/above the page inside the project, or outside a project inside the run folder: verified (render-page.mjs:153-165;render.test.mjs:951,:2747). -
Release note, each such image is carried and
--reverseputs it back in thepublic/export read: verified (render.test.mjs:2747;embedded-imports.test.mjs:82). -
Release note, an image drawn only later is carried and shown from the carried data: verified (
render.interactive.test.mjs:420). -
Release note, only
public/is read, a root-level file and a climbing path are not, and the warning names thepublic/searched: verified (render-page.mjs:848-856,:919-922;render.test.mjs:2780,:2802). -
Release note, the theme editor's image notes read a theme's
url(/…)the same way: verified (api/theme-edit/_context.mjs:864-879uses the shared resolver). -
The base looked in the project's
public/, then the project's folder: verified (the base's resolver). -
A site folder below a shared
package.json, and a page outside a project withpublic/above it, lost their images on the base: verified (both cases fail on the base). -
A
/path resolves only from apublic/folder and the search stops at the carry scope or the filesystem root: verified (render-page.mjs:159-163;render.test.mjs:2823). -
The source record names the
public/read, as an optional field with no format change: verified (render-page.mjs:1636-1651;source-block.mjs:83,:119). -
A later-drawn relative string shows the page folder's file, and each module's own file is still carried: verified (
render.interactive.test.mjs:470). -
The missing-image warning text: verified (
render.test.mjs:2780). -
Only the image resolver reads the site's folder; tsconfig, StyleX and message paths keep the project's: verified (
render-page.mjs:1048,:1067,:1609). -
The governed command, also in the Scope components line, is
astryx experimental render: false (it isastryx experimental exportat this revision;clients/cli/lib/renamed-commands.mjs:16). -
No record changes, and the guide names where a
/path comes from: verified (export-pages.doc.mjs:60). -
The guide sentence is in
render-pages.doc.mjs: false (the file isexport-pages.doc.mjs). -
An engineering owner decided the rule: verified (the owner's decision comment and approval at this revision).
-
The listed export, script, click, two-folder and unit tests: verified (all pass at this revision).
-
The 22-page before and after set: not reproduced (the set is not in the pull request); the in-tree tests cover each layout it names.
-
The outside-a-project test fails on the base and the no-
public/unit test passes there: verified (10 of 13 new cases fail on the base). -
An export run from
/finishes and warns: verified (render.test.mjs:2823); the hang it mentions was in an earlier revision, not the base. -
The recorded
public/wins over a nearer one, and a malformed record is ignored: verified (embedded-imports.test.mjs:82,:86). -
The test command gives 1,391 passed, 3 skipped: out of date (1,473 passed, 3 skipped at this revision).
-
No new public API, and no internal context in public text: verified.
-
.changeset/render-public-images.md: clear. -
packages/cli/api/render/_adapter.mjs: clear. -
packages/cli/api/render/render.interactive.test.mjs: clear. -
packages/cli/api/render/render.test.mjs: clear. -
packages/cli/assets/docs/tree/export-pages.doc.mjs: clear. -
packages/cli/foundation/render/embedded-imports.mjs: clear. -
packages/cli/foundation/render/embedded-imports.test.mjs: clear. -
packages/cli/foundation/render/render-page.mjs: clear. -
packages/cli/foundation/render/source-block.mjs: clear.
|
/approve-spec d826f88 |
There was a problem hiding this comment.
Changes requested: the code, tests and release note still look right, and the engineering owner's /approve-spec covers this revision, but the branch needs a rebase and the description two fixes.
- Regression: since the last review,
mainmerged #12404, which changes the same lines insource-block.mjs,render-page.mjsandapi/render/_adapter.mjs(itsnotCarriedrecord beside this change'spublicDir), so GitHub cannot merge this branch and runs none of its CI; please rebase and keep both record fields and bothreachableFilesinputs. - The description's Testing line still gives 1,391 passed, 3 skipped (the command gives 1,473 passed, 3 skipped at this revision), and "(before, it ran into the render's time limit)" reads as if the base hung, while the base finishes that case and only an earlier revision of this branch hung.
One small point, not blocking: the theme editor's missing-image note still says a theme's url(/…) file was not found beside the theme, although it is looked for in public/ (packages/cli/api/theme-edit/_context.mjs:879). The rebased revision needs the owner's /approve-spec again.
Claims and files checked
Review mode: incremental; reason: none
-
Changed rules (0): none since the last review.
-
Release note, more images named from the site's root show in the file and come back with
--reverse: verified (render.test.mjs:951,:2747; an export on each side). -
Release note, without a project
public/the nearestpublic/above the page inside the project, or outside a project inside the run folder: verified (render-page.mjs:138-142,:153-165;render.test.mjs:951,:2747). -
Release note, each such image is carried and
--reverseputs it back in thepublic/export read: verified (render.test.mjs:2747;embedded-imports.test.mjs:82). -
Release note, an image drawn only later is carried and shown from the carried data: verified (
render.interactive.test.mjs:420). -
Release note, only
public/is read, a root-level file and a climbing path are not, and the warning names thepublic/searched: verified (render-page.mjs:848-856,:919-921;render.test.mjs:2780,:2802). -
Release note, the theme editor's image notes read a theme's
url(/…)the same way: verified (api/theme-edit/_context.mjs:864-869uses the shared resolver). -
The base looked in the project's
public/, then the project's folder: verified (the base's resolver). -
A site folder below a shared
package.json, and a page outside a project withpublic/above it, lost their images, and a later-drawn root-path image was never carried: verified (both cases fail on the base; an export on the base). -
A
/path resolves only from apublic/folder and the search stops at the project or run folder, or the filesystem root: verified (render-page.mjs:153-165;render.test.mjs:2823). -
A climbing path names no file and a root-level file outside
public/is no longer read: verified (render.test.mjs:2780). -
The source record names the
public/read, as an optional field with no format change: verified (render-page.mjs:1636-1651;source-block.mjs:27,:83,:119). -
A later-drawn relative string shows the page folder's file, and each module's own file is still carried: verified (
render.interactive.test.mjs:470). -
The missing-image warning text: verified (
render.test.mjs:2780). -
Only the image resolver reads the site's folder; tsconfig, StyleX and message paths keep the project's: verified (
render-page.mjs:1048,:1067,:1609). -
The governed command is
astryx experimental export, no record changes, and the guide names where a/path comes from: verified (export-pages.doc.mjs:60). -
An engineering owner decided the rule: verified (the owner's decision comment and approval at this revision).
-
The files and changes in Smallest restoration: verified (the reverse takes the recorded
public/first, then the nearest,embedded-imports.mjs:357-370; the guide gains two sentences). -
The listed export, script, click, two-folder and unit tests: verified (all pass at this revision; the outside-a-project stylesheet names
/pics/bg.png). -
The 22-page before and after set: not reproduced (the set is not in the pull request); the in-tree tests cover each layout it names.
-
The outside-a-project test fails on the base and the traversal and no-
public/unit test passes there: verified (10 of 13 new cases fail on the base). -
An export run from
/finishes and warns: verified (render.test.mjs:2823); that it ran into the time limit before: false (the base finishes that case; only an earlier revision hung). -
The recorded
public/wins over a nearer one, and a malformed record is ignored: verified (embedded-imports.test.mjs:82,:86). -
The test command gives 1,391 passed, 3 skipped: false (1,473 passed, 3 skipped at this revision).
-
No new public API or hidden direction, and no internal context in public text: verified.
-
.changeset/render-public-images.md: clear. -
packages/cli/api/render/_adapter.mjs: conflicts withmain's change to the samereachableFilescall. -
packages/cli/api/render/render.interactive.test.mjs: clear. -
packages/cli/api/render/render.test.mjs: clear (merges withmain). -
packages/cli/assets/docs/tree/export-pages.doc.mjs: clear. -
packages/cli/foundation/render/embedded-imports.mjs: clear (merges withmain). -
packages/cli/foundation/render/embedded-imports.test.mjs: clear. -
packages/cli/foundation/render/render-page.mjs: conflicts withmain's change to the source record. -
packages/cli/foundation/render/source-block.mjs: conflicts withmain's change to the source record.
d826f88 to
f8762fa
Compare
|
/approve-spec f8762fa |
There was a problem hiding this comment.
Approved pending CI: an image named from the site's root (/pics/shoe.png) now resolves only from the site's public/ folder, is carried in the exported file and comes back with --reverse, the rebase keeps main's not-carried record beside the new publicDir, the engineering owner's /approve-spec covers this revision, and the CI workflow, refused on this revision because CI was full, needs a re-run before merge.
- Miss: not blocking, a percent-escaped root path (
/pics/a%20b.png) is shown and restored, but--reversestill lists it as missing withexact: false, becausereachableFilesjoins the raw string (embedded-imports.mjs:355); decoding there once also fixes the same gap that relative strings already have. - Miss: not blocking, the
data.filesdescription inpackages/cli/api/render/render.type.mjs:49still says a module names the files it carries by a relative path, and root paths read frompublic/belong there too. - Not blocking: the theme editor's missing-image note still says a theme's
url(/…)file was not found beside the theme, although it is looked for inpublic/(packages/cli/api/theme-edit/_context.mjs:879).
Claims and files checked
Review mode: full; reason: rebase
-
Release note, more images named from the site's root show in the file and come back with
--reverse: verified (render.test.mjs:951,:2844; an export on each side). -
Release note, without a project
public/the nearestpublic/above the page inside the project, or outside a project inside the run folder: verified (render-page.mjs:153-165;render.test.mjs:951,:2844). -
Release note, each such image is carried and
--reverseputs it back in thepublic/export read: verified (render.test.mjs:2844;embedded-imports.test.mjs:82). -
Release note, an image drawn only later is carried and shown from the carried data: verified (
render.interactive.test.mjs:420). -
Release note, only
public/is read, a root-level file and a climbing path are not, and the warning names thepublic/searched: verified (render-page.mjs:848-856,:919-922;render.test.mjs:2877,:2899). -
Release note, the theme editor's image notes read a theme's
url(/…)the same way: verified (api/theme-edit/_context.mjs:869uses the shared resolver). -
The base looked in the project's
public/, then the project's folder: verified (the base's resolver). -
A site folder below a shared
package.json, and a page outside a project withpublic/above it, lost their images, and a later-drawn root-path image was never carried: verified (both cases fail on the base; an export on the base). -
A
/path resolves only from apublic/folder, and the search stops at the project or run folder, or the filesystem root: verified (render-page.mjs:153-165;render.test.mjs:2920). -
A climbing path names no file and a root-level file outside
public/is no longer read: verified (render.test.mjs:2877). -
The source record names the
public/read, as an optional field with no format change: verified (render-page.mjs:1636-1652;source-block.mjs:27,:84,:121). -
A later-drawn relative string shows the page folder's file, and each module's own file is still carried: verified (
render.interactive.test.mjs:470). -
The missing-image warning text: verified (
render.test.mjs:2877). -
Only the image resolver reads the site's folder; tsconfig, StyleX and message paths keep the project's: verified (
render-page.mjs:1048,:1067,:1608-1610). -
The governed command is
astryx experimental export, no record changes, and the guide names where a/path comes from: verified (export-pages.doc.mjs:60). -
An engineering owner decided the rule: verified (the owner's decision comment and approval at this revision).
-
The files and changes in Smallest restoration: verified (the reverse takes the recorded
public/first, then the nearest,embedded-imports.mjs:361-376; the guide gains two sentences). -
The listed export, script, click, two-folder and unit tests: verified (all pass at this revision; the outside-a-project stylesheet names
/pics/bg.png). -
The 22-page before and after set: not reproduced (the set is not in the pull request); the in-tree tests and a live export cover each layout it names.
-
The outside-a-project test fails on the base and the traversal and no-
public/unit test passes there: verified (10 of 13 new cases fail on the base). -
An export run from
/finishes and warns: verified (render.test.mjs:2920). -
The recorded
public/wins over a nearer one, and a malformed record is ignored: verified (embedded-imports.test.mjs:82,:86). -
The test command passes at this revision: verified (1,479 passed, 3 skipped).
-
No new public API or hidden direction, and no internal context in public text: verified.
-
.changeset/render-public-images.md: clear. -
packages/cli/api/render/_adapter.mjs: clear (keepsmain's recorded-file merge and addspublicDir). -
packages/cli/api/render/render.interactive.test.mjs: clear. -
packages/cli/api/render/render.test.mjs: clear. -
packages/cli/assets/docs/tree/export-pages.doc.mjs: clear. -
packages/cli/foundation/render/embedded-imports.mjs: not blocking, a percent-escaped root path is listed as missing on--reverse. -
packages/cli/foundation/render/embedded-imports.test.mjs: clear. -
packages/cli/foundation/render/render-page.mjs: clear. -
packages/cli/foundation/render/source-block.mjs: clear (keeps both record fields).
| const publicPath = ref => { | ||
| /** @param {string} dir a tree folder holding `public/` files */ | ||
| const under = dir => { | ||
| const joined = path.posix.normalize(`${dir}/${ref.slice(1)}`); |
There was a problem hiding this comment.
Not blocking: this joins the raw string, while the render decodes percent-escapes before it reads the file (render-page.mjs:842). A page that names /pics/a%20b.png gets public/pics/a b.png carried and restored, yet --reverse reports exact: false with missing: ["public/pics/a%20b.png"]. Decoding the ref once (as assetRef does) before both this join and the relative one below also fixes the same gap for ./c%20d.png.
…s them A path from the site root (/pics/a.png) is read only from public/: the project's, else the nearest public/ above the page inside the project or the folder the command runs in. The file carries each such image, also one the page draws only later, so the script shows it offline and --reverse puts it back in the public/ the export read (recorded in the source). A path that leaves public/ is refused, and the missing-image warning names the public/ folder searched.
f8762fa to
d540ef7
Compare
|
/approve-spec d540ef7 |
There was a problem hiding this comment.
Approved pending CI: an image named from the site's root (/pics/shoe.png) now resolves only from the site's public/ folder, is carried in the exported file and comes back with both --reverse and the new experimental import, the engineering owner's /approve-spec covers this revision, and the remaining CI test shards still need to finish before merge.
- Regression: not blocking, since
mainaddedexperimental import, every other line of the export guide names the way back that way, while the new guide sentence (packages/cli/assets/docs/tree/export-pages.doc.mjs:60) and the changeset name only--reverse; both still work, so namingexperimental import(or--reverse) would keep the guide in one voice. - Not blocking: a percent-escaped root path (
/pics/a%20b.png) is shown and restored, but the way back still lists it as missing withexact: false, becausereachableFilesjoins the raw string (embedded-imports.mjs:355); decoding there once also fixes the same gap relative strings already have. - Not blocking: two descriptions still state only the old rule, the
data.filesdescription inpackages/cli/api/render/render.type.mjs:49(module-named files "by a relative path") and the theme editor's missing-image note inpackages/cli/api/theme-edit/_context.mjs:879("beside the theme").
Claims and files checked
Review mode: full; reason: rebase
-
Release note, more images named from the site's root show in the file and come back with
--reverse: verified (render.test.mjs:951,:2860; an export on each side). -
Release note, without a project
public/the nearestpublic/above the page inside the project, or outside a project inside the run folder: verified (render-page.mjs:154-166;render.test.mjs:951,:2860). -
Release note, each such image is carried and
--reverseputs it back in thepublic/export read: verified (render.test.mjs:2860;embedded-imports.test.mjs:82; a live restore through both way-back commands). -
Release note, an image drawn only later is carried and shown from the carried data: verified (
render.interactive.test.mjs:522). -
Release note, only
public/is read, a root-level file and a climbing path are not, and the warning names thepublic/searched: verified (render-page.mjs:878-886,:950-952;render.test.mjs:2893,:2915). -
Release note, the theme editor's image notes read a theme's
url(/…)the same way: verified (api/theme-edit/_context.mjs:869uses the shared resolver with the project as the site root). -
The base looked in the project's
public/, then the project's folder: verified (the base's resolver). -
A site folder below a shared
package.json, and a page outside a project withpublic/above it, lost their images, and a later-drawn root-path image was never carried: verified (both cases fail on the base; an export on the base). -
A
/path resolves only from apublic/folder, and the search stops at the project or run folder, or the filesystem root: verified (render-page.mjs:160-164;render.test.mjs:2936). -
A climbing path names no file and a root-level file outside
public/is no longer read: verified (render.test.mjs:2893). -
The source record names the
public/read, as an optional field with no format change: verified (render-page.mjs:1693-1709;source-block.mjs:27,:84,:121). -
A later-drawn relative string shows the page folder's file, and each module's own file is still carried: verified (
render.interactive.test.mjs:572). -
The missing-image warning text: verified (
render.test.mjs:2893). -
Only the image resolver reads the site's folder; tsconfig, StyleX and message paths keep the project's: verified (
render-page.mjs:1098-1101,:1117). -
The governed command is
astryx experimental export, no record changes, and the guide names where a/path comes from: verified (export-pages.doc.mjs:60). -
An engineering owner decided the rule: verified (the owner's decision comment and approval at this revision).
-
The files and changes in Smallest restoration: verified (the restore takes the recorded
public/first, then the nearest,embedded-imports.mjs:361-376; the guide gains one passage of two sentences). -
The listed export, script, click, two-folder and unit tests: verified (all pass at this revision; the outside-a-project stylesheet names
/pics/bg.png). -
The 22-page before and after set: not reproduced (the set is not in the pull request); the in-tree tests and a live export cover each layout it names.
-
The outside-a-project test fails on the base and the traversal and no-
public/unit test passes there: verified (10 of 13 new cases fail on the base). -
An export run from
/finishes and warns: verified (render.test.mjs:2936). -
The recorded
public/wins over a nearer one, and a malformed record is ignored: verified (embedded-imports.test.mjs:82,:86). -
The test command passes at this revision: verified (1,482 passed, 3 skipped).
-
No new public API or hidden direction, and no internal context in public text: verified.
-
.changeset/render-public-images.md: not blocking, names only--reverseas the way back. -
packages/cli/api/render/_adapter.mjs: clear (keepsmain's recorded-file merge and addspublicDir;experimental importuses the same call). -
packages/cli/api/render/render.interactive.test.mjs: clear. -
packages/cli/api/render/render.test.mjs: clear. -
packages/cli/assets/docs/tree/export-pages.doc.mjs: not blocking, the new sentence names only--reverse. -
packages/cli/foundation/render/embedded-imports.mjs: not blocking, a percent-escaped root path is listed as missing on the way back. -
packages/cli/foundation/render/embedded-imports.test.mjs: clear. -
packages/cli/foundation/render/render-page.mjs: clear (the script rewrite now runs after the carried-text scan, beforemain's uncarried-image pass reads it). -
packages/cli/foundation/render/source-block.mjs: clear (keeps both record fields).
| { | ||
| type: 'prose', | ||
| text: 'The result is ONE file with nothing beside it: the markup, the CSS rules the page can use (from Core and from any stylesheet it imports, such as a theme), the page\u2019s own StyleX styles, local images as data: URIs, and the page\u2019s own script (see The page\u2019s script). For `experimental import`, it also carries every image, font or media file (up to 8 MB each) that a carried module or stylesheet names by a relative path inside the folder that holds the carried files, also when the page does not show it. It loads nothing from the network, so it opens from disk, attaches to a message, and displays inside a sandboxed frame that blocks the network; a frame that also blocks scripts shows the rendered markup. Colors follow the viewer\u2019s light or dark setting, and a `data-theme` of `light` or `dark` on the root element picks one. The file also carries the source of the page and of every local module, stylesheet, JSON file and image it imports, so whoever you share it with can read that code; keep secrets out of what the page imports.', | ||
| text: 'The result is ONE file with nothing beside it: the markup, the CSS rules the page can use (from Core and from any stylesheet it imports, such as a theme), the page\u2019s own StyleX styles, local images as data: URIs, and the page\u2019s own script (see The page\u2019s script). An image named from the site\u2019s root (`/pics/shoe.png`) comes from the site\u2019s `public/` folder, and `--reverse` puts it back there. That folder is the project\u2019s `public/`; when the project has none, it is the nearest `public/` above the page, inside the project (or, outside a project, inside the folder you run the command from). For `experimental import`, it also carries every image, font or media file (up to 8 MB each) that a carried module or stylesheet names by a relative path inside the folder that holds the carried files, also when the page does not show it. It loads nothing from the network, so it opens from disk, attaches to a message, and displays inside a sandboxed frame that blocks the network; a frame that also blocks scripts shows the rendered markup. Colors follow the viewer\u2019s light or dark setting, and a `data-theme` of `light` or `dark` on the root element picks one. The file also carries the source of the page and of every local module, stylesheet, JSON file and image it imports, so whoever you share it with can read that code; keep secrets out of what the page imports.', |
There was a problem hiding this comment.
Not blocking: since main added experimental import, every other line of this guide names the way back that way, and this new sentence is the only one that says --reverse. Both work, so experimental import (or --reverse) puts it back there keeps the guide in one voice; the changeset (lines 5 and 8) could say the same.
User impact
A page that names an image by a path from the site's root, as Vite and other bundlers serve
public/(<img src="/pics/shoe.png">), rendered a file with a broken image whenever itspublic/was not where the render looked. A site folder below a sharedpackage.json, or a page outside a project whosepublic/sits above its folder, lost its images, and an image the page draws only after the first paint was never carried.Problem and solution fit
public/first, then in the project's folder; a project often keepspublic/in a site folder below a sharedpackage.json, or has none.A
/path now resolves only from apublic/folder: the project's, else the nearest one above the page inside the project or the folder the command runs in; the search stops there, or at the filesystem root. A path that climbs out ofpublic/(/../secret.png) names no file, and a file at the site's root outsidepublic/is no longer read. The image is carried with the page's other files, and the source record names thepublic/the render read (publicDir, optional, no format change), so--reverseputs it back under thatpublic/at the same path. An image the page names in its code but draws only after the first paint is carried too, and the script shows the file the string names from the page's folder, as the browser and the first paint read it; a file beside the naming module is still carried for--reverse. A/path to no file warns: "/x.png was not found in public/, where a path from the site's root is read, so it is left as is and will not show." Only the image resolver reads the site's folder; tsconfig.json, StyleX and the paths in messages keep the project's folder.Expected behavior and authority
astryx experimental export(experimental,spec:AST-017FR27). No record changes; the render guide names where a/path comes from.public/only).Smallest restoration
foundation/render/render-page.mjs:siteRootOf(dir, scope), used by the asset resolver's context;assetRefresolves/paths insidepublic/only; root-relative files join the carried files, also those the page names only in code.foundation/render/embedded-imports.mjs: the carried-text scan reads/paths too, and--reverseexpects them back under the nearestpublic/.assets/docs/tree/export-pages.doc.mjs: one sentence on/paths.Evidence
render.test.mjs: outside a project, a page names/pics/shoe.pngin markup and in a CSSurl(); the file shows both as data: URIs,--reverseputs the image back underpublic/, and the restored folder renders again with no missing-image warning./../secret.png,/top.png(a file at the root, not inpublic/) and/gone.pngeach warn, and nothing is carried. A site folder inside a shared project finds its ownpublic/.render.interactive.test.mjs: a page that names/pics/shoe.pngby a string shows the data: URI once the script draws the page.render.interactive.test.mjs: a click shows/pics/later.pngand./near.png, which the first paint does not draw; both are data: URIs, and--reverseis exact with both files back. Three unit tests check where--reverseexpects a/file back.src/pages/pandpublic/; the file reversed alone in an empty folder; every source file compared byte for byte): 1 of 22 exact before, 22 of 22 after. The missing and traversal cases warn and carry nothing.public/test passes on the base, which already refused those paths in that layout./outside a project, of a page with/none.pngand nopublic/, finishes and warns../photo.png: after the click both show the page folder's file, and--reverseis exact with each module's ownphoto.pngback beside it.public/wins over a nearer one; a record that names../public,/public, a path through.., a missing folder or a non-string is ignored.Scope
Components:
astryx experimental exportTesting
pnpm exec vitest run --project node packages/cli/api/render packages/cli/foundation/render packages/cli/assets(all pass at this head).