create-ailk 0.47.0 → 0.48.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.
Files changed (137) hide show
  1. package/README.md +180 -43
  2. package/component-catalog.json +223 -285
  3. package/component-catalog.md +1 -1
  4. package/dist/apply-design.d.ts +26 -68
  5. package/dist/apply-design.js +150 -322
  6. package/dist/cli.js +152 -17
  7. package/dist/compare-chrome.d.ts +108 -0
  8. package/dist/compare-chrome.js +481 -0
  9. package/dist/compare-look.d.ts +94 -0
  10. package/dist/compare-look.js +378 -0
  11. package/dist/copy.js +1 -1
  12. package/dist/design-compile.d.ts +17 -21
  13. package/dist/design-compile.js +32 -56
  14. package/dist/design-files.d.ts +93 -0
  15. package/dist/design-files.js +312 -0
  16. package/dist/design-home.d.ts +4 -2
  17. package/dist/design-home.js +88 -6
  18. package/dist/design-names.d.ts +13 -0
  19. package/dist/design-names.js +76 -0
  20. package/dist/design-package.d.ts +46 -56
  21. package/dist/design-package.js +285 -288
  22. package/dist/design-presets.d.ts +41 -0
  23. package/dist/design-presets.js +83 -4
  24. package/dist/design-scaffold.d.ts +12 -2
  25. package/dist/design-scaffold.js +72 -34
  26. package/dist/generated/design-settings.d.ts +56 -0
  27. package/dist/generated/design-settings.js +237 -0
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +2 -2
  30. package/dist/inventory.d.ts +3 -2
  31. package/dist/inventory.js +10 -4
  32. package/dist/lib/design-checks.d.ts +46 -0
  33. package/dist/lib/design-checks.js +79 -1
  34. package/dist/lib/env-catalog.js +1 -1
  35. package/dist/lib/module-license-gate.d.ts +1 -1
  36. package/dist/lib/module-license-gate.js +1 -1
  37. package/dist/lib/render-verdict.d.ts +13 -1
  38. package/dist/lib/render-verdict.js +41 -1
  39. package/dist/look-hub.d.ts +44 -0
  40. package/dist/look-hub.js +130 -0
  41. package/dist/look-record.d.ts +35 -0
  42. package/dist/look-record.js +85 -0
  43. package/dist/look-samples.d.ts +66 -0
  44. package/dist/look-samples.js +456 -0
  45. package/dist/look-settings.d.ts +53 -0
  46. package/dist/look-settings.js +363 -0
  47. package/dist/module-architecture.js +12 -0
  48. package/dist/parse-args.d.ts +10 -6
  49. package/dist/parse-args.js +26 -13
  50. package/dist/programmatic.d.ts +1 -19
  51. package/dist/programmatic.js +65 -103
  52. package/dist/retired-design-bodies.d.ts +29 -0
  53. package/dist/retired-design-bodies.js +51 -0
  54. package/dist/seed-flows.d.ts +1 -1
  55. package/dist/seed-flows.js +12 -14
  56. package/dist/seed-workspace.d.ts +4 -1
  57. package/dist/seed-workspace.js +139 -17
  58. package/dist/site-chrome.d.ts +41 -41
  59. package/dist/site-chrome.js +50 -70
  60. package/dist/site-fonts.d.ts +10 -14
  61. package/dist/site-fonts.js +5 -1
  62. package/dist/starter-grid.d.ts +2 -2
  63. package/dist/strip-look-copies.d.ts +67 -0
  64. package/dist/strip-look-copies.js +591 -0
  65. package/dist/template-manifest.d.ts +6 -14
  66. package/dist/template-manifest.js +0 -9
  67. package/dist/template-record.d.ts +3 -1
  68. package/dist/template-record.js +3 -1
  69. package/dist/topology.d.ts +15 -0
  70. package/dist/topology.js +60 -0
  71. package/dist/update.d.ts +57 -1
  72. package/dist/update.js +742 -13
  73. package/package.json +3 -4
  74. package/site-templates/aliases/hub.TEMPLATE-MANIFEST.json +2 -31
  75. package/site-templates/designs/minimalism/DESIGN.md +163 -297
  76. package/site-templates/designs/minimalism/LOOK.md +42 -0
  77. package/site-templates/designs/minimalism/design.yaml +167 -0
  78. package/site-templates/designs/standard/DESIGN.md +145 -149
  79. package/site-templates/designs/standard/LOOK.md +42 -0
  80. package/site-templates/designs/standard/design.yaml +72 -0
  81. package/site-templates/marketing-site/TEMPLATE-MANIFEST.json +2 -31
  82. package/site-templates/marketing-site/TEMPLATE-MANIFEST.md +1 -25
  83. package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.json +2 -31
  84. package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.md +1 -25
  85. package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.json +2 -31
  86. package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.md +1 -25
  87. package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.json +2 -31
  88. package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.md +1 -25
  89. package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.json +2 -31
  90. package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.md +1 -25
  91. package/site-templates/shapes/person-service/content/_site.mdx +0 -26
  92. package/templates/.claude/rules/extending.md +3 -2
  93. package/templates/.env.example +11 -4
  94. package/templates/CLAUDE.md +1 -1
  95. package/templates/DESIGN.md +145 -149
  96. package/templates/README.md +15 -16
  97. package/templates/apps/api/.env.example +11 -4
  98. package/templates/apps/api/CLAUDE.md +6 -4
  99. package/templates/apps/api/src/lib/__mocks__/prisma.ts +15 -5
  100. package/templates/apps/mcp/CLAUDE.md +4 -2
  101. package/templates/apps/web/.env.example +10 -3
  102. package/templates/apps/web/CLAUDE.md +14 -3
  103. package/templates/apps/web/app/[locale]/layout.tsx +53 -50
  104. package/templates/apps/web/app/not-found.tsx +11 -11
  105. package/templates/apps/web/auth.ts +48 -35
  106. package/templates/apps/web/jest.config.cjs +5 -0
  107. package/templates/apps/web/lib/__tests__/hub-site-config.test.ts +179 -31
  108. package/templates/apps/web/lib/__tests__/library-fonts.test.ts +35 -0
  109. package/templates/apps/web/lib/__tests__/page-chrome-navigation.test.ts +71 -32
  110. package/templates/apps/web/lib/__tests__/page-chrome.test.ts +123 -26
  111. package/templates/apps/web/lib/__tests__/section-look.test.ts +150 -0
  112. package/templates/apps/web/lib/__tests__/site-theme.test.ts +81 -289
  113. package/templates/apps/web/lib/deck-page.ts +3 -10
  114. package/templates/apps/web/lib/deploy-fonts.ts +12 -0
  115. package/templates/apps/web/lib/hub-site-config.ts +97 -14
  116. package/templates/apps/web/lib/library-fonts.ts +41 -0
  117. package/templates/apps/web/lib/mcp-oauth.ts +11 -4
  118. package/templates/apps/web/lib/page-chrome.ts +52 -34
  119. package/templates/apps/web/lib/section-look.ts +28 -0
  120. package/templates/apps/web/lib/site-design.ts +205 -0
  121. package/templates/apps/web/lib/site-theme-head.ts +98 -13
  122. package/templates/apps/web/lib/site-theme.ts +40 -62
  123. package/templates/apps/web/messages/en.json +0 -6
  124. package/templates/apps/web/next.config.mjs +195 -6
  125. package/templates/apps/web/package.json +2 -0
  126. package/templates/apps/web/site-pages.config.tsx +4 -2
  127. package/templates/content/_site.mdx +0 -26
  128. package/templates/design.yaml +75 -0
  129. package/templates/project.yaml +14 -0
  130. package/versions.json +52 -51
  131. package/site-templates/marketing-site/DESIGN.md +0 -259
  132. package/site-templates/marketing-site-free/DESIGN.md +0 -259
  133. package/site-templates/saas-product/DESIGN.md +0 -259
  134. package/templates/apps/web/lib/__tests__/deck-page.test.ts +0 -288
  135. package/templates/apps/web/lib/__tests__/site-theme-head.test.ts +0 -70
  136. package/templates/apps/web/lib/site-chrome.ts +0 -46
  137. package/templates/apps/web/lib/site-fonts.ts +0 -15
