@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/preview-bun.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import { eachChild, mapAsync } from "./analysis/queries.mjs";
|
|
1
2
|
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
-
import { mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
3
4
|
import path from "node:path";
|
|
4
5
|
import { spawn } from "node:child_process";
|
|
5
6
|
import { fileURLToPath } from "node:url";
|
|
6
|
-
import ts from "
|
|
7
|
+
import ts from "./analysis/syntax.mjs";
|
|
7
8
|
import postcss from "postcss";
|
|
8
9
|
import selectorParser from "postcss-selector-parser";
|
|
9
10
|
import valueParser from "postcss-value-parser";
|
|
@@ -11,33 +12,91 @@ import { transform, TransformCacheCollection, disposeEvalBroker } from "@wyw-in-
|
|
|
11
12
|
import { createPreviewResources } from "./preview-resources.mjs";
|
|
12
13
|
import { previewSourceRevision } from "./preview-inputs.mjs";
|
|
13
14
|
import { linariaTagResolver } from "./linaria.mjs";
|
|
14
|
-
import {createPreviewImportOptimizer} from "./preview-imports.mjs";
|
|
15
|
+
import { createPreviewImportOptimizer } from "./preview-imports.mjs";
|
|
15
16
|
import { assertBunRuntime } from "./runtime-requirements.mjs";
|
|
17
|
+
import { spatialMetadata } from "./spatial-metadata.mjs";
|
|
18
|
+
import spatialInputs from "./linaria/spatial-inputs.cjs";
|
|
19
|
+
import timing from "./stage-timing.cjs";
|
|
16
20
|
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
const previewFrameDirectory = existsSync(new URL("./showcase/preview-frame.ads.review.mjs", import.meta.url)) ? "./showcase/" : "../showcase-client/";
|
|
22
|
+
export const previewFrameFiles = [
|
|
23
|
+
...["mjs", "css", "d.mts"].map((extension) => `preview-frame.ads.review.${extension}`),
|
|
24
|
+
"foundation-view.mjs",
|
|
25
|
+
"foundation-view.css",
|
|
26
|
+
"ui/ui.js",
|
|
27
|
+
"ui/ui.css",
|
|
28
|
+
].map((file) => fileURLToPath(new URL(`${previewFrameDirectory}${file}`, import.meta.url)));
|
|
29
|
+
|
|
30
|
+
const hash = (value) => createHash("sha256").update(value).digest("hex");
|
|
31
|
+
const fileHash = (file) => {
|
|
32
|
+
try {
|
|
33
|
+
return hash(readFileSync(file));
|
|
34
|
+
} catch {
|
|
35
|
+
return null;
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
const slash = (file) => file.replaceAll("\\", "/");
|
|
39
|
+
const selectorClasses = (selector) => {
|
|
40
|
+
const names = [];
|
|
41
|
+
selectorParser((selectors) => selectors.walkClasses((node) => names.push(node.value))).processSync(selector);
|
|
42
|
+
return names;
|
|
43
|
+
};
|
|
44
|
+
const keyframeRule = (rule) => rule.parent.type === "atrule" && /(?:^|-)keyframes$/i.test(rule.parent.name);
|
|
45
|
+
/** Bun.build throws an AggregateError ("Bundle failed") on newer Bun; keep its per-file logs. */
|
|
46
|
+
async function bundle(config) {
|
|
47
|
+
try {
|
|
48
|
+
return await Bun.build(config);
|
|
49
|
+
} catch (error) {
|
|
50
|
+
if (Array.isArray(error?.errors) && error.errors.length) throw buildFailure(error.errors);
|
|
51
|
+
throw error;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
22
54
|
function buildFailure(logs) {
|
|
23
|
-
return new Error(
|
|
55
|
+
return new Error(
|
|
56
|
+
"ADS preview compilation failed:\n" +
|
|
57
|
+
logs.map((log) => `${log.position?.file ?? ""}${log.position?.line ? ":" + log.position.line : ""}: ${log.message ?? String(log)}`).join("\n"),
|
|
58
|
+
);
|
|
24
59
|
}
|
|
25
60
|
|
|
26
61
|
// Linaria's class merger is pure, but its published implementation does not
|
|
27
62
|
// annotate calls. Mark only direct module-level calls to that imported binding;
|
|
28
63
|
// a project function named cx (or a shadowed parameter) gets no exemption.
|
|
29
|
-
function pureClassComposition(code,file){
|
|
30
|
-
const tree=ts.createSourceFile(file,code,ts.ScriptTarget.Latest,true,ts.ScriptKind.TSX),
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
64
|
+
async function pureClassComposition(code, file) {
|
|
65
|
+
const tree = await ts.createSourceFile(file, code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX),
|
|
66
|
+
names = new Set(),
|
|
67
|
+
offsets = [];
|
|
68
|
+
for (const statement of tree.statements)
|
|
69
|
+
if (ts.isImportDeclaration(statement) && ["@linaria/core", "@linaria/atomic"].includes(statement.moduleSpecifier.text)) {
|
|
70
|
+
const bindings = statement.importClause?.namedBindings;
|
|
71
|
+
if (bindings && ts.isNamedImports(bindings))
|
|
72
|
+
for (const binding of bindings.elements) if ((binding.propertyName ?? binding.name).text === "cx") names.add(binding.name.text);
|
|
73
|
+
}
|
|
74
|
+
if (!names.size) return code;
|
|
75
|
+
for (const statement of tree.statements)
|
|
76
|
+
if (ts.isVariableStatement(statement))
|
|
77
|
+
for (const declaration of statement.declarationList.declarations) {
|
|
78
|
+
const call = declaration.initializer;
|
|
79
|
+
if (call && ts.isCallExpression(call) && ts.isIdentifier(call.expression) && names.has(call.expression.text)) offsets.push(call.getStart(tree));
|
|
80
|
+
}
|
|
81
|
+
for (const offset of offsets.sort((a, b) => b - a)) code = code.slice(0, offset) + "/* @__PURE__ */" + code.slice(offset);
|
|
82
|
+
return code;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Preview-only identity survives atom sharing: identical generated classes can
|
|
86
|
+
// belong to different owners. Production builds never receive these markers.
|
|
87
|
+
async function previewIdentities(code, file, options) {
|
|
88
|
+
const relative = slash(path.relative(options.dsRoot, file));
|
|
89
|
+
if (!/^(?:components|patterns|review)\//.test(relative)) return code;
|
|
90
|
+
const source = slash(path.relative(options.root, file));
|
|
91
|
+
const tree = await ts.createSourceFile(file, code, ts.ScriptTarget.Latest, true, ts.ScriptKind.TSX),
|
|
92
|
+
offsets = [];
|
|
93
|
+
function visit(node) {
|
|
94
|
+
if ((ts.isJsxOpeningElement(node) || ts.isJsxSelfClosingElement(node)) && ts.isIdentifier(node.tagName) && /^[a-z]/.test(node.tagName.text))
|
|
95
|
+
offsets.push(node.end - (ts.isJsxSelfClosingElement(node) ? 2 : 1));
|
|
96
|
+
ts.forEachChild(node, visit);
|
|
39
97
|
}
|
|
40
|
-
|
|
98
|
+
visit(tree);
|
|
99
|
+
for (const offset of offsets.sort((a, b) => b - a)) code = code.slice(0, offset) + ` data-ads-source=${JSON.stringify(source)} ` + code.slice(offset);
|
|
41
100
|
return code;
|
|
42
101
|
}
|
|
43
102
|
|
|
@@ -46,226 +105,473 @@ function pureClassComposition(code,file){
|
|
|
46
105
|
* Publication, source fencing and verification remain the shared scheduler's job. */
|
|
47
106
|
export function createBunPreviewBuilder() {
|
|
48
107
|
assertBunRuntime();
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
108
|
+
process.env.WYW_NODE_BINARY = process.execPath;
|
|
109
|
+
const cache = new TransformCacheCollection(),
|
|
110
|
+
transformed = new Map(),
|
|
111
|
+
workerResults = new Map();
|
|
112
|
+
let directory,
|
|
113
|
+
context,
|
|
114
|
+
previous,
|
|
115
|
+
closed = false,
|
|
116
|
+
workerQueue = Promise.resolve();
|
|
117
|
+
const builder = async (entries, options, track, { watched = false, workerEntry, workerAncestors = [], sourceRevision } = {}) => {
|
|
118
|
+
sourceRevision ??= await previewSourceRevision(options);
|
|
52
119
|
if (closed) throw new Error("Preview compiler is closed.");
|
|
53
120
|
const signature = JSON.stringify([options.root, options.config, watched]);
|
|
54
|
-
if (context !== signature) {
|
|
121
|
+
if (context !== signature) {
|
|
122
|
+
transformed.clear();
|
|
123
|
+
workerResults.clear();
|
|
124
|
+
disposeEvalBroker(cache);
|
|
125
|
+
cache.clear("all");
|
|
126
|
+
previous = undefined;
|
|
127
|
+
context = signature;
|
|
128
|
+
}
|
|
55
129
|
directory ??= path.join(options.root, ".ds/bun-entries", randomUUID());
|
|
56
|
-
mkdirSync(directory, {recursive:true});
|
|
57
|
-
const css = new Map(),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
67
|
-
const
|
|
130
|
+
mkdirSync(directory, { recursive: true });
|
|
131
|
+
const css = new Map(),
|
|
132
|
+
workers = new Map(),
|
|
133
|
+
workerAssets = new Map(),
|
|
134
|
+
inputs = new Set();
|
|
135
|
+
let spatialCapture;
|
|
136
|
+
const readSpatial = () => {
|
|
137
|
+
if (spatialCapture === undefined) spatialCapture = spatialInputs.captureSpatial(options);
|
|
138
|
+
return spatialCapture;
|
|
139
|
+
};
|
|
140
|
+
const foundation = path.resolve(options.dsRoot, options.config.stylesEntry);
|
|
141
|
+
const mounts = new Map(
|
|
142
|
+
entries.map((entry, index) => {
|
|
143
|
+
const file = path.join(directory, hash(entry.id) + ".tsx");
|
|
144
|
+
const code = entry.foundation
|
|
145
|
+
? `import {mountFoundation} from ${JSON.stringify(fileURLToPath(new URL(`${previewFrameDirectory}foundation-view.mjs`, import.meta.url)))};export const mount=container=>mountFoundation(container,${JSON.stringify(entry.foundation)});`
|
|
146
|
+
: `import {mountScenario} from ${JSON.stringify(path.join(options.dsRoot, "showcase/mcp/main.ads.mount.tsx"))};import Scenario from ${JSON.stringify(path.join(options.root, entry.file))};export const mount=container=>mountScenario(Scenario,container);`;
|
|
147
|
+
writeFileSync(file, code);
|
|
148
|
+
return [file, index];
|
|
149
|
+
}),
|
|
150
|
+
);
|
|
151
|
+
const previewUi = previewFrameFiles[0];
|
|
152
|
+
const alias = (specifier) =>
|
|
153
|
+
specifier === "@reqvire-org/ads/preview"
|
|
154
|
+
? previewUi
|
|
155
|
+
: specifier === options.config.publicAlias
|
|
156
|
+
? path.join(options.dsRoot, options.config.publicEntry)
|
|
157
|
+
: specifier === options.config.publicAlias + "/review"
|
|
158
|
+
? path.join(options.dsRoot, options.config.reviewEntry)
|
|
159
|
+
: specifier;
|
|
160
|
+
const resolve = (specifier, importer) => Bun.resolveSync(alias(specifier), path.dirname(importer));
|
|
161
|
+
const optimizeImports = await createPreviewImportOptimizer(options, resolve, inputs);
|
|
68
162
|
function metadata(result) {
|
|
69
|
-
for(const file of Object.keys(result.metafile.inputs)) if(path.isAbsolute(file)
|
|
163
|
+
for (const file of Object.keys(result.metafile.inputs)) if (path.isAbsolute(file) || !file.includes(":")) inputs.add(path.resolve(file));
|
|
70
164
|
}
|
|
71
165
|
async function worker(file, ancestors = new Set()) {
|
|
72
|
-
if(ancestors.has(file))throw new Error("Cyclic preview worker imports: "+file);
|
|
73
|
-
if(workers.has(file))return workers.get(file);
|
|
74
|
-
const pending=workerQueue.then(async()=>{
|
|
75
|
-
const saved=workerResults.get(file);
|
|
76
|
-
if(saved&&saved.watched===watched&&saved.dependencies.every(([input,digest])=>fileHash(input)===digest)){
|
|
77
|
-
for(const[input]of saved.dependencies)inputs.add(input);
|
|
78
|
-
for(const asset of saved.assets)workerAssets.set(asset.fileName,asset);
|
|
166
|
+
if (ancestors.has(file)) throw new Error("Cyclic preview worker imports: " + file);
|
|
167
|
+
if (workers.has(file)) return workers.get(file);
|
|
168
|
+
const pending = workerQueue.then(async () => {
|
|
169
|
+
const saved = workerResults.get(file);
|
|
170
|
+
if (saved && saved.watched === watched && saved.dependencies.every(([input, digest]) => fileHash(input) === digest)) {
|
|
171
|
+
for (const [input] of saved.dependencies) inputs.add(input);
|
|
172
|
+
for (const asset of saved.assets) workerAssets.set(asset.fileName, asset);
|
|
79
173
|
return saved.fileName;
|
|
80
174
|
}
|
|
81
|
-
const nested=new Set([...ancestors,file]);
|
|
82
|
-
const report=path.join(directory,randomUUID()+".json");
|
|
175
|
+
const nested = new Set([...ancestors, file]);
|
|
176
|
+
const report = path.join(directory, randomUUID() + ".json");
|
|
83
177
|
// Bun 1.3 serializes build contexts: a nested Bun.build awaited by an
|
|
84
178
|
// onLoad hook deadlocks. One short-lived worker compiler avoids that
|
|
85
179
|
// boundary and releases its heap before the next worker is compiled.
|
|
86
|
-
await new Promise((resolve,reject)=>{
|
|
87
|
-
const child=spawn(process.execPath,[fileURLToPath(new URL("./bun-worker.mjs",import.meta.url)),report],{stdio:["pipe","ignore","pipe"]});
|
|
88
|
-
let errors="";
|
|
89
|
-
child.
|
|
90
|
-
|
|
180
|
+
await new Promise((resolve, reject) => {
|
|
181
|
+
const child = spawn(process.execPath, [fileURLToPath(new URL("./bun-worker.mjs", import.meta.url)), report], { stdio: ["pipe", "ignore", "pipe"] });
|
|
182
|
+
let errors = "";
|
|
183
|
+
child.stderr.on("data", (bytes) => {
|
|
184
|
+
errors = (errors + bytes).slice(-8000);
|
|
185
|
+
});
|
|
186
|
+
child.stdin.on("error", () => {});
|
|
187
|
+
child.stdin.end(JSON.stringify({ file, options, watched, ancestors: [...nested] }));
|
|
188
|
+
child.once("error", reject);
|
|
189
|
+
child.once("close", (code) => (code === 0 ? resolve() : reject(new Error(`Preview worker compilation failed (${code}): ${errors}`))));
|
|
91
190
|
});
|
|
92
|
-
const result=JSON.parse(readFileSync(report,"utf8"));
|
|
93
|
-
|
|
94
|
-
const
|
|
95
|
-
|
|
191
|
+
const result = JSON.parse(readFileSync(report, "utf8"));
|
|
192
|
+
rmSync(report, { force: true });
|
|
193
|
+
for (const input of result.inputs) inputs.add(input);
|
|
194
|
+
const script = result.outputs.find((output) => output.kind === "entry-point");
|
|
195
|
+
if (!script) throw new Error("Preview worker emitted no script: " + file);
|
|
96
196
|
// Worker dependencies are self-contained; its resource is a classic
|
|
97
197
|
// script so it also runs inside the opaque-origin MCP App sandbox.
|
|
98
|
-
const source=Buffer.from(script.bytes,"base64"),
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
198
|
+
const source = Buffer.from(script.bytes, "base64"),
|
|
199
|
+
fileName = "ads-worker-" + hash(source) + ".js";
|
|
200
|
+
const childAssets = [
|
|
201
|
+
...result.assets.map((asset) => ({ ...asset, source: Buffer.from(asset.source, "base64") })),
|
|
202
|
+
...result.outputs
|
|
203
|
+
.filter((output) => output.kind !== "entry-point")
|
|
204
|
+
.map((output) => ({ type: "asset", fileName: slash(output.path).replace(/^\.\//, ""), source: Buffer.from(output.bytes, "base64") })),
|
|
205
|
+
];
|
|
206
|
+
for (const asset of childAssets) workerAssets.set(asset.fileName, asset);
|
|
207
|
+
const asset = { type: "asset", fileName, source };
|
|
208
|
+
workerAssets.set(fileName, asset);
|
|
209
|
+
workerResults.set(file, { watched, fileName, dependencies: result.inputs.map((input) => [input, fileHash(input)]), assets: [asset, ...childAssets] });
|
|
210
|
+
return fileName;
|
|
103
211
|
});
|
|
104
|
-
workerQueue=pending.catch(()=>{});
|
|
105
|
-
workers.set(file,pending);
|
|
212
|
+
workerQueue = pending.catch(() => {});
|
|
213
|
+
workers.set(file, pending);
|
|
214
|
+
return pending;
|
|
106
215
|
}
|
|
107
216
|
async function source(file, ancestors, defer) {
|
|
108
|
-
const original=readFileSync(file,"utf8");
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
if(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
217
|
+
const original = readFileSync(file, "utf8");
|
|
218
|
+
inputs.add(file);
|
|
219
|
+
let code = original;
|
|
220
|
+
if (!file.includes(`${path.sep}node_modules${path.sep}`) && /@linaria\//.test(original)) {
|
|
221
|
+
const previous = transformed.get(file);
|
|
222
|
+
let value = previous;
|
|
223
|
+
const spatialChanged = previous?.spatialRevision !== undefined && previous.spatialRevision !== (readSpatial()?.revision ?? null);
|
|
224
|
+
if (!value || value.source !== hash(original) || spatialChanged || value.dependencies.some(([dependency, digest]) => fileHash(dependency) !== digest)) {
|
|
225
|
+
// Membership changes (a new token sheet) are not in the previous file
|
|
226
|
+
// dependency list. Invalidate this extraction, even with identical TS.
|
|
227
|
+
if (spatialChanged) cache.invalidateForFile(file);
|
|
228
|
+
if (previous) for (const [dependency, digest, imported] of previous.dependencies) if (fileHash(dependency) !== digest) {
|
|
229
|
+
cache.invalidateForFile(dependency);
|
|
230
|
+
if (imported) cache.invalidateForFile(imported);
|
|
231
|
+
if (existsSync(dependency)) cache.invalidateIfChanged(dependency, readFileSync(dependency, "utf8"));
|
|
232
|
+
}
|
|
233
|
+
cache.invalidateIfChanged(file, original);
|
|
234
|
+
let usedSpatial = false;
|
|
235
|
+
const result = await timing.timeStage("linaria-transform", () => spatialInputs.withSpatialInputs(() => {
|
|
236
|
+
usedSpatial = true;
|
|
237
|
+
return readSpatial();
|
|
238
|
+
}, () => transform(
|
|
239
|
+
{ cache, asyncResolveKey: sourceRevision, options: { filename: file, root: options.root, pluginOptions: { configFile: false, tagResolver: linariaTagResolver } } },
|
|
240
|
+
original,
|
|
241
|
+
async (specifier, importer) => resolve(specifier, importer),
|
|
242
|
+
)));
|
|
243
|
+
const classes = new Set(
|
|
244
|
+
Object.values(result.rules ?? {})
|
|
245
|
+
.map((rule) => rule.className)
|
|
246
|
+
.filter(Boolean),
|
|
247
|
+
);
|
|
248
|
+
if (result.cssText)
|
|
249
|
+
postcss.parse(result.cssText).walkRules((rule) => {
|
|
250
|
+
if (!keyframeRule(rule)) for (const name of selectorClasses(rule.selector)) classes.add(name);
|
|
251
|
+
});
|
|
252
|
+
// A computed interpolation can introduce a layout without @ads- in
|
|
253
|
+
// this source. Record the processor's actual use, not a source regex.
|
|
254
|
+
const spatial = usedSpatial || previous?.spatialRevision !== undefined ? readSpatial() : undefined;
|
|
255
|
+
value = {
|
|
256
|
+
source: hash(original),
|
|
257
|
+
code: await pureClassComposition(result.code, file),
|
|
258
|
+
css: result.cssText,
|
|
259
|
+
classes: [...classes],
|
|
260
|
+
...(spatial !== undefined ? { spatialRevision: spatial?.revision ?? null } : {}),
|
|
261
|
+
// The shared spatial revision already checks every sheet once per
|
|
262
|
+
// build. Keep watcher membership without rehashing them per owner.
|
|
263
|
+
spatialInputs: spatial?.inputs ?? [],
|
|
264
|
+
dependencies: [...new Set([file, ...(result.dependencies ?? [])])].map((dependency) => {
|
|
265
|
+
const imported = path.isAbsolute(dependency) ? dependency : path.resolve(path.dirname(file), dependency);
|
|
266
|
+
const absolute = existsSync(imported) ? imported : resolve(dependency, file);
|
|
267
|
+
return [absolute, fileHash(absolute), imported];
|
|
268
|
+
}),
|
|
269
|
+
};
|
|
270
|
+
transformed.set(file, value);
|
|
123
271
|
}
|
|
124
|
-
code=value.code;
|
|
272
|
+
code = value.code;
|
|
273
|
+
for (const [dependency] of value.dependencies) inputs.add(dependency);
|
|
274
|
+
for (const dependency of value.spatialInputs) inputs.add(dependency);
|
|
125
275
|
// A side-effect CSS import here defeats JS tree shaking through public
|
|
126
276
|
// barrels. Attach this owner's styles only after Bun retains its code.
|
|
127
|
-
if(value.css)css.set(file,value.css);
|
|
277
|
+
if (value.css) css.set(file, value.css);
|
|
128
278
|
}
|
|
129
|
-
code=optimizeImports(code,file);
|
|
279
|
+
code = await optimizeImports(code, file);
|
|
130
280
|
// Bun does not interpret Vite's worker query or new Worker(new URL()).
|
|
131
281
|
// Compile these through Bun too, then register the resulting immutable
|
|
132
282
|
// script with the same MCP resource graph as all other emitted assets.
|
|
133
|
-
if(/\bnew\s+(?:Worker|SharedWorker|URL)\s*\(/.test(code)){
|
|
283
|
+
if (/\bnew\s+(?:Worker|SharedWorker|URL)\s*\(/.test(code)) {
|
|
134
284
|
await defer();
|
|
135
|
-
const tree=ts.createSourceFile(file,code,ts.ScriptTarget.Latest,true,file.endsWith("tsx")?ts.ScriptKind.TSX:ts.ScriptKind.TS),
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
285
|
+
const tree = await ts.createSourceFile(file, code, ts.ScriptTarget.Latest, true, file.endsWith("tsx") ? ts.ScriptKind.TSX : ts.ScriptKind.TS),
|
|
286
|
+
edits = [],
|
|
287
|
+
assetImports = [],
|
|
288
|
+
assetNames = new Map();
|
|
289
|
+
const jobs = [];
|
|
290
|
+
async function visit(node) {
|
|
291
|
+
if (ts.isNewExpression(node) && ts.isIdentifier(node.expression) && ["Worker", "SharedWorker"].includes(node.expression.text)) {
|
|
292
|
+
const url = node.arguments?.[0];
|
|
293
|
+
if (
|
|
294
|
+
url &&
|
|
295
|
+
ts.isNewExpression(url) &&
|
|
296
|
+
ts.isIdentifier(url.expression) &&
|
|
297
|
+
url.expression.text === "URL" &&
|
|
298
|
+
url.arguments?.[0] &&
|
|
299
|
+
ts.isStringLiteralLike(url.arguments[0])
|
|
300
|
+
) {
|
|
301
|
+
const target = resolve(url.arguments[0].text, file);
|
|
302
|
+
jobs.push(worker(target, ancestors).then((name) => edits.push([url.getStart(tree), url.end, JSON.stringify("./" + name)])));
|
|
143
303
|
}
|
|
144
304
|
}
|
|
145
|
-
if(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
305
|
+
if (
|
|
306
|
+
ts.isNewExpression(node) &&
|
|
307
|
+
ts.isIdentifier(node.expression) &&
|
|
308
|
+
node.expression.text === "URL" &&
|
|
309
|
+
node.arguments?.length === 2 &&
|
|
310
|
+
ts.isStringLiteralLike(node.arguments[0])
|
|
311
|
+
) {
|
|
312
|
+
const base = node.arguments[1],
|
|
313
|
+
parent = node.parent;
|
|
314
|
+
const workerURL =
|
|
315
|
+
ts.isNewExpression(parent) &&
|
|
316
|
+
ts.isIdentifier(parent.expression) &&
|
|
317
|
+
["Worker", "SharedWorker"].includes(parent.expression.text) &&
|
|
318
|
+
parent.arguments?.[0] === node;
|
|
319
|
+
if (
|
|
320
|
+
!workerURL &&
|
|
321
|
+
ts.isPropertyAccessExpression(base) &&
|
|
322
|
+
ts.isMetaProperty(base.expression) &&
|
|
323
|
+
base.name.text === "url" &&
|
|
324
|
+
!/^(?:[a-z]+:|#|\?)/i.test(node.arguments[0].text)
|
|
325
|
+
) {
|
|
326
|
+
const target = resolve(node.arguments[0].text, file);
|
|
327
|
+
let name = assetNames.get(target);
|
|
328
|
+
if (!name) {
|
|
329
|
+
name = "__ads_asset_" + hash(target).slice(0, 16);
|
|
330
|
+
while (code.includes(name)) name += "_";
|
|
331
|
+
assetNames.set(target, name);
|
|
332
|
+
}
|
|
333
|
+
assetImports.push(`import ${name} from ${JSON.stringify(target + "?ads-asset")};`);
|
|
334
|
+
if (workerEntry) edits.push([node.getStart(tree), node.end, `new URL(${name})`]);
|
|
335
|
+
else edits.push([node.arguments[0].getStart(tree), node.arguments[0].end, name]);
|
|
154
336
|
}
|
|
155
337
|
}
|
|
156
|
-
|
|
338
|
+
await eachChild(node, visit);
|
|
157
339
|
}
|
|
158
|
-
visit(tree);
|
|
159
|
-
|
|
160
|
-
code=
|
|
340
|
+
await visit(tree);
|
|
341
|
+
await Promise.all(jobs);
|
|
342
|
+
for (const [start, end, replacement] of edits.sort((a, b) => b[0] - a[0])) code = code.slice(0, start) + replacement + code.slice(end);
|
|
343
|
+
code = [...new Set(assetImports), code].join("\n");
|
|
161
344
|
}
|
|
162
|
-
return code;
|
|
345
|
+
return previewIdentities(code, file, options);
|
|
163
346
|
}
|
|
164
347
|
function plugin(ancestors = new Set()) {
|
|
165
|
-
return{
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
348
|
+
return {
|
|
349
|
+
name: "ads-bun-preview",
|
|
350
|
+
setup(build) {
|
|
351
|
+
build.onResolve({ filter: /./ }, (args) => {
|
|
352
|
+
if (/[?&]worker(?:[&=]|$)/.test(args.path)) {
|
|
353
|
+
const specifier = args.path.split("?")[0];
|
|
354
|
+
return { path: resolve(specifier, args.importer), namespace: args.path.includes("url") ? "ads-worker-url" : "ads-worker" };
|
|
355
|
+
}
|
|
356
|
+
// Bun shares one module per path across namespaces: a raw import keeps its own path, so
|
|
357
|
+
// the same file can be both a URL (a brand preview) and text (a component's geometry).
|
|
358
|
+
if (/[?&](?:url|raw|ads-asset)(?:[&=]|$)/.test(args.path)) {
|
|
359
|
+
const raw = /[?&]raw(?:[&=]|$)/.test(args.path),
|
|
360
|
+
file = resolve(args.path.split("?")[0], args.importer);
|
|
361
|
+
return { path: raw ? `${file}?raw` : file, namespace: raw ? "ads-raw" : "ads-file" };
|
|
362
|
+
}
|
|
363
|
+
const mapped = alias(args.path);
|
|
364
|
+
if (mapped !== args.path) return { path: resolve(mapped, args.importer) };
|
|
365
|
+
if (args.path.endsWith(".css") && resolve(args.path, args.importer || foundation) === foundation)
|
|
366
|
+
return { path: foundation, namespace: "ads-foundation" };
|
|
367
|
+
});
|
|
368
|
+
build.onLoad({ filter: /./, namespace: "ads-foundation" }, () => ({ contents: "export {};", loader: "js" }));
|
|
369
|
+
build.onLoad({ filter: /./, namespace: "ads-file" }, (args) => {
|
|
370
|
+
inputs.add(args.path);
|
|
371
|
+
return { contents: readFileSync(args.path), loader: "file" };
|
|
372
|
+
});
|
|
373
|
+
build.onLoad({ filter: /./, namespace: "ads-raw" }, (args) => {
|
|
374
|
+
const file = args.path.replace(/\?raw$/, "");
|
|
375
|
+
inputs.add(file);
|
|
376
|
+
return { contents: readFileSync(file, "utf8"), loader: "text" };
|
|
377
|
+
});
|
|
378
|
+
for (const namespace of ["ads-worker", "ads-worker-url"])
|
|
379
|
+
build.onLoad({ filter: /./, namespace }, async (args) => {
|
|
380
|
+
await args.defer();
|
|
381
|
+
const name = await worker(args.path, ancestors),
|
|
382
|
+
url = JSON.stringify("./" + name);
|
|
383
|
+
return {
|
|
384
|
+
loader: "js",
|
|
385
|
+
contents:
|
|
386
|
+
namespace === "ads-worker-url"
|
|
387
|
+
? `export default ${url};`
|
|
388
|
+
: `export default function WorkerFactory(options){return new Worker(${url},{...options,type:"classic"});}`,
|
|
389
|
+
};
|
|
390
|
+
});
|
|
391
|
+
build.onLoad({ filter: /\.[cm]?[jt]sx?$/ }, async (args) => ({
|
|
392
|
+
contents: await source(args.path, ancestors, args.defer),
|
|
393
|
+
loader: args.path.endsWith("tsx") ? "tsx" : args.path.endsWith("jsx") ? "jsx" : /\.([cm]?ts)$/.test(args.path) ? "ts" : "js",
|
|
394
|
+
}));
|
|
395
|
+
},
|
|
396
|
+
};
|
|
184
397
|
}
|
|
185
398
|
// The MCP resource loader owns dependency fetching and lazy imports. Bun's
|
|
186
399
|
// HTTP modulepreload table adds self-references that cannot become blob URLs.
|
|
187
|
-
const result=await
|
|
188
|
-
|
|
400
|
+
const result = await bundle({
|
|
401
|
+
entrypoints: workerEntry ? [workerEntry] : [...mounts.keys()],
|
|
402
|
+
root: workerEntry ? path.dirname(workerEntry) : directory,
|
|
403
|
+
target: "browser",
|
|
404
|
+
format: workerEntry ? "iife" : "esm",
|
|
405
|
+
jsx: { runtime: "automatic", importSource: options.config.framework },
|
|
406
|
+
splitting: !workerEntry,
|
|
407
|
+
modulePreload: false,
|
|
408
|
+
metafile: true,
|
|
409
|
+
minify: !watched,
|
|
410
|
+
plugins: [plugin(new Set(workerAncestors))],
|
|
411
|
+
define: { "process.env.NODE_ENV": JSON.stringify(watched ? "development" : "production") },
|
|
412
|
+
});
|
|
413
|
+
if (!result.success) throw buildFailure(result.logs);
|
|
189
414
|
metadata(result);
|
|
190
|
-
if(workerEntry)
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
415
|
+
if (workerEntry)
|
|
416
|
+
return {
|
|
417
|
+
inputs: [...inputs],
|
|
418
|
+
outputs: await Promise.all(
|
|
419
|
+
await mapAsync(result.outputs, async (artifact) => ({
|
|
420
|
+
kind: artifact.kind,
|
|
421
|
+
path: artifact.path,
|
|
422
|
+
bytes: Buffer.from(await artifact.arrayBuffer()).toString("base64"),
|
|
423
|
+
})),
|
|
424
|
+
),
|
|
425
|
+
assets: [...workerAssets.values()].map((asset) => ({ ...asset, source: Buffer.from(asset.source).toString("base64") })),
|
|
426
|
+
};
|
|
427
|
+
const output = [],
|
|
428
|
+
styleFiles = new Map(),
|
|
429
|
+
retainedCss = new Set(),
|
|
430
|
+
chunkStyles = new Map(),
|
|
431
|
+
retainedClasses = new Map();
|
|
432
|
+
const emitted = new Map(await Promise.all(await mapAsync(result.outputs, async (artifact) => [artifact.path, Buffer.from(await artifact.arrayBuffer())])));
|
|
433
|
+
for (const [file, meta] of Object.entries(result.metafile.outputs))
|
|
434
|
+
if (file.endsWith(".js")) {
|
|
435
|
+
const code = emitted.get(file).toString(),
|
|
436
|
+
owners = [];
|
|
437
|
+
for (const [input, info] of Object.entries(meta.inputs)) {
|
|
438
|
+
const owner = path.resolve(input),
|
|
439
|
+
classes = transformed.get(owner)?.classes ?? [];
|
|
440
|
+
// A discarded React component can leave only its JSX-runtime import in
|
|
441
|
+
// this chunk. That import has bytesInOutput, but needs no owner CSS.
|
|
442
|
+
const present = classes.filter((name) => code.includes(name));
|
|
443
|
+
if (info.bytesInOutput > 0 && css.has(owner) && (!classes.length || present.length)) {
|
|
444
|
+
retainedCss.add(owner);
|
|
445
|
+
owners.push(owner);
|
|
446
|
+
const names = retainedClasses.get(owner) ?? new Set();
|
|
447
|
+
for (const name of present) names.add(name);
|
|
448
|
+
retainedClasses.set(owner, names);
|
|
449
|
+
}
|
|
203
450
|
}
|
|
451
|
+
chunkStyles.set(file, owners);
|
|
204
452
|
}
|
|
205
|
-
chunkStyles.set(file,owners);
|
|
206
|
-
}
|
|
207
453
|
// This is a CSS-only build, not a second JS compilation. Keeping each owner
|
|
208
454
|
// as an entry preserves immutable style URIs across views and JS rechunking.
|
|
209
455
|
// Foundation comes first in every module's style list, including shared
|
|
210
456
|
// chunks, so @layer declarations precede any extracted component rules.
|
|
211
|
-
const cssEntries=[foundation
|
|
212
|
-
function cssSource(contents,file,names){
|
|
213
|
-
const root=postcss.parse(contents);
|
|
214
|
-
if(names)
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
if(
|
|
224
|
-
const
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
457
|
+
const cssEntries = [foundation, ...[...retainedCss].map((file) => file + ".ads-bun.css")];
|
|
458
|
+
function cssSource(contents, file, names) {
|
|
459
|
+
const root = postcss.parse(contents);
|
|
460
|
+
if (names)
|
|
461
|
+
root.walkRules((rule) => {
|
|
462
|
+
if (keyframeRule(rule)) return;
|
|
463
|
+
const classes = selectorClasses(rule.selector);
|
|
464
|
+
if (classes.length && !classes.some((name) => names.has(name))) rule.remove();
|
|
465
|
+
});
|
|
466
|
+
root.walkDecls((decl) => {
|
|
467
|
+
const parsed = valueParser(decl.value);
|
|
468
|
+
parsed.walk((node) => {
|
|
469
|
+
if (node.type !== "function" || node.value !== "url" || node.nodes.some((child) => child.type === "function")) return;
|
|
470
|
+
const specifier = valueParser.stringify(node.nodes).replace(/^["']|["']$/g, "");
|
|
471
|
+
if (!specifier || /^(?:[a-z]+:|#|\/\/)/i.test(specifier)) return;
|
|
472
|
+
const [target, fragment] = specifier.split("#"),
|
|
473
|
+
asset = resolve(decodeURI(target.split("?")[0]), file),
|
|
474
|
+
bytes = readFileSync(asset);
|
|
475
|
+
inputs.add(asset);
|
|
476
|
+
const fileName = "ads-file-" + hash(bytes) + path.extname(asset);
|
|
477
|
+
workerAssets.set(fileName, { type: "asset", fileName, source: bytes });
|
|
478
|
+
node.nodes = [{ type: "string", quote: '"', value: "/" + fileName + (fragment ? "#" + fragment : "") }];
|
|
479
|
+
});
|
|
480
|
+
decl.value = parsed.toString();
|
|
228
481
|
});
|
|
229
482
|
return root.toString();
|
|
230
483
|
}
|
|
231
|
-
const cssResult=await
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
484
|
+
const cssResult = await bundle({
|
|
485
|
+
entrypoints: cssEntries,
|
|
486
|
+
root: options.root,
|
|
487
|
+
target: "browser",
|
|
488
|
+
metafile: true,
|
|
489
|
+
minify: !watched,
|
|
490
|
+
plugins: [
|
|
491
|
+
{
|
|
492
|
+
name: "ads-extracted-css",
|
|
493
|
+
setup(build) {
|
|
494
|
+
build.onResolve({ filter: /./ }, (args) => {
|
|
495
|
+
if (args.path.endsWith(".ads-bun.css")) return { path: args.path, namespace: "ads-css" };
|
|
496
|
+
if (args.path.startsWith("/ads-file-")) return { path: args.path, external: true };
|
|
497
|
+
if (args.namespace === "ads-css") return { path: resolve(args.path, args.importer) };
|
|
498
|
+
});
|
|
499
|
+
build.onLoad({ filter: /./, namespace: "ads-css" }, (args) => {
|
|
500
|
+
const file = args.path.slice(0, -".ads-bun.css".length);
|
|
501
|
+
return { contents: cssSource(css.get(file), args.path, retainedClasses.get(file)), loader: "css", resolveDir: path.dirname(args.path) };
|
|
502
|
+
});
|
|
503
|
+
build.onLoad({ filter: /\.css$/ }, (args) => {
|
|
504
|
+
inputs.add(args.path);
|
|
505
|
+
return { contents: cssSource(readFileSync(args.path, "utf8"), args.path), loader: "css" };
|
|
506
|
+
});
|
|
507
|
+
},
|
|
508
|
+
},
|
|
509
|
+
],
|
|
510
|
+
});
|
|
511
|
+
if (!cssResult.success) throw buildFailure(cssResult.logs);
|
|
241
512
|
metadata(cssResult);
|
|
242
|
-
for(const artifact of cssResult.outputs){
|
|
243
|
-
const meta=cssResult.metafile.outputs[artifact.path],
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
513
|
+
for (const artifact of cssResult.outputs) {
|
|
514
|
+
const meta = cssResult.metafile.outputs[artifact.path],
|
|
515
|
+
bytes = Buffer.from(await artifact.arrayBuffer());
|
|
516
|
+
const fileName = "ads-style-" + hash(bytes) + path.extname(artifact.path);
|
|
517
|
+
const source = meta?.entryPoint && path.resolve(meta.entryPoint.replace(/^ads-css:/, ""));
|
|
518
|
+
const owner = source?.endsWith(".ads-bun.css") ? source.slice(0, -".ads-bun.css".length) : null;
|
|
519
|
+
output.push({
|
|
520
|
+
type: "asset",
|
|
521
|
+
fileName,
|
|
522
|
+
source: bytes,
|
|
523
|
+
...(owner ? { spatial: spatialMetadata(bytes.toString(), slash(path.relative(options.root, owner))) } : {}),
|
|
524
|
+
});
|
|
525
|
+
if (meta?.entryPoint) styleFiles.set(path.resolve(meta.entryPoint.replace(/^ads-css:/, "")), fileName);
|
|
247
526
|
}
|
|
248
|
-
for(const artifact of result.outputs){
|
|
249
|
-
const fileName=slash(artifact.path).replace(/^\.\//,""),
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
527
|
+
for (const artifact of result.outputs) {
|
|
528
|
+
const fileName = slash(artifact.path).replace(/^\.\//, ""),
|
|
529
|
+
meta = result.metafile.outputs[artifact.path] ?? result.metafile.outputs["./" + fileName];
|
|
530
|
+
const bytes = emitted.get(artifact.path);
|
|
531
|
+
if (["entry-point", "chunk"].includes(artifact.kind) && fileName.endsWith(".js")) {
|
|
532
|
+
const entry = meta?.entryPoint && mounts.get(path.resolve(meta.entryPoint));
|
|
533
|
+
const styles = [
|
|
534
|
+
styleFiles.get(foundation),
|
|
535
|
+
...(chunkStyles.get(artifact.path) ?? []).map((input) => styleFiles.get(input + ".ads-bun.css")),
|
|
536
|
+
...(meta?.cssBundle ? [meta.cssBundle.replace(/^\.\//, "")] : []),
|
|
537
|
+
].filter(Boolean);
|
|
538
|
+
output.push({
|
|
539
|
+
type: "chunk",
|
|
540
|
+
fileName,
|
|
541
|
+
code: bytes.toString(),
|
|
542
|
+
...(entry !== undefined ? { facadeModuleId: "\0ads-preview-entry:" + entry } : {}),
|
|
543
|
+
imports: (meta?.imports ?? []).filter((item) => item.kind !== "dynamic-import").map((item) => item.path.replace(/^\.\//, "")),
|
|
544
|
+
dynamicImports: (meta?.imports ?? []).filter((item) => item.kind === "dynamic-import").map((item) => item.path.replace(/^\.\//, "")),
|
|
545
|
+
viteMetadata: { importedCss: new Set(styles) },
|
|
546
|
+
});
|
|
547
|
+
} else output.push({ type: "asset", fileName, source: bytes });
|
|
256
548
|
}
|
|
257
549
|
output.push(...workerAssets.values());
|
|
258
550
|
// Generated entry modules disappear when this compiler closes. Recording
|
|
259
551
|
// them as source inputs makes every otherwise valid restart a cache miss.
|
|
260
|
-
track.generateBundle.call({getModuleIds:()=>[...inputs].filter(file=>file!==directory
|
|
552
|
+
track.generateBundle.call({ getModuleIds: () => [...inputs].filter((file) => file !== directory && !file.startsWith(directory + path.sep)) });
|
|
261
553
|
// Inactive/removed source files must not accumulate transform histories.
|
|
262
|
-
for(const file of transformed.keys())if(!inputs.has(file))transformed.delete(file);
|
|
263
|
-
for(const file of workerResults.keys())if(!inputs.has(file))workerResults.delete(file);
|
|
264
|
-
const publication=createPreviewResources({output},options,entries,{
|
|
265
|
-
|
|
554
|
+
for (const file of transformed.keys()) if (!inputs.has(file)) transformed.delete(file);
|
|
555
|
+
for (const file of workerResults.keys()) if (!inputs.has(file)) workerResults.delete(file);
|
|
556
|
+
const publication = await createPreviewResources({ output }, options, entries, {
|
|
557
|
+
retain: previous?.sourceRevision === sourceRevision ? previous.snapshot : undefined,
|
|
558
|
+
prune: true,
|
|
559
|
+
});
|
|
560
|
+
previous = { sourceRevision, snapshot: publication.snapshot() };
|
|
266
561
|
return publication;
|
|
267
562
|
};
|
|
268
|
-
builder.warmBatch=true;
|
|
269
|
-
builder.close=async()=>
|
|
270
|
-
|
|
563
|
+
builder.warmBatch = true;
|
|
564
|
+
builder.close = async () => {
|
|
565
|
+
closed = true;
|
|
566
|
+
previous = undefined;
|
|
567
|
+
transformed.clear();
|
|
568
|
+
workerResults.clear();
|
|
569
|
+
cache.clear("all");
|
|
570
|
+
await disposeEvalBroker(cache);
|
|
571
|
+
if (directory) rmSync(directory, { recursive: true, force: true });
|
|
572
|
+
};
|
|
573
|
+
const measured = (...args) => timing.timeStage("preview-build", () => builder(...args));
|
|
574
|
+
measured.warmBatch = builder.warmBatch;
|
|
575
|
+
measured.close = builder.close;
|
|
576
|
+
return measured;
|
|
271
577
|
}
|