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,26 +1,13 @@
1
+ import { BUTTON_SHAPE_VALUES, CHECKMARKS_VALUES, COLOR_KEYS_LIGHT, COPY_DENSITY_VALUES, CORNERS_VALUES, DARK_INK_VALUES, EYEBROW_CASE_VALUES, FIGURES_VALUES, FONT_SOURCE_VALUES, PLACEHOLDERS_VALUES, TYPE_SCALE_VALUES } from "./generated/design-settings.js";
1
2
  import { type ResolvedSiteChrome } from "./site-chrome.js";
2
- /** The closed colour key set (D3) — 13 required, 5 optional dark fallbacks. */
3
- export declare const DESIGN_COLOR_KEYS_REQUIRED: readonly ["bg", "fg", "surface", "surface-secondary", "border", "text-muted", "brand", "fg-on-brand", "accent", "bg-dark", "fg-dark", "border-dark", "brand-dark"];
4
- export declare const DESIGN_COLOR_KEYS_OPTIONAL: readonly ["surface-dark", "surface-secondary-dark", "text-muted-dark", "fg-on-brand-dark", "accent-dark"];
5
- type DesignColorKeyRequired = (typeof DESIGN_COLOR_KEYS_REQUIRED)[number];
6
- type DesignColorKeyOptional = (typeof DESIGN_COLOR_KEYS_OPTIONAL)[number];
7
- /** Duplicated from `SiteThemeSchema`'s colour regex (D3) — proven equal by test. */
8
- export declare const DESIGN_COLOR_REGEX: RegExp;
3
+ /** A look's light set of colour keys, under the name `update.ts` imports — the generated list, not a copy. */
4
+ export { COLOR_KEYS_LIGHT as DESIGN_COLOR_KEYS_LIGHT } from "./generated/design-settings.js";
5
+ type ColorKeyLight = (typeof COLOR_KEYS_LIGHT)[number];
9
6
  export type DesignColors = {
10
- [K in DesignColorKeyRequired]: string;
7
+ [K in ColorKeyLight | `${ColorKeyLight}-dark`]: string;
11
8
  } & {
12
- [K in DesignColorKeyOptional]?: string;
9
+ [K in `${ColorKeyLight}-band`]?: string;
13
10
  };
14
- /** The closed font-source enum (#7720 D1) — a Google Fonts family, self-hosted at build by next/font. */
15
- export declare const DESIGN_FONT_SOURCE_VALUES: readonly ["google"];
16
- /** Duplicated from site-config's `FONT_FAMILY_REGEX` (#7720 D1) — proven equal by test. */
17
- export declare const DESIGN_FONT_STACK_ENTRY_REGEX: RegExp;
18
- /**
19
- * #7739 D1.3 — a type size a `typeScale: design` package compiles: a plain
20
- * length in rem, px or em. Duplicated from site-config's `TYPE_SIZE_REGEX` —
21
- * proven equal by test.
22
- */
23
- export declare const DESIGN_TYPE_SIZE_REGEX: RegExp;
24
11
  /**
25
12
  * Typography role fields, D2's `⊆ {fontFamily, fontSize, fontWeight, lineHeight, letterSpacing}`
26
13
  * (`fontSize` required), plus #7720's `fontSource` (display/body only) and
@@ -33,59 +20,45 @@ export interface DesignTypographyRole {
33
20
  fontWeight?: number;
34
21
  lineHeight?: number;
35
22
  letterSpacing?: string;
36
- fontSource?: (typeof DESIGN_FONT_SOURCE_VALUES)[number];
23
+ fontSource?: (typeof FONT_SOURCE_VALUES)[number];
37
24
  lineHeightMobile?: number;
38
25
  fontSizeMobile?: string;
39
26
  }
40
- /** Role names are open (D2). */
27
+ /** Role names are open (D2), within the name grammar. */
41
28
  export type DesignTypography = Record<string, DesignTypographyRole>;
42
- /** Names open (D2). */
29
+ /** Names open (D2), within the name grammar. */
43
30
  export type DesignRounded = Record<string, string>;
44
31
  export type DesignSpacing = Record<string, string>;
45
- /** Duplicated from `SiteThemeSchema`'s enums (D3) — proven equal by test. */
46
- export declare const DESIGN_CORNERS_VALUES: readonly ["rounded", "square"];
47
- export declare const DESIGN_EYEBROW_CASE_VALUES: readonly ["upper", "sentence"];
48
- export declare const DESIGN_PLACEHOLDERS_VALUES: readonly ["outline", "fill"];
49
- export declare const DESIGN_CHECKMARKS_VALUES: readonly ["circle", "plain"];
50
- /** #7741 D7 — the button shape. */
51
- export declare const DESIGN_BUTTON_SHAPE_VALUES: readonly ["control", "pill"];
52
- export declare const DESIGN_DARK_INK_VALUES: readonly ["fg", "accent"];
53
- export declare const DESIGN_FIGURES_VALUES: readonly ["platform", "display"];
54
32
  /**
55
- * #7739 D1 — whether the compile writes the design's own type roles into the
56
- * theme. A compile instruction, not a runtime setting: never written into `theme:`.
57
- */
58
- export declare const DESIGN_TYPE_SCALE_VALUES: readonly ["platform", "design"];
59
- /**
60
- * D2's optional `treatments` group — the four `SiteThemeSchema` shape
61
- * settings plus #7741's `buttonShape`, #7739's `darkInk` and `figures` (also runtime settings) and its
62
- * `typeScale` compile instruction.
33
+ * D2's optional `treatments` group — the runtime shape settings, #7741's
34
+ * `buttonShape`, #7739's `darkInk` and `figures`, and its `typeScale` compile
35
+ * instruction (never written into `theme:`).
63
36
  */