@@ -1,4 +1,8 @@
1
- /** Template-relative path of the generated site-fonts module — beside `SITE_CHROME_PATH`. */
1
+ /**
2
+ * Site-relative path of the retired faces file (#12477): no generator writes
3
+ * it. `update` never records it (`REGENERATED_APP_PATHS`) and removes it only
4
+ * once the hub's read for the site carries its look (D6).
5
+ */
2
6
  export const SITE_FONTS_PATH = "apps/web/lib/site-fonts.ts";
3
7
  const HEADER = `// site-fonts.ts — the web faces the site's design sources.
4
8
  //
@@ -17,7 +17,7 @@
17
17
  import type { CategorySlug } from "./category-profile.js";
18
18
  import type { ModuleName } from "./parse-args.js";
19
19
  import type { TemplateLayout } from "./site-chrome.js";
20
- import type { StarterDesign, StarterShape, TemplateRosterRow } from "./template-manifest.js";
20
+ import type { StarterShape, TemplateRosterRow } from "./template-manifest.js";
21
21
  /**
22
22
  * The roster routes a hub keeps (#10040): the sign-in pair and the three legal
23
23
  * pages. Declared here, beside the rosters they are cut from, so this file
@@ -55,7 +55,7 @@ export interface AliasDifferences {
55
55
  */
56
56
  export interface TemplateAlias {
57
57
  readonly shape: BuildableShape;
58
- readonly design: StarterDesign;
58
+ readonly design: string;
59
59
  /** Becomes the manifest's `requires`. */
60
60
  readonly modules: readonly ModuleName[];
61
61
  readonly categories: readonly CategorySlug[];
@@ -0,0 +1,67 @@
1
+ /** The branch an `--apply` on the default branch creates, before its date. */
2
+ export declare const LOOK_COPY_IMPORT_BRANCH_PREFIX = "look-copy-import/";
3
+ /** A refusal the CLI exits 2 on, thrown before any write. */
4
+ export declare class StripLookCopiesRefusedError extends Error {
5
+ readonly exitCode = 2;
6
+ constructor(message: string);
7
+ }
8
+ export interface StripLookCopiesOptions {
9
+ /** The site. */
10
+ targetDir: string;
11
+ /** `--apply`: write. Without it nothing is written. */
12
+ apply?: boolean;
13
+ /** `--api-url`. */
14
+ apiUrl?: string | undefined;
15
+ /** `--workspace`. */
16
+ workspaceId?: string | undefined;
17
+ /** create-ailk's `component-catalog.json` (cli.ts passes it from its package root). */
18
+ catalogPath: string;
19
+ /** Injectable for tests; defaults to `process.env`. */
20
+ env?: NodeJS.ProcessEnv;
21
+ /** Injectable for tests; defaults to `globalThis.fetch`. */
22
+ fetch?: typeof globalThis.fetch;
23
+ /** Injectable for tests: the date the import branch is named for. */
24
+ now?: Date;
25
+ /** Each report line as it happens; defaults to nothing. */
26
+ onLine?: (line: string) => void;
27
+ }
28
+ /** One look copy: the `data` entry `field` of section `index` of a page. */
29
+ export interface LookCopy {
30
+ readonly path: string;
31
+ readonly index: number;
32
+ readonly sectionType: string;
33
+ readonly field: string;
34
+ }
35
+ export interface KeptLookCopy {
36
+ readonly path: string;
37
+ /** `edited`: the entry changed since the file's first commit. `section`: the look sets a field the section lacks, or every entry is a copy. `no-commit`: no commit holds the file. `unreadable`: its sections cannot be located. */
38
+ readonly reason: "edited" | "section" | "no-commit" | "unreadable";
39
+ readonly index?: number;
40
+ readonly sectionType?: string;
41
+ readonly field?: string;
42
+ }
43
+ export interface StripLookCopiesResult {
44
+ readonly removed: LookCopy[];
45
+ readonly kept: KeptLookCopy[];
46
+ /** `--apply`: the site-relative files written. */
47
+ readonly written: string[];
48
+ /** `--apply` with something to remove: the branch the files were written on. */
49
+ readonly branch?: string;
50
+ }
51
+ /**
52
+ * Whether a look may set a field, read from its JSON Schema in the catalog —
53
+ * the rule `@working-theory/validation` applies to the zod schema (#12474 D7),
54
+ * which create-ailk cannot import: an enum, a const or a union of consts, a
55
+ * boolean, or a number with both ends and a maximum of at most 10 000.
56
+ */
57
+ export declare function lookSettable(schema: unknown): boolean;
58
+ export declare function stripLookCopies(opts: StripLookCopiesOptions): Promise<StripLookCopiesResult>;
59
+ export interface StripLookCopiesArgs {
60
+ target: string | undefined;
61
+ apply: boolean;
62
+ apiUrl: string | undefined;
63
+ workspaceId: string | undefined;
64
+ help: boolean;
65
+ }
66
+ export declare const STRIP_LOOK_COPIES_HELP = "create-ailk strip-look-copies \u2014 remove from a site's page files the section look values its look already sets.\n\nUsage:\n AILK_AGENT_KEY=<key> create-ailk strip-look-copies [<dir>] [--apply] [--api-url <origin>] [--workspace <wksp_id>]\n\nArguments:\n <dir> The site, inside a git work tree. Defaults to the\n current dir.\n\nOptions:\n --apply Write the files. Without it the command prints what\n it would remove and writes nothing.\n --api-url <origin> The API origin that holds the workspace \u2014 on a\n spoke, its hub's. Else AILK_API_URL. https: only\n (http: on localhost or 127.0.0.1).\n --workspace <wksp_id> The workspace whose look is read. Else\n AILK_WORKSPACE_ID.\n -h, --help Show this help.\n\nThe look is the workspace design's worked-out section settings, read with the\nagent key from AILK_AGENT_KEY only. The site's own read of it,\nGET /v1/content/site-config, is sent on a spoke with AILK_SPOKE_KEY when it\nis set, and keyless otherwise, and must carry the same design version and\nsection settings; else the command refuses. On a spoke, a workspace or origin\nother than the one its apps/web/.env or .env.local names is refused. No key is\nprinted.\n\nA section entry in a content/ page (not _site.mdx) is removed when its field\nis a look field of its section type, the look sets it to the same value, the\nlook sets no field the section lacks, and the entry is unchanged in every\ncommit of the file since the one that added it. Any other entry stays: a\nvalue that differs, one a commit changed (listed as edited), a section the\nlook would add a field to (listed as kept), a file no commit holds. Only the\nentry and one separator are removed; every other byte stays.\n\nThe dry run prints one line per removal, <path>: <sectionType>.<field> (no\nvalues), and a total. --apply refuses a dirty work tree; on the default\nbranch (main, master, or the one origin/HEAD names) it first creates and\nswitches to look-copy-import/<YYYYMMDD>; then it writes the files and prints\nthe next steps. It never commits, pushes or opens a pull request. A second\nrun reports nothing to remove. Exit 0 on success, 2 on a refusal (nothing is\nwritten).\n";
67
+ export declare function parseStripLookCopiesArgs(argv: string[]): StripLookCopiesArgs;