@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
@@ -74,6 +74,7 @@ import {
74
74
  import {
75
75
  blockComponentsCheck,
76
76
  componentExamplesCheck,
77
+ packageListingCheck,
77
78
  componentDocNamesCheck,
78
79
  INVALID_CLI_COMMAND,
79
80
  isListedIssue,
@@ -448,6 +449,7 @@ async function validateAtPackageDir(
448
449
  ? resolveRoot(manifest.experimental?.iconSets, 'experimental.iconSets')
449
450
  : undefined,
450
451
  issuesUrl: manifest.issuesUrl,
452
+ logo: manifest.logo,
451
453
  agentDocs: manifest.agentDocs,
452
454
  cliCommand: manifest.cliCommand,
453
455
  __cliCommandError: cliCommandError,
@@ -889,6 +891,11 @@ export async function validateIntegration(pkg, options = {}) {
889
891
  const examples = integration
890
892
  ? await componentExamplesCheck(integration)
891
893
  : undefined;
894
+ // What a catalog needs to list the package: a logo, and an example of
895
+ // its components.
896
+ const listing = integration
897
+ ? packageListingCheck(integration, examples?.examples)
898
+ : undefined;
892
899
  const docNames = names?.[0].report;
893
900
  const blockComponents = names?.[1].report;
894
901
  // Notes fail nothing: a malformed `cliCommand`, and the findings added
@@ -913,6 +920,9 @@ export async function validateIntegration(pkg, options = {}) {
913
920
  each.notes.map(note => ({...note, next: true})),
914
921
  ),
915
922
  ...(examples?.notes ?? []).map(note => ({...note, next: true})),
923
+ // What a catalog needs to list the package is information only:
924
+ // these notes fail no check, under any flag.
925
+ ...(listing?.notes ?? []),
916
926
  ]
917
927
  : [];
918
928
  // The doc-syntax findings in the package's topics, as `next` notes with
@@ -926,6 +936,10 @@ export async function validateIntegration(pkg, options = {}) {
926
936
  })),
927
937
  );
928
938
  }
