@astryxdesign/cli 0.6.4 → 0.6.5-canary.00f1ed9
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/CHANGELOG.md +56 -0
- package/README.md +103 -95
- package/api/build/_adapter.d.mts +36 -2
- package/api/build/_adapter.mjs +41 -10
- package/api/build/build.doc.mjs +8 -3
- package/api/build/build.test.mjs +60 -2
- package/api/build/kit/kit.mjs +109 -26
- package/api/build/kit/rank.d.mts +24 -8
- package/api/build/kit/rank.mjs +277 -97
- package/api/build/kit/rank.test.mjs +231 -48
- package/api/component/_adapter.d.mts +25 -0
- package/api/component/_adapter.mjs +59 -5
- package/api/component/component.d.mts +6 -3
- package/api/component/component.doc.mjs +37 -17
- package/api/component/component.mjs +249 -9
- package/api/component/component.type.d.mts +25 -0
- package/api/component/component.type.mjs +44 -0
- package/api/discover/_adapter.d.mts +114 -6
- package/api/discover/_adapter.mjs +372 -17
- package/api/discover/_adapter.test.mjs +215 -0
- package/api/discover/_catalog-view.d.mts +115 -0
- package/api/discover/_catalog-view.mjs +203 -0
- package/api/discover/_catalog-view.test.mjs +128 -0
- package/api/discover/detail/detail.d.mts +18 -6
- package/api/discover/detail/detail.mjs +67 -13
- package/api/discover/detail/detail.test.mjs +85 -0
- package/api/discover/detail/item/item.d.mts +26 -0
- package/api/discover/detail/item/item.mjs +78 -0
- package/api/discover/detail/item/item.test.mjs +73 -0
- package/api/discover/discover.d.mts +3 -9
- package/api/discover/discover.doc.mjs +61 -18
- package/api/discover/discover.mjs +220 -36
- package/api/discover/discover.test.mjs +11 -2
- package/api/discover/discover.type.d.mts +147 -8
- package/api/discover/discover.type.mjs +102 -12
- package/api/discover/list/list.d.mts +20 -6
- package/api/discover/list/list.mjs +45 -12
- package/api/discover/list/list.test.mjs +46 -0
- package/api/discover/search/search.d.mts +18 -16
- package/api/discover/search/search.mjs +102 -56
- package/api/discover/search/search.test.mjs +144 -10
- package/api/docs/_adapter.d.mts +8 -3
- package/api/docs/_adapter.mjs +14 -6
- package/api/docs/docOverlays.test.mjs +27 -1
- package/api/docs/docs.doc.mjs +2 -2
- package/api/docs/docs.test.mjs +54 -18
- package/api/docs/integration-tree.test.mjs +17 -0
- package/api/docs/integrationDocs.test.mjs +27 -5
- package/api/doctor/doctor.d.mts +8 -3
- package/api/doctor/doctor.doc.mjs +17 -8
- package/api/doctor/doctor.mjs +90 -9
- package/api/doctor/doctor.test.mjs +122 -10
- package/api/doctor/doctor.type.d.mts +1 -1
- package/api/doctor/doctor.type.mjs +1 -1
- package/api/error.d.mts +22 -0
- package/api/error.mjs +42 -0
- package/api/gap-report/gap-report.doc.mjs +19 -10
- package/api/hook/hook.doc.mjs +6 -3
- package/api/index.d.mts +1 -0
- package/api/index.mjs +5 -3
- package/api/init/init.doc.mjs +17 -12
- package/api/integration/add-contribution.d.mts +2 -1
- package/api/integration/add-contribution.mjs +7 -3
- package/api/integration/add-contribution.test.mjs +3 -3
- package/api/integration/add-helpers.d.mts +5 -2
- package/api/integration/add-helpers.mjs +36 -9
- package/api/integration/add-theme.mjs +266 -23
- package/api/integration/add-theme.test.mjs +247 -0
- package/api/integration/authoring-checks.mjs +12 -9
- package/api/integration/authoring-checks.type.d.mts +8 -0
- package/api/integration/authoring-checks.type.mjs +7 -3
- package/api/integration/integration-authoring.type.d.mts +4 -1
- package/api/integration/integration-authoring.type.mjs +6 -1
- package/api/integration/integrationAdd.doc.mjs +6 -0
- package/api/integration/integrationAddTheme.doc.mjs +10 -0
- package/api/integration/integrationComponentConflicts.doc.mjs +1 -1
- package/api/integration/integrationDocConflicts.doc.mjs +1 -1
- package/api/integration/integrationPackCheck.doc.mjs +3 -3
- package/api/integration/integrationTemplateConflicts.doc.mjs +1 -1
- package/api/integration/pack-check.lifecycle-output.test.mjs +107 -0
- package/api/integration/pack-check.mjs +92 -10
- package/api/integration/pack-check.test.mjs +140 -1
- package/api/integration/pack-check.type.mjs +1 -1
- package/api/integration/validate-integration.d.mts +4 -2
- package/api/integration/validate-integration.mjs +7 -2
- package/api/integration/validate-integration.test.mjs +55 -0
- package/api/integration/validate-integration.type.d.mts +5 -0
- package/api/integration/validate-integration.type.mjs +5 -1
- package/api/integration/validateIntegration.doc.mjs +1 -1
- package/api/json/assertResponse.doc.mjs +1 -1
- package/api/json/isError.doc.mjs +1 -1
- package/api/layout/expand/expand.mjs +12 -7
- package/api/layout/expand/expand.receipt.test.mjs +74 -0
- package/api/layout/layout.type.d.mts +1 -0
- package/api/layout/layout.type.mjs +1 -0
- package/api/layout/layoutExpand.doc.mjs +1 -1
- package/api/search/search.d.mts +51 -1
- package/api/search/search.doc.mjs +2 -2
- package/api/search/search.mjs +299 -17
- package/api/search/search.test.mjs +216 -18
- package/api/swizzle/copy/copy.mjs +66 -3
- package/api/swizzle/swizzle.doc.mjs +11 -5
- package/api/template/copy/copy.mjs +15 -9
- package/api/template/copy/copy.receipt.test.mjs +77 -0
- package/api/template/copy/copy.test.mjs +9 -0
- package/api/template/show/show.mjs +15 -4
- package/api/template/show/show.test.mjs +76 -0
- package/api/template/template-integration.test.mjs +14 -0
- package/api/template/template.d.mts +1 -1
- package/api/template/template.doc.mjs +8 -3
- package/api/template/template.mjs +1 -0
- package/api/template/template.type.d.mts +2 -0
- package/api/template/template.type.mjs +2 -0
- package/api/theme/add/add.mjs +17 -25
- package/api/theme/add/add.rollback.test.mjs +158 -0
- package/api/theme/add/add.staging.test.mjs +40 -23
- package/api/theme/build/build.d.mts +24 -0
- package/api/theme/build/build.family.test.mjs +7 -12
- package/api/theme/build/build.mjs +243 -26
- package/api/theme/build/build.project-core.test.mjs +165 -0
- package/api/theme/build/build.rollback.test.mjs +148 -0
- package/api/theme/generateTonalPalette.doc.mjs +1 -2
- package/api/theme/listThemes.doc.mjs +1 -1
- package/api/theme/themeAdd.doc.mjs +9 -10
- package/api/theme/themeBuild.doc.mjs +13 -13
- package/api/theme/themeList.doc.mjs +1 -1
- package/api/theme/themeListAvailable.doc.mjs +2 -1
- package/api/theme/themePaletteGenerate.doc.mjs +15 -8
- package/api/theme/themeTargets.doc.mjs +3 -2
- package/api/theme/themeTemplate.doc.mjs +2 -1
- package/api/upgrade/run/files-changed.test.mjs +111 -0
- package/api/upgrade/run/run.mjs +25 -6
- package/api/upgrade/run/run.test.mjs +45 -1
- package/api/upgrade/upgrade.doc.mjs +24 -22
- package/api/upgrade/upgrade.type.d.mts +1 -0
- package/api/upgrade/upgrade.type.mjs +3 -2
- package/assets/codemods/__tests__/runner.test.mjs +3 -1
- package/assets/codemods/file-count.test.mjs +163 -0
- package/assets/codemods/integration-runner.mjs +3 -3
- package/assets/codemods/runner.mjs +5 -4
- package/assets/docs/README.md +4 -2
- package/assets/docs/browser-support.doc.mjs +11 -11
- package/assets/docs/color.doc.mjs +8 -2
- package/assets/docs/elevation.doc.mjs +6 -4
- package/assets/docs/getting-started.doc.mjs +5 -16
- package/assets/docs/icons.doc.mjs +3 -21
- package/assets/docs/illustrations.doc.mjs +7 -15
- package/assets/docs/internationalization.doc.mjs +7 -5
- package/assets/docs/layout.doc.dense.mjs +130 -82
- package/assets/docs/layout.doc.mjs +133 -77
- package/assets/docs/migration.doc.mjs +19 -21
- package/assets/docs/motion.doc.mjs +16 -3
- package/assets/docs/principles.doc.dense.mjs +5 -5
- package/assets/docs/principles.doc.mjs +8 -0
- package/assets/docs/principles.doc.zh.mjs +6 -6
- package/assets/docs/shape.doc.mjs +8 -3
- package/assets/docs/spacing.doc.mjs +7 -2
- package/assets/docs/styling-libraries.doc.mjs +6 -2
- package/assets/docs/styling.doc.mjs +19 -23
- package/assets/docs/theme.doc.dense.mjs +58 -18
- package/assets/docs/theme.doc.mjs +57 -47
- package/assets/docs/theme.doc.zh.mjs +9 -8
- package/assets/docs/tokens.doc.dense.mjs +2 -2
- package/assets/docs/tokens.doc.mjs +389 -8
- package/assets/docs/tokens.doc.zh.mjs +2 -2
- package/assets/docs/tree/add-a-component.doc.mjs +75 -0
- package/assets/docs/tree/add-a-theme.doc.mjs +85 -0
- package/assets/docs/tree/add-a-topic.doc.mjs +144 -0
- package/assets/docs/tree/agent-guidance.doc.mjs +138 -0
- package/assets/docs/tree/block-template.doc.mjs +130 -0
- package/assets/docs/tree/build-the-template.doc.mjs +28 -0
- package/assets/docs/tree/building-blocks.doc.mjs +46 -0
- package/assets/docs/tree/check-your-docs.doc.mjs +137 -0
- package/assets/docs/tree/checks.doc.mjs +119 -0
- package/assets/docs/tree/codemods.doc.mjs +147 -0
- package/assets/docs/tree/component-family.doc.mjs +113 -0
- package/assets/docs/tree/component-imports.doc.mjs +69 -0
- package/assets/docs/tree/component-lookups.doc.mjs +149 -0
- package/assets/docs/tree/components.doc.mjs +23 -0
- package/assets/docs/tree/configuration.doc.mjs +23 -0
- package/assets/docs/tree/debug-and-gap-reports.doc.mjs +182 -0
- package/assets/docs/tree/define-the-theme.doc.mjs +118 -0
- package/assets/docs/tree/describe-the-component.doc.mjs +57 -0
- package/assets/docs/tree/docs.doc.mjs +21 -0
- package/assets/docs/tree/document-the-template.doc.mjs +28 -0
- package/assets/docs/tree/document-the-theme.doc.mjs +68 -0
- package/assets/docs/tree/export-template-assets.doc.mjs +147 -0
- package/assets/docs/tree/extend-or-replace.doc.mjs +103 -0
- package/assets/docs/tree/fonts-and-assets.doc.mjs +106 -0
- package/assets/docs/tree/generate-a-palette.doc.mjs +66 -0
- package/assets/docs/tree/grade-template-with-agent.doc.mjs +105 -0
- package/assets/docs/tree/help.doc.mjs +16 -0
- package/assets/docs/tree/integrations.doc.mjs +25 -451
- package/assets/docs/tree/links.doc.mjs +98 -0
- package/assets/docs/tree/package-and-test.doc.mjs +32 -0
- package/assets/docs/tree/page-template.doc.mjs +71 -0
- package/assets/docs/tree/publishing.doc.mjs +111 -0
- package/assets/docs/tree/quick-start.doc.mjs +272 -0
- package/assets/docs/tree/replace-a-core-component.doc.mjs +104 -0
- package/assets/docs/tree/replace-a-core-template.doc.mjs +172 -0
- package/assets/docs/tree/sections-and-placement.doc.mjs +108 -0
- package/assets/docs/tree/see-it-in-an-app.doc.mjs +59 -0
- package/assets/docs/tree/ship.doc.mjs +16 -0
- package/assets/docs/tree/short-and-findable.doc.mjs +108 -0
- package/assets/docs/tree/single-component.doc.mjs +165 -0
- package/assets/docs/tree/start-a-template.doc.mjs +143 -0
- package/assets/docs/tree/subcomponent.doc.mjs +115 -0
- package/assets/docs/tree/template-assets.doc.mjs +64 -0
- package/assets/docs/tree/template-doc-overview.doc.mjs +121 -0
- package/assets/docs/tree/template-fonts.doc.mjs +102 -0
- package/assets/docs/tree/template-grading-rubric.doc.mjs +452 -0
- package/assets/docs/tree/template-icons.doc.mjs +97 -0
- package/assets/docs/tree/template-images-media.doc.mjs +127 -0
- package/assets/docs/tree/template-styles.doc.mjs +93 -0
- package/assets/docs/tree/templates.doc.mjs +34 -0
- package/assets/docs/tree/test-in-an-app.doc.mjs +115 -0
- package/assets/docs/tree/test-template-in-app.doc.mjs +128 -0
- package/assets/docs/tree/themes.doc.mjs +39 -0
- package/assets/docs/tree/troubleshooting.doc.mjs +153 -0
- package/assets/docs/tree/upgrading.doc.mjs +103 -0
- package/assets/docs/tree/use-a-theme-in-an-app.doc.mjs +51 -0
- package/assets/docs/tree/verify-packed-template.doc.mjs +77 -0
- package/assets/docs/tree/versioning.doc.mjs +162 -0
- package/assets/docs/tree/write-good-templates.doc.mjs +64 -0
- package/assets/docs/tree/write-the-template-file.doc.mjs +154 -0
- package/assets/docs/typography.doc.mjs +24 -4
- package/assets/docs/working-with-ai.doc.mjs +30 -22
- package/assets/templates/blocks/components/InternationalizationProvider/InternationalizationProvider01ShippedLocale.tsx +1 -1
- package/assets/templates/pages/ai-chat/template.doc.mjs +16 -1
- package/assets/templates/pages/ai-chat-landing/template.doc.mjs +9 -1
- package/assets/templates/pages/blank/template.doc.mjs +3 -1
- package/assets/templates/pages/canvas-editor/template.doc.mjs +9 -1
- package/assets/templates/pages/centered-hero/template.doc.mjs +3 -1
- package/assets/templates/pages/checkout-wizard/template.doc.mjs +1 -0
- package/assets/templates/pages/classic-gallery/template.doc.mjs +3 -1
- package/assets/templates/pages/contact-form/template.doc.mjs +16 -1
- package/assets/templates/pages/dashboard/template.doc.mjs +15 -1
- package/assets/templates/pages/dashboard-alert-rail/template.doc.mjs +23 -1
- package/assets/templates/pages/dashboard-cohort-funnel/template.doc.mjs +10 -1
- package/assets/templates/pages/dashboard-comparison/template.doc.mjs +9 -1
- package/assets/templates/pages/dashboard-composition/template.doc.mjs +10 -1
- package/assets/templates/pages/dashboard-progress/template.doc.mjs +17 -1
- package/assets/templates/pages/dashboard-scorecard/template.doc.mjs +2 -1
- package/assets/templates/pages/detail-page/template.doc.mjs +8 -0
- package/assets/templates/pages/documentation/template.doc.mjs +10 -1
- package/assets/templates/pages/documentation-design/template.doc.mjs +10 -1
- package/assets/templates/pages/documentation-technical/template.doc.mjs +10 -1
- package/assets/templates/pages/editor/template.doc.mjs +9 -1
- package/assets/templates/pages/file-explorer/template.doc.mjs +3 -1
- package/assets/templates/pages/form-two-column/template.doc.mjs +17 -1
- package/assets/templates/pages/form-wizard/template.doc.mjs +14 -1
- package/assets/templates/pages/form-wizard-dialog/template.doc.mjs +1 -0
- package/assets/templates/pages/gallery-hero/template.doc.mjs +10 -1
- package/assets/templates/pages/ide/template.doc.mjs +9 -1
- package/assets/templates/pages/incident-console/template.doc.mjs +10 -1
- package/assets/templates/pages/kanban-board/template.doc.mjs +11 -1
- package/assets/templates/pages/library/template.doc.mjs +15 -1
- package/assets/templates/pages/login/template.doc.mjs +10 -1
- package/assets/templates/pages/login-card/template.doc.mjs +11 -1
- package/assets/templates/pages/login-split/template.doc.mjs +10 -1
- package/assets/templates/pages/login-sso/template.doc.mjs +10 -1
- package/assets/templates/pages/messaging-shell/template.doc.mjs +11 -1
- package/assets/templates/pages/mixed-gallery/template.doc.mjs +10 -1
- package/assets/templates/pages/payment-form/template.doc.mjs +3 -1
- package/assets/templates/pages/product-detail/template.doc.mjs +9 -1
- package/assets/templates/pages/product-gallery/template.doc.mjs +10 -1
- package/assets/templates/pages/settings/template.doc.mjs +3 -1
- package/assets/templates/pages/settings-dialog/template.doc.mjs +9 -1
- package/assets/templates/pages/settings-sidebar/template.doc.mjs +9 -1
- package/assets/templates/pages/shell-nav/template.doc.mjs +10 -1
- package/assets/templates/pages/shell-side-nav/template.doc.mjs +14 -1
- package/assets/templates/pages/shell-top-nav/template.doc.mjs +11 -1
- package/assets/templates/pages/side-gallery/template.doc.mjs +3 -1
- package/assets/templates/pages/table/template.doc.mjs +11 -1
- package/assets/templates/pages/table-filter/template.doc.mjs +21 -1
- package/assets/templates/pages/table-grouped/template.doc.mjs +15 -1
- package/assets/templates/pages/table-inbox/template.doc.mjs +18 -6
- package/assets/templates/pages/table-page/template.doc.mjs +20 -1
- package/assets/templates/pages/table-tree/template.doc.mjs +14 -1
- package/assets/templates/pages/theme-showcase/template.doc.mjs +10 -1
- package/assets/templates/pages/work-item-detail/template.doc.mjs +10 -0
- package/assets/templates/themes/butter/icons.tsx +2 -0
- package/assets/templates/themes/chocolate/icons.tsx +2 -0
- package/assets/templates/themes/gothic/icons.tsx +2 -0
- package/assets/templates/themes/matcha/icons.tsx +2 -0
- package/assets/templates/themes/neutral/icons.tsx +2 -0
- package/assets/templates/themes/stone/icons.tsx +2 -0
- package/assets/templates/themes/y2k/icons.tsx +2 -0
- package/authoring/config/config.doc.mjs +9 -1
- package/authoring/config/parse.d.mts +2 -0
- package/authoring/config/parse.mjs +19 -0
- package/authoring/config/parse.test.mjs +8 -0
- package/authoring/config/type.ts +11 -0
- package/authoring/discover/discover.doc.d.mts +13 -0
- package/authoring/discover/discover.doc.mjs +138 -0
- package/authoring/discover/parse.d.mts +24 -0
- package/authoring/discover/parse.mjs +128 -0
- package/authoring/discover/parse.test.mjs +124 -0
- package/authoring/discover/type.ts +87 -0
- package/authoring/doctypes/_schema.d.mts +3 -2
- package/authoring/doctypes/_schema.mjs +6 -0
- package/authoring/doctypes/base/graph-fields.doc.mjs +3 -3
- package/authoring/doctypes/base/type.ts +4 -2
- package/authoring/doctypes/component/component.doc.mjs +6 -0
- package/authoring/doctypes/component/type.ts +8 -0
- package/authoring/doctypes/reference/reference.doc.mjs +7 -0
- package/authoring/doctypes/reference/type.ts +5 -0
- package/authoring/doctypes/schema/schema.doc.mjs +2 -2
- package/authoring/doctypes/template/parse.d.mts +2 -0
- package/authoring/doctypes/template/parse.mjs +1 -0
- package/authoring/doctypes/template/parse.test.mjs +21 -0
- package/authoring/doctypes/template/template.doc.mjs +7 -1
- package/authoring/doctypes/template/type.ts +12 -2
- package/authoring/index.d.mts +1 -0
- package/authoring/index.d.ts +10 -0
- package/authoring/index.mjs +1 -0
- package/authoring/integration/integration.doc.mjs +12 -10
- package/clients/cli/commands/component/index.mjs +152 -55
- package/clients/cli/commands/component-batch.test.mjs +341 -0
- package/clients/cli/commands/component-ownership.test.mjs +89 -0
- package/clients/cli/commands/component.doc.mjs +27 -9
- package/clients/cli/commands/discover.doc.mjs +53 -9
- package/clients/cli/commands/discover.mjs +393 -118
- package/clients/cli/commands/discover.sources.test.mjs +267 -0
- package/clients/cli/commands/docs.doc.mjs +1 -1
- package/clients/cli/commands/docs.mjs +60 -17
- package/clients/cli/commands/docs.test.mjs +113 -24
- package/clients/cli/commands/doctor-integration-docs.doc.mjs +3 -2
- package/clients/cli/commands/doctor-integration.test.mjs +53 -0
- package/clients/cli/commands/doctor.doc.mjs +3 -1
- package/clients/cli/commands/doctor.mjs +53 -9
- package/clients/cli/commands/gap-report.doc.mjs +10 -9
- package/clients/cli/commands/init.doc.mjs +9 -6
- package/clients/cli/commands/integration-add.doc.mjs +17 -7
- package/clients/cli/commands/integration-authoring.test.mjs +70 -9
- package/clients/cli/commands/integration-pack.doc.mjs +5 -9
- package/clients/cli/commands/integration-real-world.test.mjs +1 -1
- package/clients/cli/commands/integration-verify.doc.mjs +22 -0
- package/clients/cli/commands/integration.doc.mjs +4 -4
- package/clients/cli/commands/integration.mjs +76 -43
- package/clients/cli/commands/layout-expand.doc.mjs +3 -1
- package/clients/cli/commands/layout.expand-receipt.test.mjs +94 -0
- package/clients/cli/commands/layout.mjs +16 -0
- package/clients/cli/commands/manifest.doc.mjs +1 -1
- package/clients/cli/commands/search.doc.mjs +10 -3
- package/clients/cli/commands/search.mjs +21 -2
- package/clients/cli/commands/search.test.mjs +21 -4
- package/clients/cli/commands/swizzle.doc.mjs +1 -1
- package/clients/cli/commands/template.copy-receipt.test.mjs +60 -0
- package/clients/cli/commands/template.doc.mjs +1 -1
- package/clients/cli/commands/template.mjs +19 -5
- package/clients/cli/commands/template.show-media.test.mjs +62 -0
- package/clients/cli/commands/text-json-parity.test.mjs +7 -1
- package/clients/cli/commands/theme-add.doc.mjs +1 -1
- package/clients/cli/commands/theme-palette-generate.doc.mjs +3 -2
- package/clients/cli/commands/theme-palette.doc.mjs +1 -2
- package/clients/cli/commands/theme-targets.doc.mjs +2 -2
- package/clients/cli/commands/theme.doc.mjs +2 -1
- package/clients/cli/commands/upgrade.ascii-output.test.mjs +14 -0
- package/clients/cli/commands/upgrade.doc.mjs +62 -3
- package/clients/cli/commands/write-failure.test.mjs +175 -0
- package/clients/cli/index.mjs +28 -6
- package/clients/cli/lib/define-command.mjs +28 -4
- package/clients/cli/lib/define-command.test.mjs +54 -0
- package/clients/cli/lib/exit-codes.test.mjs +17 -1
- package/clients/cli/lib/json-shim.mjs +24 -14
- package/clients/cli/lib/manifest.mjs +48 -156
- package/clients/cli/lib/manifest.test.mjs +103 -9
- package/clients/cli/lib/parse-error-format.test.mjs +81 -0
- package/foundation/agent-docs/agent-docs.mjs +1 -1
- package/foundation/agent-docs/agent-docs.test.mjs +3 -2
- package/foundation/discovery/authoring-self-docs.mjs +1 -0
- package/foundation/discovery/authoring-self-docs.test.mjs +6 -2
- package/foundation/discovery/cli-self-docs.mjs +16 -2
- package/foundation/discovery/cli-self-docs.test.mjs +20 -0
- package/foundation/discovery/docs-discovery.mjs +5 -1
- package/foundation/discovery/docs-discovery.test.mjs +21 -0
- package/foundation/discovery/docs-section-key.d.mts +1 -1
- package/foundation/discovery/docs-section-key.mjs +1 -1
- package/foundation/discovery/template-adapter.d.mts +14 -0
- package/foundation/discovery/template-adapter.fixture-refs.test.mjs +37 -1
- package/foundation/discovery/template-adapter.mjs +21 -1
- package/foundation/doc-compiler/doc-loads.test.mjs +5 -4
- package/foundation/doc-compiler/inputs.test.mjs +0 -1
- package/foundation/doc-compiler/tree.d.mts +4 -0
- package/foundation/doc-compiler/tree.mjs +6 -1
- package/foundation/doc-compiler/tree.test.mjs +65 -14
- package/foundation/integrations/cli-requirement.d.mts +75 -11
- package/foundation/integrations/cli-requirement.mjs +120 -23
- package/foundation/integrations/cli-requirement.test.mjs +141 -9
- package/foundation/integrations/contribution-inventory.mjs +1 -1
- package/foundation/integrations/integrations.d.mts +14 -1
- package/foundation/integrations/integrations.mjs +41 -1
- package/foundation/integrations/integrations.test.mjs +31 -0
- package/foundation/response/batch.type.d.mts +33 -0
- package/foundation/response/batch.type.mjs +34 -0
- package/foundation/response/error-codes.doc.mjs +6 -8
- package/foundation/response/error-codes.test.mjs +30 -5
- package/foundation/response/response-types.doc.d.mts +5 -4
- package/foundation/response/response-types.doc.mjs +49 -19
- package/foundation/response/response-types.doc.test.mjs +23 -0
- package/foundation/response/response.doc.mjs +11 -10
- package/package.json +9 -9
- package/assets/docs/tree/integrations.test.mjs +0 -62
- package/assets/docs/tree/writing-docs.doc.mjs +0 -286
|
@@ -116,14 +116,15 @@
|
|
|
116
116
|
* @property {string[]} data.integrations Integration packages processed in this upgrade (by name/spec).
|
|
117
117
|
* @property {boolean} data.agentDocsRefreshed
|
|
118
118
|
* @property {AgentDocsSummary} data.agentDocs
|
|
119
|
+
* @property {boolean} data.sourcePathFound Whether the resolved source directory (`path`, default `./src`) exists. False means no source file was read, so a zero `filesChanged` says nothing about the project being migrated.
|
|
119
120
|
* @property {RegistryCompositionSummary} [data.registryCompositions]
|
|
120
121
|
* @property {boolean} [data.complete] False when protected required changes remain.
|
|
121
122
|
* @property {'ERR_CODEMOD_PROTECTED'} [data.errorCode] Stable incomplete-result code when complete is false.
|
|
122
|
-
* @property {number} [data.filesChanged]
|
|
123
|
+
* @property {number} [data.filesChanged] Distinct files changed across core + integration codemods (apply mode). One file that four codemods each changed counts once.
|
|
123
124
|
* @property {string[]} [data.modifiedFiles] Project-relative files changed or previewed.
|
|
124
125
|
* @property {ProtectedCodemodFile[]} [data.protectedFiles] Protected files that still require a codemod change after regeneration.
|
|
125
126
|
* @property {Array<{file: string, location?: string, reason: string}>} [data.declinedCandidates] Candidates left unchanged because proof was insufficient.
|
|
126
|
-
* @property {number} [data.transformsApplied] Total
|
|
127
|
+
* @property {number} [data.transformsApplied] Total codemod changes. A code or config codemod counts once for each file it changed, so one file changed by four of them counts four times; a project codemod counts once, however many files it writes.
|
|
127
128
|
* @property {Array<{file: string, codemod: string, error: string}>} [data.errors] Per-codemod errors, when any codemod failed.
|
|
128
129
|
*/
|
|
129
130
|
|
|
@@ -46,7 +46,9 @@ describe('runCodemods — ordered dry-run state', () => {
|
|
|
46
46
|
silent: true,
|
|
47
47
|
});
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
// One file that two transforms changed is one file and two changes.
|
|
50
|
+
expect(preview.totalFilesChanged).toBe(1);
|
|
51
|
+
expect(preview.totalTransformsApplied).toBe(2);
|
|
50
52
|
expect(preview.changedFiles).toEqual([
|
|
51
53
|
path.join(srcDir, 'a.ts'),
|
|
52
54
|
path.join(srcDir, 'a.ts'),
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file `filesChanged` counts FILES, not (codemod, file) pairs.
|
|
5
|
+
*
|
|
6
|
+
* One source file that four codemods each changed was reported as four files
|
|
7
|
+
* changed — the total was incremented once per transform per file, so it
|
|
8
|
+
* equalled `transformsApplied` in every run and the documented meaning of the
|
|
9
|
+
* field ("Total files changed") was never true. The two numbers answer
|
|
10
|
+
* different questions and both are in the receipt.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import {describe, it, expect, beforeEach, afterEach} from 'vitest';
|
|
14
|
+
import * as fs from 'node:fs';
|
|
15
|
+
import * as os from 'node:os';
|
|
16
|
+
import * as path from 'node:path';
|
|
17
|
+
import jscodeshift from 'jscodeshift';
|
|
18
|
+
import {runCodemods} from './runner.mjs';
|
|
19
|
+
import {runIntegrationCodemods} from './integration-runner.mjs';
|
|
20
|
+
|
|
21
|
+
let dir;
|
|
22
|
+
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
dir = fs.mkdtempSync(path.join(os.tmpdir(), 'astryx-file-count-'));
|
|
25
|
+
});
|
|
26
|
+
afterEach(() => fs.rmSync(dir, {recursive: true, force: true}));
|
|
27
|
+
|
|
28
|
+
/** A transform that rewrites one distinctive token, so several can stack. */
|
|
29
|
+
const renaming = (from, to) => (file) =>
|
|
30
|
+
file.source.includes(from) ? file.source.split(from).join(to) : null;
|
|
31
|
+
|
|
32
|
+
/** @param {string} name @param {string[]} contents */
|
|
33
|
+
function writeSources(...contents) {
|
|
34
|
+
return contents.map((content, i) => {
|
|
35
|
+
const file = path.join(dir, `file${i}.ts`);
|
|
36
|
+
fs.writeFileSync(file, content);
|
|
37
|
+
return file;
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
describe('core codemod runner — filesChanged counts files', () => {
|
|
42
|
+
it('reports 1 file for one file changed by four codemods', async () => {
|
|
43
|
+
writeSources('const a = ONE + TWO + THREE + FOUR;\n');
|
|
44
|
+
|
|
45
|
+
const result = await runCodemods(
|
|
46
|
+
[
|
|
47
|
+
{
|
|
48
|
+
version: '0.0.2',
|
|
49
|
+
transforms: [
|
|
50
|
+
{name: 'one', transform: renaming('ONE', '1'), meta: {title: 'one'}},
|
|
51
|
+
{name: 'two', transform: renaming('TWO', '2'), meta: {title: 'two'}},
|
|
52
|
+
{name: 'three', transform: renaming('THREE', '3'), meta: {title: 'three'}},
|
|
53
|
+
{name: 'four', transform: renaming('FOUR', '4'), meta: {title: 'four'}},
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
{apply: true, path: dir, root: dir, codemod: undefined, skipCodemods: new Set(), silent: true},
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
expect(result.totalTransformsApplied).toBe(4);
|
|
61
|
+
expect(result.totalFilesChanged).toBe(1);
|
|
62
|
+
expect(new Set(result.changedFiles).size).toBe(1);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('still counts two files as two', async () => {
|
|
66
|
+
writeSources('const a = ONE;\n', 'const b = ONE;\n');
|
|
67
|
+
|
|
68
|
+
const result = await runCodemods(
|
|
69
|
+
[
|
|
70
|
+
{
|
|
71
|
+
version: '0.0.2',
|
|
72
|
+
transforms: [
|
|
73
|
+
{name: 'one', transform: renaming('ONE', '1'), meta: {title: 'one'}},
|
|
74
|
+
],
|
|
75
|
+
},
|
|
76
|
+
],
|
|
77
|
+
{apply: true, path: dir, root: dir, codemod: undefined, skipCodemods: new Set(), silent: true},
|
|
78
|
+
);
|
|
79
|
+
|
|
80
|
+
expect(result.totalTransformsApplied).toBe(2);
|
|
81
|
+
expect(result.totalFilesChanged).toBe(2);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it('reports 0 when nothing matched', async () => {
|
|
85
|
+
writeSources('const a = 1;\n');
|
|
86
|
+
|
|
87
|
+
const result = await runCodemods(
|
|
88
|
+
[
|
|
89
|
+
{
|
|
90
|
+
version: '0.0.2',
|
|
91
|
+
transforms: [
|
|
92
|
+
{name: 'one', transform: renaming('ONE', '1'), meta: {title: 'one'}},
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
{apply: true, path: dir, root: dir, codemod: undefined, skipCodemods: new Set(), silent: true},
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
expect(result.totalFilesChanged).toBe(0);
|
|
100
|
+
expect(result.totalTransformsApplied).toBe(0);
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
describe('integration codemod runner — filesChanged counts files', () => {
|
|
105
|
+
it('reports 1 file for one file changed by three integration codemods', () => {
|
|
106
|
+
writeSources('const a = ONE + TWO + THREE;\n');
|
|
107
|
+
|
|
108
|
+
const entry = (id, from, to) => ({
|
|
109
|
+
id,
|
|
110
|
+
package: '@acme/widgets',
|
|
111
|
+
type: 'code',
|
|
112
|
+
codemod: {title: id, transform: renaming(from, to)},
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
const result = runIntegrationCodemods(
|
|
116
|
+
[
|
|
117
|
+
{
|
|
118
|
+
version: '1.0.0',
|
|
119
|
+
codemods: [
|
|
120
|
+
entry('one', 'ONE', '1'),
|
|
121
|
+
entry('two', 'TWO', '2'),
|
|
122
|
+
entry('three', 'THREE', '3'),
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
{apply: true, path: dir, root: dir, skipCodemods: new Set(), jscodeshift, silent: true},
|
|
127
|
+
);
|
|
128
|
+
|
|
129
|
+
expect(result.totalTransformsApplied).toBe(3);
|
|
130
|
+
expect(result.totalFilesChanged).toBe(1);
|
|
131
|
+
expect(new Set(result.changedFiles).size).toBe(1);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
describe('core codemod runner — a project codemod', () => {
|
|
136
|
+
it('counts every file it writes, and one change', async () => {
|
|
137
|
+
const result = await runCodemods(
|
|
138
|
+
[
|
|
139
|
+
{
|
|
140
|
+
version: '0.0.2',
|
|
141
|
+
transforms: [
|
|
142
|
+
{
|
|
143
|
+
name: 'project-plan',
|
|
144
|
+
meta: {title: 'project plan', codemodType: 'project'},
|
|
145
|
+
transform: async root => ({
|
|
146
|
+
writes: [
|
|
147
|
+
{path: path.join(root, 'a.ts'), contents: 'a\n'},
|
|
148
|
+
{path: path.join(root, 'b.ts'), contents: 'b\n'},
|
|
149
|
+
],
|
|
150
|
+
deletes: [],
|
|
151
|
+
problems: [],
|
|
152
|
+
}),
|
|
153
|
+
},
|
|
154
|
+
],
|
|
155
|
+
},
|
|
156
|
+
],
|
|
157
|
+
{apply: true, path: dir, root: dir, codemod: undefined, skipCodemods: new Set(), silent: true},
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
expect(result.totalFilesChanged).toBe(2);
|
|
161
|
+
expect(result.totalTransformsApplied).toBe(1);
|
|
162
|
+
});
|
|
163
|
+
});
|
|
@@ -67,7 +67,6 @@ export function runIntegrationCodemods(
|
|
|
67
67
|
/** In-memory pipeline state keeps ordered dry-runs equivalent to apply. */
|
|
68
68
|
const virtualContents = new Map(providedContents ?? []);
|
|
69
69
|
|
|
70
|
-
let totalFilesChanged = 0;
|
|
71
70
|
let totalTransformsApplied = 0;
|
|
72
71
|
/** @type {string[]} */
|
|
73
72
|
const changedFiles = [];
|
|
@@ -115,7 +114,6 @@ export function runIntegrationCodemods(
|
|
|
115
114
|
protection,
|
|
116
115
|
contents: virtualContents,
|
|
117
116
|
});
|
|
118
|
-
totalFilesChanged += r.filesChanged;
|
|
119
117
|
totalTransformsApplied += r.filesChanged;
|
|
120
118
|
changedFiles.push(...r.changedFiles);
|
|
121
119
|
writtenFiles.push(...r.writtenFiles);
|
|
@@ -145,7 +143,6 @@ export function runIntegrationCodemods(
|
|
|
145
143
|
protection,
|
|
146
144
|
contents: virtualContents,
|
|
147
145
|
});
|
|
148
|
-
totalFilesChanged += r.filesChanged;
|
|
149
146
|
totalTransformsApplied += r.filesChanged;
|
|
150
147
|
changedFiles.push(...r.changedFiles);
|
|
151
148
|
writtenFiles.push(...r.writtenFiles);
|
|
@@ -154,6 +151,9 @@ export function runIntegrationCodemods(
|
|
|
154
151
|
}
|
|
155
152
|
}
|
|
156
153
|
|
|
154
|
+
// A file several codemods changed is one file; transforms count each change.
|
|
155
|
+
const totalFilesChanged = new Set(changedFiles).size;
|
|
156
|
+
|
|
157
157
|
return {
|
|
158
158
|
totalFilesChanged,
|
|
159
159
|
totalTransformsApplied,
|
|
@@ -486,7 +486,6 @@ export async function runCodemods(
|
|
|
486
486
|
(await import('jscodeshift')).default
|
|
487
487
|
);
|
|
488
488
|
|
|
489
|
-
let totalFilesChanged = 0;
|
|
490
489
|
let totalTransformsApplied = 0;
|
|
491
490
|
let totalValidationBlocked = 0;
|
|
492
491
|
/** @type {Array<{file: string, codemod: string, error: string}>} */
|
|
@@ -554,7 +553,6 @@ export async function runCodemods(
|
|
|
554
553
|
protectionWriteCount = writtenFiles.length;
|
|
555
554
|
}
|
|
556
555
|
if (result.filesChanged > 0) {
|
|
557
|
-
totalFilesChanged += result.filesChanged;
|
|
558
556
|
totalTransformsApplied += 1;
|
|
559
557
|
}
|
|
560
558
|
continue;
|
|
@@ -577,7 +575,6 @@ export async function runCodemods(
|
|
|
577
575
|
changedFiles.push(...result.changedFiles);
|
|
578
576
|
writtenFiles.push(...result.writtenFiles);
|
|
579
577
|
if (result.filesChanged > 0) {
|
|
580
|
-
totalFilesChanged += result.filesChanged;
|
|
581
578
|
totalTransformsApplied += result.filesChanged;
|
|
582
579
|
}
|
|
583
580
|
continue;
|
|
@@ -592,7 +589,6 @@ export async function runCodemods(
|
|
|
592
589
|
protectedFiles.push(...result.protectedFiles);
|
|
593
590
|
changedFiles.push(...result.changedFiles);
|
|
594
591
|
writtenFiles.push(...result.writtenFiles);
|
|
595
|
-
totalFilesChanged += result.filesChanged;
|
|
596
592
|
totalTransformsApplied += result.filesChanged;
|
|
597
593
|
totalValidationBlocked += result.errors.filter(
|
|
598
594
|
error =>
|
|
@@ -630,6 +626,11 @@ export async function runCodemods(
|
|
|
630
626
|
);
|
|
631
627
|
}
|
|
632
628
|
|
|
629
|
+
// A file several codemods changed is one file. `totalTransformsApplied` is
|
|
630
|
+
// unchanged: a code or config codemod counts each file it changed, and a
|
|
631
|
+
// project codemod counts once. The two answer different questions.
|
|
632
|
+
const totalFilesChanged = new Set(changedFiles).size;
|
|
633
|
+
|
|
633
634
|
if (protectedFiles.length > 0) {
|
|
634
635
|
const files = [...new Set(protectedFiles.map(item => item.file))];
|
|
635
636
|
log.warn(
|
package/assets/docs/README.md
CHANGED
|
@@ -21,13 +21,15 @@ Someone building a product with Astryx. Their questions:
|
|
|
21
21
|
## Tells that you are writing for us instead
|
|
22
22
|
|
|
23
23
|
- second person aimed at the wrong reader — "reviewers should…", "before promoting a component…", "attach evidence for…"
|
|
24
|
-
-
|
|
24
|
+
- an internal rubric, readiness gate, audit checklist, or sign-off that the reader must satisfy for Astryx maintainers
|
|
25
25
|
- a table of things to verify rather than things to use
|
|
26
26
|
- anything about lab → core, which is our lifecycle, not theirs
|
|
27
27
|
- Storybook, Playwright, CI or the Simulator named as tools the reader runs
|
|
28
28
|
|
|
29
29
|
One subtlety: a statement about the **system's behavior** is caller-facing even when it sounds like process. "A component's theme targets are stable once published" tells a caller what they can rely on; "reviewers must check that theme targets are stable" is ours. Same fact, different reader — **rewrite it rather than move it**.
|
|
30
30
|
|
|
31
|
+
A public authoring-quality rubric is also caller-facing when it helps someone evaluate an artifact they create through Astryx. It must be complete and actionable from public inputs. It must not include Astryx's internal approval, promotion, evidence-publication, or CI process. A current system spec must assign the shipped guide as the rubric's owner.
|
|
32
|
+
|
|
31
33
|
## Where the rest goes
|
|
32
34
|
|
|
33
35
|
The material is usually good; the finding is placement, not quality. It goes in the [wiki](https://github.com/facebook/astryx/wiki) — **as a section on the page that already covers it, not a new page.** The wiki is at nearly 60 pages, several of them overlapping, because every stray section got its own.
|
|
@@ -55,5 +57,5 @@ Worked example: a responsive-and-interaction readiness rubric is grading criteri
|
|
|
55
57
|
one section by its key. A section's key is its `id`, or a key derived from its
|
|
56
58
|
title when it has none. Give a section an `id` when its title may change, since
|
|
57
59
|
readers and extensions link to the key. Two sections in one topic cannot share
|
|
58
|
-
a key. Keep each section small enough to read on its own: `astryx doctor`
|
|
60
|
+
a key. Keep each section small enough to read on its own: `astryx doctor` warns on
|
|
59
61
|
any section over 32 KB.
|
|
@@ -73,7 +73,7 @@ export const docs = {
|
|
|
73
73
|
'Baseline 2026: the tightest requirement.',
|
|
74
74
|
],
|
|
75
75
|
[
|
|
76
|
-
'
|
|
76
|
+
'`Popover` API',
|
|
77
77
|
'Opens, stacks, and light-dismisses layered surfaces via the top layer.',
|
|
78
78
|
'Baseline 2025.',
|
|
79
79
|
],
|
|
@@ -86,7 +86,7 @@ export const docs = {
|
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
type: 'prose',
|
|
89
|
-
text: 'The gap that matters is between Tier 1 and Tier 2: the
|
|
89
|
+
text: 'The gap that matters is between Tier 1 and Tier 2: the `Popover` API and `light-dark()` reached wide availability well before anchor positioning. So in Tier 2 browsers, layered surfaces open and dismiss correctly; they just are not positioned. This is the one feature most consumers will need to reason about.',
|
|
90
90
|
},
|
|
91
91
|
],
|
|
92
92
|
},
|
|
@@ -95,24 +95,24 @@ export const docs = {
|
|
|
95
95
|
content: [
|
|
96
96
|
{
|
|
97
97
|
type: 'prose',
|
|
98
|
-
text: '
|
|
98
|
+
text: 'Any component that opens a menu, popover, tooltip, or dropdown carries the browser requirement: it renders that surface in an overlay positioned against its trigger. That includes:',
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
type: 'list',
|
|
102
102
|
style: 'unordered',
|
|
103
103
|
items: [
|
|
104
|
-
'Tooltip',
|
|
105
|
-
'
|
|
106
|
-
'
|
|
107
|
-
'
|
|
108
|
-
'Selector and MultiSelector (dropdown surfaces)',
|
|
104
|
+
'Tooltip, HoverCard, and Popover, and any prop that shows one (such as the Button `tooltip`)',
|
|
105
|
+
'DropdownMenu, MoreMenu, and ContextMenu',
|
|
106
|
+
'Selector, MultiSelector, ComplexSelector, Typeahead, and PowerSearch (dropdown surfaces)',
|
|
107
|
+
'DateInput, DateRangeInput, and DateTimeInput (calendar popovers)',
|
|
109
108
|
'Tokenizer (suggestion menu)',
|
|
109
|
+
'The overflow and flyout menus in Breadcrumbs, TabList, TopNav, and SideNav',
|
|
110
110
|
'Carousel (anchored controls)',
|
|
111
111
|
],
|
|
112
112
|
},
|
|
113
113
|
{
|
|
114
114
|
type: 'prose',
|
|
115
|
-
text: 'If your product
|
|
115
|
+
text: 'If your product opens no menus, popovers, tooltips, or dropdowns, it has no anchor-positioning requirement; it needs only `light-dark()` (Tier 2 and up) for correct theme colors. Page layout, typography, forms, buttons, cards, and tables work down to Tier 2 with no special handling.',
|
|
116
116
|
},
|
|
117
117
|
],
|
|
118
118
|
},
|
|
@@ -123,7 +123,7 @@ export const docs = {
|
|
|
123
123
|
type: 'list',
|
|
124
124
|
style: 'do',
|
|
125
125
|
items: [
|
|
126
|
-
'Components never throw on missing platform APIs. Where a browser lacks the
|
|
126
|
+
'Components never throw on missing platform APIs. Where a browser lacks the `Popover` API, layers fall back to plain visibility instead of crashing.',
|
|
127
127
|
'Tier 1 and Tier 2 are officially supported and tested.',
|
|
128
128
|
'Non-layered components render correctly down to Tier 2.',
|
|
129
129
|
],
|
|
@@ -192,7 +192,7 @@ const hasLightDark = CSS.supports('color', 'light-dark(#000, #fff)');`,
|
|
|
192
192
|
},
|
|
193
193
|
{
|
|
194
194
|
type: 'prose',
|
|
195
|
-
text: 'This is not an arbitrary window: Baseline − 2 is close to where anchor positioning stops being available while the
|
|
195
|
+
text: 'This is not an arbitrary window: Baseline − 2 is close to where anchor positioning stops being available while the `Popover` API and `light-dark()` still are, so the tier boundary tracks a real capability edge, not a guessed date. The version floors above are reviewed and advanced roughly once a year as new Baseline years land. Always feature-detect rather than hardcoding version numbers, so your app adapts automatically as the platform moves.',
|
|
196
196
|
},
|
|
197
197
|
],
|
|
198
198
|
},
|
|
@@ -22,7 +22,8 @@ export const docs = {
|
|
|
22
22
|
],
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
|
-
|
|
25
|
+
id: 'surface-colors',
|
|
26
|
+
title: 'Color Tokens',
|
|
26
27
|
category: 'foundations',
|
|
27
28
|
content: [
|
|
28
29
|
{
|
|
@@ -37,9 +38,14 @@ export const docs = {
|
|
|
37
38
|
],
|
|
38
39
|
},
|
|
39
40
|
{
|
|
40
|
-
|
|
41
|
+
id: 'usage',
|
|
42
|
+
title: 'Use color tokens in StyleX',
|
|
41
43
|
category: 'foundations',
|
|
42
44
|
content: [
|
|
45
|
+
{
|
|
46
|
+
type: 'prose',
|
|
47
|
+
text: 'Import the typed color tokens and use them in `stylex.create()`; they resolve to the active theme and color mode.',
|
|
48
|
+
},
|
|
43
49
|
{
|
|
44
50
|
type: 'code',
|
|
45
51
|
lang: 'tsx',
|
|
@@ -82,7 +82,7 @@ export const docs = {
|
|
|
82
82
|
content: [
|
|
83
83
|
{
|
|
84
84
|
type: 'prose',
|
|
85
|
-
text: 'Configurable surfaces expose a single `elevation` prop instead of asking consumers to hand-write a box-shadow. It takes the graded enum `none | low | med | high`, narrowed per component to the steps that surface needs: Card, ClickableCard, SelectableCard, Button, IconButton, ButtonGroup, and Banner expose the full scale, while ChatComposer exposes only `none | low`. `none` is a flat literal (`box-shadow: none`); the other levels map to the `--shadow-*` tokens above, so a surface stays theme-agnostic.',
|
|
85
|
+
text: 'Configurable surfaces expose a single `elevation` prop instead of asking consumers to hand-write a box-shadow. It takes the graded enum `none | low | med | high`, narrowed per component to the steps that surface needs: Card, ClickableCard, SelectableCard, Button, IconButton, ButtonGroup, ToggleButton, and Banner expose the full scale, while ChatComposer exposes only `none | low`. `none` is a flat literal (`box-shadow: none`); the other levels map to the `--shadow-*` tokens above, so a surface stays theme-agnostic.',
|
|
86
86
|
},
|
|
87
87
|
{
|
|
88
88
|
type: 'prose',
|
|
@@ -92,11 +92,13 @@ export const docs = {
|
|
|
92
92
|
type: 'code',
|
|
93
93
|
lang: 'tsx',
|
|
94
94
|
label: 'Raising a surface with the elevation prop',
|
|
95
|
-
code:
|
|
95
|
+
code: `import {Plus} from 'lucide-react';
|
|
96
|
+
|
|
97
|
+
// Flat by default; raise only when the surface needs to float.
|
|
96
98
|
<Card elevation="low">Raised card</Card>
|
|
97
99
|
|
|
98
100
|
// A floating action button.
|
|
99
|
-
<IconButton icon={<Icon icon=
|
|
101
|
+
<IconButton icon={<Icon icon={Plus} />} label="New" variant="primary" elevation="med" />
|
|
100
102
|
|
|
101
103
|
// Flatten the composer (defaults to 'low').
|
|
102
104
|
<ChatComposer elevation="none" onSubmit={handleSubmit} />`,
|
|
@@ -119,7 +121,7 @@ export const docs = {
|
|
|
119
121
|
type: 'code',
|
|
120
122
|
lang: 'tsx',
|
|
121
123
|
label: 'Applying elevation',
|
|
122
|
-
code: `import {shadowVars} from '@astryxdesign/core';
|
|
124
|
+
code: `import {shadowVars} from '@astryxdesign/core/theme/tokens.stylex';
|
|
123
125
|
|
|
124
126
|
const styles = stylex.create({
|
|
125
127
|
dropdown: {
|
|
@@ -8,6 +8,7 @@ export const docs = {
|
|
|
8
8
|
category: 'guide',
|
|
9
9
|
description:
|
|
10
10
|
'Add the design system to your project and start building.',
|
|
11
|
+
keywords: ['quick start', 'setup', 'install'],
|
|
11
12
|
|
|
12
13
|
sections: [
|
|
13
14
|
{
|
|
@@ -81,24 +82,11 @@ export const docs = {
|
|
|
81
82
|
},
|
|
82
83
|
{
|
|
83
84
|
type: 'prose',
|
|
84
|
-
text: '
|
|
85
|
-
},
|
|
86
|
-
{
|
|
87
|
-
type: 'list',
|
|
88
|
-
style: 'unordered',
|
|
89
|
-
items: [
|
|
90
|
-
'`@astryxdesign/theme-neutral`: muted and minimal; a good starting point',
|
|
91
|
-
'`@astryxdesign/theme-butter`: warm, golden tones with blue accents',
|
|
92
|
-
'`@astryxdesign/theme-chocolate`: rich chocolate and caramel tones',
|
|
93
|
-
'`@astryxdesign/theme-gothic`: dark-only theme with ink and noir influences',
|
|
94
|
-
'`@astryxdesign/theme-matcha`: earthy greens and botanical tones',
|
|
95
|
-
'`@astryxdesign/theme-stone`: warm neutrals inspired by sandstone',
|
|
96
|
-
'`@astryxdesign/theme-y2k`: playful early-2000s pop aesthetic',
|
|
97
|
-
],
|
|
85
|
+
text: 'Run `astryx theme list` to see every theme.',
|
|
98
86
|
},
|
|
99
87
|
{
|
|
100
88
|
type: 'prose',
|
|
101
|
-
text: 'These stylesheets are cascade-layered: the reset loads in @layer reset and component styles in @layer astryx-base. If your project has existing global CSS, a legacy reset, or Tailwind, declare the layer order explicitly and assign every stylesheet to a layer deliberately: unlayered styles and later layers both override astryx-base regardless of specificity.
|
|
89
|
+
text: 'These stylesheets are cascade-layered: the reset loads in @layer reset and component styles in @layer astryx-base. If your project has existing global CSS, a legacy reset, or Tailwind, declare the layer order explicitly and assign every stylesheet to a layer deliberately: unlayered styles and later layers both override astryx-base regardless of specificity. Before building screens, read the two cascade layer sections of {@link generic:migration}.',
|
|
102
90
|
},
|
|
103
91
|
{
|
|
104
92
|
type: 'prose',
|
|
@@ -135,7 +123,7 @@ export default function Page() {
|
|
|
135
123
|
content: [
|
|
136
124
|
{
|
|
137
125
|
type: 'prose',
|
|
138
|
-
text: 'Astryx components support various styling solutions, from plain CSS and `className` to Tailwind and CSS-in-JS. See
|
|
126
|
+
text: 'Astryx components support various styling solutions, from plain CSS and `className` to Tailwind and CSS-in-JS. See {@link generic:styling} for the full guide. Astryx also has a deep integration with [StyleX](https://stylexjs.com/), an atomic CSS-in-JS library: create styles with `stylex.create()` and pass them to components with the `xstyle` prop.',
|
|
139
127
|
},
|
|
140
128
|
{
|
|
141
129
|
type: 'code',
|
|
@@ -167,6 +155,7 @@ const overrides = stylex.create({
|
|
|
167
155
|
['Next.js + Tailwind', 'Next.js + Tailwind bridge', '[apps/example-nextjs-tailwind](https://github.com/facebook/astryx/tree/main/apps/example-nextjs-tailwind)'],
|
|
168
156
|
['Next.js Source', 'Next.js importing from source', '[apps/example-nextjs-source](https://github.com/facebook/astryx/tree/main/apps/example-nextjs-source)'],
|
|
169
157
|
['Vite', 'Vite', '[apps/example-vite](https://github.com/facebook/astryx/tree/main/apps/example-vite)'],
|
|
158
|
+
['Vite + Tailwind', 'Vite + Tailwind bridge', '[apps/example-vite-tailwind](https://github.com/facebook/astryx/tree/main/apps/example-vite-tailwind)'],
|
|
170
159
|
],
|
|
171
160
|
},
|
|
172
161
|
{
|
|
@@ -42,6 +42,7 @@ export const docs = {
|
|
|
42
42
|
['menu', 'Hamburger menu, navigation toggle'],
|
|
43
43
|
['moreHorizontal', 'Overflow menu, additional actions'],
|
|
44
44
|
['search', 'Search inputs, find'],
|
|
45
|
+
['upload', 'Upload files or content'],
|
|
45
46
|
['arrowUp', 'Sort ascending, move up'],
|
|
46
47
|
['arrowDown', 'Sort descending, move down'],
|
|
47
48
|
['arrowsUpDown', 'Sortable column indicator'],
|
|
@@ -73,7 +74,7 @@ export const docs = {
|
|
|
73
74
|
import { HeartIcon } from 'lucide-react';
|
|
74
75
|
|
|
75
76
|
<Icon icon={PhotoIcon} size="lg" />
|
|
76
|
-
<Icon icon={HeartIcon} color="
|
|
77
|
+
<Icon icon={HeartIcon} color="error" />`,
|
|
77
78
|
},
|
|
78
79
|
],
|
|
79
80
|
},
|
|
@@ -128,26 +129,7 @@ export const brandTheme = defineTheme({
|
|
|
128
129
|
},
|
|
129
130
|
{
|
|
130
131
|
type: 'prose',
|
|
131
|
-
text: '
|
|
132
|
-
},
|
|
133
|
-
],
|
|
134
|
-
},
|
|
135
|
-
{
|
|
136
|
-
title: 'Adding New Icons',
|
|
137
|
-
category: 'foundations',
|
|
138
|
-
content: [
|
|
139
|
-
{
|
|
140
|
-
type: 'prose',
|
|
141
|
-
text: 'To add a new semantic icon name to the design system, only for a glyph the whole system shares; a component-owned one takes a namespaced key instead:',
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
type: 'list',
|
|
145
|
-
style: 'ordered',
|
|
146
|
-
items: [
|
|
147
|
-
'Add the name to IconName type in `packages/core/src/Icon/globalIconRegistry.tsx`',
|
|
148
|
-
'Add the default SVG to `packages/core/src/Icon/defaultIcons.tsx`',
|
|
149
|
-
'Add a row to the Available Names table in `packages/cli/assets/docs/icons.doc.mjs`',
|
|
150
|
-
],
|
|
132
|
+
text: 'Outside core, pass a fallback to `getExtendedIcon(key, fallback)` so the glyph renders with no theme.',
|
|
151
133
|
},
|
|
152
134
|
],
|
|
153
135
|
},
|
|
@@ -7,6 +7,7 @@ export const docs = {
|
|
|
7
7
|
category: 'foundations',
|
|
8
8
|
description:
|
|
9
9
|
'Illustration guidelines for empty states, onboarding flows, and feature highlights.',
|
|
10
|
+
keywords: ['empty state'],
|
|
10
11
|
|
|
11
12
|
sections: [
|
|
12
13
|
{
|
|
@@ -59,26 +60,17 @@ export const docs = {
|
|
|
59
60
|
content: [
|
|
60
61
|
{
|
|
61
62
|
type: 'prose',
|
|
62
|
-
text: '
|
|
63
|
+
text: 'For an empty state, pass the illustration to the `icon` slot of `EmptyState`, which centers it above the title and description. Typical illustration sizes range from 120px for inline empty states to 240px for full-page onboarding screens. Always pair the illustration with a title and a description that says what to do next.',
|
|
63
64
|
},
|
|
64
65
|
{
|
|
65
66
|
type: 'code',
|
|
66
67
|
lang: 'tsx',
|
|
67
68
|
label: 'Empty state with illustration',
|
|
68
|
-
code: `<
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
style={{ width: 200, height: 200 }}
|
|
74
|
-
/>
|
|
75
|
-
<Heading level={3}>No results found</Heading>
|
|
76
|
-
<Text type="body" color="secondary">
|
|
77
|
-
Try adjusting your search or filters to find what you\u2019re
|
|
78
|
-
looking for.
|
|
79
|
-
</Text>
|
|
80
|
-
</Stack>
|
|
81
|
-
</Center>`,
|
|
69
|
+
code: `<EmptyState
|
|
70
|
+
icon={<img src="/illustrations/empty-search.svg" alt="" width={200} height={200} />}
|
|
71
|
+
title="No results found"
|
|
72
|
+
description="Try adjusting your search or filters."
|
|
73
|
+
/>`,
|
|
82
74
|
},
|
|
83
75
|
],
|
|
84
76
|
},
|
|
@@ -41,15 +41,17 @@ function App() {
|
|
|
41
41
|
lang: 'tsx',
|
|
42
42
|
label: 'Load an astryx locale catalog',
|
|
43
43
|
code: `import {InternationalizationProvider} from '@astryxdesign/core/i18n';
|
|
44
|
-
import
|
|
44
|
+
import frFR from '@astryxdesign/core/locales/fr-FR.generated.js';
|
|
45
45
|
|
|
46
|
-
<InternationalizationProvider
|
|
46
|
+
<InternationalizationProvider
|
|
47
|
+
locale="fr-FR"
|
|
48
|
+
messages={{'fr-FR': frFR}}>
|
|
47
49
|
<App />
|
|
48
50
|
</InternationalizationProvider>;`,
|
|
49
51
|
},
|
|
50
52
|
{
|
|
51
53
|
type: 'prose',
|
|
52
|
-
text: 'Astryx ships English
|
|
54
|
+
text: 'Astryx ships English and first-party translations for supported locales. Compact runtime modules from `@astryxdesign/core/locales/*.generated.js` contain only the messages apps need; the existing `@astryxdesign/core/locales/*.json` files retain translator context. Until a locale is available, apps can pass a local catalog in either shape. Missing keys fall back through the locale chain to English (for example, `pt-BR` walks to `pt`, then to shipped `en`).',
|
|
53
55
|
},
|
|
54
56
|
{
|
|
55
57
|
type: 'prose',
|
|
@@ -290,7 +292,7 @@ export default function App() {
|
|
|
290
292
|
},
|
|
291
293
|
{
|
|
292
294
|
type: 'prose',
|
|
293
|
-
text: '`Catalog` types
|
|
295
|
+
text: '`Catalog` types the rich `{defaultMessage, description?}` authoring shape. `RuntimeCatalog` types the generated key-to-message string map. `ProviderMessagesByLocale` accepts either shape for the provider, while `MessagesByLocale` keeps the original rich-only context shape.',
|
|
294
296
|
},
|
|
295
297
|
],
|
|
296
298
|
},
|
|
@@ -307,7 +309,7 @@ export default function App() {
|
|
|
307
309
|
lang: 'tsx',
|
|
308
310
|
label: 'Turn on pseudo-localization',
|
|
309
311
|
code: `import {InternationalizationProvider} from '@astryxdesign/core/i18n';
|
|
310
|
-
import pseudo from '@astryxdesign/core/locales/pseudo.
|
|
312
|
+
import pseudo from '@astryxdesign/core/locales/pseudo.generated.js';
|
|
311
313
|
|
|
312
314
|
<InternationalizationProvider locale="pseudo" messages={{pseudo}}>
|
|
313
315
|
<App />
|