@astryxdesign/cli 0.7.15-canary.gea16e8d → 0.7.15

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 (134) hide show
  1. package/CHANGELOG.md +353 -3
  2. package/README.md +63 -63
  3. package/api/build/_adapter.d.mts +4 -0
  4. package/api/build/_adapter.mjs +28 -2
  5. package/api/build/blocks/blocks.d.mts +10 -1
  6. package/api/build/blocks/blocks.mjs +84 -7
  7. package/api/build/build.mjs +6 -1
  8. package/api/build/tree.d.mts +4 -0
  9. package/api/build/tree.mjs +9 -2
  10. package/api/doctor/_adapter.d.mts +2 -1
  11. package/api/doctor/_adapter.mjs +6 -1
  12. package/api/doctor/doctor.mjs +2 -2
  13. package/api/doctor/theme-checks.mjs +56 -21
  14. package/api/integration/add-helpers.mjs +5 -0
  15. package/api/integration/add-theme.mjs +15 -110
  16. package/api/integration/validate-integration.mjs +17 -3
  17. package/api/integration/validateIntegration.doc.mjs +1 -1
  18. package/api/theme/_adapter.d.mts +37 -5
  19. package/api/theme/_adapter.mjs +363 -50
  20. package/api/theme/_fork.d.mts +90 -0
  21. package/api/theme/_fork.mjs +246 -0
  22. package/api/theme/build/build.d.mts +25 -1
  23. package/api/theme/build/build.mjs +352 -41
  24. package/api/theme/eject/eject.mjs +36 -15
  25. package/api/theme/list/list.mjs +3 -6
  26. package/api/theme/palette/generate/generator.d.mts +13 -0
  27. package/api/theme/palette/generate/generator.mjs +32 -2
  28. package/api/theme/targets/targets.mjs +10 -3
  29. package/api/theme/template/template.mjs +48 -2
  30. package/api/theme/theme.type.d.mts +8 -0
  31. package/api/theme/theme.type.mjs +5 -1
  32. package/api/theme/themeBuild.doc.mjs +2 -2
  33. package/api/theme/themeRemove.doc.mjs +5 -2
  34. package/api/theme/themeTemplate.doc.mjs +2 -2
  35. package/api/theme/themeUse.doc.mjs +8 -2
  36. package/api/theme-edit/_adapter.mjs +157 -36
  37. package/api/theme-edit/_catalog.d.mts +1 -6
  38. package/api/theme-edit/_catalog.mjs +5 -268
  39. package/api/theme-edit/_check.d.mts +3 -1
  40. package/api/theme-edit/_check.mjs +733 -308
  41. package/api/theme-edit/_color.d.mts +19 -0
  42. package/api/theme-edit/_color.mjs +277 -33
  43. package/api/theme-edit/_compiler.d.mts +1 -0
  44. package/api/theme-edit/_compiler.mjs +25 -0
  45. package/api/theme-edit/_context.d.mts +2 -0
  46. package/api/theme-edit/_context.mjs +83 -9
  47. package/api/theme-edit/_css.d.mts +84 -0
  48. package/api/theme-edit/_css.mjs +700 -0
  49. package/api/theme-edit/_edit.mjs +370 -85
  50. package/api/theme-edit/_how-commands.d.mts +5 -0
  51. package/api/theme-edit/_how-commands.mjs +20 -13
  52. package/api/theme-edit/_how-question.d.mts +29 -0
  53. package/api/theme-edit/_how-question.mjs +1573 -182
  54. package/api/theme-edit/_how.mjs +306 -22
  55. package/api/theme-edit/_overview.mjs +2 -7
  56. package/api/theme-edit/_palette.d.mts +27 -5
  57. package/api/theme-edit/_palette.mjs +231 -97
  58. package/api/theme-edit/_parts.d.mts +42 -10
  59. package/api/theme-edit/_parts.mjs +224 -69
  60. package/api/theme-edit/_preview-app.d.mts +8 -0
  61. package/api/theme-edit/_preview-app.mjs +549 -96
  62. package/api/theme-edit/_preview.d.mts +7 -16
  63. package/api/theme-edit/_preview.mjs +77 -84
  64. package/api/theme-edit/_project.d.mts +20 -1
  65. package/api/theme-edit/_project.mjs +43 -13
  66. package/api/theme-edit/_settings.d.mts +96 -20
  67. package/api/theme-edit/_settings.mjs +646 -141
  68. package/api/theme-edit/_tables.d.mts +18 -12
  69. package/api/theme-edit/_tables.mjs +144 -147
  70. package/api/theme-edit/theme-edit.type.d.mts +10 -1
  71. package/api/theme-edit/theme-edit.type.mjs +3 -1
  72. package/api/theme-edit/themeEditNew.doc.mjs +1 -1
  73. package/api/theme-edit/themeEditPreviewAdd.doc.mjs +1 -1
  74. package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
  75. package/api/theme-edit/themeEditPreviewList.doc.mjs +2 -2
  76. package/api/theme-edit/themeEditSet.doc.mjs +1 -1
  77. package/api/theme-edit/themeEditUndo.doc.mjs +1 -1
  78. package/assets/docs/tree/checks.doc.mjs +22 -1
  79. package/assets/docs/tree/publishing.doc.mjs +1 -0
  80. package/assets/docs.generated.json +2 -2
  81. package/assets/self-audit.generated.json +1 -1
  82. package/authoring/integration/integration.doc.mjs +8 -0
  83. package/authoring/integration/schema.d.mts +8 -0
  84. package/authoring/integration/schema.mjs +1 -0
  85. package/authoring/integration/type.ts +9 -0
  86. package/clients/cli/build-id.generated.json +1 -1
  87. package/clients/cli/commands/experimental/index.mjs +10 -10
  88. package/clients/cli/commands/experimental/theme.mjs +22 -3
  89. package/clients/cli/commands/experimental-theme-compile.doc.mjs +2 -2
  90. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +3 -3
  91. package/clients/cli/commands/experimental-theme-preview-add.doc.mjs +1 -1
  92. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
  93. package/clients/cli/commands/integration.mjs +8 -0
  94. package/clients/cli/commands/theme-build.doc.mjs +2 -2
  95. package/clients/cli/commands/theme-list.doc.mjs +1 -1
  96. package/clients/cli/commands/theme-template.doc.mjs +1 -1
  97. package/clients/cli/commands/theme.mjs +325 -48
  98. package/clients/cli/index.mjs +18 -3
  99. package/clients/cli/lib/cli-error.mjs +118 -3
  100. package/clients/cli/manifest.generated.json +1 -1
  101. package/foundation/config/project.mjs +34 -8
  102. package/foundation/config/theme-state.d.mts +16 -0
  103. package/foundation/config/theme-state.mjs +84 -13
  104. package/foundation/discovery/template-needs.d.mts +13 -0
  105. package/foundation/discovery/template-needs.mjs +30 -15
  106. package/foundation/discovery/theme-discovery.mjs +14 -2
  107. package/foundation/discovery/theme-imports.d.mts +16 -0
  108. package/foundation/discovery/theme-imports.mjs +30 -2
  109. package/foundation/doc-compiler/import.mjs +10 -4
  110. package/foundation/fs/gather-cache.mjs +82 -23
  111. package/foundation/fs/jiti-cache.d.mts +21 -0
  112. package/foundation/fs/jiti-cache.mjs +66 -0
  113. package/foundation/fs/module-loader.mjs +7 -2
  114. package/foundation/integrations/autolink.d.mts +1 -24
  115. package/foundation/integrations/autolink.mjs +7 -60
  116. package/foundation/integrations/declared-dependencies.d.mts +27 -0
  117. package/foundation/integrations/declared-dependencies.mjs +73 -0
  118. package/foundation/integrations/integrations.d.mts +8 -0
  119. package/foundation/integrations/integrations.mjs +4 -0
  120. package/foundation/integrations/may-have-integrations.d.mts +8 -0
  121. package/foundation/integrations/may-have-integrations.mjs +47 -0
  122. package/foundation/integrations/validate-contributions.d.mts +62 -1
  123. package/foundation/integrations/validate-contributions.mjs +452 -29
  124. package/foundation/release/cache.d.mts +21 -2
  125. package/foundation/release/cache.mjs +48 -8
  126. package/foundation/release/folder-lock.d.mts +7 -0
  127. package/foundation/release/folder-lock.mjs +60 -26
  128. package/foundation/release/lock-lease.d.mts +2 -1
  129. package/foundation/release/lock-lease.mjs +7 -2
  130. package/foundation/response/error-codes.doc.mjs +1 -1
  131. package/foundation/response/response-types.doc.mjs +5 -5
  132. package/package.json +6 -6
  133. package/api/theme-edit/_css-properties.d.mts +0 -10
  134. package/api/theme-edit/_css-properties.mjs +0 -556