939
+ const assetsUnchecked = [
940
+ ...(examples?.unchecked ?? []),
941
+ ...(listing?.unchecked ?? []),
942
+ ];
929
943
  return {
930
944
  type: 'integration.validate',
931
945
  data: {
@@ -955,13 +969,13 @@ export async function validateIntegration(pkg, options = {}) {
955
969
  ...(result.found && result.olderCliNotes
956
970
  ? {olderCliNotes: result.olderCliNotes}
957
971
  : {}),
958
- // Template assets npm could not place, when there are any.
959
- ...(examples && examples.unchecked.length > 0
972
+ // Template assets and logos npm could not place, when there are any.
973
+ ...(assetsUnchecked.length > 0
960
974
  ? {
961
975
  exampleAssets: {
962
976
  status: 'checked',
963
977
  findings: [],
964
- unchecked: examples.unchecked,
978
+ unchecked: assetsUnchecked,
965
979
  },
966
980
  }
967
981
  : {}),
@@ -62,7 +62,7 @@ export const doc = {
62
62
  {
63
63
  type: 'integration.validate',
64
64
  description:
65
- "The result envelope: `data.validated`, false when nothing was validated — with no `package.json` at all, `data.issues` carries one `no_package` error-severity issue so the command exits 1; with a `package.json` but no integration manifest, `data.issues` is empty, which means \"not looked at\", not \"healthy\"; `data.name` and `data.version` of the validated package (both null when `data.validated` is false; `data.name` is `(local package)` when the local package.json has no readable name), plus `data.issues`, an AstryxIntegrationIssue[] of {code, severity: `warning` | `error`, message, fix?, file?, line?}: `fix` is the change that resolves the issue, and `file` and `line` where it is, relative to the package, when the check knows them; and `data.notes` when there are any: {code, message, next?} information beside the issues; a note fails nothing by default, and one with `next: true` counts as a warning under `integration check --next`, fails `integration check --strict --next`, and fails `--strict` from the next minor release. Notes include `invalid_cli_command` for a `cliCommand` that was ignored as malformed and `cli_peer_version` when the running CLI is outside the `@astryxdesign/cli` peer range of the package, and the package layout findings added after the last minor release, each with its fix in the message: `duplicate_component_doc`, `symlinked_root`, `unreadable_file`, `invalid_package_json` (no `name` or `version`), `no_provider_id`, and `source_without_component_doc` for a doc whose file name differs from its source only in letter case where the two still pair; and `doc_name_mismatch` and `unknown_block_component` (see `docNames` and `blockComponents`); they become warnings in the next minor release. For the commands a topic writes, `runner_command` (written with a package runner), `plain_command` (written bare), `package_manager_command` (written for one package manager) and `doc_token` (a token that does not parse) notes each give the file, line and the token to write. A `doc_target_not_found` note names a doc whose `replaces` or `extends` names no topic and no guide of the CLI's docs or the package's own (such as a namespace, with the guides below it), so it changes nothing unless an app also installs a package that provides it, and a `doc_section_unplaced` note a section whose `before` or `after` names no section of the topic or guide it extends, so it is added at the end, and a `duplicate_guide_replacement` note two docs of the package that replace one guide, of which only the last is read; they become warnings in the next minor release. When the manifest loads, `data.docTypes` holds the doc type check: `status` (`checked` | `skipped`), `reason` when skipped, `typescript`, `docs` (doc values checked), `findings` ({doc, line, export, type, field, problem: `unknown_field` | `missing_field` | `wrong_type`, severity: `warning`, message, fix}), `unchecked` ({doc, reason}: a doc that could not be fully checked, or a root its reader cannot read), and `fixtures` when the components or docs root holds test fixture docs under `__tests__`: how many, none of them checked. When the manifest loads, `data.docNames` lists the component doc names it could not judge: `status` (`checked`), `findings` (always empty; a doc name the module its import names provably does not export is a `doc_name_mismatch` note, with its fix in the message) and `unchecked` ({file, name, reason}: a doc whose `name` differs from the name it is listed under and whose source exports cannot all be read, such as a re-export from another package). When the manifest loads, `data.blockComponents` lists the component names templates give in `exampleFor` or `componentsUsed` that could not be judged: `status` (`checked`), `findings` (always empty; a name neither the package nor Core has, and the template does not import, is an `unknown_block_component` note, with its fix in the message) and `unchecked` ({file, name, reason}: a name the template may reach through anything other than named imports and re-exports from Core, React, StyleX, local helpers or the entry of the package itself, such as an import from another package, a default or namespace import, an alias of or member read off an imported binding, require() or a dynamic import(), or a local module that cannot be read, or any name Core would have to resolve when Core is not installed). Since 0.7.3 each import apps cannot use is a note in `data.notes`, its fix inside the message, listed only: it does not fail this command or `integration check --strict`, and fails `--strict` from the next minor release. The codes are `component_import_not_exported`, `component_import_other_package`, `component_import_missing_name`, `example_import_not_exported`, `example_import_missing_name`, `template_import_not_exported`, `template_import_outside_root`, `template_private_import`, `template_import_missing_name` and `template_no_default_export`. Since 0.7.4 the examples a package ships are checked the same way: `component_without_example` (a published component no block template shows with `exampleFor` and `isShowcase: true`, or names in `alsoShowcaseFor`), `template_category` (a template category written as a path, such as `components/X`), `showcase_not_standalone` (a showcase that imports server-only code or reads `process.env` past `NODE_ENV`) and `template_asset_not_packed` (a `new URL(…, import.meta.url)` asset that is missing, or that `npm pack --dry-run` leaves out of the package). When npm cannot list the package's files, an asset no `files` entry can reach is still a note, and any other is listed in `data.exampleAssets` (`{status: 'checked', findings: [], unchecked}`, present only when it lists any) as {file, asset, reason}; `integration check` counts them as not compared. When the manifest loads, `data.publicImports` is `{status: 'checked', findings: [], unchecked}`: `unchecked` lists each import the check could not judge, as {file, specifier, reason}, the reason starting `example <label>:` for an import in a component example: an `exports` target not built yet; a module whose export list cannot be read in full (CommonJS, or a declaration file it cannot read); a root import in a package with no `exports` (the root module `main` names is not read); every name an import (other than a component doc's own component) names that its module does not export, while a TypeScript file in the package has a `declare module` block for a relative path or the package's own name or a subpath of it, which can add names to that module (a `declare module` in a comment, `declare global`, a wildcard such as `'*.css'`, and another package's name do not count; a file whose text has `declare module` but that cannot be parsed counts); the same for every such name when the package has more than 5,000 files to search for that block; a deep path into build output not built yet in a package with no `exports`; a template import of Core when `@astryxdesign/core` is not installed beside the package (a `packages/core` of the workspace under another name does not count); every import of the package's own name when package.json has no `name` or a `name` that is not a bare package name; one entry for the whole check when package.json cannot be read; and an import of a subpath whose `exports` entry has only a `types` target, unless it is `import type`, every binding is an inline `type`, or every name it imports is a type its types file declares: a value import of a name that file does not declare as a type, a namespace or side-effect import, or any import when the types file cannot be read (it may be build output). `integration check` counts the unchecked as not compared; they never fail it. `data.olderCliNotes` ({file, kind: `template` | `namespace`, field, message}), for the local package, lists each descriptor field a release before 0.7.4 refuses while the package's CLI peer range admits one, such as `stability` on a template or namespace doc; it is present only when it has entries, is never counted, and never fails a check.",
65
+ "The result envelope: `data.validated`, false when nothing was validated — with no `package.json` at all, `data.issues` carries one `no_package` error-severity issue so the command exits 1; with a `package.json` but no integration manifest, `data.issues` is empty, which means \"not looked at\", not \"healthy\"; `data.name` and `data.version` of the validated package (both null when `data.validated` is false; `data.name` is `(local package)` when the local package.json has no readable name), plus `data.issues`, an AstryxIntegrationIssue[] of {code, severity: `warning` | `error`, message, fix?, file?, line?}: `fix` is the change that resolves the issue, and `file` and `line` where it is, relative to the package, when the check knows them; and `data.notes` when there are any: {code, message, next?} information beside the issues; a note fails nothing by default, and one with `next: true` counts as a warning under `integration check --next`, fails `integration check --strict --next`, and fails `--strict` from the next minor release. Notes include `invalid_cli_command` for a `cliCommand` that was ignored as malformed and `cli_peer_version` when the running CLI is outside the `@astryxdesign/cli` peer range of the package, and the package layout findings added after the last minor release, each with its fix in the message: `duplicate_component_doc`, `symlinked_root`, `unreadable_file`, `invalid_package_json` (no `name` or `version`), `no_provider_id`, and `source_without_component_doc` for a doc whose file name differs from its source only in letter case where the two still pair; and `doc_name_mismatch` and `unknown_block_component` (see `docNames` and `blockComponents`); they become warnings in the next minor release. For the commands a topic writes, `runner_command` (written with a package runner), `plain_command` (written bare), `package_manager_command` (written for one package manager) and `doc_token` (a token that does not parse) notes each give the file, line and the token to write. A `doc_target_not_found` note names a doc whose `replaces` or `extends` names no topic and no guide of the CLI's docs or the package's own (such as a namespace, with the guides below it), so it changes nothing unless an app also installs a package that provides it, and a `doc_section_unplaced` note a section whose `before` or `after` names no section of the topic or guide it extends, so it is added at the end, and a `duplicate_guide_replacement` note two docs of the package that replace one guide, of which only the last is read; they become warnings in the next minor release. When the manifest loads, `data.docTypes` holds the doc type check: `status` (`checked` | `skipped`), `reason` when skipped, `typescript`, `docs` (doc values checked), `findings` ({doc, line, export, type, field, problem: `unknown_field` | `missing_field` | `wrong_type`, severity: `warning`, message, fix}), `unchecked` ({doc, reason}: a doc that could not be fully checked, or a root its reader cannot read), and `fixtures` when the components or docs root holds test fixture docs under `__tests__`: how many, none of them checked. When the manifest loads, `data.docNames` lists the component doc names it could not judge: `status` (`checked`), `findings` (always empty; a doc name the module its import names provably does not export is a `doc_name_mismatch` note, with its fix in the message) and `unchecked` ({file, name, reason}: a doc whose `name` differs from the name it is listed under and whose source exports cannot all be read, such as a re-export from another package). When the manifest loads, `data.blockComponents` lists the component names templates give in `exampleFor` or `componentsUsed` that could not be judged: `status` (`checked`), `findings` (always empty; a name neither the package nor Core has, and the template does not import, is an `unknown_block_component` note, with its fix in the message) and `unchecked` ({file, name, reason}: a name the template may reach through anything other than named imports and re-exports from Core, React, StyleX, local helpers or the entry of the package itself, such as an import from another package, a default or namespace import, an alias of or member read off an imported binding, require() or a dynamic import(), or a local module that cannot be read, or any name Core would have to resolve when Core is not installed). Since 0.7.3 each import apps cannot use is a note in `data.notes`, its fix inside the message, listed only: it does not fail this command or `integration check --strict`, and fails `--strict` from the next minor release. The codes are `component_import_not_exported`, `component_import_other_package`, `component_import_missing_name`, `example_import_not_exported`, `example_import_missing_name`, `template_import_not_exported`, `template_import_outside_root`, `template_private_import`, `template_import_missing_name` and `template_no_default_export`. Since 0.7.4 the examples a package ships are checked the same way: `component_without_example` (a published component no block template shows with `exampleFor` and `isShowcase: true`, or names in `alsoShowcaseFor`), `template_category` (a template category written as a path, such as `components/X`), `showcase_not_standalone` (a showcase that imports server-only code or reads `process.env` past `NODE_ENV`) and `template_asset_not_packed` (a `new URL(…, import.meta.url)` asset that is missing, or that `npm pack --dry-run` leaves out of the package). When npm cannot list the package's files, an asset no `files` entry can reach is still a note, and any other is listed in `data.exampleAssets` (`{status: 'checked', findings: [], unchecked}`, present only when it lists any) as {file, asset, reason}; `integration check` counts them as not compared. Since 0.7.15 two notes, without `next`, say what a catalog needs to list the package, each with its fix in the message; they fail no check under any flag: `package_without_logo` (the integration file's `logo.light`, or a `logo.dark` that is set, names no file in the package that is a PNG, JPEG, WebP or shapes-only SVG of at most 512 KB and that npm packs; when the integration file has no `logo`, package.json `marketplace.logo` is read the same way) and `package_without_example` (the package contributes components, other than the ones `component_without_example` exempts, but no block template sets `isShowcase: true` with `exampleFor`, or `alsoShowcaseFor`; a package of themes, docs or codemods alone needs none). A logo npm cannot be asked about is listed in `data.exampleAssets` with `file` set to the file that names it. When the manifest loads, `data.publicImports` is `{status: 'checked', findings: [], unchecked}`: `unchecked` lists each import the check could not judge, as {file, specifier, reason}, the reason starting `example <label>:` for an import in a component example: an `exports` target not built yet; a module whose export list cannot be read in full (CommonJS, or a declaration file it cannot read); a root import in a package with no `exports` (the root module `main` names is not read); every name an import (other than a component doc's own component) names that its module does not export, while a TypeScript file in the package has a `declare module` block for a relative path or the package's own name or a subpath of it, which can add names to that module (a `declare module` in a comment, `declare global`, a wildcard such as `'*.css'`, and another package's name do not count; a file whose text has `declare module` but that cannot be parsed counts); the same for every such name when the package has more than 5,000 files to search for that block; a deep path into build output not built yet in a package with no `exports`; a template import of Core when `@astryxdesign/core` is not installed beside the package (a `packages/core` of the workspace under another name does not count); every import of the package's own name when package.json has no `name` or a `name` that is not a bare package name; one entry for the whole check when package.json cannot be read; and an import of a subpath whose `exports` entry has only a `types` target, unless it is `import type`, every binding is an inline `type`, or every name it imports is a type its types file declares: a value import of a name that file does not declare as a type, a namespace or side-effect import, or any import when the types file cannot be read (it may be build output). `integration check` counts the unchecked as not compared; they never fail it. `data.olderCliNotes` ({file, kind: `template` | `namespace`, field, message}), for the local package, lists each descriptor field a release before 0.7.4 refuses while the package's CLI peer range admits one, such as `stability` on a template or namespace doc; it is present only when it has entries, is never counted, and never fails a check.",
66
66
  },
67
67
  ],
68
68
  examples: [
@@ -6,6 +6,15 @@
6
6
  * @param {import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme} theme
7
7
  */
8
8
  export function themeRecordOwner(theme: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme): string;
9
+ /**
10
+ * Whether `--package <name>` selects a theme. It takes either name the CLI
11
+ * shows for it: the package that provides it (`@astryxdesign/cli` for a
12
+ * bundled theme) or the package the app imports it from, which the record
13
+ * holds (`@astryxdesign/theme-butter`).
14
+ * @param {import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme} theme
15
+ * @param {string | undefined} name
16
+ */
17
+ export function themeInPackage(theme: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme, name: string | undefined): boolean;
9
18
  /**
10
19
  * A bundled theme entry kept for the historical public `listThemes()` helper.
11
20
  * @typedef {Pick<import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme, 'slug' | 'displayName' | 'description' | 'maintained' | 'entry' | 'exportName' | 'files'>} BundledTheme
@@ -66,14 +75,21 @@ export function listUnmigratedThemeCopies(cwd: string): import("../../foundation
66
75
  /**
67
76
  * Publish one theme's complete source inventory as an atomic local fork.
68
77
  * @param {import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme} theme
69
- * @param {{cwd: string, targetPath?: string, overwrite?: boolean}} options
70
- * @returns {string} project-relative output directory
78
+ * @param {{cwd: string, targetPath?: string, overwrite?: boolean, takenSlugs?: Set<string>}} options
79
+ * `takenSlugs`: the slugs of the themes the project can use, which a fork's
80
+ * new folder name may not take
81
+ * @returns {{outputDir: string, files: string[]}} the project-relative output
82
+ * directory and the files written, named as the fork names them
71
83
  */
72
- export function ejectThemeFiles(theme: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme, { cwd, targetPath, overwrite }: {
84
+ export function ejectThemeFiles(theme: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme, { cwd, targetPath: typedPath, overwrite, takenSlugs }: {
73
85
  cwd: string;
74
86
  targetPath?: string;
75
87
  overwrite?: boolean;
76
- }): string;
88
+ takenSlugs?: Set<string>;
89
+ }): {
90
+ outputDir: string;
91
+ files: string[];
92
+ };
77
93
  /**
78
94
  * The packages the fork imports that the app does not declare. A fork that
79
95
  * imports a missing package (bundled icon sets use `lucide-react`) fails to
@@ -91,14 +107,30 @@ export function forkNeeds(outputDir: string, files: string[], cwd: string): {
91
107
  * Without an explicit package, a local theme shadows package themes that share
92
108
  * its slug. Other duplicate slugs fail closed until the caller selects an owner.
93
109
  * @param {string} [slug]
94
- * @param {{cwd?: string, package?: string, includeLocal?: boolean}} [options]
110
+ * @param {{cwd?: string, package?: string, includeLocal?: boolean, command?: string}} [options]
111
+ * `command`: the command a refusal suggests running with `--package`,
112
+ * `theme add` by default
95
113
  * @returns {Promise<import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme | undefined>}
96
114
  */
97
115
  export function findTheme(slug?: string, options?: {
98
116
  cwd?: string;
99
117
  package?: string;
100
118
  includeLocal?: boolean;
119
+ command?: string;
101
120
  }): Promise<import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme | undefined>;
121
+ /**
122
+ * Runnable `<command> <slug>` suggestions for an unknown slug, closest names
123
+ * first; `--package` is named only where packages share a slug.
124
+ * @param {string} command such as `theme add`
125
+ * @param {string} slug what the person typed
126
+ * @param {import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme[]} available
127
+ * @param {string} cwd
128
+ * @returns {Array<{theme: import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme, name: string}>}
129
+ */
130
+ export function themeCommandsFor(command: string, slug: string, available: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme[], cwd: string): Array<{
131
+ theme: import("../../foundation/discovery/theme-discovery.mjs").DiscoveredTheme;
132
+ name: string;
133
+ }>;
102
134
  /**
103
135
  * Read the generated module's app-theme record with stable CLI errors.
104
136
  * @param {string} [cwd]