@astryxdesign/cli 0.7.16-canary.ge95b87c → 0.7.16

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 (120) hide show
  1. package/CHANGELOG.md +369 -0
  2. package/README.md +1 -1
  3. package/api/build/_adapter.d.mts +9 -0
  4. package/api/build/_adapter.mjs +24 -0
  5. package/api/build/kit/shell.weights.json +1 -0
  6. package/api/build/kit/shellcall.d.mts +26 -0
  7. package/api/build/kit/shellcall.mjs +87 -0
  8. package/api/build/kit/start.mjs +67 -4
  9. package/api/build/kit/weights.d.mts +15 -0
  10. package/api/build/kit/weights.mjs +27 -0
  11. package/api/component/__fixtures__/resolutions/modules.txt +1 -1
  12. package/api/doctor/_adapter.d.mts +3 -2
  13. package/api/doctor/_adapter.mjs +7 -1
  14. package/api/doctor/doctor.d.mts +8 -0
  15. package/api/doctor/doctor.mjs +53 -8
  16. package/api/doctor/theme-checks.mjs +157 -8
  17. package/api/icon/_adapter.d.mts +7 -3
  18. package/api/icon/_adapter.mjs +12 -3
  19. package/api/icon/icon.type.d.mts +15 -0
  20. package/api/icon/icon.type.mjs +10 -3
  21. package/api/icon/iconUse.doc.mjs +19 -5
  22. package/api/icon/list/list.mjs +7 -1
  23. package/api/icon/use/use.d.mts +8 -5
  24. package/api/icon/use/use.mjs +95 -13
  25. package/api/init/run/run.mjs +1 -0
  26. package/api/template/template.type.d.mts +6 -2
  27. package/api/template/template.type.mjs +2 -1
  28. package/api/theme/_adapter.mjs +16 -2
  29. package/api/theme/build/build.d.mts +10 -6
  30. package/api/theme/build/build.mjs +42 -29
  31. package/api/theme/generateTonalPalette.doc.mjs +2 -2
  32. package/api/theme/palette/generate/generator.mjs +141 -2
  33. package/api/theme/theme.type.d.mts +39 -0
  34. package/api/theme/theme.type.mjs +21 -0
  35. package/api/theme/themeBuild.doc.mjs +1 -1
  36. package/api/theme/themePaletteGenerate.doc.mjs +1 -1
  37. package/api/theme-edit/_adapter.d.mts +1 -0
  38. package/api/theme-edit/_adapter.mjs +79 -21
  39. package/api/theme-edit/_check.d.mts +25 -2
  40. package/api/theme-edit/_check.mjs +251 -61
  41. package/api/theme-edit/_context.d.mts +2 -1
  42. package/api/theme-edit/_context.mjs +19 -1
  43. package/api/theme-edit/_edit.d.mts +16 -0
  44. package/api/theme-edit/_edit.mjs +360 -59
  45. package/api/theme-edit/_how-question.d.mts +8 -0
  46. package/api/theme-edit/_how-question.mjs +169 -22
  47. package/api/theme-edit/_marks.d.mts +13 -0
  48. package/api/theme-edit/_marks.mjs +15 -0
  49. package/api/theme-edit/_palette.d.mts +27 -0
  50. package/api/theme-edit/_palette.mjs +112 -8
  51. package/api/theme-edit/_preview-app.d.mts +46 -1
  52. package/api/theme-edit/_preview-app.mjs +367 -36
  53. package/api/theme-edit/_preview.d.mts +55 -0
  54. package/api/theme-edit/_preview.mjs +231 -6
  55. package/api/theme-edit/_project.d.mts +4 -0
  56. package/api/theme-edit/_project.mjs +27 -6
  57. package/api/theme-edit/_settings.d.mts +61 -2
  58. package/api/theme-edit/_settings.mjs +317 -115
  59. package/api/theme-edit/_tables.mjs +1 -1
  60. package/api/theme-edit/theme-edit.type.d.mts +30 -2
  61. package/api/theme-edit/theme-edit.type.mjs +10 -2
  62. package/api/theme-edit/themeEditPreviewApp.doc.mjs +1 -1
  63. package/assets/docs/author-a-theme.doc.mjs +1 -1
  64. package/assets/docs/theme.doc.dense.mjs +1 -1
  65. package/assets/docs/theme.doc.mjs +1 -1
  66. package/assets/docs/theme.doc.zh.mjs +4 -3
  67. package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
  68. package/assets/docs/tree/icon-sets.doc.mjs +63 -8
  69. package/assets/docs.generated.json +2 -2
  70. package/assets/self-audit.generated.json +1 -1
  71. package/assets/templates/blocks/components/Outline/useOutlineFromDOMHookUsage.doc.mjs +21 -0
  72. package/assets/templates/blocks/components/Outline/useOutlineFromDOMHookUsage.tsx +62 -0
  73. package/assets/templates/components.generated.json +1 -1
  74. package/assets/templates/pages/ai-chat/page.tsx +20 -2
  75. package/assets/templates/themes/neutral/neutralPalettes.generated.receipt.json +2 -0
  76. package/authoring/config/config.doc.mjs +8 -0
  77. package/authoring/config/parse.d.mts +1 -0
  78. package/authoring/config/parse.mjs +12 -0
  79. package/authoring/config/type.ts +8 -0
  80. package/authoring/doctypes/icon-set/icon-set-data.doc.mjs +3 -3
  81. package/clients/cli/build-id.generated.json +1 -1
  82. package/clients/cli/commands/experimental/icon.mjs +61 -6
  83. package/clients/cli/commands/experimental/theme.mjs +9 -2
  84. package/clients/cli/commands/experimental-icon-use.doc.mjs +12 -5
  85. package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +2 -2
  86. package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
  87. package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +2 -2
  88. package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
  89. package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
  90. package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
  91. package/clients/cli/commands/theme.doc.mjs +7 -2
  92. package/clients/cli/commands/theme.mjs +41 -18
  93. package/clients/cli/commands.generated.json +1 -1
  94. package/clients/cli/index.mjs +25 -5
  95. package/clients/cli/manifest.generated.json +1 -1
  96. package/foundation/agent-docs/agent-docs.mjs +1 -1
  97. package/foundation/config/config-writer.d.mts +23 -0
  98. package/foundation/config/config-writer.mjs +150 -56
  99. package/foundation/config/project.mjs +43 -2
  100. package/foundation/discovery/component-discovery.mjs +6 -5
  101. package/foundation/discovery/icon-set-checks.mjs +164 -48
  102. package/foundation/discovery/icon-set-discovery.d.mts +38 -5
  103. package/foundation/discovery/icon-set-discovery.mjs +50 -6
  104. package/foundation/discovery/icon-set-theme-maps.d.mts +59 -0
  105. package/foundation/discovery/icon-set-theme-maps.mjs +95 -0
  106. package/foundation/discovery/icon-set-writer.d.mts +2 -3
  107. package/foundation/discovery/icon-set-writer.mjs +57 -16
  108. package/foundation/discovery/template-icons.d.mts +27 -10
  109. package/foundation/discovery/template-icons.mjs +142 -26
  110. package/foundation/discovery/theme-discovery.d.mts +25 -0
  111. package/foundation/discovery/theme-discovery.mjs +48 -7
  112. package/foundation/fs/gather-cache.mjs +6 -2
  113. package/foundation/integrations/autolink.d.mts +4 -2
  114. package/foundation/integrations/autolink.mjs +4 -2
  115. package/foundation/integrations/cli-requirement.d.mts +16 -5
  116. package/foundation/integrations/cli-requirement.mjs +27 -6
  117. package/foundation/integrations/may-have-integrations.mjs +5 -2
  118. package/foundation/integrations/missing-dependency.d.mts +9 -0
  119. package/foundation/integrations/missing-dependency.mjs +100 -0
  120. package/package.json +6 -6
