@astryxdesign/cli 0.7.17-canary.g5a3fd39 → 0.7.17-canary.g5cf5d69
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 +64 -63
- 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 +3 -3
- package/api/build/help/help.d.mts +15 -14
- package/api/build/help/help.mjs +62 -3
- package/api/build/kit/answer.mjs +2 -3
- package/api/build/kit/signals.d.mts +10 -0
- package/api/build/kit/signals.mjs +15 -2
- package/api/component/detail/blocks/blocks.mjs +2 -1
- package/api/discover/_adapter.d.mts +57 -6
- package/api/discover/_adapter.mjs +278 -49
- package/api/discover/_catalog-view.d.mts +7 -0
- package/api/discover/_catalog-view.mjs +10 -1
- package/api/discover/detail/detail.d.mts +3 -2
- package/api/discover/detail/detail.mjs +3 -2
- package/api/discover/detail/doc/doc.mjs +1 -1
- package/api/discover/discover.d.mts +24 -0
- package/api/discover/discover.doc.mjs +1 -1
- package/api/discover/discover.mjs +146 -25
- package/api/discover/discover.type.d.mts +6 -4
- package/api/discover/discover.type.mjs +6 -4
- 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 +43 -3
- package/api/doctor/_adapter.mjs +142 -18
- package/api/doctor/built-checks.d.mts +30 -3
- package/api/doctor/built-checks.mjs +132 -5
- package/api/doctor/doctor.d.mts +93 -6
- package/api/doctor/doctor.doc.mjs +2 -2
- package/api/doctor/doctor.mjs +524 -33
- 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 +74 -6
- package/api/hook/hook.type.d.mts +1 -1
- package/api/hook/hook.type.mjs +1 -1
- package/api/hook/list/list.mjs +11 -7
- package/api/icon/_adapter.d.mts +2 -1
- package/api/icon/_adapter.mjs +10 -15
- package/api/icon/_records.d.mts +3 -1
- package/api/icon/_records.mjs +30 -3
- package/api/icon/exportIconIndex.doc.mjs +1 -1
- package/api/icon/icon.doc.mjs +3 -3
- package/api/icon/icon.type.d.mts +32 -1
- package/api/icon/icon.type.mjs +19 -3
- package/api/icon/list/list.mjs +4 -1
- package/api/icon/rankIconIndex.doc.mjs +1 -1
- package/api/icon/search/icon-index.mjs +18 -8
- package/api/icon/search/search.d.mts +26 -3
- package/api/icon/search/search.mjs +155 -9
- 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 +29 -1
- package/api/init/init.type.mjs +14 -1
- package/api/init/run/run.d.mts +11 -1
- package/api/init/run/run.mjs +84 -5
- package/api/integration/_adapter.d.mts +5 -4
- package/api/integration/_adapter.mjs +7 -5
- package/api/integration/integrationCheck.doc.mjs +1 -1
- package/api/integration/pack-check.mjs +8 -9
- package/api/integration/validate-integration.d.mts +1 -1
- package/api/integration/validate-integration.mjs +26 -24
- package/api/integration/validate-integration.type.d.mts +5 -2
- package/api/integration/validate-integration.type.mjs +5 -2
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.d.mts +4 -2
- package/api/render/_adapter.mjs +62 -21
- 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 +2 -2
- package/api/search/_candidate-score.d.mts +3 -0
- package/api/search/_candidate-score.mjs +36 -3
- 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/_named-keywords.d.mts +2 -1
- package/api/search/_named-keywords.mjs +48 -6
- package/api/search/_order.d.mts +36 -1
- package/api/search/_order.mjs +141 -3
- package/api/swizzle/list/list.mjs +8 -1
- package/api/swizzle/swizzle.type.d.mts +1 -1
- package/api/swizzle/swizzle.type.mjs +1 -1
- package/api/template/copy/copy.mjs +3 -4
- 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.d.mts +1 -0
- package/api/template/template.type.mjs +2 -1
- package/api/theme/_adapter.d.mts +1 -0
- package/api/theme/_adapter.mjs +3 -5
- package/api/theme/_app-provider.d.mts +42 -0
- package/api/theme/_app-provider.mjs +61 -27
- package/api/theme/build/build.d.mts +4 -10
- package/api/theme/build/build.mjs +165 -116
- 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/eject/eject.mjs +6 -1
- package/api/theme/palette/generate/generator.mjs +24 -0
- package/api/theme/theme.type.d.mts +4 -2
- package/api/theme/theme.type.mjs +3 -2
- package/api/theme/themeBuild.doc.mjs +2 -2
- 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 +120 -36
- package/api/theme-edit/_png.d.mts +24 -0
- package/api/theme-edit/_png.mjs +99 -0
- package/api/theme-edit/_preview-app.d.mts +16 -0
- package/api/theme-edit/_preview-app.mjs +52 -18
- package/api/theme-edit/_preview.d.mts +44 -26
- package/api/theme-edit/_preview.mjs +255 -67
- package/api/theme-edit/_project.d.mts +12 -1
- package/api/theme-edit/_project.mjs +16 -1
- package/api/theme-edit/_settings.d.mts +116 -0
- package/api/theme-edit/_settings.mjs +1197 -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 +15 -2
- package/api/theme-edit/theme-edit.type.mjs +8 -6
- package/api/upgrade/_adapter.d.mts +46 -7
- package/api/upgrade/_adapter.mjs +110 -15
- package/api/upgrade/registry/registry.d.mts +6 -3
- package/api/upgrade/registry/registry.mjs +21 -6
- package/api/upgrade/run/run.mjs +23 -11
- package/api/upgrade/upgrade.doc.mjs +4 -3
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/tree/agent-guidance.doc.mjs +3 -2
- 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 +6 -6
- package/assets/docs/tree/problems.doc.mjs +3 -3
- 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/troubleshooting.doc.mjs +8 -0
- package/assets/docs/tree/updates.doc.mjs +1 -1
- 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/CodeBlock/CodeBlockTerminal.tsx +1 -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/dashboard/page.tsx +24 -8
- package/assets/templates/pages/dashboard-alert-rail/page.tsx +4 -2
- package/assets/templates/pages/dashboard-cohort-funnel/page.tsx +7 -3
- package/assets/templates/pages/dashboard-comparison/page.tsx +5 -2
- package/assets/templates/pages/dashboard-composition/page.tsx +10 -4
- package/assets/templates/pages/dashboard-progress/page.tsx +6 -3
- package/assets/templates/pages/dashboard-scorecard/page.tsx +17 -8
- 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/table-grouped/page.tsx +23 -2
- package/assets/templates/pages/table-inbox/page.tsx +82 -32
- 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/codemod/parse.d.mts +0 -36
- package/authoring/codemod/parse.mjs +62 -41
- package/authoring/config/config.doc.mjs +1 -1
- package/authoring/config/parse.d.mts +0 -47
- package/authoring/config/parse.mjs +128 -103
- package/authoring/config/type.ts +4 -3
- package/authoring/debug/parse.d.mts +2 -2
- 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 +834 -950
- package/authoring/doctypes/_schema.mjs +863 -825
- package/authoring/doctypes/command/parse.mjs +2 -2
- package/authoring/doctypes/component/parse.mjs +2 -2
- package/authoring/doctypes/enum/parse.mjs +2 -2
- package/authoring/doctypes/hook/parse.mjs +2 -2
- package/authoring/doctypes/icon-definition/icon-definition.doc.mjs +1 -1
- package/authoring/doctypes/icon-definition/parse.d.mts +0 -24
- package/authoring/doctypes/icon-definition/parse.mjs +59 -43
- package/authoring/doctypes/icon-set/parse.d.mts +0 -75
- package/authoring/doctypes/icon-set/parse.mjs +239 -210
- package/authoring/doctypes/legacy.mjs +3 -3
- package/authoring/doctypes/namespace/parse.mjs +2 -2
- package/authoring/doctypes/reference/parse.mjs +2 -2
- package/authoring/doctypes/schema/parse.mjs +2 -2
- package/authoring/doctypes/template/parse.d.mts +0 -101
- package/authoring/doctypes/template/parse.mjs +131 -106
- package/authoring/doctypes/theme/parse.d.mts +0 -23
- package/authoring/doctypes/theme/parse.mjs +52 -36
- package/authoring/gap-report/parse.d.mts +1 -1
- package/authoring/integration/integration.doc.mjs +8 -0
- package/authoring/integration/schema.d.mts +14 -3
- package/authoring/integration/schema.mjs +20 -2
- package/authoring/integration/type.ts +14 -0
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/build.mjs +27 -13
- package/clients/cli/commands/component.mjs +14 -3
- package/clients/cli/commands/discover.doc.mjs +2 -2
- package/clients/cli/commands/discover.mjs +20 -3
- package/clients/cli/commands/docs.doc.mjs +11 -9
- package/clients/cli/commands/docs.mjs +50 -21
- package/clients/cli/commands/experimental/icon.mjs +330 -227
- 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-icon.doc.mjs +1 -1
- package/clients/cli/commands/experimental-render.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
- 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/integration-check.doc.mjs +1 -1
- 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-build.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +12 -2
- package/clients/cli/commands/upgrade.doc.mjs +3 -2
- package/clients/cli/commands.generated.json +1 -1
- package/clients/cli/formatters/index.mjs +52 -6
- package/clients/cli/index.mjs +23 -17
- package/clients/cli/lib/base-gate.mjs +37 -5
- 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/clients/cli/run.mjs +1 -1
- package/foundation/agent-docs/agent-docs.d.mts +49 -1
- package/foundation/agent-docs/agent-docs.mjs +108 -7
- package/foundation/agent-docs/computer-agent-text.mjs +1 -1
- package/foundation/bases/core.d.mts +1 -1
- package/foundation/bases/core.mjs +3 -3
- package/foundation/bases/resolve.d.mts +4 -8
- package/foundation/bases/resolve.mjs +15 -21
- package/foundation/bases/state.d.mts +15 -9
- package/foundation/bases/state.mjs +33 -6
- package/foundation/config/project.d.mts +5 -4
- package/foundation/config/project.mjs +33 -17
- package/foundation/discovery/component-discovery.mjs +15 -28
- 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 +28 -0
- package/foundation/discovery/icon-set-discovery.mjs +42 -0
- package/foundation/discovery/icon-set-writer.d.mts +2 -11
- package/foundation/discovery/icon-set-writer.mjs +3 -29
- package/foundation/discovery/module-exports.d.mts +1 -1
- package/foundation/discovery/module-exports.mjs +136 -33
- 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 +26 -54
- package/foundation/discovery/template-needs.d.mts +28 -2
- package/foundation/discovery/template-needs.mjs +92 -11
- package/foundation/discovery/theme-discovery.d.mts +8 -0
- package/foundation/discovery/theme-discovery.mjs +23 -6
- package/foundation/discovery/theme-imports.mjs +2 -4
- package/foundation/doc-compiler/parse-readable.mjs +4 -3
- package/foundation/doc-compiler/stored-docs.d.mts +13 -0
- package/foundation/doc-compiler/stored-docs.mjs +74 -3
- package/foundation/env/cli-command.d.mts +68 -10
- package/foundation/env/cli-command.mjs +116 -22
- package/foundation/env/project-scope.d.mts +9 -0
- package/foundation/env/project-scope.mjs +28 -2
- package/foundation/fs/gather-cache.d.mts +23 -0
- package/foundation/fs/gather-cache.mjs +94 -2
- package/foundation/fs/module-loader.d.mts +3 -1
- package/foundation/fs/module-loader.mjs +85 -5
- package/foundation/fs/read-record.mjs +9 -5
- package/foundation/identity/package-names.d.mts +18 -0
- package/foundation/identity/package-names.mjs +19 -0
- package/foundation/identity/providers.mjs +3 -2
- package/foundation/integrations/icon-features.d.mts +63 -0
- package/foundation/integrations/icon-features.mjs +54 -0
- package/foundation/integrations/integrations.d.mts +13 -1
- package/foundation/integrations/integrations.mjs +47 -6
- package/foundation/integrations/pack-state.d.mts +21 -0
- package/foundation/integrations/pack-state.mjs +42 -19
- package/foundation/integrations/validate-contributions.d.mts +11 -3
- package/foundation/integrations/validate-contributions.mjs +51 -13
- package/foundation/release/cache.d.mts +13 -1
- package/foundation/release/cache.mjs +94 -14
- package/foundation/release/notices.d.mts +15 -0
- package/foundation/release/notices.mjs +111 -7
- package/foundation/release/project.d.mts +3 -4
- package/foundation/release/project.mjs +5 -6
- package/foundation/render/client-bundle.d.mts +126 -0
- package/foundation/render/client-bundle.mjs +565 -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 +562 -86
- 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 +199 -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 +12 -12
- 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/foundation/text/icon-set-next.d.mts +25 -0
- package/foundation/text/icon-set-next.mjs +29 -0
- package/foundation/xle/browser.d.mts +2 -2
- package/package.json +7 -6
|
@@ -22,22 +22,24 @@ import {
|
|
|
22
22
|
requireIconTerm,
|
|
23
23
|
} from '../_options.mjs';
|
|
24
24
|
import {DEFAULT_ICON_LIMIT} from '../icon.mjs';
|
|
25
|
-
import {rankIconSets} from './search.mjs';
|
|
25
|
+
import {projectLooks, rankIconSets} from './search.mjs';
|
|
26
26
|
|
|
27
27
|
/**
|
|
28
|
-
* The part of a set the ranking reads, as plain JSON
|
|
29
|
-
*
|
|
30
|
-
* was made.
|
|
28
|
+
* The part of a set the ranking reads, as plain JSON, with the look the
|
|
29
|
+
* folder's project draws it in. Paths into the folder the set was read from
|
|
30
|
+
* are left out, so an index reads the same wherever it was made.
|
|
31
31
|
* @param {Awaited<ReturnType<typeof loadIconSets>>['sets'][number]} set
|
|
32
|
+
* @param {string | undefined} look
|
|
32
33
|
* @returns {import('../icon.type.mjs').IconIndexSet}
|
|
33
34
|
*/
|
|
34
|
-
function portableSet(set) {
|
|
35
|
+
function portableSet(set, look) {
|
|
35
36
|
return JSON.parse(
|
|
36
37
|
JSON.stringify({
|
|
37
38
|
name: set.name,
|
|
38
39
|
package: set.package,
|
|
39
40
|
data: set.data,
|
|
40
41
|
definitions: (set.definitions ?? []).map(each => ({doc: each.doc})),
|
|
42
|
+
...(look ? {look} : {}),
|
|
41
43
|
}),
|
|
42
44
|
);
|
|
43
45
|
}
|
|
@@ -63,12 +65,15 @@ export async function exportIconIndex(options = {}) {
|
|
|
63
65
|
ERROR_CODES.ERR_INVALID_ARGUMENT,
|
|
64
66
|
);
|
|
65
67
|
}
|
|
66
|
-
const {sets, withdrawn} = await loadIconSets(cwd);
|
|
68
|
+
const {sets, withdrawn, choice} = await loadIconSets(cwd);
|
|
69
|
+
const looks = projectLooks(choice);
|
|
67
70
|
/** @param {{package: string}} each */
|
|
68
71
|
const kept = each => owner == null || each.package === owner;
|
|
69
72
|
return {
|
|
70
73
|
version: cliVersion(),
|
|
71
|
-
sets: sets
|
|
74
|
+
sets: sets
|
|
75
|
+
.filter(kept)
|
|
76
|
+
.map(set => portableSet(set, looks[`${set.package}/${set.name}`])),
|
|
72
77
|
withdrawn: withdrawn
|
|
73
78
|
.filter(kept)
|
|
74
79
|
.map(({name, package: pkg, reason}) => ({name, package: pkg, reason})),
|
|
@@ -135,5 +140,10 @@ export async function rankIconIndex(query, indexes, options = {}) {
|
|
|
135
140
|
const ranked = /** @type {Parameters<typeof rankIconSets>[0]} */ (
|
|
136
141
|
/** @type {unknown} */ (sets)
|
|
137
142
|
);
|
|
138
|
-
|
|
143
|
+
/** @type {Record<string, string>} */
|
|
144
|
+
const looks = {};
|
|
145
|
+
for (const each of sets) {
|
|
146
|
+
if (each.look) looks[`${each.package}/${each.name}`] = each.look;
|
|
147
|
+
}
|
|
148
|
+
return rankIconSets(ranked, withdrawn, term, {set, limit, looks});
|
|
139
149
|
}
|
|
@@ -22,21 +22,44 @@ export function iconSearch(query: string, { cwd, set, limit }: {
|
|
|
22
22
|
set?: string;
|
|
23
23
|
limit: number;
|
|
24
24
|
}): Promise<import("../icon.type.mjs").IconSearchResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* The look each set in the project's list draws, by `<package>/<set>`: the
|
|
27
|
+
* look the project picks (`experimental.iconVariant`). Empty when it picks
|
|
28
|
+
* none. A set outside the list draws no project look.
|
|
29
|
+
* @param {import('../../../foundation/discovery/icon-set-discovery.mjs').IconSetChoice} choice
|
|
30
|
+
* @returns {Record<string, string>}
|
|
31
|
+
*/
|
|
32
|
+
export function projectLooks(choice: import("../../../foundation/discovery/icon-set-discovery.mjs").IconSetChoice): Record<string, string>;
|
|
25
33
|
/**
|
|
26
34
|
* Rank the icons of `sets` against a query: the one ranking behind both
|
|
27
|
-
* `icon()` and `rankIconIndex()`.
|
|
35
|
+
* `icon()` and `rankIconIndex()`. Each match's import draws the look `looks`
|
|
36
|
+
* names for its set when its icon has that look. With no set installed, not
|
|
37
|
+
* even a withdrawn one, the answer names the Astryx icon definitions that
|
|
38
|
+
* match, built-in ones first, and how to get a set.
|
|
28
39
|
* @param {Parameters<typeof rankIcons>[0]} sets in tie order
|
|
29
40
|
* @param {Array<{name: string, package: string, reason: string}>} withdrawn
|
|
30
41
|
* @param {string} query
|
|
31
|
-
* @param {{set?: string, limit: number}} options
|
|
42
|
+
* @param {{set?: string, limit: number, looks?: Record<string, string>}} options
|
|
43
|
+
* `looks`: the look each set draws, by `<package>/<set>`
|
|
32
44
|
* @returns {import('../icon.type.mjs').IconSearchResponse}
|
|
33
45
|
*/
|
|
34
46
|
export function rankIconSets(sets: Parameters<typeof rankIcons>[0], withdrawn: Array<{
|
|
35
47
|
name: string;
|
|
36
48
|
package: string;
|
|
37
49
|
reason: string;
|
|
38
|
-
}>, query: string, { set, limit }: {
|
|
50
|
+
}>, query: string, { set, limit, looks }: {
|
|
39
51
|
set?: string;
|
|
40
52
|
limit: number;
|
|
53
|
+
looks?: Record<string, string>;
|
|
41
54
|
}): import("../icon.type.mjs").IconSearchResponse;
|
|
55
|
+
/**
|
|
56
|
+
* The Astryx icon definitions that answer a query, each with its score,
|
|
57
|
+
* ranked as the search ranks a set's icons (FR6).
|
|
58
|
+
* @param {string} query
|
|
59
|
+
* @returns {Array<{doc: import('../../../authoring/doctypes/icon-definition/type').IconDefinitionDoc, score: number}>}
|
|
60
|
+
*/
|
|
61
|
+
export function definitionMatches(query: string): Array<{
|
|
62
|
+
doc: import("../../../authoring/doctypes/icon-definition/type").IconDefinitionDoc;
|
|
63
|
+
score: number;
|
|
64
|
+
}>;
|
|
42
65
|
import { rankIcons } from '../_records.mjs';
|
|
@@ -2,14 +2,22 @@
|
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @file `icon.search` leaf (AST-084 FR6): find icons by meaning across every
|
|
5
|
-
* installed set, ranked, with each match's import line.
|
|
5
|
+
* installed set, ranked, with each match's import line in the project's look.
|
|
6
6
|
*
|
|
7
7
|
* @input a query, an optional set selector, and a limit
|
|
8
8
|
* @output the `icon.search` envelope
|
|
9
9
|
* @position api/icon/search — dispatched by ../icon.mjs
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
astryxIconDefinitions,
|
|
14
|
+
iconLookExport,
|
|
15
|
+
iconSetKey,
|
|
16
|
+
importLine,
|
|
17
|
+
loadIconSets,
|
|
18
|
+
missingIconLook,
|
|
19
|
+
noIconSetNext,
|
|
20
|
+
} from '../_adapter.mjs';
|
|
13
21
|
import {
|
|
14
22
|
answeringMatches,
|
|
15
23
|
oneNamedSet,
|
|
@@ -57,26 +65,53 @@ export async function iconSetIcons({cwd, set}) {
|
|
|
57
65
|
* @returns {Promise<import('../icon.type.mjs').IconSearchResponse>}
|
|
58
66
|
*/
|
|
59
67
|
export async function iconSearch(query, {cwd, set, limit}) {
|
|
60
|
-
const {sets, withdrawn} = await loadIconSets(cwd);
|
|
61
|
-
return rankIconSets(sets, withdrawn, query, {
|
|
68
|
+
const {sets, withdrawn, choice} = await loadIconSets(cwd);
|
|
69
|
+
return rankIconSets(sets, withdrawn, query, {
|
|
70
|
+
set,
|
|
71
|
+
limit,
|
|
72
|
+
looks: projectLooks(choice),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* The look each set in the project's list draws, by `<package>/<set>`: the
|
|
78
|
+
* look the project picks (`experimental.iconVariant`). Empty when it picks
|
|
79
|
+
* none. A set outside the list draws no project look.
|
|
80
|
+
* @param {import('../../../foundation/discovery/icon-set-discovery.mjs').IconSetChoice} choice
|
|
81
|
+
* @returns {Record<string, string>}
|
|
82
|
+
*/
|
|
83
|
+
export function projectLooks(choice) {
|
|
84
|
+
const variant = choice.variant;
|
|
85
|
+
if (!variant) return {};
|
|
86
|
+
return Object.fromEntries(
|
|
87
|
+
(choice.order ?? []).map(set => [iconSetKey(set), variant]),
|
|
88
|
+
);
|
|
62
89
|
}
|
|
63
90
|
|
|
64
91
|
/**
|
|
65
92
|
* Rank the icons of `sets` against a query: the one ranking behind both
|
|
66
|
-
* `icon()` and `rankIconIndex()`.
|
|
93
|
+
* `icon()` and `rankIconIndex()`. Each match's import draws the look `looks`
|
|
94
|
+
* names for its set when its icon has that look. With no set installed, not
|
|
95
|
+
* even a withdrawn one, the answer names the Astryx icon definitions that
|
|
96
|
+
* match, built-in ones first, and how to get a set.
|
|
67
97
|
* @param {Parameters<typeof rankIcons>[0]} sets in tie order
|
|
68
98
|
* @param {Array<{name: string, package: string, reason: string}>} withdrawn
|
|
69
99
|
* @param {string} query
|
|
70
|
-
* @param {{set?: string, limit: number}} options
|
|
100
|
+
* @param {{set?: string, limit: number, looks?: Record<string, string>}} options
|
|
101
|
+
* `looks`: the look each set draws, by `<package>/<set>`
|
|
71
102
|
* @returns {import('../icon.type.mjs').IconSearchResponse}
|
|
72
103
|
*/
|
|
73
|
-
export function rankIconSets(sets, withdrawn, query, {set, limit}) {
|
|
104
|
+
export function rankIconSets(sets, withdrawn, query, {set, limit, looks = {}}) {
|
|
74
105
|
let searched = sets;
|
|
75
106
|
if (set != null) {
|
|
76
107
|
searched = setsNamed(sets, set);
|
|
77
108
|
if (searched.length === 0) throw unusableSet(sets, withdrawn, set);
|
|
78
109
|
}
|
|
79
|
-
|
|
110
|
+
// A withdrawn set is installed: `--list` says why it cannot be used.
|
|
111
|
+
if (sets.length === 0 && withdrawn.length === 0) {
|
|
112
|
+
return noIconSet(query, limit);
|
|
113
|
+
}
|
|
114
|
+
const ranked = rankIcons(searched, query, {words: true});
|
|
80
115
|
// A word start (`start` for `star`) answers only when nothing matches a
|
|
81
116
|
// whole word, and a partial match (`pin` inside `shopping`) only when
|
|
82
117
|
// nothing matches a whole word or a word start.
|
|
@@ -86,7 +121,118 @@ export function rankIconSets(sets, withdrawn, query, {set, limit}) {
|
|
|
86
121
|
data: {
|
|
87
122
|
query: query.trim(),
|
|
88
123
|
matchCount: matches.length,
|
|
89
|
-
matches: matches
|
|
124
|
+
matches: matches
|
|
125
|
+
.slice(0, limit)
|
|
126
|
+
.map(match => inLook(match, searched, looks)),
|
|
127
|
+
},
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* A match drawn in its set's look: its export and import name the icon's
|
|
133
|
+
* variant of that look, or keep its own export with `look` saying which
|
|
134
|
+
* look it draws instead. A match whose set draws no look stays as it is.
|
|
135
|
+
* @param {import('../icon.type.mjs').IconMatchEntry} match
|
|
136
|
+
* @param {Parameters<typeof rankIcons>[0]} sets
|
|
137
|
+
* @param {Record<string, string>} looks
|
|
138
|
+
* @returns {import('../icon.type.mjs').IconMatchEntry}
|
|
139
|
+
*/
|
|
140
|
+
function inLook(match, sets, looks) {
|
|
141
|
+
const variant = looks[`${match.package}/${match.set}`];
|
|
142
|
+
if (!variant) return match;
|
|
143
|
+
const set = sets.find(
|
|
144
|
+
each => each.package === match.package && each.name === match.set,
|
|
145
|
+
);
|
|
146
|
+
const icon = set?.data.icons.find(each => each.id === match.id);
|
|
147
|
+
if (!set || !icon) return match;
|
|
148
|
+
const drawn = iconLookExport(icon, set, variant);
|
|
149
|
+
const look = missingIconLook(icon, set, variant);
|
|
150
|
+
return {
|
|
151
|
+
...match,
|
|
152
|
+
module: drawn.module,
|
|
153
|
+
export: drawn.export,
|
|
154
|
+
import: importLine(drawn.export, drawn.module),
|
|
155
|
+
...(look ? {look} : {}),
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* The answer when no icon set is installed: no icon matches, so it names
|
|
160
|
+
* the Astryx icon definitions that do, built-in ones first (Core draws those
|
|
161
|
+
* by name with no set), and how to get a set.
|
|
162
|
+
* @param {string} query
|
|
163
|
+
* @param {number} limit
|
|
164
|
+
* @returns {import('../icon.type.mjs').IconSearchResponse}
|
|
165
|
+
*/
|
|
166
|
+
function noIconSet(query, limit) {
|
|
167
|
+
const found = definitionMatches(query).map(match => match.doc);
|
|
168
|
+
const ordered = [
|
|
169
|
+
...found.filter(doc => doc.builtIn),
|
|
170
|
+
...found.filter(doc => !doc.builtIn),
|
|
171
|
+
];
|
|
172
|
+
return {
|
|
173
|
+
type: 'icon.search',
|
|
174
|
+
data: {
|
|
175
|
+
query: query.trim(),
|
|
176
|
+
matchCount: 0,
|
|
177
|
+
matches: [],
|
|
178
|
+
reason: 'No icon set is installed.',
|
|
179
|
+
definitions: ordered.slice(0, limit).map(doc => ({
|
|
180
|
+
name: doc.name,
|
|
181
|
+
builtIn: doc.builtIn === true,
|
|
182
|
+
description: doc.description,
|
|
183
|
+
})),
|
|
184
|
+
next: noIconSetNext(),
|
|
90
185
|
},
|
|
91
186
|
};
|
|
92
187
|
}
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* The Astryx icon definitions that answer a query, each with its score,
|
|
191
|
+
* ranked as the search ranks a set's icons (FR6).
|
|
192
|
+
* @param {string} query
|
|
193
|
+
* @returns {Array<{doc: import('../../../authoring/doctypes/icon-definition/type').IconDefinitionDoc, score: number}>}
|
|
194
|
+
*/
|
|
195
|
+
export function definitionMatches(query) {
|
|
196
|
+
const docs = astryxIconDefinitions().definitions.map(each => each.doc);
|
|
197
|
+
const byId = new Map(docs.map(doc => [definitionId(doc.name), doc]));
|
|
198
|
+
return answeringMatches(
|
|
199
|
+
rankIcons([definitionSet(docs)], query, {words: true}),
|
|
200
|
+
).map(match => ({
|
|
201
|
+
doc: /** @type {(typeof docs)[number]} */ (byId.get(match.id)),
|
|
202
|
+
score: match.score,
|
|
203
|
+
}));
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* A definition's name as an icon id: `chevronDown` is `chevron-down`.
|
|
208
|
+
* @param {string} name
|
|
209
|
+
*/
|
|
210
|
+
const definitionId = name =>
|
|
211
|
+
name.replace(/([a-z0-9])([A-Z])/gu, '$1-$2').toLowerCase();
|
|
212
|
+
|
|
213
|
+
/**
|
|
214
|
+
* Astryx's icon definitions read as one set whose `map` names one icon for
|
|
215
|
+
* each definition, so the icon ranking finds a definition by its name, its
|
|
216
|
+
* name as words, and its own words, exactly as it finds a set's icon.
|
|
217
|
+
* @param {import('../../../authoring/doctypes/icon-definition/type').IconDefinitionDoc[]} docs
|
|
218
|
+
* @returns {import('../../../foundation/discovery/icon-set-discovery.mjs').DiscoveredIconSet}
|
|
219
|
+
*/
|
|
220
|
+
function definitionSet(docs) {
|
|
221
|
+
return /** @type {any} */ ({
|
|
222
|
+
name: 'definitions',
|
|
223
|
+
package: '@astryxdesign/cli',
|
|
224
|
+
definitions: [],
|
|
225
|
+
data: {
|
|
226
|
+
schemaVersion: 1,
|
|
227
|
+
module: '@astryxdesign/cli',
|
|
228
|
+
map: Object.fromEntries(
|
|
229
|
+
docs.map(doc => [doc.name, definitionId(doc.name)]),
|
|
230
|
+
),
|
|
231
|
+
icons: docs.map(doc => ({
|
|
232
|
+
id: definitionId(doc.name),
|
|
233
|
+
export: doc.name,
|
|
234
|
+
words: [],
|
|
235
|
+
})),
|
|
236
|
+
},
|
|
237
|
+
});
|
|
238
|
+
}
|
package/api/init/_adapter.d.mts
CHANGED
|
@@ -16,7 +16,21 @@ export function applyComputerAgentText({ remove }: {
|
|
|
16
16
|
files: import("./init.type.mjs").InitUserFile[];
|
|
17
17
|
cliOnSearchPath: boolean;
|
|
18
18
|
};
|
|
19
|
+
/**
|
|
20
|
+
* The install step to print for `packages` in the project at `cwd`: the
|
|
21
|
+
* install guidance its integrations give, else its package manager's command,
|
|
22
|
+
* or `npm install` with a note when its lockfiles disagree.
|
|
23
|
+
* @param {string[]} packages
|
|
24
|
+
* @param {string} cwd
|
|
25
|
+
* @returns {{line: string, note: string | null}}
|
|
26
|
+
*/
|
|
27
|
+
export function projectInstallStep(packages: string[], cwd: string): {
|
|
28
|
+
line: string;
|
|
29
|
+
note: string | null;
|
|
30
|
+
};
|
|
31
|
+
export { STARTER_THEME } from "../../foundation/discovery/theme-discovery.mjs";
|
|
19
32
|
import { COMPUTER_COMMAND } from '../../foundation/agent-docs/computer-agent-text.mjs';
|
|
20
33
|
import { COMPUTER_INSTALL_STEP } from '../../foundation/agent-docs/computer-agent-text.mjs';
|
|
21
34
|
import { displayHomePath } from '../../foundation/agent-docs/computer-agent-text.mjs';
|
|
22
35
|
export { COMPUTER_COMMAND, COMPUTER_INSTALL_STEP, displayHomePath };
|
|
36
|
+
export { inspectAgentDocs, resolveAgentPaths } from "../../foundation/agent-docs/agent-docs.mjs";
|
package/api/init/_adapter.mjs
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* @file Environment adapter for `init --user
|
|
5
|
-
* file, the per-user state, and the search path (spec AST-081 FR7,
|
|
6
|
-
*
|
|
4
|
+
* @file Environment adapter for init: for `init --user`, the home folder, the
|
|
5
|
+
* settings file, the per-user state, and the search path (spec AST-081 FR7,
|
|
6
|
+
* FR8); for the getting-started steps, the project's install command
|
|
7
|
+
* (architecture:cli-surface INV21).
|
|
7
8
|
*
|
|
8
9
|
* @input the home folder, the settings file, the search path
|
|
9
10
|
* @output the computer-level agent text written or removed, with the setting
|
|
10
11
|
* and the links recorded
|
|
11
|
-
* @position packages/cli/api/init — imported by the user
|
|
12
|
+
* @position packages/cli/api/init — imported by the user and run leaves
|
|
12
13
|
*/
|
|
13
14
|
|
|
14
15
|
import * as os from 'node:os';
|
|
@@ -27,9 +28,18 @@ import {
|
|
|
27
28
|
} from '../../foundation/env/user-settings.mjs';
|
|
28
29
|
import {recordAgentTextWritten} from '../../foundation/release/global-state.mjs';
|
|
29
30
|
import {cliVersion} from '../../foundation/release/run-context.mjs';
|
|
31
|
+
import {installStepFor} from '../../foundation/discovery/template-needs.mjs';
|
|
32
|
+
export {STARTER_THEME} from '../../foundation/discovery/theme-discovery.mjs';
|
|
30
33
|
|
|
31
34
|
export {COMPUTER_COMMAND, COMPUTER_INSTALL_STEP, displayHomePath};
|
|
32
35
|
|
|
36
|
+
// What the run leaf reads before it writes agent docs: the state of the files
|
|
37
|
+
// it is about to write.
|
|
38
|
+
export {
|
|
39
|
+
inspectAgentDocs,
|
|
40
|
+
resolveAgentPaths,
|
|
41
|
+
} from '../../foundation/agent-docs/agent-docs.mjs';
|
|
42
|
+
|
|
33
43
|
/**
|
|
34
44
|
* Write or refresh the computer-level agent text, or remove it, and record
|
|
35
45
|
* the setting and the links Astryx made; after a write, record the release
|
|
@@ -57,3 +67,15 @@ export function applyComputerAgentText({remove}) {
|
|
|
57
67
|
}
|
|
58
68
|
return {home, command, files, cliOnSearchPath: astryxOnSearchPath()};
|
|
59
69
|
}
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* The install step to print for `packages` in the project at `cwd`: the
|
|
73
|
+
* install guidance its integrations give, else its package manager's command,
|
|
74
|
+
* or `npm install` with a note when its lockfiles disagree.
|
|
75
|
+
* @param {string[]} packages
|
|
76
|
+
* @param {string} cwd
|
|
77
|
+
* @returns {{line: string, note: string | null}}
|
|
78
|
+
*/
|
|
79
|
+
export function projectInstallStep(packages, cwd) {
|
|
80
|
+
return installStepFor(packages, cwd);
|
|
81
|
+
}
|
package/api/init/init.d.mts
CHANGED
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
export function init(options?: InitOptions, { cwd }?: {
|
|
25
25
|
cwd?: string;
|
|
26
26
|
}): Promise<import("./init.type.mjs").InitRunResponse | import("./init.type.mjs").InitRemoveResponse | import("./init.type.mjs").InitUserResponse>;
|
|
27
|
-
export { getNextSteps } from "./run/run.mjs";
|
|
28
27
|
/**
|
|
29
28
|
* Re-exported types so callers can keep referencing them off the init barrel
|
|
30
29
|
* (e.g. cli/commands/init.mjs uses `import('../../api/init/init.mjs').InitOptions`).
|
|
@@ -37,3 +36,4 @@ export type InitOptions = import("./init.type.mjs").InitOptions;
|
|
|
37
36
|
* The canonical shapes stay colocated in api/init/init.type.mjs.
|
|
38
37
|
*/
|
|
39
38
|
export type InitRunData = import("./init.type.mjs").InitRunData;
|
|
39
|
+
export { getNextSteps, getWorkflowSteps } from "./run/run.mjs";
|
package/api/init/init.doc.mjs
CHANGED
|
@@ -30,7 +30,7 @@ export const doc = {
|
|
|
30
30
|
'counts as a project, even with a package.json; a folder below it with a package.json does. ' +
|
|
31
31
|
'The managed block is Astryx-owned: it is written, refreshed, and removed whatever ignore rules ' +
|
|
32
32
|
'or generated markers say, and the text around it is never changed. It then ' +
|
|
33
|
-
"prints getting-started guidance; `features` / `all` print only the chosen features' " +
|
|
33
|
+
"prints getting-started guidance (the build and search commands instead when every agent-docs block was already current, since the app is set up; an outdated block is still refreshed); `features` / `all` print only the chosen features' " +
|
|
34
34
|
'guidance instead (the theme feature also writes the annotated theme template). ' +
|
|
35
35
|
'With `removeAgents` it removes the managed agent-docs block, at the project root and in `ctx.cwd`, instead of installing. ' +
|
|
36
36
|
'Outside a project it writes the same files but prints no getting-started steps and no step that adds a theme to an app, since those set up a project the folder does not have. ' +
|
|
@@ -100,7 +100,7 @@ export const doc = {
|
|
|
100
100
|
{
|
|
101
101
|
type: 'init.run',
|
|
102
102
|
description:
|
|
103
|
-
'The install receipt: the `mode` (`default` | `features`), the features run, agent-doc files written, any soft docsError, the theme-template outcome (`created` | `skipped` | `failed`) plus its path, the page-template outcome (`workflow` | `created` | `skipped`) plus its path, and whether the next-steps were emitted (never outside a project).',
|
|
103
|
+
'The install receipt: the `mode` (`default` | `features`), the features run, agent-doc files written, `agentDocsStatus` (the agent docs before the write: `missing` | `stale` | `current`; null when agent docs were not installed or the write failed), what changed in each (`docsChanges`: `{path, change, from, to}`, change `created` | `updated` | `unchanged` | `removed`, from and to the Astryx versions the block names, path relative to the project root), any soft docsError, the theme-template outcome (`created` | `skipped` | `failed`) plus its path, the page-template outcome (`workflow` | `created` | `skipped`) plus its path, and whether the next-steps were emitted (never outside a project, and not when `agentDocsStatus` was `current`: a set-up app gets the build and search commands instead).',
|
|
104
104
|
},
|
|
105
105
|
{
|
|
106
106
|
type: 'init.remove',
|
package/api/init/init.mjs
CHANGED
|
@@ -25,7 +25,7 @@ import {user} from './user/user.mjs';
|
|
|
25
25
|
import {AstryxError} from '../error.mjs';
|
|
26
26
|
import {ERROR_CODES} from '../../foundation/response/error-codes.mjs';
|
|
27
27
|
|
|
28
|
-
export {getNextSteps} from './run/run.mjs';
|
|
28
|
+
export {getNextSteps, getWorkflowSteps} from './run/run.mjs';
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
* Re-exported types so callers can keep referencing them off the init barrel
|
package/api/init/init.type.d.mts
CHANGED
|
@@ -1,6 +1,26 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* What init did to one agent-doc file. `created`: the file did not exist.
|
|
6
|
+
* `updated`: its text changed. `unchanged`: it already held this text.
|
|
7
|
+
* `removed`: its Astryx block was removed, because another file holds it.
|
|
8
|
+
*/
|
|
9
|
+
export type InitDocsChange = {
|
|
10
|
+
/**
|
|
11
|
+
* The file, relative to the project root (the folder init writes agent docs in), `--agent-docs-path` files included. Never absolute.
|
|
12
|
+
*/
|
|
13
|
+
path: string;
|
|
14
|
+
change: "created" | "updated" | "unchanged" | "removed";
|
|
15
|
+
/**
|
|
16
|
+
* The Astryx version the block named before; null on `created`, and when there was no block or no version line.
|
|
17
|
+
*/
|
|
18
|
+
from: string | null;
|
|
19
|
+
/**
|
|
20
|
+
* The Astryx version the block names now; null on `removed`, and when there is no block (such as an import of AGENTS.md).
|
|
21
|
+
*/
|
|
22
|
+
to: string | null;
|
|
23
|
+
};
|
|
4
24
|
export type InitRunData = {
|
|
5
25
|
/**
|
|
6
26
|
* `default` (no flags) or `features` (--features/--all).
|
|
@@ -14,6 +34,14 @@ export type InitRunData = {
|
|
|
14
34
|
* Agent-doc files written, relative to the directory init ran in (empty if agents weren't run or install failed). Without --agent-docs-path they sit at the project root: the nearest folder at or above it whose package.json declares an Astryx package, else the nearest with any package.json, within its repository and never the home folder; with none, the directory init ran in.
|
|
15
35
|
*/
|
|
16
36
|
docsWritten: string[];
|
|
37
|
+
/**
|
|
38
|
+
* The agent docs init writes, before this run: `missing` (no Astryx block), `stale` (a block from another release or with other text, or with `--agent-docs-path` a named file without the block), or `current` (every block already matches); null when agent docs were not installed or the write failed.
|
|
39
|
+
*/
|
|
40
|
+
agentDocsStatus: "missing" | "stale" | "current" | null;
|
|
41
|
+
/**
|
|
42
|
+
* What init did to each file in `docsWritten`, in the same order; each path is relative to the project root.
|
|
43
|
+
*/
|
|
44
|
+
docsChanges: InitDocsChange[];
|
|
17
45
|
/**
|
|
18
46
|
* Soft agent-docs failure, if any. `path-safety` also implies a non-zero exit. `install-failed` carries a message when init wrote no agent docs (the home folder, or a settings folder in it outside a project) or skipped a file that resolves outside the project; docsWritten then lists what was written.
|
|
19
47
|
*/
|
|
@@ -42,7 +70,7 @@ export type InitRunData = {
|
|
|
42
70
|
*/
|
|
43
71
|
templatePath: string | null;
|
|
44
72
|
/**
|
|
45
|
-
* Whether the getting-started "Next steps" were emitted (default mode inside a project; false outside one).
|
|
73
|
+
* Whether the getting-started "Next steps" were emitted (default mode inside a project; false outside one, and false when `agentDocsStatus` is `current`, where init prints the build and search commands instead).
|
|
46
74
|
*/
|
|
47
75
|
nextSteps: boolean;
|
|
48
76
|
};
|
package/api/init/init.type.mjs
CHANGED
|
@@ -6,18 +6,31 @@
|
|
|
6
6
|
* `./api` type surface regenerates from this JSDoc.
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* What init did to one agent-doc file. `created`: the file did not exist.
|
|
11
|
+
* `updated`: its text changed. `unchanged`: it already held this text.
|
|
12
|
+
* `removed`: its Astryx block was removed, because another file holds it.
|
|
13
|
+
* @typedef {object} InitDocsChange
|
|
14
|
+
* @property {string} path The file, relative to the project root (the folder init writes agent docs in), `--agent-docs-path` files included. Never absolute.
|
|
15
|
+
* @property {'created' | 'updated' | 'unchanged' | 'removed'} change
|
|
16
|
+
* @property {string | null} from The Astryx version the block named before; null on `created`, and when there was no block or no version line.
|
|
17
|
+
* @property {string | null} to The Astryx version the block names now; null on `removed`, and when there is no block (such as an import of AGENTS.md).
|
|
18
|
+
*/
|
|
19
|
+
|
|
9
20
|
/**
|
|
10
21
|
* @typedef {object} InitRunData
|
|
11
22
|
* @property {'default' | 'features'} mode `default` (no flags) or `features` (--features/--all).
|
|
12
23
|
* @property {string[]} features Features that were run, in order.
|
|
13
24
|
* @property {string[]} docsWritten Agent-doc files written, relative to the directory init ran in (empty if agents weren't run or install failed). Without --agent-docs-path they sit at the project root: the nearest folder at or above it whose package.json declares an Astryx package, else the nearest with any package.json, within its repository and never the home folder; with none, the directory init ran in.
|
|
25
|
+
* @property {'missing' | 'stale' | 'current' | null} agentDocsStatus The agent docs init writes, before this run: `missing` (no Astryx block), `stale` (a block from another release or with other text, or with `--agent-docs-path` a named file without the block), or `current` (every block already matches); null when agent docs were not installed or the write failed.
|
|
26
|
+
* @property {InitDocsChange[]} docsChanges What init did to each file in `docsWritten`, in the same order; each path is relative to the project root.
|
|
14
27
|
* @property {{kind: 'path-safety' | 'install-failed', message?: string} | null} docsError Soft agent-docs failure, if any. `path-safety` also implies a non-zero exit. `install-failed` carries a message when init wrote no agent docs (the home folder, or a settings folder in it outside a project) or skipped a file that resolves outside the project; docsWritten then lists what was written.
|
|
15
28
|
* @property {boolean} theme Whether the theme feature ran.
|
|
16
29
|
* @property {'created' | 'skipped' | 'failed' | null} themeTemplate Outcome of writing the annotated theme template (`skipped` = a file was already there).
|
|
17
30
|
* @property {string | null} themeTemplatePath Relative output path when `themeTemplate === 'created'`.
|
|
18
31
|
* @property {'workflow' | 'created' | 'skipped' | null} template Template outcome (`workflow` is the CLI default; `created`/`skipped` are programmatic).
|
|
19
32
|
* @property {string | null} templatePath Relative output path when `template === 'created'`.
|
|
20
|
-
* @property {boolean} nextSteps Whether the getting-started "Next steps" were emitted (default mode inside a project; false outside one).
|
|
33
|
+
* @property {boolean} nextSteps Whether the getting-started "Next steps" were emitted (default mode inside a project; false outside one, and false when `agentDocsStatus` is `current`, where init prints the build and search commands instead).
|
|
21
34
|
*/
|
|
22
35
|
|
|
23
36
|
/**
|
package/api/init/run/run.d.mts
CHANGED
|
@@ -9,9 +9,19 @@
|
|
|
9
9
|
* app imports that module once and passes its default to <Theme>.
|
|
10
10
|
*
|
|
11
11
|
* @param {string} invocation install-aware CLI invocation stem (e.g. `pnpm exec astryx`, `yarn astryx`, or `npx @astryxdesign/cli` for one-off runs)
|
|
12
|
+
* @param {string} [cwd] the project folder; its integrations' install guidance, else its package manager, names the theme install step
|
|
12
13
|
* @returns {string[]} ordered list of human-facing lines
|
|
13
14
|
*/
|
|
14
|
-
export function getNextSteps(invocation: string): string[];
|
|
15
|
+
export function getNextSteps(invocation: string, cwd?: string): string[];
|
|
16
|
+
/**
|
|
17
|
+
* The lines printed instead of "Next steps" when the project's agent files
|
|
18
|
+
* already held the Astryx block: the app is set up, so it needs the commands
|
|
19
|
+
* to build with, not the install steps.
|
|
20
|
+
*
|
|
21
|
+
* @param {string} invocation install-aware CLI invocation stem
|
|
22
|
+
* @returns {string[]} ordered list of human-facing lines
|
|
23
|
+
*/
|
|
24
|
+
export function getWorkflowSteps(invocation: string): string[];
|
|
15
25
|
/**
|
|
16
26
|
* Run the install path of the non-interactive init flow (the default no-flags
|
|
17
27
|
* install plus `--features` / `--all`). Performs the side effects (agent-docs
|