@astryxdesign/cli 0.7.2-canary.081ccea → 0.7.2-canary.085e145
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 +104 -84
- package/api/build/_adapter.d.mts +8 -0
- package/api/build/_adapter.mjs +12 -1
- package/api/build/build.doc.mjs +4 -0
- package/api/build/kit/kit.mjs +3 -11
- package/api/component/_adapter.mjs +3 -11
- package/api/component/component.doc.mjs +6 -1
- package/api/discover/_adapter.d.mts +13 -0
- package/api/discover/_adapter.mjs +39 -17
- package/api/discover/discover.doc.mjs +3 -2
- package/api/discover/discover.mjs +22 -8
- package/api/discover/discover.type.d.mts +5 -3
- package/api/discover/discover.type.mjs +5 -3
- package/api/docs/_adapter.mjs +3 -2
- package/api/docs/docs.doc.mjs +2 -1
- package/api/docs/docs.mjs +2 -1
- package/api/docs/docs.test.mjs +5 -2
- package/api/docs/reference-blocks.test.mjs +1 -3
- package/api/doctor/_adapter.d.mts +108 -0
- package/api/doctor/_adapter.mjs +223 -4
- package/api/doctor/doctor.d.mts +199 -0
- package/api/doctor/doctor.doc.mjs +3 -2
- package/api/doctor/doctor.mjs +503 -31
- package/api/doctor/doctor.test.mjs +137 -14
- package/api/doctor/release-checks.test.mjs +156 -0
- package/api/doctor/theme-checks.mjs +16 -3
- package/api/doctor/theme-checks.test.mjs +87 -7
- package/api/error.d.mts +10 -0
- package/api/error.mjs +25 -0
- package/api/hook/_adapter.mjs +3 -11
- package/api/hook/hook.doc.mjs +4 -0
- package/api/hook/list/list.d.mts +1 -1
- package/api/init/_adapter.d.mts +22 -0
- package/api/init/_adapter.mjs +59 -0
- package/api/init/init.d.mts +7 -5
- package/api/init/init.doc.mjs +28 -7
- package/api/init/init.mjs +28 -4
- package/api/init/init.type.d.mts +48 -3
- package/api/init/init.type.mjs +37 -3
- package/api/init/run/run.d.mts +1 -1
- package/api/init/run/run.mjs +15 -4
- package/api/init/user/user.d.mts +14 -0
- package/api/init/user/user.mjs +87 -0
- package/api/init/user/user.test.mjs +232 -0
- package/api/integration/authoring-checks.mjs +2 -2
- package/api/integration/integrationCheck.doc.mjs +1 -1
- package/api/integration/pack-check.mjs +10 -9
- package/api/integration/pack-check.test.mjs +9 -15
- package/api/integration/validate-integration.d.mts +8 -0
- package/api/integration/validate-integration.mjs +27 -6
- package/api/integration/validate-integration.type.d.mts +8 -0
- package/api/integration/validate-integration.type.mjs +3 -1
- package/api/integration/validate-unread-theme-folders.test.mjs +3 -2
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/search/_adapter.d.mts +11 -0
- package/api/search/_adapter.mjs +25 -0
- package/api/search/search.d.mts +1 -1
- package/api/search/search.doc.mjs +8 -3
- package/api/search/search.mjs +38 -14
- package/api/search/search.test.mjs +4 -1
- package/api/search/search.type.d.mts +14 -1
- package/api/search/search.type.mjs +6 -1
- package/api/swizzle/_adapter.mjs +2 -2
- package/api/swizzle/copy/copy.mjs +1 -1
- package/api/template/template-integration.test.mjs +1 -1
- package/api/theme/_adapter.d.mts +16 -0
- package/api/theme/_adapter.mjs +32 -5
- package/api/theme/build/build.d.mts +2 -1
- package/api/theme/build/build.mjs +70 -14
- package/api/theme/build/build.packed-old-core.test.mjs +20 -3
- package/api/theme/build/font-warning.mjs +5 -3
- package/api/theme/build/font-warning.test.mjs +2 -1
- package/api/theme/remove/remove.test.mjs +2 -2
- package/api/theme/targets/targets.mjs +3 -10
- package/api/theme/themeTargets.doc.mjs +4 -0
- package/api/theme/use/use.test.mjs +1 -1
- package/api/upgrade/_adapter.mjs +1 -1
- package/api/upgrade/run/run.mjs +5 -1
- package/api/upgrade/upgrade.doc.mjs +2 -1
- package/api/upgrade/upgrade.mjs +5 -1
- package/assets/docs/getting-started.doc.mjs +23 -3
- package/assets/docs/tree/add-a-component.doc.mjs +11 -1
- package/assets/docs/tree/add-a-theme.doc.mjs +12 -2
- package/assets/docs/tree/add-a-topic.doc.mjs +43 -1
- package/assets/docs/tree/agent-guidance.doc.mjs +18 -4
- package/assets/docs/tree/building-blocks.doc.mjs +4 -0
- package/assets/docs/tree/check-the-props.doc.mjs +1 -1
- package/assets/docs/tree/check-your-docs.doc.mjs +5 -5
- package/assets/docs/tree/checks.doc.mjs +9 -9
- package/assets/docs/tree/ci-and-containers.doc.mjs +88 -0
- package/assets/docs/tree/cli-command.doc.mjs +142 -0
- package/assets/docs/tree/cli.doc.mjs +6 -0
- package/assets/docs/tree/codemods.doc.mjs +13 -3
- package/assets/docs/tree/commands.doc.mjs +7 -1
- package/assets/docs/tree/component-imports.doc.mjs +11 -1
- package/assets/docs/tree/components.doc.mjs +6 -0
- package/assets/docs/tree/computer-agent-guide.doc.mjs +160 -0
- package/assets/docs/tree/computer-integrations.doc.mjs +93 -0
- package/assets/docs/tree/configuration.doc.mjs +7 -3
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +11 -1
- package/assets/docs/tree/define-the-theme.doc.mjs +1 -1
- package/assets/docs/tree/describe-the-component.doc.mjs +1 -1
- package/assets/docs/tree/docs.doc.mjs +6 -0
- package/assets/docs/tree/extend-or-replace.doc.mjs +13 -3
- package/assets/docs/tree/generate-a-palette.doc.mjs +2 -2
- package/assets/docs/tree/global-integrations.doc.mjs +124 -0
- package/assets/docs/tree/global.doc.mjs +131 -0
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +4 -4
- package/assets/docs/tree/install-once.doc.mjs +105 -0
- package/assets/docs/tree/integrations.doc.mjs +5 -1
- package/assets/docs/tree/layout.doc.mjs +1 -1
- package/assets/docs/tree/links.doc.mjs +1 -1
- package/assets/docs/tree/monorepos.doc.mjs +84 -0
- package/assets/docs/tree/problems.doc.mjs +205 -0
- package/assets/docs/tree/project-global-or-both.doc.mjs +131 -0
- package/assets/docs/tree/publishing.doc.mjs +2 -2
- package/assets/docs/tree/quick-start.doc.mjs +15 -5
- package/assets/docs/tree/reference.doc.mjs +192 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +11 -1
- package/assets/docs/tree/replace-a-core-template.doc.mjs +4 -4
- package/assets/docs/tree/scaffold.doc.mjs +1 -1
- package/assets/docs/tree/sections-and-placement.doc.mjs +3 -3
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +13 -3
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/single-component.doc.mjs +3 -3
- package/assets/docs/tree/start-a-template.doc.mjs +15 -5
- package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
- package/assets/docs/tree/templates.doc.mjs +6 -0
- package/assets/docs/tree/test-in-an-app.doc.mjs +4 -4
- package/assets/docs/tree/test-template-in-app.doc.mjs +4 -4
- package/assets/docs/tree/themes.doc.mjs +4 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +15 -7
- package/assets/docs/tree/uninstall.doc.mjs +109 -0
- package/assets/docs/tree/updates.doc.mjs +92 -0
- package/assets/docs/tree/upgrading.doc.mjs +2 -2
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +11 -1
- package/assets/docs/tree/verify-packed-template.doc.mjs +2 -2
- package/assets/docs/tree/versioning.doc.mjs +3 -3
- package/assets/docs/tree/who-answers.doc.mjs +119 -0
- package/assets/docs/tree/write-the-template-file.doc.mjs +3 -3
- package/assets/docs/working-with-ai.doc.mjs +23 -9
- package/authoring/debug/parse.d.mts +5 -5
- package/authoring/discover/discover.doc.mjs +6 -0
- package/authoring/doctypes/_schema.d.mts +8 -3
- package/authoring/doctypes/_schema.mjs +1 -0
- package/authoring/doctypes/command/command.doc.mjs +6 -0
- package/authoring/doctypes/command/type.ts +14 -0
- package/authoring/doctypes/reference/reference.doc.mjs +1 -1
- package/authoring/index.d.ts +1 -0
- package/authoring/integration/integration.doc.mjs +18 -2
- package/authoring/integration/parse.test.mjs +11 -0
- package/authoring/integration/schema.d.mts +14 -3
- package/authoring/integration/schema.mjs +33 -2
- package/authoring/integration/type.ts +8 -0
- package/clients/cli/bin/astryx.mjs +20 -3
- package/clients/cli/cli-command.test.mjs +166 -0
- package/clients/cli/commands/blog.doc.mjs +1 -0
- package/clients/cli/commands/build-theme.batch-report.test.mjs +14 -2
- package/clients/cli/commands/build-theme.font-warning.test.mjs +3 -3
- package/clients/cli/commands/build-theme.mjs +25 -12
- package/clients/cli/commands/build.doc.mjs +1 -0
- package/clients/cli/commands/build.exit-codes-doc.test.mjs +4 -0
- package/clients/cli/commands/component.doc.mjs +1 -0
- package/clients/cli/commands/discover.broken-integration.test.mjs +7 -6
- package/clients/cli/commands/discover.doc.mjs +8 -0
- package/clients/cli/commands/discover.no-source.test.mjs +1 -0
- package/clients/cli/commands/docs.doc.mjs +1 -0
- package/clients/cli/commands/docs.mjs +49 -19
- package/clients/cli/commands/docs.test.mjs +2 -2
- package/clients/cli/commands/doctor-integration-components.doc.mjs +1 -0
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +1 -0
- package/clients/cli/commands/doctor-integration-templates.doc.mjs +1 -0
- package/clients/cli/commands/doctor-integration-validate.doc.mjs +10 -1
- package/clients/cli/commands/doctor-integration.test.mjs +4 -3
- package/clients/cli/commands/doctor.doc.mjs +12 -2
- package/clients/cli/commands/doctor.mjs +12 -3
- package/clients/cli/commands/doctor.test.mjs +10 -4
- package/clients/cli/commands/gap-report.doc.mjs +1 -0
- package/clients/cli/commands/hook.doc.mjs +1 -0
- package/clients/cli/commands/init.behavior.test.mjs +5 -0
- package/clients/cli/commands/init.doc.mjs +29 -3
- package/clients/cli/commands/integration-add.doc.mjs +7 -0
- package/clients/cli/commands/integration-authoring.test.mjs +3 -3
- package/clients/cli/commands/integration-check.doc.mjs +10 -2
- package/clients/cli/commands/integration-check.test.mjs +31 -1
- package/clients/cli/commands/integration-pack.doc.mjs +8 -1
- package/clients/cli/commands/integration-verify.doc.mjs +8 -1
- package/clients/cli/commands/integration.mjs +3 -2
- package/clients/cli/commands/json-contract.test.mjs +6 -1
- package/clients/cli/commands/manifest.doc.mjs +1 -0
- package/clients/cli/commands/outside-project.test.mjs +774 -0
- package/clients/cli/commands/search.doc.mjs +1 -0
- package/clients/cli/commands/search.mjs +16 -11
- package/clients/cli/commands/search.test.mjs +429 -296
- package/clients/cli/commands/setup-nudge.test.mjs +26 -4
- package/clients/cli/commands/swizzle.doc.mjs +7 -0
- package/clients/cli/commands/swizzle.routing.test.mjs +1 -1
- package/clients/cli/commands/template.doc.mjs +1 -0
- package/clients/cli/commands/theme-add-lifecycle.test.mjs +3 -3
- package/clients/cli/commands/theme-add.doc.mjs +8 -1
- package/clients/cli/commands/theme-build.doc.mjs +1 -0
- package/clients/cli/commands/theme-eject.doc.mjs +1 -0
- package/clients/cli/commands/theme-list.behavior.test.mjs +6 -0
- package/clients/cli/commands/theme-list.doc.mjs +1 -0
- package/clients/cli/commands/theme-palette-generate.doc.mjs +1 -0
- package/clients/cli/commands/theme-remove.doc.mjs +7 -0
- package/clients/cli/commands/theme-targets.doc.mjs +1 -0
- package/clients/cli/commands/theme-template.doc.mjs +1 -0
- package/clients/cli/commands/theme-use.doc.mjs +7 -0
- package/clients/cli/commands/upgrade.config-ordering.test.mjs +2 -1
- package/clients/cli/commands/upgrade.doc.mjs +8 -1
- package/clients/cli/commands/upgrade.file-protection.test.mjs +3 -2
- package/clients/cli/commands/upgrade.hook-output.test.mjs +2 -1
- package/clients/cli/index.mjs +84 -13
- package/clients/cli/lib/cli-error.mjs +4 -1
- package/clients/cli/lib/component-format.test.mjs +1 -1
- package/clients/cli/lib/define-command.mjs +2 -2
- package/clients/cli/lib/json-shim.mjs +3 -1
- package/clients/cli/lib/manifest.d.ts +9 -0
- package/clients/cli/lib/manifest.mjs +17 -1
- package/clients/cli/lib/manifest.test.mjs +25 -0
- package/foundation/agent-docs/agent-doc-state.d.mts +21 -6
- package/foundation/agent-docs/agent-doc-state.mjs +29 -7
- package/foundation/agent-docs/agent-docs.d.mts +2 -2
- package/foundation/agent-docs/agent-docs.mjs +3 -3
- package/foundation/agent-docs/computer-agent-text.d.mts +133 -0
- package/foundation/agent-docs/computer-agent-text.mjs +623 -0
- package/foundation/agent-docs/computer-agent-text.test.mjs +602 -0
- package/foundation/config/project.d.mts +35 -3
- package/foundation/config/project.mjs +145 -8
- package/foundation/config/project.test.mjs +66 -0
- package/foundation/config/theme-state.mjs +5 -4
- package/foundation/discovery/cli-self-docs.mjs +20 -3
- package/foundation/discovery/cli-self-docs.test.mjs +3 -2
- package/foundation/discovery/component-replacement.mjs +2 -1
- package/foundation/discovery/runner-allowlist.d.mts +40 -0
- package/foundation/discovery/runner-allowlist.mjs +53 -0
- package/foundation/discovery/template-needs.mjs +5 -2
- package/foundation/discovery/theme-imports.mjs +8 -4
- package/foundation/discovery/theme-imports.test.mjs +1 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +20 -0
- package/foundation/doc-compiler/inputs.mjs +4 -1
- package/foundation/doc-compiler/read.d.mts +1 -1
- package/foundation/doc-compiler/tree.test.mjs +1 -1
- package/foundation/env/cli-command.d.mts +83 -0
- package/foundation/env/cli-command.mjs +152 -0
- package/foundation/env/cli-command.test.mjs +129 -0
- package/foundation/env/node-version.test.mjs +15 -3
- package/foundation/env/package-manager.d.mts +61 -9
- package/foundation/env/package-manager.global.test.mjs +66 -0
- package/foundation/env/package-manager.mjs +137 -13
- package/foundation/env/package-manager.test.mjs +148 -9
- package/foundation/env/project-scope.d.mts +9 -0
- package/foundation/env/project-scope.mjs +33 -0
- package/foundation/env/search-path.d.mts +42 -0
- package/foundation/env/search-path.mjs +205 -0
- package/foundation/env/search-path.test.mjs +122 -0
- package/foundation/env/user-dirs.d.mts +39 -0
- package/foundation/env/user-dirs.mjs +93 -0
- package/foundation/env/user-dirs.test.mjs +72 -0
- package/foundation/env/user-settings.d.mts +46 -0
- package/foundation/env/user-settings.mjs +106 -0
- package/foundation/env/user-settings.test.mjs +64 -0
- package/foundation/fs/file-protection.mjs +15 -1
- package/foundation/fs/module-loader.stdout.test.mjs +3 -2
- package/foundation/fs/path-compare.d.mts +33 -0
- package/foundation/fs/path-compare.mjs +73 -0
- package/foundation/fs/paths.d.mts +57 -1
- package/foundation/fs/paths.mjs +131 -3
- package/foundation/fs/paths.test.mjs +10 -1
- package/foundation/integrations/computer-integrations.d.mts +78 -0
- package/foundation/integrations/computer-integrations.mjs +316 -0
- package/foundation/integrations/computer-integrations.test.mjs +292 -0
- package/foundation/integrations/integration-warnings.mjs +3 -2
- package/foundation/integrations/integration-warnings.test.mjs +8 -9
- package/foundation/integrations/integrations.d.mts +25 -1
- package/foundation/integrations/integrations.mjs +46 -3
- package/foundation/integrations/validate-contributions.d.mts +2 -0
- package/foundation/integrations/validate-contributions.mjs +11 -0
- package/foundation/release/agent-text-worker.d.mts +4 -0
- package/foundation/release/agent-text-worker.mjs +52 -0
- package/foundation/release/cache.d.mts +310 -0
- package/foundation/release/cache.mjs +1216 -0
- package/foundation/release/cache.test.mjs +920 -0
- package/foundation/release/choose.d.mts +207 -0
- package/foundation/release/choose.mjs +677 -0
- package/foundation/release/choose.test.mjs +427 -0
- package/foundation/release/core-worker.d.mts +4 -0
- package/foundation/release/core-worker.mjs +38 -0
- package/foundation/release/global-state.d.mts +259 -0
- package/foundation/release/global-state.mjs +472 -0
- package/foundation/release/global-state.test.mjs +381 -0
- package/foundation/release/handoff.d.mts +60 -0
- package/foundation/release/handoff.e2e.test.mjs +278 -0
- package/foundation/release/handoff.mjs +357 -0
- package/foundation/release/lock-lease.d.mts +23 -0
- package/foundation/release/lock-lease.mjs +80 -0
- package/foundation/release/notices.d.mts +253 -0
- package/foundation/release/notices.mjs +596 -0
- package/foundation/release/notices.test.mjs +565 -0
- package/foundation/release/npm-guard.d.mts +4 -0
- package/foundation/release/npm-guard.mjs +126 -0
- package/foundation/release/project.d.mts +141 -0
- package/foundation/release/project.mjs +466 -0
- package/foundation/release/project.test.mjs +288 -0
- package/foundation/release/refresh-worker.d.mts +4 -0
- package/foundation/release/refresh-worker.mjs +27 -0
- package/foundation/release/run-context.d.mts +47 -0
- package/foundation/release/run-context.mjs +149 -0
- package/foundation/release/update-notice-env.d.mts +28 -0
- package/foundation/release/update-notice-env.mjs +39 -0
- package/foundation/response/base.d.ts +26 -3
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.doc.mjs +12 -0
- package/foundation/response/error-codes.mjs +17 -0
- package/foundation/response/error-codes.test.mjs +2 -0
- package/foundation/response/json-contract.test.mjs +7 -2
- package/foundation/response/json.mjs +4 -1
- package/foundation/response/response-types.doc.mjs +8 -3
- package/foundation/response/response-types.doc.test.mjs +46 -0
- package/foundation/response/response.doc.mjs +3 -3
- package/foundation/xle/browser-imports.test.mjs +74 -0
- package/package.json +9 -9
- package/scripts/postinstall.mjs +21 -2
package/README.md
CHANGED
|
@@ -13,7 +13,19 @@ npx @astryxdesign/cli docs migration
|
|
|
13
13
|
npx @astryxdesign/cli template --list
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Once it's a project dependency (`npm install -D @astryxdesign/cli`),
|
|
16
|
+
Once it's a project dependency (`npm install -D @astryxdesign/cli`), the same scoped commands run the version you installed, or use your package manager's runner with the shorter name, such as `pnpm exec astryx component Button`. Never run the unscoped name through npx before the CLI is installed: `astryx` alone resolves to an unrelated npm package.
|
|
17
|
+
|
|
18
|
+
## Install it once for your computer
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm i -g @astryxdesign/cli
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Then `astryx` works in any folder, for you and for every coding agent on your computer. In a project, Astryx runs the project's own version, so a global install never changes what a project gets; outside a project, your global version answers. It tells you when a newer version is out, and never upgrades itself or a project.
|
|
25
|
+
|
|
26
|
+
- Project install, global install, or both (recommended)? `astryx docs global/project-global-or-both` compares them.
|
|
27
|
+
- How it works, and what it prints: `astryx docs global`.
|
|
28
|
+
- Something looks wrong: `astryx docs global/problems`. Uninstall: `astryx docs global/uninstall`.
|
|
17
29
|
|
|
18
30
|
## Reading the CLI's own docs
|
|
19
31
|
|
|
@@ -65,7 +77,7 @@ Results for "button" (20 of 239):
|
|
|
65
77
|
→ astryx template BannerCollapsibleContent
|
|
66
78
|
```
|
|
67
79
|
|
|
68
|
-
(The CLI prints the follow-up commands
|
|
80
|
+
(The CLI prints the follow-up commands so they reach the release that answered — the project's runner, such as `pnpm exec astryx …`, when the project's own CLI answered, `astryx …` outside a project for the copy installed for your computer, or the package pinned to the answering release, such as `npx @astryxdesign/cli@0.7.2 …`, otherwise — or with the command an installed integration sets as its `cliCommand`.)
|
|
69
81
|
|
|
70
82
|
Options:
|
|
71
83
|
|
|
@@ -76,25 +88,27 @@ Options:
|
|
|
76
88
|
|
|
77
89
|
## Commands
|
|
78
90
|
|
|
91
|
+
Each command declares what it does in a folder outside any project, and `astryx manifest --json` publishes it as `outsideProject`: `same` gives the answer a new project on this release would get, `refuse` writes nothing and fails with `ERR_PROJECT_REQUIRED` (or the code its earlier releases used), and `own` does something else that its docs (`astryx docs cli/commands/<name>`) describe.
|
|
92
|
+
|
|
79
93
|
<!-- BEGIN GENERATED: commands -->
|
|
80
94
|
|
|
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 |
|
|
95
|
+
| Command | Description | Outside a project |
|
|
96
|
+
| ------------- | ----------------------------------------------------------------------------- | ----------------- |
|
|
97
|
+
| `blog` | Read the Astryx blog from the published feed | `same` |
|
|
98
|
+
| `build` | Build a page: the template to start from, or the workflow playbook (no query) | `same` |
|
|
99
|
+
| `component` | List components or print component docs | `same` |
|
|
100
|
+
| `discover` | Browse and search integrations: the ones you have and the ones you could add | `same` |
|
|
101
|
+
| `docs` | Print reference docs | `same` |
|
|
102
|
+
| `doctor` | Diagnose Astryx projects and integration packages | `own` |
|
|
103
|
+
| `gap-report` | Report a missing component or feature to the package that owns it | `same` |
|
|
104
|
+
| `hook` | List hooks or print hook docs | `same` |
|
|
105
|
+
| `init` | Initialize the design system in your project | `own` |
|
|
106
|
+
| `integration` | Author and verify an Astryx integration package | by subcommand |
|
|
107
|
+
| `search` | Search components, hooks, docs, templates, and themes in one ranked list | `same` |
|
|
108
|
+
| `swizzle` | Copy component source for customization | `refuse` |
|
|
109
|
+
| `template` | List, show, or scaffold page and block templates | `same` |
|
|
110
|
+
| `theme` | Add, switch, build, and author themes | by subcommand |
|
|
111
|
+
| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components | `own` |
|
|
98
112
|
|
|
99
113
|
<!-- END GENERATED: commands -->
|
|
100
114
|
<!-- Generated by scripts/generate-cli-readme.mjs from `astryx manifest`. Run `pnpm -F @astryxdesign/cli readme`. -->
|
|
@@ -114,9 +128,11 @@ Options:
|
|
|
114
128
|
Every command supports `--json` for machine-readable output. Responses are typed envelopes:
|
|
115
129
|
|
|
116
130
|
```json
|
|
117
|
-
{"apiVersion": 1, "type": "component.detail", "data": {"name": "Button", ...}}
|
|
131
|
+
{"apiVersion": 1, "type": "component.detail", "data": {"name": "Button", ...}, "meta": {"answeredBy": {"cli": "0.7.2", "core": "0.7.2", "copy": "project"}}}
|
|
118
132
|
```
|
|
119
133
|
|
|
134
|
+
Every successful envelope carries `meta.answeredBy`: the CLI version that answered, the Core version it paired with (`null` when there is none), and which copy answered (`project`, `starting`, `matched`, `carried`, or `fallback`).
|
|
135
|
+
|
|
120
136
|
Errors:
|
|
121
137
|
|
|
122
138
|
```json
|
|
@@ -159,60 +175,62 @@ if (isError(result)) {
|
|
|
159
175
|
|
|
160
176
|
<!-- BEGIN GENERATED: error-codes -->
|
|
161
177
|
|
|
162
|
-
| Code | Meaning
|
|
163
|
-
| --------------------------------- |
|
|
164
|
-
| `ERR_UNKNOWN` | Fallback for any error without a more specific code.
|
|
165
|
-
| `ERR_UNKNOWN_COMMAND` | A top-level command name was not recognized (e.g. `astryx bogus`).
|
|
166
|
-
| `ERR_UNKNOWN_SUBCOMMAND` | A subcommand under a command group was not recognized (e.g. `astryx theme bogus`).
|
|
167
|
-
| `ERR_INVALID_OPTION` | An unknown option was passed, --json was given to a command without JSON output.
|
|
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.
|
|
169
|
-
| `ERR_MISSING_ARGUMENT` | A required argument or option value was omitted.
|
|
170
|
-
| `ERR_INVALID_LANG` | `--lang` was given a value outside its choices (en, zh, dense).
|
|
171
|
-
| `ERR_INVALID_DETAIL` | `--detail` was given a value outside its choices (full, compact, brief).
|
|
172
|
-
| `ERR_NODE_VERSION` | The running Node.js version is below the supported minimum.
|
|
173
|
-
| `ERR_CORE_NOT_FOUND` | `@astryxdesign/core` could not be located (not installed / not in a monorepo).
|
|
174
|
-
| `ERR_CORE_INCOMPATIBLE` | The installed `@astryxdesign/core` loaded but is too old for this input — it lacks a capability the CLI must call to emit correct output (upgrade core).
|
|
175
|
-
| `ERR_UNKNOWN_COMPONENT` | No component matched the requested name.
|
|
176
|
-
| `ERR_UNKNOWN_HOOK` | No hook matched the requested name.
|
|
177
|
-
| `ERR_UNKNOWN_TOPIC` | No docs topic matched the requested name.
|
|
178
|
-
| `ERR_UNKNOWN_SECTION` | A docs topic exists but the requested section within it does not.
|
|
179
|
-
| `ERR_UNKNOWN_CATEGORY` | A `--category` filter value did not match any known category.
|
|
180
|
-
| `ERR_UNKNOWN_TEMPLATE` | No template matched the requested name.
|
|
181
|
-
| `ERR_AMBIGUOUS_TEMPLATE` | A template id matched more than one template (narrow with --type/--package).
|
|
182
|
-
| `ERR_AMBIGUOUS_COMPONENT` | A component name is owned by more than one package (narrow with --package).
|
|
183
|
-
| `ERR_AMBIGUOUS_THEME` | A theme slug is owned by more than one package (narrow with --package).
|
|
184
|
-
| `ERR_UNKNOWN_THEME` | No theme matched the requested slug (theme add).
|
|
185
|
-
| `ERR_INTEGRATION_ROOT_CONFLICT` | An integration manifest already declares a different path for the requested contribution root.
|
|
186
|
-
| `ERR_INTEGRATION_EXPORT_CONFLICT` | A package export already maps a generated contribution subpath to a different target.
|
|
187
|
-
| `ERR_UNKNOWN_PACKAGE` | No package matched the requested name.
|
|
188
|
-
| `ERR_UNKNOWN_AGENT` | An unrecognized `--agent` value was passed to init.
|
|
189
|
-
| `ERR_UNKNOWN_FEATURE` | An unrecognized `--features` value was passed to init.
|
|
190
|
-
| `ERR_UNKNOWN_CODEMOD` | A `--codemod` value did not match any registered codemod (upgrade).
|
|
191
|
-
| `ERR_CODEMOD_FAILED` | One or more codemods failed during an upgrade run.
|
|
192
|
-
| `ERR_CODEMOD_PROTECTED` | A required codemod change remains blocked by a protected consumer file.
|
|
193
|
-
| `ERR_CODEMOD_PROTECTION_SOURCE` | A working-tree protection declaration could not be read or parsed.
|
|
194
|
-
| `ERR_NOT_FOUND` | A generic discover/lookup query matched nothing in any package.
|
|
195
|
-
| `ERR_NO_DOC` | A component exists but has no typed `.doc.mjs` file.
|
|
196
|
-
| `ERR_NO_SHOWCASE` | No showcase exists for the requested component.
|
|
197
|
-
| `ERR_NO_SOURCE` | No source file could be located for the requested component/template.
|
|
198
|
-
| `ERR_INVALID_DOC` | A component's docs failed validation (malformed `.doc.mjs`).
|
|
199
|
-
| `ERR_FILE_NOT_FOUND` | A required input file did not exist.
|
|
200
|
-
| `ERR_FILE_EXISTS` | Refused to overwrite an existing file.
|
|
201
|
-
| `ERR_PATH_TRAVERSAL` | A path escaped its allowed root, or a name contained traversal markers.
|
|
202
|
-
| `ERR_WRITE_FAILED` | Writing output files failed (and was rolled back).
|
|
203
|
-
| `ERR_THEME_INVALID` | A theme definition or contributed theme descriptor is invalid.
|
|
204
|
-
| `ERR_THEME_LOAD` | A theme file could not be loaded / parsed into a defineTheme result.
|
|
205
|
-
| `ERR_PALETTE_GENERATION` | A palette generation request or one of its constraints was invalid.
|
|
206
|
-
| `ERR_VERSION_DETECT` | The current `@astryxdesign/core` version could not be detected.
|
|
207
|
-
| `ERR_INVALID_VERSION` | A `--from`/`--to` value was not a valid semver string.
|
|
208
|
-
| `ERR_DEP_MISSING` | A required external dependency (e.g. jscodeshift) is missing.
|
|
209
|
-
| `ERR_GH_CLI` | GitHub CLI (`gh`) is not installed or not authenticated.
|
|
210
|
-
| `ERR_UNKNOWN_POST` | No blog post matched the requested slug in the feed.
|
|
211
|
-
| `ERR_FETCH_FAILED` | A network fetch (RSS feed or post text) failed.
|
|
212
|
-
| `ERR_LAYOUT_PARSE` | A layout expression failed to parse (syntax error, with line/col).
|
|
213
|
-
| `ERR_LAYOUT_INVALID` | A layout expression parsed but failed validation (unknown component/prop/enum/block).
|
|
214
|
-
| `ERR_UNCLASSIFIED_EXIT` | Recorded in the debug log, never printed: a command exited non-zero without reporting an error code.
|
|
215
|
-
| `ERR_SIGNAL_TERMINATED` | Recorded in the debug log, never printed: the process was ended by a signal (Ctrl-C, SIGTERM) before the command reached a terminal path.
|
|
178
|
+
| Code | Meaning |
|
|
179
|
+
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
180
|
+
| `ERR_UNKNOWN` | Fallback for any error without a more specific code. |
|
|
181
|
+
| `ERR_UNKNOWN_COMMAND` | A top-level command name was not recognized (e.g. `astryx bogus`). |
|
|
182
|
+
| `ERR_UNKNOWN_SUBCOMMAND` | A subcommand under a command group was not recognized (e.g. `astryx theme bogus`). |
|
|
183
|
+
| `ERR_INVALID_OPTION` | An unknown option was passed, --json was given to a command without JSON output. |
|
|
184
|
+
| `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. |
|
|
185
|
+
| `ERR_MISSING_ARGUMENT` | A required argument or option value was omitted. |
|
|
186
|
+
| `ERR_INVALID_LANG` | `--lang` was given a value outside its choices (en, zh, dense). |
|
|
187
|
+
| `ERR_INVALID_DETAIL` | `--detail` was given a value outside its choices (full, compact, brief). |
|
|
188
|
+
| `ERR_NODE_VERSION` | The running Node.js version is below the supported minimum. |
|
|
189
|
+
| `ERR_CORE_NOT_FOUND` | `@astryxdesign/core` could not be located (not installed / not in a monorepo). |
|
|
190
|
+
| `ERR_CORE_INCOMPATIBLE` | The installed `@astryxdesign/core` loaded but is too old for this input — it lacks a capability the CLI must call to emit correct output (upgrade core). |
|
|
191
|
+
| `ERR_UNKNOWN_COMPONENT` | No component matched the requested name. |
|
|
192
|
+
| `ERR_UNKNOWN_HOOK` | No hook matched the requested name. |
|
|
193
|
+
| `ERR_UNKNOWN_TOPIC` | No docs topic matched the requested name. |
|
|
194
|
+
| `ERR_UNKNOWN_SECTION` | A docs topic exists but the requested section within it does not. |
|
|
195
|
+
| `ERR_UNKNOWN_CATEGORY` | A `--category` filter value did not match any known category. |
|
|
196
|
+
| `ERR_UNKNOWN_TEMPLATE` | No template matched the requested name. |
|
|
197
|
+
| `ERR_AMBIGUOUS_TEMPLATE` | A template id matched more than one template (narrow with --type/--package). |
|
|
198
|
+
| `ERR_AMBIGUOUS_COMPONENT` | A component name is owned by more than one package (narrow with --package). |
|
|
199
|
+
| `ERR_AMBIGUOUS_THEME` | A theme slug is owned by more than one package (narrow with --package). |
|
|
200
|
+
| `ERR_UNKNOWN_THEME` | No theme matched the requested slug (theme add). |
|
|
201
|
+
| `ERR_INTEGRATION_ROOT_CONFLICT` | An integration manifest already declares a different path for the requested contribution root. |
|
|
202
|
+
| `ERR_INTEGRATION_EXPORT_CONFLICT` | A package export already maps a generated contribution subpath to a different target. |
|
|
203
|
+
| `ERR_UNKNOWN_PACKAGE` | No package matched the requested name. |
|
|
204
|
+
| `ERR_UNKNOWN_AGENT` | An unrecognized `--agent` value was passed to init. |
|
|
205
|
+
| `ERR_UNKNOWN_FEATURE` | An unrecognized `--features` value was passed to init. |
|
|
206
|
+
| `ERR_UNKNOWN_CODEMOD` | A `--codemod` value did not match any registered codemod (upgrade). |
|
|
207
|
+
| `ERR_CODEMOD_FAILED` | One or more codemods failed during an upgrade run. |
|
|
208
|
+
| `ERR_CODEMOD_PROTECTED` | A required codemod change remains blocked by a protected consumer file. |
|
|
209
|
+
| `ERR_CODEMOD_PROTECTION_SOURCE` | A working-tree protection declaration could not be read or parsed. |
|
|
210
|
+
| `ERR_NOT_FOUND` | A generic discover/lookup query matched nothing in any package. |
|
|
211
|
+
| `ERR_NO_DOC` | A component exists but has no typed `.doc.mjs` file. |
|
|
212
|
+
| `ERR_NO_SHOWCASE` | No showcase exists for the requested component. |
|
|
213
|
+
| `ERR_NO_SOURCE` | No source file could be located for the requested component/template. |
|
|
214
|
+
| `ERR_INVALID_DOC` | A component's docs failed validation (malformed `.doc.mjs`). |
|
|
215
|
+
| `ERR_FILE_NOT_FOUND` | A required input file did not exist. |
|
|
216
|
+
| `ERR_FILE_EXISTS` | Refused to overwrite an existing file. |
|
|
217
|
+
| `ERR_PATH_TRAVERSAL` | A path escaped its allowed root, or a name contained traversal markers. |
|
|
218
|
+
| `ERR_WRITE_FAILED` | Writing output files failed (and was rolled back). |
|
|
219
|
+
| `ERR_THEME_INVALID` | A theme definition or contributed theme descriptor is invalid. |
|
|
220
|
+
| `ERR_THEME_LOAD` | A theme file could not be loaded / parsed into a defineTheme result. |
|
|
221
|
+
| `ERR_PALETTE_GENERATION` | A palette generation request or one of its constraints was invalid. |
|
|
222
|
+
| `ERR_VERSION_DETECT` | The current `@astryxdesign/core` version could not be detected. |
|
|
223
|
+
| `ERR_INVALID_VERSION` | A `--from`/`--to` value was not a valid semver string. |
|
|
224
|
+
| `ERR_DEP_MISSING` | A required external dependency (e.g. jscodeshift) is missing. |
|
|
225
|
+
| `ERR_GH_CLI` | GitHub CLI (`gh`) is not installed or not authenticated. |
|
|
226
|
+
| `ERR_UNKNOWN_POST` | No blog post matched the requested slug in the feed. |
|
|
227
|
+
| `ERR_FETCH_FAILED` | A network fetch (RSS feed or post text) failed. |
|
|
228
|
+
| `ERR_LAYOUT_PARSE` | A layout expression failed to parse (syntax error, with line/col). |
|
|
229
|
+
| `ERR_LAYOUT_INVALID` | A layout expression parsed but failed validation (unknown component/prop/enum/block). |
|
|
230
|
+
| `ERR_UNCLASSIFIED_EXIT` | Recorded in the debug log, never printed: a command exited non-zero without reporting an error code. |
|
|
231
|
+
| `ERR_SIGNAL_TERMINATED` | Recorded in the debug log, never printed: the process was ended by a signal (Ctrl-C, SIGTERM) before the command reached a terminal path. |
|
|
232
|
+
| `ERR_VERSIONS_UNAVAILABLE` | Nothing could answer this run, and nothing was written: the project's own CLI could not start and nothing else could answer, or the Core a command needs outside a project could not be installed. |
|
|
233
|
+
| `ERR_PROJECT_REQUIRED` | The command needs a project (an app with Astryx installed, or an integration package) and was run outside one. Nothing was written. |
|
|
216
234
|
|
|
217
235
|
<!-- END GENERATED: error-codes -->
|
|
218
236
|
<!-- Generated by scripts/generate-cli-readme.mjs from the error-codes EnumDoc (== ERROR_CODES). Run `pnpm -F @astryxdesign/cli readme`. -->
|
|
@@ -423,6 +441,7 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
423
441
|
| --------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
424
442
|
| `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
443
|
| `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. |
|
|
444
|
+
| `init.user` | The computer-level agent text receipt — returned when --user is set: `data.files`, one `{path, action, reason?}` per path acted on, the skill file first and then each link to its folder (action `written` \| `linked` \| `unchanged` \| `removed` \| `absent` \| `kept`; `reason` only on `kept`: `edited` when a person changed the text, `not-astryx` when Astryx did not write it), `data.command` (the command the text names), and `data.warnings`. |
|
|
426
445
|
| `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
446
|
| `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
447
|
| `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. |
|
|
@@ -442,7 +461,7 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
442
461
|
| `discover.detail.doc` | The validated ComponentDoc for one installed component, for an @scope/name/Component query. |
|
|
443
462
|
| `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
463
|
| `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).
|
|
464
|
+
| `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). When a search with no `type` could not obtain @astryxdesign/core, `meta.partial` is {skipped, reason}: the domains it skipped (component, hook, template) and why. |
|
|
446
465
|
| `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
466
|
| `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
467
|
| `swizzle.list` | The names of swizzlable components discoverable from cwd's @astryxdesign/core. The envelope's package is @astryxdesign/core. |
|
|
@@ -470,13 +489,13 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
470
489
|
| `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
490
|
| `upgrade.status` | A short-circuit outcome with no codemods run (up_to_date, no_codemods, or config_fixable), each carrying the agent-docs summary. no_codemods and config_fixable carry cliBehindCore ({cliVersion, command}) when the installed Core is newer than the CLI, which then has no codemods for the releases after its own version. |
|
|
472
491
|
| `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. When the installed Core is newer than the CLI, it also carries cliBehindCore ({cliVersion, command}): codemods for the releases after cliVersion did not run. |
|
|
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.
|
|
492
|
+
| `manifest` | The CLI capability manifest: name, version, apiVersion, description, globalOptions, commands (each name, description, arguments, options, json, aliases?, responseTypes?, examples?, exitCodes? as [{code, when}], outsideProject? (same, refuse, or own; absent on a group), subcommands?), jsonSupported, globalMode ({docs, summary}: what a run may do beyond its command, such as the hand-off to the project's own CLI, the daily update check, and the agent skill file, and the docs topic that explains it), and the flat responseTypes index. |
|
|
474
493
|
| `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
494
|
| `version` | The CLI version, for `astryx --version --json`: {version}. |
|
|
476
495
|
| `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
496
|
| `integration.add` | A contribution-writer receipt: kind, name, optional root {path, created}, integration-manifest path, every affected project-relative path, written, and dryRun. |
|
|
478
497
|
| `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, fix?, file?, line?}] (the issues validation finds in the source and, prefixed packed_, in the packed tree, with the fix and the place when the check knows them). |
|
|
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, fix?, file?, line?} (fix: the change that resolves it; file and line: where, relative to the package). When the manifest loads, docTypes checks each doc against its published authoring type: status (checked \| skipped), reason, typescript, docs, findings (all warnings, each naming the field and a fix), unchecked, and fixtures (test fixture docs not checked).
|
|
498
|
+
| `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, fix?, file?, line?} (fix: the change that resolves it; file and line: where, relative to the package), and notes when there are any: {code, message} information that fails nothing, such as invalid_cli_command for a malformed cliCommand. When the manifest loads, docTypes checks each doc against its published authoring type: status (checked \| skipped), reason, typescript, docs, findings (all warnings, each naming the field and a fix), unchecked, and fixtures (test fixture docs not checked). |
|
|
480
499
|
| `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
500
|
| `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. When the manifest loads and declares a components root, propDrift compares documented props with the TypeScript props: status (checked \| skipped), reason, typescript, components, typesCompared, typesSkipped, findings (all warnings; a default_mismatch carries docDefault, codeDefault, and a fix), unchecked, typesNotCompared, and propsNotChecked. |
|
|
482
501
|
| `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`). copiedPassages lists each pair of topics that repeat 10 or more words of prose word for word: topic, section, otherTopic, otherOwner (package \| core), words, passages, owner (the topic that should keep the text), text (the passage as the topic writes it), line (where the copy starts in the topic to change, or null), and message (the exact replacement); each is also a copied_passage warning in issues. fluff lists padding phrases and low-density topics: topic, kind (phrase \| density), phrase, section, file (relative to the package root), line, density, and message (what to cut or write instead); each is also a doc_fluff warning in issues. strayPointers lists each code span that is exactly `astryx docs <name>` for a doc that exists, in the prose, description or summary of a topic or the text fields of a component doc: topic (the topic or component doc), kind (topic \| component), section, field (the field outside any section, such as description or usage.bestPractices[0].description, else null), file (relative to the package root), line, pointer (the written command), link (the {@link} that replaces it), and message; each is also a stray_doc_pointer warning in issues. |
|
|
@@ -653,13 +672,14 @@ export default {
|
|
|
653
672
|
};
|
|
654
673
|
```
|
|
655
674
|
|
|
656
|
-
| Field | Type | Purpose
|
|
657
|
-
| ------------ | -------- |
|
|
658
|
-
| `components` | `string` | Directory holding the package's components and their `.doc.*` files.
|
|
659
|
-
| `templates` | `string` | Directory holding the package's page/block templates.
|
|
660
|
-
| `codemods` | `string` | Directory holding upgrade codemods run by `astryx upgrade`.
|
|
661
|
-
| `docs` | `string` | Directory of reference docs; each `{topic}.doc.*` becomes a topic the CLI serves.
|
|
662
|
-
| `issuesUrl` | `string` | Where "report an issue" links for this package's contributions point.
|
|
675
|
+
| Field | Type | Purpose |
|
|
676
|
+
| ------------ | -------- | ----------------------------------------------------------------------------------------------------------- |
|
|
677
|
+
| `components` | `string` | Directory holding the package's components and their `.doc.*` files. |
|
|
678
|
+
| `templates` | `string` | Directory holding the package's page/block templates. |
|
|
679
|
+
| `codemods` | `string` | Directory holding upgrade codemods run by `astryx upgrade`. |
|
|
680
|
+
| `docs` | `string` | Directory of reference docs; each `{topic}.doc.*` becomes a topic the CLI serves. |
|
|
681
|
+
| `issuesUrl` | `string` | Where "report an issue" links for this package's contributions point. |
|
|
682
|
+
| `cliCommand` | `string` | The command its users run the CLI with, such as `acme astryx`; every command the CLI prints starts with it. |
|
|
663
683
|
|
|
664
684
|
Every field is optional; declare only the roots the package ships. There is no
|
|
665
685
|
factory: write a plain object, and annotate it with the `AstryxIntegration` type
|
package/api/build/_adapter.d.mts
CHANGED
|
@@ -66,6 +66,14 @@ export function isWeightsFile(file: any): file is import("./kit/weights.mjs").We
|
|
|
66
66
|
* @returns {string[]} Setup notes (empty when the template needs nothing).
|
|
67
67
|
*/
|
|
68
68
|
export function templateSetupNotes(template: PageTemplate, cwd: string): string[];
|
|
69
|
+
/**
|
|
70
|
+
* The Core a build answers from: the project's, else the release's own,
|
|
71
|
+
* installed into the per-user cache first when needed (a network install
|
|
72
|
+
* and an npm subprocess; spec AST-081 FR3). Throws as requireCoreDir does.
|
|
73
|
+
* @param {string} cwd
|
|
74
|
+
* @returns {string}
|
|
75
|
+
*/
|
|
76
|
+
export function requireBuildCoreDir(cwd: string): string;
|
|
69
77
|
export { withListingCache } from "../../foundation/fs/listing-cache.mjs";
|
|
70
78
|
/**
|
|
71
79
|
* A page template the kit can recommend starting from.
|
package/api/build/_adapter.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import fs from 'node:fs';
|
|
|
20
20
|
|
|
21
21
|
import {discoverTemplates} from '../template/template.mjs';
|
|
22
22
|
import {componentKeywords} from '../search/search.mjs';
|
|
23
|
-
import {findCoreDir} from '../../foundation/fs/paths.mjs';
|
|
23
|
+
import {findCoreDir, requireCoreDir} from '../../foundation/fs/paths.mjs';
|
|
24
24
|
import {analyzeTemplateNeeds} from '../../foundation/discovery/template-needs.mjs';
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -177,3 +177,14 @@ export function templateSetupNotes(template, cwd) {
|
|
|
177
177
|
return [];
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* The Core a build answers from: the project's, else the release's own,
|
|
183
|
+
* installed into the per-user cache first when needed (a network install
|
|
184
|
+
* and an npm subprocess; spec AST-081 FR3). Throws as requireCoreDir does.
|
|
185
|
+
* @param {string} cwd
|
|
186
|
+
* @returns {string}
|
|
187
|
+
*/
|
|
188
|
+
export function requireBuildCoreDir(cwd) {
|
|
189
|
+
return requireCoreDir(cwd);
|
|
190
|
+
}
|
package/api/build/build.doc.mjs
CHANGED
|
@@ -76,6 +76,10 @@ export const doc = {
|
|
|
76
76
|
code: 'ERR_CORE_NOT_FOUND',
|
|
77
77
|
when: 'a query is given and @astryxdesign/core cannot be found from cwd',
|
|
78
78
|
},
|
|
79
|
+
{
|
|
80
|
+
code: 'ERR_VERSIONS_UNAVAILABLE',
|
|
81
|
+
when: 'a query is given outside a project, or in a project with nothing installed, and the Core of the release that answers is not beside it or cached, and cannot be installed into the per-user cache (offline, a registry without it, or an unwritable cache)',
|
|
82
|
+
},
|
|
79
83
|
],
|
|
80
84
|
examples: [
|
|
81
85
|
{label: 'Get the playbook', code: 'const r = await build();'},
|
package/api/build/kit/kit.mjs
CHANGED
|
@@ -28,11 +28,9 @@
|
|
|
28
28
|
*/
|
|
29
29
|
|
|
30
30
|
import {search, searchedComponents} from '../../search/search.mjs';
|
|
31
|
-
import {
|
|
32
|
-
import {AstryxError} from '../../error.mjs';
|
|
33
|
-
import {ERROR_CODES} from '../../../foundation/response/error-codes.mjs';
|
|
31
|
+
import {coreDirOrThrow} from '../../error.mjs';
|
|
34
32
|
import {getResultCoverage} from '../../search/coverage.mjs';
|
|
35
|
-
import {loadComponents, loadPageTemplates, loadWeights, templateSetupNotes} from '../_adapter.mjs';
|
|
33
|
+
import {loadComponents, loadPageTemplates, loadWeights, requireBuildCoreDir, templateSetupNotes} from '../_adapter.mjs';
|
|
36
34
|
import {
|
|
37
35
|
asksForNewPage,
|
|
38
36
|
ideaKind,
|
|
@@ -260,13 +258,7 @@ export async function buildKit(query, options = {}) {
|
|
|
260
258
|
const {cwd = process.cwd(), type, limit = 60} = options;
|
|
261
259
|
// A kit is built from Core's components, hooks, and templates. An open
|
|
262
260
|
// search without core covers the docs alone, so the kit asks for core here.
|
|
263
|
-
if (type !== 'doc'
|
|
264
|
-
throw new AstryxError(
|
|
265
|
-
'Could not find @astryxdesign/core package',
|
|
266
|
-
undefined,
|
|
267
|
-
ERROR_CODES.ERR_CORE_NOT_FOUND,
|
|
268
|
-
);
|
|
269
|
-
}
|
|
261
|
+
if (type !== 'doc') coreDirOrThrow(requireBuildCoreDir, cwd);
|
|
270
262
|
// search()'s JSDoc @returns widens results to object[]; the SearchResponse
|
|
271
263
|
// shape is the contract (api/search/search.type.mjs). Cast locally rather than
|
|
272
264
|
// tightening the search @returns (a separate follow-up).
|
|
@@ -22,7 +22,7 @@ import * as fs from 'node:fs';
|
|
|
22
22
|
import * as path from 'node:path';
|
|
23
23
|
import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
|
|
24
24
|
import {
|
|
25
|
-
|
|
25
|
+
requireCoreDir as requireAnswerCoreDir,
|
|
26
26
|
discoverExternalPackages,
|
|
27
27
|
} from '../../foundation/fs/paths.mjs';
|
|
28
28
|
import {
|
|
@@ -44,7 +44,7 @@ import {Project} from '../../foundation/config/project.mjs';
|
|
|
44
44
|
import {loadComponentDoc as loadValidatedComponentDoc} from '../../foundation/discovery/component-loader.mjs';
|
|
45
45
|
import {resolveComponentReplacements} from '../../foundation/discovery/component-replacement.mjs';
|
|
46
46
|
import {searchComponents} from '../../foundation/text/string-utils.mjs';
|
|
47
|
-
import {AstryxError} from '../error.mjs';
|
|
47
|
+
import {AstryxError, coreDirOrThrow} from '../error.mjs';
|
|
48
48
|
import {
|
|
49
49
|
componentLinkProvider,
|
|
50
50
|
linkComponentDoc,
|
|
@@ -121,15 +121,7 @@ export {CORE_PACKAGE, unscopedComponentOwners};
|
|
|
121
121
|
* @returns {string}
|
|
122
122
|
*/
|
|
123
123
|
export function requireCoreDir(cwd) {
|
|
124
|
-
|
|
125
|
-
if (!coreDir) {
|
|
126
|
-
throw new AstryxError(
|
|
127
|
-
'Could not find @astryxdesign/core package',
|
|
128
|
-
undefined,
|
|
129
|
-
ERROR_CODES.ERR_CORE_NOT_FOUND,
|
|
130
|
-
);
|
|
131
|
-
}
|
|
132
|
-
return coreDir;
|
|
124
|
+
return coreDirOrThrow(requireAnswerCoreDir, cwd);
|
|
133
125
|
}
|
|
134
126
|
|
|
135
127
|
/**
|
|
@@ -24,7 +24,8 @@ export const doc = {
|
|
|
24
24
|
'showcase, or example blocks. An integration component that replaces a Core ' +
|
|
25
25
|
'component (its doc sets replaces, and its package declares the CLI range that ' +
|
|
26
26
|
'turns replacement on) answers to the Core name in detail, batch, and list ' +
|
|
27
|
-
"results; use options.package '@astryxdesign/core' for the original."
|
|
27
|
+
"results; use options.package '@astryxdesign/core' for the original." +
|
|
28
|
+
" In global mode: with `cwd` outside a project, components from integrations installed next to this CLI package globally resolve too; inside a project, only the project's own integrations count. See {@link namespace:global} and {@link generic:computer-integrations}.",
|
|
28
29
|
importPath: '@astryxdesign/cli/api',
|
|
29
30
|
signature:
|
|
30
31
|
'component(name?: string | string[], options?: ComponentOptions): Promise<ComponentListResponse | ComponentBatchResponse | ComponentDetailResponse | ComponentDetailPropsResponse | ComponentDetailSourceResponse | ComponentDetailShowcaseResponse | ComponentDetailBlocksResponse>',
|
|
@@ -164,6 +165,10 @@ export const doc = {
|
|
|
164
165
|
code: 'ERR_CORE_NOT_FOUND',
|
|
165
166
|
when: '@astryxdesign/core cannot be resolved from cwd',
|
|
166
167
|
},
|
|
168
|
+
{
|
|
169
|
+
code: 'ERR_VERSIONS_UNAVAILABLE',
|
|
170
|
+
when: 'outside a project, or in a project with nothing installed, the Core of the release that answers is not beside it or cached, and cannot be installed into the per-user cache (offline, a registry without it, or an unwritable cache)',
|
|
171
|
+
},
|
|
167
172
|
{
|
|
168
173
|
code: 'ERR_UNKNOWN_CATEGORY',
|
|
169
174
|
when: 'options.category is not a string or matches no component group',
|
|
@@ -36,6 +36,19 @@ export function describeInstalled(project: Project | undefined, scanned: Scanned
|
|
|
36
36
|
* @returns {boolean}
|
|
37
37
|
*/
|
|
38
38
|
export function hasSources(project: Project | undefined): boolean;
|
|
39
|
+
/**
|
|
40
|
+
* The integrations installed for the computer that a project could add, as
|
|
41
|
+
* available entries with the project's install command (spec AST-081 FR12).
|
|
42
|
+
* Empty outside a project, where they load instead.
|
|
43
|
+
* @param {Project | undefined} project
|
|
44
|
+
* @param {Array<{name: string}>} installed
|
|
45
|
+
* @param {Set<string>} declared
|
|
46
|
+
* @param {(name: string, version?: string) => string} add
|
|
47
|
+
* @returns {Promise<import('./discover.type.mjs').DiscoverAvailableEntry[]>}
|
|
48
|
+
*/
|
|
49
|
+
export function computerAvailableEntries(project: Project | undefined, installed: Array<{
|
|
50
|
+
name: string;
|
|
51
|
+
}>, declared: Set<string>, add: (name: string, version?: string) => string): Promise<import("./discover.type.mjs").DiscoverAvailableEntry[]>;
|
|
39
52
|
/**
|
|
40
53
|
* Package names the project's package.json declares in any dependency field.
|
|
41
54
|
* @param {Project | undefined} project
|