handoff-app-next 2.0.0-canary.1
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 +2069 -0
- package/License.md +19 -0
- package/README.md +461 -0
- package/components.json +21 -0
- package/config/config.template.js +95 -0
- package/config/config.template.ts +54 -0
- package/config/docs/design.md +14 -0
- package/config/docs/foundations/border-radius.md +6 -0
- package/config/docs/foundations/colors.md +7 -0
- package/config/docs/foundations/effects.md +8 -0
- package/config/docs/foundations/elevation.md +6 -0
- package/config/docs/foundations/focus.md +6 -0
- package/config/docs/foundations/fonts.md +7 -0
- package/config/docs/foundations/grid.md +21 -0
- package/config/docs/foundations/icon.md +6 -0
- package/config/docs/foundations/icons.md +6 -0
- package/config/docs/foundations/logo.md +7 -0
- package/config/docs/foundations/logos.md +7 -0
- package/config/docs/foundations/motion.md +6 -0
- package/config/docs/foundations/spacing.md +7 -0
- package/config/docs/foundations/typography.md +8 -0
- package/config/docs/foundations.md +44 -0
- package/config/docs/guidelines.md +11 -0
- package/config/docs/index.md +9 -0
- package/config/docs/playground.md +14 -0
- package/config/docs/system/figma-sync.md +14 -0
- package/config/docs/system/tokens/foundations/colors.md +24 -0
- package/config/docs/system/tokens/foundations/effects.md +21 -0
- package/config/docs/system/tokens/foundations/spacing.md +22 -0
- package/config/docs/system/tokens/foundations/typography.md +24 -0
- package/config/docs/system.md +13 -0
- package/config/templates/component/template.hbs +6 -0
- package/config/templates/component/template.js +0 -0
- package/config/templates/component/template.json +45 -0
- package/config/templates/component/template.scss +2 -0
- package/config/templates/page.md +11 -0
- package/config/templates/page.mdx +49 -0
- package/config/templates/template.html +7 -0
- package/dist/app/components/Component/Cards.d.ts +25 -0
- package/dist/app/components/Component/Cards.jsx +27 -0
- package/dist/app/lib/adapter-kit/types.d.ts +581 -0
- package/dist/app/lib/adapter-kit/types.js +36 -0
- package/dist/app/lib/hubspot-field-map.d.ts +170 -0
- package/dist/app/lib/hubspot-field-map.js +538 -0
- package/dist/app/lib/hubspot-module/build-module.d.ts +136 -0
- package/dist/app/lib/hubspot-module/build-module.js +122 -0
- package/dist/app/lib/hubspot-module/context.d.ts +111 -0
- package/dist/app/lib/hubspot-module/context.js +228 -0
- package/dist/app/lib/hubspot-module/fields/boolean.d.ts +8 -0
- package/dist/app/lib/hubspot-module/fields/boolean.js +22 -0
- package/dist/app/lib/hubspot-module/fields/button.d.ts +19 -0
- package/dist/app/lib/hubspot-module/fields/button.js +66 -0
- package/dist/app/lib/hubspot-module/fields/fields.d.ts +20 -0
- package/dist/app/lib/hubspot-module/fields/fields.js +93 -0
- package/dist/app/lib/hubspot-module/fields/generic.d.ts +33 -0
- package/dist/app/lib/hubspot-module/fields/generic.js +150 -0
- package/dist/app/lib/hubspot-module/fields/hubdb.d.ts +14 -0
- package/dist/app/lib/hubspot-module/fields/hubdb.js +155 -0
- package/dist/app/lib/hubspot-module/fields/image.d.ts +27 -0
- package/dist/app/lib/hubspot-module/fields/image.js +59 -0
- package/dist/app/lib/hubspot-module/fields/menu.d.ts +8 -0
- package/dist/app/lib/hubspot-module/fields/menu.js +12 -0
- package/dist/app/lib/hubspot-module/fields/object.d.ts +11 -0
- package/dist/app/lib/hubspot-module/fields/object.js +31 -0
- package/dist/app/lib/hubspot-module/fields/select.d.ts +17 -0
- package/dist/app/lib/hubspot-module/fields/select.js +37 -0
- package/dist/app/lib/hubspot-module/fields/text.d.ts +15 -0
- package/dist/app/lib/hubspot-module/fields/text.js +63 -0
- package/dist/app/lib/hubspot-module/fields/url.d.ts +35 -0
- package/dist/app/lib/hubspot-module/fields/url.js +57 -0
- package/dist/app/lib/hubspot-module/fields/utils.d.ts +20 -0
- package/dist/app/lib/hubspot-module/fields/utils.js +33 -0
- package/dist/app/lib/hubspot-module/fields/video.d.ts +21 -0
- package/dist/app/lib/hubspot-module/fields/video.js +70 -0
- package/dist/app/lib/hubspot-module/index.d.ts +20 -0
- package/dist/app/lib/hubspot-module/index.js +17 -0
- package/dist/app/lib/hubspot-module/transpile.d.ts +27 -0
- package/dist/app/lib/hubspot-module/transpile.js +658 -0
- package/dist/app/lib/hubspot-module/types.d.ts +204 -0
- package/dist/app/lib/hubspot-module/types.js +47 -0
- package/dist/app/lib/hubspot-module-build.d.ts +33 -0
- package/dist/app/lib/hubspot-module-build.js +41 -0
- package/dist/app-builder/build.d.ts +21 -0
- package/dist/app-builder/build.js +649 -0
- package/dist/app-builder/client-config.d.ts +17 -0
- package/dist/app-builder/client-config.js +106 -0
- package/dist/app-builder/config-diff/index.d.ts +4 -0
- package/dist/app-builder/config-diff/index.js +3 -0
- package/dist/app-builder/config-diff/registry.d.ts +9 -0
- package/dist/app-builder/config-diff/registry.js +15 -0
- package/dist/app-builder/config-diff/snapshot.d.ts +13 -0
- package/dist/app-builder/config-diff/snapshot.js +38 -0
- package/dist/app-builder/config-diff/strategies/pattern.d.ts +2 -0
- package/dist/app-builder/config-diff/strategies/pattern.js +66 -0
- package/dist/app-builder/config-diff/types.d.ts +33 -0
- package/dist/app-builder/config-diff/types.js +1 -0
- package/dist/app-builder/index.d.ts +6 -0
- package/dist/app-builder/index.js +4 -0
- package/dist/app-builder/path-contract.d.ts +23 -0
- package/dist/app-builder/path-contract.js +60 -0
- package/dist/app-builder/paths.d.ts +24 -0
- package/dist/app-builder/paths.js +82 -0
- package/dist/app-builder/watchers/component.d.ts +15 -0
- package/dist/app-builder/watchers/component.js +58 -0
- package/dist/app-builder/watchers/utils.d.ts +14 -0
- package/dist/app-builder/watchers/utils.js +31 -0
- package/dist/app-builder/watchers.d.ts +44 -0
- package/dist/app-builder/watchers.js +299 -0
- package/dist/app-builder/websocket.d.ts +12 -0
- package/dist/app-builder/websocket.js +56 -0
- package/dist/cache/build-cache.d.ts +169 -0
- package/dist/cache/build-cache.js +421 -0
- package/dist/cache/file-state.d.ts +58 -0
- package/dist/cache/file-state.js +122 -0
- package/dist/cache/index.d.ts +3 -0
- package/dist/cache/index.js +6 -0
- package/dist/cache/push-state.d.ts +69 -0
- package/dist/cache/push-state.js +156 -0
- package/dist/cli/create.d.ts +5 -0
- package/dist/cli/create.js +301 -0
- package/dist/cli/eject.d.ts +17 -0
- package/dist/cli/eject.js +82 -0
- package/dist/cli/fetch-design-md.d.ts +14 -0
- package/dist/cli/fetch-design-md.js +62 -0
- package/dist/cli/figma-audit.d.ts +7 -0
- package/dist/cli/figma-audit.js +55 -0
- package/dist/cli/init-claude-core.d.ts +26 -0
- package/dist/cli/init-claude-core.js +81 -0
- package/dist/cli/make.d.ts +12 -0
- package/dist/cli/make.js +178 -0
- package/dist/cli/scaffold.d.ts +5 -0
- package/dist/cli/scaffold.js +504 -0
- package/dist/cli/sync/apply-declaration-pull.d.ts +14 -0
- package/dist/cli/sync/apply-declaration-pull.js +184 -0
- package/dist/cli/sync/apply-pull.d.ts +24 -0
- package/dist/cli/sync/apply-pull.js +174 -0
- package/dist/cli/sync/cli-auth-store.d.ts +12 -0
- package/dist/cli/sync/cli-auth-store.js +44 -0
- package/dist/cli/sync/collect-build-artifacts.d.ts +17 -0
- package/dist/cli/sync/collect-build-artifacts.js +143 -0
- package/dist/cli/sync/collect-referenced-images.d.ts +36 -0
- package/dist/cli/sync/collect-referenced-images.js +165 -0
- package/dist/cli/sync/declaration-patch.d.ts +9 -0
- package/dist/cli/sync/declaration-patch.js +196 -0
- package/dist/cli/sync/hash.d.ts +2 -0
- package/dist/cli/sync/hash.js +11 -0
- package/dist/cli/sync/open-browser.d.ts +5 -0
- package/dist/cli/sync/open-browser.js +37 -0
- package/dist/cli/sync/push-provenance.d.ts +25 -0
- package/dist/cli/sync/push-provenance.js +82 -0
- package/dist/cli/sync/push-registry-content.d.ts +132 -0
- package/dist/cli/sync/push-registry-content.js +854 -0
- package/dist/cli/sync/push-shared-assets.d.ts +26 -0
- package/dist/cli/sync/push-shared-assets.js +33 -0
- package/dist/cli/sync/resolve-declaration-payload.d.ts +8 -0
- package/dist/cli/sync/resolve-declaration-payload.js +208 -0
- package/dist/cli/sync/resolve-declaration.d.ts +5 -0
- package/dist/cli/sync/resolve-declaration.js +12 -0
- package/dist/cli/sync/run-cli-login.d.ts +9 -0
- package/dist/cli/sync/run-cli-login.js +81 -0
- package/dist/cli/sync/run-history-purge.d.ts +19 -0
- package/dist/cli/sync/run-history-purge.js +112 -0
- package/dist/cli/sync/run-pull.d.ts +9 -0
- package/dist/cli/sync/run-pull.js +92 -0
- package/dist/cli/sync/run-push.d.ts +47 -0
- package/dist/cli/sync/run-push.js +585 -0
- package/dist/cli/sync/run-sync-status.d.ts +2 -0
- package/dist/cli/sync/run-sync-status.js +30 -0
- package/dist/cli/sync/sync-remote-env.d.ts +14 -0
- package/dist/cli/sync/sync-remote-env.js +52 -0
- package/dist/cli/sync/sync-state.d.ts +15 -0
- package/dist/cli/sync/sync-state.js +26 -0
- package/dist/cli/tokens/ensure-default-brand.d.ts +18 -0
- package/dist/cli/tokens/ensure-default-brand.js +95 -0
- package/dist/cli/tokens/migrate-legacy.d.ts +23 -0
- package/dist/cli/tokens/migrate-legacy.js +213 -0
- package/dist/cli/tokens/parse-css-brands.d.ts +25 -0
- package/dist/cli/tokens/parse-css-brands.js +148 -0
- package/dist/cli/tokens/transform.d.ts +12 -0
- package/dist/cli/tokens/transform.js +126 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +56 -0
- package/dist/commands/audit/figma-components.d.ts +8 -0
- package/dist/commands/audit/figma-components.js +27 -0
- package/dist/commands/build/app.d.ts +8 -0
- package/dist/commands/build/app.js +22 -0
- package/dist/commands/build/components.d.ts +7 -0
- package/dist/commands/build/components.js +17 -0
- package/dist/commands/build/hubspot.d.ts +56 -0
- package/dist/commands/build/hubspot.js +177 -0
- package/dist/commands/dev/index.d.ts +6 -0
- package/dist/commands/dev/index.js +14 -0
- package/dist/commands/eject/config.d.ts +6 -0
- package/dist/commands/eject/config.js +14 -0
- package/dist/commands/eject/pages.d.ts +6 -0
- package/dist/commands/eject/pages.js +14 -0
- package/dist/commands/eject/theme.d.ts +6 -0
- package/dist/commands/eject/theme.js +14 -0
- package/dist/commands/fetch/index.d.ts +6 -0
- package/dist/commands/fetch/index.js +14 -0
- package/dist/commands/history-purge.d.ts +19 -0
- package/dist/commands/history-purge.js +52 -0
- package/dist/commands/index.d.ts +1 -0
- package/dist/commands/index.js +66 -0
- package/dist/commands/init/index.d.ts +5 -0
- package/dist/commands/init/index.js +12 -0
- package/dist/commands/init/vercel.d.ts +6 -0
- package/dist/commands/init/vercel.js +99 -0
- package/dist/commands/init-claude.d.ts +9 -0
- package/dist/commands/init-claude.js +47 -0
- package/dist/commands/login.d.ts +9 -0
- package/dist/commands/login.js +28 -0
- package/dist/commands/logout.d.ts +6 -0
- package/dist/commands/logout.js +16 -0
- package/dist/commands/make/component.d.ts +7 -0
- package/dist/commands/make/component.js +23 -0
- package/dist/commands/make/page.d.ts +8 -0
- package/dist/commands/make/page.js +33 -0
- package/dist/commands/make/template.d.ts +8 -0
- package/dist/commands/make/template.js +33 -0
- package/dist/commands/mcp-init.d.ts +12 -0
- package/dist/commands/mcp-init.js +94 -0
- package/dist/commands/mcp-token.d.ts +7 -0
- package/dist/commands/mcp-token.js +23 -0
- package/dist/commands/prepare-runtime.d.ts +7 -0
- package/dist/commands/prepare-runtime.js +28 -0
- package/dist/commands/pull.d.ts +7 -0
- package/dist/commands/pull.js +18 -0
- package/dist/commands/push-all.d.ts +23 -0
- package/dist/commands/push-all.js +146 -0
- package/dist/commands/push-assets.d.ts +8 -0
- package/dist/commands/push-assets.js +40 -0
- package/dist/commands/push-tokens.d.ts +8 -0
- package/dist/commands/push-tokens.js +40 -0
- package/dist/commands/push.d.ts +14 -0
- package/dist/commands/push.js +75 -0
- package/dist/commands/scaffold/index.d.ts +6 -0
- package/dist/commands/scaffold/index.js +15 -0
- package/dist/commands/start/index.d.ts +6 -0
- package/dist/commands/start/index.js +14 -0
- package/dist/commands/sync-status.d.ts +6 -0
- package/dist/commands/sync-status.js +14 -0
- package/dist/commands/tokens-build.d.ts +7 -0
- package/dist/commands/tokens-build.js +104 -0
- package/dist/commands/types.d.ts +5 -0
- package/dist/commands/types.js +1 -0
- package/dist/commands/utils.d.ts +18 -0
- package/dist/commands/utils.js +19 -0
- package/dist/commands/validate/components.d.ts +7 -0
- package/dist/commands/validate/components.js +19 -0
- package/dist/commands/validate.d.ts +11 -0
- package/dist/commands/validate.js +163 -0
- package/dist/commands/vercel-build.d.ts +7 -0
- package/dist/commands/vercel-build.js +81 -0
- package/dist/config/declaration-module-load.d.ts +6 -0
- package/dist/config/declaration-module-load.js +68 -0
- package/dist/config/defaults.d.ts +16 -0
- package/dist/config/defaults.js +60 -0
- package/dist/config/helpers.d.ts +7 -0
- package/dist/config/helpers.js +29 -0
- package/dist/config/index.d.ts +7 -0
- package/dist/config/index.js +11 -0
- package/dist/config/loader.d.ts +20 -0
- package/dist/config/loader.js +107 -0
- package/dist/config/normalizers/declaration.d.ts +11 -0
- package/dist/config/normalizers/declaration.js +122 -0
- package/dist/config/normalizers/pattern.d.ts +8 -0
- package/dist/config/normalizers/pattern.js +31 -0
- package/dist/config/runtime.d.ts +42 -0
- package/dist/config/runtime.js +337 -0
- package/dist/config/validator.d.ts +9 -0
- package/dist/config/validator.js +22 -0
- package/dist/declarations/codegen.d.ts +57 -0
- package/dist/declarations/codegen.js +279 -0
- package/dist/declarations/helpers.d.ts +6 -0
- package/dist/declarations/helpers.js +20 -0
- package/dist/declarations/index.d.ts +2 -0
- package/dist/declarations/index.js +1 -0
- package/dist/declarations/types.d.ts +193 -0
- package/dist/declarations/types.js +1 -0
- package/dist/figma/component-linking.d.ts +164 -0
- package/dist/figma/component-linking.js +1080 -0
- package/dist/figma/image-fills.d.ts +32 -0
- package/dist/figma/image-fills.js +211 -0
- package/dist/generated/build-meta.d.ts +4 -0
- package/dist/generated/build-meta.js +6 -0
- package/dist/index.d.ts +115 -0
- package/dist/index.js +301 -0
- package/dist/pipeline/archive.d.ts +19 -0
- package/dist/pipeline/archive.js +62 -0
- package/dist/pipeline/components.d.ts +5 -0
- package/dist/pipeline/components.js +7 -0
- package/dist/pipeline/documentation.d.ts +3 -0
- package/dist/pipeline/documentation.js +64 -0
- package/dist/pipeline/figma.d.ts +11 -0
- package/dist/pipeline/figma.js +142 -0
- package/dist/pipeline/hubspot/config.d.ts +179 -0
- package/dist/pipeline/hubspot/config.js +171 -0
- package/dist/pipeline/hubspot/emit.d.ts +101 -0
- package/dist/pipeline/hubspot/emit.js +283 -0
- package/dist/pipeline/index.d.ts +14 -0
- package/dist/pipeline/index.js +34 -0
- package/dist/pipeline/patterns.d.ts +8 -0
- package/dist/pipeline/patterns.js +8 -0
- package/dist/pipeline/styles.d.ts +10 -0
- package/dist/pipeline/styles.js +127 -0
- package/dist/pipeline/validation.d.ts +6 -0
- package/dist/pipeline/validation.js +23 -0
- package/dist/transformers/docgen/index.d.ts +24 -0
- package/dist/transformers/docgen/index.js +244 -0
- package/dist/transformers/plugins/csf-render.d.ts +5 -0
- package/dist/transformers/plugins/csf-render.js +406 -0
- package/dist/transformers/plugins/handlebars-previews.d.ts +12 -0
- package/dist/transformers/plugins/handlebars-previews.js +128 -0
- package/dist/transformers/plugins/index.d.ts +11 -0
- package/dist/transformers/plugins/index.js +10 -0
- package/dist/transformers/plugins/slot-probe-candidates.d.ts +159 -0
- package/dist/transformers/plugins/slot-probe-candidates.js +279 -0
- package/dist/transformers/plugins/slot-probe.d.ts +66 -0
- package/dist/transformers/plugins/slot-probe.js +298 -0
- package/dist/transformers/plugins/ssr-render.d.ts +33 -0
- package/dist/transformers/plugins/ssr-render.js +531 -0
- package/dist/transformers/plugins.d.ts +14 -0
- package/dist/transformers/plugins.js +15 -0
- package/dist/transformers/preview/component/api.d.ts +22 -0
- package/dist/transformers/preview/component/api.js +146 -0
- package/dist/transformers/preview/component/artifacts.d.ts +3 -0
- package/dist/transformers/preview/component/artifacts.js +103 -0
- package/dist/transformers/preview/component/build-shared-bundles.d.ts +83 -0
- package/dist/transformers/preview/component/build-shared-bundles.js +400 -0
- package/dist/transformers/preview/component/builder.d.ts +29 -0
- package/dist/transformers/preview/component/builder.js +638 -0
- package/dist/transformers/preview/component/css.d.ts +68 -0
- package/dist/transformers/preview/component/css.js +219 -0
- package/dist/transformers/preview/component/field-annotations.d.ts +129 -0
- package/dist/transformers/preview/component/field-annotations.js +325 -0
- package/dist/transformers/preview/component/html.d.ts +21 -0
- package/dist/transformers/preview/component/html.js +80 -0
- package/dist/transformers/preview/component/javascript.d.ts +24 -0
- package/dist/transformers/preview/component/javascript.js +162 -0
- package/dist/transformers/preview/component/normalizer.d.ts +35 -0
- package/dist/transformers/preview/component/normalizer.js +56 -0
- package/dist/transformers/preview/component/playwright-shared.d.ts +70 -0
- package/dist/transformers/preview/component/playwright-shared.js +164 -0
- package/dist/transformers/preview/component/preview-assets.d.ts +55 -0
- package/dist/transformers/preview/component/preview-assets.js +144 -0
- package/dist/transformers/preview/component/preview-merge.d.ts +53 -0
- package/dist/transformers/preview/component/preview-merge.js +50 -0
- package/dist/transformers/preview/component/preview-select.d.ts +86 -0
- package/dist/transformers/preview/component/preview-select.js +150 -0
- package/dist/transformers/preview/component/preview-server.d.ts +41 -0
- package/dist/transformers/preview/component/preview-server.js +112 -0
- package/dist/transformers/preview/component/preview-validation.d.ts +64 -0
- package/dist/transformers/preview/component/preview-validation.js +194 -0
- package/dist/transformers/preview/component/previews.d.ts +9 -0
- package/dist/transformers/preview/component/previews.js +6 -0
- package/dist/transformers/preview/component/screenshot.d.ts +90 -0
- package/dist/transformers/preview/component/screenshot.js +282 -0
- package/dist/transformers/preview/component/serialized-elements.d.ts +86 -0
- package/dist/transformers/preview/component/serialized-elements.js +118 -0
- package/dist/transformers/preview/component/summary.d.ts +6 -0
- package/dist/transformers/preview/component/summary.js +41 -0
- package/dist/transformers/preview/component.d.ts +13 -0
- package/dist/transformers/preview/component.js +26 -0
- package/dist/transformers/preview/height-reporter.d.ts +27 -0
- package/dist/transformers/preview/height-reporter.js +32 -0
- package/dist/transformers/preview/pattern/api.d.ts +11 -0
- package/dist/transformers/preview/pattern/api.js +58 -0
- package/dist/transformers/preview/pattern/builder.d.ts +17 -0
- package/dist/transformers/preview/pattern/builder.js +149 -0
- package/dist/transformers/preview/pattern/html.d.ts +25 -0
- package/dist/transformers/preview/pattern/html.js +95 -0
- package/dist/transformers/preview/slots.d.ts +109 -0
- package/dist/transformers/preview/slots.js +13 -0
- package/dist/transformers/preview/types.d.ts +292 -0
- package/dist/transformers/preview/types.js +7 -0
- package/dist/transformers/types.d.ts +60 -0
- package/dist/transformers/types.js +1 -0
- package/dist/transformers/utils/build.d.ts +27 -0
- package/dist/transformers/utils/build.js +77 -0
- package/dist/transformers/utils/csf.d.ts +16 -0
- package/dist/transformers/utils/csf.js +29 -0
- package/dist/transformers/utils/handlebars.d.ts +32 -0
- package/dist/transformers/utils/handlebars.js +73 -0
- package/dist/transformers/utils/html.d.ts +18 -0
- package/dist/transformers/utils/html.js +40 -0
- package/dist/transformers/utils/index.d.ts +13 -0
- package/dist/transformers/utils/index.js +20 -0
- package/dist/transformers/utils/module.d.ts +13 -0
- package/dist/transformers/utils/module.js +41 -0
- package/dist/transformers/utils/schema-loader.d.ts +19 -0
- package/dist/transformers/utils/schema-loader.js +61 -0
- package/dist/transformers/utils/schema.d.ts +33 -0
- package/dist/transformers/utils/schema.js +517 -0
- package/dist/transformers/utils/string.d.ts +36 -0
- package/dist/transformers/utils/string.js +52 -0
- package/dist/transformers/utils/svg-sprite.d.ts +16 -0
- package/dist/transformers/utils/svg-sprite.js +114 -0
- package/dist/transformers/utils/usage.d.ts +23 -0
- package/dist/transformers/utils/usage.js +282 -0
- package/dist/transformers/utils/vite-logger.d.ts +2 -0
- package/dist/transformers/utils/vite-logger.js +30 -0
- package/dist/transformers/validation/runner.d.ts +67 -0
- package/dist/transformers/validation/runner.js +277 -0
- package/dist/transformers/vite-config.d.ts +3 -0
- package/dist/transformers/vite-config.js +18 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/types/config.d.ts +472 -0
- package/dist/types/config.js +1 -0
- package/dist/types/font.d.ts +3 -0
- package/dist/types/font.js +1 -0
- package/dist/types/handoff-sync.d.ts +132 -0
- package/dist/types/handoff-sync.js +5 -0
- package/dist/types/history-purge.d.ts +112 -0
- package/dist/types/history-purge.js +18 -0
- package/dist/types/icon.d.ts +8 -0
- package/dist/types/icon.js +1 -0
- package/dist/types/preview.d.ts +138 -0
- package/dist/types/preview.js +1 -0
- package/dist/types/validation.d.ts +200 -0
- package/dist/types/validation.js +11 -0
- package/dist/utils/asset-upload-limits.d.ts +87 -0
- package/dist/utils/asset-upload-limits.js +129 -0
- package/dist/utils/design-md.d.ts +55 -0
- package/dist/utils/design-md.js +107 -0
- package/dist/utils/duration.d.ts +2 -0
- package/dist/utils/duration.js +2 -0
- package/dist/utils/filter.d.ts +31 -0
- package/dist/utils/filter.js +109 -0
- package/dist/utils/fs.d.ts +8 -0
- package/dist/utils/fs.js +31 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/line-diff.d.ts +25 -0
- package/dist/utils/line-diff.js +74 -0
- package/dist/utils/logger.d.ts +50 -0
- package/dist/utils/logger.js +158 -0
- package/dist/utils/path.d.ts +21 -0
- package/dist/utils/path.js +50 -0
- package/dist/utils/port.d.ts +15 -0
- package/dist/utils/port.js +38 -0
- package/dist/utils/rich-text.d.ts +228 -0
- package/dist/utils/rich-text.js +1087 -0
- package/dist/validators/axe.d.ts +47 -0
- package/dist/validators/axe.js +222 -0
- package/dist/validators/contrast.d.ts +33 -0
- package/dist/validators/contrast.js +235 -0
- package/dist/validators/index.d.ts +30 -0
- package/dist/validators/index.js +26 -0
- package/dist/validators/schema.d.ts +34 -0
- package/dist/validators/schema.js +138 -0
- package/docs/DEPENDENCIES.md +26 -0
- package/docs/DEPLOYMENT.md +110 -0
- package/docs/LOCAL-RIG.md +305 -0
- package/docs/README.md +15 -0
- package/docs/REGISTRY-SETUP.md +353 -0
- package/docs/STANDALONE-INSTALL.md +70 -0
- package/docs/WORKSPACE-PACKAGE-JSON.md +125 -0
- package/docs/api.md +657 -0
- package/docs/api_spec.yaml +450 -0
- package/docs/cli.md +86 -0
- package/docs/schemas/component.schema.json +167 -0
- package/docs/schemas/examples/button.json +83 -0
- package/drizzle.config.ts +10 -0
- package/package.json +271 -0
- package/postcss.config.mjs +8 -0
- package/scripts/assert-standalone-install.mjs +60 -0
- package/src/app/app/[...slug]/DocCatchAllClient.tsx +103 -0
- package/src/app/app/[...slug]/page.tsx +101 -0
- package/src/app/app/account/AccountClient.tsx +116 -0
- package/src/app/app/account/IntegrationsSection.tsx +273 -0
- package/src/app/app/account/SanityCard.tsx +473 -0
- package/src/app/app/account/ai-cost/page.tsx +141 -0
- package/src/app/app/account/appearance/AppearanceClient.tsx +433 -0
- package/src/app/app/account/appearance/page.tsx +52 -0
- package/src/app/app/account/integrations/page.tsx +37 -0
- package/src/app/app/account/layout.tsx +82 -0
- package/src/app/app/account/page.tsx +41 -0
- package/src/app/app/account/users/UsersClient.tsx +244 -0
- package/src/app/app/account/users/page.tsx +36 -0
- package/src/app/app/actions/ai-generate.ts +25 -0
- package/src/app/app/actions/components.ts +126 -0
- package/src/app/app/actions/patterns.ts +289 -0
- package/src/app/app/admin/ai-cost/AiCostClient.tsx +236 -0
- package/src/app/app/admin/ai-cost/page.tsx +56 -0
- package/src/app/app/admin/builds/BuildsClient.tsx +527 -0
- package/src/app/app/admin/builds/page.tsx +41 -0
- package/src/app/app/admin/integrations/page.tsx +32 -0
- package/src/app/app/admin/pages/PagesClient.tsx +282 -0
- package/src/app/app/admin/pages/edit/PageEditorClient.tsx +157 -0
- package/src/app/app/admin/pages/edit/page.tsx +48 -0
- package/src/app/app/admin/pages/page.tsx +31 -0
- package/src/app/app/admin/protection/ProtectionClient.tsx +235 -0
- package/src/app/app/admin/protection/page.tsx +33 -0
- package/src/app/app/admin/reference/ReferenceClient.tsx +150 -0
- package/src/app/app/admin/reference/page.tsx +38 -0
- package/src/app/app/admin/users/page.tsx +11 -0
- package/src/app/app/api/account/route.ts +36 -0
- package/src/app/app/api/admin/builds/status/route.ts +34 -0
- package/src/app/app/api/admin/cleanup-versions/route.ts +64 -0
- package/src/app/app/api/admin/contract-limit-audit/route.ts +126 -0
- package/src/app/app/api/admin/contract-render-audit/route.ts +116 -0
- package/src/app/app/api/admin/field-bridge-audit/route.ts +152 -0
- package/src/app/app/api/admin/migrate/route.ts +47 -0
- package/src/app/app/api/admin/playground-turns/route.ts +85 -0
- package/src/app/app/api/admin/purge-history/route.ts +119 -0
- package/src/app/app/api/auth/[...nextauth]/route.ts +30 -0
- package/src/app/app/api/component/[...path]/route.ts +141 -0
- package/src/app/app/api/component-artifact/[...path]/route.ts +18 -0
- package/src/app/app/api/components/route.ts +78 -0
- package/src/app/app/api/figma-plugin/auth/device/route.ts +40 -0
- package/src/app/app/api/figma-plugin/auth/revoke/route.ts +15 -0
- package/src/app/app/api/figma-plugin/auth/token/route.ts +50 -0
- package/src/app/app/api/figma-plugin/foundations/commit/route.ts +111 -0
- package/src/app/app/api/figma-plugin/foundations/preview/route.ts +69 -0
- package/src/app/app/api/figma-plugin/foundations/route.ts +49 -0
- package/src/app/app/api/handoff/admin/appearance/route.ts +80 -0
- package/src/app/app/api/handoff/admin/backfill-artifact-blobs/route.ts +48 -0
- package/src/app/app/api/handoff/admin/build-tasks/kill/route.ts +43 -0
- package/src/app/app/api/handoff/admin/build-tasks/route.ts +21 -0
- package/src/app/app/api/handoff/admin/invite/route.ts +18 -0
- package/src/app/app/api/handoff/admin/normalize-previews/route.ts +107 -0
- package/src/app/app/api/handoff/admin/reference-materials/route.ts +69 -0
- package/src/app/app/api/handoff/admin/remove/route.ts +18 -0
- package/src/app/app/api/handoff/admin/resend-invite/route.ts +18 -0
- package/src/app/app/api/handoff/admin/role/route.ts +18 -0
- package/src/app/app/api/handoff/admin/users/route.ts +16 -0
- package/src/app/app/api/handoff/ai/analyze-layout-guide/route.ts +172 -0
- package/src/app/app/api/handoff/ai/analyze-layout-guide/wireframe-style/wireframe-example-1.png +0 -0
- package/src/app/app/api/handoff/ai/analyze-layout-guide/wireframe-style/wireframe-example-2.png +0 -0
- package/src/app/app/api/handoff/ai/chat/route.ts +217 -0
- package/src/app/app/api/handoff/ai/component-screenshot/route.ts +43 -0
- package/src/app/app/api/handoff/ai/debug-foundation-raster/route.ts +162 -0
- package/src/app/app/api/handoff/ai/design-artifact/[id]/clone/route.ts +68 -0
- package/src/app/app/api/handoff/ai/design-artifact/[id]/public/route.ts +37 -0
- package/src/app/app/api/handoff/ai/design-artifact/[id]/route.ts +99 -0
- package/src/app/app/api/handoff/ai/design-artifact/[id]/status/route.ts +44 -0
- package/src/app/app/api/handoff/ai/design-artifact/route.ts +405 -0
- package/src/app/app/api/handoff/ai/design-artifact-extract/route.ts +37 -0
- package/src/app/app/api/handoff/ai/design-generation-job/[id]/route.ts +67 -0
- package/src/app/app/api/handoff/ai/design-generation-jobs/route.ts +23 -0
- package/src/app/app/api/handoff/ai/design-jobs/run/route.ts +102 -0
- package/src/app/app/api/handoff/ai/extract-url/route.ts +34 -0
- package/src/app/app/api/handoff/ai/foundation-preview/route.ts +44 -0
- package/src/app/app/api/handoff/ai/generate-component/route.ts +137 -0
- package/src/app/app/api/handoff/ai/generate-design/route.ts +210 -0
- package/src/app/app/api/handoff/ai/generate-image/route.ts +72 -0
- package/src/app/app/api/handoff/ai/generate-pattern/route.ts +86 -0
- package/src/app/app/api/handoff/ai/playground-chat/refine/route.ts +52 -0
- package/src/app/app/api/handoff/ai/playground-chat/route.ts +102 -0
- package/src/app/app/api/handoff/ai/status/route.ts +14 -0
- package/src/app/app/api/handoff/artifact-asset/route.ts +88 -0
- package/src/app/app/api/handoff/assets/[id]/raw/route.ts +49 -0
- package/src/app/app/api/handoff/assets/[id]/route.ts +76 -0
- package/src/app/app/api/handoff/assets/collections/route.ts +54 -0
- package/src/app/app/api/handoff/assets/confirm/route.ts +80 -0
- package/src/app/app/api/handoff/assets/icon-sets/route.ts +47 -0
- package/src/app/app/api/handoff/assets/presign/route.ts +41 -0
- package/src/app/app/api/handoff/assets/route.ts +89 -0
- package/src/app/app/api/handoff/assets/upload/route.ts +152 -0
- package/src/app/app/api/handoff/assets/usages/[id]/route.ts +21 -0
- package/src/app/app/api/handoff/assets/usages/route.ts +69 -0
- package/src/app/app/api/handoff/auth/request-reset/route.ts +9 -0
- package/src/app/app/api/handoff/auth/reset-password/route.ts +17 -0
- package/src/app/app/api/handoff/capture/health/route.ts +86 -0
- package/src/app/app/api/handoff/capture/jobs/route.ts +75 -0
- package/src/app/app/api/handoff/capture/run/route.ts +112 -0
- package/src/app/app/api/handoff/changelog/pushes/route.ts +49 -0
- package/src/app/app/api/handoff/changelog/route.ts +28 -0
- package/src/app/app/api/handoff/changes/why/route.ts +41 -0
- package/src/app/app/api/handoff/cms/connections/route.ts +182 -0
- package/src/app/app/api/handoff/cms/sanity/callback/route.ts +18 -0
- package/src/app/app/api/handoff/cms/sanity/categories/route.ts +146 -0
- package/src/app/app/api/handoff/cms/sanity/connect/route.ts +15 -0
- package/src/app/app/api/handoff/cms/sanity/publish/route.ts +161 -0
- package/src/app/app/api/handoff/cms/sanity/token/route.ts +87 -0
- package/src/app/app/api/handoff/components/[id]/screenshot.png/route.ts +101 -0
- package/src/app/app/api/handoff/components/[id]/thumbnail.svg/route.ts +158 -0
- package/src/app/app/api/handoff/components/build/route.ts +26 -0
- package/src/app/app/api/handoff/components/history/contract/route.ts +33 -0
- package/src/app/app/api/handoff/components/history/route.ts +35 -0
- package/src/app/app/api/handoff/components/history/version/route.ts +36 -0
- package/src/app/app/api/handoff/components/route.ts +56 -0
- package/src/app/app/api/handoff/components/validation/route.ts +36 -0
- package/src/app/app/api/handoff/design/workspace/brand-imagery-image/route.ts +75 -0
- package/src/app/app/api/handoff/design/workspace/route.ts +163 -0
- package/src/app/app/api/handoff/figma/component-properties/route.ts +34 -0
- package/src/app/app/api/handoff/figma/components/route.ts +21 -0
- package/src/app/app/api/handoff/figma/components/sync/route.ts +50 -0
- package/src/app/app/api/handoff/figma/fetch/route.ts +126 -0
- package/src/app/app/api/handoff/guest/assets/route.ts +52 -0
- package/src/app/app/api/handoff/guest/enter/route.ts +169 -0
- package/src/app/app/api/handoff/guest/submission/route.ts +209 -0
- package/src/app/app/api/handoff/guest/submission/submit/route.ts +63 -0
- package/src/app/app/api/handoff/image-slots/route.ts +24 -0
- package/src/app/app/api/handoff/navigation/prune/route.ts +106 -0
- package/src/app/app/api/handoff/pages/route.ts +90 -0
- package/src/app/app/api/handoff/patterns/[id]/clone/route.ts +69 -0
- package/src/app/app/api/handoff/patterns/[id]/manifest/route.ts +102 -0
- package/src/app/app/api/handoff/patterns/[id]/notes/route.ts +101 -0
- package/src/app/app/api/handoff/patterns/[id]/route.ts +41 -0
- package/src/app/app/api/handoff/patterns/[id]/thumbnail.svg/route.ts +70 -0
- package/src/app/app/api/handoff/patterns/route.ts +77 -0
- package/src/app/app/api/handoff/reference-materials/route.ts +40 -0
- package/src/app/app/api/handoff/review/[id]/route.ts +172 -0
- package/src/app/app/api/handoff/review/[id]/voice/route.ts +58 -0
- package/src/app/app/api/handoff/review/route.ts +31 -0
- package/src/app/app/api/handoff/share/[token]/route.ts +82 -0
- package/src/app/app/api/handoff/share/links/route.ts +48 -0
- package/src/app/app/api/handoff/share/route.ts +172 -0
- package/src/app/app/api/handoff/site-protection/route.ts +85 -0
- package/src/app/app/api/handoff/site-protection/unlock/route.ts +62 -0
- package/src/app/app/api/handoff/templates/[id]/submissions/route.ts +41 -0
- package/src/app/app/api/mcp/route.ts +39 -0
- package/src/app/app/api/oauth/authorization-server-metadata/route.ts +30 -0
- package/src/app/app/api/oauth/authorize/route.ts +158 -0
- package/src/app/app/api/oauth/device/approve/route.ts +32 -0
- package/src/app/app/api/oauth/device/route.ts +34 -0
- package/src/app/app/api/oauth/protected-resource-metadata/route.ts +26 -0
- package/src/app/app/api/oauth/register/route.ts +43 -0
- package/src/app/app/api/oauth/token/route.ts +94 -0
- package/src/app/app/api/openapi/route.ts +38 -0
- package/src/app/app/api/patterns/route.ts +8 -0
- package/src/app/app/api/registry/assets/ingest/route.ts +204 -0
- package/src/app/app/api/registry/assets/ingest-figma-fills/route.ts +81 -0
- package/src/app/app/api/registry/components/[id]/previews/[previewId]/route.ts +56 -0
- package/src/app/app/api/registry/components/[id]/previews/route.ts +66 -0
- package/src/app/app/api/registry/config/route.ts +50 -0
- package/src/app/app/api/registry/dtcg/download/route.ts +78 -0
- package/src/app/app/api/registry/dtcg/route.ts +133 -0
- package/src/app/app/api/registry/fonts/route.ts +67 -0
- package/src/app/app/api/registry/icons/download/route.ts +52 -0
- package/src/app/app/api/registry/icons/route.ts +47 -0
- package/src/app/app/api/registry/image-slots/route.ts +68 -0
- package/src/app/app/api/registry/logo.svg/route.ts +45 -0
- package/src/app/app/api/registry/logos/route.ts +47 -0
- package/src/app/app/api/registry/navigation/route.ts +52 -0
- package/src/app/app/api/registry/pages/route.ts +67 -0
- package/src/app/app/api/registry/theme/route.ts +51 -0
- package/src/app/app/api/registry/theme.css/route.ts +34 -0
- package/src/app/app/api/registry/tokens/route.ts +59 -0
- package/src/app/app/api/sync/changes/route.ts +24 -0
- package/src/app/app/api/sync/shared-assets/route.ts +79 -0
- package/src/app/app/api/sync/status/route.ts +12 -0
- package/src/app/app/api/sync/upload/route.ts +109 -0
- package/src/app/app/assets/AssetsClient.tsx +670 -0
- package/src/app/app/assets/[id]/AssetDetailClient.tsx +319 -0
- package/src/app/app/assets/[id]/page.tsx +8 -0
- package/src/app/app/assets/fonts/page.tsx +5 -0
- package/src/app/app/assets/logos/page.tsx +5 -0
- package/src/app/app/assets/page.tsx +5 -0
- package/src/app/app/cli/device/CliDeviceClient.tsx +104 -0
- package/src/app/app/cli/device/page.tsx +45 -0
- package/src/app/app/design/DesignClient.tsx +1682 -0
- package/src/app/app/design/SessionHistoryPanel.tsx +116 -0
- package/src/app/app/design/assets/[id]/page.tsx +11 -0
- package/src/app/app/design/assets/icons/page.tsx +8 -0
- package/src/app/app/design/assets/page.tsx +8 -0
- package/src/app/app/design/library/[id]/SavedDesignDetailClient.tsx +892 -0
- package/src/app/app/design/library/[id]/page.tsx +40 -0
- package/src/app/app/design/library/[id]/share/SharePublicClient.tsx +107 -0
- package/src/app/app/design/library/[id]/share/page.tsx +22 -0
- package/src/app/app/design/library/page.tsx +12 -0
- package/src/app/app/design/page.tsx +158 -0
- package/src/app/app/design/settings/SettingsClient.tsx +648 -0
- package/src/app/app/design/settings/page.tsx +41 -0
- package/src/app/app/design/settings/settings-constants.ts +96 -0
- package/src/app/app/design/v1/DesignClient.tsx +1316 -0
- package/src/app/app/design/v1/page.tsx +103 -0
- package/src/app/app/design/workbench-session.ts +54 -0
- package/src/app/app/design/workbench-types.ts +72 -0
- package/src/app/app/dev/local-setup/LocalSetupClient.tsx +119 -0
- package/src/app/app/dev/local-setup/McpSetupSection.tsx +174 -0
- package/src/app/app/dev/local-setup/page.tsx +5 -0
- package/src/app/app/developer/api/route.ts +13 -0
- package/src/app/app/developer/cli/page.tsx +192 -0
- package/src/app/app/developer/layout.tsx +57 -0
- package/src/app/app/developer/local-setup/page.tsx +37 -0
- package/src/app/app/developer/mcp/page.tsx +74 -0
- package/src/app/app/developer/page.tsx +111 -0
- package/src/app/app/developer/push-pull/page.tsx +130 -0
- package/src/app/app/fonts/[filename]/route.ts +41 -0
- package/src/app/app/foundations/[...slug]/page.tsx +83 -0
- package/src/app/app/foundations/assets/[id]/page.tsx +35 -0
- package/src/app/app/foundations/assets/page.tsx +31 -0
- package/src/app/app/foundations/border-radius/page.tsx +179 -0
- package/src/app/app/foundations/colors/page.tsx +166 -0
- package/src/app/app/foundations/effects/page.tsx +124 -0
- package/src/app/app/foundations/elevation/page.tsx +209 -0
- package/src/app/app/foundations/error.tsx +22 -0
- package/src/app/app/foundations/grid/page.tsx +315 -0
- package/src/app/app/foundations/icons/IconsPageClient.tsx +100 -0
- package/src/app/app/foundations/icons/[name]/SingleIconClient.tsx +231 -0
- package/src/app/app/foundations/icons/[name]/page.tsx +44 -0
- package/src/app/app/foundations/icons/page.tsx +58 -0
- package/src/app/app/foundations/logo/page.tsx +213 -0
- package/src/app/app/foundations/motion/page.tsx +228 -0
- package/src/app/app/foundations/page.tsx +65 -0
- package/src/app/app/foundations/spacing/page.tsx +171 -0
- package/src/app/app/foundations/typography/page.tsx +115 -0
- package/src/app/app/layout.tsx +131 -0
- package/src/app/app/library/LibraryClient.tsx +567 -0
- package/src/app/app/library/page.tsx +46 -0
- package/src/app/app/login/LoginClient.tsx +75 -0
- package/src/app/app/login/page.tsx +33 -0
- package/src/app/app/page.tsx +178 -0
- package/src/app/app/patterns/PatternBrowserClient.tsx +263 -0
- package/src/app/app/patterns/page.tsx +14 -0
- package/src/app/app/playground/PlaygroundClient.tsx +84 -0
- package/src/app/app/playground/[id]/page.tsx +215 -0
- package/src/app/app/playground/page.tsx +79 -0
- package/src/app/app/providers.tsx +72 -0
- package/src/app/app/reset-password/ResetPasswordClient.tsx +89 -0
- package/src/app/app/reset-password/page.tsx +24 -0
- package/src/app/app/review/ReviewClient.tsx +31 -0
- package/src/app/app/review/page.tsx +56 -0
- package/src/app/app/s/[token]/page.tsx +317 -0
- package/src/app/app/setup/SetupClient.tsx +87 -0
- package/src/app/app/setup/actions.ts +53 -0
- package/src/app/app/setup/page.tsx +28 -0
- package/src/app/app/system/FigmaFetchControls.tsx +163 -0
- package/src/app/app/system/FigmaSyncPanel.tsx +357 -0
- package/src/app/app/system/NewComponentForm.tsx +272 -0
- package/src/app/app/system/SystemPageClient.tsx +137 -0
- package/src/app/app/system/changelog/ChangelogClient.tsx +608 -0
- package/src/app/app/system/changelog/page.tsx +28 -0
- package/src/app/app/system/component/[component]/ComponentAssetsPanel.tsx +108 -0
- package/src/app/app/system/component/[component]/ComponentDetailClient.tsx +420 -0
- package/src/app/app/system/component/[component]/ComponentImageSlotsPanel.tsx +163 -0
- package/src/app/app/system/component/[component]/ComponentVersionHistory.tsx +430 -0
- package/src/app/app/system/component/[component]/VersionCompare.tsx +267 -0
- package/src/app/app/system/component/[component]/page.tsx +68 -0
- package/src/app/app/system/component/page.tsx +5 -0
- package/src/app/app/system/figma-sync/FigmaSyncPageClient.tsx +35 -0
- package/src/app/app/system/figma-sync/page.tsx +21 -0
- package/src/app/app/system/health/ComponentHealthTable.tsx +217 -0
- package/src/app/app/system/health/HealthDashboardClient.tsx +141 -0
- package/src/app/app/system/health/RuleBreakdownTable.tsx +123 -0
- package/src/app/app/system/health/ScoreBadge.tsx +58 -0
- package/src/app/app/system/health/TrendChart.tsx +76 -0
- package/src/app/app/system/health/ValidatorBreakdownBars.tsx +35 -0
- package/src/app/app/system/health/health-types.ts +7 -0
- package/src/app/app/system/health/page.tsx +100 -0
- package/src/app/app/system/page.tsx +21 -0
- package/src/app/app/system/pattern/[pattern]/PatternDetailClient.tsx +216 -0
- package/src/app/app/system/pattern/[pattern]/page.tsx +53 -0
- package/src/app/app/system/pattern/page.tsx +5 -0
- package/src/app/app/unlock/UnlockClient.tsx +100 -0
- package/src/app/app/unlock/page.tsx +40 -0
- package/src/app/components/Auth/AuthControls.tsx +146 -0
- package/src/app/components/Brief/BuildList.tsx +78 -0
- package/src/app/components/Brief/BuildPanel.tsx +460 -0
- package/src/app/components/Brief/export-blocks.ts +47 -0
- package/src/app/components/Chat/ChatActionCard.tsx +97 -0
- package/src/app/components/Chat/ChatChangelogFeed.tsx +252 -0
- package/src/app/components/Chat/ChatComponentGrid.tsx +144 -0
- package/src/app/components/Chat/ChatContext.tsx +192 -0
- package/src/app/components/Chat/ChatDrawer.tsx +162 -0
- package/src/app/components/Chat/ChatFab.tsx +41 -0
- package/src/app/components/Chat/ChatInput.tsx +150 -0
- package/src/app/components/Chat/ChatMessage.tsx +125 -0
- package/src/app/components/Chat/ChatValidationPanel.tsx +161 -0
- package/src/app/components/CloudFeatureGate.tsx +27 -0
- package/src/app/components/Component/BestPracticesCard.tsx +36 -0
- package/src/app/components/Component/Cards.tsx +76 -0
- package/src/app/components/Component/ComponentLists.tsx +279 -0
- package/src/app/components/Component/ComponentWorkbenchDialog.tsx +230 -0
- package/src/app/components/Component/InlineComponentEditor.tsx +163 -0
- package/src/app/components/Component/PageSliceResolver.tsx +81 -0
- package/src/app/components/Component/Preview.tsx +1091 -0
- package/src/app/components/Component/slices/BestPracticesSlice.tsx +14 -0
- package/src/app/components/Component/slices/CardsSlice.tsx +17 -0
- package/src/app/components/Component/slices/ComponentDisplaySlice.tsx +101 -0
- package/src/app/components/Component/slices/PropertiesSlice.tsx +24 -0
- package/src/app/components/Component/slices/TextSlice.tsx +23 -0
- package/src/app/components/Component/slices/ValidationResultsSlice.tsx +31 -0
- package/src/app/components/Component/slices/index.ts +14 -0
- package/src/app/components/Component/usePreviews.ts +97 -0
- package/src/app/components/ComponentDesignTokens.tsx +271 -0
- package/src/app/components/ComponentGuidelines.tsx +21 -0
- package/src/app/components/ComponentNotFound.tsx +35 -0
- package/src/app/components/ComponentSearch.tsx +96 -0
- package/src/app/components/CopyCode.tsx +59 -0
- package/src/app/components/CopyToClipboard.tsx +63 -0
- package/src/app/components/Design/DevHandoffPanel.tsx +481 -0
- package/src/app/components/DownloadTokens.tsx +78 -0
- package/src/app/components/Footer.tsx +46 -0
- package/src/app/components/Foundations/BrandColorSwatches.tsx +151 -0
- package/src/app/components/Foundations/ColorContrast.tsx +179 -0
- package/src/app/components/Foundations/ColorGrid.tsx +199 -0
- package/src/app/components/Foundations/ColorInfo.tsx +64 -0
- package/src/app/components/Foundations/ColorSpaces.tsx +119 -0
- package/src/app/components/Foundations/ColorTailwind.tsx +58 -0
- package/src/app/components/Foundations/ColorsDisplay.tsx +136 -0
- package/src/app/components/Foundations/DisplayLogo.tsx +16 -0
- package/src/app/components/Foundations/IconCatalogGrid.tsx +145 -0
- package/src/app/components/Foundations/ProvenanceBadge.tsx +40 -0
- package/src/app/components/Foundations/RulesSheet.tsx +204 -0
- package/src/app/components/Foundations/TokenOutputTabs.tsx +88 -0
- package/src/app/components/Foundations/TypographyExample.tsx +275 -0
- package/src/app/components/Guest/GuestAuthoring.tsx +589 -0
- package/src/app/components/Guest/GuestEditor.tsx +157 -0
- package/src/app/components/Hero.tsx +42 -0
- package/src/app/components/InlineEdit/InlineEditField.tsx +162 -0
- package/src/app/components/InlineEdit/InlineEditHeader.tsx +98 -0
- package/src/app/components/Layout/BuildBadge.tsx +90 -0
- package/src/app/components/Layout/Header.tsx +54 -0
- package/src/app/components/Layout/Main.tsx +84 -0
- package/src/app/components/Markdown/CodeHighlight.tsx +328 -0
- package/src/app/components/Markdown/MarkdownComponents.tsx +270 -0
- package/src/app/components/Markdown/MarkdownEditor.tsx +153 -0
- package/src/app/components/Markdown/WysiwygEditor.tsx +364 -0
- package/src/app/components/Markdown/wysiwyg.css +89 -0
- package/src/app/components/ModeSwitcher.tsx +29 -0
- package/src/app/components/NavLink.tsx +26 -0
- package/src/app/components/Navigation/AnchorNav.tsx +94 -0
- package/src/app/components/Navigation/AnchorNavLink.tsx +41 -0
- package/src/app/components/Navigation/AnchorNavNew.tsx +27 -0
- package/src/app/components/Navigation/MainNav.tsx +84 -0
- package/src/app/components/Navigation/MobileNav.tsx +123 -0
- package/src/app/components/Navigation/PrevNextNav.tsx +53 -0
- package/src/app/components/Navigation/SideNav.tsx +336 -0
- package/src/app/components/Navigation/anchor-slugify.ts +6 -0
- package/src/app/components/Playground/AiChatPanel.tsx +1483 -0
- package/src/app/components/Playground/ComponentCard.tsx +65 -0
- package/src/app/components/Playground/ComponentLibrary.tsx +228 -0
- package/src/app/components/Playground/CoverImagePicker.tsx +281 -0
- package/src/app/components/Playground/EditContext.tsx +247 -0
- package/src/app/components/Playground/EditSheet.tsx +82 -0
- package/src/app/components/Playground/FieldGuardrailsContext.ts +31 -0
- package/src/app/components/Playground/FieldLinkContext.ts +138 -0
- package/src/app/components/Playground/FieldMediaContext.ts +50 -0
- package/src/app/components/Playground/FindingsList.tsx +149 -0
- package/src/app/components/Playground/MediaBrowser.tsx +397 -0
- package/src/app/components/Playground/PageChecks.tsx +71 -0
- package/src/app/components/Playground/PageTitle.tsx +93 -0
- package/src/app/components/Playground/PlaygroundBuilder.tsx +1271 -0
- package/src/app/components/Playground/PlaygroundContext.tsx +990 -0
- package/src/app/components/Playground/PlaygroundWorkbench.tsx +260 -0
- package/src/app/components/Playground/Preview.tsx +1465 -0
- package/src/app/components/Playground/PublishToSanityDialog.tsx +468 -0
- package/src/app/components/Playground/SavePatternDialog.tsx +231 -0
- package/src/app/components/Playground/ShareTemplate.tsx +503 -0
- package/src/app/components/Playground/SortableItem.tsx +94 -0
- package/src/app/components/Playground/Wizard/ApiKeySettings.tsx +139 -0
- package/src/app/components/Playground/Wizard/PageImporter.tsx +384 -0
- package/src/app/components/Playground/Wizard/WizardDialog.tsx +329 -0
- package/src/app/components/Playground/Wizard/llm-client.ts +87 -0
- package/src/app/components/Playground/Wizard/prompt-builder.ts +134 -0
- package/src/app/components/Playground/Wizard/response-parser.ts +80 -0
- package/src/app/components/Playground/fields/ButtonField.tsx +24 -0
- package/src/app/components/Playground/fields/Field.tsx +344 -0
- package/src/app/components/Playground/fields/FieldLabel.tsx +9 -0
- package/src/app/components/Playground/fields/FunctionField.tsx +19 -0
- package/src/app/components/Playground/fields/ImageField.tsx +239 -0
- package/src/app/components/Playground/fields/LinkField.tsx +24 -0
- package/src/app/components/Playground/fields/RawJsonField.tsx +60 -0
- package/src/app/components/Playground/fields/RichTextField.tsx +220 -0
- package/src/app/components/Playground/fields/SelectField.tsx +55 -0
- package/src/app/components/Playground/fields/SlotField.tsx +40 -0
- package/src/app/components/Playground/fields/TextField.tsx +125 -0
- package/src/app/components/Playground/fields/VideoFileField.tsx +67 -0
- package/src/app/components/Playground/fields/content-only.ts +121 -0
- package/src/app/components/Playground/fields/field-type.ts +84 -0
- package/src/app/components/Playground/fields/reseed.ts +140 -0
- package/src/app/components/Playground/inline-edit-script.ts +596 -0
- package/src/app/components/Playground/link-guard-script.ts +50 -0
- package/src/app/components/Playground/types.ts +76 -0
- package/src/app/components/Playground/usePublishToSanity.ts +153 -0
- package/src/app/components/Review/ReviewQueueClient.tsx +288 -0
- package/src/app/components/SideNav/Custom.tsx +40 -0
- package/src/app/components/SideNavNew.tsx +280 -0
- package/src/app/components/Typography/Headers.tsx +50 -0
- package/src/app/components/Validation/ValidationFrameworkResults.tsx +208 -0
- package/src/app/components/Validation/ValidationResults.tsx +60 -0
- package/src/app/components/cards/CardsWithIcons.tsx +38 -0
- package/src/app/components/context/AuthUiContext.tsx +13 -0
- package/src/app/components/context/ConfigContext.tsx +43 -0
- package/src/app/components/context/HandoffCapabilitiesContext.tsx +40 -0
- package/src/app/components/context/HotReloadProvider.tsx +38 -0
- package/src/app/components/context/PreviewContext.tsx +135 -0
- package/src/app/components/library/AssetCard.tsx +166 -0
- package/src/app/components/library/KindPicker.tsx +66 -0
- package/src/app/components/library/LaneTabs.tsx +54 -0
- package/src/app/components/library/LifecycleBadge.tsx +28 -0
- package/src/app/components/library/LifecyclePicker.tsx +53 -0
- package/src/app/components/library/MetaControl.tsx +294 -0
- package/src/app/components/library/OwnerAttribution.tsx +106 -0
- package/src/app/components/library/PageNotes.tsx +191 -0
- package/src/app/components/library/PageOrigin.tsx +124 -0
- package/src/app/components/library/VisibilityBadge.tsx +25 -0
- package/src/app/components/library/VisibilityPicker.tsx +56 -0
- package/src/app/components/library/index.ts +7 -0
- package/src/app/components/ui/accordion.tsx +49 -0
- package/src/app/components/ui/alert.tsx +39 -0
- package/src/app/components/ui/attachment.tsx +204 -0
- package/src/app/components/ui/badge.tsx +32 -0
- package/src/app/components/ui/breadcrumb.tsx +68 -0
- package/src/app/components/ui/bubble.tsx +125 -0
- package/src/app/components/ui/button.tsx +45 -0
- package/src/app/components/ui/card.tsx +76 -0
- package/src/app/components/ui/collapsible.tsx +9 -0
- package/src/app/components/ui/dialog.tsx +80 -0
- package/src/app/components/ui/drawer.tsx +103 -0
- package/src/app/components/ui/dropdown-menu.tsx +176 -0
- package/src/app/components/ui/input.tsx +22 -0
- package/src/app/components/ui/json-tree-view.tsx +250 -0
- package/src/app/components/ui/label.tsx +24 -0
- package/src/app/components/ui/marker.tsx +69 -0
- package/src/app/components/ui/message-scroller.tsx +130 -0
- package/src/app/components/ui/message.tsx +92 -0
- package/src/app/components/ui/mobile-nav.tsx +95 -0
- package/src/app/components/ui/navigation-menu.tsx +116 -0
- package/src/app/components/ui/popover.tsx +31 -0
- package/src/app/components/ui/radio-group.tsx +36 -0
- package/src/app/components/ui/select.tsx +132 -0
- package/src/app/components/ui/separator.tsx +29 -0
- package/src/app/components/ui/sheet.tsx +140 -0
- package/src/app/components/ui/sidebar.tsx +609 -0
- package/src/app/components/ui/skeleton.tsx +15 -0
- package/src/app/components/ui/switch.tsx +29 -0
- package/src/app/components/ui/table.tsx +60 -0
- package/src/app/components/ui/tabs.tsx +53 -0
- package/src/app/components/ui/textarea.tsx +19 -0
- package/src/app/components/ui/toggle-group.tsx +51 -0
- package/src/app/components/ui/toggle.tsx +39 -0
- package/src/app/components/ui/tooltip.tsx +30 -0
- package/src/app/components/util/colors.ts +93 -0
- package/src/app/components/util/dtcg.ts +50 -0
- package/src/app/components/util/index.ts +963 -0
- package/src/app/components/util/theme-provider.tsx +11 -0
- package/src/app/components/util/token.ts +70 -0
- package/src/app/components.json +21 -0
- package/src/app/css/index.css +275 -0
- package/src/app/css/theme.css +14 -0
- package/src/app/css.d.ts +1 -0
- package/src/app/hooks/use-mobile.tsx +17 -0
- package/src/app/instrumentation.ts +39 -0
- package/src/app/lib/adapter-kit/errors.ts +141 -0
- package/src/app/lib/adapter-kit/types.ts +637 -0
- package/src/app/lib/admin-build-tasks-types.ts +41 -0
- package/src/app/lib/api-path.ts +12 -0
- package/src/app/lib/asset-search.ts +167 -0
- package/src/app/lib/asset-types.ts +88 -0
- package/src/app/lib/asset-upload-source.ts +314 -0
- package/src/app/lib/auth.ts +244 -0
- package/src/app/lib/authoring-guardrails.ts +591 -0
- package/src/app/lib/authoring-shapes.ts +261 -0
- package/src/app/lib/authz/guest.ts +131 -0
- package/src/app/lib/authz/notes.ts +102 -0
- package/src/app/lib/authz/policy.ts +228 -0
- package/src/app/lib/authz/review.ts +180 -0
- package/src/app/lib/authz/vocab.ts +175 -0
- package/src/app/lib/brief-components.ts +212 -0
- package/src/app/lib/build-audits.ts +239 -0
- package/src/app/lib/capture-chromium-plan.ts +123 -0
- package/src/app/lib/capture-determinism.ts +397 -0
- package/src/app/lib/capture-kinds.ts +207 -0
- package/src/app/lib/change-digest.ts +108 -0
- package/src/app/lib/chat-turn-guards.ts +149 -0
- package/src/app/lib/cli-sync-jwt.ts +110 -0
- package/src/app/lib/client/poll-generation-job.ts +85 -0
- package/src/app/lib/client-name.ts +29 -0
- package/src/app/lib/cms-migration-prompt.ts +99 -0
- package/src/app/lib/component-capture.ts +156 -0
- package/src/app/lib/component-id.ts +14 -0
- package/src/app/lib/component-thumbnail.ts +200 -0
- package/src/app/lib/composition-summary.ts +84 -0
- package/src/app/lib/content-length-plan.ts +512 -0
- package/src/app/lib/contract-limit-audit.ts +228 -0
- package/src/app/lib/contract-render-audit.ts +208 -0
- package/src/app/lib/data/component-row.ts +121 -0
- package/src/app/lib/data/components-digest.ts +116 -0
- package/src/app/lib/data/dynamic-provider.ts +765 -0
- package/src/app/lib/data/has-payload.ts +18 -0
- package/src/app/lib/data/hybrid-provider.ts +6 -0
- package/src/app/lib/data/index.ts +45 -0
- package/src/app/lib/data/menu-merge.ts +417 -0
- package/src/app/lib/data/page-metadata.ts +85 -0
- package/src/app/lib/data/pattern-merge.ts +78 -0
- package/src/app/lib/data/static-provider.ts +237 -0
- package/src/app/lib/data/types.ts +125 -0
- package/src/app/lib/db/auto-migrate.ts +205 -0
- package/src/app/lib/db/bootstrap-admin.ts +45 -0
- package/src/app/lib/db/capture-job-queries.ts +333 -0
- package/src/app/lib/db/changelog-queries.ts +623 -0
- package/src/app/lib/db/cms-connection-config.ts +21 -0
- package/src/app/lib/db/cms-connection-queries.ts +218 -0
- package/src/app/lib/db/component-artifact-queries.ts +115 -0
- package/src/app/lib/db/component-facets.ts +535 -0
- package/src/app/lib/db/component-preview-queries.ts +224 -0
- package/src/app/lib/db/component-version-queries.ts +682 -0
- package/src/app/lib/db/dialect.ts +15 -0
- package/src/app/lib/db/event-log-store.ts +47 -0
- package/src/app/lib/db/grant-queries.ts +827 -0
- package/src/app/lib/db/history-purge-plan.ts +446 -0
- package/src/app/lib/db/history-purge.ts +233 -0
- package/src/app/lib/db/index.ts +92 -0
- package/src/app/lib/db/migrations/0000_init.sql +226 -0
- package/src/app/lib/db/migrations/0001_design_workspace.sql +12 -0
- package/src/app/lib/db/migrations/0002_boring_ricochet.sql +50 -0
- package/src/app/lib/db/migrations/0003_demonic_flatman.sql +41 -0
- package/src/app/lib/db/migrations/0004_validation_runs.sql +18 -0
- package/src/app/lib/db/migrations/0005_component_versions.sql +21 -0
- package/src/app/lib/db/migrations/0006_token_and_page_changes.sql +40 -0
- package/src/app/lib/db/migrations/0007_design_spec.sql +9 -0
- package/src/app/lib/db/migrations/0008_design_generation_jobs.sql +22 -0
- package/src/app/lib/db/migrations/0009_assets.sql +80 -0
- package/src/app/lib/db/migrations/0010_registry_dtcg.sql +13 -0
- package/src/app/lib/db/migrations/0011_dtcg_brands.sql +5 -0
- package/src/app/lib/db/migrations/0012_icon_logo_registry.sql +13 -0
- package/src/app/lib/db/migrations/0013_registry_fonts.sql +13 -0
- package/src/app/lib/db/migrations/0014_asset_blobs.sql +9 -0
- package/src/app/lib/db/migrations/0015_appearance.sql +7 -0
- package/src/app/lib/db/migrations/0016_image_slots.sql +16 -0
- package/src/app/lib/db/migrations/0017_component_preview.sql +20 -0
- package/src/app/lib/db/migrations/0018_token_change_details.sql +26 -0
- package/src/app/lib/db/migrations/0019_change_why.sql +18 -0
- package/src/app/lib/db/migrations/0020_pattern_change.sql +17 -0
- package/src/app/lib/db/migrations/0021_mcp_oauth_connector.sql +37 -0
- package/src/app/lib/db/migrations/0022_dtcg_source.sql +21 -0
- package/src/app/lib/db/migrations/0023_perf_indexes.sql +30 -0
- package/src/app/lib/db/migrations/0024_phase_b_visibility.sql +40 -0
- package/src/app/lib/db/migrations/0027_guest_authoring.sql +49 -0
- package/src/app/lib/db/migrations/0028_invite_to_build.sql +99 -0
- package/src/app/lib/db/migrations/0029_pages_templates_reflow.sql +121 -0
- package/src/app/lib/db/migrations/0030_retire_briefs.sql +71 -0
- package/src/app/lib/db/migrations/0031_drop_brief_columns.sql +32 -0
- package/src/app/lib/db/migrations/0033_site_protection.sql +45 -0
- package/src/app/lib/db/migrations/0034_brand_imagery.sql +8 -0
- package/src/app/lib/db/migrations/0035_history_provenance.sql +42 -0
- package/src/app/lib/db/migrations/0036_cms_connections.sql +68 -0
- package/src/app/lib/db/migrations/0037_component_preview_purpose.sql +17 -0
- package/src/app/lib/db/migrations/0038_capture_job.sql +87 -0
- package/src/app/lib/db/migrations/meta/0000_snapshot.json +1424 -0
- package/src/app/lib/db/migrations/meta/0002_snapshot.json +1644 -0
- package/src/app/lib/db/migrations/meta/0003_snapshot.json +1820 -0
- package/src/app/lib/db/migrations/meta/_journal.json +258 -0
- package/src/app/lib/db/note-queries.ts +184 -0
- package/src/app/lib/db/pattern-write.ts +1094 -0
- package/src/app/lib/db/property-delta.ts +117 -0
- package/src/app/lib/db/push-grouping.ts +256 -0
- package/src/app/lib/db/queries.ts +2426 -0
- package/src/app/lib/db/registry-queries.ts +607 -0
- package/src/app/lib/db/schema-active.ts +2 -0
- package/src/app/lib/db/schema-pg.ts +1201 -0
- package/src/app/lib/db/schema.ts +2 -0
- package/src/app/lib/db/seed.ts +117 -0
- package/src/app/lib/db/sync-queries.ts +542 -0
- package/src/app/lib/db/token-flatten.ts +95 -0
- package/src/app/lib/db/validation-queries.ts +82 -0
- package/src/app/lib/db/version-baseline.ts +42 -0
- package/src/app/lib/design-workspace-client.ts +194 -0
- package/src/app/lib/design-workspace-format.ts +294 -0
- package/src/app/lib/docx-copy.ts +279 -0
- package/src/app/lib/dtcg-axes.ts +138 -0
- package/src/app/lib/dtcg-normalizer.ts +370 -0
- package/src/app/lib/edit-operations.ts +275 -0
- package/src/app/lib/email.ts +199 -0
- package/src/app/lib/error-summary.ts +79 -0
- package/src/app/lib/evals/cases.ts +678 -0
- package/src/app/lib/evals/copy-coverage.ts +147 -0
- package/src/app/lib/evals/copy-decks.ts +296 -0
- package/src/app/lib/field-lens.ts +308 -0
- package/src/app/lib/field-marks.ts +206 -0
- package/src/app/lib/figma-plugin-contract.ts +104 -0
- package/src/app/lib/figma-sync-types.ts +56 -0
- package/src/app/lib/generated/build-meta.ts +8 -0
- package/src/app/lib/guest-editable.ts +371 -0
- package/src/app/lib/handoff-capabilities.ts +91 -0
- package/src/app/lib/health-types.ts +324 -0
- package/src/app/lib/hubspot-field-map.ts +770 -0
- package/src/app/lib/hubspot-module/build-module.ts +238 -0
- package/src/app/lib/hubspot-module/context.ts +259 -0
- package/src/app/lib/hubspot-module/fields/boolean.ts +24 -0
- package/src/app/lib/hubspot-module/fields/button.ts +70 -0
- package/src/app/lib/hubspot-module/fields/fields.ts +104 -0
- package/src/app/lib/hubspot-module/fields/generic.ts +183 -0
- package/src/app/lib/hubspot-module/fields/hubdb.ts +168 -0
- package/src/app/lib/hubspot-module/fields/image.ts +65 -0
- package/src/app/lib/hubspot-module/fields/menu.ts +14 -0
- package/src/app/lib/hubspot-module/fields/object.ts +42 -0
- package/src/app/lib/hubspot-module/fields/select.ts +43 -0
- package/src/app/lib/hubspot-module/fields/text.ts +68 -0
- package/src/app/lib/hubspot-module/fields/url.ts +57 -0
- package/src/app/lib/hubspot-module/fields/utils.ts +36 -0
- package/src/app/lib/hubspot-module/fields/video.ts +75 -0
- package/src/app/lib/hubspot-module/index.ts +30 -0
- package/src/app/lib/hubspot-module/transpile.ts +727 -0
- package/src/app/lib/hubspot-module/types.ts +238 -0
- package/src/app/lib/hubspot-module-build.ts +50 -0
- package/src/app/lib/image-bytes.ts +133 -0
- package/src/app/lib/image-dimensions.ts +214 -0
- package/src/app/lib/image-field-write.ts +51 -0
- package/src/app/lib/image-generation-request.ts +142 -0
- package/src/app/lib/image-target.ts +175 -0
- package/src/app/lib/json-shape.ts +121 -0
- package/src/app/lib/library-image-seed.ts +236 -0
- package/src/app/lib/login-required-messages.ts +17 -0
- package/src/app/lib/mcp/apps/component-gallery.bundle.ts +2 -0
- package/src/app/lib/mcp/apps/component-gallery.client.ts +208 -0
- package/src/app/lib/mcp/apps/component-preview.bundle.ts +2 -0
- package/src/app/lib/mcp/apps/component-preview.client.ts +140 -0
- package/src/app/lib/mcp/apps/token-palette.bundle.ts +2 -0
- package/src/app/lib/mcp/apps/token-palette.client.ts +199 -0
- package/src/app/lib/mcp/contract-report.ts +200 -0
- package/src/app/lib/mcp/create-server.ts +2622 -0
- package/src/app/lib/mcp/history-shapes.ts +72 -0
- package/src/app/lib/mcp/project-profile.ts +82 -0
- package/src/app/lib/mcp/scaffold-helpers.ts +93 -0
- package/src/app/lib/mcp/stack-guides/bootstrap-handlebars.md +62 -0
- package/src/app/lib/mcp/stack-guides/react-scss.md +7 -0
- package/src/app/lib/mcp/stack-guides/react-tailwind.md +9 -0
- package/src/app/lib/mcp/stack-guides/tailwind-handlebars.md +142 -0
- package/src/app/lib/mcp/stack-guides.ts +68 -0
- package/src/app/lib/mcp/tool-catalog.ts +132 -0
- package/src/app/lib/mcp-auth.ts +85 -0
- package/src/app/lib/merge-block-values.ts +868 -0
- package/src/app/lib/normalize-preview-values.ts +244 -0
- package/src/app/lib/notify.ts +213 -0
- package/src/app/lib/oauth-scopes.ts +33 -0
- package/src/app/lib/page-exemplars.ts +112 -0
- package/src/app/lib/page-manifest.ts +162 -0
- package/src/app/lib/page-provenance.ts +231 -0
- package/src/app/lib/page-slug.ts +68 -0
- package/src/app/lib/page-title.ts +44 -0
- package/src/app/lib/page-urls.ts +41 -0
- package/src/app/lib/passwords.ts +33 -0
- package/src/app/lib/pattern-payload.ts +122 -0
- package/src/app/lib/pattern-thumbnail.ts +234 -0
- package/src/app/lib/placeholder-audit.ts +196 -0
- package/src/app/lib/placeholder-copy.ts +370 -0
- package/src/app/lib/playground-prompt-link.ts +46 -0
- package/src/app/lib/preview-groups.ts +107 -0
- package/src/app/lib/preview-purpose-labels.ts +37 -0
- package/src/app/lib/preview-purpose.ts +37 -0
- package/src/app/lib/preview-render-target.ts +27 -0
- package/src/app/lib/preview-url.ts +15 -0
- package/src/app/lib/publish-to-sanity-state.ts +605 -0
- package/src/app/lib/rate-limit.ts +75 -0
- package/src/app/lib/remote-handoff-client.ts +33 -0
- package/src/app/lib/sanity-assets.ts +211 -0
- package/src/app/lib/sanity-categories.ts +178 -0
- package/src/app/lib/sanity-config.ts +266 -0
- package/src/app/lib/sanity-integration-state.ts +235 -0
- package/src/app/lib/sanity-mapping.ts +3284 -0
- package/src/app/lib/sanity-portable-text.ts +640 -0
- package/src/app/lib/sanity-publish.ts +337 -0
- package/src/app/lib/sanity-references.ts +295 -0
- package/src/app/lib/server/admin-users.ts +162 -0
- package/src/app/lib/server/ai-client.ts +633 -0
- package/src/app/lib/server/ai-proxy.ts +70 -0
- package/src/app/lib/server/api-gate.ts +148 -0
- package/src/app/lib/server/appearance.ts +169 -0
- package/src/app/lib/server/asset-generation-worker.ts +133 -0
- package/src/app/lib/server/asset-ingest-store.ts +55 -0
- package/src/app/lib/server/asset-ingest.ts +347 -0
- package/src/app/lib/server/auth-reset.ts +107 -0
- package/src/app/lib/server/capture-browser.ts +130 -0
- package/src/app/lib/server/capture-harness.ts +319 -0
- package/src/app/lib/server/capture-worker.ts +178 -0
- package/src/app/lib/server/change-why.ts +195 -0
- package/src/app/lib/server/cli-device-oauth.ts +159 -0
- package/src/app/lib/server/cms-providers.ts +53 -0
- package/src/app/lib/server/component-build-preload.cjs +3 -0
- package/src/app/lib/server/component-build-worker.ts +196 -0
- package/src/app/lib/server/component-builder.ts +96 -0
- package/src/app/lib/server/component-capture-reads.ts +172 -0
- package/src/app/lib/server/component-generation-context.ts +165 -0
- package/src/app/lib/server/component-generation-images.ts +40 -0
- package/src/app/lib/server/component-generation-llm.ts +232 -0
- package/src/app/lib/server/component-generation-run.ts +289 -0
- package/src/app/lib/server/component-generation-schedule.ts +12 -0
- package/src/app/lib/server/component-preview-screenshot.ts +111 -0
- package/src/app/lib/server/component-scaffold.ts +88 -0
- package/src/app/lib/server/component-visual-compare.ts +90 -0
- package/src/app/lib/server/design-artifact-persist.ts +49 -0
- package/src/app/lib/server/design-asset-extractor.ts +414 -0
- package/src/app/lib/server/design-asset-schedule.ts +36 -0
- package/src/app/lib/server/design-asset-worker-spawn.ts +64 -0
- package/src/app/lib/server/design-asset-worker.ts +24 -0
- package/src/app/lib/server/design-generation-worker.ts +281 -0
- package/src/app/lib/server/design-prompt-builder.ts +322 -0
- package/src/app/lib/server/design-spec-generator.ts +739 -0
- package/src/app/lib/server/design-spec-types.ts +219 -0
- package/src/app/lib/server/design-system-context.ts +141 -0
- package/src/app/lib/server/design-token-summary.ts +133 -0
- package/src/app/lib/server/design-workspace.ts +230 -0
- package/src/app/lib/server/dev-handoff.ts +334 -0
- package/src/app/lib/server/doc-pages.ts +442 -0
- package/src/app/lib/server/event-log.ts +138 -0
- package/src/app/lib/server/fetch-asset-bytes.ts +161 -0
- package/src/app/lib/server/figma-audit-api.ts +188 -0
- package/src/app/lib/server/figma-auth.ts +113 -0
- package/src/app/lib/server/figma-fetch-runner.ts +241 -0
- package/src/app/lib/server/figma-fetch-worker.ts +130 -0
- package/src/app/lib/server/figma-fetch.ts +90 -0
- package/src/app/lib/server/figma-fills-ingest.ts +201 -0
- package/src/app/lib/server/figma-plugin-properties-sync.ts +438 -0
- package/src/app/lib/server/figma-sync-service.ts +1076 -0
- package/src/app/lib/server/find-assets.ts +53 -0
- package/src/app/lib/server/foundation-image.tsx +671 -0
- package/src/app/lib/server/generation-queue-health.ts +108 -0
- package/src/app/lib/server/guest-context.ts +62 -0
- package/src/app/lib/server/guest-session.ts +153 -0
- package/src/app/lib/server/handoff-app-paths.ts +77 -0
- package/src/app/lib/server/handoff-component-patch.ts +123 -0
- package/src/app/lib/server/handoff-config-load.ts +29 -0
- package/src/app/lib/server/handoff-config-project.ts +104 -0
- package/src/app/lib/server/mcp-oauth-connector.ts +269 -0
- package/src/app/lib/server/node-tsx-worker-launcher.cjs +32 -0
- package/src/app/lib/server/oauth-state.ts +83 -0
- package/src/app/lib/server/passphrase.ts +121 -0
- package/src/app/lib/server/pattern-api-map.ts +123 -0
- package/src/app/lib/server/playground-chat.ts +1890 -0
- package/src/app/lib/server/public-api-paths.ts +34 -0
- package/src/app/lib/server/reference-material-generator.ts +341 -0
- package/src/app/lib/server/reference-material-ids.ts +8 -0
- package/src/app/lib/server/reference-material-persist.ts +25 -0
- package/src/app/lib/server/reference-material-schedule.ts +13 -0
- package/src/app/lib/server/registry-cache.ts +110 -0
- package/src/app/lib/server/request-public-url.ts +19 -0
- package/src/app/lib/server/runtime-config.ts +43 -0
- package/src/app/lib/server/s3-assets.ts +188 -0
- package/src/app/lib/server/sanity-connection.ts +176 -0
- package/src/app/lib/server/sanity-oauth.ts +34 -0
- package/src/app/lib/server/scaffold-args.ts +392 -0
- package/src/app/lib/server/secret-box.ts +85 -0
- package/src/app/lib/server/serverless-chromium.ts +93 -0
- package/src/app/lib/server/share-link-token.ts +106 -0
- package/src/app/lib/server/site-protection.ts +145 -0
- package/src/app/lib/server/spawn-tsx-worker.ts +47 -0
- package/src/app/lib/server/store-image-asset.ts +220 -0
- package/src/app/lib/server/token-freshness.ts +23 -0
- package/src/app/lib/server/unlock-cookie.ts +70 -0
- package/src/app/lib/server/upload-asset-to-library.ts +128 -0
- package/src/app/lib/server/url-extract.ts +117 -0
- package/src/app/lib/server/voice-audit.ts +209 -0
- package/src/app/lib/set-at-args-path.ts +36 -0
- package/src/app/lib/site-gate.ts +374 -0
- package/src/app/lib/slot-capabilities.ts +487 -0
- package/src/app/lib/source-copy.ts +295 -0
- package/src/app/lib/storage/artifact-images.ts +225 -0
- package/src/app/lib/storage/capture-artifacts.ts +109 -0
- package/src/app/lib/swap-image-src.ts +121 -0
- package/src/app/lib/sync-auth.ts +124 -0
- package/src/app/lib/tool-payload.ts +101 -0
- package/src/app/lib/turn-log.ts +78 -0
- package/src/app/lib/url-safety.ts +46 -0
- package/src/app/lib/utils.ts +35 -0
- package/src/app/lib/workbench-level.ts +56 -0
- package/src/app/middleware-hook.mjs +2 -0
- package/src/app/next-env.d.ts +6 -0
- package/src/app/next.config.mjs +355 -0
- package/src/app/postcss.config.mjs +8 -0
- package/src/app/proxy.ts +133 -0
- package/src/app/public/assets/css/preview.css +27 -0
- package/src/app/public/assets/design/blocks/callout-cta.jpg +0 -0
- package/src/app/public/assets/design/blocks/carousel.png +0 -0
- package/src/app/public/assets/design/blocks/container.png +0 -0
- package/src/app/public/assets/design/blocks/customer-stories.jpg +0 -0
- package/src/app/public/assets/design/blocks/faq.jpg +0 -0
- package/src/app/public/assets/design/blocks/features-comparison.jpg +0 -0
- package/src/app/public/assets/design/blocks/table.jpg +0 -0
- package/src/app/public/assets/images/blocks.svg +150 -0
- package/src/app/public/assets/images/check-circle.svg +10 -0
- package/src/app/public/assets/images/colors.svg +186 -0
- package/src/app/public/assets/images/components.png +0 -0
- package/src/app/public/assets/images/components.svg +183 -0
- package/src/app/public/assets/images/illustration-sample-2.svg +102 -0
- package/src/app/public/assets/images/illustration-sample-3.svg +124 -0
- package/src/app/public/assets/images/illustration-sample-bw-1.svg +84 -0
- package/src/app/public/assets/images/illustration-sample-bw-2.svg +88 -0
- package/src/app/public/assets/images/illustration-sample-bw-3.svg +125 -0
- package/src/app/public/assets/images/illustration-sample.svg +110 -0
- package/src/app/public/assets/images/typography.svg +279 -0
- package/src/app/public/assets/images/usage-correct.png +0 -0
- package/src/app/public/assets/images/usage-wrong.png +0 -0
- package/src/app/public/assets/images/x-circle.svg +10 -0
- package/src/app/public/assets/js/preview.js +90 -0
- package/src/app/public/assets/svg/activity.svg +1 -0
- package/src/app/public/assets/svg/add.svg +1 -0
- package/src/app/public/assets/svg/airplay.svg +1 -0
- package/src/app/public/assets/svg/alert-circle.svg +1 -0
- package/src/app/public/assets/svg/alert-octagon.svg +1 -0
- package/src/app/public/assets/svg/alert-triangle.svg +1 -0
- package/src/app/public/assets/svg/align-center.svg +1 -0
- package/src/app/public/assets/svg/align-justify.svg +1 -0
- package/src/app/public/assets/svg/align-left.svg +1 -0
- package/src/app/public/assets/svg/arrow-down-circle.svg +1 -0
- package/src/app/public/assets/svg/arrow-left-circle.svg +1 -0
- package/src/app/public/assets/svg/arrow-right-circle.svg +1 -0
- package/src/app/public/assets/svg/arrow-right.svg +4 -0
- package/src/app/public/assets/svg/arrow-up-circle.svg +1 -0
- package/src/app/public/assets/svg/bell-off.svg +1 -0
- package/src/app/public/assets/svg/bell.svg +1 -0
- package/src/app/public/assets/svg/camera.svg +1 -0
- package/src/app/public/assets/svg/cast.svg +1 -0
- package/src/app/public/assets/svg/check.svg +1 -0
- package/src/app/public/assets/svg/clock.svg +1 -0
- package/src/app/public/assets/svg/code.svg +1 -0
- package/src/app/public/assets/svg/component-accordion.svg +56 -0
- package/src/app/public/assets/svg/component-alert.svg +34 -0
- package/src/app/public/assets/svg/component-button.svg +63 -0
- package/src/app/public/assets/svg/component-checkbox.svg +41 -0
- package/src/app/public/assets/svg/component-input.svg +30 -0
- package/src/app/public/assets/svg/component-modal.svg +63 -0
- package/src/app/public/assets/svg/component-pagination.svg +82 -0
- package/src/app/public/assets/svg/component-radio.svg +15 -0
- package/src/app/public/assets/svg/component-select.svg +48 -0
- package/src/app/public/assets/svg/component-switch.svg +6 -0
- package/src/app/public/assets/svg/component-table.svg +45 -0
- package/src/app/public/assets/svg/component-tabs.svg +34 -0
- package/src/app/public/assets/svg/component-tooltip.svg +60 -0
- package/src/app/public/assets/svg/component.svg +48 -0
- package/src/app/public/assets/svg/copy.svg +1 -0
- package/src/app/public/assets/svg/delivery.svg +1 -0
- package/src/app/public/assets/svg/download.svg +1 -0
- package/src/app/public/assets/svg/file-jpg.svg +20 -0
- package/src/app/public/assets/svg/file-svg.svg +31 -0
- package/src/app/public/assets/svg/file-zip.svg +24 -0
- package/src/app/public/assets/svg/hero-brand-assets.svg +44 -0
- package/src/app/public/assets/svg/hero-colors.svg +10 -0
- package/src/app/public/assets/svg/hero-components.svg +68 -0
- package/src/app/public/assets/svg/hero-design.svg +20 -0
- package/src/app/public/assets/svg/hero-effects.svg +1 -0
- package/src/app/public/assets/svg/illustration-sample.svg +82 -0
- package/src/app/public/assets/svg/image.svg +8 -0
- package/src/app/public/assets/svg/link.svg +1 -0
- package/src/app/public/assets/svg/logo.svg +8 -0
- package/src/app/public/assets/svg/moon.svg +1 -0
- package/src/app/public/assets/svg/motiv-logo-dark-example.svg +11 -0
- package/src/app/public/assets/svg/motiv-logo-example.svg +11 -0
- package/src/app/public/assets/svg/plus-circle.svg +1 -0
- package/src/app/public/assets/svg/react.svg +10 -0
- package/src/app/public/assets/svg/search-laptop.svg +20 -0
- package/src/app/public/assets/svg/search.svg +1 -0
- package/src/app/public/assets/svg/send.svg +10 -0
- package/src/app/public/assets/svg/share.svg +1 -0
- package/src/app/public/assets/svg/small-accordion.svg +9 -0
- package/src/app/public/assets/svg/small-button.svg +9 -0
- package/src/app/public/assets/svg/small-pagination.svg +14 -0
- package/src/app/public/assets/svg/small-radio.svg +15 -0
- package/src/app/public/assets/svg/small-select.svg +9 -0
- package/src/app/public/assets/svg/small-table.svg +16 -0
- package/src/app/public/assets/svg/small-toggle.svg +9 -0
- package/src/app/public/assets/svg/sun.svg +1 -0
- package/src/app/public/assets/svg/token-alignment.svg +5 -0
- package/src/app/public/assets/svg/token-border-radius.svg +3 -0
- package/src/app/public/assets/svg/token-border-width.svg +10 -0
- package/src/app/public/assets/svg/token-spacing-horizontal.svg +8 -0
- package/src/app/public/assets/svg/token-spacing-vertical.svg +8 -0
- package/src/app/public/assets/svg/token-type-small.svg +5 -0
- package/src/app/public/assets/svg/x.svg +1 -0
- package/src/app/public/assets/svg/zap.svg +1 -0
- package/src/app/public/favicon.ico +0 -0
- package/src/app/public/fonts/readme.md +4 -0
- package/src/app/public/handoff-logo.svg +38 -0
- package/src/app/public/logo.svg +13 -0
- package/src/app/public/openapi.yaml +1818 -0
- package/src/app/public/robots.txt +0 -0
- package/src/app/tsconfig.json +53 -0
- package/src/app/types/middleware-hook.d.ts +10 -0
- package/src/app/types/next-auth-augmentation.d.ts +20 -0
- package/src/app-builder/README.md +43 -0
- package/src/app-builder/build.ts +741 -0
- package/src/app-builder/client-config.ts +124 -0
- package/src/app-builder/config-diff/index.ts +4 -0
- package/src/app-builder/config-diff/registry.ts +23 -0
- package/src/app-builder/config-diff/snapshot.ts +51 -0
- package/src/app-builder/config-diff/strategies/pattern.ts +80 -0
- package/src/app-builder/config-diff/types.ts +36 -0
- package/src/app-builder/index.ts +7 -0
- package/src/app-builder/path-contract.ts +81 -0
- package/src/app-builder/paths.ts +90 -0
- package/src/app-builder/watchers/component.ts +72 -0
- package/src/app-builder/watchers/utils.ts +44 -0
- package/src/app-builder/watchers.ts +345 -0
- package/src/app-builder/websocket.ts +72 -0
- package/src/cache/README.md +49 -0
- package/src/cache/build-cache.ts +567 -0
- package/src/cache/file-state.ts +170 -0
- package/src/cache/index.ts +46 -0
- package/src/cache/push-state.ts +201 -0
- package/src/cli/README.md +12 -0
- package/src/cli/create.ts +366 -0
- package/src/cli/eject.ts +93 -0
- package/src/cli/fetch-design-md.ts +60 -0
- package/src/cli/figma-audit.ts +76 -0
- package/src/cli/init-claude-core.ts +111 -0
- package/src/cli/make.ts +203 -0
- package/src/cli/scaffold.ts +651 -0
- package/src/cli/sync/apply-declaration-pull.ts +257 -0
- package/src/cli/sync/apply-pull.ts +223 -0
- package/src/cli/sync/cli-auth-store.ts +51 -0
- package/src/cli/sync/collect-build-artifacts.ts +159 -0
- package/src/cli/sync/collect-referenced-images.ts +204 -0
- package/src/cli/sync/declaration-patch.ts +192 -0
- package/src/cli/sync/hash.ts +12 -0
- package/src/cli/sync/open-browser.ts +37 -0
- package/src/cli/sync/push-provenance.ts +109 -0
- package/src/cli/sync/push-registry-content.ts +1025 -0
- package/src/cli/sync/push-shared-assets.ts +62 -0
- package/src/cli/sync/resolve-declaration-payload.ts +231 -0
- package/src/cli/sync/resolve-declaration.ts +18 -0
- package/src/cli/sync/run-cli-login.ts +110 -0
- package/src/cli/sync/run-history-purge.ts +142 -0
- package/src/cli/sync/run-pull.ts +112 -0
- package/src/cli/sync/run-push.ts +702 -0
- package/src/cli/sync/run-sync-status.ts +37 -0
- package/src/cli/sync/sync-remote-env.ts +64 -0
- package/src/cli/sync/sync-state.ts +42 -0
- package/src/cli/tokens/ensure-default-brand.ts +115 -0
- package/src/cli/tokens/migrate-legacy.ts +261 -0
- package/src/cli/tokens/parse-css-brands.ts +208 -0
- package/src/cli/tokens/transform.ts +134 -0
- package/src/cli.ts +62 -0
- package/src/commands/README.md +25 -0
- package/src/commands/audit/figma-components.ts +37 -0
- package/src/commands/build/app.ts +32 -0
- package/src/commands/build/components.ts +25 -0
- package/src/commands/build/hubspot.ts +267 -0
- package/src/commands/dev/index.ts +20 -0
- package/src/commands/eject/config.ts +20 -0
- package/src/commands/eject/pages.ts +20 -0
- package/src/commands/eject/theme.ts +20 -0
- package/src/commands/fetch/index.ts +20 -0
- package/src/commands/history-purge.ts +67 -0
- package/src/commands/index.ts +67 -0
- package/src/commands/init/index.ts +17 -0
- package/src/commands/init/vercel.ts +112 -0
- package/src/commands/init-claude.ts +61 -0
- package/src/commands/login.ts +39 -0
- package/src/commands/logout.ts +22 -0
- package/src/commands/make/component.ts +34 -0
- package/src/commands/make/page.ts +47 -0
- package/src/commands/make/template.ts +47 -0
- package/src/commands/mcp-init.ts +111 -0
- package/src/commands/mcp-token.ts +32 -0
- package/src/commands/prepare-runtime.ts +39 -0
- package/src/commands/pull.ts +28 -0
- package/src/commands/push-all.ts +202 -0
- package/src/commands/push-assets.ts +52 -0
- package/src/commands/push-tokens.ts +52 -0
- package/src/commands/push.ts +91 -0
- package/src/commands/scaffold/index.ts +22 -0
- package/src/commands/start/index.ts +20 -0
- package/src/commands/sync-status.ts +21 -0
- package/src/commands/tokens-build.ts +118 -0
- package/src/commands/types.ts +6 -0
- package/src/commands/utils.ts +21 -0
- package/src/commands/validate/components.ts +27 -0
- package/src/commands/validate.ts +189 -0
- package/src/commands/vercel-build.ts +96 -0
- package/src/config/README.md +32 -0
- package/src/config/declaration-module-load.ts +74 -0
- package/src/config/defaults.ts +78 -0
- package/src/config/helpers.ts +43 -0
- package/src/config/index.ts +16 -0
- package/src/config/loader.ts +131 -0
- package/src/config/normalizers/declaration.ts +180 -0
- package/src/config/normalizers/pattern.ts +56 -0
- package/src/config/runtime.ts +426 -0
- package/src/config/validator.ts +24 -0
- package/src/declarations/codegen.ts +367 -0
- package/src/declarations/helpers.ts +36 -0
- package/src/declarations/index.ts +20 -0
- package/src/declarations/types.ts +214 -0
- package/src/figma/component-linking.ts +1415 -0
- package/src/figma/image-fills.ts +247 -0
- package/src/generated/build-meta.ts +8 -0
- package/src/index.d.ts +13 -0
- package/src/index.ts +369 -0
- package/src/pipeline/README.md +21 -0
- package/src/pipeline/archive.ts +75 -0
- package/src/pipeline/components.ts +9 -0
- package/src/pipeline/documentation.ts +77 -0
- package/src/pipeline/figma.ts +173 -0
- package/src/pipeline/hubspot/config.ts +288 -0
- package/src/pipeline/hubspot/emit.ts +385 -0
- package/src/pipeline/index.ts +38 -0
- package/src/pipeline/patterns.ts +12 -0
- package/src/pipeline/styles.ts +154 -0
- package/src/pipeline/validation.ts +25 -0
- package/src/stacks/bootstrap-handlebars.md +117 -0
- package/src/stacks/react-scss.md +126 -0
- package/src/stacks/react-tailwind.md +123 -0
- package/src/stacks/tailwind-handlebars.md +142 -0
- package/src/transformers/README.md +19 -0
- package/src/transformers/docgen/index.ts +305 -0
- package/src/transformers/plugins/csf-render.ts +485 -0
- package/src/transformers/plugins/handlebars-previews.ts +194 -0
- package/src/transformers/plugins/index.ts +14 -0
- package/src/transformers/plugins/slot-probe-candidates.ts +386 -0
- package/src/transformers/plugins/slot-probe.ts +366 -0
- package/src/transformers/plugins/ssr-render.ts +622 -0
- package/src/transformers/plugins.ts +17 -0
- package/src/transformers/preview/component/api.ts +175 -0
- package/src/transformers/preview/component/artifacts.ts +112 -0
- package/src/transformers/preview/component/build-shared-bundles.ts +453 -0
- package/src/transformers/preview/component/builder.ts +754 -0
- package/src/transformers/preview/component/css.ts +253 -0
- package/src/transformers/preview/component/field-annotations.ts +400 -0
- package/src/transformers/preview/component/html.ts +96 -0
- package/src/transformers/preview/component/javascript.ts +182 -0
- package/src/transformers/preview/component/normalizer.ts +83 -0
- package/src/transformers/preview/component/playwright-shared.ts +183 -0
- package/src/transformers/preview/component/preview-assets.ts +158 -0
- package/src/transformers/preview/component/preview-merge.ts +95 -0
- package/src/transformers/preview/component/preview-select.ts +184 -0
- package/src/transformers/preview/component/preview-server.ts +128 -0
- package/src/transformers/preview/component/preview-validation.ts +255 -0
- package/src/transformers/preview/component/previews.ts +12 -0
- package/src/transformers/preview/component/screenshot.ts +306 -0
- package/src/transformers/preview/component/serialized-elements.ts +124 -0
- package/src/transformers/preview/component/summary.ts +54 -0
- package/src/transformers/preview/component.ts +31 -0
- package/src/transformers/preview/height-reporter.ts +37 -0
- package/src/transformers/preview/pattern/api.ts +83 -0
- package/src/transformers/preview/pattern/builder.ts +192 -0
- package/src/transformers/preview/pattern/html.ts +115 -0
- package/src/transformers/preview/slots.ts +105 -0
- package/src/transformers/preview/types.ts +302 -0
- package/src/transformers/types.ts +68 -0
- package/src/transformers/utils/build.ts +85 -0
- package/src/transformers/utils/csf.ts +48 -0
- package/src/transformers/utils/handlebars.ts +92 -0
- package/src/transformers/utils/html.ts +44 -0
- package/src/transformers/utils/index.ts +27 -0
- package/src/transformers/utils/module.ts +54 -0
- package/src/transformers/utils/schema-loader.ts +68 -0
- package/src/transformers/utils/schema.ts +569 -0
- package/src/transformers/utils/string.ts +55 -0
- package/src/transformers/utils/svg-sprite.ts +139 -0
- package/src/transformers/utils/usage.ts +317 -0
- package/src/transformers/utils/vite-logger.ts +33 -0
- package/src/transformers/validation/runner.ts +351 -0
- package/src/transformers/vite-config.ts +21 -0
- package/src/types/README.md +12 -0
- package/src/types/config.ts +482 -0
- package/src/types/font.ts +3 -0
- package/src/types/handoff-sync.ts +145 -0
- package/src/types/history-purge.ts +141 -0
- package/src/types/icon.ts +8 -0
- package/src/types/preview.ts +136 -0
- package/src/types/validation.ts +213 -0
- package/src/utils/README.md +14 -0
- package/src/utils/asset-upload-limits.ts +157 -0
- package/src/utils/design-md.ts +152 -0
- package/src/utils/duration.ts +3 -0
- package/src/utils/filter.ts +134 -0
- package/src/utils/fs.ts +35 -0
- package/src/utils/index.ts +6 -0
- package/src/utils/line-diff.ts +80 -0
- package/src/utils/logger.ts +176 -0
- package/src/utils/path.ts +61 -0
- package/src/utils/port.ts +46 -0
- package/src/utils/rich-text.ts +1202 -0
- package/src/validators/axe.ts +288 -0
- package/src/validators/contrast.ts +270 -0
- package/src/validators/index.ts +42 -0
- package/src/validators/schema.ts +191 -0
- package/tailwind.config.ts +96 -0
- package/templates/default/README.md.tpl +15 -0
- package/templates/default/components/button/Button.jsx.tpl +64 -0
- package/templates/default/components/button/Button.tsx.tpl +92 -0
- package/templates/default/components/button/button.react.handoff.js.tpl +31 -0
- package/templates/default/components/button/button.react.handoff.ts.tpl +31 -0
- package/templates/default/env.tpl +2 -0
- package/templates/default/gitignore.tpl +7 -0
- package/templates/default/handoff.config.js.tpl +216 -0
- package/templates/default/handoff.config.ts.tpl +196 -0
- package/templates/default/handoff.config.with-examples.js.tpl +215 -0
- package/templates/default/handoff.config.with-examples.ts.tpl +208 -0
- package/templates/default/package.json.tpl +19 -0
- package/templates/default/tsconfig.json.tpl +24 -0
- package/templates/workflows/hubspot-deploy.yml +134 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { PushProvenance } from '../../types/handoff-sync';
|
|
2
|
+
import type Handoff from '../../index';
|
|
3
|
+
export type RunPushOptions = {
|
|
4
|
+
/** When set and non-empty, only these component ids are pushed (must exist in config). */
|
|
5
|
+
componentIds?: string[];
|
|
6
|
+
/** When set and non-empty, only these pattern ids are pushed (must exist in config). */
|
|
7
|
+
patternIds?: string[];
|
|
8
|
+
/** When set and non-empty, only these page slugs are pushed (paths under `pages/` without `.md`, e.g. `about` or `guides/colors`). */
|
|
9
|
+
pageSlugs?: string[];
|
|
10
|
+
/** List changes that would be uploaded without calling the remote API (no HANDOFF_CLOUD_* required). */
|
|
11
|
+
dryRun?: boolean;
|
|
12
|
+
/** Run local component/pattern build before collecting artifacts (default true when pushing components/patterns). */
|
|
13
|
+
build?: boolean;
|
|
14
|
+
/** Skip build artifacts; upload declaration metadata only. */
|
|
15
|
+
metadataOnly?: boolean;
|
|
16
|
+
/** Skip build step; upload existing artifacts only. */
|
|
17
|
+
noBuild?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Skip work that is provably unnecessary. Two independent decisions hang off this:
|
|
20
|
+
* - rebuild? — from the workspace build cache (.handoff/.cache/build-cache.json)
|
|
21
|
+
* - re-upload? — from THIS registry's upload state
|
|
22
|
+
* (.handoff/.cache/push-state/<registry>.json)
|
|
23
|
+
* Ignored when handoff.force is set.
|
|
24
|
+
*/
|
|
25
|
+
skipUnchanged?: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Re-upload every component to this registry without rebuilding anything. For a
|
|
28
|
+
* registry that has fallen behind (a fresh rig, a restored database) where the local
|
|
29
|
+
* artifacts are known good — `--force` would also spend minutes rebuilding them.
|
|
30
|
+
*/
|
|
31
|
+
forceUpload?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Optional human-authored "why" for this push. Stamped onto every change's
|
|
34
|
+
* data so the registry records it on each component/page version
|
|
35
|
+
* (`handoff_*` change tables). Surfaces in the changelog.
|
|
36
|
+
*/
|
|
37
|
+
message?: string;
|
|
38
|
+
/**
|
|
39
|
+
* who / when / why for this push. `push:all` mints one and passes it to every step so components,
|
|
40
|
+
* pages and tokens all land under the same `pushId`; a bare `push` mints its own.
|
|
41
|
+
*/
|
|
42
|
+
provenance?: PushProvenance;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Scan local project and POST declarations + pages to the remote Handoff API.
|
|
46
|
+
*/
|
|
47
|
+
export declare function runPush(handoff: Handoff, opts?: RunPushOptions): Promise<void>;
|
|
@@ -0,0 +1,585 @@
|
|
|
1
|
+
import { buildPatterns } from '../../pipeline/patterns.js';
|
|
2
|
+
import matter from 'gray-matter';
|
|
3
|
+
import fs from 'fs-extra';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { Logger } from '../../utils/logger.js';
|
|
6
|
+
import { collectComponentBuildArtifacts, collectComponentSourceFiles, collectPatternBuildArtifacts, collectSharedComponentAssets, isBinaryArtifactFilename, } from './collect-build-artifacts.js';
|
|
7
|
+
import { applyImageRewrites, collectReferencedImages } from './collect-referenced-images.js';
|
|
8
|
+
import { pushComponentImages } from './push-registry-content.js';
|
|
9
|
+
import { pushSharedAssets } from './push-shared-assets.js';
|
|
10
|
+
import { resolveComponentDeclarationForSync, resolvePatternDeclarationForSync, } from './resolve-declaration-payload.js';
|
|
11
|
+
import { resolvePushProvenance, warnWhenNoWhy } from './push-provenance.js';
|
|
12
|
+
import { getSyncBearerToken, resolveSyncRemoteUrl } from './sync-remote-env.js';
|
|
13
|
+
import { loadBuildCache, saveBuildCache, createEmptyCache, computeComponentFileStates, computeGlobalDepsState, needsSyncRebuild, recordSyncBuild, } from '../../cache/build-cache.js';
|
|
14
|
+
import { createEmptyPushState, getPushStatePath, hasUploadChanged, loadPushState, normalizeRegistryIdentity, recordComponentUploaded, savePushState, } from '../../cache/push-state.js';
|
|
15
|
+
async function collectMarkdownFiles(rootDir) {
|
|
16
|
+
const out = [];
|
|
17
|
+
if (!(await fs.pathExists(rootDir)))
|
|
18
|
+
return out;
|
|
19
|
+
const walk = async (dir) => {
|
|
20
|
+
const names = await fs.readdir(dir);
|
|
21
|
+
for (const n of names) {
|
|
22
|
+
const p = path.join(dir, n);
|
|
23
|
+
const st = await fs.stat(p);
|
|
24
|
+
if (st.isDirectory())
|
|
25
|
+
await walk(p);
|
|
26
|
+
else if (n.endsWith('.md'))
|
|
27
|
+
out.push(p);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
await walk(rootDir);
|
|
31
|
+
return out;
|
|
32
|
+
}
|
|
33
|
+
function normalizePageSlug(s) {
|
|
34
|
+
return s.replace(/\\/g, '/').replace(/^\/+|\/+$/g, '');
|
|
35
|
+
}
|
|
36
|
+
function shouldRunBuild(opts, pushingComponentsOrPatterns) {
|
|
37
|
+
if (opts?.metadataOnly)
|
|
38
|
+
return false;
|
|
39
|
+
if (opts?.noBuild)
|
|
40
|
+
return false;
|
|
41
|
+
if (!pushingComponentsOrPatterns)
|
|
42
|
+
return false;
|
|
43
|
+
if (opts?.build === false)
|
|
44
|
+
return false;
|
|
45
|
+
return true;
|
|
46
|
+
}
|
|
47
|
+
async function buildEntity(handoff, kind, id) {
|
|
48
|
+
if (kind === 'component') {
|
|
49
|
+
await handoff.component(id);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
await buildPatterns(handoff, { onlyPatternIds: new Set([id]) });
|
|
53
|
+
}
|
|
54
|
+
function attachArtifacts(data, files, shared) {
|
|
55
|
+
const buildArtifacts = { ...shared, ...files };
|
|
56
|
+
if (Object.keys(buildArtifacts).length === 0)
|
|
57
|
+
return data;
|
|
58
|
+
return { ...data, buildArtifacts };
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Scan local project and POST declarations + pages to the remote Handoff API.
|
|
62
|
+
*/
|
|
63
|
+
export async function runPush(handoff, opts) {
|
|
64
|
+
// Screenshots and validators share a single headless Chromium process that
|
|
65
|
+
// is opened lazily on the first call to getSharedBrowser(). We MUST close
|
|
66
|
+
// it before returning; otherwise Node.js keeps the chromium child process
|
|
67
|
+
// alive and the CLI hangs indefinitely after "Push complete."
|
|
68
|
+
try {
|
|
69
|
+
await _runPushInner(handoff, opts);
|
|
70
|
+
}
|
|
71
|
+
finally {
|
|
72
|
+
const { closeSharedBrowser } = await import('../../transformers/preview/component/playwright-shared.js');
|
|
73
|
+
await closeSharedBrowser();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
async function _runPushInner(handoff, opts) {
|
|
77
|
+
const workPath = handoff.workingPath;
|
|
78
|
+
const dryRun = Boolean(opts?.dryRun);
|
|
79
|
+
// Minted here, once, and stamped on every row this push produces (history spec §2.3). Without it
|
|
80
|
+
// the changelog can only show 69 unrelated rows where there was one push. `commitSha`/`branch`
|
|
81
|
+
// and the commit subject come from the workspace git if there is one; nothing read git before.
|
|
82
|
+
const provenance = opts?.provenance ?? (await resolvePushProvenance(workPath, { message: opts?.message }));
|
|
83
|
+
// `push:all` mints one provenance for the whole run and warns once; a bare `push` warns here.
|
|
84
|
+
if (!opts?.provenance && !dryRun)
|
|
85
|
+
warnWhenNoWhy(provenance);
|
|
86
|
+
let baseUrl = '';
|
|
87
|
+
let bearer = '';
|
|
88
|
+
if (!dryRun) {
|
|
89
|
+
baseUrl = await resolveSyncRemoteUrl(workPath);
|
|
90
|
+
bearer = await getSyncBearerToken(workPath);
|
|
91
|
+
}
|
|
92
|
+
// Two caches, two questions, deliberately separate (roadmap 6c):
|
|
93
|
+
//
|
|
94
|
+
// build cache → "did the sources change?" per WORKSPACE
|
|
95
|
+
// push state → "does that server have it yet?" per REGISTRY
|
|
96
|
+
//
|
|
97
|
+
// They used to be one file, so pushing the same workspace to a local rig recorded
|
|
98
|
+
// "uploaded" and the next production push skipped those components. Nothing about a
|
|
99
|
+
// rig can tell you anything about production.
|
|
100
|
+
const selective = (opts?.componentIds?.length ?? 0) > 0 || (opts?.patternIds?.length ?? 0) > 0 || (opts?.pageSlugs?.length ?? 0) > 0;
|
|
101
|
+
const skipUnchanged = Boolean(opts?.skipUnchanged) && !selective && !handoff.force;
|
|
102
|
+
// A dry run has no bearer token but can still resolve which registry it would target;
|
|
103
|
+
// without one, it just reports everything as pending rather than guessing.
|
|
104
|
+
let registryUrl = baseUrl;
|
|
105
|
+
if (dryRun && !registryUrl) {
|
|
106
|
+
registryUrl = await resolveSyncRemoteUrl(workPath).catch(() => '');
|
|
107
|
+
}
|
|
108
|
+
const registryIdentity = normalizeRegistryIdentity(registryUrl);
|
|
109
|
+
const useBuildCache = skipUnchanged;
|
|
110
|
+
let buildCache = useBuildCache ? (await loadBuildCache(handoff)) ?? createEmptyCache() : null;
|
|
111
|
+
let buildCacheDirty = false;
|
|
112
|
+
const useUploadState = skipUnchanged && !opts?.forceUpload && Boolean(registryIdentity);
|
|
113
|
+
let pushState = null;
|
|
114
|
+
if (useUploadState) {
|
|
115
|
+
const existing = await loadPushState(handoff, registryUrl);
|
|
116
|
+
if (!existing) {
|
|
117
|
+
// Say why out loud. A full upload after an upgrade, or on first contact with a new
|
|
118
|
+
// registry, looks identical to the bug it replaces unless we name the reason.
|
|
119
|
+
Logger.info(`No upload state yet for ${registryIdentity} — uploading every component once so this registry is complete. ` +
|
|
120
|
+
`Recorded at ${getPushStatePath(handoff, registryUrl)}; later pushes to it skip unchanged components.`);
|
|
121
|
+
}
|
|
122
|
+
pushState = existing ?? createEmptyPushState(registryUrl);
|
|
123
|
+
}
|
|
124
|
+
else if (skipUnchanged && !registryIdentity) {
|
|
125
|
+
Logger.debug('No registry URL resolved — upload-skip disabled for this run.');
|
|
126
|
+
}
|
|
127
|
+
const globalDepsState = useBuildCache || useUploadState ? await computeGlobalDepsState(handoff) : null;
|
|
128
|
+
// IDs whose upload this registry has now confirmed
|
|
129
|
+
const uploadedIds = new Set();
|
|
130
|
+
const changes = [];
|
|
131
|
+
const pageSlugSet = selective && opts?.pageSlugs?.length
|
|
132
|
+
? new Set(opts.pageSlugs.map((s) => normalizePageSlug(s)))
|
|
133
|
+
: null;
|
|
134
|
+
const pagesDir = path.join(handoff.workingPath, 'pages');
|
|
135
|
+
if (!selective || pageSlugSet) {
|
|
136
|
+
const mdFiles = await collectMarkdownFiles(pagesDir);
|
|
137
|
+
for (const abs of mdFiles) {
|
|
138
|
+
const slug = path.relative(pagesDir, abs).replace(/\\/g, '/').replace(/\.md$/i, '');
|
|
139
|
+
if (pageSlugSet && !pageSlugSet.has(slug))
|
|
140
|
+
continue;
|
|
141
|
+
const raw = await fs.readFile(abs, 'utf8');
|
|
142
|
+
const parsed = matter(raw);
|
|
143
|
+
changes.push({
|
|
144
|
+
entityType: 'page',
|
|
145
|
+
entityId: slug,
|
|
146
|
+
action: 'update',
|
|
147
|
+
data: { slug, frontmatter: parsed.data, markdown: parsed.content },
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
if (pageSlugSet) {
|
|
151
|
+
for (const wanted of pageSlugSet) {
|
|
152
|
+
if (!mdFiles.some((abs) => path.relative(pagesDir, abs).replace(/\\/g, '/').replace(/\.md$/i, '') === wanted)) {
|
|
153
|
+
Logger.warn(`Page slug "${wanted}" not found under pages/ — skipped.`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const configuredCompIds = Object.keys(handoff.runtimeConfig?.entries?.components ?? {});
|
|
159
|
+
const compIdsToScan = selective
|
|
160
|
+
? (opts?.componentIds?.length ? opts.componentIds : [])
|
|
161
|
+
: configuredCompIds;
|
|
162
|
+
if (selective && opts?.componentIds?.length) {
|
|
163
|
+
const set = new Set(configuredCompIds);
|
|
164
|
+
for (const id of opts.componentIds) {
|
|
165
|
+
if (!set.has(id))
|
|
166
|
+
Logger.warn(`Component "${id}" is not in handoff.config entries.components — skipped.`);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
const configuredPatIds = Object.keys(handoff.runtimeConfig?.entries?.patterns ?? {});
|
|
170
|
+
const pushingEntities = compIdsToScan.length > 0 || (selective ? (opts?.patternIds?.length ?? 0) > 0 : configuredPatIds.length > 0);
|
|
171
|
+
const runBuild = shouldRunBuild(opts, pushingEntities);
|
|
172
|
+
// Vendor-split (roadmap 6.6): the batched phase that emits shared React/library
|
|
173
|
+
// bundles + importmap + tiny per-component entries runs ONLY on a FULL build
|
|
174
|
+
// (processComponents with no id). Per-component builds (the default in the loop
|
|
175
|
+
// below) re-emit fat self-contained bundles and skip the split. So for a full
|
|
176
|
+
// (non-selective) push of a split-enabled project, build ALL components in one
|
|
177
|
+
// pass up front, then skip the per-component rebuild in the loop (it would
|
|
178
|
+
// clobber the tiny entries). Non-split projects keep the per-component build.
|
|
179
|
+
const splitEnabled = (handoff.config?.preview?.sharedPackages?.length ?? 0) > 0;
|
|
180
|
+
let buildPerComponentInLoop = runBuild;
|
|
181
|
+
if (runBuild && !selective && splitEnabled && compIdsToScan.length > 0) {
|
|
182
|
+
Logger.info('Vendor-split enabled — building all components in one pass (shared bundles + importmap)…');
|
|
183
|
+
await handoff.component(null);
|
|
184
|
+
buildPerComponentInLoop = false;
|
|
185
|
+
// The build just wrote its own snapshot to build-cache.json — which components
|
|
186
|
+
// it built and, crucially, the global-deps state it built against. Our copy was
|
|
187
|
+
// loaded BEFORE the build, so saving it at the end would write that stale copy
|
|
188
|
+
// back over the builder's, and the next build would find its globalDeps missing
|
|
189
|
+
// and rebuild everything. Re-read the builder's snapshot instead.
|
|
190
|
+
if (useBuildCache) {
|
|
191
|
+
buildCache = (await loadBuildCache(handoff)) ?? buildCache;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
// Collect the catalog-wide artifacts up front, NOT as a side effect of some
|
|
195
|
+
// component being pushed. They used to be gathered inside the loop, which made
|
|
196
|
+
// them hostage to per-component state: when the push cache skipped every
|
|
197
|
+
// component as unchanged, they were never collected and never sent — so a
|
|
198
|
+
// registry that was missing its vendor bundles could not self-heal by
|
|
199
|
+
// re-pushing, because "nothing changed". They belong to the catalog, so they
|
|
200
|
+
// are collected and pushed whenever we are pushing artifacts at all.
|
|
201
|
+
let sharedAssets;
|
|
202
|
+
if (!opts?.metadataOnly) {
|
|
203
|
+
sharedAssets = await collectSharedComponentAssets(handoff);
|
|
204
|
+
}
|
|
205
|
+
for (const id of compIdsToScan) {
|
|
206
|
+
if (!configuredCompIds.includes(id))
|
|
207
|
+
continue;
|
|
208
|
+
try {
|
|
209
|
+
// Source identity is computed from the sources, before any build, so it
|
|
210
|
+
// describes the input rather than the output. Both decisions below read it.
|
|
211
|
+
let currentFileStates = null;
|
|
212
|
+
if ((useUploadState || useBuildCache) && globalDepsState) {
|
|
213
|
+
currentFileStates = await computeComponentFileStates(handoff, id);
|
|
214
|
+
}
|
|
215
|
+
// Decision 1 — does THIS registry already have it? Skipping here also skips the
|
|
216
|
+
// build, which is right: the registry holding the current sources means the
|
|
217
|
+
// artifacts for them were produced at some point.
|
|
218
|
+
if (useUploadState && pushState && currentFileStates && globalDepsState) {
|
|
219
|
+
if (!hasUploadChanged(pushState.components[id], currentFileStates, globalDepsState)) {
|
|
220
|
+
Logger.info(`Component "${id}": unchanged since last push to ${registryIdentity}, skipping`);
|
|
221
|
+
continue;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
// Decision 2 — do the sources need rebuilding? Independent of the registry: a
|
|
225
|
+
// component that is merely missing from a second registry is uploaded from the
|
|
226
|
+
// artifacts already on disk instead of being rebuilt.
|
|
227
|
+
if (buildPerComponentInLoop) {
|
|
228
|
+
const rebuild = !useBuildCache ||
|
|
229
|
+
!buildCache ||
|
|
230
|
+
!currentFileStates ||
|
|
231
|
+
!globalDepsState ||
|
|
232
|
+
needsSyncRebuild(buildCache.components[id], currentFileStates, globalDepsState);
|
|
233
|
+
if (rebuild) {
|
|
234
|
+
Logger.info(`Building component "${id}"…`);
|
|
235
|
+
await buildEntity(handoff, 'component', id);
|
|
236
|
+
if (buildCache && currentFileStates && globalDepsState) {
|
|
237
|
+
recordSyncBuild(buildCache, id, currentFileStates, globalDepsState);
|
|
238
|
+
buildCacheDirty = true;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
else {
|
|
242
|
+
Logger.info(`Component "${id}": sources unchanged, uploading the existing build.`);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
let payload = await resolveComponentDeclarationForSync(handoff, id, {
|
|
246
|
+
warnMissingArtifacts: !opts?.metadataOnly,
|
|
247
|
+
});
|
|
248
|
+
if (!payload) {
|
|
249
|
+
Logger.warn(`Skipping component "${id}" (no declaration file found in config).`);
|
|
250
|
+
continue;
|
|
251
|
+
}
|
|
252
|
+
if (!opts?.metadataOnly) {
|
|
253
|
+
const collected = await collectComponentBuildArtifacts(handoff, id);
|
|
254
|
+
for (const w of collected.warnings)
|
|
255
|
+
Logger.warn(w);
|
|
256
|
+
const sourceFiles = await collectComponentSourceFiles(handoff, id);
|
|
257
|
+
// Discover workspace images referenced by this component (relative paths,
|
|
258
|
+
// /images/… absolutes, CSS url(…)), resolve them to bytes, and rewrite the
|
|
259
|
+
// references in the text artifacts to the asset's served URL so they
|
|
260
|
+
// resolve on the registry (where the workspace public/ dir doesn't exist).
|
|
261
|
+
const textArtifacts = Object.entries(collected.files)
|
|
262
|
+
.filter(([name]) => !isBinaryArtifactFilename(name))
|
|
263
|
+
.map(([, content]) => content);
|
|
264
|
+
const { images, rewriteMap, warnings: imageWarnings } = await collectReferencedImages(handoff, textArtifacts, sourceFiles);
|
|
265
|
+
for (const w of imageWarnings)
|
|
266
|
+
Logger.warn(`Component "${id}": ${w}`);
|
|
267
|
+
if (Object.keys(rewriteMap).length > 0) {
|
|
268
|
+
for (const name of Object.keys(collected.files)) {
|
|
269
|
+
if (!isBinaryArtifactFilename(name)) {
|
|
270
|
+
collected.files[name] = applyImageRewrites(collected.files[name], rewriteMap);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
Logger.info(`Component "${id}": linked ${images.length} referenced image(s) to the asset library.`);
|
|
274
|
+
}
|
|
275
|
+
// Shared assets (main.js/main.css/shared.css and the `hvendor-*`
|
|
276
|
+
// vendor-split bundles) are catalog-wide, so they are NOT attached to a
|
|
277
|
+
// component here — they go to /api/sync/shared-assets after this loop.
|
|
278
|
+
// Attaching them coupled them to the per-component size guard below:
|
|
279
|
+
// when the carrier component exceeded MAX_ITEM_BYTES the guard stripped
|
|
280
|
+
// ALL its buildArtifacts, silently taking the shared bundles with it,
|
|
281
|
+
// and the push still reported success. Every component entry then 404'd
|
|
282
|
+
// its bare-specifier imports and no preview could hydrate.
|
|
283
|
+
// The fallback further down restores the old attach behaviour, but only
|
|
284
|
+
// for a registry too old to have that route.
|
|
285
|
+
payload = attachArtifacts(payload, collected.files);
|
|
286
|
+
if (Object.keys(sourceFiles).length > 0) {
|
|
287
|
+
payload = { ...payload, sourceFiles };
|
|
288
|
+
}
|
|
289
|
+
// Push referenced images via dedicated per-image endpoint (decoupled from
|
|
290
|
+
// the component payload so there's no size cap per image).
|
|
291
|
+
if (images.length > 0) {
|
|
292
|
+
const pushed = await pushComponentImages(handoff, id, images);
|
|
293
|
+
if (pushed > 0) {
|
|
294
|
+
Logger.info(`Component "${id}": pushed ${pushed}/${images.length} referenced image(s) to asset library.`);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
payload = {
|
|
299
|
+
...payload,
|
|
300
|
+
changeType: opts?.metadataOnly ? 'metadata_updated' : 'full',
|
|
301
|
+
};
|
|
302
|
+
changes.push({
|
|
303
|
+
entityType: 'component',
|
|
304
|
+
entityId: id,
|
|
305
|
+
action: 'update',
|
|
306
|
+
data: { ...payload, source: 'sync' },
|
|
307
|
+
});
|
|
308
|
+
// Staged for this registry's upload state; only written once the server accepts.
|
|
309
|
+
if (useUploadState && pushState && globalDepsState) {
|
|
310
|
+
if (!currentFileStates)
|
|
311
|
+
currentFileStates = await computeComponentFileStates(handoff, id);
|
|
312
|
+
recordComponentUploaded(pushState, id, currentFileStates, globalDepsState);
|
|
313
|
+
uploadedIds.add(id);
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
catch (e) {
|
|
317
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
318
|
+
Logger.error(`Component "${id}": ${msg}`);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
// Persist build state as soon as the builds are done, not at the end: it records work
|
|
322
|
+
// already on disk, so it must survive every later exit path (dry run, nothing to push,
|
|
323
|
+
// a failed upload) rather than being thrown away with them.
|
|
324
|
+
if (buildCacheDirty && buildCache) {
|
|
325
|
+
await saveBuildCache(handoff, buildCache);
|
|
326
|
+
}
|
|
327
|
+
const patIdsToScan = selective ? (opts?.patternIds?.length ? opts.patternIds : []) : configuredPatIds;
|
|
328
|
+
if (selective && opts?.patternIds?.length) {
|
|
329
|
+
const set = new Set(configuredPatIds);
|
|
330
|
+
for (const id of opts.patternIds) {
|
|
331
|
+
if (!set.has(id))
|
|
332
|
+
Logger.warn(`Pattern "${id}" is not in handoff.config entries.patterns — skipped.`);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
for (const id of patIdsToScan) {
|
|
336
|
+
if (!configuredPatIds.includes(id))
|
|
337
|
+
continue;
|
|
338
|
+
try {
|
|
339
|
+
if (runBuild) {
|
|
340
|
+
Logger.info(`Building pattern "${id}"…`);
|
|
341
|
+
await buildEntity(handoff, 'pattern', id);
|
|
342
|
+
}
|
|
343
|
+
let payload = await resolvePatternDeclarationForSync(handoff, id);
|
|
344
|
+
if (!payload) {
|
|
345
|
+
Logger.warn(`Skipping pattern "${id}" (no declaration file found in config).`);
|
|
346
|
+
continue;
|
|
347
|
+
}
|
|
348
|
+
if (!opts?.metadataOnly) {
|
|
349
|
+
const collected = await collectPatternBuildArtifacts(handoff, id);
|
|
350
|
+
for (const w of collected.warnings)
|
|
351
|
+
Logger.warn(w);
|
|
352
|
+
payload = attachArtifacts(payload, collected.files);
|
|
353
|
+
}
|
|
354
|
+
changes.push({
|
|
355
|
+
entityType: 'pattern',
|
|
356
|
+
entityId: id,
|
|
357
|
+
action: 'update',
|
|
358
|
+
data: { ...payload, source: 'sync' },
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
catch (e) {
|
|
362
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
363
|
+
Logger.error(`Pattern "${id}": ${msg}`);
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
// ── Shared (catalog-wide) artifacts ─────────────────────────────────────
|
|
367
|
+
// Pushed on their own endpoint so their size is judged independently and no
|
|
368
|
+
// component payload can take them down with it. See push-shared-assets.ts.
|
|
369
|
+
if (!dryRun && sharedAssets && Object.keys(sharedAssets).length > 0) {
|
|
370
|
+
const shared = sharedAssets;
|
|
371
|
+
const total = Object.keys(shared).length;
|
|
372
|
+
Logger.info(`Pushing ${total} shared artifact(s) (vendor bundles + globals), independently of components…`);
|
|
373
|
+
const result = await pushSharedAssets(handoff, shared);
|
|
374
|
+
if (result.status === 'pushed') {
|
|
375
|
+
Logger.success(`Shared artifacts pushed: ${result.stored.length}/${total}.`);
|
|
376
|
+
}
|
|
377
|
+
else if (result.status === 'unsupported') {
|
|
378
|
+
// Registry predates /api/sync/shared-assets. Fall back to riding a
|
|
379
|
+
// component payload — but pick the SMALLEST change, not the first. The
|
|
380
|
+
// size guard strips a change's artifacts wholesale once it crosses
|
|
381
|
+
// MAX_ITEM_BYTES, so the roomiest carrier is the safest one.
|
|
382
|
+
Logger.warn('Registry has no /api/sync/shared-assets route (older deploy) — attaching shared artifacts to the smallest component change instead.');
|
|
383
|
+
let carrier;
|
|
384
|
+
let carrierBytes = Infinity;
|
|
385
|
+
for (const c of changes) {
|
|
386
|
+
if (c.entityType !== 'component')
|
|
387
|
+
continue;
|
|
388
|
+
const b = Buffer.byteLength(JSON.stringify(c), 'utf8');
|
|
389
|
+
if (b < carrierBytes) {
|
|
390
|
+
carrierBytes = b;
|
|
391
|
+
carrier = c;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
if (carrier) {
|
|
395
|
+
const d = carrier.data;
|
|
396
|
+
const existing = d.buildArtifacts ?? {};
|
|
397
|
+
carrier.data = { ...d, buildArtifacts: { ...existing, ...shared } };
|
|
398
|
+
Logger.info(` Shared artifacts riding on component "${carrier.entityId}".`);
|
|
399
|
+
}
|
|
400
|
+
else {
|
|
401
|
+
Logger.error('No component change available to carry shared artifacts — vendor bundles will not reach the registry and previews will not hydrate.');
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
else {
|
|
405
|
+
Logger.error(`Shared artifact push failed: ${result.error}`);
|
|
406
|
+
Logger.error('Previews will not hydrate until these land — the per-component entries import them by bare specifier.');
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
if (!changes.length) {
|
|
410
|
+
Logger.warn('Nothing to push (no pages or resolvable declarations found).');
|
|
411
|
+
return;
|
|
412
|
+
}
|
|
413
|
+
if (dryRun) {
|
|
414
|
+
const pages = changes.filter((c) => c.entityType === 'page');
|
|
415
|
+
const components = changes.filter((c) => c.entityType === 'component');
|
|
416
|
+
const patterns = changes.filter((c) => c.entityType === 'pattern');
|
|
417
|
+
Logger.log('');
|
|
418
|
+
Logger.info(`Dry run: would push ${changes.length} change(s) (no request sent).`);
|
|
419
|
+
Logger.log(` Pages: ${pages.length}`);
|
|
420
|
+
Logger.log(` Components: ${components.length}`);
|
|
421
|
+
Logger.log(` Patterns: ${patterns.length}`);
|
|
422
|
+
if (handoff.debug) {
|
|
423
|
+
for (const c of changes) {
|
|
424
|
+
const art = c.data?.buildArtifacts;
|
|
425
|
+
const artCount = art ? Object.keys(art).length : 0;
|
|
426
|
+
Logger.debug(` - ${c.entityType} ${c.entityId} (${c.action})${artCount ? ` [${artCount} artifacts]` : ''}`);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
Logger.log('');
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
// Auto-batch changes so each HTTP request stays under Vercel's 4.5MB
|
|
433
|
+
// serverless-function body limit. We target 3MB per batch (with comfortable
|
|
434
|
+
// headroom for the JSON wrapper and HTTP headers).
|
|
435
|
+
//
|
|
436
|
+
// Individual components can still exceed the batch limit when they carry
|
|
437
|
+
// large artifact files (e.g. a React component-library JS bundle). We
|
|
438
|
+
// handle this with a three-level safeguard:
|
|
439
|
+
//
|
|
440
|
+
// 1. (Selective strip) Strip individual artifact files that exceed
|
|
441
|
+
// MAX_ARTIFACT_FILE_BYTES from buildArtifacts, keeping small files
|
|
442
|
+
// (CSS, screenshots, HTML previews, JSON). This lets metadata +
|
|
443
|
+
// previews push even when the JS bundle alone is 3+ MB.
|
|
444
|
+
//
|
|
445
|
+
// 2. (Full strip) If the item is still over MAX_ITEM_BYTES after selective
|
|
446
|
+
// stripping, strip ALL buildArtifacts. Metadata + source files still push.
|
|
447
|
+
//
|
|
448
|
+
// 3. (Skip) If the item is still over MAX_ITEM_BYTES after full stripping
|
|
449
|
+
// (e.g. enormous source files), skip it entirely so one bad component
|
|
450
|
+
// never blocks the rest of the push.
|
|
451
|
+
const url = `${baseUrl}/api/sync/upload`;
|
|
452
|
+
// Ceilings sized against Vercel's ~4.5 MB serverless request-body limit, with
|
|
453
|
+
// headroom for the batch wrapper. A minified production React hydration bundle
|
|
454
|
+
// (<id>-client.mjs) is ~1.3-1.5 MB even after prod+minify — the old 1 MB
|
|
455
|
+
// per-file cap stripped it (→ 404 → frozen preview). Allow a single artifact up
|
|
456
|
+
// to 4 MB and a change/batch up to 4 MB (still under Vercel's 4.5 MB wall).
|
|
457
|
+
// (Long-term, externalizing React into one shared vendor artifact would drop
|
|
458
|
+
// these bundles to tens of KB — see roadmap.)
|
|
459
|
+
// Keep in sync with SHARED_ARTIFACT_PREFIX / SHARED_FILENAMES in
|
|
460
|
+
// src/app/lib/db/component-artifact-queries.ts.
|
|
461
|
+
const SHARED_ARTIFACT_PREFIX = 'hvendor-';
|
|
462
|
+
const SHARED_ARTIFACT_FILENAMES = new Set(['main.css', 'shared.css', 'main.js']);
|
|
463
|
+
const MAX_BATCH_BYTES = 4 * 1024 * 1024; // 4 MB per batch
|
|
464
|
+
const MAX_ITEM_BYTES = 4 * 1024 * 1024; // 4 MB per single change (must fit in one batch)
|
|
465
|
+
const MAX_ARTIFACT_FILE_BYTES = 4 * 1024 * 1024; // 4 MB per individual artifact file
|
|
466
|
+
// Stamp the push "why" onto every change so each recorded version carries it. (Provenance rides
|
|
467
|
+
// on the request body instead — one copy per request, not one per change.)
|
|
468
|
+
const pushMessage = opts?.message?.trim() ?? provenance.why ?? undefined;
|
|
469
|
+
if (pushMessage) {
|
|
470
|
+
for (const change of changes) {
|
|
471
|
+
change.data = { ...(change.data ?? {}), message: pushMessage };
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
const batches = [];
|
|
475
|
+
let current = [];
|
|
476
|
+
let currentBytes = 0;
|
|
477
|
+
for (let change of changes) {
|
|
478
|
+
let changeBytes = Buffer.byteLength(JSON.stringify(change), 'utf8');
|
|
479
|
+
// ── Per-item oversize guard ──────────────────────────────────────────────
|
|
480
|
+
if (changeBytes > MAX_ITEM_BYTES) {
|
|
481
|
+
const dataObj = change.data;
|
|
482
|
+
const artifacts = dataObj?.buildArtifacts;
|
|
483
|
+
// Level 1: Selectively strip oversized individual artifact files.
|
|
484
|
+
// Keeps small files (HTML previews, screenshots, CSS) while dropping
|
|
485
|
+
// large JS bundles (e.g. a 3 MB React component-library bundle).
|
|
486
|
+
if (artifacts && typeof artifacts === 'object' && !Array.isArray(artifacts)) {
|
|
487
|
+
const slimArtifacts = {};
|
|
488
|
+
const strippedFiles = [];
|
|
489
|
+
for (const [filename, content] of Object.entries(artifacts)) {
|
|
490
|
+
const fileBytes = Buffer.byteLength(content, 'utf8');
|
|
491
|
+
if (fileBytes > MAX_ARTIFACT_FILE_BYTES) {
|
|
492
|
+
strippedFiles.push(`${filename} (${(fileBytes / (1024 * 1024)).toFixed(1)}MB)`);
|
|
493
|
+
}
|
|
494
|
+
else {
|
|
495
|
+
slimArtifacts[filename] = content;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
if (strippedFiles.length > 0) {
|
|
499
|
+
Logger.warn(`Component "${change.entityId}": stripping ${strippedFiles.length} oversized artifact(s) ` +
|
|
500
|
+
`(>${(MAX_ARTIFACT_FILE_BYTES / (1024 * 1024)).toFixed(0)}MB each): ${strippedFiles.join(', ')}. ` +
|
|
501
|
+
`Metadata, HTML previews, screenshots and CSS will still push.`);
|
|
502
|
+
change = { ...change, data: { ...dataObj, buildArtifacts: slimArtifacts } };
|
|
503
|
+
changeBytes = Buffer.byteLength(JSON.stringify(change), 'utf8');
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
// Level 2: Still over limit — drop ALL buildArtifacts.
|
|
507
|
+
if (changeBytes > MAX_ITEM_BYTES) {
|
|
508
|
+
const sizeMb = (changeBytes / (1024 * 1024)).toFixed(1);
|
|
509
|
+
const hasArtifacts = change.entityType === 'component' &&
|
|
510
|
+
!!change.data?.buildArtifacts;
|
|
511
|
+
if (hasArtifacts) {
|
|
512
|
+
Logger.warn(`Component "${change.entityId}" payload is ${sizeMb}MB even after selective artifact stripping. ` +
|
|
513
|
+
`Stripping all buildArtifacts — metadata + source files still push. ` +
|
|
514
|
+
`To avoid this, reduce preview variant count or set \`metadataOnly: true\`.`);
|
|
515
|
+
// A full strip must never silently discard catalog-wide artifacts. It
|
|
516
|
+
// used to: shared bundles rode on a component, the guard dropped them
|
|
517
|
+
// with everything else, and the push still reported success — so the
|
|
518
|
+
// registry served no vendor bundles and every preview stopped
|
|
519
|
+
// hydrating, with nothing in the log pointing at the cause. They are
|
|
520
|
+
// pushed on their own endpoint now, so this should be unreachable
|
|
521
|
+
// except on the older-registry fallback path — say so loudly if not.
|
|
522
|
+
const droppedShared = Object.keys(change.data.buildArtifacts ?? {}).filter((f) => SHARED_ARTIFACT_FILENAMES.has(f) || f.startsWith(SHARED_ARTIFACT_PREFIX));
|
|
523
|
+
if (droppedShared.length > 0) {
|
|
524
|
+
Logger.error(` This strip also discarded ${droppedShared.length} SHARED artifact(s): ${droppedShared.join(', ')}. ` +
|
|
525
|
+
`These belong to the whole catalog, not to "${change.entityId}" — every component's preview depends on them. ` +
|
|
526
|
+
`Previews will not hydrate until they reach the registry.`);
|
|
527
|
+
}
|
|
528
|
+
const { buildArtifacts: _dropped, ...dataWithout } = change.data;
|
|
529
|
+
change = { ...change, data: dataWithout };
|
|
530
|
+
changeBytes = Buffer.byteLength(JSON.stringify(change), 'utf8');
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
// Level 3: Still too large — skip to avoid a guaranteed 413.
|
|
534
|
+
if (changeBytes > MAX_ITEM_BYTES) {
|
|
535
|
+
const sizeMb2 = (changeBytes / (1024 * 1024)).toFixed(1);
|
|
536
|
+
Logger.error(`Component "${change.entityId}" payload is ${sizeMb2}MB even after stripping buildArtifacts. ` +
|
|
537
|
+
`Skipping this component — use \`handoff-app push --metadata-only --component ${change.entityId}\` ` +
|
|
538
|
+
`to push just its metadata.`);
|
|
539
|
+
continue;
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
// ────────────────────────────────────────────────────────────────────────
|
|
543
|
+
if (current.length > 0 && currentBytes + changeBytes > MAX_BATCH_BYTES) {
|
|
544
|
+
batches.push(current);
|
|
545
|
+
current = [];
|
|
546
|
+
currentBytes = 0;
|
|
547
|
+
}
|
|
548
|
+
current.push(change);
|
|
549
|
+
currentBytes += changeBytes;
|
|
550
|
+
}
|
|
551
|
+
if (current.length > 0)
|
|
552
|
+
batches.push(current);
|
|
553
|
+
if (batches.length > 1) {
|
|
554
|
+
Logger.info(`Splitting ${changes.length} changes into ${batches.length} batches (server body-size limit).`);
|
|
555
|
+
}
|
|
556
|
+
let totalApplied = 0;
|
|
557
|
+
for (let i = 0; i < batches.length; i++) {
|
|
558
|
+
const batch = batches[i];
|
|
559
|
+
const batchBytes = Buffer.byteLength(JSON.stringify({ changes: batch }), 'utf8');
|
|
560
|
+
Logger.info(`Pushing batch ${i + 1}/${batches.length}: ${batch.length} change(s), ${Math.round(batchBytes / 1024)}KB`);
|
|
561
|
+
const res = await fetch(url, {
|
|
562
|
+
method: 'POST',
|
|
563
|
+
headers: {
|
|
564
|
+
Authorization: `Bearer ${bearer}`,
|
|
565
|
+
'Content-Type': 'application/json',
|
|
566
|
+
},
|
|
567
|
+
body: JSON.stringify({ changes: batch, provenance }),
|
|
568
|
+
});
|
|
569
|
+
if (!res.ok) {
|
|
570
|
+
const text = await res.text().catch(() => '');
|
|
571
|
+
throw new Error(`Sync push failed on batch ${i + 1}/${batches.length} (${res.status}): ${text || res.statusText}`);
|
|
572
|
+
}
|
|
573
|
+
const body = (await res.json());
|
|
574
|
+
totalApplied += body.appliedCount ?? batch.length;
|
|
575
|
+
}
|
|
576
|
+
Logger.success(`Push complete: ${totalApplied} change(s) applied on server across ${batches.length} batch(es).`);
|
|
577
|
+
// Upload state is written only now, after the server answered OK — that is the whole
|
|
578
|
+
// point of keeping it separate: a failed push must leave this registry looking
|
|
579
|
+
// incomplete, not current. (Build state was already persisted after the loop; those
|
|
580
|
+
// artifacts exist on disk whether or not the upload landed.)
|
|
581
|
+
if (useUploadState && pushState && uploadedIds.size > 0) {
|
|
582
|
+
await savePushState(handoff, registryUrl, pushState);
|
|
583
|
+
Logger.debug(`Upload state for ${registryIdentity} updated for ${uploadedIds.size} component(s).`);
|
|
584
|
+
}
|
|
585
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Logger } from '../../utils/logger.js';
|
|
2
|
+
import { readSyncState } from './sync-state.js';
|
|
3
|
+
import { getSyncBearerToken, resolveSyncRemoteUrl } from './sync-remote-env.js';
|
|
4
|
+
export async function runSyncStatus(handoff) {
|
|
5
|
+
const workPath = handoff.workingPath;
|
|
6
|
+
const baseUrl = await resolveSyncRemoteUrl(workPath);
|
|
7
|
+
const bearer = await getSyncBearerToken(workPath);
|
|
8
|
+
const url = `${baseUrl}/api/sync/status`;
|
|
9
|
+
const res = await fetch(url, {
|
|
10
|
+
headers: { Authorization: `Bearer ${bearer}` },
|
|
11
|
+
});
|
|
12
|
+
if (!res.ok) {
|
|
13
|
+
const text = await res.text().catch(() => '');
|
|
14
|
+
throw new Error(`Sync status failed (${res.status}): ${text || res.statusText}`);
|
|
15
|
+
}
|
|
16
|
+
const remote = (await res.json());
|
|
17
|
+
const local = await readSyncState(handoff.workingPath);
|
|
18
|
+
Logger.log(`Remote: ${baseUrl}`);
|
|
19
|
+
Logger.log(` latestVersion: ${remote.latestVersion}`);
|
|
20
|
+
Logger.log(` counts: ${JSON.stringify(remote.counts)}`);
|
|
21
|
+
Logger.log(`Local sync state (${handoff.workingPath}/.handoff/sync-state.json):`);
|
|
22
|
+
if (!local) {
|
|
23
|
+
Logger.log(' (not initialized — run handoff pull first)');
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
Logger.log(` remoteUrl: ${local.remoteUrl}`);
|
|
27
|
+
Logger.log(` lastSyncVersion: ${local.lastSyncVersion}`);
|
|
28
|
+
Logger.log(` lastSyncAt: ${local.lastSyncAt || '(never)'}`);
|
|
29
|
+
Logger.log(` fingerprinted entities: ${Object.keys(local.fingerprints).length}`);
|
|
30
|
+
}
|