@astryxdesign/cli 0.7.17-canary.g2fb7c5b → 0.7.17-canary.g2ff1afc
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 +5 -4
- package/api/build/_adapter.d.mts +51 -0
- package/api/build/_adapter.mjs +122 -6
- package/api/build/build.doc.mjs +1 -1
- package/api/build/build.mjs +23 -14
- package/api/build/build.type.d.mts +1 -1
- package/api/build/build.type.mjs +1 -1
- package/api/build/help/help.d.mts +15 -14
- package/api/build/help/help.mjs +62 -3
- package/api/component/detail/blocks/blocks.mjs +2 -1
- package/api/discover/_adapter.d.mts +57 -6
- package/api/discover/_adapter.mjs +270 -48
- package/api/discover/_catalog-view.d.mts +7 -0
- package/api/discover/_catalog-view.mjs +10 -1
- package/api/discover/detail/doc/doc.mjs +1 -1
- package/api/discover/discover.d.mts +24 -0
- package/api/discover/discover.mjs +146 -25
- package/api/discover/search/search.d.mts +22 -0
- package/api/discover/search/search.mjs +290 -70
- package/api/docs/_entry-names.mjs +4 -3
- package/api/doctor/_adapter.d.mts +40 -2
- package/api/doctor/_adapter.mjs +139 -17
- package/api/doctor/built-checks.d.mts +30 -3
- package/api/doctor/built-checks.mjs +132 -5
- package/api/doctor/doctor.d.mts +75 -6
- package/api/doctor/doctor.doc.mjs +2 -2
- package/api/doctor/doctor.mjs +404 -26
- package/api/doctor/doctor.type.d.mts +2 -1
- package/api/doctor/doctor.type.mjs +2 -1
- package/api/doctor/theme-checks.d.mts +19 -0
- package/api/doctor/theme-checks.mjs +56 -3
- package/api/icon/_adapter.mjs +3 -15
- package/api/icon/icon.doc.mjs +1 -1
- package/api/icon/search/search.d.mts +10 -0
- package/api/icon/search/search.mjs +19 -6
- package/api/init/_adapter.d.mts +14 -0
- package/api/init/_adapter.mjs +26 -4
- package/api/init/init.d.mts +1 -1
- package/api/init/init.doc.mjs +2 -2
- package/api/init/init.mjs +1 -1
- package/api/init/init.type.d.mts +5 -1
- package/api/init/init.type.mjs +2 -1
- package/api/init/run/run.d.mts +11 -1
- package/api/init/run/run.mjs +54 -4
- package/api/integration/_adapter.d.mts +5 -4
- package/api/integration/_adapter.mjs +7 -5
- package/api/integration/validate-integration.d.mts +1 -1
- package/api/integration/validate-integration.mjs +5 -1
- package/api/integration/validate-integration.type.d.mts +3 -1
- package/api/integration/validate-integration.type.mjs +3 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.d.mts +4 -2
- package/api/render/_adapter.mjs +53 -18
- package/api/render/render.doc.mjs +8 -5
- package/api/render/render.mjs +1 -1
- package/api/render/render.type.d.mts +2 -0
- package/api/render/render.type.mjs +2 -0
- package/api/search/ORDERING.md +1 -1
- package/api/search/_gather-docs.mjs +29 -2
- package/api/search/_gather-templates.mjs +2 -1
- package/api/search/_main-searcher.mjs +13 -0
- package/api/search/_order.d.mts +36 -1
- package/api/search/_order.mjs +141 -3
- package/api/template/list/list.mjs +2 -1
- package/api/template/show/show.mjs +2 -1
- package/api/template/skeleton/skeleton.mjs +2 -1
- package/api/template/template.doc.mjs +1 -1
- package/api/template/template.mjs +19 -1
- package/api/template/template.type.mjs +1 -1
- package/api/theme/_app-provider.d.mts +42 -0
- package/api/theme/_app-provider.mjs +61 -27
- package/api/theme/build/build.d.mts +0 -10
- package/api/theme/build/build.mjs +60 -77
- package/api/theme/build/input-fields.d.mts +9 -0
- package/api/theme/build/input-fields.mjs +155 -16
- package/api/theme/build/radius-values.d.mts +18 -0
- package/api/theme/build/radius-values.mjs +76 -0
- package/api/theme/build/typography-values.mjs +7 -23
- package/api/theme/build/written-values.d.mts +18 -0
- package/api/theme/build/written-values.mjs +107 -31
- package/api/theme/palette/generate/generator.mjs +24 -0
- package/api/theme/theme.type.d.mts +2 -1
- package/api/theme/theme.type.mjs +2 -1
- package/api/theme/themeBuild.doc.mjs +1 -1
- package/api/theme/themeEject.doc.mjs +1 -1
- package/api/theme-edit/_catalog.d.mts +40 -0
- package/api/theme-edit/_catalog.mjs +100 -22
- package/api/theme-edit/_check.mjs +213 -43
- package/api/theme-edit/_color.d.mts +14 -0
- package/api/theme-edit/_color.mjs +22 -0
- package/api/theme-edit/_compiler.mjs +52 -0
- package/api/theme-edit/_context.d.mts +20 -2
- package/api/theme-edit/_context.mjs +157 -29
- package/api/theme-edit/_edit.mjs +426 -58
- package/api/theme-edit/_how-question.d.mts +14 -0
- package/api/theme-edit/_how-question.mjs +1541 -127
- package/api/theme-edit/_how.mjs +43 -0
- package/api/theme-edit/_missed.mjs +107 -27
- package/api/theme-edit/_normal.d.mts +18 -4
- package/api/theme-edit/_normal.mjs +84 -3
- package/api/theme-edit/_palette.d.mts +9 -0
- package/api/theme-edit/_palette.mjs +158 -33
- package/api/theme-edit/_part-words.mjs +16 -3
- package/api/theme-edit/_parts.d.mts +8 -0
- package/api/theme-edit/_parts.mjs +109 -31
- package/api/theme-edit/_png.d.mts +24 -0
- package/api/theme-edit/_png.mjs +99 -0
- package/api/theme-edit/_preview-app.mjs +5 -3
- package/api/theme-edit/_preview.d.mts +44 -26
- package/api/theme-edit/_preview.mjs +255 -67
- package/api/theme-edit/_project.d.mts +4 -0
- package/api/theme-edit/_project.mjs +2 -0
- package/api/theme-edit/_settings.d.mts +116 -0
- package/api/theme-edit/_settings.mjs +1194 -58
- package/api/theme-edit/_tables.d.mts +16 -0
- package/api/theme-edit/_tables.mjs +34 -4
- package/api/theme-edit/theme-edit.type.d.mts +14 -2
- package/api/theme-edit/theme-edit.type.mjs +7 -5
- package/api/upgrade/_adapter.d.mts +5 -4
- package/api/upgrade/_adapter.mjs +7 -5
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/tree/agent-guidance.doc.mjs +2 -1
- package/assets/docs/tree/checks.doc.mjs +2 -2
- package/assets/docs/tree/host-entry.doc.mjs +4 -0
- package/assets/docs/tree/icon-definitions.doc.mjs +3 -3
- package/assets/docs/tree/icon-sets.doc.mjs +4 -4
- package/assets/docs/tree/problems.doc.mjs +2 -2
- package/assets/docs/tree/render-pages.doc.mjs +17 -3
- package/assets/docs/tree/share-a-page.doc.mjs +5 -5
- package/assets/docs/tree/short-and-findable.doc.mjs +3 -3
- package/assets/docs/tree/versioning.doc.mjs +1 -1
- package/assets/docs/working-with-ai.doc.mjs +40 -5
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/installed-icon-set.doc.mjs +30 -0
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Avatar/AvatarInteractive.tsx +6 -1
- package/assets/templates/blocks/components/LinkProvider/LinkProviderCustomLink.tsx +3 -1
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/page.tsx +6 -2
- package/assets/templates/pages/ai-chat-landing/page.tsx +1 -1
- package/assets/templates/pages/blank/page.tsx +4 -2
- package/assets/templates/pages/canvas-editor/page.tsx +3 -1
- package/assets/templates/pages/centered-hero/page.tsx +1 -1
- package/assets/templates/pages/checkout-wizard/page.tsx +1 -1
- package/assets/templates/pages/classic-gallery/page.tsx +1 -1
- package/assets/templates/pages/contact-form/page.tsx +2 -2
- package/assets/templates/pages/course-detail/page.tsx +1 -1
- package/assets/templates/pages/detail-page/page.tsx +22 -5
- package/assets/templates/pages/documentation/page.tsx +4 -2
- package/assets/templates/pages/documentation-design/page.tsx +5 -2
- package/assets/templates/pages/documentation-technical/page.tsx +4 -2
- package/assets/templates/pages/editor/page.tsx +28 -9
- package/assets/templates/pages/file-explorer/page.tsx +3 -1
- package/assets/templates/pages/form-two-column/page.tsx +1 -1
- package/assets/templates/pages/form-wizard/page.tsx +1 -1
- package/assets/templates/pages/form-wizard-dialog/page.tsx +3 -1
- package/assets/templates/pages/form-wizard-inline/page.tsx +1 -1
- package/assets/templates/pages/form-wizard-vertical/page.tsx +1 -1
- package/assets/templates/pages/gallery-hero/page.tsx +1 -1
- package/assets/templates/pages/ide/page.tsx +7 -2
- package/assets/templates/pages/kanban-board/page.tsx +10 -4
- package/assets/templates/pages/library/page.tsx +31 -61
- package/assets/templates/pages/login/page.tsx +4 -2
- package/assets/templates/pages/login-card/page.tsx +4 -2
- package/assets/templates/pages/login-split/page.tsx +3 -2
- package/assets/templates/pages/login-sso/page.tsx +4 -4
- package/assets/templates/pages/mixed-gallery/page.tsx +1 -1
- package/assets/templates/pages/payment-form/page.tsx +1 -1
- package/assets/templates/pages/product-detail/page.tsx +16 -4
- package/assets/templates/pages/product-gallery/page.tsx +1 -1
- package/assets/templates/pages/settings/page.tsx +10 -4
- package/assets/templates/pages/settings-dialog/page.tsx +5 -6
- package/assets/templates/pages/settings-sidebar/page.tsx +39 -13
- package/assets/templates/pages/side-gallery/page.tsx +1 -1
- package/assets/templates/pages/table/page.tsx +2 -2
- package/assets/templates/pages/table-filter/page.tsx +21 -6
- package/assets/templates/pages/theme-showcase/page.tsx +3 -2
- package/assets/templates/themes/butter/butterPaletteRefs.generated.ts +12 -12
- package/assets/templates/themes/butter/butterTheme.ts +197 -4
- package/assets/templates/themes/chocolate/chocolateTheme.ts +72 -8
- package/assets/templates/themes/gothic/gothicPaletteRefs.generated.ts +3 -3
- package/assets/templates/themes/gothic/gothicTheme.ts +114 -4
- package/assets/templates/themes/matcha/matchaPaletteRefs.generated.ts +8 -8
- package/assets/templates/themes/matcha/matchaTheme.ts +48 -12
- package/assets/templates/themes/neutral/neutralTheme.ts +29 -0
- package/assets/templates/themes/stone/stonePaletteRefs.generated.ts +2 -2
- package/assets/templates/themes/stone/stoneTheme.ts +69 -0
- package/assets/templates/themes/y2k/y2kPaletteRefs.generated.ts +9 -9
- package/assets/templates/themes/y2k/y2kTheme.ts +249 -14
- package/authoring/config/config.doc.mjs +1 -1
- package/authoring/config/type.ts +4 -3
- package/authoring/discover/parse.d.mts +2 -2
- package/authoring/discover/parse.mjs +52 -38
- package/authoring/discover/type.ts +2 -1
- package/authoring/doctypes/_schema.d.mts +3 -3
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +1 -1
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.mjs +12 -6
- package/clients/cli/commands/component.mjs +6 -2
- package/clients/cli/commands/discover.doc.mjs +2 -2
- package/clients/cli/commands/discover.mjs +16 -2
- package/clients/cli/commands/docs.doc.mjs +11 -9
- package/clients/cli/commands/docs.mjs +50 -21
- package/clients/cli/commands/experimental/icon.mjs +329 -276
- package/clients/cli/commands/experimental/render.mjs +16 -1
- package/clients/cli/commands/experimental/theme.mjs +42 -17
- package/clients/cli/commands/experimental-icon-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-icon-map.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-definition.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-new-set.doc.mjs +4 -1
- package/clients/cli/commands/experimental-icon-use.doc.mjs +1 -1
- package/clients/cli/commands/experimental-render.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/init.doc.mjs +36 -24
- package/clients/cli/commands/mcp.doc.mjs +53 -0
- package/clients/cli/commands/mcp.mjs +51 -0
- package/clients/cli/commands/search.mjs +46 -9
- package/clients/cli/commands/template.mjs +3 -2
- package/clients/cli/commands/theme.mjs +10 -0
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/formatters/index.mjs +15 -0
- package/clients/cli/index.mjs +14 -6
- package/clients/cli/lib/define-command.mjs +82 -4
- package/clients/cli/lib/json-shim.mjs +61 -4
- package/clients/cli/lib/manifest.mjs +9 -1
- package/clients/cli/lib/mcp-server.mjs +286 -0
- package/clients/cli/lib/mcp-tools.mjs +405 -0
- package/clients/cli/lib/other-cli-words.mjs +99 -0
- package/clients/cli/lib/stray-option.mjs +27 -1
- package/clients/cli/lib/unknown-command.mjs +326 -11
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.d.mts +12 -1
- package/foundation/agent-docs/agent-docs.mjs +32 -4
- package/foundation/config/project.d.mts +5 -4
- package/foundation/config/project.mjs +27 -12
- package/foundation/discovery/icon-imports.d.mts +66 -0
- package/foundation/discovery/icon-imports.mjs +225 -0
- package/foundation/discovery/icon-ranking.d.mts +12 -2
- package/foundation/discovery/icon-ranking.mjs +197 -10
- package/foundation/discovery/icon-set-checks.mjs +2 -1
- package/foundation/discovery/icon-set-discovery.d.mts +2 -0
- package/foundation/discovery/icon-set-discovery.mjs +3 -0
- package/foundation/discovery/icon-set-writer.d.mts +2 -11
- package/foundation/discovery/icon-set-writer.mjs +3 -29
- package/foundation/discovery/name-roots.d.mts +5 -0
- package/foundation/discovery/name-roots.mjs +11 -0
- package/foundation/discovery/runner-allowlist.d.mts +1 -0
- package/foundation/discovery/runner-allowlist.mjs +2 -0
- package/foundation/discovery/runner-commands.mjs +1 -0
- package/foundation/discovery/template-adapter.d.mts +1 -1
- package/foundation/discovery/template-destination.d.mts +14 -6
- package/foundation/discovery/template-destination.mjs +42 -8
- package/foundation/discovery/template-icons.d.mts +45 -2
- package/foundation/discovery/template-icons.mjs +16 -10
- package/foundation/discovery/template-needs.d.mts +20 -0
- package/foundation/discovery/template-needs.mjs +76 -7
- package/foundation/discovery/theme-discovery.d.mts +8 -0
- package/foundation/discovery/theme-discovery.mjs +9 -0
- package/foundation/env/project-scope.d.mts +9 -0
- package/foundation/env/project-scope.mjs +28 -2
- package/foundation/fs/gather-cache.mjs +5 -1
- package/foundation/fs/module-loader.d.mts +3 -1
- package/foundation/fs/module-loader.mjs +85 -5
- package/foundation/integrations/icon-features.d.mts +63 -0
- package/foundation/integrations/icon-features.mjs +54 -0
- package/foundation/integrations/validate-contributions.d.mts +9 -3
- package/foundation/integrations/validate-contributions.mjs +40 -13
- package/foundation/release/cache.d.mts +13 -1
- package/foundation/release/cache.mjs +94 -14
- package/foundation/render/client-bundle.d.mts +112 -0
- package/foundation/render/client-bundle.mjs +537 -0
- package/foundation/render/cut-short.d.mts +7 -1
- package/foundation/render/cut-short.mjs +46 -6
- package/foundation/render/embedded-imports.d.mts +4 -3
- package/foundation/render/embedded-imports.mjs +13 -8
- package/foundation/render/esbuild-dependency.d.mts +14 -0
- package/foundation/render/esbuild-dependency.mjs +41 -0
- package/foundation/render/file-header.mjs +5 -4
- package/foundation/render/page-worker.mjs +355 -81
- package/foundation/render/picture-chrome.mjs +54 -29
- package/foundation/render/picture-playwright.mjs +78 -42
- package/foundation/render/picture-window.d.mts +33 -0
- package/foundation/render/picture-window.mjs +78 -0
- package/foundation/render/render-page.d.mts +55 -4
- package/foundation/render/render-page.mjs +194 -28
- package/foundation/render/restore-folder.d.mts +13 -0
- package/foundation/render/restore-folder.mjs +30 -0
- package/foundation/render/served-packages.d.mts +2 -1
- package/foundation/render/served-packages.mjs +5 -3
- package/foundation/render/ts-paths.d.mts +11 -0
- package/foundation/render/ts-paths.mjs +27 -2
- package/foundation/render/value-uses.d.mts +43 -0
- package/foundation/render/value-uses.mjs +110 -0
- package/foundation/response/error-codes.d.mts +2 -1
- package/foundation/response/error-codes.doc.mjs +7 -1
- package/foundation/response/error-codes.mjs +10 -2
- package/foundation/response/response-types.doc.mjs +7 -7
- package/foundation/runtime/package-root.d.mts +8 -0
- package/foundation/runtime/package-root.mjs +20 -0
- package/foundation/suggest/other-command.d.mts +11 -0
- package/foundation/suggest/other-command.mjs +1 -1
- package/foundation/text/icon-id.d.mts +20 -0
- package/foundation/text/icon-id.mjs +40 -0
- package/package.json +7 -6
package/README.md
CHANGED
|
@@ -111,6 +111,7 @@ Every run reads one base: Core, or an installed integration whose manifest decla
|
|
|
111
111
|
| `hook` | List hooks or print hook docs | `same` |
|
|
112
112
|
| `init` | Initialize the design system in your project | `own` |
|
|
113
113
|
| `integration` | Author and verify an Astryx integration package | by subcommand |
|
|
114
|
+
| `mcp` | For AI tools that cannot run commands: serve every astryx command as an MCP tool, over stdio | `same` |
|
|
114
115
|
| `search` | Search components, hooks, docs, templates, and themes in one ranked list | `same` |
|
|
115
116
|
| `swizzle` | Copy component source for customization | `refuse` |
|
|
116
117
|
| `template` | List, show, or scaffold page and block templates | `same` |
|
|
@@ -480,7 +481,7 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
480
481
|
|
|
481
482
|
| Type | What `data` carries |
|
|
482
483
|
| --------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
483
|
-
| `init.run` | The install receipt: the `mode` (`default` \| `features`), the features run, agent-doc files written, what changed in each (`docsChanges`: `{path, change, from, to}`), any soft `docsError`, whether theme guidance was emitted, the template outcome (`workflow` \| `created` \| `skipped`) plus its path, and whether the next-steps were emitted.
|
|
484
|
+
| `init.run` | The install receipt: the `mode` (`default` \| `features`), the features run, agent-doc files written, `agentDocsStatus` (`missing` \| `stale` \| `current`: the agent docs before the write; null when agent docs were not installed or the write failed), what changed in each (`docsChanges`: `{path, change, from, to}`), any soft `docsError`, whether theme guidance was emitted, the template outcome (`workflow` \| `created` \| `skipped`) plus its path, and whether the next-steps were emitted (false outside a project, and when `agentDocsStatus` was `current`). |
|
|
484
485
|
| `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. |
|
|
485
486
|
| `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`. |
|
|
486
487
|
| `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. |
|
|
@@ -491,8 +492,8 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
491
492
|
| `component.detail.showcase` | One component's showcase example, as {component, aspectRatio, source}. The envelope's package names the npm package that owns the component. |
|
|
492
493
|
| `component.detail.blocks` | One component's example blocks, as {component, showcase, examples, related} of BlockEntry ({name, package, displayName, description, isShowcase, category, isReady}); each block names the package that owns it, and the envelope's package names the component's owner. |
|
|
493
494
|
| `docs.list` | All reference-doc topics as DocsListEntry[] ({topic, description, package, replaces?, replacedPackage?}), in read order; meta.namespaces lists the docs tree's top-level namespaces, and meta.notLoaded each package whose docs did not load. |
|
|
494
|
-
| `docs.detail` | One topic's full ReferenceDoc (the JSON read of a topic
|
|
495
|
-
| `docs.index` | One topic's section index, the text read of a topic
|
|
495
|
+
| `docs.detail` | One topic's full ReferenceDoc (the JSON read of a topic; in text, a read of a topic whose whole text is 16 KB or less, --full, or --dense), 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). A topic or guide that took another's place carries replaces and replacedPackage, the package whose topic or guide it replaced. |
|
|
496
|
+
| `docs.index` | One topic's section index, the text read of a topic whose whole text is over 16 KB (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); replaces and replacedPackage when the topic or guide took another's place. |
|
|
496
497
|
| `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. |
|
|
497
498
|
| `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, and a guide an integration replaced its replaces and replacedPackage) 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). |
|
|
498
499
|
| `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. |
|
|
@@ -512,7 +513,7 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
512
513
|
| `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. |
|
|
513
514
|
| `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), and demoContentReplaced (how many Astryx docs-only demo content elements were replaced with a Text placeholder for your own content), and isReady (false when the template's doc sets isReady: false). |
|
|
514
515
|
| `template.skeleton` | A layout skeleton (structural tags with spatial annotations) plus the template's description, the components it composes, and isReady. The envelope's package names the npm package that owns the template. |
|
|
515
|
-
| `template.copy` | A scaffold receipt: template id, output directory (relative to the project; absolute for a scratch copy in the system temp folder), written file name, file count, givenPath (optional; the absolute path as given, present only when it was inside the project), demoMediaReplaced (how many Astryx demo media references were replaced with placeholders), demoContentReplaced (how many Astryx docs-only demo content elements were replaced with a Text placeholder), 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,
|
|
516
|
+
| `template.copy` | A scaffold receipt: template id, output directory (relative to the project; absolute for a scratch copy in the system temp folder), written file name, file count, givenPath (optional; the absolute path as given, present only when it was inside the project), demoMediaReplaced (how many Astryx demo media references were replaced with placeholders), demoContentReplaced (how many Astryx docs-only demo content elements were replaced with a Text placeholder), 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, when several lockfiles leave the package manager undetermined, or when no package.json holds the folder, where an install would make the folder a project), and isReady. The envelope's package names the npm package that owns the template. |
|
|
516
517
|
| `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. |
|
|
517
518
|
| `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 the run's active base: @astryxdesign/core in a run on Core. |
|
|
518
519
|
| `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core. |
|
package/api/build/_adapter.d.mts
CHANGED
|
@@ -141,6 +141,31 @@ export function pageDestination(id: string, cwd: string): string | null;
|
|
|
141
141
|
* @returns {string | null}
|
|
142
142
|
*/
|
|
143
143
|
export function buildCoreContentDir(cwd: string): string | null;
|
|
144
|
+
/**
|
|
145
|
+
* The provider the app passes its theme to instead of `<Theme>`, as
|
|
146
|
+
* `theme add` names it: the one an installed package declares, when it takes
|
|
147
|
+
* a theme object. `line` is its opening tag, built as the `theme add`
|
|
148
|
+
* receipt builds it.
|
|
149
|
+
* @typedef {{export: string, from: string, line: string}} ThemeProvider
|
|
150
|
+
*/
|
|
151
|
+
/**
|
|
152
|
+
* @typedef {({state: 'wired', modulePath: string, hasModes: boolean}
|
|
153
|
+
* | {state: 'installed', slug: string, hasModes: boolean}
|
|
154
|
+
* | {state: 'none', slug: string, package: string})
|
|
155
|
+
* & {provider: ThemeProvider | null}} AppThemeWiring
|
|
156
|
+
*/
|
|
157
|
+
/**
|
|
158
|
+
* How the project at `cwd` wires its theme, read the way `theme add` reads
|
|
159
|
+
* it: `wired` when `theme add` has written the generated module, `installed`
|
|
160
|
+
* when a theme it can add is installed but not added, and otherwise the
|
|
161
|
+
* starter theme. `hasModes` says the module records a theme's one color mode,
|
|
162
|
+
* or will once `theme add` adds the installed theme, read from its built
|
|
163
|
+
* module as `theme add` reads it. `provider` is set when an installed package
|
|
164
|
+
* names the provider that takes the theme.
|
|
165
|
+
* @param {string} cwd
|
|
166
|
+
* @returns {Promise<AppThemeWiring>}
|
|
167
|
+
*/
|
|
168
|
+
export function appThemeWiring(cwd: string): Promise<AppThemeWiring>;
|
|
144
169
|
export { withListingCache } from "../../foundation/fs/listing-cache.mjs";
|
|
145
170
|
/**
|
|
146
171
|
* A page template the kit can recommend starting from.
|
|
@@ -238,3 +263,29 @@ export type BlockTemplate = {
|
|
|
238
263
|
*/
|
|
239
264
|
isReady: boolean;
|
|
240
265
|
};
|
|
266
|
+
/**
|
|
267
|
+
* The provider the app passes its theme to instead of `<Theme>`, as
|
|
268
|
+
* `theme add` names it: the one an installed package declares, when it takes
|
|
269
|
+
* a theme object. `line` is its opening tag, built as the `theme add`
|
|
270
|
+
* receipt builds it.
|
|
271
|
+
*/
|
|
272
|
+
export type ThemeProvider = {
|
|
273
|
+
export: string;
|
|
274
|
+
from: string;
|
|
275
|
+
line: string;
|
|
276
|
+
};
|
|
277
|
+
export type AppThemeWiring = ({
|
|
278
|
+
state: "wired";
|
|
279
|
+
modulePath: string;
|
|
280
|
+
hasModes: boolean;
|
|
281
|
+
} | {
|
|
282
|
+
state: "installed";
|
|
283
|
+
slug: string;
|
|
284
|
+
hasModes: boolean;
|
|
285
|
+
} | {
|
|
286
|
+
state: "none";
|
|
287
|
+
slug: string;
|
|
288
|
+
package: string;
|
|
289
|
+
}) & {
|
|
290
|
+
provider: ThemeProvider | null;
|
|
291
|
+
};
|
package/api/build/_adapter.mjs
CHANGED
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @input Template and component discovery for `cwd` — the CLI's own templates
|
|
9
9
|
* and Core's components, plus any that the project's configured integrations
|
|
10
|
-
* contribute
|
|
10
|
+
* contribute; the project's generated theme module and installed theme
|
|
11
|
+
* packages.
|
|
11
12
|
* @output Ready page templates as `{name, displayName, description, category,
|
|
12
13
|
* keywords, command}`, where `command` is the `astryx template` command that
|
|
13
14
|
* selects exactly that template; blocks as search names them; components as
|
|
14
15
|
* `{name, keywords}`; the kit's matcher weights, the root's classifier
|
|
15
16
|
* weights, and the block picker's weights; `keptBlockCatalog`, which keeps
|
|
16
|
-
* the picker's per-block vectors beside the kept search catalog
|
|
17
|
+
* the picker's per-block vectors beside the kept search catalog; and
|
|
18
|
+
* `appThemeWiring`, how the project wires its theme.
|
|
17
19
|
* @position Beside build.mjs (api/build/). The kit leaf reads templates and
|
|
18
20
|
* components only through here, because a subject's `_adapter.mjs` is its
|
|
19
21
|
* only environment access. This adds no discovery of its own: templates come
|
|
20
|
-
* from the template subject's, components from search's
|
|
22
|
+
* from the template subject's, components from search's, themes from the
|
|
23
|
+
* theme subject's.
|
|
21
24
|
*/
|
|
22
25
|
|
|
23
26
|
import fs from 'node:fs';
|
|
27
|
+
import {renderTokens} from '../../foundation/doc-compiler/links.mjs';
|
|
24
28
|
import path from 'node:path';
|
|
25
29
|
import {fileURLToPath} from 'node:url';
|
|
26
30
|
|
|
@@ -33,6 +37,21 @@ import {extractComponents} from '../../foundation/discovery/template-adapter.mjs
|
|
|
33
37
|
import {templateDestination} from '../../foundation/discovery/template-destination.mjs';
|
|
34
38
|
import {quoteCommandArgument} from '../../foundation/env/package-manager.mjs';
|
|
35
39
|
import {isWordModel} from './kit/word-model.mjs';
|
|
40
|
+
import {
|
|
41
|
+
listAvailableThemeState,
|
|
42
|
+
themeOwnerInstalled,
|
|
43
|
+
} from '../theme/_adapter.mjs';
|
|
44
|
+
import {providerLine, providersOf} from '../theme/_app-provider.mjs';
|
|
45
|
+
import {
|
|
46
|
+
ThemeImportError,
|
|
47
|
+
resolveThemeImports,
|
|
48
|
+
} from '../../foundation/discovery/theme-imports.mjs';
|
|
49
|
+
import {
|
|
50
|
+
ThemeStateError,
|
|
51
|
+
readThemeState,
|
|
52
|
+
} from '../../foundation/config/theme-state.mjs';
|
|
53
|
+
import {STARTER_THEME} from '../../foundation/discovery/theme-discovery.mjs';
|
|
54
|
+
import {AstryxError} from '../error.mjs';
|
|
36
55
|
|
|
37
56
|
/**
|
|
38
57
|
* Runs one build with a single directory listing per path: the kit resolves
|
|
@@ -116,7 +135,7 @@ export async function loadTemplates(cwd) {
|
|
|
116
135
|
displayName: t.displayName || t.name,
|
|
117
136
|
category: t.category || '',
|
|
118
137
|
keywords: t.keywords ?? [],
|
|
119
|
-
description: t.description || '',
|
|
138
|
+
description: renderTokens(t.description || ''),
|
|
120
139
|
}));
|
|
121
140
|
const pages = templates
|
|
122
141
|
.filter(t => t.type === 'page' && t.isReady !== false)
|
|
@@ -125,7 +144,7 @@ export async function loadTemplates(cwd) {
|
|
|
125
144
|
{
|
|
126
145
|
name: t.dirName,
|
|
127
146
|
displayName: t.displayName || t.name,
|
|
128
|
-
description: t.description || '',
|
|
147
|
+
description: renderTokens(t.description || ''),
|
|
129
148
|
package: t.package ?? '@astryxdesign/core',
|
|
130
149
|
category: t.category || '',
|
|
131
150
|
keywords: t.keywords ?? [],
|
|
@@ -145,7 +164,7 @@ export async function loadTemplates(cwd) {
|
|
|
145
164
|
name: t.dirName,
|
|
146
165
|
package: t.package ?? '@astryxdesign/core',
|
|
147
166
|
displayName: t.name,
|
|
148
|
-
description: t.description || '',
|
|
167
|
+
description: renderTokens(t.description || ''),
|
|
149
168
|
command: `astryx template ${t.replaces ?? t.dirName} --type block`,
|
|
150
169
|
isReady: t.isReady !== false,
|
|
151
170
|
}));
|
|
@@ -414,3 +433,100 @@ function withComponents(entry, filePath) {
|
|
|
414
433
|
})
|
|
415
434
|
);
|
|
416
435
|
}
|
|
436
|
+
|
|
437
|
+
/**
|
|
438
|
+
* The provider the app passes its theme to instead of `<Theme>`, as
|
|
439
|
+
* `theme add` names it: the one an installed package declares, when it takes
|
|
440
|
+
* a theme object. `line` is its opening tag, built as the `theme add`
|
|
441
|
+
* receipt builds it.
|
|
442
|
+
* @typedef {{export: string, from: string, line: string}} ThemeProvider
|
|
443
|
+
*/
|
|
444
|
+
|
|
445
|
+
/**
|
|
446
|
+
* @typedef {({state: 'wired', modulePath: string, hasModes: boolean}
|
|
447
|
+
* | {state: 'installed', slug: string, hasModes: boolean}
|
|
448
|
+
* | {state: 'none', slug: string, package: string})
|
|
449
|
+
* & {provider: ThemeProvider | null}} AppThemeWiring
|
|
450
|
+
*/
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* How the project at `cwd` wires its theme, read the way `theme add` reads
|
|
454
|
+
* it: `wired` when `theme add` has written the generated module, `installed`
|
|
455
|
+
* when a theme it can add is installed but not added, and otherwise the
|
|
456
|
+
* starter theme. `hasModes` says the module records a theme's one color mode,
|
|
457
|
+
* or will once `theme add` adds the installed theme, read from its built
|
|
458
|
+
* module as `theme add` reads it. `provider` is set when an installed package
|
|
459
|
+
* names the provider that takes the theme.
|
|
460
|
+
* @param {string} cwd
|
|
461
|
+
* @returns {Promise<AppThemeWiring>}
|
|
462
|
+
*/
|
|
463
|
+
export async function appThemeWiring(cwd) {
|
|
464
|
+
/** @type {ThemeProvider | null} */
|
|
465
|
+
let starterProvider = null;
|
|
466
|
+
try {
|
|
467
|
+
const {themes} = await listAvailableThemeState(cwd);
|
|
468
|
+
const {taking} = providersOf(themes);
|
|
469
|
+
/** @param {boolean} oneMode @returns {ThemeProvider | null} */
|
|
470
|
+
const provide = oneMode =>
|
|
471
|
+
taking?.provider.themeProp
|
|
472
|
+
? {
|
|
473
|
+
export: taking.provider.export,
|
|
474
|
+
from: taking.provider.from,
|
|
475
|
+
line: providerLine(taking.provider, oneMode),
|
|
476
|
+
}
|
|
477
|
+
: null;
|
|
478
|
+
starterProvider = provide(false);
|
|
479
|
+
const state = readThemeState(cwd);
|
|
480
|
+
const source = state.module.expectedOriginal;
|
|
481
|
+
if (state.configured && source) {
|
|
482
|
+
const hasModes = /\bexport const themeModes\b/u.test(
|
|
483
|
+
source.toString('utf-8'),
|
|
484
|
+
);
|
|
485
|
+
return {
|
|
486
|
+
state: 'wired',
|
|
487
|
+
modulePath: state.module.path,
|
|
488
|
+
hasModes,
|
|
489
|
+
provider: provide(hasModes),
|
|
490
|
+
};
|
|
491
|
+
}
|
|
492
|
+
const installed = themes.find(theme =>
|
|
493
|
+
themeOwnerInstalled(theme, state.projectDir),
|
|
494
|
+
);
|
|
495
|
+
if (installed) {
|
|
496
|
+
const hasModes = oneColorModeOf(installed, cwd);
|
|
497
|
+
return {
|
|
498
|
+
state: 'installed',
|
|
499
|
+
slug: installed.slug,
|
|
500
|
+
hasModes,
|
|
501
|
+
provider: provide(hasModes),
|
|
502
|
+
};
|
|
503
|
+
}
|
|
504
|
+
} catch (error) {
|
|
505
|
+
// Outside a project, or with theme state the theme commands refuse, the
|
|
506
|
+
// playbook names the starter theme; those commands report the problem.
|
|
507
|
+
if (!(error instanceof ThemeStateError || error instanceof AstryxError))
|
|
508
|
+
throw error;
|
|
509
|
+
}
|
|
510
|
+
return {
|
|
511
|
+
state: 'none',
|
|
512
|
+
slug: STARTER_THEME.slug,
|
|
513
|
+
package: STARTER_THEME.package,
|
|
514
|
+
provider: starterProvider,
|
|
515
|
+
};
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
/**
|
|
519
|
+
* Whether `theme add` records one color mode for a theme: its built module
|
|
520
|
+
* exports one. A theme whose built module cannot be resolved has none here;
|
|
521
|
+
* `theme add` reports that problem.
|
|
522
|
+
* @param {import('../../foundation/discovery/theme-discovery.mjs').DiscoveredTheme} theme
|
|
523
|
+
* @param {string} cwd
|
|
524
|
+
*/
|
|
525
|
+
function oneColorModeOf(theme, cwd) {
|
|
526
|
+
try {
|
|
527
|
+
return resolveThemeImports(theme, {cwd}).mode != null;
|
|
528
|
+
} catch (error) {
|
|
529
|
+
if (error instanceof ThemeImportError) return false;
|
|
530
|
+
throw error;
|
|
531
|
+
}
|
|
532
|
+
}
|
package/api/build/build.doc.mjs
CHANGED
|
@@ -40,7 +40,7 @@ export const doc = {
|
|
|
40
40
|
name: 'options.cwd',
|
|
41
41
|
type: 'string',
|
|
42
42
|
description:
|
|
43
|
-
'Directory to resolve @astryxdesign/core and templates from.',
|
|
43
|
+
'Directory to resolve @astryxdesign/core and templates from, and whose theme wiring the playbook names.',
|
|
44
44
|
default: 'process.cwd()',
|
|
45
45
|
},
|
|
46
46
|
{
|