@@ -17,6 +17,7 @@
17
17
  * @typedef {object} HowTheme
18
18
  * @property {string} slug
19
19
  * @property {boolean} exists - false when the app has no theme: the commands name {@link EXAMPLE_THEME} and the answer starts with `new`.
20
+ * @property {string | null} previewDamage - why the in-app preview's record is damaged and how to fix it, or null.
20
21
  * @property {string[]} themes - Every theme the editor made in the app.
21
22
  * @property {string | null} note - Which theme the commands are for when the app has several, or that it has none.
22
23
  * @property {'named' | 'only' | 'last-changed' | 'none'} chosenBy - How the theme was picked.
@@ -83,6 +84,10 @@ export type HowTheme = {
83
84
  * - false when the app has no theme: the commands name {@link EXAMPLE_THEME} and the answer starts with `new`.
84
85
  */
85
86
  exists: boolean;
87
+ /**
88
+ * - why the in-app preview's record is damaged and how to fix it, or null.
89
+ */
90
+ previewDamage: string | null;
86
91
  /**
87
92
  * - Every theme the editor made in the app.
88
93
  */
@@ -43,6 +43,7 @@ export const EXAMPLE_THEME = 'my-theme';
43
43
  * @typedef {object} HowTheme
44
44
  * @property {string} slug
45
45
  * @property {boolean} exists - false when the app has no theme: the commands name {@link EXAMPLE_THEME} and the answer starts with `new`.
46
+ * @property {string | null} previewDamage - why the in-app preview's record is damaged and how to fix it, or null.
46
47
  * @property {string[]} themes - Every theme the editor made in the app.
47
48
  * @property {string | null} note - Which theme the commands are for when the app has several, or that it has none.
48
49
  * @property {'named' | 'only' | 'last-changed' | 'none'} chosenBy - How the theme was picked.
@@ -119,26 +120,32 @@ export async function howTheme(ctx, cwd, name) {
119
120
  x => x.thing !== 'font' || x.on === 'heading',
120
121
  ),
121
122
  };