64
37
  export interface DesignTreatments {
65
- corners?: (typeof DESIGN_CORNERS_VALUES)[number];
66
- eyebrowCase?: (typeof DESIGN_EYEBROW_CASE_VALUES)[number];
67
- placeholders?: (typeof DESIGN_PLACEHOLDERS_VALUES)[number];
68
- checkmarks?: (typeof DESIGN_CHECKMARKS_VALUES)[number];
69
- buttonShape?: (typeof DESIGN_BUTTON_SHAPE_VALUES)[number];
70
- typeScale?: (typeof DESIGN_TYPE_SCALE_VALUES)[number];
71
- darkInk?: (typeof DESIGN_DARK_INK_VALUES)[number];
72
- figures?: (typeof DESIGN_FIGURES_VALUES)[number];
38
+ corners?: (typeof CORNERS_VALUES)[number];
39
+ eyebrowCase?: (typeof EYEBROW_CASE_VALUES)[number];
40
+ placeholders?: (typeof PLACEHOLDERS_VALUES)[number];
41
+ checkmarks?: (typeof CHECKMARKS_VALUES)[number];
42
+ buttonShape?: (typeof BUTTON_SHAPE_VALUES)[number];
43
+ typeScale?: (typeof TYPE_SCALE_VALUES)[number];
44
+ darkInk?: (typeof DARK_INK_VALUES)[number];
45
+ figures?: (typeof FIGURES_VALUES)[number];
73
46
  }
74
- /** D2's optional `sections` group — carried verbatim; look-field validation is #6803's. */
47
+ /** D2's optional `sections` group — page type → section key → look field → token, number or boolean. */
75
48
  export type DesignSections = Record<string, Record<string, unknown>>;
76
- /** The closed copy-density enum (spec 6892 D4). */
77
- export declare const DESIGN_COPY_DENSITY_VALUES: readonly ["standard", "sparse"];
78
49
  /**
79
50
  * Spec 6892 D4's optional `copy` group — how many words a design's own pages
80
51
  * carry. Read only by the fill-page/copywriting agents against the scaffold's
81
- * installed `DESIGN.md`; no code branches on it.
52
+ * installed `design.yaml`; no code branches on it.
82
53
  */
83
54
  export interface DesignCopy {
84
- density: (typeof DESIGN_COPY_DENSITY_VALUES)[number];
55
+ density: (typeof COPY_DENSITY_VALUES)[number];
85
56
  }
86
57
  /** The typed package `readDesignPackage` returns (D2). */
87
58
  export interface DesignPackage {
88
59
  name: string;
60
+ /** The design's own version (#12500 D4): a whole number from 1, raised by one with each settings change. */
61
+ version: number;
89
62
  description: string;
90
63
  colors: DesignColors;
91
64
  typography: DesignTypography;
@@ -94,27 +67,44 @@ export interface DesignPackage {
94
67
  layout: ResolvedSiteChrome;
95
68
  treatments?: DesignTreatments;
96
69
  sections: DesignSections;
97
- /** Absent in `DESIGN.md` resolves to `{ density: "standard" }` (D4). */
70
+ /** Absent in `design.yaml` resolves to `{ density: "standard" }` (D4). */
98
71
  copy: DesignCopy;
99
72
  }
100
73
  /**
101
74
  * Thrown by `readDesignPackage` on any malformed package (D2) — never thrown
102
75
  * after a write; every refusal happens before any I/O beyond reading
103
- * `DESIGN.md` itself.
76
+ * `design.yaml` itself.
104
77
  */
105
78
  export declare class DesignPackageError extends Error {
106
79
  readonly file: string;
107
80
  readonly field: string;
108
81
  constructor(file: string, field: string, reason: string);
109
82
  }
83
+ /**
84
+ * Parse `<dir>/design.yaml` — a bare YAML mapping — into a plain object tree
85
+ * (D5), with every refusal this reader's subset makes. `update` also reads a
86
+ * `theme:` block create-ailk wrote through it (#12500 D7).
87
+ */
88
+ export declare function parseSettings(text: string, file: string): Record<string, unknown>;
110
89
  /** One stack entry, trimmed, with one matching pair of `'` or `"` removed. */
111
90
  export declare function unquoteFamily(entry: string): string;
112
91
  /**
113
- * Read and validate `<dir>/DESIGN.md`'s frontmatter into a typed
92
+ * `readDesignPackage`'s check over settings text, with no file read (#12500
93
+ * D7): `update` reads a site's moved settings as a design before it writes them.
94
+ */
95
+ export declare function readDesignPackageText(text: string, file: string): DesignPackage;
96
+ /**
97
+ * Read `<dir>/design.yaml`, validated exactly as `readDesignPackage` validates
98
+ * it, and answer the parsed settings object rather than the typed package
99
+ * (#12477 D3): the settings a look of a workspace's own is written to its hub
100
+ * design record with. Refuses as `readDesignPackage` does.
101
+ */
102
+ export declare function readDesignSettings(dir: string): Record<string, unknown>;
103
+ /**
104
+ * Read and validate `<dir>/design.yaml` into a typed
114
105
  * `DesignPackage` (D1/D2). Refuses — naming the file and the field — on any
115
106
  * malformed package: a missing file, an unknown key, a wrong type, an
116
107
  * unknown layout value. Nothing is written; this function has no side
117
108
  * effects beyond the one read.
118
109
  */
119
110
  export declare function readDesignPackage(dir: string): DesignPackage;
120
- export {};