@astryxdesign/cli 0.7.17-canary.gf63cf9f → 0.7.17-canary.gf672a82
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 +24 -24
- package/api/discover/_adapter.d.mts +13 -2
- package/api/discover/_adapter.mjs +38 -30
- package/api/discover/_catalog-view.d.mts +15 -0
- package/api/discover/_catalog-view.mjs +20 -0
- package/api/discover/_icon-set-coverage.d.mts +22 -0
- package/api/discover/_icon-set-coverage.mjs +32 -0
- package/api/discover/detail/detail.d.mts +3 -1
- package/api/discover/detail/detail.mjs +11 -4
- package/api/discover/detail/item/item.d.mts +11 -1
- package/api/discover/detail/item/item.mjs +29 -8
- package/api/discover/discover.d.mts +12 -0
- package/api/discover/discover.mjs +72 -16
- package/api/discover/discover.type.d.mts +23 -3
- package/api/discover/discover.type.mjs +14 -3
- package/api/discover/search/search.mjs +3 -0
- package/api/docs/_adapter.d.mts +29 -1
- package/api/docs/_adapter.mjs +83 -9
- package/api/doctor/_adapter.d.mts +22 -0
- package/api/doctor/_adapter.mjs +83 -0
- package/api/doctor/built-checks.mjs +6 -1
- package/api/doctor/doctor.d.mts +24 -6
- package/api/doctor/doctor.doc.mjs +1 -1
- package/api/doctor/doctor.mjs +114 -17
- package/api/doctor/doctor.type.d.mts +4 -0
- package/api/doctor/doctor.type.mjs +1 -0
- package/api/error.d.mts +12 -1
- package/api/error.mjs +18 -6
- package/api/icon/_adapter.d.mts +10 -1
- package/api/icon/_adapter.mjs +19 -1
- package/api/icon/_authoring.mjs +21 -7
- package/api/icon/icon.doc.mjs +1 -1
- package/api/icon/list/list.mjs +4 -5
- package/api/icon/search/search.d.mts +5 -3
- package/api/icon/search/search.mjs +16 -6
- package/api/init/_adapter.d.mts +69 -0
- package/api/init/_adapter.mjs +262 -13
- package/api/init/init.doc.mjs +16 -3
- package/api/init/init.mjs +66 -4
- package/api/init/init.type.d.mts +39 -2
- package/api/init/init.type.mjs +18 -2
- package/api/init/run/run.d.mts +34 -2
- package/api/init/run/run.mjs +341 -32
- package/api/integration/pack-check.d.mts +2 -1
- package/api/integration/pack-check.mjs +10 -18
- package/api/integration/validate-integration.mjs +20 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.mjs +135 -27
- package/api/render/render.doc.d.mts +1 -1
- package/api/render/render.doc.mjs +3 -3
- package/api/render/render.mjs +11 -11
- package/api/render/render.type.d.mts +32 -9
- package/api/render/render.type.mjs +16 -13
- package/api/search/ORDERING.md +1 -1
- package/api/search/_adapter.d.mts +11 -7
- package/api/search/_adapter.mjs +15 -11
- package/api/search/_candidate-score.d.mts +9 -4
- package/api/search/_candidate-score.mjs +59 -13
- package/api/search/_cards.json +4 -1
- package/api/search/_gather-templates.mjs +6 -0
- package/api/search/_icons.d.mts +8 -4
- package/api/search/_icons.mjs +18 -5
- package/api/search/_lexical.d.mts +9 -1
- package/api/search/_lexical.mjs +185 -11
- package/api/search/_named-keywords.d.mts +4 -2
- package/api/search/_named-keywords.mjs +22 -13
- package/api/search/_order.mjs +7 -3
- package/api/search/_result.d.mts +7 -0
- package/api/search/_result.mjs +8 -0
- package/api/search/_score.d.mts +20 -6
- package/api/search/_score.mjs +93 -14
- package/api/search/_titles.d.mts +14 -0
- package/api/search/_titles.mjs +16 -3
- package/api/search/_words.d.mts +8 -0
- package/api/search/_words.mjs +19 -0
- package/api/search/search-index.mjs +5 -2
- package/api/search/search.mjs +1 -0
- package/api/search/search.type.mjs +5 -2
- package/api/swizzle/_adapter.d.mts +1 -1
- package/api/swizzle/_adapter.mjs +1 -5
- package/api/swizzle/_moduleGraph.d.mts +0 -6
- package/api/swizzle/_moduleGraph.mjs +0 -12
- package/api/swizzle/copy/copy.mjs +1 -1
- package/api/template/_adapter.d.mts +24 -0
- package/api/template/_adapter.mjs +122 -2
- package/api/template/copy/copy.d.mts +9 -2
- package/api/template/copy/copy.mjs +6 -1
- package/api/template/show/show.d.mts +10 -3
- package/api/template/show/show.mjs +13 -3
- package/api/template/template.doc.mjs +2 -2
- package/api/template/template.mjs +20 -4
- package/api/template/template.type.d.mts +2 -0
- package/api/template/template.type.mjs +3 -1
- package/api/theme/_adapter.d.mts +27 -2
- package/api/theme/_adapter.mjs +675 -15
- package/api/theme/_shared-source.d.mts +33 -0
- package/api/theme/_shared-source.mjs +348 -0
- package/api/theme/add/add.d.mts +3 -0
- package/api/theme/add/add.mjs +21 -4
- package/api/theme/build/build.d.mts +54 -19
- package/api/theme/build/build.mjs +205 -144
- package/api/theme/build/import-specifier.d.mts +14 -0
- package/api/theme/build/import-specifier.mjs +36 -0
- package/api/theme/build/null-values.d.mts +11 -3
- package/api/theme/build/null-values.mjs +49 -23
- package/api/theme/build/self-contained.mjs +32 -11
- package/api/theme/build/theme-object.d.mts +47 -0
- package/api/theme/build/theme-object.mjs +144 -0
- package/api/theme/theme.d.mts +25 -4
- package/api/theme/theme.mjs +55 -5
- package/api/theme/theme.type.d.mts +49 -0
- package/api/theme/theme.type.mjs +25 -1
- package/api/theme/themeAdd.doc.mjs +3 -2
- package/api/theme/themeRemove.doc.mjs +1 -1
- package/api/theme-edit/_catalog.mjs +1 -1
- package/api/theme-edit/_context.d.mts +2 -1
- package/api/theme-edit/_context.mjs +12 -1
- package/api/theme-edit/_edit.mjs +160 -12
- package/api/theme-edit/_how-question.mjs +26 -0
- package/api/theme-edit/_missed.d.mts +2 -1
- package/api/theme-edit/_missed.mjs +20 -1
- package/api/theme-edit/_palette.d.mts +0 -9
- package/api/theme-edit/_palette.mjs +0 -18
- package/api/theme-edit/_parts.mjs +2 -2
- package/api/theme-edit/_settings.d.mts +1 -1
- package/api/theme-edit/_settings.mjs +4 -8
- package/api/theme-edit/theme-edit.type.d.mts +6 -1
- package/api/theme-edit/theme-edit.type.mjs +2 -1
- package/api/upgrade/upgrade.mjs +1 -1
- package/assets/codemods/transforms/next/index.mjs +8 -0
- package/assets/codemods/transforms/next/preserve-chat-radius.mjs +515 -0
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/author-a-theme.doc.mjs +1 -1
- package/assets/docs/principles.doc.dense.mjs +1 -1
- package/assets/docs/principles.doc.mjs +1 -1
- package/assets/docs/principles.doc.zh.mjs +1 -1
- package/assets/docs/tree/checks.doc.mjs +1 -1
- package/assets/docs/tree/{render-pages.doc.mjs → export-pages.doc.mjs} +10 -9
- package/assets/docs/tree/icon-sets.doc.mjs +62 -7
- package/assets/docs/tree/layout.doc.mjs +16 -5
- package/assets/docs/tree/responsive.doc.mjs +2 -2
- package/assets/docs/tree/share-a-page.doc.mjs +6 -6
- package/assets/docs/tree/tokens-radius.doc.mjs +1 -1
- package/assets/docs/tree/tokens.doc.mjs +32 -0
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Step/StepContent.tsx +1 -1
- package/assets/templates/blocks/components/Step/StepShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Stepper/StepperCustomContent.tsx +18 -14
- package/assets/templates/blocks/components/Stepper/StepperOnTrackHorizontal.tsx +1 -1
- package/assets/templates/blocks/components/Table/TableInCard.tsx +1 -1
- package/assets/templates/blocks/components/Table/TableShowcase.tsx +1 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarCardHeader.tsx +2 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarSizes.tsx +1 -1
- package/assets/templates/blocks/components/Toolbar/ToolbarThreeSlot.tsx +2 -1
- package/assets/templates/blocks/components/TopNav/TopNavShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TopNavItem/TopNavItemShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuBasic.tsx +1 -1
- package/assets/templates/blocks/components/TopNavMegaMenu/TopNavMegaMenuShowcase.tsx +1 -1
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuBasic.tsx +1 -1
- package/assets/templates/blocks/components/TopNavMenu/TopNavMenuShowcase.tsx +1 -1
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/checkout-wizard/page.tsx +9 -1
- package/assets/templates/pages/dashboard/page.tsx +3 -1
- package/assets/templates/pages/dashboard-comparison/page.tsx +3 -1
- package/assets/templates/pages/dashboard-progress/page.tsx +89 -96
- package/assets/templates/pages/dashboard-scorecard/page.tsx +32 -23
- package/assets/templates/pages/kanban-board/page.tsx +2 -9
- package/assets/templates/pages/kanban-board/template.doc.mjs +0 -1
- package/assets/templates/pages/payment-form/page.tsx +27 -4
- package/assets/templates/pages/shell-nav/page.tsx +27 -15
- package/assets/templates/pages/shell-side-nav/page.tsx +10 -9
- package/assets/templates/themes/butter/butterTheme.ts +9 -1
- package/assets/templates/themes/chocolate/chocolateTheme.ts +10 -6
- package/assets/templates/themes/gothic/gothicTheme.ts +2 -0
- package/assets/templates/themes/matcha/matchaTheme.ts +7 -2
- package/assets/templates/themes/neutral/neutralTheme.ts +2 -0
- package/assets/templates/themes/stone/stoneTheme.ts +2 -0
- package/assets/templates/themes/y2k/y2kTheme.ts +3 -0
- package/assets/theme.template.ts +1 -0
- package/authoring/config/config.doc.mjs +7 -0
- package/authoring/config/parse.mjs +15 -0
- package/authoring/config/skill-places.d.mts +23 -0
- package/authoring/config/skill-places.mjs +35 -0
- package/authoring/config/type.ts +15 -0
- package/authoring/discover/parse.d.mts +2 -1
- package/authoring/discover/parse.mjs +24 -3
- package/authoring/discover/type.ts +9 -2
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/discover.mjs +86 -6
- package/clients/cli/commands/docs.mjs +22 -16
- package/clients/cli/commands/doctor.mjs +16 -3
- package/clients/cli/commands/experimental/export.mjs +64 -0
- package/clients/cli/commands/experimental/icon.mjs +7 -4
- package/clients/cli/commands/experimental/import.mjs +70 -0
- package/clients/cli/commands/experimental/index.mjs +92 -6
- package/clients/cli/commands/experimental/render-output.mjs +196 -0
- package/clients/cli/commands/experimental/theme.mjs +34 -13
- package/clients/cli/commands/{experimental-render.doc.mjs → experimental-export.doc.mjs} +10 -10
- package/clients/cli/commands/experimental-import.doc.mjs +53 -0
- package/clients/cli/commands/experimental-theme-add.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme.doc.mjs +1 -1
- package/clients/cli/commands/experimental.doc.mjs +4 -4
- package/clients/cli/commands/init.doc.mjs +13 -3
- package/clients/cli/commands/template.mjs +18 -0
- package/clients/cli/commands/theme-add.doc.mjs +6 -2
- package/clients/cli/commands/theme-remove.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +74 -3
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/index.mjs +7 -6
- package/clients/cli/lib/cli-error.mjs +1 -6
- package/clients/cli/lib/component-format.mjs +10 -2
- package/clients/cli/lib/hook-format.mjs +14 -11
- package/clients/cli/lib/renamed-commands.mjs +21 -0
- package/clients/cli/lib/stray-option.mjs +53 -1
- package/clients/cli/lib/unknown-command.mjs +84 -6
- package/clients/cli/manifest.generated.json +1 -1
- package/clients/cli/run.mjs +27 -0
- package/foundation/agent-docs/agent-doc-state.d.mts +20 -2
- package/foundation/agent-docs/agent-doc-state.mjs +70 -3
- package/foundation/agent-docs/computer-agent-text.d.mts +5 -14
- package/foundation/agent-docs/computer-agent-text.mjs +60 -155
- package/foundation/agent-docs/managed-skill-file.d.mts +103 -0
- package/foundation/agent-docs/managed-skill-file.mjs +193 -0
- package/foundation/agent-docs/skill-place-files.d.mts +12 -0
- package/foundation/agent-docs/skill-place-files.mjs +38 -0
- package/foundation/agent-docs/skill-places.d.mts +115 -0
- package/foundation/agent-docs/skill-places.mjs +322 -0
- package/foundation/config/config-path.d.mts +2 -2
- package/foundation/config/config-path.mjs +5 -6
- package/foundation/config/config-writer.d.mts +5 -1
- package/foundation/config/config-writer.mjs +20 -4
- package/foundation/config/theme-state.d.mts +13 -0
- package/foundation/config/theme-state.mjs +28 -0
- package/foundation/discovery/component-discovery.mjs +59 -15
- package/foundation/discovery/icon-definition-discovery.d.mts +11 -0
- package/foundation/discovery/icon-definition-discovery.mjs +16 -0
- package/foundation/discovery/icon-ranking.d.mts +84 -4
- package/foundation/discovery/icon-ranking.mjs +222 -76
- package/foundation/discovery/icon-set-writer.mjs +73 -3
- package/foundation/discovery/module-exports.mjs +2 -9
- package/foundation/discovery/runner-allowlist.d.mts +1 -1
- package/foundation/discovery/runner-allowlist.mjs +1 -1
- package/foundation/discovery/template-adapter.d.mts +26 -0
- package/foundation/discovery/template-adapter.mjs +98 -1
- package/foundation/doc-compiler/read.d.mts +1 -1
- package/foundation/doc-compiler/stored-docs.d.mts +14 -3
- package/foundation/doc-compiler/stored-docs.mjs +12 -6
- package/foundation/env/package-manager.d.mts +8 -0
- package/foundation/env/package-manager.mjs +20 -2
- package/foundation/env/user-settings.d.mts +15 -0
- package/foundation/env/user-settings.mjs +56 -2
- package/foundation/fs/empty-folder.d.mts +12 -0
- package/foundation/fs/empty-folder.mjs +30 -0
- package/foundation/fs/gather-cache.d.mts +8 -3
- package/foundation/fs/gather-cache.mjs +110 -28
- package/foundation/fs/import-url.d.mts +7 -5
- package/foundation/fs/import-url.mjs +7 -5
- package/foundation/fs/loaded-files.d.mts +15 -1
- package/foundation/fs/loaded-files.mjs +40 -3
- package/foundation/fs/relative-specifier.d.mts +10 -0
- package/foundation/fs/relative-specifier.mjs +28 -0
- package/foundation/integrations/integrations.d.mts +3 -1
- package/foundation/integrations/integrations.mjs +3 -2
- package/foundation/integrations/provider-resolution.mjs +19 -2
- package/foundation/release/agent-text-worker.mjs +32 -1
- package/foundation/release/choose.d.mts +2 -1
- package/foundation/release/choose.mjs +24 -3
- package/foundation/release/global-state.mjs +10 -2
- package/foundation/render/assets.mjs +1 -1
- package/foundation/render/component-map.mjs +1 -1
- package/foundation/render/css-cut.mjs +1 -1
- package/foundation/render/embedded-files.mjs +1 -1
- package/foundation/render/embedded-imports.d.mts +33 -5
- package/foundation/render/embedded-imports.mjs +113 -34
- package/foundation/render/esbuild-dependency.mjs +1 -1
- package/foundation/render/file-header.d.mts +2 -2
- package/foundation/render/file-header.mjs +7 -7
- package/foundation/render/html-reader.d.mts +5 -4
- package/foundation/render/html-reader.mjs +6 -5
- package/foundation/render/markup-edits.mjs +1 -1
- package/foundation/render/page-host.mjs +1 -1
- package/foundation/render/page-worker.mjs +32 -2
- package/foundation/render/rebuild.mjs +2 -2
- package/foundation/render/render-page.d.mts +11 -3
- package/foundation/render/render-page.mjs +167 -35
- package/foundation/render/source-block.d.mts +8 -0
- package/foundation/render/source-block.mjs +6 -2
- package/foundation/render/ts-paths.d.mts +7 -1
- package/foundation/render/ts-paths.mjs +19 -2
- package/foundation/response/error-codes.doc.mjs +11 -11
- package/foundation/response/error-codes.mjs +4 -4
- package/foundation/response/json.d.mts +0 -15
- package/foundation/response/json.mjs +1 -51
- package/foundation/response/response-types.doc.mjs +5 -5
- package/foundation/runtime/lazy-dependencies.d.mts +1 -0
- package/foundation/runtime/lazy-dependencies.mjs +10 -3
- package/foundation/text/definition-coverage.d.mts +21 -0
- package/foundation/text/definition-coverage.mjs +20 -0
- package/foundation/text/icon-set-next.d.mts +11 -10
- package/foundation/text/icon-set-next.mjs +19 -11
- package/foundation/text/suggest-order.d.mts +10 -4
- package/foundation/text/suggest-order.mjs +20 -13
- package/package.json +6 -6
- package/clients/cli/commands/experimental/render.mjs +0 -205
package/README.md
CHANGED
|
@@ -98,25 +98,25 @@ Every run reads one base: Core, or an installed integration whose manifest decla
|
|
|
98
98
|
|
|
99
99
|
<!-- BEGIN GENERATED: commands -->
|
|
100
100
|
|
|
101
|
-
| Command | Description
|
|
102
|
-
| -------------- |
|
|
103
|
-
| `blog` | Read the Astryx blog from the published feed
|
|
104
|
-
| `build` | Build a page: the template to start from, or the workflow playbook (no query)
|
|
105
|
-
| `component` | List components or print component docs
|
|
106
|
-
| `discover` | Browse and search integrations: the ones you have and the ones you could add
|
|
107
|
-
| `docs` | Print reference docs
|
|
108
|
-
| `doctor` | Diagnose Astryx projects and integration packages
|
|
109
|
-
| `experimental` | [experimental] Try features that may change in a patch release: icon sets, page
|
|
110
|
-
| `gap-report` | Report a missing component or feature to the package that owns it
|
|
111
|
-
| `hook` | List hooks or print hook docs
|
|
112
|
-
| `init` | Initialize the design system in your project
|
|
113
|
-
| `integration` | Author and verify an Astryx integration package
|
|
114
|
-
| `mcp` | For AI tools that cannot run commands: serve every astryx command as an MCP tool, over stdio
|
|
115
|
-
| `search` | Search components, hooks, docs, templates, and themes in one ranked list
|
|
116
|
-
| `swizzle` | Copy component source for customization
|
|
117
|
-
| `template` | List, show, or scaffold page and block templates
|
|
118
|
-
| `theme` | Add, switch, build, and author themes (to make or change one, use experimental theme editor)
|
|
119
|
-
| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components
|
|
101
|
+
| Command | Description | Outside a project |
|
|
102
|
+
| -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------- |
|
|
103
|
+
| `blog` | Read the Astryx blog from the published feed | `same` |
|
|
104
|
+
| `build` | Build a page: the template to start from, or the workflow playbook (no query) | `same` |
|
|
105
|
+
| `component` | List components or print component docs | `same` |
|
|
106
|
+
| `discover` | Browse and search integrations: the ones you have and the ones you could add | `same` |
|
|
107
|
+
| `docs` | Print reference docs | `same` |
|
|
108
|
+
| `doctor` | Diagnose Astryx projects and integration packages | `own` |
|
|
109
|
+
| `experimental` | [experimental] Try features that may change in a patch release: icon sets, one self-contained HTML file from a page built with Astryx components (not for other pages), checked theme editing | by subcommand |
|
|
110
|
+
| `gap-report` | Report a missing component or feature to the package that owns it | `same` |
|
|
111
|
+
| `hook` | List hooks or print hook docs | `same` |
|
|
112
|
+
| `init` | Initialize the design system in your project | `own` |
|
|
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` |
|
|
115
|
+
| `search` | Search components, hooks, docs, templates, and themes in one ranked list | `same` |
|
|
116
|
+
| `swizzle` | Copy component source for customization | `refuse` |
|
|
117
|
+
| `template` | List, show, or scaffold page and block templates | `same` |
|
|
118
|
+
| `theme` | Add, switch, build, and author themes (to make or change one, use experimental theme editor) | by subcommand |
|
|
119
|
+
| `upgrade` | Update your code after upgrading Astryx, and refresh ShadCN-copied components | `own` |
|
|
120
120
|
|
|
121
121
|
<!-- END GENERATED: commands -->
|
|
122
122
|
<!-- Generated by scripts/generate-cli-readme.mjs from `astryx manifest`. Run `pnpm -F @astryxdesign/cli readme`. -->
|
|
@@ -510,11 +510,11 @@ Every response has a `type` discriminant. The full set is below (generated from
|
|
|
510
510
|
| `swizzle.copy` | An eject receipt: component name, owning package, output directory, files-copied count, the copied file names (relative to the component folder; owner modules copied beside it start with ../), whether any file uses StyleX, and, when the owner has an issues URL, feedback ({issuesUrl, ghCommand?}): where to report the gap that led to swizzling. The envelope's package names the same owning package. |
|
|
511
511
|
| `gap-report.categories` | The fixed gap category values and human-readable labels; when a loaded integration names its own issues URL, meta.destinations lists every destination ({to, default, issuesUrl}) and meta.ask tells an agent to ask the person. |
|
|
512
512
|
| `gap-report.file` | An aggregate receipt: overall status, the selected package, issuesUrl (or null), deliveries in handler order, each {handlerType: project \| integration \| fallback, handler, audience, status, url, message}, and filedCount/routedOnlyCount totals; without --to, when a loaded integration names its own issues URL, destinations and ask as on gap-report.categories. |
|
|
513
|
-
| `template.list` | The effective
|
|
514
|
-
| `template.show` | The
|
|
515
|
-
| `template.skeleton` | A layout skeleton (structural tags with spatial annotations)
|
|
516
|
-
| `template.copy` | A scaffold receipt: template id,
|
|
517
|
-
| `template.cdn` | A write receipt for the no-build
|
|
513
|
+
| `template.list` | The effective TemplateListEntry[] for pages and blocks; a replacement carries `replaces`, the Core id it hides from the default list. |
|
|
514
|
+
| `template.show` | The template's source, as a copy writes it, with its description, kind, components (a sorted summary, without common ones such as Text), componentsToRead (what it renders, in the form `astryx component` takes, in first-use order), demoMediaReplaced and demoContentReplaced (demo media and content replaced with placeholders), and isReady (false when its doc says so). |
|
|
515
|
+
| `template.skeleton` | A layout skeleton (structural tags with spatial annotations) with the template's description, components, and isReady. |
|
|
516
|
+
| `template.copy` | A scaffold receipt: template id, outputDir (absolute for a scratch copy), fileName, filesCopied, givenPath (the absolute path given, only when inside the project), demoMediaReplaced, demoContentReplaced, notes (what the project lacks, such as missing packages or a StyleX compiler; empty when nothing), missingPackages, installCommand (null when nothing is missing, the package manager is undetermined, or no package.json holds the folder), installGuidance (how an integration adds them, used instead of installCommand), components (what it renders, in the form `astryx component` takes, in first-use order), and isReady. |
|
|
517
|
+
| `template.cdn` | A write receipt for the no-build CDN starter page: path (relative to cwd), the Astryx version its CDN URLs pin, written, and reason (`exists`, a success, when a file was already there). |
|
|
518
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. |
|
|
519
519
|
| `hook.detail` | One hook's full authored HookDoc. The envelope's package is @astryxdesign/core. |
|
|
520
520
|
| `hook.detail.params` | Just one hook's parameters table (HookParamDoc[]). The envelope's package is @astryxdesign/core. |
|
|
@@ -148,13 +148,13 @@ export function callSources(project: Project | undefined, request?: {
|
|
|
148
148
|
official?: OfficialList;
|
|
149
149
|
}): Promise<CatalogResult>;
|
|
150
150
|
/**
|
|
151
|
-
* The item kinds
|
|
151
|
+
* The item kinds `--type` takes in the project at the working directory, or
|
|
152
152
|
* the stable kinds when it cannot be read.
|
|
153
153
|
* @returns {Promise<readonly string[]>}
|
|
154
154
|
*/
|
|
155
155
|
export function loadReadKinds(): Promise<readonly string[]>;
|
|
156
156
|
/**
|
|
157
|
-
* The item kinds
|
|
157
|
+
* The item kinds `--type` takes in this project: every stable kind, and the
|
|
158
158
|
* experimental ones where icon features are on.
|
|
159
159
|
* @param {Project | undefined} project
|
|
160
160
|
* @returns {readonly string[]}
|
|
@@ -265,6 +265,17 @@ export function loadValidatedDoc(result: ComponentResolution, { lang, zh }: {
|
|
|
265
265
|
* @returns {Promise<AstryxError>}
|
|
266
266
|
*/
|
|
267
267
|
export function withCoreMatch(err: AstryxError, query: string, cwd: string): Promise<AstryxError>;
|
|
268
|
+
/**
|
|
269
|
+
* How many of the icon definitions this CLI ships a set's definitions cover,
|
|
270
|
+
* of how many: the coverage `experimental icon --list` reports as
|
|
271
|
+
* `coverage.astryx`.
|
|
272
|
+
* @param {string[]} definitions
|
|
273
|
+
* @returns {{mapped: number, total: number}}
|
|
274
|
+
*/
|
|
275
|
+
export function iconSetCoverage(definitions: string[]): {
|
|
276
|
+
mapped: number;
|
|
277
|
+
total: number;
|
|
278
|
+
};
|
|
268
279
|
/** The name the official list goes by, as a source and on each of its entries. */
|
|
269
280
|
export const OFFICIAL_SOURCE_NAME: "Astryx";
|
|
270
281
|
/** The official list, generated from the repository when the CLI is built. */
|
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
projectTree,
|
|
39
39
|
} from '../docs/_adapter.mjs';
|
|
40
40
|
import {discoverIntegrationIconSets} from '../../foundation/discovery/icon-set-discovery.mjs';
|
|
41
|
+
import {astryxDefinitionCoverage} from '../../foundation/discovery/icon-definition-discovery.mjs';
|
|
41
42
|
import {iconFeatureGate} from '../../foundation/integrations/icon-features.mjs';
|
|
42
43
|
import {isValidSemver, semverCompare} from '../../foundation/env/semver.mjs';
|
|
43
44
|
import {assertWithin} from '../../foundation/fs/path-safety.mjs';
|
|
@@ -691,6 +692,24 @@ function savedCopyPath(cacheDir, from, request) {
|
|
|
691
692
|
return assertWithin(`${key}.json`, dir, {label: 'discover saved copy'});
|
|
692
693
|
}
|
|
693
694
|
|
|
695
|
+
/**
|
|
696
|
+
* A source's catalog with its icon sets, which discover lists in every
|
|
697
|
+
* project (spec:AST-084 FR17). With icon features off, a malformed icon-set
|
|
698
|
+
* item never fails a source: the catalog is then read as a CLI without icon
|
|
699
|
+
* sets reads it, with the kind and its fields unknown (spec:AST-051 FR7).
|
|
700
|
+
* @param {unknown} value
|
|
701
|
+
* @param {string} label
|
|
702
|
+
* @param {boolean} iconSets icon features are on in the project
|
|
703
|
+
*/
|
|
704
|
+
function parseCatalog(value, label, iconSets) {
|
|
705
|
+
if (iconSets) return parseDiscoverCatalog(value, label, {iconSets: true});
|
|
706
|
+
try {
|
|
707
|
+
return parseDiscoverCatalog(value, label, {iconSets: true});
|
|
708
|
+
} catch {
|
|
709
|
+
return parseDiscoverCatalog(value, label);
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
|
|
694
713
|
/**
|
|
695
714
|
* @param {string} file
|
|
696
715
|
* @param {string} label
|
|
@@ -701,7 +720,7 @@ function readSavedCopy(file, label, iconSets) {
|
|
|
701
720
|
const saved = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
702
721
|
return {
|
|
703
722
|
savedAt: String(saved.savedAt),
|
|
704
|
-
catalog:
|
|
723
|
+
catalog: parseCatalog(saved.catalog, label, iconSets),
|
|
705
724
|
};
|
|
706
725
|
} catch {
|
|
707
726
|
return null;
|
|
@@ -752,7 +771,7 @@ async function callSource(source, request, label, timeoutMs, iconSets) {
|
|
|
752
771
|
),
|
|
753
772
|
timedOut,
|
|
754
773
|
]);
|
|
755
|
-
return
|
|
774
|
+
return parseCatalog(answer, label, iconSets);
|
|
756
775
|
} finally {
|
|
757
776
|
clearTimeout(timer);
|
|
758
777
|
}
|
|
@@ -850,10 +869,7 @@ export function savedCatalog(
|
|
|
850
869
|
}
|
|
851
870
|
}
|
|
852
871
|
if (!saved) return null;
|
|
853
|
-
return
|
|
854
|
-
...packages,
|
|
855
|
-
...officialNotCovered(packages, official),
|
|
856
|
-
]);
|
|
872
|
+
return [...packages, ...officialNotCovered(packages, official)];
|
|
857
873
|
}
|
|
858
874
|
|
|
859
875
|
/**
|
|
@@ -912,8 +928,6 @@ async function callOwnSources(project, request = {}, options = {}) {
|
|
|
912
928
|
const result = {sources: [], packages: []};
|
|
913
929
|
const fromDoor = doorSources();
|
|
914
930
|
if (project == null && fromDoor.length === 0) return result;
|
|
915
|
-
// With icon features off, icon-set items and fields are unknown before the
|
|
916
|
-
// catalog is checked, so one cannot fail a source (spec:AST-051 FR7).
|
|
917
931
|
const iconSets = optedIntoIconSets(project);
|
|
918
932
|
|
|
919
933
|
const origins = sourceOrigins(project);
|
|
@@ -1019,11 +1033,9 @@ export async function callSources(project, request = {}, options = {}) {
|
|
|
1019
1033
|
],
|
|
1020
1034
|
// Source order: the first entry per integration is the one discover
|
|
1021
1035
|
// keeps. Official packages are put first only where discover shows them.
|
|
1022
|
-
//
|
|
1023
|
-
//
|
|
1024
|
-
|
|
1025
|
-
// (FR7).
|
|
1026
|
-
packages: withoutUnreadKinds(project, [...own.packages, ...added]),
|
|
1036
|
+
// Icon sets a project could add are listed in every project, so an app
|
|
1037
|
+
// can compare them before it picks one (spec:AST-084 FR17).
|
|
1038
|
+
packages: [...own.packages, ...added],
|
|
1027
1039
|
};
|
|
1028
1040
|
}
|
|
1029
1041
|
|
|
@@ -1063,7 +1075,7 @@ export const STABLE_KINDS = DISCOVER_KINDS.filter(
|
|
|
1063
1075
|
);
|
|
1064
1076
|
|
|
1065
1077
|
/**
|
|
1066
|
-
* The item kinds
|
|
1078
|
+
* The item kinds `--type` takes in the project at the working directory, or
|
|
1067
1079
|
* the stable kinds when it cannot be read.
|
|
1068
1080
|
* @returns {Promise<readonly string[]>}
|
|
1069
1081
|
*/
|
|
@@ -1072,7 +1084,7 @@ export async function loadReadKinds() {
|
|
|
1072
1084
|
}
|
|
1073
1085
|
|
|
1074
1086
|
/**
|
|
1075
|
-
* The item kinds
|
|
1087
|
+
* The item kinds `--type` takes in this project: every stable kind, and the
|
|
1076
1088
|
* experimental ones where icon features are on.
|
|
1077
1089
|
* @param {Project | undefined} project
|
|
1078
1090
|
* @returns {readonly string[]}
|
|
@@ -1089,21 +1101,6 @@ export function optedIntoIconSets(project) {
|
|
|
1089
1101
|
return iconFeatureGate(project).on;
|
|
1090
1102
|
}
|
|
1091
1103
|
|
|
1092
|
-
/**
|
|
1093
|
-
* @template {{contributions: Array<{kind: string}>}} P
|
|
1094
|
-
* @param {Project | undefined} project
|
|
1095
|
-
* @param {P[]} packages
|
|
1096
|
-
* @returns {P[]}
|
|
1097
|
-
*/
|
|
1098
|
-
function withoutUnreadKinds(project, packages) {
|
|
1099
|
-
if (optedIntoIconSets(project)) return packages;
|
|
1100
|
-
const kinds = readKinds(project);
|
|
1101
|
-
return packages.map(pkg => ({
|
|
1102
|
-
...pkg,
|
|
1103
|
-
contributions: pkg.contributions.filter(c => kinds.includes(c.kind)),
|
|
1104
|
-
}));
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
1104
|
/**
|
|
1108
1105
|
* Official packages first, in the official list's order; the rest keep theirs.
|
|
1109
1106
|
* @template T
|
|
@@ -1441,3 +1438,14 @@ export async function withCoreMatch(err, query, cwd) {
|
|
|
1441
1438
|
return err;
|
|
1442
1439
|
}
|
|
1443
1440
|
}
|
|
1441
|
+
|
|
1442
|
+
/**
|
|
1443
|
+
* How many of the icon definitions this CLI ships a set's definitions cover,
|
|
1444
|
+
* of how many: the coverage `experimental icon --list` reports as
|
|
1445
|
+
* `coverage.astryx`.
|
|
1446
|
+
* @param {string[]} definitions
|
|
1447
|
+
* @returns {{mapped: number, total: number}}
|
|
1448
|
+
*/
|
|
1449
|
+
export function iconSetCoverage(definitions) {
|
|
1450
|
+
return astryxDefinitionCoverage(definitions);
|
|
1451
|
+
}
|
|
@@ -50,6 +50,19 @@ export function catalogState(pkg: CatalogPackage, installedNames: Set<string>, d
|
|
|
50
50
|
state: "installed" | "declared" | "alias" | "available";
|
|
51
51
|
installedAs?: string;
|
|
52
52
|
};
|
|
53
|
+
/**
|
|
54
|
+
* A catalog package as discover may show it: an installed package's icon
|
|
55
|
+
* sets, under its own name or an alias, are read only where icon features are
|
|
56
|
+
* on (spec:AST-084 FR17), whichever version is shown.
|
|
57
|
+
* @param {CatalogPackage} entry
|
|
58
|
+
* @param {{installed: boolean, iconSets?: boolean}} options `installed`: the
|
|
59
|
+
* project has the package, under its name or an alias
|
|
60
|
+
* @returns {CatalogPackage}
|
|
61
|
+
*/
|
|
62
|
+
export function shownEntry(entry: CatalogPackage, { installed, iconSets }: {
|
|
63
|
+
installed: boolean;
|
|
64
|
+
iconSets?: boolean;
|
|
65
|
+
}): CatalogPackage;
|
|
53
66
|
/**
|
|
54
67
|
* The version a catalog package shows by default.
|
|
55
68
|
* @param {CatalogPackage} pkg
|
|
@@ -62,6 +75,7 @@ export function defaultVersion(pkg: CatalogPackage): string | undefined;
|
|
|
62
75
|
* @param {string | undefined} version
|
|
63
76
|
*/
|
|
64
77
|
export function catalogEntry(pkg: CatalogPackage, version: string | undefined): {
|
|
78
|
+
experimentalFields?: string[] | undefined;
|
|
65
79
|
description?: string | undefined;
|
|
66
80
|
version?: string | undefined;
|
|
67
81
|
name: string;
|
|
@@ -85,6 +99,7 @@ export function availableEntries(catalog: CatalogResult, installed: InstalledPac
|
|
|
85
99
|
install?: string | undefined;
|
|
86
100
|
source: string;
|
|
87
101
|
aliases?: string[] | undefined;
|
|
102
|
+
experimentalFields?: string[] | undefined;
|
|
88
103
|
description?: string | undefined;
|
|
89
104
|
version?: string | undefined;
|
|
90
105
|
name: string;
|
|
@@ -86,6 +86,23 @@ export function catalogState(pkg, installedNames, declared, officialDeclared) {
|
|
|
86
86
|
return {state: 'available'};
|
|
87
87
|
}
|
|
88
88
|
|
|
89
|
+
/**
|
|
90
|
+
* A catalog package as discover may show it: an installed package's icon
|
|
91
|
+
* sets, under its own name or an alias, are read only where icon features are
|
|
92
|
+
* on (spec:AST-084 FR17), whichever version is shown.
|
|
93
|
+
* @param {CatalogPackage} entry
|
|
94
|
+
* @param {{installed: boolean, iconSets?: boolean}} options `installed`: the
|
|
95
|
+
* project has the package, under its name or an alias
|
|
96
|
+
* @returns {CatalogPackage}
|
|
97
|
+
*/
|
|
98
|
+
export function shownEntry(entry, {installed, iconSets}) {
|
|
99
|
+
if (!installed || iconSets) return entry;
|
|
100
|
+
return {
|
|
101
|
+
...entry,
|
|
102
|
+
contributions: entry.contributions.filter(c => c.kind !== 'icon-set'),
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
|
|
89
106
|
/**
|
|
90
107
|
* The version a catalog package shows by default.
|
|
91
108
|
* @param {CatalogPackage} pkg
|
|
@@ -110,6 +127,9 @@ export function catalogEntry(pkg, version) {
|
|
|
110
127
|
...(version ? {version} : {}),
|
|
111
128
|
...(pkg.description ? {description: pkg.description} : {}),
|
|
112
129
|
...others,
|
|
130
|
+
// Icon sets are experimental (spec:AST-017 FR27): the entry names the
|
|
131
|
+
// field that lists them, so a consumer can leave them out.
|
|
132
|
+
...(others.iconSets ? {experimentalFields: ['iconSets']} : {}),
|
|
113
133
|
};
|
|
114
134
|
}
|
|
115
135
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Record the coverage of the icon set an item response shows.
|
|
6
|
+
* @param {object} response
|
|
7
|
+
* @param {{mapped: number, total: number}} coverage
|
|
8
|
+
*/
|
|
9
|
+
export function setIconSetCoverage(response: object, coverage: {
|
|
10
|
+
mapped: number;
|
|
11
|
+
total: number;
|
|
12
|
+
}): void;
|
|
13
|
+
/**
|
|
14
|
+
* How many of this CLI's icon definitions the icon set an item response
|
|
15
|
+
* shows maps, of how many; null when its source lists no definitions.
|
|
16
|
+
* @param {object} response
|
|
17
|
+
* @returns {{mapped: number, total: number} | null}
|
|
18
|
+
*/
|
|
19
|
+
export function iconSetCoverageOf(response: object): {
|
|
20
|
+
mapped: number;
|
|
21
|
+
total: number;
|
|
22
|
+
} | null;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file How many of this CLI's icon definitions an icon set a source lists
|
|
5
|
+
* maps, kept beside the item response that shows the set.
|
|
6
|
+
* @input The item leaf records it; the text view reads it.
|
|
7
|
+
* @output `iconSetCoverageOf(response)`: `{mapped, total}`, or null.
|
|
8
|
+
* @position A module of its own so search's discover line, which imports
|
|
9
|
+
* discover's entry, loads no leaf for it. It never enters discover's JSON.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/** @type {WeakMap<object, {mapped: number, total: number}>} */
|
|
13
|
+
const coverageByResponse = new WeakMap();
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Record the coverage of the icon set an item response shows.
|
|
17
|
+
* @param {object} response
|
|
18
|
+
* @param {{mapped: number, total: number}} coverage
|
|
19
|
+
*/
|
|
20
|
+
export function setIconSetCoverage(response, coverage) {
|
|
21
|
+
coverageByResponse.set(response, coverage);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* How many of this CLI's icon definitions the icon set an item response
|
|
26
|
+
* shows maps, of how many; null when its source lists no definitions.
|
|
27
|
+
* @param {object} response
|
|
28
|
+
* @returns {{mapped: number, total: number} | null}
|
|
29
|
+
*/
|
|
30
|
+
export function iconSetCoverageOf(response) {
|
|
31
|
+
return coverageByResponse.get(response) ?? null;
|
|
32
|
+
}
|
|
@@ -15,7 +15,8 @@
|
|
|
15
15
|
* version?: string,
|
|
16
16
|
* add?: (name: string, version?: string) => string,
|
|
17
17
|
* installedAs?: string,
|
|
18
|
-
*
|
|
18
|
+
* iconSets?: boolean,
|
|
19
|
+
* }} [options] `iconSets`: icon features are on in the project
|
|
19
20
|
* @returns {import('../discover.type.mjs').DiscoverDetailResponse}
|
|
20
21
|
*/
|
|
21
22
|
export function detail(packages: import("../_adapter.mjs").InstalledPackage[], name: string, options?: {
|
|
@@ -23,4 +24,5 @@ export function detail(packages: import("../_adapter.mjs").InstalledPackage[], n
|
|
|
23
24
|
version?: string;
|
|
24
25
|
add?: (name: string, version?: string) => string;
|
|
25
26
|
installedAs?: string;
|
|
27
|
+
iconSets?: boolean;
|
|
26
28
|
}): import("../discover.type.mjs").DiscoverDetailResponse;
|