@reqvire-org/ads 0.3.53 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +114 -94
- package/dist/a11y.mjs +108 -29
- package/dist/analysis/compiler-options.mjs +13 -0
- package/dist/analysis/context.mjs +46 -0
- package/dist/analysis/file-tree.mjs +52 -0
- package/dist/analysis/helpers.mjs +140 -0
- package/dist/analysis/impact.mjs +20 -0
- package/dist/analysis/inputs.mjs +15 -0
- package/dist/analysis/native-adapter.mjs +180 -0
- package/dist/analysis/native-project.mjs +323 -0
- package/dist/analysis/queries.mjs +133 -0
- package/dist/analysis/service.mjs +146 -0
- package/dist/analysis/standalone.mjs +57 -0
- package/dist/analysis/syntax.mjs +164 -0
- package/dist/analysis/worker.mjs +182 -0
- package/dist/assets.mjs +6 -6
- package/dist/atomic-composition.mjs +191 -70
- package/dist/atomic-trace.mjs +120 -50
- package/dist/behavior-libraries.mjs +106 -37
- package/dist/behaviors.mjs +222 -79
- package/dist/boundaries.mjs +137 -40
- package/dist/brand-assets.mjs +219 -47
- package/dist/brands.mjs +86 -27
- package/dist/bun-compiler.mjs +34 -13
- package/dist/bun-worker.mjs +7 -5
- package/dist/capture/worker.mjs +15 -4
- package/dist/capture-store.mjs +4 -2
- package/dist/capture.mjs +17 -14
- package/dist/check-service.mjs +66 -0
- package/dist/check.mjs +756 -196
- package/dist/cli.mjs +203 -100
- package/dist/color-values.mjs +21 -21
- package/dist/component-contrast.mjs +2 -2
- package/dist/config.mjs +308 -163
- package/dist/construction-styles.cjs +10 -0
- package/dist/contracts.d.mts +9 -0
- package/dist/control-padding.mjs +45 -25
- package/dist/css-values.mjs +3 -2
- package/dist/declarative-flow.mjs +209 -109
- package/dist/design-values.mjs +136 -51
- package/dist/development-runtime.mjs +4 -6
- package/dist/draft-boundary.mjs +11 -6
- package/dist/evidence.mjs +1 -1
- package/dist/finding-rules.mjs +7 -5
- package/dist/font-rules.mjs +2 -2
- package/dist/fonts-generated.mjs +4 -2
- package/dist/foundation-views.mjs +238 -0
- package/dist/foundation.mjs +63 -39
- package/dist/generated-entries.mjs +198 -0
- package/dist/icons.mjs +80 -33
- package/dist/image-attributes.mjs +109 -36
- package/dist/image-size.mjs +1 -1
- package/dist/index.mjs +0 -2
- package/dist/init.mjs +128 -68
- package/dist/investigations.mjs +2 -2
- package/dist/layers.mjs +300 -127
- package/dist/layout-widths.mjs +180 -85
- package/dist/linaria/preserve-values.cjs +7 -0
- package/dist/linaria/spatial-inputs.cjs +56 -0
- package/dist/lockup-composition.mjs +44 -0
- package/dist/lockup-model.cjs +64 -0
- package/dist/mcp/THIRD_PARTY_NOTICES.md +51 -1
- package/dist/mcp/apps.mjs +4 -30
- package/dist/mcp/behavior-pages.mjs +72 -24
- package/dist/mcp/build-status.mjs +257 -64
- package/dist/mcp/catalog.mjs +91 -26
- package/dist/mcp/context.mjs +17 -18
- package/dist/mcp/draft-discovery.mjs +44 -21
- package/dist/mcp/drafts.mjs +978 -343
- package/dist/mcp/execution-coordinator.mjs +417 -167
- package/dist/mcp/execution-results.mjs +7 -7
- package/dist/mcp/mutations.mjs +701 -219
- package/dist/mcp/preview-watch.mjs +465 -161
- package/dist/mcp/preview-widget.bundle.js +44 -50
- package/dist/mcp/prompts.mjs +6 -6
- package/dist/mcp/result-pages.mjs +1 -1
- package/dist/mcp/sandbox-host.mjs +1 -1
- package/dist/mcp/server.mjs +2436 -570
- package/dist/mcp/showcase-host.mjs +176 -39
- package/dist/mcp/skills.mjs +1 -1
- package/dist/mcp/text-diff.mjs +29 -10
- package/dist/paint-contracts.mjs +174 -81
- package/dist/palette-generated.mjs +2 -2
- package/dist/preview-bun.mjs +493 -187
- package/dist/preview-failure.mjs +1 -1
- package/dist/preview-files.mjs +13 -13
- package/dist/preview-imports.mjs +104 -55
- package/dist/preview-inputs.mjs +2 -2
- package/dist/preview-requests.mjs +24 -0
- package/dist/preview-resources.mjs +288 -147
- package/dist/preview-scope.mjs +5 -4
- package/dist/program-cache.mjs +10 -0
- package/dist/project-documents.mjs +1 -1
- package/dist/public-api.mjs +70 -31
- package/dist/public-props.mjs +39 -22
- package/dist/{browser-audit → render-audit}/axe-run.mjs +3 -3
- package/dist/{browser-audit → render-audit}/image-shape.mjs +2 -2
- package/dist/{browser-audit → render-audit}/layout-overflow.mjs +86 -23
- package/dist/{browser-audit → render-audit}/non-text-contrast.mjs +86 -27
- package/dist/{browser-audit → render-audit}/render-states.mjs +208 -52
- package/dist/{browser-audit → render-audit}/worker.mjs +86 -30
- package/dist/render-audit.mjs +828 -0
- package/dist/render-color-probe.mjs +96 -42
- package/dist/resource-limits.mjs +229 -97
- package/dist/runtime-contracts.mjs +467 -185
- package/dist/scenario-groups.mjs +22 -10
- package/dist/scenario-inspector.mjs +6 -43
- package/dist/scenario-program.mjs +8 -25
- package/dist/scenario-registry.mjs +72 -30
- package/dist/scenario-selectors.mjs +161 -64
- package/dist/scenario-slots.mjs +149 -56
- package/dist/scenario-trace.mjs +215 -109
- package/dist/scenarios-compiler.mjs +768 -359
- package/dist/scenarios-vite.d.mts +1 -3
- package/dist/scenarios-vite.mjs +2 -81
- package/dist/scenarios.mjs +424 -159
- package/dist/selector-match.mjs +2 -2
- package/dist/showcase/client.bundle.js +57 -56
- package/dist/showcase/draft-navigation.js +18 -0
- package/dist/showcase/favicon.ico +0 -0
- package/dist/showcase/favicon.svg +1 -0
- package/dist/showcase/foundation-view.css +55 -0
- package/dist/showcase/foundation-view.mjs +252 -0
- package/dist/showcase/guide-controls.ads.review.mjs +32 -0
- package/dist/showcase/icons.js +1 -145
- package/dist/showcase/index.html +3 -31
- package/dist/showcase/preview-frame.ads.review.css +46 -0
- package/dist/showcase/preview-frame.ads.review.d.mts +11 -0
- package/dist/showcase/preview-frame.ads.review.mjs +22 -0
- package/dist/showcase/preview-state.js +0 -9
- package/dist/showcase/refresh-scheduler.js +23 -0
- package/dist/showcase/style.css +5 -47
- package/dist/showcase/ui/ui.css +1353 -0
- package/dist/showcase/ui/ui.js +1062 -0
- package/dist/showcase-coverage.mjs +58 -37
- package/dist/skills/README.md +24 -23
- package/dist/skills/ads-designer/README.md +8 -2
- package/dist/skills/ads-designer/SKILL.md +152 -144
- package/dist/skills/ads-designer/references/accessibility.md +14 -11
- package/dist/skills/ads-designer/references/atomic-styles.md +4 -4
- package/dist/skills/ads-designer/references/behaviors.md +34 -30
- package/dist/skills/ads-designer/references/branding.md +98 -10
- package/dist/skills/ads-designer/references/captures.md +31 -31
- package/dist/skills/ads-designer/references/cli.md +21 -20
- package/dist/skills/ads-designer/references/contracts.md +63 -29
- package/dist/skills/ads-designer/references/design-data.md +49 -52
- package/dist/skills/ads-designer/references/drafts.md +71 -52
- package/dist/skills/ads-designer/references/evidence.md +1 -5
- package/dist/skills/ads-designer/references/guarded-editing.md +58 -51
- package/dist/skills/ads-designer/references/layers.md +1 -1
- package/dist/skills/ads-designer/references/layout.md +347 -0
- package/dist/skills/ads-designer/references/mobile.md +2 -1
- package/dist/skills/{ads-motion/references/performance.md → ads-designer/references/motion-performance.md} +5 -1
- package/dist/skills/{ads-motion/references/build.md → ads-designer/references/motion.md} +73 -5
- package/dist/skills/ads-designer/references/performance.md +3 -2
- package/dist/skills/ads-designer/references/review.md +42 -38
- package/dist/skills/ads-designer/references/runtimes.md +33 -30
- package/dist/skills/ads-designer/references/scenarios.md +17 -19
- package/dist/skills/{ads-break-ui/references/catalog.md → ads-designer/references/stress-catalog.md} +3 -1
- package/dist/skills/ads-designer/references/stress-test.md +68 -0
- package/dist/skills/ads-designer/references/validation.md +83 -71
- package/dist/skills/ads-designer/references/workflows.md +19 -37
- package/dist/skills/ads-import/SKILL.md +43 -328
- package/dist/skills/ads-import/references/atomic-styles.md +4 -4
- package/dist/skills/ads-import/references/behaviors.md +34 -30
- package/dist/skills/ads-import/references/branding.md +5 -5
- package/dist/skills/ads-import/references/captures.md +31 -31
- package/dist/skills/ads-import/references/cli.md +21 -20
- package/dist/skills/ads-import/references/compatibility.md +1 -1
- package/dist/skills/ads-import/references/contracts.md +63 -29
- package/dist/skills/ads-import/references/design-data.md +49 -52
- package/dist/skills/ads-import/references/drafts.md +71 -52
- package/dist/skills/ads-import/references/evidence.md +1 -5
- package/dist/skills/ads-import/references/guarded-editing.md +58 -51
- package/dist/skills/ads-import/references/implementation.md +2 -1
- package/dist/skills/ads-import/references/layers.md +1 -1
- package/dist/skills/ads-import/references/layout.md +347 -0
- package/dist/skills/ads-import/references/review.md +42 -38
- package/dist/skills/ads-import/references/runtimes.md +33 -30
- package/dist/skills/ads-import/references/scenarios.md +17 -19
- package/dist/skills/ads-import/references/tokens.md +3 -3
- package/dist/skills/ads-import/references/validation.md +83 -71
- package/dist/skills/ads-import/references/workflows.md +19 -37
- package/dist/skills/ads-migrate/SKILL.md +56 -0
- package/dist/skills/ads-migrate/references/0.4.1-to-0.4.2.md +602 -0
- package/dist/skills/ads-port/SKILL.md +54 -346
- package/dist/skills/ads-port/references/atomic-styles.md +4 -4
- package/dist/skills/ads-port/references/behaviors.md +34 -30
- package/dist/skills/ads-port/references/captures.md +31 -31
- package/dist/skills/ads-port/references/cli.md +21 -20
- package/dist/skills/ads-port/references/contracts.md +63 -29
- package/dist/skills/ads-port/references/design-data.md +49 -52
- package/dist/skills/ads-port/references/drafts.md +71 -52
- package/dist/skills/ads-port/references/evidence.md +1 -5
- package/dist/skills/ads-port/references/guarded-editing.md +58 -51
- package/dist/skills/ads-port/references/layers.md +1 -1
- package/dist/skills/ads-port/references/layout.md +347 -0
- package/dist/skills/ads-port/references/lint-and-docs.md +8 -11
- package/dist/skills/ads-port/references/native-implementation.md +8 -7
- package/dist/skills/ads-port/references/review.md +42 -38
- package/dist/skills/ads-port/references/runtimes.md +33 -30
- package/dist/skills/ads-port/references/scenarios.md +17 -19
- package/dist/skills/ads-port/references/validation.md +83 -71
- package/dist/skills/ads-port/references/workflows.md +19 -37
- package/dist/source-symbols.mjs +1 -8
- package/dist/source-values.mjs +266 -128
- package/dist/spatial-composition.mjs +322 -0
- package/dist/spatial-contexts.cjs +56 -0
- package/dist/spatial-css.cjs +351 -0
- package/dist/spatial-inputs.cjs +80 -0
- package/dist/spatial-metadata.mjs +18 -0
- package/dist/spatial-model.cjs +322 -0
- package/dist/spatial.mjs +21 -0
- package/dist/stage-timing.cjs +20 -0
- package/dist/starters/preact/design-system/patterns/Conversation/Conversation.tsx +105 -0
- package/dist/starters/preact/design-system/patterns/Shell/Shell.tsx +275 -0
- package/dist/starters/preact/design-system/review/demo-frame/DemoFrame.ads.review.tsx +7 -0
- package/dist/starters/preact/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +10 -0
- package/dist/starters/preact/design-system/showcase/mcp/main.ads.mount.tsx +8 -0
- package/dist/starters/preact/ds.config.json +24 -19
- package/dist/starters/preact/package.json +4 -8
- package/dist/starters/preact/tsconfig.json +4 -5
- package/dist/starters/preact/vite.config.ts +3 -3
- package/dist/starters/react/ADS.md +42 -47
- package/dist/starters/react/README.md +54 -52
- package/dist/starters/react/design-system/components/Actions/Button/Button.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Actions/IconButton/IconButton.tsx +18 -2
- package/dist/starters/react/design-system/components/Actions/IconButton/README.md +3 -0
- package/dist/starters/react/design-system/components/Content/Icon/Icon.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Image/Image.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Content/Logo/Logo.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/components/Forms/TextField/TextField.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/README.md +5 -0
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.fixture.ts +13 -0
- package/dist/starters/react/design-system/composition/Workspace/WorkspacePage/WorkspacePage.ads.scenario.tsx +22 -0
- package/dist/starters/react/design-system/controllers/Palette/Palette.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/index.ts +5 -8
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.fixture.ts +7 -0
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.ads.scenario.tsx +15 -0
- package/dist/starters/react/design-system/patterns/Conversation/Conversation.tsx +105 -0
- package/dist/starters/react/design-system/patterns/Conversation/README.md +9 -0
- package/dist/starters/react/design-system/patterns/Search/SearchBar/SearchBar.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/patterns/Shell/Floating.ads.fixture.ts +5 -0
- package/dist/starters/react/design-system/patterns/Shell/Floating.ads.scenario.tsx +21 -0
- package/dist/starters/react/design-system/patterns/Shell/README.md +43 -0
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.fixture.ts +5 -0
- package/dist/starters/react/design-system/patterns/Shell/Shell.ads.scenario.tsx +21 -0
- package/dist/starters/react/design-system/patterns/Shell/Shell.tsx +274 -0
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.ads.review.tsx +7 -0
- package/dist/starters/react/design-system/review/index.ads.review.ts +4 -0
- package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/region-block/RegionBlock.ads.review.tsx +6 -0
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.exports.ts +1 -0
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.ads.review.tsx +10 -0
- package/dist/starters/react/design-system/showcase/mcp/{main.tsx → main.ads.mount.tsx} +4 -2
- package/dist/starters/react/design-system/styles.css +1 -0
- package/dist/starters/react/design-system/tokens/catalog.ads.json +1221 -0
- package/dist/starters/react/design-system/tokens/colors.css +1 -1
- package/dist/starters/react/design-system/tokens/spacing.css +22 -32
- package/dist/starters/react/design-system/tokens/spatial.ads.json +70 -0
- package/dist/starters/react/design-system/tokens/themes.generated.ts +1 -1
- package/dist/starters/react/ds.config.json +24 -19
- package/dist/starters/react/package.json +2 -6
- package/dist/starters/react/tsconfig.json +2 -3
- package/dist/starters/react/vite.config.ts +3 -3
- package/dist/style-boundaries.mjs +73 -27
- package/dist/task-cache.mjs +173 -72
- package/dist/task-worker.mjs +22 -11
- package/dist/test-boundaries.mjs +133 -60
- package/dist/themes-generated.mjs +1 -1
- package/dist/themes-watch.mjs +60 -19
- package/dist/themes.mjs +176 -73
- package/dist/token-export.mjs +39 -14
- package/dist/token-policy.mjs +6 -3
- package/dist/token-quality.mjs +6 -6
- package/dist/token-samples.mjs +16 -5
- package/dist/tokens.mjs +71 -26
- package/dist/ui-framework.mjs +16 -14
- package/dist/unit-contracts.mjs +270 -89
- package/dist/units.mjs +215 -180
- package/dist/usage.mjs +138 -38
- package/dist/validation-checks.mjs +121 -38
- package/dist/validation-inputs.mjs +187 -78
- package/dist/validation.mjs +268 -102
- package/dist/verification/browser.mjs +27 -5
- package/dist/verification.mjs +711 -187
- package/docs/ADS.md +100 -89
- package/docs/ARCHITECTURE.md +353 -159
- package/docs/BEHAVIORS.md +33 -28
- package/docs/CACHING.md +55 -11
- package/docs/CHANGELOG.md +358 -17
- package/docs/COMPARISON.md +1 -1
- package/docs/CONTRACTS.md +22 -29
- package/docs/DESIGN-REFERENCES.md +40 -0
- package/docs/GUIDE.md +313 -292
- package/docs/MCP.md +261 -439
- package/docs/SPATIAL-CHECKS.md +69 -0
- package/docs/benchmarks/README.md +39 -0
- package/package.json +42 -34
- package/dist/browser-audit.mjs +0 -424
- package/dist/contract-migration.mjs +0 -110
- package/dist/create.mjs +0 -48
- package/dist/lint-config.mjs +0 -48
- package/dist/mcp/draft-exports.mjs +0 -40
- package/dist/mcp/edit-preparation.mjs +0 -115
- package/dist/mcp/project-widget.bundle.js +0 -114
- package/dist/mcp/reports.mjs +0 -101
- package/dist/mcp/widget.bundle.js +0 -147
- package/dist/oxlint.mjs +0 -88
- package/dist/preview-builder.mjs +0 -133
- package/dist/preview-workers.mjs +0 -184
- package/dist/showcase.mjs +0 -77
- package/dist/skills/ads-break-ui/LICENSE.upstream +0 -21
- package/dist/skills/ads-break-ui/README.md +0 -16
- package/dist/skills/ads-break-ui/SKILL.md +0 -415
- package/dist/skills/ads-break-ui/agents/openai.yaml +0 -4
- package/dist/skills/ads-break-ui/references/atomic-styles.md +0 -293
- package/dist/skills/ads-break-ui/references/behaviors.md +0 -411
- package/dist/skills/ads-break-ui/references/captures.md +0 -160
- package/dist/skills/ads-break-ui/references/contracts.md +0 -284
- package/dist/skills/ads-break-ui/references/design-data.md +0 -354
- package/dist/skills/ads-break-ui/references/drafts.md +0 -178
- package/dist/skills/ads-break-ui/references/evidence.md +0 -128
- package/dist/skills/ads-break-ui/references/guarded-editing.md +0 -154
- package/dist/skills/ads-break-ui/references/layers.md +0 -145
- package/dist/skills/ads-break-ui/references/reporting.md +0 -101
- package/dist/skills/ads-break-ui/references/review.md +0 -96
- package/dist/skills/ads-break-ui/references/runtimes.md +0 -203
- package/dist/skills/ads-break-ui/references/scenarios.md +0 -246
- package/dist/skills/ads-break-ui/references/validation.md +0 -162
- package/dist/skills/ads-break-ui/references/verification.md +0 -58
- package/dist/skills/ads-break-ui/references/workflows.md +0 -83
- package/dist/skills/ads-designer/references/reporting.md +0 -101
- package/dist/skills/ads-import/references/reporting.md +0 -101
- package/dist/skills/ads-motion/LICENSE.upstream +0 -21
- package/dist/skills/ads-motion/README.md +0 -22
- package/dist/skills/ads-motion/SKILL.md +0 -388
- package/dist/skills/ads-motion/agents/openai.yaml +0 -4
- package/dist/skills/ads-motion/references/atomic-styles.md +0 -293
- package/dist/skills/ads-motion/references/audit.md +0 -44
- package/dist/skills/ads-motion/references/behaviors.md +0 -411
- package/dist/skills/ads-motion/references/captures.md +0 -160
- package/dist/skills/ads-motion/references/contracts.md +0 -284
- package/dist/skills/ads-motion/references/design-data.md +0 -354
- package/dist/skills/ads-motion/references/drafts.md +0 -178
- package/dist/skills/ads-motion/references/evidence.md +0 -128
- package/dist/skills/ads-motion/references/guarded-editing.md +0 -154
- package/dist/skills/ads-motion/references/layers.md +0 -145
- package/dist/skills/ads-motion/references/motion-review.md +0 -35
- package/dist/skills/ads-motion/references/reporting.md +0 -101
- package/dist/skills/ads-motion/references/review.md +0 -96
- package/dist/skills/ads-motion/references/runtimes.md +0 -203
- package/dist/skills/ads-motion/references/scenarios.md +0 -246
- package/dist/skills/ads-motion/references/validation.md +0 -162
- package/dist/skills/ads-motion/references/verification.md +0 -39
- package/dist/skills/ads-motion/references/workflows.md +0 -83
- package/dist/skills/ads-port/references/reporting.md +0 -101
- package/dist/starters/preact/design-system/components/Layout/Grid/Grid.tsx +0 -76
- package/dist/starters/preact/design-system/review/demo-frame/DemoFrame.tsx +0 -29
- package/dist/starters/preact/design-system/review/screen-frame/ScreenFrame.tsx +0 -34
- package/dist/starters/preact/design-system/review/token-preview/TokenPreview.tsx +0 -137
- package/dist/starters/preact/design-system/showcase/mcp/main.tsx +0 -6
- package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.fixture.ts +0 -7
- package/dist/starters/react/design-system/brand/Icons/AppIcon/AppIcon.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.fixture.ts +0 -7
- package/dist/starters/react/design-system/brand/Identity/Logo/Logo.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.fixture.ts +0 -12
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.ads.scenario.tsx +0 -17
- package/dist/starters/react/design-system/components/Layout/Grid/Grid.tsx +0 -75
- package/dist/starters/react/design-system/components/Layout/Grid/README.md +0 -21
- package/dist/starters/react/design-system/review/brand-preview/BrandPreview.tsx +0 -112
- package/dist/starters/react/design-system/review/demo-frame/DemoFrame.tsx +0 -29
- package/dist/starters/react/design-system/review/grid-cell/GridCell.tsx +0 -18
- package/dist/starters/react/design-system/review/index.ts +0 -5
- package/dist/starters/react/design-system/review/screen-frame/ScreenFrame.tsx +0 -34
- package/dist/starters/react/design-system/review/token-preview/TokenPreview.tsx +0 -137
- package/dist/starters/react/design-system/showcase/mcp/index.html +0 -1
- package/dist/starters/react/design-system/tokens/Color.ads.fixture.ts +0 -124
- package/dist/starters/react/design-system/tokens/Color.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/tokens/Layout.ads.fixture.ts +0 -39
- package/dist/starters/react/design-system/tokens/Layout.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/tokens/Motion.ads.fixture.ts +0 -18
- package/dist/starters/react/design-system/tokens/Motion.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/tokens/Shape.ads.fixture.ts +0 -30
- package/dist/starters/react/design-system/tokens/Shape.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/tokens/Space.ads.fixture.ts +0 -37
- package/dist/starters/react/design-system/tokens/Space.ads.scenario.tsx +0 -4
- package/dist/starters/react/design-system/tokens/Type.ads.fixture.ts +0 -29
- package/dist/starters/react/design-system/tokens/Type.ads.scenario.tsx +0 -4
- package/dist/starters/react/package-lock.json +0 -4707
- package/dist/token-fixtures.mjs +0 -30
- package/docs/benchmarks/bun-previews.md +0 -91
- package/docs/benchmarks/preview-memory.md +0 -147
- package/docs/benchmarks/turbo-poc.md +0 -284
- package/docs/plans/execution-coordination.md +0 -57
- /package/dist/{browser-audit → render-audit}/first-render.mjs +0 -0
- /package/dist/{browser-audit → render-audit}/layout-shift.mjs +0 -0
package/dist/config.mjs
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
import { existsSync, readFileSync, readdirSync } from "node:fs";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { hasProjectConfig } from "./project-boundary.mjs";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
4
|
import { isDraftFile, draftImportViolation } from "./draft-boundary.mjs";
|
|
6
|
-
import { isSharedToken } from "./token-policy.mjs";
|
|
7
5
|
import { defaultThemes, validateThemes } from "./themes.mjs";
|
|
8
6
|
import { validateBrands } from "./brands.mjs";
|
|
9
7
|
|
|
10
8
|
export const supportedFrameworks = ["react", "preact"];
|
|
11
9
|
|
|
10
|
+
/** The design system's fixed layout inside dsDir, and the alias the app imports it by. ADS generates these entries. */
|
|
11
|
+
export const fixedLayout = {
|
|
12
|
+
publicAlias: "@ds",
|
|
13
|
+
publicEntry: "index.ts",
|
|
14
|
+
reviewEntry: "review/index.ads.review.ts",
|
|
15
|
+
stylesEntry: "styles.css",
|
|
16
|
+
tokenDir: "tokens",
|
|
17
|
+
};
|
|
18
|
+
|
|
12
19
|
export const defaultConfig = {
|
|
13
20
|
schemaVersion: 1,
|
|
14
21
|
framework: null,
|
|
@@ -16,26 +23,39 @@ export const defaultConfig = {
|
|
|
16
23
|
usage: { notifications: [], restrictedImports: [] },
|
|
17
24
|
sourceDir: "src",
|
|
18
25
|
dsDir: "design-system",
|
|
19
|
-
publicAlias: "@ds",
|
|
20
|
-
publicEntry: "index.ts",
|
|
21
|
-
reviewEntry: "review/index.ts",
|
|
22
|
-
stylesEntry: "styles.css",
|
|
23
|
-
tokenDir: "tokens",
|
|
24
26
|
themes: defaultThemes,
|
|
25
27
|
// Optional brand axis beside the themes; empty means one brand.
|
|
26
28
|
brands: [],
|
|
27
29
|
// With no data-theme on the root, the OS color scheme picks the first theme of that scheme.
|
|
28
30
|
followSystemTheme: false,
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
assets: {
|
|
32
|
+
publicDirs: ["public/assets"],
|
|
33
|
+
generatedPaths: ["dist", "dist-showcase", ".vite", ".ds"],
|
|
34
|
+
generatedFiles: [],
|
|
35
|
+
iconSource: null,
|
|
36
|
+
targets: [],
|
|
37
|
+
glyphs: null,
|
|
38
|
+
imageBudgetKb: null,
|
|
39
|
+
fontBudgetKb: null,
|
|
40
|
+
preloadFonts: null,
|
|
41
|
+
},
|
|
42
|
+
// Draft acceptance runs ads check, these scripts, and the draft owners' own behavior tests and
|
|
43
|
+
// render audit. ads_validate runs ads check, both script lists, and every behavior test and render
|
|
44
|
+
// audit its change set reaches; it has no depth settings.
|
|
45
|
+
acceptance: { scripts: [], behavior: true, audit: true },
|
|
46
|
+
validation: { scripts: [], inputs: [] },
|
|
35
47
|
resources: { memoryLimitMb: null },
|
|
36
48
|
// Width tokens and owners allowed fixed widths; see src/layout-widths.mjs.
|
|
37
49
|
layout: { widthTokens: [], fixedWidthUnits: [] },
|
|
38
|
-
mcp: {
|
|
50
|
+
mcp: {
|
|
51
|
+
showcaseTitle: null,
|
|
52
|
+
mutationCheckTimeoutMs: 60000,
|
|
53
|
+
previewBuildTimeoutMs: 300000,
|
|
54
|
+
auditPages: 4,
|
|
55
|
+
behaviorProfiles: {},
|
|
56
|
+
capture: {},
|
|
57
|
+
resultRetention: { maxRuns: 50, maxAgeDays: 7, maxBytesMb: 256 },
|
|
58
|
+
},
|
|
39
59
|
};
|
|
40
60
|
|
|
41
61
|
export function isInside(parent, file) {
|
|
@@ -56,29 +76,42 @@ function validateBrandTargets(targets, { root, dsRoot }) {
|
|
|
56
76
|
for (const [index, target] of targets.entries()) {
|
|
57
77
|
const field = `assets.targets[${index}]`;
|
|
58
78
|
if (!target || typeof target !== "object" || Array.isArray(target)) throw new Error(`${field} must be an object.`);
|
|
59
|
-
const unknown = Object.keys(target).filter(key => !["from", "to", ...sizeKeys].includes(key));
|
|
79
|
+
const unknown = Object.keys(target).filter((key) => !["from", "to", ...sizeKeys].includes(key));
|
|
60
80
|
if (unknown.length) throw new Error(`${field} has unknown keys: ${unknown.join(", ")}.`);
|
|
61
81
|
const source = projectPath(dsRoot, target.from, `${field}.from`);
|
|
62
82
|
const sourceFormat = path.extname(source).toLowerCase();
|
|
63
|
-
if (!isInside(path.join(dsRoot, "assets/brand"), source) || !brandFormats.includes(sourceFormat))
|
|
83
|
+
if (!isInside(path.join(dsRoot, "assets/brand"), source) || !brandFormats.includes(sourceFormat))
|
|
84
|
+
throw new Error(`${field}.from must name brand artwork inside the ADS's assets/brand/ folder (${brandFormats.join(", ")}).`);
|
|
64
85
|
const output = projectPath(root, target.to, `${field}.to`);
|
|
65
|
-
if (isInside(path.join(dsRoot, "assets"), output) || isInside(path.join(root, ".ds"), output))
|
|
86
|
+
if (isInside(path.join(dsRoot, "assets"), output) || isInside(path.join(root, ".ds"), output))
|
|
87
|
+
throw new Error(`${field}.to must be outside the ADS assets/ folder and .ds/.`);
|
|
66
88
|
if (outputs.has(output)) throw new Error(`${field}.to repeats an earlier target's output.`);
|
|
67
89
|
outputs.add(output);
|
|
68
90
|
const format = path.extname(output).toLowerCase();
|
|
69
|
-
const sized = sizeKeys.some(key => key in target);
|
|
91
|
+
const sized = sizeKeys.some((key) => key in target);
|
|
70
92
|
// The same format without sizes is a copy of the supplied file.
|
|
71
93
|
if (!sized && format === sourceFormat) continue;
|
|
72
94
|
if (format === ".svg") throw new Error(`${field} copies an SVG master to .svg; it takes no sizes.`);
|
|
73
|
-
if (!renderableFormats.includes(sourceFormat))
|
|
74
|
-
|
|
75
|
-
|
|
95
|
+
if (!renderableFormats.includes(sourceFormat))
|
|
96
|
+
throw new Error(`${field} copies the finished ${sourceFormat} file; give it the same extension and no sizes.`);
|
|
97
|
+
const pixels = (value) => Number.isInteger(value) && value >= 1 && value <= 4096;
|
|
98
|
+
if (target.background !== undefined && (typeof target.background !== "string" || !/^#(?:[0-9a-f]{3}|[0-9a-f]{6}|[0-9a-f]{8})$/i.test(target.background)))
|
|
99
|
+
throw new Error(`${field}.background must be a #RGB, #RRGGBB or #RRGGBBAA colour on a PNG, ICO or ICNS target.`);
|
|
76
100
|
if (format === ".png") {
|
|
77
|
-
const square = target.size !== undefined,
|
|
78
|
-
|
|
101
|
+
const square = target.size !== undefined,
|
|
102
|
+
rectangle = target.width !== undefined || target.height !== undefined;
|
|
103
|
+
if (square === rectangle || target.sizes !== undefined || (square ? !pixels(target.size) : !pixels(target.width) || !pixels(target.height)))
|
|
104
|
+
throw new Error(`${field} renders a PNG at one size (1–4096) or one width and height.`);
|
|
79
105
|
} else if (format === ".ico" || format === ".icns") {
|
|
80
106
|
const allowed = format === ".ico" ? [16, 24, 32, 48, 64, 128, 256] : iconSizes;
|
|
81
|
-
if (
|
|
107
|
+
if (
|
|
108
|
+
["size", "width", "height"].some((key) => key in target) ||
|
|
109
|
+
!Array.isArray(target.sizes) ||
|
|
110
|
+
!target.sizes.length ||
|
|
111
|
+
new Set(target.sizes).size !== target.sizes.length ||
|
|
112
|
+
target.sizes.some((size) => !allowed.includes(size))
|
|
113
|
+
)
|
|
114
|
+
throw new Error(`${field}.sizes must list distinct ${format.slice(1).toUpperCase()} sizes from ${allowed.join(", ")}.`);
|
|
82
115
|
} else throw new Error(`${field}.to must end in .svg, .png, .ico or .icns, or keep the supplied file's extension.`);
|
|
83
116
|
}
|
|
84
117
|
}
|
|
@@ -86,14 +119,22 @@ function validateBrandTargets(targets, { root, dsRoot }) {
|
|
|
86
119
|
function validateGlyphs(glyphs, { dsRoot }) {
|
|
87
120
|
if (glyphs === null) return;
|
|
88
121
|
if (!glyphs || typeof glyphs !== "object" || Array.isArray(glyphs)) throw new Error("assets.glyphs must be an object or null.");
|
|
89
|
-
const unknown = Object.keys(glyphs).filter(key => !["source", "output", "attributes"].includes(key));
|
|
122
|
+
const unknown = Object.keys(glyphs).filter((key) => !["source", "output", "attributes"].includes(key));
|
|
90
123
|
if (unknown.length) throw new Error(`assets.glyphs has unknown keys: ${unknown.join(", ")}.`);
|
|
91
124
|
const source = projectPath(dsRoot, glyphs.source, "assets.glyphs.source");
|
|
92
|
-
if (!isInside(path.join(dsRoot, "assets"), source) || source === path.join(dsRoot, "assets"))
|
|
125
|
+
if (!isInside(path.join(dsRoot, "assets"), source) || source === path.join(dsRoot, "assets"))
|
|
126
|
+
throw new Error("assets.glyphs.source must be a folder inside the ADS's assets/ folder.");
|
|
93
127
|
const output = projectPath(dsRoot, glyphs.output, "assets.glyphs.output");
|
|
94
|
-
if (isInside(path.join(dsRoot, "assets"), output) || path.extname(output) !== ".ts")
|
|
128
|
+
if (isInside(path.join(dsRoot, "assets"), output) || path.extname(output) !== ".ts")
|
|
129
|
+
throw new Error("assets.glyphs.output must be a .ts module in the ADS, outside assets/.");
|
|
95
130
|
const attributes = glyphs.attributes ?? {};
|
|
96
|
-
if (
|
|
131
|
+
if (
|
|
132
|
+
!attributes ||
|
|
133
|
+
typeof attributes !== "object" ||
|
|
134
|
+
Array.isArray(attributes) ||
|
|
135
|
+
Object.entries(attributes).some(([name, value]) => !/^[a-z][a-z0-9-]*$/.test(name) || typeof value !== "string" || /["<>]/.test(value))
|
|
136
|
+
)
|
|
137
|
+
throw new Error("assets.glyphs.attributes maps SVG attribute names to plain string values.");
|
|
97
138
|
}
|
|
98
139
|
|
|
99
140
|
export function projectPath(root, value, field) {
|
|
@@ -105,82 +146,171 @@ export function projectPath(root, value, field) {
|
|
|
105
146
|
return absolute;
|
|
106
147
|
}
|
|
107
148
|
|
|
149
|
+
/** Where ADS publishes the verified preview graph, relative to the project root. */
|
|
150
|
+
export const PREVIEW_MANIFEST = ".ds/preview/manifest.json";
|
|
151
|
+
|
|
108
152
|
export function loadConfig(directory = process.cwd()) {
|
|
109
153
|
const root = path.resolve(directory);
|
|
110
154
|
const configFile = path.join(root, "ds.config.json");
|
|
111
155
|
const user = existsSync(configFile) ? JSON.parse(readFileSync(configFile, "utf8")) : {};
|
|
112
156
|
if (!user || typeof user !== "object" || Array.isArray(user)) throw new Error("ds.config.json must be an object.");
|
|
113
|
-
if (Object.hasOwn(user, "enforce")) throw new Error("enforce was removed in 0.3.47: ADS findings are errors, review items or info. Remove enforce from ds.config.json.");
|
|
114
157
|
for (const field of Object.keys(user)) {
|
|
115
158
|
if (!(field in defaultConfig)) throw new Error(`Unknown ADS configuration field: ${field}`);
|
|
116
159
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
for (const key of Object.keys(user[field] ?? {}))
|
|
160
|
+
|
|
161
|
+
for (const field of ["assets", "mcp", "acceptance", "validation", "usage", "resources", "layout"]) {
|
|
162
|
+
if (user[field] !== undefined && (!user[field] || typeof user[field] !== "object" || Array.isArray(user[field])))
|
|
163
|
+
throw new Error(`${field} must be an object.`);
|
|
164
|
+
for (const key of Object.keys(user[field] ?? {})) {
|
|
165
|
+
if (!(key in defaultConfig[field])) throw new Error(`Unknown ${field} configuration field: ${key}`);
|
|
166
|
+
}
|
|
122
167
|
}
|
|
123
|
-
const config = {
|
|
168
|
+
const config = {
|
|
169
|
+
...defaultConfig,
|
|
170
|
+
...user,
|
|
171
|
+
...fixedLayout,
|
|
172
|
+
assets: { ...defaultConfig.assets, ...user.assets },
|
|
173
|
+
acceptance: { ...defaultConfig.acceptance, ...user.acceptance },
|
|
174
|
+
validation: { ...defaultConfig.validation, ...user.validation },
|
|
175
|
+
mcp: { ...defaultConfig.mcp, ...user.mcp },
|
|
176
|
+
usage: { ...defaultConfig.usage, ...user.usage },
|
|
177
|
+
resources: { ...defaultConfig.resources, ...user.resources },
|
|
178
|
+
layout: { ...defaultConfig.layout, ...user.layout },
|
|
179
|
+
};
|
|
124
180
|
validateThemes(config.themes);
|
|
125
181
|
validateBrands(config.brands);
|
|
126
182
|
if (typeof config.followSystemTheme !== "boolean") throw new Error("followSystemTheme must be true or false.");
|
|
127
183
|
if (config.followSystemTheme) {
|
|
128
184
|
const other = config.themes[0].scheme === "dark" ? "light" : "dark";
|
|
129
|
-
if (!config.themes.some(theme => theme.scheme === other)) throw new Error(`followSystemTheme needs a declared theme with scheme ${other}.`);
|
|
185
|
+
if (!config.themes.some((theme) => theme.scheme === other)) throw new Error(`followSystemTheme needs a declared theme with scheme ${other}.`);
|
|
130
186
|
}
|
|
131
|
-
for (const brand of config.brands)
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
if (
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
187
|
+
for (const brand of config.brands)
|
|
188
|
+
if (config.themes.some((theme) => theme.name === `brand-${brand.name}`))
|
|
189
|
+
throw new Error(`Theme "brand-${brand.name}" and brand "${brand.name}" would share the display switch --display-brand-${brand.name}; rename one.`);
|
|
190
|
+
if (
|
|
191
|
+
config.resources.memoryLimitMb !== null &&
|
|
192
|
+
(!Number.isInteger(config.resources.memoryLimitMb) || config.resources.memoryLimitMb < 64 || config.resources.memoryLimitMb > 1048576)
|
|
193
|
+
)
|
|
194
|
+
throw new Error("resources.memoryLimitMb must be null (automatic) or an integer from 64 to 1048576 MiB.");
|
|
195
|
+
if (
|
|
196
|
+
config.assets.imageBudgetKb !== null &&
|
|
197
|
+
(!Number.isInteger(config.assets.imageBudgetKb) || config.assets.imageBudgetKb < 1 || config.assets.imageBudgetKb > 1048576)
|
|
198
|
+
)
|
|
199
|
+
throw new Error("assets.imageBudgetKb must be null (a limit per format) or a positive whole number of KB for every format.");
|
|
200
|
+
if (
|
|
201
|
+
config.assets.preloadFonts !== null &&
|
|
202
|
+
(!Array.isArray(config.assets.preloadFonts) ||
|
|
203
|
+
config.assets.preloadFonts.some(
|
|
204
|
+
(item) =>
|
|
205
|
+
!item ||
|
|
206
|
+
typeof item !== "object" ||
|
|
207
|
+
Array.isArray(item) ||
|
|
208
|
+
Object.keys(item).some((key) => !["family", "weight"].includes(key)) ||
|
|
209
|
+
typeof item.family !== "string" ||
|
|
210
|
+
!item.family ||
|
|
211
|
+
!Number.isInteger(item.weight) ||
|
|
212
|
+
item.weight < 1 ||
|
|
213
|
+
item.weight > 1000,
|
|
214
|
+
))
|
|
215
|
+
)
|
|
216
|
+
throw new Error('assets.preloadFonts must be null or an array of { "family": "Name", "weight": 400 }.');
|
|
217
|
+
if (
|
|
218
|
+
config.assets.fontBudgetKb !== null &&
|
|
219
|
+
(!Number.isInteger(config.assets.fontBudgetKb) || config.assets.fontBudgetKb < 1 || config.assets.fontBudgetKb > 1048576)
|
|
220
|
+
)
|
|
221
|
+
throw new Error("assets.fontBudgetKb must be null (the default limit) or a positive whole number of KB.");
|
|
222
|
+
if (
|
|
223
|
+
!Array.isArray(config.layout.widthTokens) ||
|
|
224
|
+
config.layout.widthTokens.length > 200 ||
|
|
225
|
+
new Set(config.layout.widthTokens).size !== config.layout.widthTokens.length ||
|
|
226
|
+
config.layout.widthTokens.some((name) => typeof name !== "string" || !/^--[\w-][\w*-]*$/.test(name))
|
|
227
|
+
)
|
|
228
|
+
throw new Error("layout.widthTokens must contain distinct token names or globs such as --panel-*, and cannot name every token.");
|
|
229
|
+
if (
|
|
230
|
+
!Array.isArray(config.layout.fixedWidthUnits) ||
|
|
231
|
+
config.layout.fixedWidthUnits.length > 200 ||
|
|
232
|
+
new Set(config.layout.fixedWidthUnits).size !== config.layout.fixedWidthUnits.length ||
|
|
233
|
+
config.layout.fixedWidthUnits.some(
|
|
234
|
+
(glob) => typeof glob !== "string" || !glob || glob.includes("\\") || glob.startsWith("/") || glob.split("/").includes("..") || !/[^*/]/.test(glob),
|
|
235
|
+
)
|
|
236
|
+
)
|
|
237
|
+
throw new Error(
|
|
238
|
+
"layout.fixedWidthUnits must contain distinct unit ids or project-relative globs such as components/Overlay/*, and cannot name every unit.",
|
|
239
|
+
);
|
|
240
|
+
if (!Array.isArray(config.usage.notifications) || config.usage.notifications.length > 100)
|
|
241
|
+
throw new Error("usage.notifications must be an array of notification API registrations.");
|
|
139
242
|
const notificationNames = new Set();
|
|
140
243
|
for (const entry of config.usage.notifications) {
|
|
141
|
-
if (
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
244
|
+
if (
|
|
245
|
+
!entry ||
|
|
246
|
+
typeof entry !== "object" ||
|
|
247
|
+
Array.isArray(entry) ||
|
|
248
|
+
Object.keys(entry).some((key) => !["api", "host", "rootFiles"].includes(key)) ||
|
|
249
|
+
![entry.api, entry.host].every((name) => typeof name === "string" && /^[A-Za-z_$][\w$]*$/.test(name))
|
|
250
|
+
)
|
|
251
|
+
throw new Error("Each usage.notifications entry requires public api and host export names and rootFiles.");
|
|
252
|
+
if (notificationNames.has(entry.api) || notificationNames.has(entry.host) || entry.api === entry.host)
|
|
253
|
+
throw new Error("Notification API and host registrations must be distinct.");
|
|
254
|
+
notificationNames.add(entry.api);
|
|
255
|
+
notificationNames.add(entry.host);
|
|
256
|
+
if (!Array.isArray(entry.rootFiles) || !entry.rootFiles.length || entry.rootFiles.length > 100 || new Set(entry.rootFiles).size !== entry.rootFiles.length)
|
|
257
|
+
throw new Error("Notification rootFiles must contain distinct project-relative source files.");
|
|
145
258
|
for (const file of entry.rootFiles) {
|
|
146
259
|
projectPath(root, file, "usage.notifications.rootFiles");
|
|
147
|
-
if (
|
|
260
|
+
if (
|
|
261
|
+
!/\.[cm]?[jt]sx?$/.test(file) ||
|
|
262
|
+
file.includes("\\") ||
|
|
263
|
+
file.split("/").some((part) => !part || [".", "..", "node_modules", ".git", ".ds"].includes(part))
|
|
264
|
+
)
|
|
265
|
+
throw new Error("Notification rootFiles must name canonical project-relative source files.");
|
|
148
266
|
}
|
|
149
267
|
}
|
|
150
|
-
if (
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
268
|
+
if (
|
|
269
|
+
!Array.isArray(config.usage.restrictedImports) ||
|
|
270
|
+
config.usage.restrictedImports.length > 100 ||
|
|
271
|
+
new Set(config.usage.restrictedImports).size !== config.usage.restrictedImports.length ||
|
|
272
|
+
config.usage.restrictedImports.some((name) => typeof name !== "string" || !/^(?:@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*$/.test(name))
|
|
273
|
+
)
|
|
274
|
+
throw new Error("usage.restrictedImports must contain distinct npm package names.");
|
|
275
|
+
for (const name of ["acceptance", "validation"]) {
|
|
276
|
+
const scripts = config[name].scripts;
|
|
277
|
+
if (
|
|
278
|
+
!Array.isArray(scripts) ||
|
|
279
|
+
scripts.length > 20 ||
|
|
280
|
+
new Set(scripts).size !== scripts.length ||
|
|
281
|
+
scripts.some((script) => typeof script !== "string" || !/^[a-zA-Z0-9][\w:.-]*$/.test(script))
|
|
282
|
+
)
|
|
283
|
+
throw new Error(`${name}.scripts must contain up to 20 unique package script names.`);
|
|
156
284
|
}
|
|
157
|
-
|
|
285
|
+
for (const key of ["behavior", "audit"]) if (typeof config.acceptance[key] !== "boolean") throw new Error(`acceptance.${key} must be true or false.`);
|
|
286
|
+
if (config.validation.scripts.some((script) => config.acceptance.scripts.includes(script)))
|
|
287
|
+
throw new Error("validation.scripts run after acceptance.scripts; list each script once.");
|
|
288
|
+
if (
|
|
289
|
+
!Array.isArray(config.validation.inputs) ||
|
|
290
|
+
config.validation.inputs.length > 200 ||
|
|
291
|
+
new Set(config.validation.inputs).size !== config.validation.inputs.length
|
|
292
|
+
)
|
|
293
|
+
throw new Error("validation.inputs must contain at most 200 unique project-relative files or directories.");
|
|
158
294
|
for (const file of config.validation.inputs) {
|
|
159
|
-
const absolute = projectPath(root,file,"validation.inputs");
|
|
160
|
-
if (
|
|
295
|
+
const absolute = projectPath(root, file, "validation.inputs");
|
|
296
|
+
if (
|
|
297
|
+
absolute === root ||
|
|
298
|
+
path.relative(root, absolute).replaceAll("\\", "/") !== file ||
|
|
299
|
+
file.split("/").some((part) => ["node_modules", ".git", ".ds"].includes(part))
|
|
300
|
+
)
|
|
301
|
+
throw new Error("validation.inputs must name canonical source paths below the project root, excluding dependency and metadata directories.");
|
|
161
302
|
}
|
|
162
303
|
if (config.schemaVersion !== 1) throw new Error(`Unsupported ADS config version: ${config.schemaVersion}`);
|
|
163
304
|
if (user.framework !== undefined && !supportedFrameworks.includes(user.framework)) throw new Error("framework must be react or preact.");
|
|
164
|
-
if (
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
305
|
+
if (
|
|
306
|
+
!Array.isArray(config.behaviorLibraries) ||
|
|
307
|
+
config.behaviorLibraries.length > 100 ||
|
|
308
|
+
new Set(config.behaviorLibraries).size !== config.behaviorLibraries.length ||
|
|
309
|
+
config.behaviorLibraries.some((name) => typeof name !== "string" || name.length > 214 || !/^(?:@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*$/.test(name))
|
|
310
|
+
)
|
|
311
|
+
throw new Error("behaviorLibraries must contain up to 100 unique npm package names, without versions, subpaths or wildcards.");
|
|
169
312
|
const sourceRoot = projectPath(root, config.sourceDir, "sourceDir");
|
|
170
313
|
const dsRoot = projectPath(root, config.dsDir, "dsDir");
|
|
171
|
-
for (const field of ["publicEntry", "reviewEntry", "stylesEntry", "tokenDir"]) projectPath(dsRoot, config[field], field);
|
|
172
|
-
if (!isInside(path.join(dsRoot, "review"), path.resolve(dsRoot, config.reviewEntry)) || path.resolve(dsRoot, config.reviewEntry) === path.join(dsRoot, "review") || !/\.[cm]?[jt]sx?$/.test(config.reviewEntry)) throw new Error("reviewEntry must name a script entry inside the ADS review/ development layer.");
|
|
173
|
-
for (const file of config.inlineStyleFiles) projectPath(root, file, "inlineStyleFiles");
|
|
174
|
-
if (!Array.isArray(config.boundaries.componentVariables) || config.boundaries.componentVariables.some((name) => typeof name !== "string" || !/^--ds-[\w-]+$/.test(name) || isStateVariable(name))) throw new Error("boundaries.componentVariables must name non-state --ds-* customization variables.");
|
|
175
|
-
if (!Array.isArray(config.boundaries.styleWrites)) throw new Error("boundaries.styleWrites must be an array.");
|
|
176
|
-
const boundaryFiles = new Set();
|
|
177
|
-
for (const boundary of config.boundaries.styleWrites) {
|
|
178
|
-
if (!boundary || typeof boundary !== "object" || Array.isArray(boundary) || Object.keys(boundary).some((key) => !["file", "properties"].includes(key))) throw new Error("Each styleWrites boundary requires file and properties.");
|
|
179
|
-
const file = projectPath(root, boundary.file, "boundaries.styleWrites.file");
|
|
180
|
-
if (boundaryFiles.has(file)) throw new Error("Duplicate styleWrites file boundary.");
|
|
181
|
-
boundaryFiles.add(file);
|
|
182
|
-
if (!Array.isArray(boundary.properties) || !boundary.properties.length || boundary.properties.some((name) => typeof name !== "string" || !/^(?:--[\w-]+|[a-z][a-z0-9-]*)$/.test(name) || name === "css-text" || isStateVariable(name) || isSharedToken(name) || name.startsWith("--") && !/^(?:--ds-|--ux-|--showcase-)/.test(name))) throw new Error("styleWrites.properties must name explicit CSS properties; bulk cssText, shared tokens, foreign prefixes, and primitive-state writes cannot be allowed.");
|
|
183
|
-
}
|
|
184
314
|
for (const field of ["publicDirs", "generatedPaths", "generatedFiles"]) {
|
|
185
315
|
if (!Array.isArray(config.assets[field])) throw new Error(`assets.${field} must be an array.`);
|
|
186
316
|
for (const entry of config.assets[field]) {
|
|
@@ -189,73 +319,90 @@ export function loadConfig(directory = process.cwd()) {
|
|
|
189
319
|
if (absolute === base) throw new Error(`assets.${field} must name a path below its root.`);
|
|
190
320
|
}
|
|
191
321
|
}
|
|
192
|
-
if (!Array.isArray(config.oxlint.plugins) || !config.oxlint.rules || typeof config.oxlint.rules !== "object" || Array.isArray(config.oxlint.rules)) {
|
|
193
|
-
throw new Error("oxlint requires plugins (array) and rules (object).");
|
|
194
|
-
}
|
|
195
|
-
if (!Array.isArray(config.oxlint.overrides)) throw new Error("oxlint.overrides must be an array.");
|
|
196
|
-
for (const override of config.oxlint.overrides) {
|
|
197
|
-
if (!override || typeof override !== "object" || Array.isArray(override) || Object.keys(override).some((key) => !["files", "rules"].includes(key))) throw new Error("Each oxlint override requires files and rules only.");
|
|
198
|
-
if (!Array.isArray(override.files) || !override.files.length || override.files.some((file) => typeof file !== "string" || !file.trim() || file.startsWith("!") || path.isAbsolute(file) || file.split(/[\\/]/).includes(".."))) throw new Error("oxlint.overrides.files must contain project-relative paths or globs.");
|
|
199
|
-
if (!override.rules || typeof override.rules !== "object" || Array.isArray(override.rules)) throw new Error("oxlint.overrides.rules must be an object.");
|
|
200
|
-
}
|
|
201
322
|
if (config.assets.iconSource !== null) {
|
|
202
323
|
const source = projectPath(dsRoot, config.assets.iconSource, "assets.iconSource");
|
|
203
|
-
if (!isInside(path.join(dsRoot, "assets/brand"), source) || !renderableFormats.includes(path.extname(source).toLowerCase()))
|
|
324
|
+
if (!isInside(path.join(dsRoot, "assets/brand"), source) || !renderableFormats.includes(path.extname(source).toLowerCase()))
|
|
325
|
+
throw new Error("assets.iconSource must name an SVG, or a square PNG, JPEG or WebP of at least 512 px, inside the ADS's assets/brand/ folder.");
|
|
204
326
|
}
|
|
205
327
|
validateBrandTargets(config.assets.targets, { root, dsRoot });
|
|
206
328
|
validateGlyphs(config.assets.glyphs, { dsRoot });
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
}
|
|
213
|
-
if (config.mcp.showcaseUrl !== null) {
|
|
214
|
-
let url;
|
|
215
|
-
try { url = new URL(config.mcp.showcaseUrl); } catch { throw new Error("mcp.showcaseUrl must be an http(s) URL or null."); }
|
|
216
|
-
if (!["http:", "https:"].includes(url.protocol) || url.username || url.password) throw new Error("mcp.showcaseUrl must be an http(s) URL without credentials.");
|
|
217
|
-
}
|
|
218
|
-
if (config.mcp.showcaseTitle !== null && (typeof config.mcp.showcaseTitle !== "string" || !config.mcp.showcaseTitle.trim() || config.mcp.showcaseTitle.length > 120)) throw new Error("mcp.showcaseTitle must be a non-empty title of at most 120 characters or null.");
|
|
219
|
-
if (!Array.isArray(config.mcp.apps)) throw new Error("mcp.apps must be an array of built project previews.");
|
|
329
|
+
if (
|
|
330
|
+
config.mcp.showcaseTitle !== null &&
|
|
331
|
+
(typeof config.mcp.showcaseTitle !== "string" || !config.mcp.showcaseTitle.trim() || config.mcp.showcaseTitle.length > 120)
|
|
332
|
+
)
|
|
333
|
+
throw new Error("mcp.showcaseTitle must be a non-empty title of at most 120 characters or null.");
|
|
220
334
|
const capture = config.mcp.capture;
|
|
221
|
-
if (
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
335
|
+
if (
|
|
336
|
+
!capture ||
|
|
337
|
+
typeof capture !== "object" ||
|
|
338
|
+
Array.isArray(capture) ||
|
|
339
|
+
Object.keys(capture).some((key) => !["browser", "channel", "timeoutMs"].includes(key)) ||
|
|
340
|
+
!["chromium", "firefox", "webkit"].includes(capture.browser ?? "chromium") ||
|
|
341
|
+
(capture.channel !== undefined &&
|
|
342
|
+
(typeof capture.channel !== "string" || !/^[\w-]{1,60}$/.test(capture.channel) || ![undefined, "chromium"].includes(capture.browser))) ||
|
|
343
|
+
(capture.timeoutMs !== undefined && (!Number.isInteger(capture.timeoutMs) || capture.timeoutMs < 100 || capture.timeoutMs > 300000))
|
|
344
|
+
)
|
|
345
|
+
throw new Error(
|
|
346
|
+
"mcp.capture accepts browser (chromium/firefox/webkit), an optional Chromium channel, and timeoutMs (100–300000). Install Playwright and its browser in the project; ADS installs nothing.",
|
|
347
|
+
);
|
|
348
|
+
if (
|
|
349
|
+
!config.mcp.behaviorProfiles ||
|
|
350
|
+
typeof config.mcp.behaviorProfiles !== "object" ||
|
|
351
|
+
Array.isArray(config.mcp.behaviorProfiles) ||
|
|
352
|
+
Object.keys(config.mcp.behaviorProfiles).length > 20
|
|
353
|
+
)
|
|
354
|
+
throw new Error("mcp.behaviorProfiles must be an object of up to 20 registered execution profiles.");
|
|
226
355
|
for (const [name, profile] of Object.entries(config.mcp.behaviorProfiles)) {
|
|
227
|
-
if (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
}
|
|
249
|
-
if(config.framework&&config.mcp.previewManifest&&config.mcp.previewWatch===null){
|
|
250
|
-
config.mcp.previewWatch={command:"bun",args:[fileURLToPath(new URL("./bun-compiler.mjs",import.meta.url)),"--watch"]};
|
|
251
|
-
}
|
|
252
|
-
const appIds = new Set();
|
|
253
|
-
for (const app of config.mcp.apps) {
|
|
254
|
-
if (!app || typeof app !== "object" || Object.keys(app).some((key) => !["id", "title", "kind", "file", "description"].includes(key)) || !/^[a-z][a-z0-9-]{0,63}$/.test(app.id) || app.id === "tokens" || appIds.has(app.id) || typeof app.title !== "string" || !app.title.trim() || !["components", "patterns", "showcase"].includes(app.kind) || app.description !== undefined && typeof app.description !== "string") throw new Error("Each mcp.apps entry needs a unique id (tokens is reserved), title, kind (components/patterns/showcase), and project-relative HTML file.");
|
|
255
|
-
const file = projectPath(root, app.file, "mcp.apps.file");
|
|
256
|
-
if (path.extname(file) !== ".html") throw new Error("mcp.apps.file must be a built, self-contained HTML file.");
|
|
257
|
-
appIds.add(app.id);
|
|
356
|
+
if (
|
|
357
|
+
!/^[a-zA-Z0-9][\w.-]{0,79}$/.test(name) ||
|
|
358
|
+
!profile ||
|
|
359
|
+
typeof profile !== "object" ||
|
|
360
|
+
Array.isArray(profile) ||
|
|
361
|
+
Object.keys(profile).some((key) => !["command", "args", "timeoutMs", "runner", "framework", "mode"].includes(key)) ||
|
|
362
|
+
typeof profile.command !== "string" ||
|
|
363
|
+
!profile.command.trim() ||
|
|
364
|
+
profile.command.includes("\0") ||
|
|
365
|
+
!Array.isArray(profile.args) ||
|
|
366
|
+
profile.args.some((arg) => typeof arg !== "string" || arg.includes("\0")) ||
|
|
367
|
+
!["protocol", "playwright"].includes(profile.runner ?? "protocol") ||
|
|
368
|
+
(profile.framework !== undefined && profile.framework !== config.framework) ||
|
|
369
|
+
(profile.mode !== undefined && !["browser", "strict", "unit"].includes(profile.mode)) ||
|
|
370
|
+
(profile.timeoutMs !== undefined && (!Number.isInteger(profile.timeoutMs) || profile.timeoutMs < 100 || profile.timeoutMs > 900000))
|
|
371
|
+
)
|
|
372
|
+
throw new Error(
|
|
373
|
+
`Invalid behavior profile ${name}. Use literal executable/args, a protocol or Playwright runner, a matching framework and a timeout from 100 to 900000 ms. Profiles do not install dependencies or receive APIs from an MCP host.`,
|
|
374
|
+
);
|
|
375
|
+
if (profile.mode === "strict" && config.framework !== "react")
|
|
376
|
+
throw new Error(`Behavior profile ${name}: React StrictMode requires framework react; use the configured framework's lifecycle tests instead.`);
|
|
258
377
|
}
|
|
378
|
+
const retention = { ...defaultConfig.mcp.resultRetention, ...config.mcp.resultRetention };
|
|
379
|
+
if (
|
|
380
|
+
!config.mcp.resultRetention ||
|
|
381
|
+
typeof config.mcp.resultRetention !== "object" ||
|
|
382
|
+
Array.isArray(config.mcp.resultRetention) ||
|
|
383
|
+
Object.keys(config.mcp.resultRetention).some((key) => !["maxRuns", "maxAgeDays", "maxBytesMb"].includes(key)) ||
|
|
384
|
+
!Number.isInteger(retention.maxRuns) ||
|
|
385
|
+
retention.maxRuns < 1 ||
|
|
386
|
+
retention.maxRuns > 1000 ||
|
|
387
|
+
!Number.isInteger(retention.maxAgeDays) ||
|
|
388
|
+
retention.maxAgeDays < 1 ||
|
|
389
|
+
retention.maxAgeDays > 365 ||
|
|
390
|
+
!Number.isInteger(retention.maxBytesMb) ||
|
|
391
|
+
retention.maxBytesMb < 8 ||
|
|
392
|
+
retention.maxBytesMb > 16384
|
|
393
|
+
)
|
|
394
|
+
throw new Error("mcp.resultRetention requires maxRuns (1–1000), maxAgeDays (1–365), maxBytesMb (8–16384).");
|
|
395
|
+
config.mcp.resultRetention = retention;
|
|
396
|
+
if (!Number.isInteger(config.mcp.mutationCheckTimeoutMs) || config.mcp.mutationCheckTimeoutMs < 100 || config.mcp.mutationCheckTimeoutMs > 300000)
|
|
397
|
+
throw new Error(
|
|
398
|
+
"mcp.mutationCheckTimeoutMs must be an integer from 100 to 300000. This budget applies to each registered project script, separately from behavior profiles.",
|
|
399
|
+
);
|
|
400
|
+
if (!Number.isInteger(config.mcp.auditPages) || config.mcp.auditPages < 1 || config.mcp.auditPages > 16)
|
|
401
|
+
throw new Error("mcp.auditPages must be an integer from 1 to 16: how many pages the render audit renders at once.");
|
|
402
|
+
if (!Number.isInteger(config.mcp.previewBuildTimeoutMs) || config.mcp.previewBuildTimeoutMs < 1000 || config.mcp.previewBuildTimeoutMs > 3600000)
|
|
403
|
+
throw new Error(
|
|
404
|
+
"mcp.previewBuildTimeoutMs must be an integer from 1000 to 3600000. It is how long a preview waits for its build, including the first build after the MCP server starts.",
|
|
405
|
+
);
|
|
259
406
|
return { root, config, sourceRoot, dsRoot };
|
|
260
407
|
}
|
|
261
408
|
|
|
@@ -268,19 +415,11 @@ export function isTestFile(file) {
|
|
|
268
415
|
}
|
|
269
416
|
|
|
270
417
|
export function isScenarioFile(file) {
|
|
271
|
-
return
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export function isFixtureFile(file) {
|
|
275
|
-
return /(?:^|[\\/])fixtures?\.(?:[cm]?[jt]sx?|json)$/.test(file) || /\.fixtures?\.(?:[cm]?[jt]sx?|json)$/.test(file);
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
/** File role, rather than folder location, keeps colocated preview code private. */
|
|
279
|
-
export function isBehaviorFile(file) {
|
|
280
|
-
return /(?:^|[\\/])behavior\.json$|\.behavior\.json$/.test(file);
|
|
418
|
+
return /\.ads\.scenario\.[cm]?[jt]sx?$/.test(file);
|
|
281
419
|
}
|
|
282
420
|
|
|
283
|
-
/** A visible development boundary, independent of whether its role is supported.
|
|
421
|
+
/** A visible development boundary, independent of whether its role is supported.
|
|
422
|
+
* File role, rather than folder location, keeps colocated development code private. */
|
|
284
423
|
export function adsFileRole(file) {
|
|
285
424
|
const match = path.basename(file).match(/\.ads\.(.+)\.[^.]+$/);
|
|
286
425
|
return match ? match[1] : null;
|
|
@@ -290,9 +429,12 @@ export function isContractFile(file) {
|
|
|
290
429
|
return /\.ads\.contract\.[cm]?ts$/.test(file);
|
|
291
430
|
}
|
|
292
431
|
|
|
293
|
-
/**
|
|
432
|
+
/** The ADS-relative path without `.ads.scenario.*`; a canonical `<Dir>/<Dir>.ads.scenario.*` identifies the directory. */
|
|
294
433
|
export function scenarioIdentity(file, dsRoot) {
|
|
295
|
-
let id = path
|
|
434
|
+
let id = path
|
|
435
|
+
.relative(dsRoot, file)
|
|
436
|
+
.replaceAll("\\", "/")
|
|
437
|
+
.replace(/\.ads\.scenario\.[^.]+$/, "");
|
|
296
438
|
if (adsFileRole(file) === "scenario" && path.posix.basename(id) === path.posix.basename(path.posix.dirname(id))) id = path.posix.dirname(id);
|
|
297
439
|
return id;
|
|
298
440
|
}
|
|
@@ -300,19 +442,16 @@ export function scenarioIdentity(file, dsRoot) {
|
|
|
300
442
|
export function isDevelopmentFile(file, { dsRoot }) {
|
|
301
443
|
if (isDraftFile(file)) return true;
|
|
302
444
|
if (!isInside(dsRoot, file)) return isTestFile(file) || adsFileRole(file) !== null;
|
|
303
|
-
|
|
304
|
-
return adsFileRole(file) !== null
|
|
305
|
-
|| /^(?:showcase|composition|review|brand)\//.test(relative)
|
|
306
|
-
|| /(?:^|\/)(?:scenario|fixtures)(?:\/|$)/.test(relative)
|
|
307
|
-
|| /\.scenario(?:-adapter)?\.[cm]?[jt]sx?$/.test(relative);
|
|
445
|
+
// An exports file belongs to its owner's layer: production for the public barrel, development under review/.
|
|
446
|
+
return (adsFileRole(file) !== null && (adsFileRole(file) !== "exports" || isInside(path.join(dsRoot, "review"), file))) || isTestFile(file);
|
|
308
447
|
}
|
|
309
448
|
|
|
310
449
|
/** Review implementations may own demo presentation; scenarios/fixtures may not. */
|
|
311
450
|
export function isReviewFile(file, { dsRoot }) {
|
|
312
|
-
return !isDraftFile(file) && isInside(
|
|
451
|
+
return !isDraftFile(file) && isInside(dsRoot, file) && adsFileRole(file) === "review" && !isTestFile(file);
|
|
313
452
|
}
|
|
314
453
|
|
|
315
|
-
const ignored = new Set(["node_modules", "dist", "dist-showcase", "
|
|
454
|
+
const ignored = new Set(["node_modules", "dist", "dist-showcase", ".git", ".vite", ".ds", "coverage"]);
|
|
316
455
|
|
|
317
456
|
export function sourceFiles(root) {
|
|
318
457
|
if (!existsSync(root)) return [];
|
|
@@ -320,23 +459,28 @@ export function sourceFiles(root) {
|
|
|
320
459
|
for (const entry of readdirSync(root, { withFileTypes: true })) {
|
|
321
460
|
if (ignored.has(entry.name) || entry.isSymbolicLink() || isDraftFile(path.join(root, entry.name))) continue;
|
|
322
461
|
const file = path.join(root, entry.name);
|
|
323
|
-
if (entry.isDirectory()) {
|
|
324
|
-
|
|
462
|
+
if (entry.isDirectory()) {
|
|
463
|
+
if (!hasProjectConfig(file)) files.push(...sourceFiles(file));
|
|
464
|
+
} else if (entry.isFile() && /\.(css|html|[cm]?[jt]sx?)$/.test(entry.name)) files.push(file);
|
|
325
465
|
}
|
|
326
466
|
return files.sort();
|
|
327
467
|
}
|
|
328
468
|
|
|
329
|
-
export function importViolation(specifier, filename, options, resolve) {
|
|
330
|
-
if (draftImportViolation(specifier, filename, resolve ?? ((id, file) => [path.resolve(path.dirname(file), id)]))) return true;
|
|
469
|
+
export async function importViolation(specifier, filename, options, resolve) {
|
|
470
|
+
if (await draftImportViolation(specifier, filename, resolve ?? ((id, file) => [path.resolve(path.dirname(file), id)]))) return true;
|
|
331
471
|
const { root, dsRoot, config } = options;
|
|
332
472
|
// ADS implementation code needs its private imports; the showcase is a consumer.
|
|
333
473
|
if (isInside(dsRoot, filename) && (!isDevelopmentFile(filename, options) || isContractFile(filename))) return false; // Contract symbol ownership is checked without executing imports.
|
|
334
474
|
if (specifier === `${config.publicAlias}/review`) return !isDevelopmentFile(filename, options) && !isTestFile(filename);
|
|
335
475
|
if (specifier.startsWith(`${config.publicAlias}/`)) return true;
|
|
336
476
|
if (specifier === config.publicAlias) return false;
|
|
337
|
-
const imported = resolve
|
|
338
|
-
|
|
339
|
-
: specifier.startsWith(
|
|
477
|
+
const imported = resolve
|
|
478
|
+
? await resolve(specifier, filename)
|
|
479
|
+
: specifier.startsWith(".")
|
|
480
|
+
? [path.resolve(path.dirname(filename), specifier)]
|
|
481
|
+
: specifier.startsWith(`${config.dsDir}/`)
|
|
482
|
+
? [path.resolve(root, specifier)]
|
|
483
|
+
: [];
|
|
340
484
|
return imported.some((file) => {
|
|
341
485
|
if (!isInside(dsRoot, file)) return false;
|
|
342
486
|
// Previews may show the ADS's own artwork and fonts: asset files are data, not implementation.
|
|
@@ -346,7 +490,8 @@ export function importViolation(specifier, filename, options, resolve) {
|
|
|
346
490
|
if (isReviewFile(filename, options)) return false;
|
|
347
491
|
// Owner-local white-box tests may exercise private helpers without making
|
|
348
492
|
// those helpers public API. Scenarios remain public-API consumers.
|
|
349
|
-
if (isTestFile(filename) && isInside(dsRoot, filename) && options.testOwner?.(filename) && options.testOwner(filename) === options.testOwner(file))
|
|
493
|
+
if (isTestFile(filename) && isInside(dsRoot, filename) && options.testOwner?.(filename) && options.testOwner(filename) === options.testOwner(file))
|
|
494
|
+
return false;
|
|
350
495
|
if (isDevelopmentFile(filename, options) && isDevelopmentFile(file, options)) return false;
|
|
351
496
|
if (isTestFile(filename) && (isInside(path.join(dsRoot, "showcase"), file) || isTestFile(file))) return false;
|
|
352
497
|
if (isInside(path.join(dsRoot, "showcase"), filename) && isInside(path.join(dsRoot, "showcase"), file)) return false;
|