@@ -17,8 +17,9 @@ import {fileURLToPath} from 'node:url';
17
17
  import * as fs from 'node:fs';
18
18
  import * as path from 'node:path';
19
19
  import {formatCliCommand, getCliInvocation, quoteCommandArgument} from '../../foundation/env/package-manager.mjs';
20
- import {hasRecordedProject} from '../../foundation/env/cli-command.mjs';
20
+ import {hasRecordedProject, recordDeclaredCliCommands} from '../../foundation/env/cli-command.mjs';
21
21
  import {isOutsideProject} from '../../foundation/env/project-scope.mjs';
22
+ import {mayHaveIntegrations} from '../../foundation/integrations/may-have-integrations.mjs';
22
23
  import {findConfigPath} from '../../foundation/config/config-path.mjs';
23
24
  import {API_VERSION, setJsonMode} from '../../foundation/response/json.mjs';
24
25
  import {answeredBy, runChoice} from '../../foundation/release/run-context.mjs';
@@ -235,7 +236,10 @@ export async function loadProjectDebugHandler() {
235
236
  * Commander parses, before any hook, so the preAction load cannot reach it.
236
237
  * `Project.load` reads astryx.config and each integration's manifest; it does
237
238
  * no discovery. Skipped when the debug preload already loaded the project, and
238
- * outside a package. Called from the bin before Commander parses.
239
+ * where no integration can load (no config, no manifest of its own, no
240
+ * installed dependency that ships one): nothing there declares a command, so
241
+ * help prints the same without loading the project module. Called from the
242
+ * bin before Commander parses.
239
243
  *
240
244
  * @param {string[]} [argv] arguments after the binary.
241
245
  * @returns {Promise<void>}
@@ -247,6 +251,11 @@ export async function loadProjectForHelp(argv = process.argv.slice(2)) {
247
251
  try {
248
252
  const cwd = process.cwd();
249
253
  if (hasRecordedProject(cwd)) return;
254
+ if (!mayHaveIntegrations(cwd)) {
255
+ // What loading this project would record: no declared command.
256
+ recordDeclaredCliCommands(cwd, []);
257
+ return;
258
+ }
250
259
  const {Project} = await import('../../foundation/config/project.mjs');
251
260
  await Project.load(cwd);
252
261
  } catch {
@@ -586,7 +595,7 @@ export async function createProgram({argv} = {}) {
586
595
 
587
596
  program
588
597
  .name('astryx')
589
- .description('Design system CLI — components, themes, and tooling')
598
+ .description('Design system CLI — components, themes, and tooling\n\nMaking or changing a theme? Use the experimental theme editor: astryx experimental theme editor new <name> --like neutral, then editor set / editor how "<what you want>"; after each change look at it with astryx experimental theme editor show <name> --png (writes PNGs, changes nothing in the app): a theme change is not done until you have looked. No app yet: astryx experimental theme preview app <dir>.')
590
599
  .version(pkg.version)
591
600
  // These four change only the reads named in their text; every other
592
601
  // command ignores them.
@@ -792,13 +801,20 @@ export async function createProgram({argv} = {}) {
792
801
  * Load the project's integrations before any command runs, so every command
793
802
  * it prints starts with the `cliCommand` they declare (the picker reads them
794
803
  * synchronously; see foundation/env/cli-command.mjs). Skipped when this
795
- * process already loaded the project, such as the bin's debug preload. A
796
- * project that cannot load is the command's to report, never this hook's.
804
+ * process already loaded the project, such as the bin's debug preload, and
805
+ * where no integration can load, so nothing declares a command (a command
806
+ * that needs the project still loads it). A project that cannot load is the
807
+ * command's to report, never this hook's.
797
808
  */
798
809
  program.hook('preAction', async () => {
799
810
  try {
800
811
  const cwd = process.cwd();
801
812
  if (hasRecordedProject(cwd)) return;
813
+ if (!mayHaveIntegrations(cwd)) {
814
+ // What loading this project would record: no declared command.
815
+ recordDeclaredCliCommands(cwd, []);
816
+ return;
817
+ }
802
818
  const {Project} = await import('../../foundation/config/project.mjs');
803
819
  await Project.load(cwd);
804
820
  } catch {
@@ -933,6 +949,10 @@ export async function createProgram({argv} = {}) {
933
949
  const stub = program
934
950
  .command(cmd.name)
935
951
  .description(`(failed to load: ${reason})`)
952
+ // Whatever options and words the run passed, it gets the load
953
+ // error, not a complaint about an option this stand-in never knew.
954
+ .allowUnknownOption()
955
+ .allowExcessArguments()
936
956
  .action(() => {
937
957
  // Nothing loaded, so nothing was answered — say that rather than
938
958
  // leaving the run's result unreported.