@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/foundation/fs/paths.mjs
CHANGED
|
@@ -291,6 +291,19 @@ export function homeFolder() {
|
|
|
291
291
|
}
|
|
292
292
|
}
|
|
293
293
|
|
|
294
|
+
/**
|
|
295
|
+
* Whether a relative path climbs out of the folder it starts in: `..`
|
|
296
|
+
* itself, or a path that begins with `../` (or `..` and the platform's
|
|
297
|
+
* separator). A name that only
|
|
298
|
+
* begins with two dots (`..x`) is a folder or file like any other.
|
|
299
|
+
*
|
|
300
|
+
* @param {string} rel
|
|
301
|
+
* @returns {boolean}
|
|
302
|
+
*/
|
|
303
|
+
export function climbsOut(rel) {
|
|
304
|
+
return rel === '..' || rel.startsWith('../') || rel.startsWith(`..${path.sep}`);
|
|
305
|
+
}
|
|
306
|
+
|
|
294
307
|
/**
|
|
295
308
|
* Whether `child` lies strictly inside `parent`.
|
|
296
309
|
*
|
|
@@ -298,9 +311,9 @@ export function homeFolder() {
|
|
|
298
311
|
* @param {string} parent
|
|
299
312
|
* @returns {boolean}
|
|
300
313
|
*/
|
|
301
|
-
function isInside(child, parent) {
|
|
314
|
+
export function isInside(child, parent) {
|
|
302
315
|
const rel = path.relative(parent, child);
|
|
303
|
-
return rel !== '' && !rel
|
|
316
|
+
return rel !== '' && !climbsOut(rel) && !path.isAbsolute(rel);
|
|
304
317
|
}
|
|
305
318
|
|
|
306
319
|
/**
|
|
@@ -45,6 +45,15 @@ export function withoutRecording<T>(fn: () => T): T;
|
|
|
45
45
|
* @param {Iterable<[string, string]>} states
|
|
46
46
|
*/
|
|
47
47
|
export function recordStates(states: Iterable<[string, string]>): void;
|
|
48
|
+
/**
|
|
49
|
+
* Keep `state` as the state read of `file`, one state per path: the first
|
|
50
|
+
* one, except that a folder only probed takes a full stamp read later. The
|
|
51
|
+
* listing counts, as when a run lists a folder it probed (see `note`).
|
|
52
|
+
* @param {Map<string, string>} seen
|
|
53
|
+
* @param {string} file
|
|
54
|
+
* @param {string} state
|
|
55
|
+
*/
|
|
56
|
+
export function keepState(seen: Map<string, string>, file: string, state: string): void;
|
|
48
57
|
/**
|
|
49
58
|
* Run `fn`, adding to `seen` each path it reads, with that path's state when
|
|
50
59
|
* it was first read (see the file header).
|
|
@@ -233,17 +233,25 @@ export function recordStates(states) {
|
|
|
233
233
|
const runs = reads.getStore();
|
|
234
234
|
if (!runs) return;
|
|
235
235
|
for (const [file, state] of states) {
|
|
236
|
-
for (const seen of runs)
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
236
|
+
for (const seen of runs) keepState(seen, file, state);
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Keep `state` as the state read of `file`, one state per path: the first
|
|
242
|
+
* one, except that a folder only probed takes a full stamp read later. The
|
|
243
|
+
* listing counts, as when a run lists a folder it probed (see `note`).
|
|
244
|
+
* @param {Map<string, string>} seen
|
|
245
|
+
* @param {string} file
|
|
246
|
+
* @param {string} state
|
|
247
|
+
*/
|
|
248
|
+
export function keepState(seen, file, state) {
|
|
249
|
+
const had = seen.get(file);
|
|
250
|
+
if (
|
|
251
|
+
had === undefined ||
|
|
252
|
+
(had.startsWith('dir:') && !state.startsWith('dir:'))
|
|
253
|
+
) {
|
|
254
|
+
seen.set(file, state);
|
|
247
255
|
}
|
|
248
256
|
}
|
|
249
257
|
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Remove `p` if a stop ends the process while the work runs. The returned
|
|
6
|
+
* function stops tracking it (the work removes it itself when it ends).
|
|
7
|
+
* @param {string} p
|
|
8
|
+
* @returns {() => void}
|
|
9
|
+
*/
|
|
10
|
+
export function removeOnStop(p: string): () => void;
|
|
11
|
+
/** The signals that stop a command, the terminal closing among them. */
|
|
12
|
+
export const STOP_SIGNALS: readonly ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file Temp folders and files a command makes, removed when a stop (Ctrl-C,
|
|
5
|
+
* SIGTERM, or the terminal closing) ends the process: an `exit` listener
|
|
6
|
+
* does not run on a death by signal, and a `finally` does not run either.
|
|
7
|
+
* @input paths tracked while their work runs
|
|
8
|
+
* @output each tracked path removed before the stop ends the process
|
|
9
|
+
* @position foundation/fs — used by the render host and the editor's render
|
|
10
|
+
* folder, the places that make temp folders while a command can be stopped
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import * as fs from 'node:fs';
|
|
14
|
+
|
|
15
|
+
/** The signals that stop a command, the terminal closing among them. */
|
|
16
|
+
export const STOP_SIGNALS = /** @type {const} */ ([
|
|
17
|
+
'SIGINT',
|
|
18
|
+
'SIGTERM',
|
|
19
|
+
'SIGHUP',
|
|
20
|
+
]);
|
|
21
|
+
|
|
22
|
+
/** The paths to remove on a stop. @type {Set<string>} */
|
|
23
|
+
const tracked = new Set();
|
|
24
|
+
|
|
25
|
+
/** @param {string} p */
|
|
26
|
+
const remove = p => {
|
|
27
|
+
try {
|
|
28
|
+
fs.rmSync(p, {recursive: true, force: true});
|
|
29
|
+
} catch {
|
|
30
|
+
// Gone already, or held open: the stop goes on.
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Remove every tracked path, then step aside: the signal goes on to the
|
|
36
|
+
* listeners after this one, and with none it ends the process as it would
|
|
37
|
+
* have without this listener. Runs before every other listener, so a
|
|
38
|
+
* listener that ends the process at once still finds the paths removed.
|
|
39
|
+
* @param {NodeJS.Signals} sig
|
|
40
|
+
*/
|
|
41
|
+
function onStop(sig) {
|
|
42
|
+
for (const p of tracked) remove(p);
|
|
43
|
+
tracked.clear();
|
|
44
|
+
unlisten();
|
|
45
|
+
if (process.listenerCount(sig) === 0) process.kill(process.pid, sig);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function unlisten() {
|
|
49
|
+
for (const sig of STOP_SIGNALS) process.removeListener(sig, onStop);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Remove `p` if a stop ends the process while the work runs. The returned
|
|
54
|
+
* function stops tracking it (the work removes it itself when it ends).
|
|
55
|
+
* @param {string} p
|
|
56
|
+
* @returns {() => void}
|
|
57
|
+
*/
|
|
58
|
+
export function removeOnStop(p) {
|
|
59
|
+
if (!tracked.size)
|
|
60
|
+
for (const sig of STOP_SIGNALS) process.prependListener(sig, onStop);
|
|
61
|
+
tracked.add(p);
|
|
62
|
+
return () => {
|
|
63
|
+
tracked.delete(p);
|
|
64
|
+
if (!tracked.size) unlisten();
|
|
65
|
+
};
|
|
66
|
+
}
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
// @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
|
|
2
2
|
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Whether a value is a bare npm package name, as written (lowercase).
|
|
6
|
+
* @param {unknown} name
|
|
7
|
+
* @returns {boolean}
|
|
8
|
+
*/
|
|
9
|
+
export function isPackageName(name: unknown): boolean;
|
|
4
10
|
/**
|
|
5
11
|
* Normalize an npm package name into a ProviderId.
|
|
6
12
|
* @param {string} packageName
|
|
@@ -57,6 +57,15 @@ const DOC_KINDS = new Set([
|
|
|
57
57
|
'icon-definition',
|
|
58
58
|
]);
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Whether a value is a bare npm package name, as written (lowercase).
|
|
62
|
+
* @param {unknown} name
|
|
63
|
+
* @returns {boolean}
|
|
64
|
+
*/
|
|
65
|
+
export function isPackageName(name) {
|
|
66
|
+
return typeof name === 'string' && PACKAGE_NAME_RE.test(name);
|
|
67
|
+
}
|
|
68
|
+
|
|
60
69
|
/** RFC 3986 path-segment encoding with uppercase escapes. */
|
|
61
70
|
/** @param {string} value @returns {string} */
|
|
62
71
|
function encodeSegment(value) {
|
|
@@ -92,7 +101,7 @@ function normalizeName(value, label) {
|
|
|
92
101
|
*/
|
|
93
102
|
export function normalizeProviderId(packageName) {
|
|
94
103
|
const normalized = normalizeName(packageName, 'Provider ID').toLowerCase();
|
|
95
|
-
if (!
|
|
104
|
+
if (!isPackageName(normalized)) {
|
|
96
105
|
throw new Error(
|
|
97
106
|
`Provider ID "${packageName}" must be a bare npm package name.`,
|
|
98
107
|
);
|
|
@@ -26,6 +26,7 @@ import {discoverIntegrationCodemods} from '../../assets/codemods/integration-dis
|
|
|
26
26
|
import {discoverIntegrationDocs} from '../discovery/docs-discovery.mjs';
|
|
27
27
|
import {discoverIconSetDirectory} from '../discovery/icon-set-discovery.mjs';
|
|
28
28
|
import {generatedTypesPath} from '../discovery/icon-set-paths.mjs';
|
|
29
|
+
import {compareText} from '../text/compare-text.mjs';
|
|
29
30
|
|
|
30
31
|
// ── File-walk helpers (no module imports, no execution) ──────────
|
|
31
32
|
|
|
@@ -314,7 +315,7 @@ export async function collectIdentities(loaded) {
|
|
|
314
315
|
);
|
|
315
316
|
identities.themes = themes
|
|
316
317
|
.map(t => ({slug: t.slug, exportName: t.exportName}))
|
|
317
|
-
.sort((a, b) => a.slug
|
|
318
|
+
.sort((a, b) => compareText(a.slug, b.slug));
|
|
318
319
|
} catch (err) {
|
|
319
320
|
errors.push({
|
|
320
321
|
kind: 'themes',
|
|
@@ -367,7 +368,7 @@ export async function collectIdentities(loaded) {
|
|
|
367
368
|
name: t.name,
|
|
368
369
|
...(t.replaces == null ? {} : {replaces: t.replaces}),
|
|
369
370
|
}))
|
|
370
|
-
.sort((a, b) => a.id
|
|
371
|
+
.sort((a, b) => compareText(a.id, b.id));
|
|
371
372
|
} catch (err) {
|
|
372
373
|
errors.push({
|
|
373
374
|
kind: 'templates',
|
|
@@ -385,7 +386,7 @@ export async function collectIdentities(loaded) {
|
|
|
385
386
|
for (const cm of codemods) entries.push({version, id: cm.id});
|
|
386
387
|
}
|
|
387
388
|
identities.codemods = entries.sort((a, b) =>
|
|
388
|
-
`${a.version}/${a.id}
|
|
389
|
+
compareText(`${a.version}/${a.id}`, `${b.version}/${b.id}`),
|
|
389
390
|
);
|
|
390
391
|
} catch (err) {
|
|
391
392
|
errors.push({
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in foundation/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {object} ExampleScopeRead
|
|
6
|
+
* @property {ExampleScope | null} scope null when there is nothing to read
|
|
7
|
+
* examples against: no package.json with a name
|
|
8
|
+
* @property {string} [reason] why `scope` is null
|
|
9
|
+
* @property {string} [incomplete] why names Core or React give could not be
|
|
10
|
+
* read: the scope then lists none of them, so a name it does not list may
|
|
11
|
+
* still be defined
|
|
12
|
+
* @property {Map<string, any>} docs each component doc that loaded, by path
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The scope a package's component examples are read against, as JSON: the
|
|
16
|
+
* components the package documents with the import an app uses for each,
|
|
17
|
+
* the components and hooks the Core installed beside it documents, the
|
|
18
|
+
* React it resolves, the packages it declares, and its server-only modules
|
|
19
|
+
* and async components.
|
|
20
|
+
* @param {any} integration a loaded integration
|
|
21
|
+
* @returns {Promise<ExampleScopeRead>}
|
|
22
|
+
*/
|
|
23
|
+
export function exampleScopeFor(integration: any): Promise<ExampleScopeRead>;
|
|
24
|
+
/**
|
|
25
|
+
* Check every example of every component doc the package ships.
|
|
26
|
+
* @param {any} integration a loaded integration
|
|
27
|
+
* @returns {Promise<{notes: ExampleCodeNote[], unchecked: ExampleCodeUnchecked[]}>}
|
|
28
|
+
*/
|
|
29
|
+
export function exampleCodeCheck(integration: any): Promise<{
|
|
30
|
+
notes: ExampleCodeNote[];
|
|
31
|
+
unchecked: ExampleCodeUnchecked[];
|
|
32
|
+
}>;
|
|
33
|
+
export type ExampleCodeNote = {
|
|
34
|
+
code: string;
|
|
35
|
+
message: string;
|
|
36
|
+
};
|
|
37
|
+
export type ExampleCodeUnchecked = {
|
|
38
|
+
file: string;
|
|
39
|
+
example: string;
|
|
40
|
+
reason: string;
|
|
41
|
+
};
|
|
42
|
+
export type ExampleScope = import("../../authoring/example/type.ts").ExampleScope;
|
|
43
|
+
export type ExampleScopeRead = {
|
|
44
|
+
/**
|
|
45
|
+
* null when there is nothing to read
|
|
46
|
+
* examples against: no package.json with a name
|
|
47
|
+
*/
|
|
48
|
+
scope: ExampleScope | null;
|
|
49
|
+
/**
|
|
50
|
+
* why `scope` is null
|
|
51
|
+
*/
|
|
52
|
+
reason?: string | undefined;
|
|
53
|
+
/**
|
|
54
|
+
* why names Core or React give could not be
|
|
55
|
+
* read: the scope then lists none of them, so a name it does not list may
|
|
56
|
+
* still be defined
|
|
57
|
+
*/
|
|
58
|
+
incomplete?: string | undefined;
|
|
59
|
+
/**
|
|
60
|
+
* each component doc that loaded, by path
|
|
61
|
+
*/
|
|
62
|
+
docs: Map<string, any>;
|
|
63
|
+
};
|