create-ailk 0.40.3 → 0.42.0
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/README.md +31 -1
- package/component-catalog.json +6 -0
- package/dist/add-route.d.ts +2 -6
- package/dist/add-route.js +2 -43
- package/dist/export-content.js +11 -3
- package/dist/language-import.js +5 -2
- package/dist/lib/env-catalog.js +5 -1
- package/dist/lib/import-mdx.js +10 -7
- package/dist/magnet-page.d.ts +36 -0
- package/dist/magnet-page.js +70 -0
- package/dist/module-architecture.js +14 -48
- package/dist/routes.d.ts +44 -2
- package/dist/routes.js +766 -33
- package/dist/surfaces.d.ts +18 -2
- package/dist/surfaces.js +85 -21
- package/dist/topology.js +0 -1
- package/dist/update.d.ts +16 -1
- package/dist/update.js +273 -7
- package/package.json +3 -3
- package/templates/.claude/hooks/template-guard.sh +145 -36
- package/templates/CLAUDE.md +1 -1
- package/templates/apps/api/.env.example +2 -1
- package/templates/apps/api/CLAUDE.md +1 -0
- package/templates/apps/mcp/CLAUDE.md +5 -3
- package/templates/apps/web/.env.example +5 -6
- package/templates/apps/web/CLAUDE.md +41 -7
- package/templates/apps/web/app/[locale]/layout.tsx +6 -3
- package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +37 -1
- package/templates/apps/web/app/sitemap.xml/__tests__/site-listing.test.ts +28 -0
- package/templates/apps/web/lib/__tests__/deck-page.test.ts +17 -0
- package/templates/apps/web/lib/__tests__/magnet-routes.test.ts +1 -0
- package/templates/apps/web/lib/__tests__/page-chrome.test.ts +42 -0
- package/templates/apps/web/lib/__tests__/route-paths.test.ts +57 -0
- package/templates/apps/web/lib/__tests__/structured-data.test.tsx +22 -7
- package/templates/apps/web/lib/deck-page.ts +20 -1
- package/templates/apps/web/lib/mcp-oauth.ts +14 -10
- package/templates/apps/web/lib/page-chrome.ts +11 -5
- package/templates/apps/web/lib/route-paths.ts +22 -0
- package/templates/apps/web/lib/services-path.ts +27 -18
- package/templates/apps/web/messages/en.json +0 -9
- package/templates/apps/web/middleware.ts +2 -1
- package/templates/apps/web/next.config.mjs +123 -2
- package/templates/apps/web/src/lib/routes.ts +4 -2
- package/versions.json +50 -50
- package/templates/apps/web/lib/deliverable-grant.ts +0 -18
package/dist/surfaces.d.ts
CHANGED
|
@@ -55,6 +55,22 @@ export declare const PAGE_PACKAGE_ROUTES: readonly {
|
|
|
55
55
|
}[];
|
|
56
56
|
/** The page package that ships `route` (a ROUTE_ROOT-relative dir), or `undefined` when no page package does. */
|
|
57
57
|
export declare function pagePackageOfRoute(route: string): string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* #11385 D6 — the route families a site may rename with `<family>: { path:
|
|
60
|
+
* /<segment> }` in `content/_site.mdx`, family key → convention segment. A
|
|
61
|
+
* copy of `@working-theory/site-config`'s record (create-ailk imports nothing
|
|
62
|
+
* at runtime); `tests/routes/route-renames-parity.test.ts` pins the two equal.
|
|
63
|
+
*/
|
|
64
|
+
export declare const RENAMABLE_ROUTE_FAMILIES: Readonly<Record<string, string>>;
|
|
65
|
+
/** #11385 D6 — first segments no rename may take; a copy of site-config's `RESERVED_ROUTE_SEGMENTS`. */
|
|
66
|
+
export declare const RESERVED_ROUTE_SEGMENTS: readonly string[];
|
|
67
|
+
/**
|
|
68
|
+
* #11385 D7 — the first segment of every `@working-theory/templates` `ROUTES`
|
|
69
|
+
* row and of every legacy route it still redirects from, sorted: the routes a
|
|
70
|
+
* rename may not take. A copy (create-ailk cannot
|
|
71
|
+
* read `ROUTES` at runtime); the parity test pins it to the routes map.
|
|
72
|
+
*/
|
|
73
|
+
export declare const ROUTES_FIRST_SEGMENTS: readonly string[];
|
|
58
74
|
/** Template-relative route directories that are always copied. */
|
|
59
75
|
export declare const CORE_ROUTE_DIRS: readonly string[];
|
|
60
76
|
/**
|
|
@@ -212,8 +228,8 @@ export declare function isUnservedSurfaceContent(path: string, enabled: readonly
|
|
|
212
228
|
* so without it nothing can host a foreign file there. A module-less
|
|
213
229
|
* surface's segment hosts other modules' companion routes by design —
|
|
214
230
|
* signal-collectors' `projects/apply` and `careers/apply` walks
|
|
215
|
-
* (`NESTED_FOREIGN_MODULE_ENTRIES` in `sync-routes.ts`, #8840 D13) and
|
|
216
|
-
*
|
|
231
|
+
* (`NESTED_FOREIGN_MODULE_ENTRIES` in `sync-routes.ts`, #8840 D13) — and
|
|
232
|
+
* those keep landing.
|
|
217
233
|
*/
|
|
218
234
|
export declare function isUnservedSurfaceRoute(path: string, enabled: readonly string[]): boolean;
|
|
219
235
|
/**
|
package/dist/surfaces.js
CHANGED
|
@@ -96,7 +96,7 @@ export function isRemovedPublicRoutePath(destRel) {
|
|
|
96
96
|
const SITE_PAGES_PREFIXES = [
|
|
97
97
|
"(authed)/leads", "[slug]", "about", "alternatives", "careers", "case-studies", "clients",
|
|
98
98
|
"contact", "courses", "events", "faq", "features", "for", "glossary", "how-to", "integrations",
|
|
99
|
-
"launch-service", "newsletter", "partners", "portfolio", "pricing", "privacy", "products",
|
|
99
|
+
"launch-service", "newsletter", "partners", "portfolio", "pricing", "privacy", "private/[slug]", "products",
|
|
100
100
|
"projects", "purchase-policy", "resources", "services", "software", "team", "tech-articles",
|
|
101
101
|
"templates", "terms", "testimonials", "thanks", "unsubscribe", "vs", "whitepapers",
|
|
102
102
|
"working-agreement",
|
|
@@ -107,7 +107,7 @@ const SITE_PAGES_PAGES = [
|
|
|
107
107
|
"clients", "contact", "courses", "courses/[slug]", "events", "events/[slug]", "faq", "features",
|
|
108
108
|
"features/[slug]", "for", "for/[slug]", "glossary", "how-to", "how-to/[slug]", "integrations",
|
|
109
109
|
"integrations/[slug]", "launch-service", "newsletter", "partners", "partners/[slug]",
|
|
110
|
-
"portfolio", "portfolio/[slug]", "pricing", "pricing/[slug]", "privacy", "products",
|
|
110
|
+
"portfolio", "portfolio/[slug]", "pricing", "pricing/[slug]", "privacy", "private/[slug]", "products",
|
|
111
111
|
"products/[slug]", "projects", "projects/[slug]", "purchase-policy", "resources",
|
|
112
112
|
"resources/[slug]", "services", "services/[slug]", "services/[slug]/[child]", "software",
|
|
113
113
|
"software/[slug]", "team", "team/[slug]", "tech-articles", "tech-articles/[slug]", "templates",
|
|
@@ -180,6 +180,25 @@ export const PAGE_PACKAGE_ROUTES = [
|
|
|
180
180
|
siteOwned: [],
|
|
181
181
|
pages: ["flows/[slug]", "flows/[slug]/start", "flows/[slug]/verify", "flows/[slug]/results/[payload]"],
|
|
182
182
|
},
|
|
183
|
+
// #11657 — the magnet pages: one row per prefix, and one per careers walk
|
|
184
|
+
// the manifest adopts from site-pages' `careers` prefix. Each walk's
|
|
185
|
+
// prefix is more specific than site-pages' `careers`, so
|
|
186
|
+
// `pagePackageOfRoute` (most specific prefix wins, #11659 D10) names this
|
|
187
|
+
// package for it.
|
|
188
|
+
{
|
|
189
|
+
package: "@working-theory/ui-signal-collectors",
|
|
190
|
+
prefix: "reports",
|
|
191
|
+
siteOwned: [],
|
|
192
|
+
pages: ["reports", "reports/[slug]", "reports/[slug]/start"],
|
|
193
|
+
},
|
|
194
|
+
{ package: "@working-theory/ui-signal-collectors", prefix: "trial", siteOwned: [], pages: ["trial", "trial/request"] },
|
|
195
|
+
{ package: "@working-theory/ui-signal-collectors", prefix: "careers/apply", siteOwned: [], pages: ["careers/apply"] },
|
|
196
|
+
{
|
|
197
|
+
package: "@working-theory/ui-signal-collectors",
|
|
198
|
+
prefix: "careers/[slug]/apply",
|
|
199
|
+
siteOwned: [],
|
|
200
|
+
pages: ["careers/[slug]/apply"],
|
|
201
|
+
},
|
|
183
202
|
// #11252 — the booking pages; likewise absent from the snapshot. One entry
|
|
184
203
|
// per prefix of the package's two-prefix manifest.
|
|
185
204
|
{ package: "@working-theory/ui-scheduling", prefix: "meet", siteOwned: [], pages: ["meet", "meet/[slug]", "meet/confirmed"] },
|
|
@@ -196,9 +215,9 @@ export const PAGE_PACKAGE_ROUTES = [
|
|
|
196
215
|
// #11254 — the docs and blog catch-alls; likewise absent from the snapshot,
|
|
197
216
|
// one entry per prefix of the package's two-prefix manifest.
|
|
198
217
|
{ package: "@working-theory/ui-docs-blog", prefix: "docs", siteOwned: [], pages: ["docs/[[...slug]]"] },
|
|
199
|
-
{ package: "@working-theory/ui-docs-blog", prefix: "blog", siteOwned: [], pages: ["blog/[[...slug]]"] },
|
|
218
|
+
{ package: "@working-theory/ui-docs-blog", prefix: "blog", siteOwned: [], pages: ["blog/[[...slug]]", "blog/category/[tag]"] },
|
|
200
219
|
// #11259 — the base website pages; likewise absent from the snapshot, one
|
|
201
|
-
// entry per prefix of the package's
|
|
220
|
+
// entry per prefix of the package's 39-prefix manifest. Gated on the
|
|
202
221
|
// site's surfaces and public tree, as the generator gates them.
|
|
203
222
|
...SITE_PAGES_PREFIXES.map((prefix) => {
|
|
204
223
|
const under = (path) => path === prefix || path.startsWith(`${prefix}/`);
|
|
@@ -214,8 +233,59 @@ export const PAGE_PACKAGE_ROUTES = [
|
|
|
214
233
|
/** The page package that ships `route` (a ROUTE_ROOT-relative dir), or `undefined` when no page package does. */
|
|
215
234
|
export function pagePackageOfRoute(route) {
|
|
216
235
|
const under = (dir) => route === dir || route.startsWith(`${dir}/`);
|
|
217
|
-
|
|
236
|
+
// #11659 D10 — the most specific prefix wins, and a prefix segment after
|
|
237
|
+
// the first that is a `[param]` matches any one route segment, so
|
|
238
|
+
// `private/convo` is site-pages' (`private/[slug]`) and `private` stays
|
|
239
|
+
// ui-scheduling's. A first segment matches only literally.
|
|
240
|
+
const segments = route.split("/");
|
|
241
|
+
const prefixMatches = (prefix) => prefix
|
|
242
|
+
.split("/")
|
|
243
|
+
.every((part, i) => part === segments[i] || (i > 0 && i < segments.length && /^\[[^\]]+\]$/.test(part)));
|
|
244
|
+
let best;
|
|
245
|
+
for (const entry of PAGE_PACKAGE_ROUTES) {
|
|
246
|
+
if (!prefixMatches(entry.prefix) || entry.siteOwned.some(under))
|
|
247
|
+
continue;
|
|
248
|
+
if (best === undefined || entry.prefix.split("/").length > best.prefix.split("/").length)
|
|
249
|
+
best = entry;
|
|
250
|
+
}
|
|
251
|
+
return best?.package;
|
|
218
252
|
}
|
|
253
|
+
/**
|
|
254
|
+
* #11385 D6 — the route families a site may rename with `<family>: { path:
|
|
255
|
+
* /<segment> }` in `content/_site.mdx`, family key → convention segment. A
|
|
256
|
+
* copy of `@working-theory/site-config`'s record (create-ailk imports nothing
|
|
257
|
+
* at runtime); `tests/routes/route-renames-parity.test.ts` pins the two equal.
|
|
258
|
+
*/
|
|
259
|
+
export const RENAMABLE_ROUTE_FAMILIES = Object.freeze({
|
|
260
|
+
meet: "meet",
|
|
261
|
+
caseStudies: "case-studies",
|
|
262
|
+
portfolio: "portfolio",
|
|
263
|
+
team: "team",
|
|
264
|
+
courses: "courses",
|
|
265
|
+
events: "events",
|
|
266
|
+
integrations: "integrations",
|
|
267
|
+
partners: "partners",
|
|
268
|
+
features: "features",
|
|
269
|
+
products: "products",
|
|
270
|
+
resources: "resources",
|
|
271
|
+
for: "for",
|
|
272
|
+
});
|
|
273
|
+
/** #11385 D6 — first segments no rename may take; a copy of site-config's `RESERVED_ROUTE_SEGMENTS`. */
|
|
274
|
+
export const RESERVED_ROUTE_SEGMENTS = Object.freeze(["api", "og", "v1", "apple-icon"]);
|
|
275
|
+
/**
|
|
276
|
+
* #11385 D7 — the first segment of every `@working-theory/templates` `ROUTES`
|
|
277
|
+
* row and of every legacy route it still redirects from, sorted: the routes a
|
|
278
|
+
* rename may not take. A copy (create-ailk cannot
|
|
279
|
+
* read `ROUTES` at runtime); the parity test pins it to the routes map.
|
|
280
|
+
*/
|
|
281
|
+
export const ROUTES_FIRST_SEGMENTS = Object.freeze([
|
|
282
|
+
"about", "account", "alternatives", "appointments", "blog", "careers", "case-studies", "clients", "consent",
|
|
283
|
+
"contact", "courses", "docs", "downloads", "events", "faq", "features", "flows", "for", "forgot-password", "glossary",
|
|
284
|
+
"how-to", "integrations", "launch-service", "meet", "newsletter", "partners", "portfolio", "pricing", "privacy",
|
|
285
|
+
"private", "products", "projects", "purchase", "purchase-policy", "reports", "reset-password", "resources",
|
|
286
|
+
"schedule", "services", "sign-in", "sign-up", "software", "team", "tech-articles", "templates", "terms", "testimonials",
|
|
287
|
+
"thanks", "trial", "unsubscribe", "verify-email", "vs", "whitepapers", "working-agreement",
|
|
288
|
+
]);
|
|
219
289
|
/** Template-relative route directories that are always copied. */
|
|
220
290
|
export const CORE_ROUTE_DIRS = [
|
|
221
291
|
`${ROUTE_ROOT}/about`,
|
|
@@ -734,8 +804,8 @@ export function isUnservedSurfaceContent(path, enabled) {
|
|
|
734
804
|
* so without it nothing can host a foreign file there. A module-less
|
|
735
805
|
* surface's segment hosts other modules' companion routes by design —
|
|
736
806
|
* signal-collectors' `projects/apply` and `careers/apply` walks
|
|
737
|
-
* (`NESTED_FOREIGN_MODULE_ENTRIES` in `sync-routes.ts`, #8840 D13) and
|
|
738
|
-
*
|
|
807
|
+
* (`NESTED_FOREIGN_MODULE_ENTRIES` in `sync-routes.ts`, #8840 D13) — and
|
|
808
|
+
* those keep landing.
|
|
739
809
|
*/
|
|
740
810
|
export function isUnservedSurfaceRoute(path, enabled) {
|
|
741
811
|
const on = new Set(enabled);
|
|
@@ -771,22 +841,16 @@ export const ROUTE_SINCE = {
|
|
|
771
841
|
// #11253 — no `purchase/…` key: the checkout return pair's route files are
|
|
772
842
|
// generated from `@working-theory/ui-commerce`'s manifest (`create-ailk
|
|
773
843
|
// routes`), never synced from the snapshot.
|
|
774
|
-
// #11259 D6 — no key under `@working-theory/site-pages`'s
|
|
775
|
-
// the
|
|
776
|
-
//
|
|
777
|
-
//
|
|
844
|
+
// #11259 D6 — no key under `@working-theory/site-pages`'s 39 prefixes but
|
|
845
|
+
// the module route that stays the site's (`projects/apply`): the base
|
|
846
|
+
// pages' route files are generated from its manifest, never synced from
|
|
847
|
+
// the snapshot.
|
|
848
|
+
// #11657 — no `reports…`, `trial…` or careers-walk key: the magnet pages'
|
|
849
|
+
// route files are generated from `@working-theory/ui-signal-collectors`'s
|
|
850
|
+
// manifest; `downloads`, `downloads/[slug]` and `dev/purchase` are retired
|
|
851
|
+
// (the `/downloads` redirects are routes-map `legacyRoutes`).
|
|
778
852
|
"blog/[[...slug]]": "0.0.0",
|
|
779
|
-
// #8840 D11 — the Job application magnet's two walks, signal-collectors
|
|
780
|
-
// slice files. Genuinely new, so they attach at the fixed group's next
|
|
781
|
-
// release line, the same rule #8661 D10 applied.
|
|
782
|
-
"careers/apply": "0.44.0",
|
|
783
|
-
"careers/[slug]/apply": "0.44.0",
|
|
784
|
-
"dev/purchase": "0.0.0",
|
|
785
853
|
"docs/[[...slug]]": "0.0.0",
|
|
786
|
-
downloads: "0.0.0",
|
|
787
|
-
// #8848 D12 — the per-slug redirect into `/reports/<slug>`, a
|
|
788
|
-
// signal-collectors slice file at the fixed group's next release line.
|
|
789
|
-
"downloads/[slug]": "0.44.0",
|
|
790
854
|
// #5048 — the founder-application reference mount. It carries the client
|
|
791
855
|
// wrapper only and no `page.tsx`: a route needs a question set, and a
|
|
792
856
|
// question set is the SITE's content. A scaffolded site adds its own route
|
package/dist/topology.js
CHANGED
|
@@ -55,7 +55,6 @@ export const SPOKE_MCP_ROOT = "apps/mcp";
|
|
|
55
55
|
*/
|
|
56
56
|
export const SPOKE_HUB_CHECKOUT_SEEDS = [
|
|
57
57
|
"apps/web/app/[locale]/flows/[slug]/results",
|
|
58
|
-
"apps/web/app/[locale]/dev/purchase",
|
|
59
58
|
];
|
|
60
59
|
/**
|
|
61
60
|
* The files a spoke does not carry — files and directories, scaffold-relative:
|
package/dist/update.d.ts
CHANGED
|
@@ -153,6 +153,21 @@ export declare function mergeMessagesAdditively(ours: string, theirs: string): {
|
|
|
153
153
|
status: "invalid";
|
|
154
154
|
reason: string;
|
|
155
155
|
};
|
|
156
|
+
/**
|
|
157
|
+
* The files the signal-collectors and commerce bundles delivered under
|
|
158
|
+
* `apps/web/app/[locale]/` before #11657 — never recorded, so the row loop
|
|
159
|
+
* never sees them — each with the SHA-256 of every copy a bundle could have
|
|
160
|
+
* landed: every blob of that path on `main` up to #11657 (a bundle installs
|
|
161
|
+
* these bytes unchanged; none carries a `{{MARKER}}`). The seven magnet
|
|
162
|
+
* pages, their renderer and byte proxy ship in
|
|
163
|
+
* `@working-theory/ui-signal-collectors` and `/downloads` and
|
|
164
|
+
* `/dev/purchase` are retired, so an unrecorded copy whose bytes hash into
|
|
165
|
+
* its set is deleted, and the closing `writeRoutes` writes the generated file
|
|
166
|
+
* at each routing path among them; any other bytes are the site's edit, left
|
|
167
|
+
* on disk and listed for review. Frozen as of #11657; never extend: no
|
|
168
|
+
* bundle delivers a file under these trees any more.
|
|
169
|
+
*/
|
|
170
|
+
export declare const RETIRED_SLICE_FILES: ReadonlyMap<string, ReadonlySet<string>>;
|
|
156
171
|
export declare function updateSite(opts: UpdateSiteOptions): Promise<UpdateResult>;
|
|
157
172
|
/**
|
|
158
173
|
* The site's own MDX parser (#10773 D5): `@mdx-js/mdx` resolved through the
|
|
@@ -168,6 +183,6 @@ export interface UpdateArgs {
|
|
|
168
183
|
target: string | undefined;
|
|
169
184
|
help: boolean;
|
|
170
185
|
}
|
|
171
|
-
export declare const UPDATE_HELP = "create-ailk update \u2014 bring template fixes into a site's copied app code.\n\nUsage:\n create-ailk update [<target-dir>]\n\nArguments:\n <target-dir> The existing site. Defaults to the current dir.\n\nOptions:\n --help, -h Print this message.\n\nReads .ailk-template-files.json (written beside .ailk-site-manifest.json by\nevery template scaffold) to tell an untouched copy from an edit. An\nuntouched apps/web, apps/api or apps/mcp file, or a root tools/jest file the\napp jest configs require, whose template copy changed is overwritten. An\nedited file whose template copy also changed is three-way merged with\n`git` (git must be on PATH); a conflict leaves the file alone and is\nlisted under \"Needs review\"; an apps/web/messages catalog instead gains the\ntemplate's new keys and keeps every value it has \u2014 also when its recorded\nversion's copy cannot be read \u2014 and is reviewed only when a key is an object\non one side and a value on the other; a written apps/web file that uses\nthrough t(...) a key the catalog then lacks is held with it, listed under\n\"Held back with <catalog>\". Each @working-theory/* package a written apps/web\nfile imports that apps/web/package.json does not declare is added to its\ndependencies at this release's version. An edited file whose\nbytes are another published create-ailk version's copy is a stale copy, not\nan edit: it is overwritten or removed as an untouched file is, listed with\nthe version it matched. An edit that touches only comment lines is listed as\n\"comment-only edit\"; on a conflict the template's copy lands. A file at a\ntemplate path that is not in the record (one an earlier sync-routes --apply\nor add-route copied without recording it) whose bytes are a published\ncreate-ailk version's copy \u2014 from the version the site was scaffolded at to\nthis one \u2014 is adopted: recorded and moved forward as an untouched file is,\nlisted under \"Adopted\" with the version it matched. One whose bytes are the\nrunning copy with this site's modules' patches applied (a module's\njest.config.cjs or next.config.mjs edit) is left as it is and not listed.\nOne whose bytes match no published copy is a site edit: skipped, never overwritten, and counted under\n\"Held as site edits, not in the record\". No file under a route the site\nlists in customizations.yaml declined_routes is written: each is listed under\n\"Skipped\" naming the declined route. Every template\ntest, and every site-edited template file, that imports a file left under\n\"Needs review\" (by a relative or @/ import, transitively) is held\nat the site's version with it, its record entry is not advanced, and it is\nlisted under \"Held back with <file>\" \u2014 reconcile the file, then run update\nagain to bring it forward. A skipped file never holds another. A file whose\nown bytes are the record's is not held by what it imports: it moves, unless\nit names an export the held copy lacks, and the held file is listed as\n\"Held back: <file> \u2014 imported by N moved files; the site edit is <hunk\nsummary>\". A written file whose import names a file the site lacks gets it\nadded when this template supplies it; otherwise it is held the same way,\nunder \"Held back with <file> (not in this site)\", unless its own copy\nalready named the file \u2014 then it moves and the path is listed under \"Not in\nthis site or the template: <file>\". A file the template removed is kept\nwhile any file still in the site imports it. Every other file in the run\nstill updates. When project.yaml has an env_contract block, each\nenv var the written files read that has no row gains one; no row is edited.\nA record row at a path create-ailk no longer records is dropped and listed.\nA surface the site's .ailk-site-manifest.json names a page on but\narchitecture.yaml does not declare (one no module owns, such as projects)\ngets its route files added and is declared, listed under \"Surfaces declared\nfrom the roster\". A code-route row of that roster no page file serves is\ndropped, listed under \"Roster rows dropped, no route serves them\".\nA site with no record gets one on its first run, from the version its\n.ailk-site-manifest.json already records. A site scaffolded before\n@working-theory/mcp-server has its copied apps/mcp moved to the boot set:\nthe server and each module's paid MCP pack join apps/mcp/package.json, the\ncopied server files go, and apps/mcp/src/lib/paid-tools.generated.ts is\nrewritten on every run. A site scaffolded before @working-theory/api has its\ncopied apps/api moved to the boot file: the app becomes @working-theory/app-api,\nthe package and the six @working-theory/api-<module> packages join\napps/api/package.json, its bins and build:vercel delegate to the package, and\nthe copied server files go. Run `pnpm install` after either move, since the\napp's package.json gained dependencies. Each mdx-body page in content/ with no\n'# ' heading gets its title and description written into its body as its\nheading and intro, listed under \"Page heading added\"; a page with one heading\nis left as it is, and one with several, or one whose frontmatter it cannot\nread, is listed under \"Needs review\". Each bare { on an mdx-body page is\nescaped as \\{ when the site's own MDX parser then reads the page clean, listed\nunder \"Placeholder brace escaped\"; a page it cannot escape safely, or any page\nwith one while the site's dependencies are not installed, is listed under\n\"Needs review\". Each topology seam (*.generated.* \u2014 the web seam, the\n(authed) gate, the API origin and the MCP seam) is rendered again for the\ntopology and sign-in mode .ailk-site-manifest.json records and listed under\n\"Regenerated\", when its bytes are still the render .ailk-template-files.json\nrecords; one edited by hand, or with no recorded render, is listed under\n\"Needs review\" and left as it is. Last, the generated route files of every installed page\npackage (one whose package.json declares \"ailk\": { \"routes\" }) are rewritten\nfrom its manifest, listed under \"Route files regenerated\"; run\n`create-ailk routes --write` after the install when the packages were not\ninstalled yet. Commit before running
|
|
186
|
+
export declare const UPDATE_HELP = "create-ailk update \u2014 bring template fixes into a site's copied app code.\n\nUsage:\n create-ailk update [<target-dir>]\n\nArguments:\n <target-dir> The existing site. Defaults to the current dir.\n\nOptions:\n --help, -h Print this message.\n\nReads .ailk-template-files.json (written beside .ailk-site-manifest.json by\nevery template scaffold) to tell an untouched copy from an edit. An\nuntouched apps/web, apps/api or apps/mcp file, or a root tools/jest file the\napp jest configs require, whose template copy changed is overwritten. An\nedited file whose template copy also changed is three-way merged with\n`git` (git must be on PATH); a conflict leaves the file alone and is\nlisted under \"Needs review\"; an apps/web/messages catalog instead gains the\ntemplate's new keys and keeps every value it has \u2014 also when its recorded\nversion's copy cannot be read \u2014 and is reviewed only when a key is an object\non one side and a value on the other; a written apps/web file that uses\nthrough t(...) a key the catalog then lacks is held with it, listed under\n\"Held back with <catalog>\". Each @working-theory/* package a written apps/web\nfile imports that apps/web/package.json does not declare is added to its\ndependencies at this release's version. An edited file whose\nbytes are another published create-ailk version's copy is a stale copy, not\nan edit: it is overwritten or removed as an untouched file is, listed with\nthe version it matched. An edit that touches only comment lines is listed as\n\"comment-only edit\"; on a conflict the template's copy lands. A file at a\ntemplate path that is not in the record (one an earlier sync-routes --apply\nor add-route copied without recording it) whose bytes are a published\ncreate-ailk version's copy \u2014 from the version the site was scaffolded at to\nthis one \u2014 is adopted: recorded and moved forward as an untouched file is,\nlisted under \"Adopted\" with the version it matched. One whose bytes are the\nrunning copy with this site's modules' patches applied (a module's\njest.config.cjs or next.config.mjs edit) is left as it is and not listed.\nOne whose bytes match no published copy is a site edit: skipped, never overwritten, and counted under\n\"Held as site edits, not in the record\". No file under a route the site\nlists in customizations.yaml declined_routes is written: each is listed under\n\"Skipped\" naming the declined route. Every template\ntest, and every site-edited template file, that imports a file left under\n\"Needs review\" (by a relative or @/ import, transitively) is held\nat the site's version with it, its record entry is not advanced, and it is\nlisted under \"Held back with <file>\" \u2014 reconcile the file, then run update\nagain to bring it forward. A skipped file never holds another. A file whose\nown bytes are the record's is not held by what it imports: it moves, unless\nit names an export the held copy lacks, and the held file is listed as\n\"Held back: <file> \u2014 imported by N moved files; the site edit is <hunk\nsummary>\". A written file whose import names a file the site lacks gets it\nadded when this template supplies it; otherwise it is held the same way,\nunder \"Held back with <file> (not in this site)\", unless its own copy\nalready named the file \u2014 then it moves and the path is listed under \"Not in\nthis site or the template: <file>\". A file the template removed is kept\nwhile any file still in the site imports it. A file a customizations.yaml\nentry records is never removed, nor anything it imports: it keeps its record\nrow and is listed under \"Skipped\" as kept. Every other file in the run\nstill updates. When project.yaml has an env_contract block, each\nenv var the written files read that has no row gains one; no row is edited.\nA record row at a path create-ailk no longer records is dropped and listed.\nA surface the site's .ailk-site-manifest.json names a page on but\narchitecture.yaml does not declare (one no module owns, such as projects)\ngets its route files added and is declared, listed under \"Surfaces declared\nfrom the roster\". A code-route row of that roster no page file serves is\ndropped, listed under \"Roster rows dropped, no route serves them\".\nA site with no record gets one on its first run, from the version its\n.ailk-site-manifest.json already records. A site scaffolded before\n@working-theory/mcp-server has its copied apps/mcp moved to the boot set:\nthe server and each module's paid MCP pack join apps/mcp/package.json, the\ncopied server files go, and apps/mcp/src/lib/paid-tools.generated.ts is\nrewritten on every run. A site scaffolded before @working-theory/api has its\ncopied apps/api moved to the boot file: the app becomes @working-theory/app-api,\nthe package and the six @working-theory/api-<module> packages join\napps/api/package.json, its bins and build:vercel delegate to the package, and\nthe copied server files go. Run `pnpm install` after either move, since the\napp's package.json gained dependencies. Each mdx-body page in content/ with no\n'# ' heading gets its title and description written into its body as its\nheading and intro, listed under \"Page heading added\"; a page with one heading\nis left as it is, and one with several, or one whose frontmatter it cannot\nread, is listed under \"Needs review\". Each bare { on an mdx-body page is\nescaped as \\{ when the site's own MDX parser then reads the page clean, listed\nunder \"Placeholder brace escaped\"; a page it cannot escape safely, or any page\nwith one while the site's dependencies are not installed, is listed under\n\"Needs review\". Each topology seam (*.generated.* \u2014 the web seam, the\n(authed) gate, the API origin and the MCP seam) is rendered again for the\ntopology and sign-in mode .ailk-site-manifest.json records and listed under\n\"Regenerated\", when its bytes are still the render .ailk-template-files.json\nrecords; one edited by hand, or with no recorded render, is listed under\n\"Needs review\" and left as it is. Last, the generated route files of every installed page\npackage (one whose package.json declares \"ailk\": { \"routes\" }) are rewritten\nfrom its manifest, listed under \"Route files regenerated\"; run\n`create-ailk routes --write` after the install when the packages were not\ninstalled yet. Each hand-written page `routes --check` then fails on \u2014 no\ndecided customizations.yaml entry, under a package's prefix, or at a\npackage's own route \u2014 is listed under \"Needs review\". Commit before running,\nand review the diff after.\n";
|
|
172
187
|
/** Parse the argv AFTER the `update` word. Strict `node:util` parseArgs, like `parseAdoptArgs`. */
|
|
173
188
|
export declare function parseUpdateArgs(argv: string[]): UpdateArgs;
|
package/dist/update.js
CHANGED
|
@@ -117,7 +117,7 @@ import { escapeBareBraces, findBareBraces } from "./mdx-braces.js";
|
|
|
117
117
|
import { MODULE_SLICES } from "./module-architecture.js";
|
|
118
118
|
import { MODULE_FLAGS_PATH, PAID_MCP_TOOLS_PATH, PAID_SECTIONS_PATH, renderSitePaidSections, writeModuleFlags, writePaidMcpTools, writePaidSectionsRegistry, } from "./paid-sections.js";
|
|
119
119
|
import { ParseError } from "./parse-args.js";
|
|
120
|
-
import { RoutesRefusedError, writeRoutes } from "./routes.js";
|
|
120
|
+
import { PAGE_DECISION_GUIDANCE, RoutesRefusedError, checkRoutes, customizationsRecord, isGenerated, writeRoutes } from "./routes.js";
|
|
121
121
|
import { planSeamRefresh, seamRow, siteSeamRenders } from "./seam-refresh.js";
|
|
122
122
|
import { SITE_LISTING_PATH } from "./site-listing-path.js";
|
|
123
123
|
import { SITE_ROSTER_PATH, planServedRoster, readRosterPageRoutes } from "./site-roster.js";
|
|
@@ -869,6 +869,207 @@ function pruneEmptyDirs(root) {
|
|
|
869
869
|
rmdirSync(abs);
|
|
870
870
|
}
|
|
871
871
|
}
|
|
872
|
+
// ── The retired signal-collectors and commerce slice files (#11657 D9) ────
|
|
873
|
+
/** The route tree every retired slice file sits under. */
|
|
874
|
+
const RETIRED_SLICE_ROOT = "apps/web/app/[locale]";
|
|
875
|
+
/**
|
|
876
|
+
* The files the signal-collectors and commerce bundles delivered under
|
|
877
|
+
* `apps/web/app/[locale]/` before #11657 — never recorded, so the row loop
|
|
878
|
+
* never sees them — each with the SHA-256 of every copy a bundle could have
|
|
879
|
+
* landed: every blob of that path on `main` up to #11657 (a bundle installs
|
|
880
|
+
* these bytes unchanged; none carries a `{{MARKER}}`). The seven magnet
|
|
881
|
+
* pages, their renderer and byte proxy ship in
|
|
882
|
+
* `@working-theory/ui-signal-collectors` and `/downloads` and
|
|
883
|
+
* `/dev/purchase` are retired, so an unrecorded copy whose bytes hash into
|
|
884
|
+
* its set is deleted, and the closing `writeRoutes` writes the generated file
|
|
885
|
+
* at each routing path among them; any other bytes are the site's edit, left
|
|
886
|
+
* on disk and listed for review. Frozen as of #11657; never extend: no
|
|
887
|
+
* bundle delivers a file under these trees any more.
|
|
888
|
+
*/
|
|
889
|
+
export const RETIRED_SLICE_FILES = new Map([
|
|
890
|
+
["reports/page.tsx", [
|
|
891
|
+
"280d5960c1c8154120dd05c07bd4341d0a584d0deea9e5251ed2f09c24f25fe3",
|
|
892
|
+
"b87f15ce9c529f24f9b8c90af465ef840c66218dfc9331466587aad6cd05b1b9",
|
|
893
|
+
"1de548ce8f71ede83f58c75e0326fb3fcbcf19773360717b5781e98cd8a5f350",
|
|
894
|
+
"7a78d6c8d928e9f17dbc92c794723b44dfef0726c465de1ae88b811a8b9e1dac",
|
|
895
|
+
]],
|
|
896
|
+
["reports/deliverable-page.tsx", [
|
|
897
|
+
"7412d64da98915ce5a7dc8b7b9108a912eadf574d07af53f48ab2f6cc8e1453b",
|
|
898
|
+
"f04b3793c76db4ff7d65112c9c81f5075473ad768912e21d8a2d1f4e21c13549",
|
|
899
|
+
"9007d0f669f395cda3e55c73a29308b7b20c64c1dc88bc42e44ec080685f0828",
|
|
900
|
+
"fa230cc942d235c0412d086bb7f3697b2c727e275139f4a64411371941ad7da9",
|
|
901
|
+
]],
|
|
902
|
+
["reports/[slug]/page.tsx", [
|
|
903
|
+
"db13540a1b20a8f6b2d05bc1af221c490e9aa9f4fd01bb098bd4a7e825d5a6b5",
|
|
904
|
+
"7e4e59b5e964b4d543fb584b392e69dc0a4e0e6a04a115a2263e24cadec092c7",
|
|
905
|
+
"09d6a71bfbc6fda2043c3eecca7d011813b49c5dca26d0dbe61edbbf0c93a5d3",
|
|
906
|
+
"f37297f1cb98e160da58efcb87832c038c67f700edfacd71fbcbba59912c953f",
|
|
907
|
+
"01d69a5268e2d895beabdcd00ca5dbbe7ef9fe83ca88ad55a70f37a51468c292",
|
|
908
|
+
"0f4b9ff2a2f8553af74ece98a0dbbc0d6f69d67d706958b1dafb09da5327e3d6",
|
|
909
|
+
]],
|
|
910
|
+
["reports/[slug]/start/page.tsx", [
|
|
911
|
+
"789e38e8d6549756bf3c9a4104971694b8926ab3087875d3e199fb21114ee27a",
|
|
912
|
+
"771bb10c14d07047b327631cf2c7cc03a0e163fb6a03076569e11fc7b514e879",
|
|
913
|
+
"04149ce6c9415dbfbe74204a8bcc018bcc60cb4635dd842f82a804dec1c292a6",
|
|
914
|
+
]],
|
|
915
|
+
["reports/[slug]/file/route.ts", [
|
|
916
|
+
"740ae977578ab01157b1d1f2b7c8e3d9fd2c9900dfbf0b550ed98fec09c25a2f",
|
|
917
|
+
"40ca5592a4b4fbb13219b1879cda6f99eee9ba9b670c48743291171ea8542dad",
|
|
918
|
+
"98e2412240d2335aae8573abd6d14ee4c6010b4d2f0305e9beb0b92d59273de7",
|
|
919
|
+
"cd844a249e81de922c3b870095dee5d0c80579f4bdee94bfd4a64230fdfc15cc",
|
|
920
|
+
]],
|
|
921
|
+
["trial/page.tsx", [
|
|
922
|
+
"fd2fef2ba1d6b451b9580d47b031326435dd918039d8bb83d3878ba8df5fd76d",
|
|
923
|
+
"1260ec20e0f97bbcd6dfc602973e730a0a5e47991ebb23786a2cfc364ef9eb78",
|
|
924
|
+
"bdb0c4834a0385896af84e74db54785b16fce76dcaf5c3394bf5584da03ce4d6",
|
|
925
|
+
]],
|
|
926
|
+
["trial/request/page.tsx", [
|
|
927
|
+
"922bbe72c8dcf38149e52473b85cbf821f3387c13106ed578d8e9d052fac64f3",
|
|
928
|
+
"5ee9d74a91c1bc5943665858849d7bca1b550393f4a2033d9e7c905bbb8b0bf8",
|
|
929
|
+
"81bbdf8ea16128c661acffff491c08af8f8aac4da20ef4688c67eac179cd2612",
|
|
930
|
+
"2867f0653a6b8ce3206e0f8a3b60eb85d372ca7ea147d350cf3767842d44f31b",
|
|
931
|
+
]],
|
|
932
|
+
["careers/apply/page.tsx", [
|
|
933
|
+
"5ae6ddad1fb33a226b3b017c82ded23e26bcec4e9b21c017cc77fccf042c62c9",
|
|
934
|
+
"ff6792b98684a81f0e8e0f4271efb16a78580bcc3c75d79ec3ea2f40b679b54b",
|
|
935
|
+
"eadd843f87c16b67dd9b6ac7123e42ed523dff6ed5ba30665263ecfe531c2a02",
|
|
936
|
+
]],
|
|
937
|
+
["careers/[slug]/apply/page.tsx", [
|
|
938
|
+
"660e6cebd2159283472c168335cd7a94753734cbbbb851f5d1f64cda5b5ed3e9",
|
|
939
|
+
"ef6ee84a114ab4f39c20455246834bf77244c5fa8e8e2564afcef62ac00c02a8",
|
|
940
|
+
"02d2c6fe74553e9e3572d47ecc587f6c9fce1fb6da462602e29b720f73dca67e",
|
|
941
|
+
"6473d3ff8064d06485f45d6621f9de90488ae8d2eb136e3fb9de14f53dca1829",
|
|
942
|
+
"be5061c6f1fa0df7e62c5f4cc9f25bf127be41fb8a06a519149f5e2820ea9235",
|
|
943
|
+
]],
|
|
944
|
+
["downloads/page.tsx", [
|
|
945
|
+
"1163db365e43f24b40b653525e096cea515c5ef25da98696ab32466d43756b23",
|
|
946
|
+
"a3695c5c2f324f5d61181fba64b51d0679a6620683e0696546dc3e9975aaa283",
|
|
947
|
+
"4cd71844c28e90dfe9e8b713341b4348c4f3c244c350511cff769866f2bb4fc1",
|
|
948
|
+
"17c2d6b95ab27f18fb07488390f511c07fcfb4e23d9087f9ba5a0db9ebf5e419",
|
|
949
|
+
"2296ad86884cfab1119fea6e2e4aaa58077a600e96d14b9aa4139be9b9927fd3",
|
|
950
|
+
"e2b3eb2a0e063a158cb85e485f91e261568e67e6b754a42d9a7d106098c9b099",
|
|
951
|
+
]],
|
|
952
|
+
["downloads/[slug]/page.tsx", [
|
|
953
|
+
"25fb0ee4bed836c7959de258c4d822230a0cd161c066a6b1da426c199773d9ca",
|
|
954
|
+
]],
|
|
955
|
+
["dev/purchase/page.tsx", [
|
|
956
|
+
"1ec7952998df4da316b4b9a834f31663a221f36ebe771cf20d6f82210c485619",
|
|
957
|
+
"c40b3a22de9c952f31e9ddd87e0cc23bba810b689091e40827377851f983e2da",
|
|
958
|
+
"0676092047250c5fb448603d3a4c60b494ca7b35cecdf9a7b369719c88c37e32",
|
|
959
|
+
"ffd421f47adaa87ae090834ba022787d4f0955f9c4e0f2766bffd01d375eccc9",
|
|
960
|
+
"3395e53907077f17879873978d177eaefe5d613a529316c746b04991391290ca",
|
|
961
|
+
]],
|
|
962
|
+
["dev/purchase/error.tsx", [
|
|
963
|
+
"c08765f0c6af726e1f82b8451e82b62fbd4ccf95a91065c08fe4d06665a40ce7",
|
|
964
|
+
"6c239af6fc9ca1027a68293c35fe75f7bc50a2f30bed801138741d8099ba7d4c",
|
|
965
|
+
]],
|
|
966
|
+
["dev/purchase/purchase.actions.ts", [
|
|
967
|
+
"a44bdc29756ed26ad7591a3b9253e8d0c2e099c999889be7220cf6e45c8620d1",
|
|
968
|
+
"3de0ff9d65120e9adf0f5325019d7e840c727004384f4dbb678807eef6d5342c",
|
|
969
|
+
"b063370762bb85922d57929fcffef2a12b196b4aa22b59b908556dbd2cb6b7de",
|
|
970
|
+
"f6b13878246eb96130f96309745f2e8e93835d03c6cbcae584210c92d3bdb287",
|
|
971
|
+
"1dc61387c7d89e930a64d0e4bdcbf80b53e40e00c8545b2b941828948be85084",
|
|
972
|
+
"ee88a6050f68c29f94fdbb2655827e50dc1179bc70acc1df6b7dee92087a498f",
|
|
973
|
+
"d8f1c39e3834cd62927ca033674c79655ad39cbba0ed58783fc71b6c87ce3f89",
|
|
974
|
+
]],
|
|
975
|
+
["careers/__tests__/apply-routes.test.tsx", [
|
|
976
|
+
"f231570cdaa18d009d080dd79a6bd2be1311989bb315840ccaf70ec42dbfc656",
|
|
977
|
+
"16ef5167ae07cdbecd5cd412b34c209276681b04b0f58b690adc43ede957c5ea",
|
|
978
|
+
"0a8bc4db5023c421c5d5ce7037e38def1c1c1b2258959843b21a3b0ff2b6e410",
|
|
979
|
+
"f15ecdcfe27c7fbb8ce9499ad061243017b9fe7925165f613bc9c468885e54c1",
|
|
980
|
+
"61380a95d55b968ec3c14115a5e5330b9415534d76832a9df7eb18c0d454fac7",
|
|
981
|
+
"88dfd8a85d60d6c4369352bcda43484493fce57476fad323d43f74b709695667",
|
|
982
|
+
"d2b38c780a8d2509ff11ba07fa53cf203a016c185d5ca871ee9343ad4f622f1d",
|
|
983
|
+
]],
|
|
984
|
+
["reports/__tests__/page.test.tsx", [
|
|
985
|
+
"b7e920ee9f05deda595519027218b39d7b9a85c50c715f166bb86b5b7733fca2",
|
|
986
|
+
"5a6f55c2d1c884622b375e4ccbc7f40e2a5a6ebb8824fd1c52f0f7663f2c5fbb",
|
|
987
|
+
]],
|
|
988
|
+
["reports/__tests__/deliverable-page.test.tsx", [
|
|
989
|
+
"095b8a0441ba883d3b075892535df95043c2a746080db09995e6e792c4c03a8d",
|
|
990
|
+
"0d2c80a9156cbc38d84f52fc68e5bbe59a0e9d593b5004130a7d5fe8eea74b71",
|
|
991
|
+
"4447f76e0a51976a562cdf46b6abfee6a8042d3b063776a3401c76360a12d50d",
|
|
992
|
+
"799797edd94dfe68ee2d0772356079216924d79d8907fcb36a6acec2659c20ac",
|
|
993
|
+
]],
|
|
994
|
+
["reports/[slug]/__tests__/page.test.tsx", [
|
|
995
|
+
"e2550508061a8c8123da7b7eca96a17fb8000288054dc77048290f64a6499d63",
|
|
996
|
+
"dbb1ffb463de54a6080a387b59405b2257042ac278c08c289e1773ed41825b5b",
|
|
997
|
+
"5ec69478ef4810ab287ae4a7e029f2801d57f83cf38d79b01185690f74d28344",
|
|
998
|
+
"4d721426b4d48612ea99fd306eec7f635aa2c2fd99f35943f69ad09d278c4b97",
|
|
999
|
+
"cb3dfb7076a0c44646d5b8588de8b588b517a1f8643ad1cc124d8fa6834d90f8",
|
|
1000
|
+
"eac3194d5b98f49af6a1a07237e674b6f4ac1222dab9d9da0febe56756b6d41e",
|
|
1001
|
+
"d785cb74338eb41a4a814be726e9b244b8cd02efca17d43d65236cf80a9dcfc6",
|
|
1002
|
+
]],
|
|
1003
|
+
["reports/[slug]/__tests__/start-and-file.test.ts", [
|
|
1004
|
+
"76ef5bc9f7d545f7a7d1f3793c228b4a16f639a64b46d257e1a98d0d3ac2191c",
|
|
1005
|
+
"471fff01ec1e7b1e949b3337d2cde933c3251d591d84e88b24350aad56b18ec0",
|
|
1006
|
+
"acf1b598026d8048152e7d975f59af29b6c048fe364f7e848d423e90d1f5f26c",
|
|
1007
|
+
"c6bf56ec2c19b52a8ab0645a8ca9c975c8662b45ac7d57d0a430eaf215483f79",
|
|
1008
|
+
"8046f2026df97cdfbd380a23ba67edbd9eb44bd23c29d4709ba6af6a2c53105d",
|
|
1009
|
+
"5f2b3e4d961677865a2fc385531184e5aee9782a36336578e0c84df8a6fdd683",
|
|
1010
|
+
]],
|
|
1011
|
+
["trial/__tests__/trial-pages.test.tsx", [
|
|
1012
|
+
"c67346a767941deb8d52c053aa8e8b4b92555e05b640d9393ec0a65b4d08412d",
|
|
1013
|
+
"c2179ef5ef5796efa934c497c4aa15d43a24d082b5418b133615180faba13c6d",
|
|
1014
|
+
"c5dc5b6120698a2e0310fcb84f921bea7b4c919c0df816a7812b6fafba337466",
|
|
1015
|
+
"43341f2ac3a471c116ae8d1881ddb8b00dec8633b5d1db9743ce797304030cf2",
|
|
1016
|
+
"069a5f0bda7188b31e243b13418c1dced95b51333201280fcc2be6cc42917641",
|
|
1017
|
+
]],
|
|
1018
|
+
["downloads/__tests__/page-renderer-migration.test.tsx", [
|
|
1019
|
+
"70a3a8642fd8687a286a6d456321b2f48cae6f77f01708ff3ad73342ec3e08ff",
|
|
1020
|
+
"e806c3f20cc9109945456e7693820e4303f21afe5e990fab7f652bba75d01935",
|
|
1021
|
+
"f867f0358614438954992bbb1eea72705356e4a0dfc30309e72d8146df7608bf",
|
|
1022
|
+
"cb7484365f1e9018e6a4b2ab19eb6223f53905b9f75ad9ed38e5e2f8be5adb08",
|
|
1023
|
+
"c09c80ef63baa8f2fe7766c1fd1e14e7d5f6dccedea2f45e8871d2fdd77eed76",
|
|
1024
|
+
"469307ccecc88527ed81af866d11cde7ad7960d6f8c3f0c0906a4cd709550ecb",
|
|
1025
|
+
"0c53ca8677dc26ab7d33dc213f69b128222c023efab0d7409fdfa9aeebc1a2fe",
|
|
1026
|
+
"d50909f3a38ab7e6a3383fbe2ea60c1659ce37434d217cb3a7a43eb09d1a4460",
|
|
1027
|
+
"6b9709cad3c2032249c01b93eef2259ed2145a16dc0a32d4c5174cc6c5d4b359",
|
|
1028
|
+
"0f0031baf29e04ba202a472350ce5c5f68432c86f715001dcefb6473639da9e7",
|
|
1029
|
+
"52879e2163b3dfa5e9f988f789dc5e3cec99af33d8e65f5368b8c9272a6f584b",
|
|
1030
|
+
"ae943ec3aa49ac5db95f683275f55db63779be63cf50d2ba8907a07cb77e733f",
|
|
1031
|
+
]],
|
|
1032
|
+
["dev/purchase/__tests__/actions.test.ts", [
|
|
1033
|
+
"6d296b28c72afa71aa7ea64bc871a5344a3c665ac7c980dc333b2a9ffc3bcfbc",
|
|
1034
|
+
"52d832d7900a9990fc7f7a9788d1657e3e11fb25b2bbdd9d67119d6458a7dc27",
|
|
1035
|
+
"54cac6168cc4441a8e60b5533a31e24c7b3d9eb5de18ddb4d13f95d89496fbab",
|
|
1036
|
+
"365f0b48388e78e9d229f102e86b7f9f2b95fe64730478485e8cea2018f1af8f",
|
|
1037
|
+
"a9fbbdb37ce9e6c45462f1461e7d1def1b5353858f13b8d2e6b6aae74b5021c8",
|
|
1038
|
+
"49c89700eb9e4add1887aeb04fa12f71b5c823344ba10e44169e3cf0deba9dfa",
|
|
1039
|
+
]],
|
|
1040
|
+
].map(([path, hashes]) => [`${RETIRED_SLICE_ROOT}/${path}`, new Set(hashes)]));
|
|
1041
|
+
/** Paths under these trees are retired outright; the rest ship in the package. */
|
|
1042
|
+
const RETIRED_ROUTE_TREES = [`${RETIRED_SLICE_ROOT}/downloads/`, `${RETIRED_SLICE_ROOT}/dev/purchase/`];
|
|
1043
|
+
/**
|
|
1044
|
+
* The retired slice files present in `targetDir` and not in its record,
|
|
1045
|
+
* sorted into what update deletes (an unedited bundle copy) and what it lists
|
|
1046
|
+
* for review (any other bytes, never deleted). A recorded path is the row
|
|
1047
|
+
* loop's; a generated route file at the path is the replacement, left alone.
|
|
1048
|
+
*/
|
|
1049
|
+
function planSliceRetirement(targetDir, recorded) {
|
|
1050
|
+
const deletes = [];
|
|
1051
|
+
const review = [];
|
|
1052
|
+
for (const [path, copies] of RETIRED_SLICE_FILES) {
|
|
1053
|
+
if (recorded.has(path))
|
|
1054
|
+
continue;
|
|
1055
|
+
const abs = join(targetDir, ...path.split("/"));
|
|
1056
|
+
if (!existsSync(abs))
|
|
1057
|
+
continue;
|
|
1058
|
+
const bytes = readFileSync(abs);
|
|
1059
|
+
if (copies.has(sha256Hex(bytes))) {
|
|
1060
|
+
deletes.push(path);
|
|
1061
|
+
continue;
|
|
1062
|
+
}
|
|
1063
|
+
// The route file a previous run generated in the copy's place is the replacement, not an edit.
|
|
1064
|
+
if (isGenerated(bytes.toString("utf8")))
|
|
1065
|
+
continue;
|
|
1066
|
+
const reason = RETIRED_ROUTE_TREES.some((tree) => path.startsWith(tree))
|
|
1067
|
+
? "edited here; retired in #11657 — record it in customizations.yaml or delete it"
|
|
1068
|
+
: "edited here; ships in @working-theory/ui-signal-collectors since #11657 — record it in customizations.yaml or delete it";
|
|
1069
|
+
review.push({ path, reason });
|
|
1070
|
+
}
|
|
1071
|
+
return { deletes, review };
|
|
1072
|
+
}
|
|
872
1073
|
// ── The API move (#9566): a copied apps/api becomes the boot file ─────────
|
|
873
1074
|
const API_PACKAGE = "@working-theory/api";
|
|
874
1075
|
/** The app's name since #9564 D10 — the copied app's `@working-theory/api` would shadow the dependency. */
|
|
@@ -1383,6 +1584,12 @@ export async function updateSite(opts) {
|
|
|
1383
1584
|
const apiMove = existsSync(apiPkgPath)
|
|
1384
1585
|
? planApiMove(targetDir, opts.templatesDir, new Set([...newMap.keys()].filter((path) => path.startsWith(`${API_SRC}/`))), new Set(Object.keys(record.files)), opts.versions ?? {})
|
|
1385
1586
|
: undefined;
|
|
1587
|
+
// ── The retired slice files (#11657 D9), planned before the first write ──
|
|
1588
|
+
// The bundle-delivered magnet pages, `/downloads` and `/dev/purchase` the
|
|
1589
|
+
// record never saw: an unedited copy goes (the closing `writeRoutes`
|
|
1590
|
+
// writes the generated file at each routing path), an edited one is
|
|
1591
|
+
// reviewed and stays.
|
|
1592
|
+
const sliceRetirement = planSliceRetirement(targetDir, new Set(Object.keys(record.files)));
|
|
1386
1593
|
// ── The web app's carried dependencies (#9889 D9), planned before the
|
|
1387
1594
|
// first write so an unparseable apps/web/package.json refuses the run.
|
|
1388
1595
|
const webDependencies = planWebDependencies(targetDir, opts.templatesDir);
|
|
@@ -1395,8 +1602,26 @@ export async function updateSite(opts) {
|
|
|
1395
1602
|
const review = [
|
|
1396
1603
|
...(mcpMove?.review ?? []),
|
|
1397
1604
|
...(apiMove?.review ?? []),
|
|
1605
|
+
...sliceRetirement.review,
|
|
1398
1606
|
];
|
|
1399
1607
|
const skipped = [];
|
|
1608
|
+
// #11511 — a path a customizations.yaml entry records is the site's: never
|
|
1609
|
+
// removed, its row kept as it is. What it imports is then held by #11147.
|
|
1610
|
+
const recordedBy = customizationsRecord(targetDir);
|
|
1611
|
+
const keptReason = (path) => {
|
|
1612
|
+
const id = recordedBy(path);
|
|
1613
|
+
return id === undefined ? undefined : `recorded in customizations.yaml "${id}" — kept, never removed`;
|
|
1614
|
+
};
|
|
1615
|
+
for (const move of [mcpMove, apiMove, sliceRetirement]) {
|
|
1616
|
+
if (move === undefined)
|
|
1617
|
+
continue;
|
|
1618
|
+
move.deletes = move.deletes.filter((path) => {
|
|
1619
|
+
const reason = keptReason(path);
|
|
1620
|
+
if (reason !== undefined)
|
|
1621
|
+
skipped.push({ path, reason });
|
|
1622
|
+
return reason === undefined;
|
|
1623
|
+
});
|
|
1624
|
+
}
|
|
1400
1625
|
// #11147 — the edited rows sorted: a stale copy of another version, a
|
|
1401
1626
|
// comment-only edit, or a site edit with its hunk summary (the cascade's).
|
|
1402
1627
|
const staleCopies = [];
|
|
@@ -1443,6 +1668,11 @@ export async function updateSite(opts) {
|
|
|
1443
1668
|
const newBytes = newMap.get(path);
|
|
1444
1669
|
if (!edited) {
|
|
1445
1670
|
if (newBytes === undefined) {
|
|
1671
|
+
const kept = keptReason(path);
|
|
1672
|
+
if (kept !== undefined) {
|
|
1673
|
+
skipped.push({ path, reason: kept });
|
|
1674
|
+
continue;
|
|
1675
|
+
}
|
|
1446
1676
|
deletes.push(path);
|
|
1447
1677
|
delete nextFiles[path];
|
|
1448
1678
|
removed.push(path);
|
|
@@ -1465,6 +1695,11 @@ export async function updateSite(opts) {
|
|
|
1465
1695
|
const priorMcpCopy = path.startsWith(`${MCP_SRC}/`) && PRIOR_MCP_TEMPLATE_HASHES.has(diskHash);
|
|
1466
1696
|
const stale = priorMcpCopy ? undefined : await staleCopyOf(path, diskHash);
|
|
1467
1697
|
if (priorMcpCopy || stale !== undefined) {
|
|
1698
|
+
const kept = keptReason(path);
|
|
1699
|
+
if (kept !== undefined) {
|
|
1700
|
+
skipped.push({ path, reason: kept });
|
|
1701
|
+
continue;
|
|
1702
|
+
}
|
|
1468
1703
|
if (stale !== undefined)
|
|
1469
1704
|
staleCopies.push({ path, version: stale });
|
|
1470
1705
|
deletes.push(path);
|
|
@@ -1684,7 +1919,12 @@ export async function updateSite(opts) {
|
|
|
1684
1919
|
const leftAlone = new Set(heldFiles);
|
|
1685
1920
|
const writtenBytes = new Map(writes.map((w) => [w.path, w.bytes]));
|
|
1686
1921
|
// The moves' removals (#9567, #9566) land too: never code that stays.
|
|
1687
|
-
const deleting = new Set([
|
|
1922
|
+
const deleting = new Set([
|
|
1923
|
+
...deletes,
|
|
1924
|
+
...(mcpMove?.deletes ?? []),
|
|
1925
|
+
...(apiMove?.deletes ?? []),
|
|
1926
|
+
...sliceRetirement.deletes,
|
|
1927
|
+
]);
|
|
1688
1928
|
const adding = new Set(added);
|
|
1689
1929
|
const heldBackByFile = new Map();
|
|
1690
1930
|
// #11147 — per held file, the importers that moved anyway: a file whose
|
|
@@ -1960,10 +2200,12 @@ export async function updateSite(opts) {
|
|
|
1960
2200
|
// #11147 — a removal a still-present file imports — the site's own
|
|
1961
2201
|
// code, a file left alone, or a file held with one — is held with that
|
|
1962
2202
|
// importer, so the run never removes what the tree still imports. The
|
|
1963
|
-
// moves' removals (#9567, #9566) retire server copies and are not read
|
|
2203
|
+
// moves' removals (#9567, #9566) retire server copies and are not read;
|
|
2204
|
+
// a retired slice file (#11657) is, as an edited reader kept beside it
|
|
2205
|
+
// still imports it (`reports/[slug]/page.tsx` → `deliverable-page.tsx`).
|
|
1964
2206
|
// A written importer held as `missing` on one pass can be what holds the
|
|
1965
2207
|
// removal on the next; it then stays held — conservative, never wrong.
|
|
1966
|
-
for (const path of deletes) {
|
|
2208
|
+
for (const path of [...deletes, ...sliceRetirement.deletes]) {
|
|
1967
2209
|
if (heldPaths.has(path))
|
|
1968
2210
|
continue;
|
|
1969
2211
|
const importer = [...stayingFiles, ...heldPaths].find((file) => !rewrittenLater.has(file) && importCandidatesOf(file).has(path));
|
|
@@ -2200,7 +2442,7 @@ export async function updateSite(opts) {
|
|
|
2200
2442
|
// ── Apply: writes and removals, then the record (D4 Order) ───────────
|
|
2201
2443
|
// #9566 — the API move's removals first: a retired file at a boot-set
|
|
2202
2444
|
// path is overwritten by the write that follows, never deleted after it.
|
|
2203
|
-
for (const path of apiMove?.deletes ?? []) {
|
|
2445
|
+
for (const path of [...(apiMove?.deletes ?? []), ...sliceRetirement.deletes.filter(notHeld)]) {
|
|
2204
2446
|
rmSync(join(targetDir, ...path.split("/")));
|
|
2205
2447
|
removed.push(path);
|
|
2206
2448
|
}
|
|
@@ -2405,6 +2647,25 @@ export async function updateSite(opts) {
|
|
|
2405
2647
|
let routesWritten = [];
|
|
2406
2648
|
try {
|
|
2407
2649
|
routesWritten = writeRoutes(targetDir).written;
|
|
2650
|
+
// #11700 D10 — each hand-written page the routes check fails on is a
|
|
2651
|
+
// review row, so the bump PR carries the list, not only a red preflight.
|
|
2652
|
+
const drift = checkRoutes(targetDir);
|
|
2653
|
+
const pageRow = (path, what) => {
|
|
2654
|
+
const suggestion = drift.routeSuggestions[path];
|
|
2655
|
+
review.push({
|
|
2656
|
+
path,
|
|
2657
|
+
reason: `${what} — routes --check fails on it; ${PAGE_DECISION_GUIDANCE}${suggestion === undefined ? "" : `; ${suggestion}`}`,
|
|
2658
|
+
});
|
|
2659
|
+
};
|
|
2660
|
+
for (const { path, id } of drift.undecidedPages) {
|
|
2661
|
+
pageRow(path, id === undefined ? "a site page with no decided customizations.yaml entry" : `a page whose customizations.yaml entry "${id}" is not decided`);
|
|
2662
|
+
}
|
|
2663
|
+
for (const path of drift.stray)
|
|
2664
|
+
pageRow(path, "a site page under a page package's route prefix");
|
|
2665
|
+
for (const path of drift.stale) {
|
|
2666
|
+
if (!isGenerated(readFileSync(join(targetDir, path), "utf8")))
|
|
2667
|
+
pageRow(path, "a site page at a page package's own route");
|
|
2668
|
+
}
|
|
2408
2669
|
}
|
|
2409
2670
|
catch (err) {
|
|
2410
2671
|
if (!(err instanceof RoutesRefusedError))
|
|
@@ -2676,7 +2937,9 @@ added when this template supplies it; otherwise it is held the same way,
|
|
|
2676
2937
|
under "Held back with <file> (not in this site)", unless its own copy
|
|
2677
2938
|
already named the file — then it moves and the path is listed under "Not in
|
|
2678
2939
|
this site or the template: <file>". A file the template removed is kept
|
|
2679
|
-
while any file still in the site imports it.
|
|
2940
|
+
while any file still in the site imports it. A file a customizations.yaml
|
|
2941
|
+
entry records is never removed, nor anything it imports: it keeps its record
|
|
2942
|
+
row and is listed under "Skipped" as kept. Every other file in the run
|
|
2680
2943
|
still updates. When project.yaml has an env_contract block, each
|
|
2681
2944
|
env var the written files read that has no row gains one; no row is edited.
|
|
2682
2945
|
A record row at a path create-ailk no longer records is dropped and listed.
|
|
@@ -2712,7 +2975,10 @@ records; one edited by hand, or with no recorded render, is listed under
|
|
|
2712
2975
|
package (one whose package.json declares "ailk": { "routes" }) are rewritten
|
|
2713
2976
|
from its manifest, listed under "Route files regenerated"; run
|
|
2714
2977
|
\`create-ailk routes --write\` after the install when the packages were not
|
|
2715
|
-
installed yet.
|
|
2978
|
+
installed yet. Each hand-written page \`routes --check\` then fails on — no
|
|
2979
|
+
decided customizations.yaml entry, under a package's prefix, or at a
|
|
2980
|
+
package's own route — is listed under "Needs review". Commit before running,
|
|
2981
|
+
and review the diff after.
|
|
2716
2982
|
`;
|
|
2717
2983
|
/** Parse the argv AFTER the `update` word. Strict `node:util` parseArgs, like `parseAdoptArgs`. */
|
|
2718
2984
|
export function parseUpdateArgs(argv) {
|