handoff-app-next 2.0.0-canary.21 → 2.0.0-canary.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Changelog.md +189 -0
- package/dist/app/components/Component/Cards.jsx +2 -2
- package/dist/generated/build-meta.d.ts +2 -2
- package/dist/generated/build-meta.js +2 -2
- package/dist/lib/provision/check.js +56 -0
- package/dist/lib/provision/spec.js +3 -0
- package/dist/transformers/utils/html.d.ts +36 -3
- package/dist/transformers/utils/html.js +122 -7
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/app/app/[...slug]/DocCatchAllClient.tsx +3 -3
- package/src/app/app/account/captures/CapturesClient.tsx +216 -0
- package/src/app/app/account/captures/page.tsx +64 -0
- package/src/app/app/account/layout.tsx +2 -0
- package/src/app/app/account/sharing/SharingClient.tsx +154 -0
- package/src/app/app/account/sharing/page.tsx +48 -0
- package/src/app/app/actions/patterns.ts +20 -0
- package/src/app/app/api/handoff/capture/health/route.ts +7 -65
- package/src/app/app/api/handoff/capture/patterns/regenerate/route.ts +87 -0
- package/src/app/app/api/handoff/capture/queue/route.ts +39 -0
- package/src/app/app/api/handoff/capture/run/route.ts +59 -18
- package/src/app/app/api/handoff/patterns/[id]/clone/route.ts +23 -0
- package/src/app/app/api/handoff/patterns/[id]/restore/route.ts +48 -0
- package/src/app/app/api/handoff/patterns/facets/route.ts +57 -0
- package/src/app/app/api/handoff/patterns/route.ts +45 -7
- package/src/app/app/api/handoff/registry-sharing/route.ts +54 -0
- package/src/app/app/api/handoff/render/[id]/route.ts +19 -6
- package/src/app/app/api/handoff/render/collection/[id]/route.ts +148 -0
- package/src/app/app/api/handoff/share/collection/route.ts +125 -0
- package/src/app/app/api/handoff/share/unlock/route.ts +100 -0
- package/src/app/app/api/sync/upload/route.ts +10 -0
- package/src/app/app/design/DesignClient.tsx +1 -1
- package/src/app/app/developer/cli/page.tsx +34 -34
- package/src/app/app/developer/local-setup/page.tsx +3 -3
- package/src/app/app/developer/mcp/page.tsx +8 -8
- package/src/app/app/developer/page.tsx +17 -17
- package/src/app/app/developer/push-pull/page.tsx +35 -35
- package/src/app/app/foundations/border-radius/page.tsx +4 -4
- package/src/app/app/foundations/elevation/page.tsx +8 -8
- package/src/app/app/foundations/grid/page.tsx +16 -16
- package/src/app/app/foundations/icons/IconsPageClient.tsx +5 -5
- package/src/app/app/foundations/icons/[name]/SingleIconClient.tsx +8 -8
- package/src/app/app/foundations/logo/page.tsx +14 -14
- package/src/app/app/foundations/motion/page.tsx +8 -8
- package/src/app/app/foundations/spacing/page.tsx +4 -4
- package/src/app/app/foundations/typography/page.tsx +1 -1
- package/src/app/app/library/LibraryClient.tsx +673 -64
- package/src/app/app/page.tsx +24 -24
- package/src/app/app/s/[token]/page.tsx +54 -4
- package/src/app/app/system/NewComponentForm.tsx +2 -2
- package/src/app/app/system/SystemPageClient.tsx +2 -2
- package/src/app/app/system/changelog/ChangelogClient.tsx +1 -1
- package/src/app/app/system/component/[component]/ComponentDetailClient.tsx +3 -3
- package/src/app/app/system/health/ComponentHealthTable.tsx +2 -2
- package/src/app/app/system/health/ValidatorBreakdownBars.tsx +1 -1
- package/src/app/app/system/pattern/[pattern]/PatternDetailClient.tsx +20 -20
- package/src/app/components/Component/Cards.tsx +2 -2
- package/src/app/components/Component/ComponentLists.tsx +4 -4
- package/src/app/components/Component/ComponentWorkbenchDialog.tsx +3 -3
- package/src/app/components/Component/ElementVariantGrid.tsx +11 -11
- package/src/app/components/Component/InlineComponentEditor.tsx +7 -7
- package/src/app/components/Component/Preview.tsx +25 -25
- package/src/app/components/Component/VariantCodeDialog.tsx +3 -3
- package/src/app/components/CopyToClipboard.tsx +1 -1
- package/src/app/components/Footer.tsx +1 -1
- package/src/app/components/Foundations/BrandColorSwatches.tsx +1 -1
- package/src/app/components/Foundations/ColorContrast.tsx +6 -6
- package/src/app/components/Foundations/ColorGrid.tsx +4 -4
- package/src/app/components/Foundations/ColorInfo.tsx +1 -1
- package/src/app/components/Foundations/ColorSpaces.tsx +4 -4
- package/src/app/components/Foundations/ColorTailwind.tsx +5 -5
- package/src/app/components/Foundations/ColorsDisplay.tsx +1 -1
- package/src/app/components/Foundations/IconCatalogGrid.tsx +10 -10
- package/src/app/components/Foundations/RulesSheet.tsx +1 -1
- package/src/app/components/Foundations/TypographyExample.tsx +8 -8
- package/src/app/components/Guest/CollectionDoor.tsx +114 -0
- package/src/app/components/Layout/Header.tsx +1 -1
- package/src/app/components/Markdown/CodeHighlight.tsx +1 -1
- package/src/app/components/Markdown/MarkdownCodeBlock.tsx +3 -3
- package/src/app/components/Navigation/AnchorNav.tsx +1 -1
- package/src/app/components/Navigation/AnchorNavNew.tsx +1 -1
- package/src/app/components/Navigation/MainNav.tsx +2 -2
- package/src/app/components/Navigation/SideNav.tsx +9 -3
- package/src/app/components/Playground/DeletePageControl.tsx +116 -0
- package/src/app/components/Playground/PlaygroundBuilder.tsx +12 -0
- package/src/app/components/Playground/SavePatternDialog.tsx +48 -1
- package/src/app/components/SideNavNew.tsx +8 -8
- package/src/app/components/Validation/ValidationFrameworkResults.tsx +2 -2
- package/src/app/components/Validation/ValidationResults.tsx +2 -2
- package/src/app/components/cards/CardsWithIcons.tsx +4 -4
- package/src/app/components/library/AssetCard.tsx +119 -8
- package/src/app/components/library/CollectionShareDialog.tsx +229 -0
- package/src/app/components/library/DeletePatternDialog.tsx +114 -0
- package/src/app/components/library/FolderCard.tsx +109 -0
- package/src/app/components/library/LibrarySelectionBar.tsx +176 -0
- package/src/app/components/library/index.ts +3 -0
- package/src/app/components/ui/alert.tsx +1 -1
- package/src/app/components/ui/badge.tsx +1 -1
- package/src/app/components/ui/button.tsx +1 -1
- package/src/app/components/ui/json-tree-view.tsx +12 -12
- package/src/app/css/index.css +37 -35
- package/src/app/hooks/use-regenerate-capture.ts +88 -0
- package/src/app/lib/authz/vocab.ts +15 -1
- package/src/app/lib/db/capture-job-queries.ts +37 -0
- package/src/app/lib/db/grant-queries.ts +323 -15
- package/src/app/lib/db/migrations/0046_pattern_collections.sql +205 -0
- package/src/app/lib/db/migrations/0047_registry_sharing.sql +47 -0
- package/src/app/lib/db/migrations/0048_pattern_soft_delete.sql +47 -0
- package/src/app/lib/db/migrations/meta/_journal.json +21 -0
- package/src/app/lib/db/pattern-collections.ts +314 -0
- package/src/app/lib/db/pattern-list-filters.ts +145 -0
- package/src/app/lib/db/pattern-write.ts +112 -35
- package/src/app/lib/db/queries.ts +47 -6
- package/src/app/lib/db/schema-pg.ts +115 -2
- package/src/app/lib/db/sync-queries.ts +62 -2
- package/src/app/lib/generated/build-meta.ts +2 -2
- package/src/app/lib/library-folders.ts +144 -0
- package/src/app/lib/mcp/create-server.ts +8 -2
- package/src/app/lib/pattern-capture-regen.ts +206 -0
- package/src/app/lib/pattern-capture.ts +141 -17
- package/src/app/lib/pattern-deletion.ts +106 -0
- package/src/app/lib/preview-origin.ts +82 -2
- package/src/app/lib/render/collection-index.ts +205 -0
- package/src/app/lib/server/capture-queue-health.ts +114 -0
- package/src/app/lib/server/capture-worker.ts +3 -0
- package/src/app/lib/server/pattern-api-map.ts +22 -5
- package/src/app/lib/server/pattern-capture-reads.ts +77 -18
- package/src/app/lib/server/pattern-capture-regen.ts +204 -0
- package/src/app/lib/server/pattern-render-revision.ts +105 -0
- package/src/app/lib/server/pattern-share-picture.ts +99 -0
- package/src/app/lib/server/registry-sharing.ts +109 -0
- package/src/app/lib/server/render-auth.ts +232 -6
- package/src/app/lib/server/sync-capture.ts +35 -0
- package/src/app/lib/share-render-access.ts +188 -0
- package/src/app/lib/share-unlock-token.ts +163 -0
- package/src/app/proxy.ts +8 -2
- package/src/generated/build-meta.ts +2 -2
- package/src/lib/provision/check.ts +63 -0
- package/src/lib/provision/spec.ts +3 -0
- package/src/transformers/utils/html.ts +146 -7
package/Changelog.md
CHANGED
|
@@ -6,6 +6,195 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
and this project adheres to
|
|
7
7
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
8
8
|
|
|
9
|
+
## \[2.0.0-canary.24] - 2026-09-24
|
|
10
|
+
|
|
11
|
+
### Captures
|
|
12
|
+
|
|
13
|
+
- **Screenshots can now be asked for.** A save takes a picture, a library read notices a stale one
|
|
14
|
+
and — since canary.23 — a theme, token, appearance or component change invalidates every one. None
|
|
15
|
+
of that was a way to say "that picture is wrong, take it again". `/account/captures` regenerates
|
|
16
|
+
one page or the whole registry, and `POST /api/handoff/capture/patterns/regenerate` is the same
|
|
17
|
+
ask for anything else that needs it.
|
|
18
|
+
- **A manual ask overrides exactly one thing: "this page already has a current picture".** Every
|
|
19
|
+
stampede rule still applies — a page already queued, one asked for in the last five minutes, one
|
|
20
|
+
whose last capture failed in the last thirty, and a queue already at depth are all refused. The
|
|
21
|
+
cooldown memory is shared with the lazy read path rather than copied, so the button and the library
|
|
22
|
+
grid can see each other.
|
|
23
|
+
- **Regenerate-all is bounded at 100 pages a click and says so.** The drain does about twelve a
|
|
24
|
+
minute, so the reply is "Queued 100 of 317 pages. 217 not queued yet — the queue is full; click
|
|
25
|
+
again as it drains" rather than a silent truncation. A second click is additive, never
|
|
26
|
+
multiplicative: a page already in flight is skipped, and the queue's unique index refuses it
|
|
27
|
+
anyway.
|
|
28
|
+
- **The capture queue is visible.** `/account/captures` shows waiting/running/done/failed per kind
|
|
29
|
+
and the newest failure reasons verbatim — the column that previously needed a database client to
|
|
30
|
+
read, and the one that left a wrong `HANDOFF_APP_URL` invisible for a day. It is served by a new
|
|
31
|
+
`GET /api/handoff/capture/queue`, which is `capture/health`'s queue half **without** the Chromium
|
|
32
|
+
launch, so a panel can poll it while screenshots arrive.
|
|
33
|
+
|
|
34
|
+
### Library
|
|
35
|
+
|
|
36
|
+
- **A group is a folder, and a folder is one card.** The collapsible sections are gone: a group now
|
|
37
|
+
takes a single card in the same grid as the pages, showing a peek of its contents and its size,
|
|
38
|
+
instead of a band across the index that cost a full row whatever was in it. Ungrouped pages stay
|
|
39
|
+
loose on the shelf rather than being folded into a folder nobody named.
|
|
40
|
+
- **Clicking a folder opens it, with a breadcrumb back out.** The view is the existing `?group=`
|
|
41
|
+
query, so a folder of forty returns forty rather than the ones that happened to be loaded, and the
|
|
42
|
+
address carries it — a drilled-in folder can be bookmarked, shared and backed out of with the back
|
|
43
|
+
button. `?collection=<slug>` opens the same view, and is rewritten to the canonical `?group=`.
|
|
44
|
+
- **Pages can be filed from the grid.** Hovering a card you can edit reveals a checkbox; selecting any
|
|
45
|
+
number of them offers "Move to…", which lists the folders that exist, takes a new folder name, or
|
|
46
|
+
takes the pages out of a folder altogether. Filing previously existed only in the Save dialog on one
|
|
47
|
+
page at a time, so the one screen that shows which pages belong together could not act on it.
|
|
48
|
+
- The Share control for a collection moved from every section heading to the folder's own view, where
|
|
49
|
+
it sits next to the breadcrumb.
|
|
50
|
+
- **Pages and templates can be deleted.** Hovering a card you own reveals a delete icon, and the page
|
|
51
|
+
editor's toolbar has the same control for the page you have open; both ask to confirm and both leave
|
|
52
|
+
you somewhere sensible. The delete is reversible — the page leaves every list, every folder count and
|
|
53
|
+
every share link, but nothing is erased and an admin can restore it.
|
|
54
|
+
- A page's card now shows a **regenerated screenshot** as soon as the regenerate finishes. Retaking a
|
|
55
|
+
screenshot deliberately does not change the page, so the card's picture was being served from the
|
|
56
|
+
browser's cache and the new photograph was invisible until something else about the page moved.
|
|
57
|
+
|
|
58
|
+
### Sharing
|
|
59
|
+
|
|
60
|
+
- **Anonymous sharing is a setting a registry admin owns**, at **Account → Sharing**, replacing the
|
|
61
|
+
`HANDOFF_ANONYMOUS_SHARE` environment variable it shipped as in canary.23. The decision is the
|
|
62
|
+
client's per registry, and an environment variable put it behind Vercel project access — so the
|
|
63
|
+
person who owns the decision could neither see it nor make it. The setting defaults to **off**,
|
|
64
|
+
records who changed it and when, and takes effect on the **next request**: no redeploy, no purge.
|
|
65
|
+
- **Behaviour before and after is identical.** No registry had opted in, the new setting defaults off,
|
|
66
|
+
and every one of the render path's refusals is unchanged — an invalid, expired, revoked, exhausted,
|
|
67
|
+
passphrased, view-less or wrong-page token is refused exactly as it was, and the setting is one
|
|
68
|
+
more refusal in front of them rather than a replacement for any.
|
|
69
|
+
- **It costs no extra round trip.** The setting is read in the same query as the share link
|
|
70
|
+
(`resolveShareLinkForRender`), on the path that was already making that read.
|
|
71
|
+
- **The proxy's question changed** from "is the switch on" to "is a preview origin configured". A
|
|
72
|
+
per-request database read does not belong on a matcher that runs before every handler; a preview
|
|
73
|
+
origin is cheap and is what the two anchored path shapes actually depend on. **A deployment with no
|
|
74
|
+
preview origin still gains nothing**, and the shapes themselves are byte-identical.
|
|
75
|
+
- `HANDOFF_ANONYMOUS_SHARE` is **removed**, not kept as a second gate — two switches where one is
|
|
76
|
+
invisible is the problem this change exists to fix. `provision --check` now names the setting
|
|
77
|
+
(`anonymousShare.setting`), still warns when no preview origin is declared, and warns when a
|
|
78
|
+
leftover variable is still set.
|
|
79
|
+
- Migration `0047_registry_sharing` adds `handoff_registry_sharing`. Additive; no existing table is
|
|
80
|
+
touched.
|
|
81
|
+
- **A deleted page stops rendering behind a share link that was already sent.** A link cannot be
|
|
82
|
+
un-sent, so removing the page is now what closes it: the link is untouched, and the page refuses.
|
|
83
|
+
|
|
84
|
+
### Data
|
|
85
|
+
|
|
86
|
+
- Deleting a page records **when and by whom** in two new columns rather than overwriting the page's
|
|
87
|
+
lifecycle. A page that was "Approved" when it was deleted is "Approved" again if it is restored, and a
|
|
88
|
+
page somebody deliberately archived is no longer indistinguishable from one somebody deleted.
|
|
89
|
+
- `handoff push` carrying a delete no longer runs a hard `DELETE` — the last one in the app. A pushed
|
|
90
|
+
page that the registry had deleted is restored by the push rather than written invisibly.
|
|
91
|
+
|
|
92
|
+
### Internal
|
|
93
|
+
|
|
94
|
+
- The migration journal test now also catches two branches **racing for the same migration number**:
|
|
95
|
+
`idx` must be unique and no two migration files may share a filename number. The existing checks
|
|
96
|
+
guarded the sequence and passed on each branch alone, because the collision only exists between two
|
|
97
|
+
of them — and drizzle resolves it by applying one migration and skipping the other in silence.
|
|
98
|
+
|
|
99
|
+
## \[2.0.0-canary.23] - 2026-09-24
|
|
100
|
+
|
|
101
|
+
### Library
|
|
102
|
+
|
|
103
|
+
- The library index is **searchable, filterable and grouped**. The search box `/patterns` has always
|
|
104
|
+
had is now on the screen people use, and `group`, `status` and `tags` — columns that have existed
|
|
105
|
+
since migration 0029 and were never filterable from anywhere — each get a menu. Every filter runs
|
|
106
|
+
in SQL and pages with the cursor, so a facet describes the library rather than the fifty rows that
|
|
107
|
+
happen to be loaded.
|
|
108
|
+
- Pages are shown in **collapsible sections by group**, with an Ungrouped bucket. The section
|
|
109
|
+
headings and their counts come from a new `/api/handoff/patterns/facets` endpoint that counts the
|
|
110
|
+
whole lane, so a group whose pages all sit past the cursor still appears — with its true size and a
|
|
111
|
+
"Show all" that re-asks the server for it. A section says `8 of 40` when that is the truth.
|
|
112
|
+
- The Save page dialog completes the Group field from the groups already in use, so "Marketing" and
|
|
113
|
+
"marketing" stop becoming two sections. It is still free text: the first page in a new group has to
|
|
114
|
+
be able to name it.
|
|
115
|
+
|
|
116
|
+
### Collections
|
|
117
|
+
|
|
118
|
+
- **A group is now a record.** `handoff_pattern_collection` and an ordered membership table (migration
|
|
119
|
+
0046) hold the sets of pages the library index has been drawing sections for, and every group that
|
|
120
|
+
already existed was backfilled into one. Flat and unnested, modelled on asset collections — a page
|
|
121
|
+
can belong to more than one collection, which is why membership is a join table rather than a
|
|
122
|
+
column on the page.
|
|
123
|
+
- **Nothing on the index moves.** The section headings, their counts and "Show all" read the
|
|
124
|
+
collection instead of the column, and `handoff_pattern.group` stays the field the save dialog, the
|
|
125
|
+
CLI push and the MCP composer write — it is mirrored into membership on every write. `?group=` keeps
|
|
126
|
+
working and is joined by `?collection=<slug>`, which addresses the record rather than the name
|
|
127
|
+
printed on it.
|
|
128
|
+
- **One page type, one name.** `handoff_pattern.group`, `handoff_page_fixture.type` and
|
|
129
|
+
`handoff_page_import.page_type` were three names for the same idea. All three now resolve to a
|
|
130
|
+
collection: an imported page whose type was only ever recorded on the import row is filed under
|
|
131
|
+
that type in the library, and a folder typed two ways ("Marketing" / "marketing") is one section
|
|
132
|
+
rather than two.
|
|
133
|
+
- `handoff_share_link.resource_type` accepts `collection`. Vocabulary only — nothing mints or serves
|
|
134
|
+
such a link yet.
|
|
135
|
+
|
|
136
|
+
### Appearance
|
|
137
|
+
|
|
138
|
+
- **The dark theme is a neutral palette rather than an inverted one.** Dark-mode tokens are now
|
|
139
|
+
Tailwind `neutral` steps — pure gray, no hue — with a white foreground and solid icon colours;
|
|
140
|
+
`--destructive` is the one token that keeps a colour. Touches 60 files across the nav, cards,
|
|
141
|
+
validation results, alerts, badges and the JSON tree view, plus a button fix. This closes the
|
|
142
|
+
standing "dark mode is not good; rework the colour palette" item.
|
|
143
|
+
|
|
144
|
+
### Sharing
|
|
145
|
+
|
|
146
|
+
- **A share link can render a page to somebody with no account** — the exec review case. `?t=<token>`
|
|
147
|
+
on the render route resolves the link live, requires it to carry `view` and to cover the page (its
|
|
148
|
+
own page for a page link, the members for a collection link), and inherits revocation, expiry and
|
|
149
|
+
the use cap from the row rather than from anything cached in a cookie. `format=export` still needs
|
|
150
|
+
a CLI bearer.
|
|
151
|
+
- **It is off until the registry turns it on.** `HANDOFF_ANONYMOUS_SHARE` is a deployment setting,
|
|
152
|
+
default off, and it is the client's call per site. With it unset nothing changes: no new route is
|
|
153
|
+
reachable, the preview host's allowlist is byte-identical to what it was, and a valid share link
|
|
154
|
+
still needs an account. `provision --check` prints the setting's state next to the preview-origin
|
|
155
|
+
findings so the answer is visible per registry rather than remembered.
|
|
156
|
+
- **Served only from the preview origin**, the sibling host that strips `Cookie` and `Authorization`,
|
|
157
|
+
sets no cookie and holds nothing — so an imperfect renderer leaks no account, and the registry
|
|
158
|
+
origin still admits nobody anonymously. The allowlist gains exactly two anchored shapes: the page
|
|
159
|
+
document and the asset bytes it embeds. Listing routes, the render index, the thumbnail route and
|
|
160
|
+
every asset write endpoint stay refused.
|
|
161
|
+
- A **passphrased** link was refused on the single-page path at first, because the passphrase door is
|
|
162
|
+
`/s/<token>` and its credential is a cookie the preview host deletes — admitting the token alone
|
|
163
|
+
would have made the passphrase decorative. The collection surface below closes that with a door of
|
|
164
|
+
its own, so within this release a passphrase is enforced rather than deferred.
|
|
165
|
+
- **One link now opens a browsable collection.** A share link on a collection resolves to an index of
|
|
166
|
+
cards — each page's picture, click into its rendered document — served from the preview origin to
|
|
167
|
+
somebody with no account. `?brand=` is validated once on the index and carried into every card, so a
|
|
168
|
+
token proposal is reviewed on real pages rather than one page at a time.
|
|
169
|
+
- **A passphrased collection link works, and the passphrase is not decorative.** The passphrase is
|
|
170
|
+
still typed on the registry origin, where the scrypt check and the ten-try lockout live; success
|
|
171
|
+
mints a short-lived signed grant bound to that one link, which the reader carries to the preview
|
|
172
|
+
origin instead of a cookie the host would have deleted. The grant lets a reader past the passphrase
|
|
173
|
+
and past nothing else — revoked, expired, used-up and view-less links still refuse with a valid
|
|
174
|
+
grant in hand. It lasts two hours, so an unlocked URL forwarded within that window works; that is
|
|
175
|
+
the stated trade for a door on a host that holds no state.
|
|
176
|
+
- **Share a collection from the library.** A "Share" control on any section with a collection behind
|
|
177
|
+
it mints the link, public or passphrased, with an expiry (30 days by default). It refuses to mint on
|
|
178
|
+
a registry that has not turned anonymous sharing on or has no preview origin, rather than handing
|
|
179
|
+
back a link that opens nothing.
|
|
180
|
+
|
|
181
|
+
### Page thumbnails
|
|
182
|
+
|
|
183
|
+
- The capture drain processes **up to twelve jobs a tick in parallel waves** instead of two in
|
|
184
|
+
series. Concurrency is two by default, measured rather than guessed: a second browser context costs
|
|
185
|
+
~107MB of peak RSS, which fits the headroom a 512MB function has once `@sparticuz/chromium` is
|
|
186
|
+
extracted, and a third does not. `HANDOFF_CAPTURE_CONCURRENCY` raises it on a larger function.
|
|
187
|
+
- **Cloning a page and pushing one from the CLI now queue a thumbnail.** Both wrote the row directly
|
|
188
|
+
and skipped the enqueue that every editor save goes through, so a registry seeded by `handoff push`
|
|
189
|
+
showed silhouettes until somebody opened each page.
|
|
190
|
+
- A capture is now keyed on `hash(content, presentationRevision, rendererVersion)` rather than on
|
|
191
|
+
content alone. A theme edit, a token push or a component rebuild changed every picture in the
|
|
192
|
+
library and invalidated none of them; those pages are now detectably stale and are re-photographed
|
|
193
|
+
on the next library read, under the stampede limits that were already there.
|
|
194
|
+
- **Guests viewing a shared page see the picture.** `/s/<token>` rendered the `thumbnail` column,
|
|
195
|
+
which nothing writes, so a share link showed a heading and no image. It now resolves
|
|
196
|
+
`capture ?? column ?? silhouette` on the server and inlines it — no new anonymous image route.
|
|
197
|
+
|
|
9
198
|
## \[2.0.0-canary.21] - 2026-09-22
|
|
10
199
|
|
|
11
200
|
### Previews
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Check, X } from 'lucide-react';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
const PracticeLine = ({ line, type }) => (<li className="flex items-start gap-3">
|
|
4
|
-
{type === 'positive' ? (<Check className="mt-[5px] h-3 w-3 shrink-0 text-emerald-600" strokeWidth={3}/>) : type === 'negative' ? (<X className="mt-[5px] h-3 w-3 shrink-0 text-
|
|
4
|
+
{type === 'positive' ? (<Check className="mt-[5px] h-3 w-3 shrink-0 text-emerald-600" strokeWidth={3}/>) : type === 'negative' ? (<X className="mt-[5px] h-3 w-3 shrink-0 text-neutral-400" strokeWidth={3}/>) : (<span className="mt-[5px] h-3 w-3 shrink-0"/>)}
|
|
5
5
|
<p className="text-sm">{line}</p>
|
|
6
6
|
</li>);
|
|
7
7
|
const CardItem = ({ card }) => {
|
|
@@ -16,7 +16,7 @@ const Cards = ({ cards, maxCardsPerRow = 2, className = '' }) => {
|
|
|
16
16
|
return null;
|
|
17
17
|
}
|
|
18
18
|
return (<div className="grid grid-cols-[repeat(auto-fit,minmax(100%,1fr))] gap-6 sm:grid-cols-[repeat(auto-fit,minmax(300px,1fr))]">
|
|
19
|
-
{cards.map((card, index) => (<div key={`card-${index}`} className="relative rounded-lg border bg-gray-50 p-8 text-gray-600 dark:bg-
|
|
19
|
+
{cards.map((card, index) => (<div key={`card-${index}`} className="relative rounded-lg border bg-gray-50 p-8 text-gray-600 dark:bg-neutral-800">
|
|
20
20
|
<h2 className="mb-3 font-normal text-gray-700">
|
|
21
21
|
{card.title}
|
|
22
22
|
</h2>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/** Semver + alpha suffix stamped at build time. e.g. "2.0.0-alpha.20260609.da2f104f" */
|
|
2
|
-
export declare const BUILD_VERSION = "2.0.0-alpha.
|
|
2
|
+
export declare const BUILD_VERSION = "2.0.0-alpha.20260928.db920968";
|
|
3
3
|
/** ISO 8601 timestamp of this build. */
|
|
4
|
-
export declare const BUILD_DATE = "2026-09-
|
|
4
|
+
export declare const BUILD_DATE = "2026-09-29T02:25:28.472Z";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// AUTO-GENERATED by scripts/write-build-meta.mjs — do not edit.
|
|
2
2
|
// Regenerated on every `npm run build`.
|
|
3
3
|
/** Semver + alpha suffix stamped at build time. e.g. "2.0.0-alpha.20260609.da2f104f" */
|
|
4
|
-
export const BUILD_VERSION = "2.0.0-alpha.
|
|
4
|
+
export const BUILD_VERSION = "2.0.0-alpha.20260928.db920968";
|
|
5
5
|
/** ISO 8601 timestamp of this build. */
|
|
6
|
-
export const BUILD_DATE = "2026-09-
|
|
6
|
+
export const BUILD_DATE = "2026-09-29T02:25:28.472Z";
|
|
@@ -221,6 +221,61 @@ const previewOriginFindings = (cfg, previewHostname, attached, byKey, probe, dom
|
|
|
221
221
|
}
|
|
222
222
|
return out;
|
|
223
223
|
};
|
|
224
|
+
/**
|
|
225
|
+
* Anonymous sharing, reported **next to** the preview-origin checks and never inferred.
|
|
226
|
+
*
|
|
227
|
+
* The decision recorded on 2026-09-23 is that anonymous sharing is the client's call per registry, and
|
|
228
|
+
* a decision nobody can see is a decision nobody made. It shipped as `HANDOFF_ANONYMOUS_SHARE` and is
|
|
229
|
+
* now a registry **admin setting** in the database, at `/account/sharing`
|
|
230
|
+
* (`_control/projects/handoff-anonymous-share-admin-setting.md`) — precisely so that the client can
|
|
231
|
+
* see and make it without Vercel access.
|
|
232
|
+
*
|
|
233
|
+
* Which leaves this check with something it cannot read. It talks to the Vercel API, not to the
|
|
234
|
+
* registry's database, so the setting's state is **`unknown` from here** — and `unknown` is a level
|
|
235
|
+
* this file already uses for exactly this reason: "not established" and "wrong" are different answers
|
|
236
|
+
* and a provisioning check must not confuse them. It reports where the answer lives instead of
|
|
237
|
+
* guessing at it.
|
|
238
|
+
*
|
|
239
|
+
* Two things it *can* still establish, and both are the ones worth a line:
|
|
240
|
+
*
|
|
241
|
+
* - **The setting is inert without a preview origin.** The capability only ever admits a reader on the
|
|
242
|
+
* sibling host, so with no `HANDOFF_PREVIEW_ORIGIN` the toggle does nothing whatever it says: the
|
|
243
|
+
* client believes they turned sharing on, every link 404s, and nothing explains why. That is the
|
|
244
|
+
* warning this function has always carried, now stated against the prerequisite rather than against
|
|
245
|
+
* a state this tool can no longer read. A `warn`, not a `fail` — nothing is exposed, it simply
|
|
246
|
+
* cannot work.
|
|
247
|
+
* - **A leftover `HANDOFF_ANONYMOUS_SHARE`.** Nothing reads it any more. Left set, it is a switch that
|
|
248
|
+
* looks like it governs something and does not, which is the exact confusion the setting was moved
|
|
249
|
+
* to end.
|
|
250
|
+
*/
|
|
251
|
+
const anonymousShareFindings = (byKey, previewHostname) => {
|
|
252
|
+
const out = [];
|
|
253
|
+
out.push({
|
|
254
|
+
level: 'unknown',
|
|
255
|
+
code: 'anonymousShare.setting',
|
|
256
|
+
message: 'Anonymous sharing is a registry setting, not an environment variable — check Account → Sharing',
|
|
257
|
+
detail: 'Default off. An admin on the registry turns it on; this check reads the Vercel project and cannot see the database.',
|
|
258
|
+
});
|
|
259
|
+
if (!previewHostname) {
|
|
260
|
+
out.push({
|
|
261
|
+
level: 'warn',
|
|
262
|
+
code: 'anonymousShare.previewOrigin.missing',
|
|
263
|
+
message: 'This project declares no preview origin, so anonymous sharing cannot work even if it is switched on',
|
|
264
|
+
detail: 'The anonymous render is admitted on the preview hostname only, so with none configured every share link 404s and the setting does nothing.',
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
const stale = byKey.get('HANDOFF_ANONYMOUS_SHARE') ?? [];
|
|
268
|
+
if (stale.length) {
|
|
269
|
+
const values = stale.map((v) => readableValue(v)).filter((v) => typeof v === 'string');
|
|
270
|
+
out.push({
|
|
271
|
+
level: 'warn',
|
|
272
|
+
code: 'anonymousShare.env.stale',
|
|
273
|
+
message: `HANDOFF_ANONYMOUS_SHARE is still set${values.length ? ` (${values.map((v) => JSON.stringify(v)).join(', ')})` : ''} and is no longer read`,
|
|
274
|
+
detail: 'The switch moved to the registry admin screen (Account → Sharing). Remove this variable so it cannot look like it governs something.',
|
|
275
|
+
});
|
|
276
|
+
}
|
|
277
|
+
return out;
|
|
278
|
+
};
|
|
224
279
|
/** Redact unless the key is on the non-secret allowlist. */
|
|
225
280
|
/**
|
|
226
281
|
* The longest value worth printing. Every variable this tool names is a URL, a branch, a model id
|
|
@@ -509,6 +564,7 @@ export const checkProject = (cfg, state) => {
|
|
|
509
564
|
}
|
|
510
565
|
}
|
|
511
566
|
const pHost = previewHost(cfg)?.toLowerCase();
|
|
567
|
+
out.push(...anonymousShareFindings(byKey, pHost ?? null));
|
|
512
568
|
if (pHost) {
|
|
513
569
|
out.push(...previewOriginFindings(cfg, pHost, attached.has(pHost), byKey, state.previewProbe, domains));
|
|
514
570
|
const pd = attached.get(pHost);
|
|
@@ -32,6 +32,9 @@ export const NON_SECRET_KEYS = new Set([
|
|
|
32
32
|
'HANDOFF_PREVIEW_ORIGIN',
|
|
33
33
|
'NEXT_PUBLIC_HANDOFF_PREVIEW_ORIGIN',
|
|
34
34
|
'HANDOFF_PREVIEW_EMBED_HOSTS',
|
|
35
|
+
// Retired — anonymous sharing is a registry admin setting now (`/account/sharing`). Kept on this
|
|
36
|
+
// list so `provision --check` can print a leftover value when it warns that nothing reads it.
|
|
37
|
+
'HANDOFF_ANONYMOUS_SHARE',
|
|
35
38
|
'HANDOFF_REGISTRY_ORIGINS',
|
|
36
39
|
'NEXT_PUBLIC_HANDOFF_REGISTRY_ORIGINS',
|
|
37
40
|
'HANDOFF_APP_INTERNAL_ORIGIN',
|
|
@@ -1,7 +1,40 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
2
|
+
* Take everything between `<body>` and `</body>`.
|
|
3
|
+
*
|
|
4
|
+
* ## Why this parses, and why it masks first
|
|
5
|
+
*
|
|
6
|
+
* The parse earns its place: `parse(…).querySelector('body').innerHTML` also *normalises* what it
|
|
7
|
+
* re-serializes — `<path … />` becomes `<path …></path>`, an implicitly-closed `<p>` gains its
|
|
8
|
+
* `</p>` — and that normalised form is what the reviewed HubSpot modules in production contain. A
|
|
9
|
+
* plain string slice is faithful to the template but diverges from production on every component
|
|
10
|
+
* with an inline SVG: 37 of one registry's 69 published modules, 76 tag tokens.
|
|
11
|
+
*
|
|
12
|
+
* What the parse must *not* do is read the template's Handlebars as markup. `preview` is very often
|
|
13
|
+
* not HTML: for a Handlebars component it is `template.hbs`, and this function's output becomes
|
|
14
|
+
* `componentData.code` — the source every downstream consumer transpiles, including the HubSpot
|
|
15
|
+
* module emitter. node-html-parser has no concept of `{{!-- … --}}`, so an HTML tag *named* inside a
|
|
16
|
+
* Handlebars comment is a real tag to it:
|
|
17
|
+
*
|
|
18
|
+
* {{!-- A navigation item with no url renders dead rather than disappearing. An <a> without
|
|
19
|
+
* href is not focusable or clickable. --}}
|
|
20
|
+
* <a {{#if this.url}}href="{{this.url}}" {{/if}}class="accordion-button">…</a>
|
|
21
|
+
*
|
|
22
|
+
* The parser opens a phantom `<a>` from the prose, spends the template's real `</a>` closing it, and
|
|
23
|
+
* rebalances the rest of the document around the genuine `<a>` that is now unclosed — turning
|
|
24
|
+
* ancestor `<div>` openers into closers and discarding the ones it can no longer match. The result
|
|
25
|
+
* stays balanced, so nothing downstream can tell. One registry's nav component came back with 32
|
|
26
|
+
* `<div>` pairs instead of 35 and 4 `<h6>` pairs instead of 5; the mobile drawer's flex wrapper
|
|
27
|
+
* vanished outright and its contents rendered as siblings of the drawer on the live site.
|
|
28
|
+
*
|
|
29
|
+
* Masking the Handlebars first takes away the parser's ability to see inside one, and keeps the
|
|
30
|
+
* normalisation. Comments are the expensive case but not the only one — a `<` inside a helper
|
|
31
|
+
* argument, `{{concat "<span>" x}}`, is eaten exactly the same way — so every construct is masked
|
|
32
|
+
* except the one in {@link maskHandlebars} that must not be.
|
|
33
|
+
*
|
|
34
|
+
* Non-HTML input (a React component's source, say) has no `<body>` and comes back untouched.
|
|
35
|
+
*
|
|
36
|
+
* @param preview - The HTML (or template) string
|
|
37
|
+
* @returns The body's contents, trimmed; the whole input when there is no `<body>`
|
|
5
38
|
*/
|
|
6
39
|
export declare const trimPreview: (preview: string) => string;
|
|
7
40
|
/**
|
|
@@ -1,9 +1,113 @@
|
|
|
1
1
|
import { parse } from 'node-html-parser';
|
|
2
2
|
import prettier from 'prettier';
|
|
3
|
+
const BODY_OPEN = /<body(?=[\s/>])[^>]*>/i;
|
|
4
|
+
const BODY_CLOSE = '</body>';
|
|
3
5
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
|
|
6
|
+
* Every Handlebars construct, longest delimiter first so `{{!-- … --}}`, `{{{{raw}}}}` and
|
|
7
|
+
* `{{{ … }}}` are each claimed whole before the plain `{{ … }}` alternative can bite off a prefix.
|
|
8
|
+
*/
|
|
9
|
+
const HANDLEBARS = /\{\{!--[\s\S]*?--\}\}|\{\{!(?!--)[\s\S]*?\}\}|\{\{\{\{[\s\S]*?\}\}\}\}|\{\{\{[\s\S]*?\}\}\}|\{\{[\s\S]*?\}\}/g;
|
|
10
|
+
/**
|
|
11
|
+
* Replace every Handlebars construct with an opaque token, so the HTML parser cannot read markup
|
|
12
|
+
* that exists only inside one.
|
|
13
|
+
*
|
|
14
|
+
* Three properties make the round trip exact:
|
|
15
|
+
*
|
|
16
|
+
* 1. **Inert.** A token is `[a-z]` and digits only — no `<`, `>`, `&`, quote or whitespace. An HTML
|
|
17
|
+
* serializer has nothing to escape, normalise or re-order, and that holds in text, in an
|
|
18
|
+
* attribute value, and in attribute-*name* position alike — which is where
|
|
19
|
+
* `<a {{#if this.url}}href="{{this.url}}" {{/if}}class="nav-link">` puts one.
|
|
20
|
+
* 2. **Collision-free.** The nonce grows until it occurs nowhere in the input, so nothing the author
|
|
21
|
+
* wrote can be mistaken for a token on the way back.
|
|
22
|
+
* 3. **Unambiguous.** The nonce never ends in a digit, so `<nonce>(\d+)<nonce>` cannot straddle two
|
|
23
|
+
* adjacent tokens.
|
|
24
|
+
*
|
|
25
|
+
* ## The one construct that is left alone
|
|
26
|
+
*
|
|
27
|
+
* A construct in **tag-name** position — `<{{properties.header}} class="mb-0">` — must stay
|
|
28
|
+
* unmasked. Unmasked, `{` cannot open a tag name, so the parser treats the whole thing as text and
|
|
29
|
+
* passes it through untouched. Masked, it becomes a *valid* tag name, and since the matching
|
|
30
|
+
* `</{{properties.header}}>` masks to a different token the parser sees an unclosed element and
|
|
31
|
+
* rebalances around it. A measured registry's simple-title component loses a `<section>` and two
|
|
32
|
+
* `<div>` pairs that way — the very damage this function exists to prevent, reintroduced by
|
|
33
|
+
* over-masking.
|
|
34
|
+
*/
|
|
35
|
+
const maskHandlebars = (source) => {
|
|
36
|
+
let nonce = 'hbmask';
|
|
37
|
+
while (source.includes(nonce)) {
|
|
38
|
+
nonce += 'x';
|
|
39
|
+
}
|
|
40
|
+
const spans = [];
|
|
41
|
+
const masked = source.replace(HANDLEBARS, (construct, offset) => {
|
|
42
|
+
const inTagNamePosition = source[offset - 1] === '<' || (source[offset - 1] === '/' && source[offset - 2] === '<');
|
|
43
|
+
if (inTagNamePosition) {
|
|
44
|
+
return construct;
|
|
45
|
+
}
|
|
46
|
+
spans.push(construct);
|
|
47
|
+
return `${nonce}${spans.length - 1}${nonce}`;
|
|
48
|
+
});
|
|
49
|
+
return { masked, nonce, spans };
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Put the Handlebars back.
|
|
53
|
+
*
|
|
54
|
+
* Returns `null` when the parser did not hand every token back intact: a leftover nonce means a
|
|
55
|
+
* token was split or rewritten, and a half-restored template is worse than an unparsed one. The
|
|
56
|
+
* caller falls back to the slice rather than emitting it.
|
|
57
|
+
*/
|
|
58
|
+
const unmaskHandlebars = (markup, { nonce, spans }) => {
|
|
59
|
+
const restored = markup.replace(new RegExp(`${nonce}(\\d+)${nonce}`, 'g'), (whole, index) => spans[Number(index)] ?? whole);
|
|
60
|
+
return restored.includes(nonce) ? null : restored;
|
|
61
|
+
};
|
|
62
|
+
/** The body's contents by string search: what the parse path falls back to. Faithful, unnormalised. */
|
|
63
|
+
const sliceBody = (source) => {
|
|
64
|
+
const open = BODY_OPEN.exec(source);
|
|
65
|
+
if (!open) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
68
|
+
const start = open.index + open[0].length;
|
|
69
|
+
// Last, not first: a document whose body contains a nested `</body>` still ends at its own. A body
|
|
70
|
+
// left unclosed runs to the end of the input.
|
|
71
|
+
const close = source.toLowerCase().lastIndexOf(BODY_CLOSE);
|
|
72
|
+
return source.slice(start, close === -1 || close < start ? source.length : close).trim();
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Take everything between `<body>` and `</body>`.
|
|
76
|
+
*
|
|
77
|
+
* ## Why this parses, and why it masks first
|
|
78
|
+
*
|
|
79
|
+
* The parse earns its place: `parse(…).querySelector('body').innerHTML` also *normalises* what it
|
|
80
|
+
* re-serializes — `<path … />` becomes `<path …></path>`, an implicitly-closed `<p>` gains its
|
|
81
|
+
* `</p>` — and that normalised form is what the reviewed HubSpot modules in production contain. A
|
|
82
|
+
* plain string slice is faithful to the template but diverges from production on every component
|
|
83
|
+
* with an inline SVG: 37 of one registry's 69 published modules, 76 tag tokens.
|
|
84
|
+
*
|
|
85
|
+
* What the parse must *not* do is read the template's Handlebars as markup. `preview` is very often
|
|
86
|
+
* not HTML: for a Handlebars component it is `template.hbs`, and this function's output becomes
|
|
87
|
+
* `componentData.code` — the source every downstream consumer transpiles, including the HubSpot
|
|
88
|
+
* module emitter. node-html-parser has no concept of `{{!-- … --}}`, so an HTML tag *named* inside a
|
|
89
|
+
* Handlebars comment is a real tag to it:
|
|
90
|
+
*
|
|
91
|
+
* {{!-- A navigation item with no url renders dead rather than disappearing. An <a> without
|
|
92
|
+
* href is not focusable or clickable. --}}
|
|
93
|
+
* <a {{#if this.url}}href="{{this.url}}" {{/if}}class="accordion-button">…</a>
|
|
94
|
+
*
|
|
95
|
+
* The parser opens a phantom `<a>` from the prose, spends the template's real `</a>` closing it, and
|
|
96
|
+
* rebalances the rest of the document around the genuine `<a>` that is now unclosed — turning
|
|
97
|
+
* ancestor `<div>` openers into closers and discarding the ones it can no longer match. The result
|
|
98
|
+
* stays balanced, so nothing downstream can tell. One registry's nav component came back with 32
|
|
99
|
+
* `<div>` pairs instead of 35 and 4 `<h6>` pairs instead of 5; the mobile drawer's flex wrapper
|
|
100
|
+
* vanished outright and its contents rendered as siblings of the drawer on the live site.
|
|
101
|
+
*
|
|
102
|
+
* Masking the Handlebars first takes away the parser's ability to see inside one, and keeps the
|
|
103
|
+
* normalisation. Comments are the expensive case but not the only one — a `<` inside a helper
|
|
104
|
+
* argument, `{{concat "<span>" x}}`, is eaten exactly the same way — so every construct is masked
|
|
105
|
+
* except the one in {@link maskHandlebars} that must not be.
|
|
106
|
+
*
|
|
107
|
+
* Non-HTML input (a React component's source, say) has no `<body>` and comes back untouched.
|
|
108
|
+
*
|
|
109
|
+
* @param preview - The HTML (or template) string
|
|
110
|
+
* @returns The body's contents, trimmed; the whole input when there is no `<body>`
|
|
7
111
|
*/
|
|
8
112
|
export const trimPreview = (preview) => {
|
|
9
113
|
if (typeof preview !== 'string') {
|
|
@@ -13,14 +117,25 @@ export const trimPreview = (preview) => {
|
|
|
13
117
|
if (!normalizedPreview) {
|
|
14
118
|
return '';
|
|
15
119
|
}
|
|
120
|
+
const masked = maskHandlebars(normalizedPreview);
|
|
16
121
|
try {
|
|
17
|
-
|
|
18
|
-
|
|
122
|
+
// `comment: true` keeps `<!-- … -->`. An authoring note is content the template meant to carry;
|
|
123
|
+
// dropping it is loss, not normalisation, and the default drops it.
|
|
124
|
+
const body = parse(masked.masked, { comment: true }).querySelector('body');
|
|
125
|
+
if (!body) {
|
|
126
|
+
return normalizedPreview;
|
|
127
|
+
}
|
|
128
|
+
const restored = unmaskHandlebars(body.innerHTML.trim(), masked);
|
|
129
|
+
if (restored !== null) {
|
|
130
|
+
return restored;
|
|
131
|
+
}
|
|
19
132
|
}
|
|
20
133
|
catch {
|
|
21
|
-
// Keep build resilient if parser fails on malformed HTML.
|
|
22
|
-
return normalizedPreview;
|
|
134
|
+
// Keep the build resilient if the parser fails on malformed HTML.
|
|
23
135
|
}
|
|
136
|
+
// The parse either threw or did not hand every token back. Fall back to the slice: no
|
|
137
|
+
// normalisation, but nothing invented and nothing lost.
|
|
138
|
+
return sliceBody(normalizedPreview) ?? normalizedPreview;
|
|
24
139
|
};
|
|
25
140
|
/**
|
|
26
141
|
* Formats HTML content using Prettier
|