123
+ const withBody = compileTheme(
124
+ ctx,
125
+ {
126
+ ...fontless,
127
+ settings: [
128
+ ...fontless.settings,
129
+ {thing: 'font', value: 'courier', on: 'body', source: 'dial'},
130
+ ],
131
+ },
132
+ base,
133
+ ).typography;
134
+ // The editor writes the base theme's heading font beside a body font of
135
+ // its own; only a build that writes none leaves headings to Core.
122
136
  const bodyFontReachesHeadings =
137
+ !withBody?.heading &&
123
138
  headingOf(compileTheme(ctx, fontless, base).typography) !==
124
- headingOf(
125
- compileTheme(
126
- ctx,
127
- {
128
- ...fontless,
129
- settings: [
130
- ...fontless.settings,
131
- {thing: 'font', value: 'courier', on: 'body', source: 'dial'},
132
- ],
133
- },
134
- base,
135
- ).typography,
136
- );
139
+ headingOf(withBody);
140
+ // A damaged preview record refuses every preview command, so an answer
141
+ // names its fix instead of a preview command.
142
+ const {previewRecordProblem} = await import('./_preview-app.mjs');
137
143
  return {
138
144
  slug,
139
145
  exists,
140
146
  themes,
141
147
  note,
148
+ previewDamage: previewRecordProblem(cwd),
142
149
  chosenBy: name
143
150
  ? 'named'
144
151
  : !themes.length
@@ -1,6 +1,21 @@
1
1
  // @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
2
2
  // DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
3
3
 
4
+ /**
5
+ * A CSS property the clause names, with its value kept whole ("caret-color
6
+ * #2563eb", "transition: background-color 150ms ease", "border-radius 12px
7
+ * 12px 0 0"). The value runs to the end of the clause or the part it is
8
+ * for, and is the longest start of it the property's grammar accepts.
9
+ * Plain words that are also properties ("color", "padding") count only
10
+ * with a colon; the aspect words read those.
11
+ * @param {string} text
12
+ * @returns {{prop: string, value: string, bad?: string} | null}
13
+ */
14
+ export function namedProperty(text: string): {
15
+ prop: string;
16
+ value: string;
17
+ bad?: string;
18
+ } | null;
4
19
  /**
5
20
  * Answer a plain-words question with drafts of commands.
6
21
  * @param {import('./_settings.mjs').Ctx} ctx
@@ -47,6 +62,14 @@ export type Clause = {
47
62
  * - family names the clause writes in quotes
48
63
  */
49
64
  quoted?: string[] | undefined;
65
+ /**
66
+ * - a CSS property the clause names, with its value as typed
67
+ */
68
+ named: {
69
+ prop: string;
70
+ value: string;
71
+ bad?: string;
72
+ } | null;
50
73
  };
51
74
  export type Step = import("./_how-commands.mjs").Step;
52
75
  /**
@@ -59,3 +82,9 @@ export type Draft = {
59
82
  sequence?: boolean;
60
83
  lookup?: string;
61
84
  };
85
+ export type PartRef = {
86
+ on: string;
87
+ when?: string;
88
+ role?: string;
89
+ level?: string;
90
+ };