@astryxdesign/cli 0.7.16 → 0.7.17-canary.g0135e03
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 +76 -86
- package/api/build/_adapter.d.mts +12 -0
- package/api/build/_adapter.mjs +51 -34
- package/api/build/blocks/blocks.d.mts +7 -5
- package/api/build/blocks/blocks.mjs +113 -26
- package/api/build/build.doc.mjs +4 -3
- package/api/build/build.type.d.mts +2 -2
- package/api/build/build.type.mjs +3 -3
- package/api/build/kit/kind.d.mts +2 -1
- package/api/build/kit/kind.mjs +199 -10
- package/api/build/kit/kit.mjs +6 -4
- package/api/build/kit/rank.d.mts +4 -2
- package/api/build/kit/rank.mjs +125 -24
- package/api/build/kit/start.d.mts +5 -4
- package/api/build/kit/start.mjs +12 -8
- package/api/build/kit/weights.d.mts +39 -3
- package/api/build/kit/weights.json +1 -1
- package/api/build/kit/weights.mjs +340 -43
- package/api/build/kit/word-model.d.mts +23 -0
- package/api/build/kit/word-model.mjs +46 -0
- package/api/build/kit/words.d.mts +48 -0
- package/api/build/kit/words.mjs +90 -1
- package/api/component/__fixtures__/resolutions/modules.txt +4 -5
- package/api/component/list/list.d.mts +1 -1
- package/api/component/list/list.mjs +48 -6
- package/api/discover/_adapter.d.mts +1 -1
- package/api/discover/search/search.mjs +3 -2
- package/api/docs/_adapter.d.mts +26 -2
- package/api/docs/_adapter.mjs +219 -6
- package/api/docs/docs.d.mts +3 -0
- package/api/docs/docs.doc.mjs +7 -1
- package/api/docs/docs.mjs +12 -0
- package/api/docs/docs.type.d.mts +5 -0
- package/api/docs/docs.type.mjs +2 -0
- package/api/docs/node/node.mjs +1 -1
- package/api/doctor/_adapter.d.mts +27 -5
- package/api/doctor/_adapter.mjs +83 -10
- package/api/doctor/built-checks.mjs +40 -14
- package/api/doctor/doctor.d.mts +4 -3
- package/api/doctor/doctor.mjs +14 -7
- package/api/doctor/theme-checks.mjs +121 -17
- package/api/icon/_records.mjs +2 -1
- package/api/index.d.mts +2 -0
- package/api/index.mjs +2 -0
- package/api/integration/_adapter.d.mts +44 -0
- package/api/integration/_adapter.mjs +77 -1
- package/api/integration/authoring-checks.mjs +6 -6
- package/api/integration/example-scope.d.mts +14 -0
- package/api/integration/example-scope.mjs +44 -0
- package/api/integration/example-scope.type.d.mts +29 -0
- package/api/integration/example-scope.type.mjs +25 -0
- package/api/integration/integrationExampleScope.doc.d.mts +11 -0
- package/api/integration/integrationExampleScope.doc.mjs +59 -0
- package/api/integration/validate-integration.mjs +19 -1
- package/api/integration/validate-integration.type.d.mts +9 -0
- package/api/integration/validate-integration.type.mjs +1 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/render/_adapter.mjs +591 -195
- package/api/render/render.doc.mjs +11 -3
- package/api/render/render.type.d.mts +52 -0
- package/api/render/render.type.mjs +31 -1
- package/api/search/ORDERING.md +1 -1
- package/api/search/_adapter.d.mts +9 -0
- package/api/search/_adapter.mjs +85 -0
- package/api/search/_candidate-score.mjs +51 -32
- package/api/search/_fit-order.mjs +3 -3
- package/api/search/_gather-components.d.mts +3 -2
- package/api/search/_gather-components.mjs +12 -3
- package/api/search/_lexical.d.mts +5 -0
- package/api/search/_lexical.mjs +8 -2
- package/api/search/_result.d.mts +11 -9
- package/api/search/_result.mjs +4 -4
- package/api/search/_score.d.mts +6 -1
- package/api/search/_score.mjs +15 -3
- package/api/search/search-index.mjs +7 -1
- package/api/search/search.d.mts +1 -1
- package/api/theme/_adapter.mjs +12 -1
- package/api/theme/build/build.d.mts +122 -1
- package/api/theme/build/build.mjs +412 -84
- package/api/theme/build/core-interception.d.mts +10 -0
- package/api/theme/build/core-interception.mjs +10 -0
- package/api/theme/build/font-warning.d.mts +23 -3
- package/api/theme/build/font-warning.mjs +54 -5
- package/api/theme/build/icon-imports.mjs +25 -2
- package/api/theme/theme.type.d.mts +10 -0
- package/api/theme/theme.type.mjs +7 -1
- package/api/theme-edit/_adapter.d.mts +103 -3
- package/api/theme-edit/_adapter.mjs +961 -82
- package/api/theme-edit/_catalog.mjs +19 -4
- package/api/theme-edit/_check.d.mts +63 -24
- package/api/theme-edit/_check.mjs +2467 -362
- package/api/theme-edit/_color.d.mts +10 -0
- package/api/theme-edit/_color.mjs +49 -1
- package/api/theme-edit/_compiler.mjs +89 -6
- package/api/theme-edit/_context.d.mts +3 -3
- package/api/theme-edit/_context.mjs +165 -54
- package/api/theme-edit/_css.d.mts +14 -0
- package/api/theme-edit/_css.mjs +46 -1
- package/api/theme-edit/_edit.d.mts +31 -4
- package/api/theme-edit/_edit.mjs +2433 -204
- package/api/theme-edit/_how-commands.d.mts +72 -1
- package/api/theme-edit/_how-commands.mjs +759 -9
- package/api/theme-edit/_how-question.d.mts +82 -5
- package/api/theme-edit/_how-question.mjs +6473 -553
- package/api/theme-edit/_how.d.mts +2 -1
- package/api/theme-edit/_how.mjs +237 -41
- package/api/theme-edit/_marks.d.mts +31 -5
- package/api/theme-edit/_marks.mjs +57 -5
- package/api/theme-edit/_name-rule.d.mts +11 -0
- package/api/theme-edit/_name-rule.mjs +12 -0
- package/api/theme-edit/_normal.d.mts +292 -0
- package/api/theme-edit/_normal.mjs +1454 -0
- package/api/theme-edit/_palette.mjs +10 -4
- package/api/theme-edit/_part-words.d.mts +31 -0
- package/api/theme-edit/_part-words.mjs +126 -0
- package/api/theme-edit/_parts.d.mts +18 -1
- package/api/theme-edit/_parts.mjs +246 -23
- package/api/theme-edit/_preview-app.d.mts +7 -1
- package/api/theme-edit/_preview-app.mjs +776 -187
- package/api/theme-edit/_preview.d.mts +100 -14
- package/api/theme-edit/_preview.mjs +582 -139
- package/api/theme-edit/_project.d.mts +4 -0
- package/api/theme-edit/_project.mjs +3 -1
- package/api/theme-edit/_settings.d.mts +417 -42
- package/api/theme-edit/_settings.mjs +3262 -424
- package/api/theme-edit/_tables.d.mts +15 -0
- package/api/theme-edit/_tables.mjs +63 -1
- package/api/theme-edit/_vet.d.mts +20 -0
- package/api/theme-edit/_vet.mjs +47 -2
- package/api/theme-edit/theme-edit.type.d.mts +10 -1
- package/api/theme-edit/theme-edit.type.mjs +4 -1
- package/api/theme-edit/themeEditHow.doc.mjs +1 -1
- package/api/theme-edit/themeEditNew.doc.d.mts +0 -1
- package/api/theme-edit/themeEditNew.doc.mjs +7 -4
- package/api/theme-edit/themeEditPreviewApp.doc.mjs +3 -3
- package/api/theme-edit/themeEditPreviewRemove.doc.mjs +2 -2
- package/api/upgrade/run/run.mjs +4 -3
- package/assets/codemods/integration-discovery.mjs +2 -1
- package/assets/codemods/run-codemod.mjs +87 -7
- package/assets/codemods/transforms/next/index.mjs +11 -1
- package/assets/codemods/transforms/next/migrate-item-swipe-actions-to-swipe.mjs +394 -0
- package/assets/component-list.generated.json +1 -0
- package/assets/docs/author-a-theme.doc.mjs +1 -0
- package/assets/docs/theme.doc.dense.mjs +2 -2
- package/assets/docs/theme.doc.mjs +1 -1
- package/assets/docs/tree/check-your-docs.doc.mjs +1 -1
- package/assets/docs/tree/checks.doc.mjs +1 -1
- package/assets/docs/tree/cli-command.doc.mjs +2 -3
- package/assets/docs/tree/render-pages.doc.mjs +44 -3
- package/assets/docs/tree/single-component.doc.mjs +4 -0
- package/assets/docs/tree/template-doc-overview.doc.mjs +1 -1
- package/assets/docs/tree/test-in-an-app.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/search-catalog.generated.json +2 -0
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/ChatComposerInput/useChatDictationHookUsage.tsx +38 -0
- package/assets/templates/blocks/components/Hooks/useContainerRevealHookUsage.tsx +2 -2
- package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.doc.mjs +14 -0
- package/assets/templates/blocks/components/SyntaxTheme/useSyntaxThemeHookUsage.tsx +36 -0
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ai-chat/template.doc.mjs +5 -4
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +5 -1
- package/assets/templates/pages/blank/template.doc.mjs +1 -1
- package/assets/templates/pages/canvas-editor/template.doc.mjs +4 -2
- package/assets/templates/pages/centered-hero/template.doc.mjs +9 -1
- package/assets/templates/pages/classic-gallery/template.doc.mjs +1 -1
- package/assets/templates/pages/contact-form/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard/template.doc.mjs +3 -2
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +2 -1
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +6 -3
- package/assets/templates/pages/detail-page/template.doc.mjs +10 -3
- package/assets/templates/pages/documentation/template.doc.mjs +4 -1
- package/assets/templates/pages/documentation-design/template.doc.mjs +7 -1
- package/assets/templates/pages/documentation-technical/template.doc.mjs +7 -1
- package/assets/templates/pages/editor/template.doc.mjs +2 -8
- package/assets/templates/pages/file-explorer/template.doc.mjs +1 -1
- package/assets/templates/pages/form-two-column/template.doc.mjs +4 -3
- package/assets/templates/pages/form-wizard/template.doc.mjs +5 -3
- package/assets/templates/pages/gallery-hero/template.doc.mjs +4 -2
- package/assets/templates/pages/ide/page.tsx +24 -2
- package/assets/templates/pages/kanban-board/template.doc.mjs +1 -9
- package/assets/templates/pages/library/template.doc.mjs +4 -1
- package/assets/templates/pages/login/template.doc.mjs +2 -1
- package/assets/templates/pages/login-card/template.doc.mjs +2 -1
- package/assets/templates/pages/login-split/template.doc.mjs +2 -1
- package/assets/templates/pages/login-sso/template.doc.mjs +4 -2
- package/assets/templates/pages/mixed-gallery/template.doc.mjs +2 -1
- package/assets/templates/pages/product-detail/template.doc.mjs +4 -2
- package/assets/templates/pages/product-gallery/template.doc.mjs +2 -1
- package/assets/templates/pages/settings-dialog/template.doc.mjs +2 -1
- package/assets/templates/pages/settings-sidebar/template.doc.mjs +2 -1
- package/assets/templates/pages/shell-nav/template.doc.mjs +4 -2
- package/assets/templates/pages/shell-side-nav/template.doc.mjs +5 -3
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +2 -1
- package/assets/templates/pages/side-gallery/template.doc.mjs +9 -1
- package/assets/templates/pages/table-filter/template.doc.mjs +9 -8
- package/assets/templates/pages/table-grouped/template.doc.mjs +4 -2
- package/assets/templates/pages/table-page/template.doc.mjs +5 -4
- package/assets/templates/pages/table-tree/template.doc.mjs +6 -3
- package/assets/templates/pages/theme-showcase/template.doc.mjs +2 -9
- package/assets/templates/pages/work-item-detail/template.doc.mjs +1 -0
- package/assets/theme.template.ts +6 -0
- package/authoring/debug/parse.d.mts +3 -3
- package/authoring/doctypes/_schema.d.mts +3 -3
- package/authoring/doctypes/command/command.doc.mjs +1 -1
- package/authoring/doctypes/component/categories.d.mts +37 -0
- package/authoring/doctypes/component/categories.mjs +54 -0
- package/authoring/doctypes/template/template.doc.mjs +1 -1
- package/authoring/doctypes/template/type.ts +9 -0
- package/authoring/example/example.doc.d.mts +12 -0
- package/authoring/example/example.doc.mjs +69 -0
- package/authoring/example/preview.d.mts +92 -0
- package/authoring/example/preview.mjs +994 -0
- package/authoring/example/type.ts +102 -0
- package/authoring/index.d.mts +1 -0
- package/authoring/index.d.ts +12 -0
- package/authoring/index.mjs +3 -1
- package/clients/cli/bin/astryx.mjs +6 -9
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/component.doc.mjs +1 -1
- package/clients/cli/commands/component.mjs +22 -3
- package/clients/cli/commands/docs.doc.mjs +7 -1
- package/clients/cli/commands/docs.mjs +3 -1
- package/clients/cli/commands/doctor.mjs +32 -14
- package/clients/cli/commands/experimental/render.mjs +42 -1
- package/clients/cli/commands/experimental/theme.mjs +358 -63
- package/clients/cli/commands/experimental-render.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +87 -1
- package/clients/cli/commands/experimental-theme-editor-new.doc.mjs +10 -3
- 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 +2 -2
- package/clients/cli/commands/experimental-theme-editor.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-app.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-preview-remove.doc.mjs +2 -2
- package/clients/cli/commands/experimental-theme-preview.doc.mjs +2 -1
- package/clients/cli/commands/experimental-theme.doc.mjs +5 -1
- package/clients/cli/commands/search.doc.mjs +2 -1
- package/clients/cli/commands/search.mjs +6 -1
- package/clients/cli/commands/template.mjs +4 -2
- package/clients/cli/commands/theme-build.doc.mjs +5 -1
- package/clients/cli/commands/theme.doc.mjs +1 -1
- package/clients/cli/commands/theme.mjs +317 -47
- package/clients/cli/commands/upgrade.mjs +42 -7
- package/clients/cli/index.mjs +1 -1
- package/clients/cli/lib/cli-error.mjs +2 -1
- package/clients/cli/lib/component-format.mjs +205 -98
- package/clients/cli/lib/hook-format.mjs +9 -19
- package/clients/cli/lib/json-shim.mjs +92 -21
- package/clients/cli/lib/manifest.mjs +3 -2
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/config/theme-state.d.mts +13 -1
- package/foundation/config/theme-state.mjs +47 -7
- package/foundation/discovery/authoring-self-docs.mjs +1 -0
- package/foundation/discovery/component-discovery.d.mts +11 -0
- package/foundation/discovery/component-discovery.mjs +56 -8
- package/foundation/discovery/component-replacement.mjs +130 -1
- package/foundation/discovery/copied-passages.mjs +2 -1
- package/foundation/discovery/doc-types.mjs +4 -3
- package/foundation/discovery/entry-name-files.d.mts +43 -0
- package/foundation/discovery/entry-name-files.mjs +264 -0
- package/foundation/discovery/hook-discovery.d.mts +8 -2
- package/foundation/discovery/hook-discovery.mjs +22 -8
- package/foundation/discovery/icon-definition-discovery.mjs +2 -1
- package/foundation/discovery/icon-set-checks.mjs +2 -1
- package/foundation/discovery/icon-set-discovery.mjs +2 -1
- package/foundation/discovery/integration-doc-files.mjs +2 -1
- package/foundation/discovery/package-exports.d.mts +10 -0
- package/foundation/discovery/package-exports.mjs +56 -3
- package/foundation/discovery/prop-drift.mjs +9 -9
- package/foundation/discovery/runner-allowlist.d.mts +1 -0
- package/foundation/discovery/runner-allowlist.mjs +2 -0
- package/foundation/discovery/stored-component-list.d.mts +43 -0
- package/foundation/discovery/stored-component-list.mjs +90 -0
- package/foundation/discovery/stored-search-catalog.d.mts +115 -0
- package/foundation/discovery/stored-search-catalog.mjs +297 -0
- package/foundation/discovery/stored-self-audit.d.mts +26 -10
- package/foundation/discovery/stored-self-audit.mjs +38 -18
- package/foundation/discovery/template-adapter.d.mts +53 -1
- package/foundation/discovery/template-adapter.mjs +176 -12
- package/foundation/discovery/template-icons.mjs +2 -1
- package/foundation/discovery/theme-discovery.mjs +31 -4
- package/foundation/discovery/theme-imports.d.mts +14 -0
- package/foundation/discovery/theme-imports.mjs +43 -1
- package/foundation/discovery/theming-targets.mjs +3 -2
- package/foundation/doc-compiler/import.mjs +7 -1
- package/foundation/doc-compiler/inputs.mjs +3 -2
- package/foundation/doc-compiler/parse-readable.mjs +4 -1
- package/foundation/doc-compiler/stored-docs.d.mts +22 -0
- package/foundation/doc-compiler/stored-docs.mjs +49 -0
- package/foundation/env/semver.mjs +3 -1
- package/foundation/fonts/font-stylesheet.d.mts +31 -0
- package/foundation/fonts/font-stylesheet.mjs +115 -0
- package/foundation/fs/cache-eviction.d.mts +21 -0
- package/foundation/fs/cache-eviction.mjs +73 -0
- package/foundation/fs/exact-codec.d.mts +12 -2
- package/foundation/fs/exact-codec.mjs +23 -6
- package/foundation/fs/file-protection.mjs +4 -3
- package/foundation/fs/gather-cache.d.mts +62 -4
- package/foundation/fs/gather-cache.mjs +512 -91
- package/foundation/fs/jiti-cache.d.mts +19 -1
- package/foundation/fs/jiti-cache.mjs +130 -6
- package/foundation/fs/kept-tree.d.mts +60 -0
- package/foundation/fs/kept-tree.mjs +154 -0
- package/foundation/fs/listing-cache.d.mts +7 -0
- package/foundation/fs/listing-cache.mjs +10 -0
- package/foundation/fs/module-loader.d.mts +24 -2
- package/foundation/fs/module-loader.mjs +94 -21
- package/foundation/fs/paths.d.mts +18 -0
- package/foundation/fs/paths.mjs +15 -2
- package/foundation/fs/read-record.d.mts +9 -0
- package/foundation/fs/read-record.mjs +19 -11
- package/foundation/fs/stop-cleanup.d.mts +12 -0
- package/foundation/fs/stop-cleanup.mjs +66 -0
- package/foundation/identity/provider-identity.d.mts +6 -0
- package/foundation/identity/provider-identity.mjs +10 -1
- package/foundation/integrations/contribution-inventory.mjs +4 -3
- package/foundation/integrations/example-code.d.mts +63 -0
- package/foundation/integrations/example-code.mjs +416 -0
- package/foundation/integrations/public-imports.d.mts +9 -0
- package/foundation/integrations/public-imports.mjs +3 -2
- package/foundation/integrations/validate-contributions.mjs +17 -45
- package/foundation/render/embedded-files.d.mts +6 -0
- package/foundation/render/embedded-files.mjs +25 -5
- package/foundation/render/embedded-imports.d.mts +39 -7
- package/foundation/render/embedded-imports.mjs +66 -27
- package/foundation/render/file-header.d.mts +66 -0
- package/foundation/render/file-header.mjs +118 -0
- package/foundation/render/host-answer.d.mts +18 -0
- package/foundation/render/host-answer.mjs +46 -0
- package/foundation/render/host-exit.d.mts +1 -0
- package/foundation/render/host-exit.mjs +6 -1
- package/foundation/render/html-reader.d.mts +55 -2
- package/foundation/render/html-reader.mjs +145 -26
- package/foundation/render/markup-edits.d.mts +57 -0
- package/foundation/render/markup-edits.mjs +182 -0
- package/foundation/render/page-host.mjs +29 -12
- package/foundation/render/page-worker.mjs +121 -13
- package/foundation/render/picture-chrome.d.mts +4 -0
- package/foundation/render/picture-chrome.mjs +185 -0
- package/foundation/render/picture-playwright.d.mts +4 -0
- package/foundation/render/picture-playwright.mjs +34 -0
- package/foundation/render/rebuild.mjs +2 -1
- package/foundation/render/render-page.d.mts +35 -3
- package/foundation/render/render-page.mjs +641 -96
- package/foundation/render/source-block.d.mts +85 -6
- package/foundation/render/source-block.mjs +211 -20
- package/foundation/render/ts-paths.d.mts +69 -6
- package/foundation/render/ts-paths.mjs +326 -40
- package/foundation/response/error-codes.d.mts +3 -1
- package/foundation/response/error-codes.d.ts +1 -0
- package/foundation/response/error-codes.doc.mjs +12 -1
- package/foundation/response/error-codes.mjs +11 -1
- package/foundation/response/response-types.doc.mjs +2 -2
- package/foundation/text/compare-text.d.mts +14 -0
- package/foundation/text/compare-text.mjs +68 -0
- package/foundation/text/string-utils.d.mts +3 -2
- package/foundation/text/string-utils.mjs +18 -4
- package/foundation/text/suggest-order.d.mts +9 -0
- package/foundation/text/suggest-order.mjs +15 -1
- package/foundation/xle/expand.mjs +2 -1
- package/host/index.mjs +8 -6
- package/package.json +7 -6
package/api/search/_lexical.mjs
CHANGED
|
@@ -59,6 +59,7 @@ import {scoreQuery} from './_score.mjs';
|
|
|
59
59
|
import {scoreCandidate} from './_candidate-score.mjs';
|
|
60
60
|
import {domainPriority} from './_priority.mjs';
|
|
61
61
|
import {toResult, searchedComponentsOf} from './_result.mjs';
|
|
62
|
+
import {compareText} from '../../foundation/text/compare-text.mjs';
|
|
62
63
|
|
|
63
64
|
/**
|
|
64
65
|
* A search candidate gathered from one content domain. Extra underscore-
|
|
@@ -88,6 +89,7 @@ import {toResult, searchedComponentsOf} from './_result.mjs';
|
|
|
88
89
|
* @property {string} [_command] - The command that reads exactly this doc part.
|
|
89
90
|
* @property {string} [_parent] - The command that opens the level above a doc
|
|
90
91
|
* part: its topic's section list, or the docs-tree namespace it sits in.
|
|
92
|
+
* @property {string} [_category] - The category its own doc files it under.
|
|
91
93
|
* @property {string} [_package] - The npm package that owns the candidate:
|
|
92
94
|
* Core's package for its components, hooks, and templates, the integration's
|
|
93
95
|
* for what it contributed, and for a doc part the package that wrote it.
|
|
@@ -295,7 +297,7 @@ export function rankLexical(query, options, catalog) {
|
|
|
295
297
|
const byScore = ({result: a, key: ka}, {result: b, key: kb}) =>
|
|
296
298
|
kb - ka ||
|
|
297
299
|
(domainOrder[a.domain] ?? 9) - (domainOrder[b.domain] ?? 9) ||
|
|
298
|
-
a.name
|
|
300
|
+
compareText(a.name, b.name);
|
|
299
301
|
const others = ranked.filter(r => r.result.domain !== 'doc').sort(byScore);
|
|
300
302
|
// Against other domains, a doc the reader asked for competes ahead of docs
|
|
301
303
|
// they did not, so it is not held behind a broad page that outscores it.
|
|
@@ -351,7 +353,11 @@ export function rankLexical(query, options, catalog) {
|
|
|
351
353
|
if (catalog.searchedComponents) {
|
|
352
354
|
searchedComponentsOf.set(
|
|
353
355
|
response,
|
|
354
|
-
components.map(c => ({
|
|
356
|
+
components.map(c => ({
|
|
357
|
+
name: c.name,
|
|
358
|
+
keywords: c.keywords ?? [],
|
|
359
|
+
category: c._category ?? '',
|
|
360
|
+
})),
|
|
355
361
|
);
|
|
356
362
|
}
|
|
357
363
|
return response;
|
package/api/search/_result.d.mts
CHANGED
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
* @param {string} reason
|
|
13
13
|
* @param {number} matchedTerms - Query concepts this result answered.
|
|
14
14
|
* @param {number} queryTerms - Query concepts there were to answer.
|
|
15
|
-
|
|
15
|
+
* @param {boolean} [outside] - The search runs outside a project, where a
|
|
16
16
|
* theme cannot be added to an app, so its command forks the source instead
|
|
17
17
|
* (spec AST-081 FR3).
|
|
18
18
|
*/
|
|
19
19
|
export function toResult(c: Candidate, score: number, reason: string, matchedTerms: number, queryTerms: number, outside?: boolean): {
|
|
20
|
-
domain: "
|
|
20
|
+
domain: "component" | "template" | "doc" | "theme" | "hook";
|
|
21
21
|
name: string;
|
|
22
22
|
package: string | undefined;
|
|
23
23
|
score: number;
|
|
@@ -27,7 +27,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
|
|
|
27
27
|
deprecated?: import("../../authoring/index.js").ComponentDeprecation | undefined;
|
|
28
28
|
import: string | undefined;
|
|
29
29
|
command: string;
|
|
30
|
-
domain: "
|
|
30
|
+
domain: "component" | "template" | "doc" | "theme" | "hook";
|
|
31
31
|
name: string;
|
|
32
32
|
package: string | undefined;
|
|
33
33
|
score: number;
|
|
@@ -39,7 +39,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
|
|
|
39
39
|
command: string;
|
|
40
40
|
section?: string | undefined;
|
|
41
41
|
name: string;
|
|
42
|
-
domain: "
|
|
42
|
+
domain: "component" | "template" | "doc" | "theme" | "hook";
|
|
43
43
|
package: string | undefined;
|
|
44
44
|
score: number;
|
|
45
45
|
reason: string;
|
|
@@ -48,7 +48,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
|
|
|
48
48
|
displayName: string | undefined;
|
|
49
49
|
kind: "page" | "block" | undefined;
|
|
50
50
|
command: string;
|
|
51
|
-
domain: "
|
|
51
|
+
domain: "component" | "template" | "doc" | "theme" | "hook";
|
|
52
52
|
name: string;
|
|
53
53
|
package: string | undefined;
|
|
54
54
|
score: number;
|
|
@@ -57,7 +57,7 @@ export function toResult(c: Candidate, score: number, reason: string, matchedTer
|
|
|
57
57
|
} | {
|
|
58
58
|
displayName: string | undefined;
|
|
59
59
|
command: string;
|
|
60
|
-
domain: "
|
|
60
|
+
domain: "component" | "template" | "doc" | "theme" | "hook";
|
|
61
61
|
name: string;
|
|
62
62
|
package: string | undefined;
|
|
63
63
|
score: number;
|
|
@@ -76,23 +76,25 @@ export function checkSearchArgs(query: string, options: {
|
|
|
76
76
|
limit?: number;
|
|
77
77
|
}): void;
|
|
78
78
|
/**
|
|
79
|
-
* The components (name and
|
|
79
|
+
* The components (name, keywords and category) a search response was scored against, or
|
|
80
80
|
* null when that search was narrowed away from components.
|
|
81
81
|
* @param {object} response
|
|
82
|
-
* @returns {{name: string, keywords: string[]}[] | null}
|
|
82
|
+
* @returns {{name: string, keywords: string[], category: string}[] | null}
|
|
83
83
|
*/
|
|
84
84
|
export function searchedComponents(response: object): {
|
|
85
85
|
name: string;
|
|
86
86
|
keywords: string[];
|
|
87
|
+
category: string;
|
|
87
88
|
}[] | null;
|
|
88
89
|
/**
|
|
89
90
|
* The components each search response was scored against, by response:
|
|
90
91
|
* `build` reads them to tell a part of a page from a page without gathering
|
|
91
92
|
* them again. Module-private, so they never enter search's JSON.
|
|
92
|
-
* @type {WeakMap<object, {name: string, keywords: string[]}[]>}
|
|
93
|
+
* @type {WeakMap<object, {name: string, keywords: string[], category: string}[]>}
|
|
93
94
|
*/
|
|
94
95
|
export const searchedComponentsOf: WeakMap<object, {
|
|
95
96
|
name: string;
|
|
96
97
|
keywords: string[];
|
|
98
|
+
category: string;
|
|
97
99
|
}[]>;
|
|
98
100
|
export type Candidate = import("./_lexical.mjs").Candidate;
|
package/api/search/_result.mjs
CHANGED
|
@@ -22,7 +22,7 @@ import {SEARCH_DOMAINS} from './_query.mjs';
|
|
|
22
22
|
* @param {string} reason
|
|
23
23
|
* @param {number} matchedTerms - Query concepts this result answered.
|
|
24
24
|
* @param {number} queryTerms - Query concepts there were to answer.
|
|
25
|
-
|
|
25
|
+
* @param {boolean} [outside] - The search runs outside a project, where a
|
|
26
26
|
* theme cannot be added to an app, so its command forks the source instead
|
|
27
27
|
* (spec AST-081 FR3).
|
|
28
28
|
*/
|
|
@@ -136,15 +136,15 @@ export function checkSearchArgs(query, options) {
|
|
|
136
136
|
* The components each search response was scored against, by response:
|
|
137
137
|
* `build` reads them to tell a part of a page from a page without gathering
|
|
138
138
|
* them again. Module-private, so they never enter search's JSON.
|
|
139
|
-
* @type {WeakMap<object, {name: string, keywords: string[]}[]>}
|
|
139
|
+
* @type {WeakMap<object, {name: string, keywords: string[], category: string}[]>}
|
|
140
140
|
*/
|
|
141
141
|
export const searchedComponentsOf = new WeakMap();
|
|
142
142
|
|
|
143
143
|
/**
|
|
144
|
-
* The components (name and
|
|
144
|
+
* The components (name, keywords and category) a search response was scored against, or
|
|
145
145
|
* null when that search was narrowed away from components.
|
|
146
146
|
* @param {object} response
|
|
147
|
-
* @returns {{name: string, keywords: string[]}[] | null}
|
|
147
|
+
* @returns {{name: string, keywords: string[], category: string}[] | null}
|
|
148
148
|
*/
|
|
149
149
|
export function searchedComponents(response) {
|
|
150
150
|
return searchedComponentsOf.get(response) ?? null;
|
package/api/search/_score.d.mts
CHANGED
|
@@ -7,12 +7,17 @@
|
|
|
7
7
|
* @param {string} tok
|
|
8
8
|
* @param {Candidate} candidate
|
|
9
9
|
* @param {{fuzzy?: boolean, part?: boolean}} [opts] - see scoreCandidate
|
|
10
|
+
* @param {{score: number, reason: string} | null} [direct] - scoreCandidate(tok,
|
|
11
|
+
* candidate, opts), when the caller already holds it
|
|
10
12
|
* @returns {{score: number, reason: string} | null}
|
|
11
13
|
*/
|
|
12
14
|
export function bestForToken(tok: string, candidate: Candidate, opts?: {
|
|
13
15
|
fuzzy?: boolean;
|
|
14
16
|
part?: boolean;
|
|
15
|
-
}
|
|
17
|
+
}, direct?: {
|
|
18
|
+
score: number;
|
|
19
|
+
reason: string;
|
|
20
|
+
} | null): {
|
|
16
21
|
score: number;
|
|
17
22
|
reason: string;
|
|
18
23
|
} | null;
|
package/api/search/_score.mjs
CHANGED
|
@@ -40,10 +40,13 @@ const MIN_TOKEN_SCORE = 50;
|
|
|
40
40
|
* @param {string} tok
|
|
41
41
|
* @param {Candidate} candidate
|
|
42
42
|
* @param {{fuzzy?: boolean, part?: boolean}} [opts] - see scoreCandidate
|
|
43
|
+
* @param {{score: number, reason: string} | null} [direct] - scoreCandidate(tok,
|
|
44
|
+
* candidate, opts), when the caller already holds it
|
|
43
45
|
* @returns {{score: number, reason: string} | null}
|
|
44
46
|
*/
|
|
45
|
-
export function bestForToken(tok, candidate, opts = {}) {
|
|
46
|
-
let best =
|
|
47
|
+
export function bestForToken(tok, candidate, opts = {}, direct = undefined) {
|
|
48
|
+
let best =
|
|
49
|
+
direct !== undefined ? direct : scoreCandidate(tok, candidate, opts);
|
|
47
50
|
const syns = SYNONYM_INDEX.get(tok);
|
|
48
51
|
if (syns) {
|
|
49
52
|
for (const s of syns) {
|
|
@@ -131,8 +134,17 @@ export function scoreQuery(
|
|
|
131
134
|
* single words), but if stopwords left exactly one DIFFERENT token (e.g.
|
|
132
135
|
* "pricing page" → "pricing"), score that token too and take the stronger. */
|
|
133
136
|
const fewTokens = () => {
|
|
137
|
+
// A one-word query whose token is the query itself scores exactly as
|
|
138
|
+
// `full` did: `joins` only matters for a term with a space in it.
|
|
134
139
|
const single =
|
|
135
|
-
tokens.length === 1
|
|
140
|
+
tokens.length === 1
|
|
141
|
+
? bestForToken(
|
|
142
|
+
tokens[0],
|
|
143
|
+
candidate,
|
|
144
|
+
{fuzzy},
|
|
145
|
+
tokens[0] === term && !/\s/.test(term) ? full : undefined,
|
|
146
|
+
)
|
|
147
|
+
: null;
|
|
136
148
|
if (full && (!single || full.score >= single.score)) return asFull(full);
|
|
137
149
|
return single ? asFull(single) : null;
|
|
138
150
|
};
|
|
@@ -37,6 +37,12 @@ import {searchView} from './_named-keywords.mjs';
|
|
|
37
37
|
*/
|
|
38
38
|
const LOCAL_FIELDS = ['_docPath'];
|
|
39
39
|
|
|
40
|
+
/**
|
|
41
|
+
* Fields a gathered candidate holds only for `build`, which reads them from
|
|
42
|
+
* the gather itself. They never rank, so an index leaves them out.
|
|
43
|
+
*/
|
|
44
|
+
const BUILD_FIELDS = ['_category'];
|
|
45
|
+
|
|
40
46
|
/**
|
|
41
47
|
* A component candidate's description as `search` prints it: its inline
|
|
42
48
|
* `{@link}`, `{@pm}` and `{@command}` tokens resolved in the folder the index
|
|
@@ -54,7 +60,7 @@ const STORED_CORE = 'stored-index';
|
|
|
54
60
|
function portable(candidate) {
|
|
55
61
|
/** @type {Record<string, unknown>} */
|
|
56
62
|
const out = JSON.parse(JSON.stringify(candidate));
|
|
57
|
-
for (const field of LOCAL_FIELDS) delete out[field];
|
|
63
|
+
for (const field of [...LOCAL_FIELDS, ...BUILD_FIELDS]) delete out[field];
|
|
58
64
|
return out;
|
|
59
65
|
}
|
|
60
66
|
|
package/api/search/search.d.mts
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
export function search(query: string, options?: {
|
|
15
15
|
cwd?: string | undefined;
|
|
16
|
-
type?: "
|
|
16
|
+
type?: "component" | "template" | "doc" | "theme" | "hook" | undefined;
|
|
17
17
|
limit?: number | undefined;
|
|
18
18
|
}): Promise<import("./search.type.mjs").SearchResponse>;
|
|
19
19
|
/**
|
package/api/theme/_adapter.mjs
CHANGED
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
import {fsErrorMessage} from '../../foundation/fs/fs-error.mjs';
|
|
62
62
|
import {levenshteinDistance} from '../../foundation/text/string-utils.mjs';
|
|
63
63
|
import {analyzeTemplateNeeds} from '../../foundation/discovery/template-needs.mjs';
|
|
64
|
+
import {compareText} from '../../foundation/text/compare-text.mjs';
|
|
64
65
|
|
|
65
66
|
export {BUNDLED_THEME_PACKAGE, THEMES_DIR};
|
|
66
67
|
|
|
@@ -1005,7 +1006,7 @@ export function themeCommandsFor(command, slug, available, cwd) {
|
|
|
1005
1006
|
(a, b) =>
|
|
1006
1007
|
levenshteinDistance(needle, a.slug.toLowerCase()) -
|
|
1007
1008
|
levenshteinDistance(needle, b.slug.toLowerCase()) ||
|
|
1008
|
-
a.slug
|
|
1009
|
+
compareText(a.slug, b.slug),
|
|
1009
1010
|
)
|
|
1010
1011
|
.slice(0, 5)
|
|
1011
1012
|
.map(theme => ({
|
|
@@ -1186,6 +1187,7 @@ async function writeThemeApp(
|
|
|
1186
1187
|
stylesheet: theme.stylesheet,
|
|
1187
1188
|
...(theme.fontStylesheet ? {fontStylesheet: theme.fontStylesheet} : {}),
|
|
1188
1189
|
source: theme.source,
|
|
1190
|
+
...(theme.mode ? {mode: theme.mode} : {}),
|
|
1189
1191
|
})),
|
|
1190
1192
|
default: defaultSlug,
|
|
1191
1193
|
modulePath: prepared.module.path,
|
|
@@ -1194,6 +1196,15 @@ async function writeThemeApp(
|
|
|
1194
1196
|
slug,
|
|
1195
1197
|
changed,
|
|
1196
1198
|
firstAdd: action === 'add' && !state.configured,
|
|
1199
|
+
// The module lists one-mode themes' modes for the first time, after
|
|
1200
|
+
// the app was wired without them: the wiring takes the mode now.
|
|
1201
|
+
...(state.configured &&
|
|
1202
|
+
/\bexport const themeModes\b/.test(prepared.moduleContents) &&
|
|
1203
|
+
!/\bexport const themeModes\b/.test(
|
|
1204
|
+
String(prepared.module.expectedOriginal ?? ''),
|
|
1205
|
+
)
|
|
1206
|
+
? {wireModes: true}
|
|
1207
|
+
: {}),
|
|
1197
1208
|
},
|
|
1198
1209
|
...(notes.length > 0 ? {notes} : {}),
|
|
1199
1210
|
},
|
|
@@ -26,6 +26,15 @@
|
|
|
26
26
|
* @returns {() => any}
|
|
27
27
|
*/
|
|
28
28
|
export function lazyRootModule(resolveFile: () => string | null): () => any;
|
|
29
|
+
/**
|
|
30
|
+
* `target` spelled through real directories: the deepest ancestor that exists
|
|
31
|
+
* is resolved through its symlinks, and the missing rest is appended as given.
|
|
32
|
+
* The build confines its outputs by it, and the theme editor's compile guard
|
|
33
|
+
* reads paths through it too, so both read a path the same way.
|
|
34
|
+
* @param {string} target absolute path
|
|
35
|
+
* @returns {string}
|
|
36
|
+
*/
|
|
37
|
+
export function realLocation(target: string): string;
|
|
29
38
|
/**
|
|
30
39
|
* Why `theme build` has no Core to generate with, and the fix for where it
|
|
31
40
|
* ran: the Astryx repository builds Core, an app installs it, and an installed
|
|
@@ -49,6 +58,8 @@ export function coreUnavailableMessage(cwd: string, importError: any): string;
|
|
|
49
58
|
* @returns {string}
|
|
50
59
|
*/
|
|
51
60
|
export function normalizeThemeBuildForCompare(content: string): string;
|
|
61
|
+
/** @param {string} dest absolute output path @param {string} root @returns {boolean} whether a build at `root` refuses to write `dest` */
|
|
62
|
+
export function refusedOutput(dest: string, root: string): boolean;
|
|
52
63
|
/**
|
|
53
64
|
* Whether `error` is a build's refusal of a theme that sets a private var
|
|
54
65
|
* (which `doctor` reports in its own check, not as a stale output).
|
|
@@ -57,6 +68,34 @@ export function normalizeThemeBuildForCompare(content: string): string;
|
|
|
57
68
|
* @returns {boolean}
|
|
58
69
|
*/
|
|
59
70
|
export function isPrivateVarRefusal(error: unknown): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* The marks a file's leading comment carries (see `generatedMark`): a theme
|
|
73
|
+
* build's output, or a file the theme editor writes, with the command it
|
|
74
|
+
* names. The one reader build and doctor share.
|
|
75
|
+
* @param {string} source the start of the file
|
|
76
|
+
* @param {string} [file] its path, for a mark that names no exact command
|
|
77
|
+
*/
|
|
78
|
+
export function fileMark(source: string, file?: string): {
|
|
79
|
+
kind: "build" | "editor";
|
|
80
|
+
command: string;
|
|
81
|
+
} | null;
|
|
82
|
+
/**
|
|
83
|
+
* The command a file's leading comment says writes it, when another CLI
|
|
84
|
+
* command generates it (the theme editor's settings module or app copy):
|
|
85
|
+
* the exact command its mark names. Null for a theme build's own output and
|
|
86
|
+
* a file without a mark, such as a theme source of one's own.
|
|
87
|
+
* @param {string} file
|
|
88
|
+
* @returns {string | null}
|
|
89
|
+
*/
|
|
90
|
+
export function generatedFileCommand(file: string): string | null;
|
|
91
|
+
/**
|
|
92
|
+
* The command that writes `file`: from its own mark, or, when it is
|
|
93
|
+
* missing, from the files beside it (see `missingGeneratedCommand`); null
|
|
94
|
+
* otherwise.
|
|
95
|
+
* @param {string} file
|
|
96
|
+
* @returns {string | null}
|
|
97
|
+
*/
|
|
98
|
+
export function generatedSourceCommand(file: string): string | null;
|
|
60
99
|
/**
|
|
61
100
|
* The files a theme source is made of: the source and every local file it
|
|
62
101
|
* imports, directly or through other local files, read from their import
|
|
@@ -94,6 +133,16 @@ export function setEditorFolderListener(listener: ((warning: string) => void) |
|
|
|
94
133
|
* and `familyKey` names its key (a family run never takes --out).
|
|
95
134
|
* @typedef {{glob?: boolean, family?: boolean, familyKey?: string}} SuggestionShape
|
|
96
135
|
*/
|
|
136
|
+
/**
|
|
137
|
+
* The refusal a build gives the file it is given before it reads it, or
|
|
138
|
+
* null: a file that is not there, and a folder. The build throws it, and a
|
|
139
|
+
* suggested build is checked by it before it is offered.
|
|
140
|
+
* @param {string} file as typed, from cwd
|
|
141
|
+
* @param {BuildMode} options
|
|
142
|
+
* @param {string} cwd
|
|
143
|
+
* @returns {AstryxError | null}
|
|
144
|
+
*/
|
|
145
|
+
export function buildInputProblem(file: string, options: BuildMode, cwd: string): AstryxError | null;
|
|
97
146
|
/**
|
|
98
147
|
* The `theme build` command for `source` with the caller's mode flags, so a
|
|
99
148
|
* suggestion never turns a check into a write or moves the outputs.
|
|
@@ -129,6 +178,59 @@ export function writeDeferredBuildOutputs(deferred: Array<Array<{
|
|
|
129
178
|
* @returns {string}
|
|
130
179
|
*/
|
|
131
180
|
export function importSpecifier(relDir: string, base: string): string;
|
|
181
|
+
/**
|
|
182
|
+
* Load a theme module as a standalone build of it loads it (the Core the
|
|
183
|
+
* build selects, the same loader and interception) and name the export the
|
|
184
|
+
* build reads. Callers that must agree with the build on which theme a
|
|
185
|
+
* module defines read it here, never from the module's text.
|
|
186
|
+
*
|
|
187
|
+
* With `base`, also whether the theme extends that module's export, by
|
|
188
|
+
* identity, anywhere up its `extends` chain (`extendsBase`): the module is
|
|
189
|
+
* loaded once, and the theme module's imports of it (by any of
|
|
190
|
+
* `base.specifiers`) are handed that one load, so the answer is about the
|
|
191
|
+
* very object, not one that only looks like it.
|
|
192
|
+
* @param {string} file
|
|
193
|
+
* @param {{cwd?: string, base?: {file: string, exportName: string, specifiers: string[]}}} [ctx]
|
|
194
|
+
* @returns {Promise<{theme: any, exportName: string, extendsBase?: boolean}>}
|
|
195
|
+
*/
|
|
196
|
+
export function loadThemeExport(file: string, { cwd, base }?: {
|
|
197
|
+
cwd?: string;
|
|
198
|
+
base?: {
|
|
199
|
+
file: string;
|
|
200
|
+
exportName: string;
|
|
201
|
+
specifiers: string[];
|
|
202
|
+
};
|
|
203
|
+
}): Promise<{
|
|
204
|
+
theme: any;
|
|
205
|
+
exportName: string;
|
|
206
|
+
extendsBase?: boolean;
|
|
207
|
+
}>;
|
|
208
|
+
/**
|
|
209
|
+
* The input a theme module gives `defineTheme()` for the theme a build of
|
|
210
|
+
* it reads, evaluated as the build evaluates the module (an import, an
|
|
211
|
+
* expression, a spread or a computed key is its value), with the theme Core
|
|
212
|
+
* made of it. When Core refuses the input, the input the module gave for
|
|
213
|
+
* the named theme (else its last) and Core's error; null when the module
|
|
214
|
+
* does not load at all.
|
|
215
|
+
* @param {string} file
|
|
216
|
+
* @param {{cwd?: string, name?: string}} [ctx]
|
|
217
|
+
* @returns {Promise<{input: any, theme: any, error: Error | null} | null>}
|
|
218
|
+
*/
|
|
219
|
+
export function loadThemeInput(file: string, { cwd, name }?: {
|
|
220
|
+
cwd?: string;
|
|
221
|
+
name?: string;
|
|
222
|
+
}): Promise<{
|
|
223
|
+
input: any;
|
|
224
|
+
theme: any;
|
|
225
|
+
error: Error | null;
|
|
226
|
+
} | null>;
|
|
227
|
+
/**
|
|
228
|
+
* A one-mode `colorModes` value (`['light']` or `['dark']`), or null for
|
|
229
|
+
* anything else: a theme with both modes needs no export.
|
|
230
|
+
* @param {unknown} value
|
|
231
|
+
* @returns {['light'] | ['dark'] | null}
|
|
232
|
+
*/
|
|
233
|
+
export function oneColorMode(value: unknown): ["light"] | ["dark"] | null;
|
|
132
234
|
/**
|
|
133
235
|
* The package a theme load failed on because it is not installed.
|
|
134
236
|
* @param {unknown} error
|
|
@@ -346,9 +448,13 @@ export type ThemeBuildTrailer = {
|
|
|
346
448
|
*/
|
|
347
449
|
unloadedFonts: string[];
|
|
348
450
|
/**
|
|
349
|
-
* One notice per unloaded font family.
|
|
451
|
+
* One notice per unloaded font family, as printed.
|
|
350
452
|
*/
|
|
351
453
|
fontNotices: string[];
|
|
454
|
+
/**
|
|
455
|
+
* How the caller loads fonts, when it does.
|
|
456
|
+
*/
|
|
457
|
+
fontHelp?: FontHelp | null | undefined;
|
|
352
458
|
};
|
|
353
459
|
/**
|
|
354
460
|
* What the CLI hands a build beyond themeBuild's options. CLI-internal, never
|
|
@@ -359,6 +465,8 @@ export type ThemeBuildTrailer = {
|
|
|
359
465
|
* output must stay inside, for a scratch build; `commandWords` names the
|
|
360
466
|
* command in the rebuild hint; `prepareFamily`, `familyLoader`, and
|
|
361
467
|
* `familyInterception` make the build a family member's plan.
|
|
468
|
+
* `colorModes` is the one color mode a calling command knows the theme has
|
|
469
|
+
* (the theme editor, from its settings), written into the built module.
|
|
362
470
|
*/
|
|
363
471
|
export type ThemeBuildHandOff = {
|
|
364
472
|
prepareFamily?: boolean;
|
|
@@ -374,4 +482,17 @@ export type ThemeBuildHandOff = {
|
|
|
374
482
|
group: string;
|
|
375
483
|
build: string;
|
|
376
484
|
};
|
|
485
|
+
colorModes?: ["light"] | ["dark"] | null;
|
|
486
|
+
fontHelp?: FontHelp | null;
|
|
487
|
+
loadedFonts?: ((family: string) => boolean) | null;
|
|
488
|
+
};
|
|
489
|
+
/**
|
|
490
|
+
* How a caller that loads a theme's fonts itself (the editor's app copy)
|
|
491
|
+
* says to load a family: the notice per family and the recipe in place of
|
|
492
|
+
* the generic one.
|
|
493
|
+
*/
|
|
494
|
+
export type FontHelp = {
|
|
495
|
+
notice: (family: string) => string;
|
|
496
|
+
recipe: (families: string[]) => string;
|
|
377
497
|
};
|
|
498
|
+
import { AstryxError } from '../../error.mjs';
|