@astryxdesign/cli 0.7.0-canary.9eb7c76 → 0.7.0-canary.b507cde
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.
- package/README.md +79 -83
- package/api/build/build.mjs +9 -0
- package/api/component/_adapter.d.mts +2 -0
- package/api/component/_adapter.mjs +3 -1
- package/api/component/component.doc.mjs +5 -1
- package/api/docs/compiled-topics.test.mjs +16 -0
- package/api/gap-report/gap-report.doc.mjs +1 -1
- package/api/gap-report/gap-report.mjs +15 -0
- package/api/index.d.mts +0 -2
- package/api/index.mjs +0 -2
- package/api/init/init.mjs +22 -0
- package/api/integration/pack-check.test.mjs +8 -0
- package/api/integration/validate-integration.d.mts +4 -0
- package/api/integration/validate-integration.mjs +5 -2
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/json/index.ts +0 -1
- package/api/template/list/list.mjs +23 -2
- package/api/template/list/list.test.mjs +52 -0
- package/api/template/template-integration.test.mjs +37 -100
- package/api/template/template.doc.mjs +8 -3
- package/api/template/template.mjs +45 -0
- package/api/template/template.type.mjs +1 -1
- package/api/theme/build/build.d.mts +0 -1
- package/api/theme/build/build.mjs +4 -29
- package/api/theme/build/family.mjs +1 -1
- package/api/upgrade/upgrade.doc.mjs +1 -1
- package/api/upgrade/upgrade.mjs +19 -0
- package/assets/codemods/transforms/next/__tests__/migrate-field-input-styling.test.mjs +108 -0
- package/assets/codemods/transforms/next/__tests__/preserve-bottom-sheet-content-padding.test.mjs +178 -0
- package/assets/codemods/transforms/next/__tests__/validate-data-token-ownership.test.mjs +84 -0
- package/assets/codemods/transforms/next/index.mjs +24 -0
- package/assets/codemods/transforms/next/migrate-field-input-styling.mjs +198 -0
- package/assets/codemods/transforms/next/preserve-bottom-sheet-content-padding.mjs +242 -0
- package/assets/codemods/transforms/next/validate-data-token-ownership.mjs +102 -0
- package/assets/docs/author-a-theme.doc.mjs +4 -4
- package/assets/docs/tree/tokens-data.doc.mjs +2 -2
- package/assets/docs/tree/tokens-usage.doc.mjs +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetHeights.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetMobileKeyboard.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetNoScrim.tsx +1 -1
- package/assets/templates/blocks/components/BottomSheet/BottomSheetSnapPoints.tsx +1 -1
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorDeadlinePicker.tsx +1 -1
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorShowcase.tsx +1 -1
- package/assets/templates/blocks/components/ComplexSelector/ComplexSelectorTreeSearch.tsx +1 -1
- package/assets/templates/blocks/components/Dialog/DialogAdaptivePresentation.tsx +1 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider02Overrides.tsx +1 -1
- package/assets/templates/blocks/components/Selector/SelectorClearable.tsx +1 -1
- package/assets/templates/blocks/components/Selector/SelectorOptionDescriptions.tsx +2 -2
- package/assets/templates/blocks/components/Selector/SelectorShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Selector/SelectorWithSections.tsx +1 -1
- package/assets/templates/blocks/components/SelectorOption/SelectorOptionBasic.tsx +1 -1
- package/assets/templates/blocks/components/SelectorOption/SelectorOptionShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Slider/SliderFormattedValue.tsx +1 -1
- package/assets/templates/blocks/components/Slider/SliderRangeSlider.tsx +1 -1
- package/assets/templates/blocks/components/Slider/SliderShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Slider/SliderWithMarks.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerClear.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerCreatable.tsx +2 -2
- package/assets/templates/blocks/components/Tokenizer/TokenizerEndContent.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerIcon.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerMaxEntries.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerOverflow.tsx +2 -2
- package/assets/templates/blocks/components/Tokenizer/TokenizerShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Tokenizer/TokenizerStates.tsx +4 -4
- package/assets/templates/blocks/components/Toolbar/ToolbarTableFilter.tsx +1 -1
- package/assets/templates/pages/canvas-editor/page.tsx +2 -2
- package/assets/templates/pages/form-wizard-vertical/page.tsx +1 -1
- package/assets/templates/pages/payment-form/page.tsx +1 -1
- package/assets/templates/pages/table-filter/page.tsx +11 -6
- package/assets/templates/pages/table-inbox/page.tsx +3 -1
- package/assets/templates/pages/theme-showcase/page.tsx +2 -2
- package/assets/templates/themes/neutral/neutralPaletteRefs.generated.ts +10 -9
- package/clients/cli/command-result-coverage.test.mjs +1 -1
- package/clients/cli/commands/build-theme.color-scheme.test.mjs +10 -6
- package/clients/cli/commands/build-theme.data-tokens.test.mjs +23 -75
- package/clients/cli/commands/build.doc.mjs +1 -1
- package/clients/cli/commands/build.mjs +1 -1
- package/clients/cli/commands/component-ownership.test.mjs +2 -2
- package/clients/cli/commands/debug-result-summary.test.mjs +0 -16
- package/clients/cli/commands/doctor.mjs +5 -2
- package/clients/cli/commands/gap-report.doc.mjs +1 -1
- package/clients/cli/commands/gap-report.test.mjs +2 -2
- package/clients/cli/commands/init.doc.mjs +4 -4
- package/clients/cli/commands/init.flag-help.test.mjs +7 -10
- package/clients/cli/commands/integration.mjs +2 -1
- package/clients/cli/commands/option-pair-refusals.test.mjs +37 -0
- package/clients/cli/commands/silent-success-refusals.test.mjs +15 -0
- package/clients/cli/commands/template.doc.mjs +4 -4
- package/clients/cli/commands/template.flag-help.test.mjs +18 -11
- package/clients/cli/commands/text-json-parity.test.mjs +0 -17
- package/clients/cli/commands/upgrade.doc.mjs +1 -1
- package/clients/cli/commands/upgrade.flag-help.test.mjs +7 -11
- package/clients/cli/commands/validate-nothing-exits-nonzero.test.mjs +67 -0
- package/clients/cli/index.mjs +0 -4
- package/clients/cli/lib/exit-codes.test.mjs +0 -7
- package/clients/cli/lib/json-shim.test.mjs +0 -24
- package/foundation/discovery/template-needs.mjs +93 -11
- package/foundation/discovery/template-needs.test.mjs +106 -3
- package/foundation/doc-compiler/doc-loads.test.mjs +0 -12
- package/foundation/env/package-manager.d.mts +13 -0
- package/foundation/env/package-manager.mjs +106 -63
- package/foundation/response/error-codes.doc.mjs +1 -1
- package/foundation/response/response-types.doc.mjs +2 -19
- package/foundation/response/response.doc.mjs +1 -1
- package/foundation/xle/browser.d.mts +2 -2
- package/foundation/xle/browser.mjs +2 -2
- package/foundation/xle/expand.mjs +1 -1
- package/foundation/xle/print.mjs +1 -1
- package/package.json +9 -9
- package/api/layout/_adapter.d.mts +0 -34
- package/api/layout/_adapter.mjs +0 -148
- package/api/layout/check/check.d.mts +0 -17
- package/api/layout/check/check.mjs +0 -41
- package/api/layout/expand/expand.d.mts +0 -23
- package/api/layout/expand/expand.mjs +0 -161
- package/api/layout/expand/expand.path-safety.test.mjs +0 -53
- package/api/layout/expand/expand.receipt.test.mjs +0 -74
- package/api/layout/grammar/grammar.d.mts +0 -14
- package/api/layout/grammar/grammar.mjs +0 -88
- package/api/layout/layout.d.mts +0 -6
- package/api/layout/layout.mjs +0 -17
- package/api/layout/layout.test.mjs +0 -297
- package/api/layout/layout.type.d.mts +0 -90
- package/api/layout/layout.type.mjs +0 -104
- package/api/layout/layoutCheck.doc.d.mts +0 -11
- package/api/layout/layoutCheck.doc.mjs +0 -85
- package/api/layout/layoutExpand.doc.d.mts +0 -11
- package/api/layout/layoutExpand.doc.mjs +0 -107
- package/api/layout/layoutGrammar.doc.d.mts +0 -11
- package/api/layout/layoutGrammar.doc.mjs +0 -57
- package/clients/cli/commands/layout-check.doc.mjs +0 -67
- package/clients/cli/commands/layout-expand.doc.mjs +0 -87
- package/clients/cli/commands/layout-grammar.doc.mjs +0 -32
- package/clients/cli/commands/layout.deprecation-lifecycle.test.mjs +0 -140
- package/clients/cli/commands/layout.doc.mjs +0 -36
- package/clients/cli/commands/layout.error-codes.test.mjs +0 -66
- package/clients/cli/commands/layout.exit-parity.test.mjs +0 -41
- package/clients/cli/commands/layout.expand-receipt.test.mjs +0 -94
- package/clients/cli/commands/layout.mjs +0 -327
- package/clients/cli/commands/layout.path-help.test.mjs +0 -33
- package/clients/cli/commands/layout.stdin-cap.test.mjs +0 -47
- package/clients/cli/commands/layout.text-fields.test.mjs +0 -39
package/README.md
CHANGED
|
@@ -78,24 +78,23 @@ Options:
|
|
|
78
78
|
|
|
79
79
|
<!-- BEGIN GENERATED: commands -->
|
|
80
80
|
|
|
81
|
-
| Command | Description
|
|
82
|
-
| ------------- |
|
|
83
|
-
| `blog` | Read the Astryx blog from the published feed
|
|
84
|
-
| `build` | Build a page: the template to start from, or the workflow playbook (no query)
|
|
85
|
-
| `component` | List components or print component docs
|
|
86
|
-
| `discover` | Browse and search integrations: the ones you have and the ones you could add
|
|
87
|
-
| `docs` | Print reference docs
|
|
88
|
-
| `doctor` | Diagnose Astryx projects and integration packages
|
|
89
|
-
| `gap-report` | Report a missing component or feature to the package that owns it
|
|
90
|
-
| `hook` | List hooks or print hook docs
|
|
91
|
-
| `init` | Initialize the design system in your project
|
|
92
|
-
| `integration` | Author and verify an Astryx integration package
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `
|
|
96
|
-
| `
|
|
97
|
-
| `
|
|
98
|
-
| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components |
|
|
81
|
+
| Command | Description |
|
|
82
|
+
| ------------- | ----------------------------------------------------------------------------- |
|
|
83
|
+
| `blog` | Read the Astryx blog from the published feed |
|
|
84
|
+
| `build` | Build a page: the template to start from, or the workflow playbook (no query) |
|
|
85
|
+
| `component` | List components or print component docs |
|
|
86
|
+
| `discover` | Browse and search integrations: the ones you have and the ones you could add |
|
|
87
|
+
| `docs` | Print reference docs |
|
|
88
|
+
| `doctor` | Diagnose Astryx projects and integration packages |
|
|
89
|
+
| `gap-report` | Report a missing component or feature to the package that owns it |
|
|
90
|
+
| `hook` | List hooks or print hook docs |
|
|
91
|
+
| `init` | Initialize the design system in your project |
|
|
92
|
+
| `integration` | Author and verify an Astryx integration package |
|
|
93
|
+
| `search` | Search components, hooks, docs, templates, and themes in one ranked list |
|
|
94
|
+
| `swizzle` | Copy component source for customization |
|
|
95
|
+
| `template` | List, show, or scaffold page and block templates |
|
|
96
|
+
| `theme` | Add, switch, build, and author themes |
|
|
97
|
+
| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components |
|
|
99
98
|
|
|
100
99
|
<!-- END GENERATED: commands -->
|
|
101
100
|
<!-- Generated by scripts/generate-cli-readme.mjs from `astryx manifest`. Run `pnpm -F @astryxdesign/cli readme`. -->
|
|
@@ -165,7 +164,7 @@ if (isError(result)) {
|
|
|
165
164
|
| `ERR_UNKNOWN` | Fallback for any error without a more specific code. |
|
|
166
165
|
| `ERR_UNKNOWN_COMMAND` | A top-level command name was not recognized (e.g. `astryx bogus`). |
|
|
167
166
|
| `ERR_UNKNOWN_SUBCOMMAND` | A subcommand under a command group was not recognized (e.g. `astryx theme bogus`). |
|
|
168
|
-
| `ERR_INVALID_OPTION` | An unknown option was passed, --json was given to a command without JSON output
|
|
167
|
+
| `ERR_INVALID_OPTION` | An unknown option was passed, --json was given to a command without JSON output. |
|
|
169
168
|
| `ERR_INVALID_ARGUMENT` | An argument or option value is invalid: wrong type, out of range, an unknown choice, an extra argument, or a conflicting combination. |
|
|
170
169
|
| `ERR_MISSING_ARGUMENT` | A required argument or option value was omitted. |
|
|
171
170
|
| `ERR_INVALID_LANG` | `--lang` was given a value outside its choices (en, zh, dense). |
|
|
@@ -420,70 +419,67 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
420
419
|
|
|
421
420
|
<!-- BEGIN GENERATED: response-types -->
|
|
422
421
|
|
|
423
|
-
| Type | What `data` carries
|
|
424
|
-
| --------------------------------- |
|
|
425
|
-
| `init.run` | The install receipt: the `mode` (`default` \| `features`), the features run, agent-doc files written, any soft `docsError`, whether theme guidance was emitted, the template outcome (`workflow` \| `created` \| `skipped`) plus its path, and whether the next-steps were emitted.
|
|
426
|
-
| `init.remove` | The removal receipt — returned when --remove-agents is set: `data.removed` is true when a managed agent-docs block was found and removed, and false when there was none to remove.
|
|
427
|
-
| `component.list` | The component catalog grouped by component group (each component's group field): `detail` (the level: names \| compact \| full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries ({name, package, description, import}), or a full ComponentDoc per entry with its package.
|
|
428
|
-
| `component.batch` | The component specialization of the shared `BatchResponse` and `BatchRow` types. An explicit programmatic selector array, or two or more CLI selectors, returns one ordered receipt: `count` plus `results`, one row per selector including duplicates. Every row carries `selector` and `status` (found \| not_found \| ambiguous \| error). A found row carries `result`, the same {type, data} response as one selector. An ambiguous row carries `code`, `error`, and `candidates` ({package, component, kind, installed}). Other failed rows carry `code`, `error`, and optional `suggestions` ({name, reason}).
|
|
429
|
-
| `component.detail` | One component's authored ComponentDoc plus ownership fields (package, the owner; import, the specifier; sourceAvailable, whether source exists) and parentDoc (present when the component is documented inside another component's doc, naming that doc). The envelope's package names the same owner.
|
|
430
|
-
| `component.detail.props` | Just one component's props table (ComponentPropDoc[]). The envelope's package names the npm package that owns the component.
|
|
431
|
-
| `component.detail.source` | One component's source file, as {component, source}. The envelope's package names the npm package that owns the component.
|
|
432
|
-
| `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. The envelope's package names the npm package that owns the component.
|
|
433
|
-
| `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry ({name, package, displayName, description, isShowcase, category}); each block names the package that owns it, and the envelope's package names the component's owner.
|
|
434
|
-
| `docs.list` | All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load.
|
|
435
|
-
| `docs.detail` | One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined and each section naming the package that wrote it, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there).
|
|
436
|
-
| `docs.index` | One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, package, summary} (pass the id as the section argument; package is the npm package that wrote the section; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there).
|
|
437
|
-
| `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open its topic index and the sections before and after it). The envelope's package names the npm package that wrote the section.
|
|
438
|
-
| `docs.node` | One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down, each naming its package) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names).
|
|
439
|
-
| `blog.list` | The feed URL plus every post parsed from the RSS feed, each with slug, title, description, date, type, authors, link, and plaintext URL.
|
|
440
|
-
| `blog.detail` | One post's metadata plus the feed URL and the post's full plaintext body.
|
|
441
|
-
| `discover.list` | The integrations the project loads (name, category, components, version, a list per other kind they add, and latest when a source knows it); with a discover source, meta.available lists what the project could add and meta.sources reports each source; when empty it carries meta.configured to tell "nothing configured" from "nothing discovered".
|
|
442
|
-
| `discover.detail` | One package, for an @scope/name or @scope/name@version query: what the shown version adds, whether the project has it, and, when a source knows the package, its versions, latest release, and the command that adds it.
|
|
443
|
-
| `discover.detail.doc` | The validated ComponentDoc for one installed component, for an @scope/name/Component query.
|
|
444
|
-
| `discover.item` | One item that is not an installed component, for an @scope/name/<item> query: its kind, name, package, version, and whether the project has the package.
|
|
445
|
-
| `discover.search` | The echoed query plus every matching item and package across all packages, each with its kind and whether the project has it, even when only one matches; total is set when --limit cut the list.
|
|
446
|
-
| `search` | The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, package, score, reason, description, command} (package is the npm package that owns the result), plus import (components, hooks), title, parent (the command that opens the level above), and, for a hit on one section, section (docs), or displayName and kind (templates).
|
|
447
|
-
| `build.help` | The how-to-build-a-page playbook, emitted when no query is given: `playbook: true`, a title, the ordered steps (title, commands, optional returns), the on-system rules, and related lookups. Commands are bare subcommands for the caller to render with its own invocation.
|
|
448
|
-
| `build.kit` | The template to start from and its kit: query, hasResults, matchCount (never a cap), directMatch, start {name, package, command, basis, reason, alternatives, ...} (the start and each alternative name the package that owns the template), pages (search's closest templates), blocks and domain as SearchResultEntry[] (each naming its package), frame and foundation (Core component names), and hint {reason, commands} when thin.
|
|
449
|
-
| `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. The envelope's package is @astryxdesign/core.
|
|
450
|
-
| `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling. The envelope's package names the same owning package.
|
|
451
|
-
| `gap-report.categories` | The fixed gap category values and human-readable labels.
|
|
452
|
-
| `gap-report.file` | An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project \| integration \| fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals.
|
|
453
|
-
| `template.list` | The effective discovered TemplateListEntry[] for pages and blocks. A winning replacement entry includes optional `replaces`, naming the Core id omitted from the default list.
|
|
454
|
-
| `template.show` | The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media).
|
|
455
|
-
| `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. The envelope's package names the npm package that owns the template.
|
|
456
|
-
| `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, demoMediaReplaced (how many Astryx demo media references were replaced with placeholders), notes (setup notes naming what the template needs that the project lacks — missing packages, missing StyleX compiler; empty when satisfied), missingPackages (external package names the template imports that are not in the project), and installCommand (a ready-to-run install command with the detected package manager and workspace version ranges; null when nothing is missing). The envelope's package names the npm package that owns the template. |
|
|
457
|
-
| `template.cdn` | A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not. `exists` when a file was already there, which is a success.
|
|
458
|
-
| `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. The envelope's package is @astryxdesign/core, the only package that ships hooks.
|
|
459
|
-
| `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core.
|
|
460
|
-
| `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). The envelope's package is @astryxdesign/core.
|
|
461
|
-
| `theme.build` | A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, cssDts, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load).
|
|
462
|
-
| `theme.build.check` | The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing \| outdated}), and the full list of checked paths. Writes nothing.
|
|
463
|
-
| `theme.build.batch` | Several themes built in one invocation: `count` plus one {file, receipt} per theme in argument order, where receipt is that theme's theme.build (or theme.build.check) envelope, or null when it produced no CSS.
|
|
464
|
-
| `theme.list` | Every bundled, installed package, and local theme as a ThemeListEntry[]. Each entry has slug, displayName, description, maintained, owner package or local root, source, added, and default fields. Optional meta.unmigratedCopies names earlier descriptor-less copies, their missing descriptor, and the upgrade command; those copies are not data entries.
|
|
465
|
-
| `theme.app` | The app theme record after add, remove, or use. It includes every added theme and its built imports, the default slug, generated module path, and the command change. After add, the envelope package names the npm package that owns the added theme; a local theme has none.
|
|
466
|
-
| `theme.eject` | A local source-fork receipt with the resolved slug, displayName, source theme maintained flag, source-selector package, outputDir, source entry, exportName, and every file written, including the descriptor. The written local descriptor always uses maintained: false.
|
|
467
|
-
| `theme.template` | A write receipt for the annotated theme template: the path (relative to cwd), whether it was written, and the reason it was not. `exists` when a file was already there, which is a success.
|
|
468
|
-
| `theme.targets` | The whole themeable surface: the echoed filter, componentCount, and targets, one per theming target — {key, className, component, props, states}, where props and states are its legal override keys.
|
|
469
|
-
| `theme.palette.generate` | An author-reviewable OKLCH palette candidate, its reproducibility receipt, summary counts, and optional candidate/receipt file-write result.
|
|
470
|
-
| `upgrade.list` | Every available codemod, oldest→newest, as {name, package, title, version, optional}; returned for --list without running anything.
|
|
471
|
-
| `upgrade.registry` | The copied-composition receipt for --registry: applied, ok, the counts (found, current, wouldUpdate, updated, wouldMerge, merged, wouldRefreshReceipt, receiptsRefreshed, conflicts, missing, invalid, failed), and items.
|
|
472
|
-
| `upgrade.status` | A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary.
|
|
473
|
-
| `upgrade.run` | The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, sourcePathFound (false when the resolved source directory does not exist, so no source file was read), and (apply mode) filesChanged, transformsApplied, and per-codemod errors.
|
|
474
|
-
| `manifest` | The CLI capability manifest: name, version, apiVersion, description, globalOptions, commands (each name, description, arguments, options, json, aliases?, responseTypes?, examples?, exitCodes? as [{code, when}], subcommands?), jsonSupported, and the flat responseTypes index.
|
|
475
|
-
| `help` | Help, in one of two shapes. A bare `astryx --json` returns the root manifest: name, version, commands (the command names), jsonSupported, and manifest (the full payload `astryx manifest --json` returns). `--help --json` on any command, or `astryx help [command] --json`, returns that command's help: command, description, usage, options (each flags, description, and defaultValue and choices when set), and subcommands (each name and description). data.manifest marks the first shape; data.usage marks the second.
|
|
476
|
-
| `version` | The CLI version, for `astryx --version --json`: {version}.
|
|
477
|
-
| `doctor` | The health-check report: `checks` (each with id, label, status: pass \| warn \| fail \| info, a message, and an optional fix, always present on warn and fail) plus a `summary` of counts per status.
|
|
478
|
-
| `integration.add` | A contribution-writer receipt: kind, name, optional root {path, created}, integration-manifest path, every affected project-relative path, written, and dryRun.
|
|
479
|
-
| `integration.pack-check` | The packed-package check: name, version, packable, tarball {filename, fileCount, size, unpackedSize} or null, inventory {manifest, roots [{kind, path, expectedFiles, missingFiles, complete}], expectedFiles, packedFiles}, contributions {local, packed}, each null or {themes [{slug, exportName}], components, templates [{id, type, name}], codemods [{version, id}], docs, agentDocsAppend}, and issues [{code, severity, message}].
|
|
480
|
-
| `integration.validate` | The validation result: validated (false when no
|
|
481
|
-
| `integration.template-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}.
|
|
482
|
-
| `integration.component-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command.
|
|
483
|
-
| `integration.doc-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` \| `error`) and `relationship` (`replaces` \| `extends` \| `accidental`).
|
|
484
|
-
| `layout.expand` | The expansion: parsed form, generated TSX code, componentsUsed, states (count of useState hooks scaffolded), todos, blocksReferenced (each {name, mode}), warnings, written (the output path, or null when nothing was written), and demoMediaReplaced (count of demo media placeholders). Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
|
|
485
|
-
| `layout.check` | The validation result: a valid flag, the detected form, errors (each with line/col, message, formatted text, and suggestions), warnings, and the expression re-printed in both canonical surfaces (compact and outline). Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
|
|
486
|
-
| `layout.grammar` | The XLE/XLO grammar cheatsheet: a text field with the full reference plus an aliases map (short name → canonical component) generated from this install's registry. Carries `meta.deprecations` with DEP-0006 and its replacement commands. |
|
|
422
|
+
| Type | What `data` carries |
|
|
423
|
+
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
424
|
+
| `init.run` | The install receipt: the `mode` (`default` \| `features`), the features run, agent-doc files written, any soft `docsError`, whether theme guidance was emitted, the template outcome (`workflow` \| `created` \| `skipped`) plus its path, and whether the next-steps were emitted. |
|
|
425
|
+
| `init.remove` | The removal receipt — returned when --remove-agents is set: `data.removed` is true when a managed agent-docs block was found and removed, and false when there was none to remove. |
|
|
426
|
+
| `component.list` | The component catalog grouped by component group (each component's group field): `detail` (the level: names \| compact \| full) and `components`, the grouped map of names entries ({name, package, and optional canonical import for integrations}), brief entries ({name, package, description, import}), or a full ComponentDoc per entry with its package. |
|
|
427
|
+
| `component.batch` | The component specialization of the shared `BatchResponse` and `BatchRow` types. An explicit programmatic selector array, or two or more CLI selectors, returns one ordered receipt: `count` plus `results`, one row per selector including duplicates. Every row carries `selector` and `status` (found \| not_found \| ambiguous \| error). A found row carries `result`, the same {type, data} response as one selector. An ambiguous row carries `code`, `error`, and `candidates` ({package, component, kind, installed}). Other failed rows carry `code`, `error`, and optional `suggestions` ({name, reason}). |
|
|
428
|
+
| `component.detail` | One component's authored ComponentDoc plus ownership fields (package, the owner; import, the specifier; sourceAvailable, whether source exists) and parentDoc (present when the component is documented inside another component's doc, naming that doc). The envelope's package names the same owner. |
|
|
429
|
+
| `component.detail.props` | Just one component's props table (ComponentPropDoc[]). The envelope's package names the npm package that owns the component. |
|
|
430
|
+
| `component.detail.source` | One component's source file, as {component, source}. The envelope's package names the npm package that owns the component. |
|
|
431
|
+
| `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. The envelope's package names the npm package that owns the component. |
|
|
432
|
+
| `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry ({name, package, displayName, description, isShowcase, category}); each block names the package that owns it, and the envelope's package names the component's owner. |
|
|
433
|
+
| `docs.list` | All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load. |
|
|
434
|
+
| `docs.detail` | One topic's full ReferenceDoc (the JSON read of a topic, --full, --dense, or a topic with one section), with token-ref blocks inlined and each section naming the package that wrote it, plus links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
|
|
435
|
+
| `docs.index` | One topic's section index, the text read of a topic with more than one section (and --index): the topic's name, title, and description, plus sections, each {id, title, package, summary} (pass the id as the section argument; package is the npm package that wrote the section; summary is the section's one-line summary), and links ({up, previous, next}: the commands that open the level it sits in and its neighbors there). |
|
|
436
|
+
| `docs.detail.section` | One ReferenceSection of a topic, found by key or title, with token-ref blocks inlined, plus links ({up, previous, next}: the commands that open its topic index and the sections before and after it). The envelope's package names the npm package that wrote the section. |
|
|
437
|
+
| `docs.node` | One node of the docs tree, read by its route: its id, kind, package, title, summary, and breadcrumb, plus a namespace's slots with their children (one level down, each naming its package) or a typed doc's content, and links ({up, previous, next, related}: the commands that open its parent, its neighbors, and the docs it names). |
|
|
438
|
+
| `blog.list` | The feed URL plus every post parsed from the RSS feed, each with slug, title, description, date, type, authors, link, and plaintext URL. |
|
|
439
|
+
| `blog.detail` | One post's metadata plus the feed URL and the post's full plaintext body. |
|
|
440
|
+
| `discover.list` | The integrations the project loads (name, category, components, version, a list per other kind they add, and latest when a source knows it); with a discover source, meta.available lists what the project could add and meta.sources reports each source; when empty it carries meta.configured to tell "nothing configured" from "nothing discovered". |
|
|
441
|
+
| `discover.detail` | One package, for an @scope/name or @scope/name@version query: what the shown version adds, whether the project has it, and, when a source knows the package, its versions, latest release, and the command that adds it. |
|
|
442
|
+
| `discover.detail.doc` | The validated ComponentDoc for one installed component, for an @scope/name/Component query. |
|
|
443
|
+
| `discover.item` | One item that is not an installed component, for an @scope/name/<item> query: its kind, name, package, version, and whether the project has the package. |
|
|
444
|
+
| `discover.search` | The echoed query plus every matching item and package across all packages, each with its kind and whether the project has it, even when only one matches; total is set when --limit cut the list. |
|
|
445
|
+
| `search` | The echoed query, `matchCount` (total matches, before `limit`), and results, a ranked SearchResultEntry[] bounded by `limit`: each {domain, name, package, score, reason, description, command} (package is the npm package that owns the result), plus import (components, hooks), title, parent (the command that opens the level above), and, for a hit on one section, section (docs), or displayName and kind (templates). |
|
|
446
|
+
| `build.help` | The how-to-build-a-page playbook, emitted when no query is given: `playbook: true`, a title, the ordered steps (title, commands, optional returns), the on-system rules, and related lookups. Commands are bare subcommands for the caller to render with its own invocation. |
|
|
447
|
+
| `build.kit` | The template to start from and its kit: query, hasResults, matchCount (never a cap), directMatch, start {name, package, command, basis, reason, alternatives, ...} (the start and each alternative name the package that owns the template), pages (search's closest templates), blocks and domain as SearchResultEntry[] (each naming its package), frame and foundation (Core component names), and hint {reason, commands} when thin. |
|
|
448
|
+
| `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. The envelope's package is @astryxdesign/core. |
|
|
449
|
+
| `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the written file names, whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling. The envelope's package names the same owning package. |
|
|
450
|
+
| `gap-report.categories` | The fixed gap category values and human-readable labels. |
|
|
451
|
+
| `gap-report.file` | An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project \| integration \| fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals. |
|
|
452
|
+
| `template.list` | The effective discovered TemplateListEntry[] for pages and blocks. A winning replacement entry includes optional `replaces`, naming the Core id omitted from the default list. |
|
|
453
|
+
| `template.show` | The resolved template's source, exactly as a copy writes it, plus its description, kind, the component names it composes, and demoMediaReplaced (how many Astryx demo media references were replaced with placeholders for you to swap for your own media). |
|
|
454
|
+
| `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description and the components it composes. The envelope's package names the npm package that owns the template. |
|
|
455
|
+
| `template.copy` | A scaffold receipt: template id, output directory, written file name, file count, demoMediaReplaced (how many Astryx demo media references were replaced with placeholders), notes (setup notes naming what the template needs that the project lacks — missing packages, missing StyleX compiler; empty when satisfied), missingPackages (external package names the template imports that are not in the project), and installCommand (a ready-to-run install command with the detected package manager and workspace version ranges; null when nothing is missing, or when several lockfiles leave the package manager undetermined). The envelope's package names the npm package that owns the template. |
|
|
456
|
+
| `template.cdn` | A write receipt for the no-build-step CDN starter page: the path (relative to cwd), the Astryx version every CDN URL was pinned to, whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
|
|
457
|
+
| `hook.list` | The hook catalog grouped by category: `detail` (the level: names \| compact \| full) and `components`, the grouped map of hook names, brief entries, or a full HookDoc per entry. The envelope's package is @astryxdesign/core, the only package that ships hooks. |
|
|
458
|
+
| `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core. |
|
|
459
|
+
| `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). The envelope's package is @astryxdesign/core. |
|
|
460
|
+
| `theme.build` | A theme build receipt: name, tokenCount and componentCount (override counts), sizeKB, the written outputs {css, cssDts, js, dts, and variantsDts when applicable}, warnings (defects to fix), and notices (advisories about a correct theme, such as a named font it does not load). |
|
|
461
|
+
| `theme.build.check` | The --check receipt: theme name, an upToDate flag, the stale outputs (each {path, reason: missing \| outdated}), and the full list of checked paths. Writes nothing. |
|
|
462
|
+
| `theme.build.batch` | Several themes built in one invocation: `count` plus one {file, receipt} per theme in argument order, where receipt is that theme's theme.build (or theme.build.check) envelope, or null when it produced no CSS. |
|
|
463
|
+
| `theme.list` | Every bundled, installed package, and local theme as a ThemeListEntry[]. Each entry has slug, displayName, description, maintained, owner package or local root, source, added, and default fields. Optional meta.unmigratedCopies names earlier descriptor-less copies, their missing descriptor, and the upgrade command; those copies are not data entries. |
|
|
464
|
+
| `theme.app` | The app theme record after add, remove, or use. It includes every added theme and its built imports, the default slug, generated module path, and the command change. After add, the envelope package names the npm package that owns the added theme; a local theme has none. |
|
|
465
|
+
| `theme.eject` | A local source-fork receipt with the resolved slug, displayName, source theme maintained flag, source-selector package, outputDir, source entry, exportName, and every file written, including the descriptor. The written local descriptor always uses maintained: false. |
|
|
466
|
+
| `theme.template` | A write receipt for the annotated theme template: the path (relative to cwd), whether it was written, and the reason it was not. `exists` when a file was already there, which is a success. |
|
|
467
|
+
| `theme.targets` | The whole themeable surface: the echoed filter, componentCount, and targets, one per theming target — {key, className, component, props, states}, where props and states are its legal override keys. |
|
|
468
|
+
| `theme.palette.generate` | An author-reviewable OKLCH palette candidate, its reproducibility receipt, summary counts, and optional candidate/receipt file-write result. |
|
|
469
|
+
| `upgrade.list` | Every available codemod, oldest→newest, as {name, package, title, version, optional}; returned for --list without running anything. |
|
|
470
|
+
| `upgrade.registry` | The copied-composition receipt for --registry: applied, ok, the counts (found, current, wouldUpdate, updated, wouldMerge, merged, wouldRefreshReceipt, receiptsRefreshed, conflicts, missing, invalid, failed), and items. |
|
|
471
|
+
| `upgrade.status` | A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary. |
|
|
472
|
+
| `upgrade.run` | The run receipt: from/to versions, codemod count, integrations processed, the agent-docs summary, sourcePathFound (false when the resolved source directory does not exist, so no source file was read), and (apply mode) filesChanged, transformsApplied, and per-codemod errors. |
|
|
473
|
+
| `manifest` | The CLI capability manifest: name, version, apiVersion, description, globalOptions, commands (each name, description, arguments, options, json, aliases?, responseTypes?, examples?, exitCodes? as [{code, when}], subcommands?), jsonSupported, and the flat responseTypes index. |
|
|
474
|
+
| `help` | Help, in one of two shapes. A bare `astryx --json` returns the root manifest: name, version, commands (the command names), jsonSupported, and manifest (the full payload `astryx manifest --json` returns). `--help --json` on any command, or `astryx help [command] --json`, returns that command's help: command, description, usage, options (each flags, description, and defaultValue and choices when set), and subcommands (each name and description). data.manifest marks the first shape; data.usage marks the second. |
|
|
475
|
+
| `version` | The CLI version, for `astryx --version --json`: {version}. |
|
|
476
|
+
| `doctor` | The health-check report: `checks` (each with id, label, status: pass \| warn \| fail \| info, a message, and an optional fix, always present on warn and fail) plus a `summary` of counts per status. |
|
|
477
|
+
| `integration.add` | A contribution-writer receipt: kind, name, optional root {path, created}, integration-manifest path, every affected project-relative path, written, and dryRun. |
|
|
478
|
+
| `integration.pack-check` | The packed-package check: name, version, packable, tarball {filename, fileCount, size, unpackedSize} or null, inventory {manifest, roots [{kind, path, expectedFiles, missingFiles, complete}], expectedFiles, packedFiles}, contributions {local, packed}, each null or {themes [{slug, exportName}], components, templates [{id, type, name}], codemods [{version, id}], docs, agentDocsAppend}, and issues [{code, severity, message}]. |
|
|
479
|
+
| `integration.validate` | The validation result: validated (false when nothing was validated: with no package.json the issues list carries one no_package error so the command exits 1, and with a package.json but no integration manifest the issues list is empty and proves nothing), the package name and version (both null when validated is false) plus issues, an AstryxIntegrationIssue[] of {code, severity: warning \| error, message}. |
|
|
480
|
+
| `integration.template-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking Core template-id conflicts as {id, severity: warning, integrationPackage, integrationType, integrationName, coreMatches, message, command}. |
|
|
481
|
+
| `integration.component-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and non-blocking conflicts where an integration component name is also owned by Core; each conflict includes the exact package-qualified command. |
|
|
482
|
+
| `integration.doc-conflicts` | validated (false when no integration manifest was found, so nothing was inspected), the integration identity, structural issues, and Core doc overlaps. Each finding includes `severity` (`info` \| `error`) and `relationship` (`replaces` \| `extends` \| `accidental`). |
|
|
487
483
|
|
|
488
484
|
<!-- END GENERATED: response-types -->
|
|
489
485
|
<!-- Generated by scripts/generate-cli-readme.mjs from the response-types EnumDoc. Run `pnpm -F @astryxdesign/cli readme`. -->
|
package/api/build/build.mjs
CHANGED
|
@@ -13,6 +13,8 @@
|
|
|
13
13
|
* a query → build.kit (api/build/kit/kit.mjs)
|
|
14
14
|
*/
|
|
15
15
|
|
|
16
|
+
import {AstryxError} from '../error.mjs';
|
|
17
|
+
import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
|
|
16
18
|
import {buildHelp} from './help/help.mjs';
|
|
17
19
|
import {buildKit} from './kit/kit.mjs';
|
|
18
20
|
|
|
@@ -31,5 +33,12 @@ export async function build(query, options = {}) {
|
|
|
31
33
|
if (!query || !String(query).trim()) {
|
|
32
34
|
return buildHelp();
|
|
33
35
|
}
|
|
36
|
+
if (options.limit != null && (!Number.isInteger(options.limit) || options.limit <= 0)) {
|
|
37
|
+
throw new AstryxError(
|
|
38
|
+
`Invalid limit "${options.limit}". Must be a positive integer.`,
|
|
39
|
+
undefined,
|
|
40
|
+
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
34
43
|
return buildKit(query, options);
|
|
35
44
|
}
|
|
@@ -149,6 +149,8 @@ export function resolveCoreSourcePath(coreDir: string, dirName: string): string
|
|
|
149
149
|
/**
|
|
150
150
|
* Resolve a bare (unscoped) name to a `.doc.mjs`: core first, then back-compat
|
|
151
151
|
* externals, then a conservative fuzzy search. Throws ERR_UNKNOWN_COMPONENT
|
|
152
|
+
* for a genuinely unknown name, and ERR_AMBIGUOUS_COMPONENT when multiple
|
|
153
|
+
* packages provide the same name
|
|
152
154
|
* (with candidate suggestions when close) or ERR_NO_DOC.
|
|
153
155
|
* @param {string} dirName - bare component name (no `XDS` prefix)
|
|
154
156
|
* @param {{coreDir: string, cwd: string, name: string}} ctx - `name` is the caller's original (prefixed) input, used in error text
|
|
@@ -324,7 +324,7 @@ export class ComponentAmbiguityError extends AstryxError {
|
|
|
324
324
|
super(
|
|
325
325
|
`Component "${dirName}" is provided by multiple packages. Re-run with --package <pkg> to choose one.`,
|
|
326
326
|
owners.map(o => ({name: o.package, reason: 'provides this component'})),
|
|
327
|
-
ERROR_CODES.
|
|
327
|
+
ERROR_CODES.ERR_AMBIGUOUS_COMPONENT,
|
|
328
328
|
);
|
|
329
329
|
this.candidates = owners.map(owner => ({
|
|
330
330
|
package: owner.package,
|
|
@@ -375,6 +375,8 @@ export function resolveCoreSourcePath(coreDir, dirName) {
|
|
|
375
375
|
/**
|
|
376
376
|
* Resolve a bare (unscoped) name to a `.doc.mjs`: core first, then back-compat
|
|
377
377
|
* externals, then a conservative fuzzy search. Throws ERR_UNKNOWN_COMPONENT
|
|
378
|
+
* for a genuinely unknown name, and ERR_AMBIGUOUS_COMPONENT when multiple
|
|
379
|
+
* packages provide the same name
|
|
378
380
|
* (with candidate suggestions when close) or ERR_NO_DOC.
|
|
379
381
|
* @param {string} dirName - bare component name (no `XDS` prefix)
|
|
380
382
|
* @param {{coreDir: string, cwd: string, name: string}} ctx - `name` is the caller's original (prefixed) input, used in error text
|
|
@@ -170,7 +170,11 @@ export const doc = {
|
|
|
170
170
|
},
|
|
171
171
|
{
|
|
172
172
|
code: 'ERR_UNKNOWN_COMPONENT',
|
|
173
|
-
when: 'name is not a string, resolves to no known component,
|
|
173
|
+
when: 'name is not a string, resolves to no known component, or is absent from the requested options.package',
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
code: 'ERR_AMBIGUOUS_COMPONENT',
|
|
177
|
+
when: 'the component is provided by multiple packages (pass options.package to disambiguate)',
|
|
174
178
|
},
|
|
175
179
|
{
|
|
176
180
|
code: 'ERR_UNKNOWN_PACKAGE',
|
|
@@ -48,6 +48,22 @@ describe('every shipped topic compiles to plain JSON', () => {
|
|
|
48
48
|
);
|
|
49
49
|
});
|
|
50
50
|
|
|
51
|
+
describe('author-a-theme color guidance', () => {
|
|
52
|
+
it('teaches committed generated palette references as the main example', async () => {
|
|
53
|
+
const catalog = await loadDocsCatalog();
|
|
54
|
+
const topic = detailView(
|
|
55
|
+
await compileTopic(catalog, catalog.resolve('author-a-theme')),
|
|
56
|
+
);
|
|
57
|
+
const rendered = JSON.stringify(topic);
|
|
58
|
+
|
|
59
|
+
expect(rendered).toContain("import {palette} from './palette.generated';");
|
|
60
|
+
expect(rendered).toContain('palette.neutral.light[100]');
|
|
61
|
+
expect(rendered).toContain('palette.neutral.dark[15]');
|
|
62
|
+
expect(rendered).toContain('color (existing themes)');
|
|
63
|
+
expect(rendered).not.toContain("color: { accent: ['#7B61FF'");
|
|
64
|
+
});
|
|
65
|
+
});
|
|
66
|
+
|
|
51
67
|
describe('reads that share a catalog', () => {
|
|
52
68
|
it(
|
|
53
69
|
'never let one read change another',
|
|
@@ -74,7 +74,7 @@ export const doc = {
|
|
|
74
74
|
name: 'options.listCategories',
|
|
75
75
|
type: 'boolean',
|
|
76
76
|
description:
|
|
77
|
-
'Return categories without resolving a route or writing; the component and every other option are
|
|
77
|
+
'Return categories without resolving a route or writing; the component and every other option are refused with ERR_INVALID_ARGUMENT.',
|
|
78
78
|
default: 'false',
|
|
79
79
|
},
|
|
80
80
|
{
|
|
@@ -595,6 +595,21 @@ function aggregateStatus(deliveries) {
|
|
|
595
595
|
*/
|
|
596
596
|
export async function gapReport(component, options = {}) {
|
|
597
597
|
if (options.listCategories) {
|
|
598
|
+
const ignored = [
|
|
599
|
+
component ? 'component' : null,
|
|
600
|
+
options.category ? '--category' : null,
|
|
601
|
+
options.reason ? '--reason' : null,
|
|
602
|
+
options.detail ? '--additional-context' : null,
|
|
603
|
+
options.package ? '--package' : null,
|
|
604
|
+
options.confirmPublic ? '--confirm-public' : null,
|
|
605
|
+
].filter(Boolean);
|
|
606
|
+
if (ignored.length > 0) {
|
|
607
|
+
throw new AstryxError(
|
|
608
|
+
`\`--list-categories\` cannot be combined with ${ignored.join(', ')}: it lists categories and ignores submission options.`,
|
|
609
|
+
undefined,
|
|
610
|
+
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
611
|
+
);
|
|
612
|
+
}
|
|
598
613
|
return {
|
|
599
614
|
type: 'gap-report.categories',
|
|
600
615
|
data: GAP_REPORT_CATEGORIES.map(category => ({...category})),
|
package/api/index.d.mts
CHANGED
|
@@ -33,14 +33,12 @@ export * from "./gap-report/gap-report.type.mjs";
|
|
|
33
33
|
export * from "./upgrade/upgrade.type.mjs";
|
|
34
34
|
export * from "./init/init.type.mjs";
|
|
35
35
|
export * from "./doctor/doctor.type.mjs";
|
|
36
|
-
export * from "./layout/layout.type.mjs";
|
|
37
36
|
export * from "./integration/integration-authoring.type.mjs";
|
|
38
37
|
export * from "./integration/pack-check.type.mjs";
|
|
39
38
|
export * from "./integration/validate-integration.type.mjs";
|
|
40
39
|
export * from "./integration/authoring-checks.type.mjs";
|
|
41
40
|
export type Logger = import("./logger.mjs").Logger;
|
|
42
41
|
export { themeBuild, themeAdd, themeRemove, themeUse, themeEject, themeTemplate, themeList, themeListAvailable, themeListCopySources, themeTargets, themePaletteGenerate, generateTonalPalette, listThemes } from "./theme/theme.mjs";
|
|
43
|
-
export { layoutExpand, layoutCheck, layoutGrammar } from "./layout/layout.mjs";
|
|
44
42
|
export { integrationAdd, integrationAddAgentDoc, integrationAddCodemod, integrationAddComponent, integrationAddDoc, integrationAddTemplate } from "./integration/add-contribution.mjs";
|
|
45
43
|
export { validateIntegration, summarizeIssues } from "./integration/validate-integration.mjs";
|
|
46
44
|
export { integrationTemplateConflicts, integrationComponentConflicts, integrationDocConflicts } from "./integration/authoring-checks.mjs";
|
package/api/index.mjs
CHANGED
|
@@ -48,7 +48,6 @@ export {gapReport} from './gap-report/gap-report.mjs';
|
|
|
48
48
|
export {upgrade} from './upgrade/upgrade.mjs';
|
|
49
49
|
export {init} from './init/init.mjs';
|
|
50
50
|
export {doctor} from './doctor/doctor.mjs';
|
|
51
|
-
export {layoutExpand, layoutCheck, layoutGrammar} from './layout/layout.mjs';
|
|
52
51
|
export {
|
|
53
52
|
integrationAdd,
|
|
54
53
|
integrationAddAgentDoc,
|
|
@@ -97,7 +96,6 @@ export * from './gap-report/gap-report.type.mjs';
|
|
|
97
96
|
export * from './upgrade/upgrade.type.mjs';
|
|
98
97
|
export * from './init/init.type.mjs';
|
|
99
98
|
export * from './doctor/doctor.type.mjs';
|
|
100
|
-
export * from './layout/layout.type.mjs';
|
|
101
99
|
export * from './integration/integration-authoring.type.mjs';
|
|
102
100
|
export * from './integration/pack-check.type.mjs';
|
|
103
101
|
export * from './integration/validate-integration.type.mjs';
|
package/api/init/init.mjs
CHANGED
|
@@ -18,6 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
import {run} from './run/run.mjs';
|
|
20
20
|
import {remove} from './remove/remove.mjs';
|
|
21
|
+
import {AstryxError} from '../error.mjs';
|
|
22
|
+
import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
|
|
21
23
|
|
|
22
24
|
export {getNextSteps} from './run/run.mjs';
|
|
23
25
|
|
|
@@ -42,7 +44,27 @@ export {getNextSteps} from './run/run.mjs';
|
|
|
42
44
|
*/
|
|
43
45
|
export async function init(options = {}, {cwd = process.cwd()} = {}) {
|
|
44
46
|
if (options.removeAgents) {
|
|
47
|
+
const ignored = [
|
|
48
|
+
options.features ? '--features' : null,
|
|
49
|
+
options.all ? '--all' : null,
|
|
50
|
+
options.agent ? '--agent' : null,
|
|
51
|
+
options.agentDocsPath ? '--agent-docs-path' : null,
|
|
52
|
+
].filter(Boolean);
|
|
53
|
+
if (ignored.length > 0) {
|
|
54
|
+
throw new AstryxError(
|
|
55
|
+
`\`--remove-agents\` cannot be combined with ${ignored.join(', ')}: it removes the managed block and ignores install options.`,
|
|
56
|
+
undefined,
|
|
57
|
+
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
45
60
|
return remove({cwd});
|
|
46
61
|
}
|
|
62
|
+
if (options.all && options.features) {
|
|
63
|
+
throw new AstryxError(
|
|
64
|
+
'`--all` and `--features` cannot be used together: `--all` installs every feature, so a feature list is redundant.',
|
|
65
|
+
undefined,
|
|
66
|
+
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
67
|
+
);
|
|
68
|
+
}
|
|
47
69
|
return run(options, {cwd});
|
|
48
70
|
}
|
|
@@ -504,6 +504,14 @@ describe('integrationPackCheck', () => {
|
|
|
504
504
|
message:
|
|
505
505
|
'Theme "ocean" exports @acme/widgets/theme.css without a complete built module and stylesheet pair. Missing partner exports alone do not block packing; add the matching export when the theme should be importable. Every declared export must resolve. Staleness is a warning until the complete importable pair is declared.',
|
|
506
506
|
},
|
|
507
|
+
// A 0.6.5-built stylesheet still carries the root data-color defaults
|
|
508
|
+
// that theme output no longer emits, so it no longer matches its source.
|
|
509
|
+
{
|
|
510
|
+
code: 'theme_stylesheet_stale',
|
|
511
|
+
severity: 'warning',
|
|
512
|
+
message:
|
|
513
|
+
'Theme "ocean" stylesheet does not match themes/ocean/oceanTheme.ts. This incomplete export remains packable, but run `astryx theme build themes/ocean/oceanTheme.ts` before adding its matching export.',
|
|
514
|
+
},
|
|
507
515
|
]);
|
|
508
516
|
const cli = runCliVerify();
|
|
509
517
|
expect(cli.status, cli.stderr).toBe(0);
|
|
@@ -62,6 +62,10 @@ export type ValidateResult = {
|
|
|
62
62
|
* Absolute path to the loaded manifest.
|
|
63
63
|
*/
|
|
64
64
|
manifestFile?: string | undefined;
|
|
65
|
+
/**
|
|
66
|
+
* Why nothing was validated (internal).
|
|
67
|
+
*/
|
|
68
|
+
reason?: "no_package_json" | undefined;
|
|
65
69
|
issues: Issue[];
|
|
66
70
|
integration?: import("../../foundation/integrations/integrations.mjs").LoadedIntegration | undefined;
|
|
67
71
|
};
|