@1agh/maude 0.28.0 → 0.29.0
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 +2 -2
- package/{plugins/design/dev-server → apps/studio}/ai-banner.tsx +1 -1
- package/{plugins/design/dev-server → apps/studio}/annotations-context-toolbar.tsx +286 -6
- package/{plugins/design/dev-server → apps/studio}/annotations-layer.tsx +1209 -122
- package/{plugins/design/dev-server → apps/studio}/api.ts +486 -32
- package/{plugins/design/dev-server → apps/studio}/artboard-activity-overlay.tsx +1 -1
- package/{plugins/design/dev-server → apps/studio}/artboard-marquee.tsx +1 -1
- package/apps/studio/bin/_motion-sample-playwright.mjs +129 -0
- package/{plugins/design/dev-server → apps/studio}/bin/canvas-edit.sh +1 -1
- package/{plugins/design/dev-server → apps/studio}/bin/draw-proof.sh +37 -2
- package/{plugins/design/dev-server → apps/studio}/bin/preflight.sh +1 -1
- package/apps/studio/bin/read-annotations.mjs +438 -0
- package/apps/studio/bin/read-annotations.sh +11 -0
- package/{plugins/design/dev-server → apps/studio}/bin/runtime-health.sh +1 -1
- package/{plugins/design/dev-server → apps/studio}/bin/scenario-report.mjs +1 -1
- package/{plugins/design/dev-server → apps/studio}/bin/screenshot.sh +62 -2
- package/apps/studio/bin/server-up.sh +234 -0
- package/apps/studio/bin/to-lottie-verify.html +68 -0
- package/apps/studio/bin/to-lottie.sh +128 -0
- package/{plugins/design/dev-server → apps/studio}/bin/visual-sanity.sh +19 -3
- package/{plugins/design/dev-server → apps/studio}/build.ts +5 -3
- package/{plugins/design/dev-server → apps/studio}/canvas-arrowheads.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/canvas-comment-mount.tsx +2 -2
- package/apps/studio/canvas-create.ts +104 -0
- package/{plugins/design/dev-server → apps/studio}/canvas-cursors.ts +47 -13
- package/{plugins/design/dev-server → apps/studio}/canvas-icons.tsx +60 -1
- package/{plugins/design/dev-server → apps/studio}/canvas-lib-inline.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/canvas-lib-resolver.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/canvas-lib.tsx +41 -33
- package/{plugins/design/dev-server → apps/studio}/canvas-shell.tsx +57 -42
- package/{plugins/design/dev-server → apps/studio}/client/app.jsx +1713 -530
- package/apps/studio/client/canvas-url.js +81 -0
- package/{plugins/design/dev-server → apps/studio}/client/comments-overlay.css +41 -27
- package/{plugins/design/dev-server → apps/studio}/client/index.html +2 -1
- package/apps/studio/client/styles/1-tokens-maude.css +296 -0
- package/apps/studio/client/styles/3-shell-maude.css +459 -0
- package/{plugins/design/dev-server → apps/studio}/client/styles/3-shell.css +129 -0
- package/apps/studio/client/styles/4-components-maude.css +74 -0
- package/{plugins/design/dev-server → apps/studio}/client/styles/4-components.css +357 -34
- package/apps/studio/client/styles/5-maude-overrides.css +123 -0
- package/{plugins/design/dev-server → apps/studio}/client/styles/_index.css +9 -0
- package/{plugins/design/dev-server → apps/studio}/client/styles.css +1 -1
- package/apps/studio/client/tour/overlay.jsx +191 -0
- package/apps/studio/client/tour/usage-tour.js +35 -0
- package/apps/studio/client/whats-new-seen.js +52 -0
- package/apps/studio/client/whats-new.jsx +250 -0
- package/{plugins/design/dev-server → apps/studio}/collab/index.ts +4 -4
- package/{plugins/design/dev-server → apps/studio}/collab/persistence.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/commands/annotation-strokes-command.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/commands/equal-spacing-command.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/commands/move-artboards-command.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/comments-overlay.tsx +25 -6
- package/{plugins/design/dev-server → apps/studio}/context-menu.tsx +2 -2
- package/{plugins/design/dev-server → apps/studio}/contextual-toolbar.tsx +4 -7
- package/{plugins/design/dev-server → apps/studio}/cursors-overlay.tsx +1 -1
- package/apps/studio/dist/client.bundle.js +22825 -0
- package/apps/studio/dist/comment-mount.js +1960 -0
- package/apps/studio/dist/runtime/lib0_decoding.js +1 -0
- package/apps/studio/dist/runtime/lib0_encoding.js +1 -0
- package/apps/studio/dist/runtime/motion.js +4 -0
- package/apps/studio/dist/runtime/motion_react.js +12 -0
- package/apps/studio/dist/runtime/pixi-js.js +3397 -0
- package/apps/studio/dist/runtime/react-dom.js +1 -0
- package/apps/studio/dist/runtime/react-dom_client.js +9 -0
- package/apps/studio/dist/runtime/react.js +1 -0
- package/apps/studio/dist/runtime/react_jsx-dev-runtime.js +1 -0
- package/apps/studio/dist/runtime/react_jsx-runtime.js +1 -0
- package/apps/studio/dist/runtime/y-protocols_awareness.js +1 -0
- package/apps/studio/dist/runtime/y-protocols_sync.js +1 -0
- package/apps/studio/dist/runtime/yjs.js +5 -0
- package/apps/studio/dist/styles.css +5695 -0
- package/{plugins/design/dev-server → apps/studio}/dom-selection.ts +75 -4
- package/apps/studio/draw/animate.ts +333 -0
- package/{plugins/design/dev-server → apps/studio}/draw/brush.ts +4 -4
- package/{plugins/design/dev-server → apps/studio}/draw/composition.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/draw/geometry.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/draw/index.ts +9 -6
- package/{plugins/design/dev-server → apps/studio}/draw/layout.ts +2 -2
- package/apps/studio/draw/morph.ts +204 -0
- package/{plugins/design/dev-server → apps/studio}/draw/optimize.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/draw/palette.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/draw/primitives.ts +1 -1
- package/apps/studio/draw/serialize-animate.ts +324 -0
- package/{plugins/design/dev-server → apps/studio}/draw/serialize.ts +9 -3
- package/apps/studio/draw/test/animate.test.ts +172 -0
- package/{plugins/design/dev-server → apps/studio}/draw/test/layout.test.ts +1 -1
- package/apps/studio/draw/test/morph.test.ts +107 -0
- package/apps/studio/draw/test/serialize-animate.test.ts +142 -0
- package/{plugins/design/dev-server → apps/studio}/draw/test/serialize.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/equal-spacing-detector.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/equal-spacing-handles.tsx +7 -29
- package/{plugins/design/dev-server → apps/studio}/examples/perf-100-artboards.tsx +1 -2
- package/{plugins/design/dev-server → apps/studio}/export-dialog.tsx +14 -2
- package/{plugins/design/dev-server → apps/studio}/exporters/index.ts +2 -2
- package/{plugins/design/dev-server → apps/studio}/http.ts +103 -2
- package/{plugins/design/dev-server → apps/studio}/input-router.tsx +8 -1
- package/{plugins/design/dev-server → apps/studio}/inspect.ts +20 -3
- package/{plugins/design/dev-server → apps/studio}/marquee-overlay.tsx +6 -3
- package/{plugins/design/dev-server → apps/studio}/participants-chrome.tsx +1 -1
- package/{plugins/design/dev-server → apps/studio}/paths.ts +15 -11
- package/{plugins/design/dev-server → apps/studio}/server.ts +19 -1
- package/{plugins/design/dev-server → apps/studio}/sync/index.ts +6 -6
- package/{plugins/design/dev-server → apps/studio}/sync/materialize.ts +2 -2
- package/{plugins/design/dev-server → apps/studio}/test/ai-activity.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/annotations-api.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/annotations-layer.test.ts +69 -6
- package/{plugins/design/dev-server → apps/studio}/test/annotations-roundtrip.test.ts +98 -1
- package/apps/studio/test/annotations-text-format.test.ts +396 -0
- package/apps/studio/test/asset-api.test.ts +149 -0
- package/{plugins/design/dev-server → apps/studio}/test/boot-self-heal.test.ts +1 -1
- package/apps/studio/test/canvas-create-api.test.ts +361 -0
- package/{plugins/design/dev-server → apps/studio}/test/canvas-cursors.test.ts +3 -1
- package/{plugins/design/dev-server → apps/studio}/test/canvas-edit.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/canvas-hmr-runtime.test.tsx +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/canvas-lib-inline.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/canvas-lib-resolver.test.ts +2 -3
- package/apps/studio/test/canvas-media-drop.test.ts +158 -0
- package/{plugins/design/dev-server → apps/studio}/test/canvas-meta-api.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/canvas-origin-gate.test.ts +18 -3
- package/apps/studio/test/canvas-url.test.ts +99 -0
- package/{plugins/design/dev-server → apps/studio}/test/collab-annotations-bridge.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/collab-bridge.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/collab-room.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/collab-stress.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/comments-api.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/compile-entry.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/exporters/canva.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/exporters/history.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/exporters/pw-launch.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/exporters/scope.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/exporters/zip.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/git-lifecycle.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/handoff-static-frames.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/hmr-broadcast.test.ts +1 -1
- package/apps/studio/test/index-data-canvas-ds.test.ts +97 -0
- package/apps/studio/test/motion-sample.test.ts +35 -0
- package/{plugins/design/dev-server → apps/studio}/test/perf-harness.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/phase-3.6-smoke.test.ts +3 -1
- package/apps/studio/test/read-annotations.test.ts +409 -0
- package/{plugins/design/dev-server → apps/studio}/test/runtime-bundle.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/sanitize-annotation-svg.test.ts +108 -2
- package/{plugins/design/dev-server → apps/studio}/test/shared-doc-convergence.test.ts +2 -2
- package/{plugins/design/dev-server → apps/studio}/test/shared-doc-migrate.test.ts +2 -3
- package/{plugins/design/dev-server → apps/studio}/test/shared-doc-projection.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/snap-distance-pill.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/sync-agent.test.ts +2 -3
- package/{plugins/design/dev-server → apps/studio}/test/sync-atomic-write.test.ts +2 -3
- package/{plugins/design/dev-server → apps/studio}/test/sync-connection-state.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/sync-echo-guard.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/sync-fs-mirror.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/sync-hardening.test.ts +4 -5
- package/{plugins/design/dev-server → apps/studio}/test/sync-hubs-config.test.ts +1 -2
- package/{plugins/design/dev-server → apps/studio}/test/sync-runtime.test.ts +3 -8
- package/{plugins/design/dev-server → apps/studio}/test/sync-status.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/sync-untrusted.test.ts +1 -2
- package/apps/studio/test/tour-overlay.test.tsx +56 -0
- package/{plugins/design/dev-server → apps/studio}/test/use-agent-presence.test.tsx +4 -1
- package/{plugins/design/dev-server → apps/studio}/test/use-annotation-resize.test.ts +43 -0
- package/{plugins/design/dev-server → apps/studio}/test/use-snap-guides.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/use-tool-mode.test.tsx +4 -1
- package/apps/studio/test/whats-new.test.ts +101 -0
- package/apps/studio/text-imports.d.ts +9 -0
- package/{plugins/design/dev-server → apps/studio}/tool-palette.tsx +4 -69
- package/{plugins/design/dev-server → apps/studio}/undo-hud.tsx +1 -1
- package/{plugins/design/dev-server → apps/studio}/undo-stack.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/use-agent-presence.tsx +2 -2
- package/{plugins/design/dev-server → apps/studio}/use-annotation-resize.tsx +41 -12
- package/{plugins/design/dev-server → apps/studio}/use-annotation-selection.tsx +3 -7
- package/{plugins/design/dev-server → apps/studio}/use-annotations-visibility.tsx +2 -2
- package/{plugins/design/dev-server → apps/studio}/use-artboard-drag.tsx +2 -2
- package/{plugins/design/dev-server → apps/studio}/use-canvas-activity.tsx +2 -2
- package/apps/studio/use-canvas-media-drop.tsx +343 -0
- package/{plugins/design/dev-server → apps/studio}/use-collab.tsx +4 -5
- package/{plugins/design/dev-server → apps/studio}/use-cursor-modifiers.tsx +1 -1
- package/{plugins/design/dev-server → apps/studio}/use-keyboard-discipline.tsx +5 -2
- package/{plugins/design/dev-server → apps/studio}/use-selection-set.tsx +10 -2
- package/{plugins/design/dev-server → apps/studio}/use-snap-guides.tsx +1 -1
- package/{plugins/design/dev-server → apps/studio}/use-tool-mode.tsx +4 -2
- package/{plugins/design/dev-server → apps/studio}/use-undo-stack.tsx +5 -6
- package/apps/studio/whats-new.json +139 -0
- package/apps/studio/whats-new.schema.json +70 -0
- package/apps/studio/whats-new.ts +87 -0
- package/cli/bin/maude.mjs +10 -0
- package/cli/commands/design.mjs +84 -10
- package/cli/commands/design.test.mjs +133 -1
- package/cli/commands/help.mjs +8 -2
- package/cli/commands/hub.mjs +3 -3
- package/cli/commands/hub.test.mjs +1 -1
- package/cli/commands/scenario-report.mjs +2 -9
- package/cli/lib/cache.mjs +1 -1
- package/cli/lib/config-lint.mjs +1 -1
- package/cli/lib/copy-tree.mjs +1 -1
- package/cli/lib/design-link.mjs +1 -1
- package/cli/lib/flow-design-integration.test.mjs +2 -2
- package/cli/lib/gitignore-block.mjs +1 -0
- package/cli/lib/gitignore-block.test.mjs +2 -2
- package/cli/lib/plugin-cli-reachability.test.mjs +8 -7
- package/cli/lib/preflight.mjs +1 -1
- package/cli/lib/stack-detect.mjs +1 -1
- package/package.json +16 -16
- package/plugins/design/templates/_shell.html +3 -3
- package/plugins/design/templates/brief-board.tsx.template +61 -0
- package/plugins/design/templates/canvas.tsx.template +1 -1
- package/plugins/design/templates/design-system-inspiration/SUB-AGENT-PROMPTS.md +18 -3
- package/plugins/design/templates/design-system-inspiration/core/config.json.tpl +1 -1
- package/plugins/design/templates/design-system-inspiration/core/preview/_motion-readme.md.tpl +1 -1
- package/plugins/flow/.claude-plugin/config.schema.json +16 -0
- package/plugins/design/dev-server/bin/server-up.sh +0 -135
- package/plugins/design/dev-server/dist/client.bundle.js +0 -20692
- package/plugins/design/dev-server/dist/comment-mount.js +0 -1924
- package/plugins/design/dev-server/dist/runtime/lib0_decoding.js +0 -620
- package/plugins/design/dev-server/dist/runtime/lib0_encoding.js +0 -604
- package/plugins/design/dev-server/dist/runtime/motion.js +0 -4944
- package/plugins/design/dev-server/dist/runtime/motion_react.js +0 -10056
- package/plugins/design/dev-server/dist/runtime/pixi-js.js +0 -53104
- package/plugins/design/dev-server/dist/runtime/react-dom.js +0 -231
- package/plugins/design/dev-server/dist/runtime/react-dom_client.js +0 -10357
- package/plugins/design/dev-server/dist/runtime/react.js +0 -535
- package/plugins/design/dev-server/dist/runtime/react_jsx-dev-runtime.js +0 -60
- package/plugins/design/dev-server/dist/runtime/react_jsx-runtime.js +0 -85
- package/plugins/design/dev-server/dist/runtime/y-protocols_awareness.js +0 -376
- package/plugins/design/dev-server/dist/runtime/y-protocols_sync.js +0 -100
- package/plugins/design/dev-server/dist/runtime/yjs.js +0 -6687
- package/plugins/design/dev-server/dist/styles.css +0 -2710
- package/{plugins/design/dev-server → apps/studio}/activity.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/_enumerate-artboards-playwright.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/_html-playwright.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/_pdf-playwright.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/_png-playwright.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/_pptx-playwright.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/_pw-launch.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/_screenshot-playwright.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/_svg-optimize.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/_svg-playwright.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/asset-sweep.sh +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/bootstrap-check.sh +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/check-runtime-bundles.sh +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/draw-build.sh +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/handoff.sh +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/prep.sh +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/slug.sh +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/smoke.sh +0 -0
- package/{plugins/design/dev-server → apps/studio}/bin/svg-optimize.sh +0 -0
- package/{plugins/design/dev-server → apps/studio}/boot-self-heal.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/canvas-build.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/canvas-edit.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/canvas-header.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/canvas-meta.schema.json +0 -0
- package/{plugins/design/dev-server → apps/studio}/canvas-pipeline.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/client/hmr.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/client/iframe-lazy.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/client/styles/0-reset.css +0 -0
- package/{plugins/design/dev-server → apps/studio}/client/styles/1-tokens.css +0 -0
- package/{plugins/design/dev-server → apps/studio}/client/styles/2-layout.css +0 -0
- package/{plugins/design/dev-server → apps/studio}/client/styles/5-utilities.css +0 -0
- package/{plugins/design/dev-server → apps/studio}/collab/ai-activity.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/collab/awareness-bridge.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/collab/git-lifecycle.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/collab/protocol.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/collab/registry.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/collab/room.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/config.schema.json +0 -0
- package/{plugins/design/dev-server → apps/studio}/context.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/dist/runtime/.min-sizes.json +0 -0
- package/{plugins/design/dev-server → apps/studio}/draw/test/brush.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/draw/test/composition.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/draw/test/geometry.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/draw/test/gradient.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/draw/test/optimize.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/draw/test/palette.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/draw/test/primitives.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/examples/README.md +0 -0
- package/{plugins/design/dev-server → apps/studio}/exporters/_browser-bundles.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/exporters/canva-handoff-prompt.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/exporters/canva.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/exporters/html.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/exporters/pdf.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/exporters/png.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/exporters/pptx.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/exporters/scope.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/exporters/svg.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/exporters/zip.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/fs-watch.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/handoff.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/history.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/hmr-broadcast.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/locator.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/mem.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/runtime-bundle.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/server.mjs +0 -0
- package/{plugins/design/dev-server → apps/studio}/sync/agent.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/sync/atomic-write.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/sync/codec.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/sync/connection-state.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/sync/echo-guard.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/sync/fs-mirror.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/sync/hubs-config.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/sync/migrate-seed.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/sync/origins.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/sync/projection.ts +3 -3
- package/{plugins/design/dev-server → apps/studio}/sync/status.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/sync/untrusted.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/_helpers.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/active-state.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/activity.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/annotation-strokes-command.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/annotations-draw-modifiers.test.ts +2 -2
- package/{plugins/design/dev-server → apps/studio}/test/artboard-activity-overlay.test.tsx +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/binary-smoke.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/bundle-smoke.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/canvas-build.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/canvas-header.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/canvas-lib-motion.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/canvas-pipeline.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/canvas-route.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/collab-awareness-bridge.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/collab-loopback.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/collab-protocol.test.ts +2 -2
- package/{plugins/design/dev-server → apps/studio}/test/collab-reseed-guard.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/comment-mount.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/context-resolve-tokens.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/csp-canvas-shell.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/equal-spacing-detector.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/exporters/endpoint.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/exporters/html.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/exporters/pdf.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/exporters/png.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/exporters/pptx-deck.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/exporters/pptx.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/exporters/svg.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/fixtures/phase-20-annotations.svg +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/fixtures/phase-21-annotations.svg +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/fs-watch.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/handoff.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/history-rollback.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/hmr-classify.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/input-router.test.ts +2 -2
- package/{plugins/design/dev-server → apps/studio}/test/locator.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/marquee-overlay.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/move-artboards-command.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/participants-chrome.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/paths.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/runtime-bundle-error-mapping.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/server-lifecycle.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/shared-doc-foundation.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/sync-codec.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/sync-meta-codec.test.ts +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/system-endpoint.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/tool-palette.test.tsx +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/undo-stack.test.ts +2 -2
- package/{plugins/design/dev-server → apps/studio}/test/use-annotation-selection.test.tsx +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/use-artboard-drag.test.ts +3 -3
- package/{plugins/design/dev-server → apps/studio}/test/use-canvas-activity.test.tsx +2 -2
- package/{plugins/design/dev-server → apps/studio}/test/use-collab.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/use-cursor-modifiers.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/use-keyboard-discipline.test.ts +0 -0
- package/{plugins/design/dev-server → apps/studio}/test/use-selection-set.test.tsx +1 -1
- package/{plugins/design/dev-server → apps/studio}/test/use-undo-stack.test.tsx +2 -2
- /package/{plugins/design/dev-server → apps/studio}/test/ws-handshake.test.ts +0 -0
- /package/{plugins/design/dev-server → apps/studio}/tsconfig.json +0 -0
- /package/{plugins/design/dev-server → apps/studio}/ws.ts +0 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// DDR-093 — canvasUrl() token-resolution. Regression guard for the
|
|
2
|
+
// "non-default-DS UI canvas renders unstyled" bug: every `ui/*.tsx` authored
|
|
3
|
+
// under a non-default design system used to load designSystems[0]'s tokens
|
|
4
|
+
// (scoped to a different `.<rootClass>` subtree) so every `var(--*)` went
|
|
5
|
+
// undefined and the canvas rendered white.
|
|
6
|
+
|
|
7
|
+
import { describe, expect, test } from 'bun:test';
|
|
8
|
+
|
|
9
|
+
import { canvasUrl, urlOf } from '../client/canvas-url.js';
|
|
10
|
+
|
|
11
|
+
// Mirrors this repo's real multi-DS config: `project` is the default (ds0),
|
|
12
|
+
// `maude` is the non-default one that the bug broke.
|
|
13
|
+
const cfg = {
|
|
14
|
+
designRel: '.design',
|
|
15
|
+
designSystems: [
|
|
16
|
+
{ name: 'project', path: 'system/project', tokensCssRel: 'system/project/colors_and_type.css' },
|
|
17
|
+
{ name: 'maude', path: 'system/maude', tokensCssRel: 'system/maude/colors_and_type.css' },
|
|
18
|
+
],
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
function paramsOf(url: string): URLSearchParams {
|
|
22
|
+
const qs = url.split('?')[1] ?? '';
|
|
23
|
+
return new URLSearchParams(qs);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
describe('canvasUrl — per-canvas design-system token resolution', () => {
|
|
27
|
+
test('explicit opts.ds resolves a non-default DS canvas to its OWN tokens', () => {
|
|
28
|
+
const p = paramsOf(canvasUrl('.design/ui/Studio.tsx', cfg, { ds: 'maude' }));
|
|
29
|
+
expect(p.get('tokens')).toBe('system/maude/colors_and_type.css');
|
|
30
|
+
expect(p.get('components')).toBe('system/maude/preview/_components.css');
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
test('RCA interface form — relative path + opts.ds', () => {
|
|
34
|
+
const p = paramsOf(canvasUrl('ui/Studio.tsx', cfg, { ds: 'maude' }));
|
|
35
|
+
expect(p.get('tokens')).toBe('system/maude/colors_and_type.css');
|
|
36
|
+
expect(p.get('components')).toBe('system/maude/preview/_components.css');
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
test('opts.ds = the default DS resolves to ds0 tokens', () => {
|
|
40
|
+
const p = paramsOf(canvasUrl('.design/ui/Studio.tsx', cfg, { ds: 'project' }));
|
|
41
|
+
expect(p.get('tokens')).toBe('system/project/colors_and_type.css');
|
|
42
|
+
expect(p.get('components')).toBe('system/project/preview/_components.css');
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
test('cfg.canvasDesignSystems map drives resolution when opts.ds is absent', () => {
|
|
46
|
+
const withMap = { ...cfg, canvasDesignSystems: { '.design/ui/Studio.tsx': 'maude' } };
|
|
47
|
+
const p = paramsOf(canvasUrl('.design/ui/Studio.tsx', withMap));
|
|
48
|
+
expect(p.get('tokens')).toBe('system/maude/colors_and_type.css');
|
|
49
|
+
expect(p.get('components')).toBe('system/maude/preview/_components.css');
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
test('opts.ds wins over the map', () => {
|
|
53
|
+
const withMap = { ...cfg, canvasDesignSystems: { '.design/ui/Studio.tsx': 'maude' } };
|
|
54
|
+
const p = paramsOf(canvasUrl('.design/ui/Studio.tsx', withMap, { ds: 'project' }));
|
|
55
|
+
expect(p.get('tokens')).toBe('system/project/colors_and_type.css');
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test('unknown / no DS falls back to ds0 (single-DS + legacy behavior intact)', () => {
|
|
59
|
+
const p = paramsOf(canvasUrl('.design/ui/Plain.tsx', cfg, {}));
|
|
60
|
+
expect(p.get('tokens')).toBe('system/project/colors_and_type.css');
|
|
61
|
+
expect(p.get('components')).toBe('system/project/preview/_components.css');
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
test('an unknown DS name (not in designSystems) falls back to ds0, never undefined', () => {
|
|
65
|
+
const p = paramsOf(canvasUrl('.design/ui/Ghost.tsx', cfg, { ds: 'does-not-exist' }));
|
|
66
|
+
expect(p.get('tokens')).toBe('system/project/colors_and_type.css');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('specimen paths stay path-resolved and are unaffected by the map', () => {
|
|
70
|
+
const withWrongMap = {
|
|
71
|
+
...cfg,
|
|
72
|
+
// A bogus map entry must NOT override the specimen branch.
|
|
73
|
+
canvasDesignSystems: { '.design/system/maude/preview/Buttons.tsx': 'project' },
|
|
74
|
+
};
|
|
75
|
+
const p = paramsOf(canvasUrl('.design/system/maude/preview/Buttons.tsx', withWrongMap));
|
|
76
|
+
expect(p.get('tokens')).toBe('system/maude/colors_and_type.css');
|
|
77
|
+
expect(p.get('layout')).toBe('system/maude/preview/_layout.css');
|
|
78
|
+
expect(p.get('components')).toBe('system/maude/preview/_components.css');
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
test('the bug it guards against: ds0 is the WRONG DS for a maude canvas', () => {
|
|
82
|
+
// Documents the failure mode — with neither opts.ds nor a map entry the
|
|
83
|
+
// resolver returns designSystems[0] (project), which is exactly what broke a
|
|
84
|
+
// maude canvas before DDR-093. The fix is that the map now supplies 'maude'.
|
|
85
|
+
const p = paramsOf(canvasUrl('.design/ui/Studio.tsx', cfg));
|
|
86
|
+
expect(p.get('tokens')).toBe('system/project/colors_and_type.css'); // ds0 — wrong for maude
|
|
87
|
+
const fixed = paramsOf(
|
|
88
|
+
canvasUrl('.design/ui/Studio.tsx', {
|
|
89
|
+
...cfg,
|
|
90
|
+
canvasDesignSystems: { '.design/ui/Studio.tsx': 'maude' },
|
|
91
|
+
})
|
|
92
|
+
);
|
|
93
|
+
expect(fixed.get('tokens')).toBe('system/maude/colors_and_type.css'); // fixed
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test('non-tsx paths bypass the shell and return a direct URL', () => {
|
|
97
|
+
expect(canvasUrl('.design/ui/legacy.html', cfg)).toBe(urlOf('.design/ui/legacy.html'));
|
|
98
|
+
});
|
|
99
|
+
});
|
|
@@ -45,7 +45,7 @@ describe('Registry.syncRoomFromAnnotations', () => {
|
|
|
45
45
|
test('inspector-write origin propagates through doc.update', () => {
|
|
46
46
|
const r = createRegistry(noopCallbacks());
|
|
47
47
|
const room = r.get('echo-slug');
|
|
48
|
-
let lastOrigin: unknown
|
|
48
|
+
let lastOrigin: unknown;
|
|
49
49
|
room.doc.on('update', (_update, origin) => {
|
|
50
50
|
lastOrigin = origin;
|
|
51
51
|
});
|
|
@@ -71,7 +71,7 @@ describe('Registry inspector-bridge', () => {
|
|
|
71
71
|
test('inspector-write origin triggers doc.update broadcast', async () => {
|
|
72
72
|
const r = createRegistry(noopCallbacks());
|
|
73
73
|
const room = r.get('echo-slug');
|
|
74
|
-
let lastOrigin: unknown
|
|
74
|
+
let lastOrigin: unknown;
|
|
75
75
|
room.doc.on('update', (_update, origin) => {
|
|
76
76
|
lastOrigin = origin;
|
|
77
77
|
});
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
encodeSyncUpdate,
|
|
13
13
|
handleMessage,
|
|
14
14
|
} from '../collab/protocol.ts';
|
|
15
|
-
import { type RoomCallbacks, type RoomConn
|
|
15
|
+
import { createRoom, type RoomCallbacks, type RoomConn } from '../collab/room.ts';
|
|
16
16
|
|
|
17
17
|
function makeConn(id: string): RoomConn & { recv: Uint8Array[] } {
|
|
18
18
|
const recv: Uint8Array[] = [];
|
|
@@ -19,7 +19,7 @@ import { afterEach, describe, expect, test } from 'bun:test';
|
|
|
19
19
|
import { Awareness } from 'y-protocols/awareness';
|
|
20
20
|
import * as Y from 'yjs';
|
|
21
21
|
|
|
22
|
-
import { type RoomConn
|
|
22
|
+
import { createRoom, type RoomConn } from '../collab/room.ts';
|
|
23
23
|
|
|
24
24
|
const STRESS_MS = Number(process.env.MAUDE_STRESS_MS ?? 10_000);
|
|
25
25
|
const RSS_GROWTH_LIMIT_MB = 20;
|
|
@@ -11,11 +11,10 @@
|
|
|
11
11
|
// git sandbox; gracefully empty if git fails)
|
|
12
12
|
// - Reply on unknown id → 404
|
|
13
13
|
|
|
14
|
+
import { describe, expect, test } from 'bun:test';
|
|
14
15
|
import { mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
15
16
|
import { join } from 'node:path';
|
|
16
17
|
|
|
17
|
-
import { describe, expect, test } from 'bun:test';
|
|
18
|
-
|
|
19
18
|
import { bootServer, killProc, makeSandbox, nextPort } from './_helpers.ts';
|
|
20
19
|
|
|
21
20
|
async function initGit(root: string) {
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
// no spawn): given a target, it writes two files (`init-oxc-<slug>.ts` +
|
|
5
5
|
// `server-<slug>.ts`) under dist/.compile-entries/ and returns the entry path.
|
|
6
6
|
|
|
7
|
+
import { describe, expect, test } from 'bun:test';
|
|
7
8
|
import { existsSync, readFileSync, rmSync } from 'node:fs';
|
|
8
9
|
import { dirname, join } from 'node:path';
|
|
9
10
|
import { fileURLToPath } from 'node:url';
|
|
10
11
|
|
|
11
|
-
import { describe, expect, test } from 'bun:test';
|
|
12
|
-
|
|
13
12
|
import { writeCompileEntry } from '../build.ts';
|
|
14
13
|
|
|
15
14
|
const ROOT = dirname(fileURLToPath(import.meta.url));
|
|
@@ -4,9 +4,8 @@
|
|
|
4
4
|
// + the empty/file-tree branches.
|
|
5
5
|
|
|
6
6
|
import { describe, expect, test } from 'bun:test';
|
|
7
|
-
|
|
8
|
-
import { buildHandoffMarkdown } from '../../exporters/canva-handoff-prompt.ts';
|
|
9
7
|
import { run } from '../../exporters/canva.ts';
|
|
8
|
+
import { buildHandoffMarkdown } from '../../exporters/canva-handoff-prompt.ts';
|
|
10
9
|
|
|
11
10
|
const CTX = {
|
|
12
11
|
designRoot: '/tmp/.design',
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// Phase 6.5 T10 — export history persistence + endpoint.
|
|
2
2
|
|
|
3
|
+
import { describe, expect, test } from 'bun:test';
|
|
3
4
|
import { readFileSync } from 'node:fs';
|
|
4
5
|
import { join } from 'node:path';
|
|
5
6
|
|
|
6
|
-
import { describe, expect, test } from 'bun:test';
|
|
7
|
-
|
|
8
7
|
import { bootServer, killProc, makeSandbox, nextPort } from '../_helpers.ts';
|
|
9
8
|
|
|
10
9
|
interface HistoryShape {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
import { describe, expect, test } from 'bun:test';
|
|
9
9
|
|
|
10
|
-
import { INSTALL_HINT,
|
|
10
|
+
import { INSTALL_HINT, isMissingBrowserError, NO_BROWSER_EXIT } from '../../bin/_pw-launch.mjs';
|
|
11
11
|
|
|
12
12
|
describe('_pw-launch — missing-browser classifier', () => {
|
|
13
13
|
test('matches the real Playwright "Executable doesn\'t exist" message', () => {
|
|
@@ -4,12 +4,11 @@
|
|
|
4
4
|
// `_active.json` shapes. `project-raw` exercises the fs walk inside a
|
|
5
5
|
// throwaway temp dir; the other three branches don't touch disk.
|
|
6
6
|
|
|
7
|
+
import { describe, expect, test } from 'bun:test';
|
|
7
8
|
import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';
|
|
8
9
|
import { tmpdir } from 'node:os';
|
|
9
10
|
import { join } from 'node:path';
|
|
10
11
|
|
|
11
|
-
import { describe, expect, test } from 'bun:test';
|
|
12
|
-
|
|
13
12
|
import { type ActiveJsonShape, resolveScope } from '../../exporters/scope.ts';
|
|
14
13
|
|
|
15
14
|
function emptyActive(): ActiveJsonShape {
|
|
@@ -3,11 +3,10 @@
|
|
|
3
3
|
// Real walk + bundle against a sandboxed designRoot, then unzip the result
|
|
4
4
|
// and diff against expected contents.
|
|
5
5
|
|
|
6
|
+
import { describe, expect, test } from 'bun:test';
|
|
6
7
|
import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';
|
|
7
8
|
import { tmpdir } from 'node:os';
|
|
8
9
|
import { join } from 'node:path';
|
|
9
|
-
|
|
10
|
-
import { describe, expect, test } from 'bun:test';
|
|
11
10
|
import JSZip from 'jszip';
|
|
12
11
|
|
|
13
12
|
import { resolveScope } from '../../exporters/scope.ts';
|
|
@@ -8,12 +8,11 @@
|
|
|
8
8
|
// already exposes flushAll(). The integration with .git/HEAD writes is
|
|
9
9
|
// exercised manually in the Task 7 acceptance test (Phase 8 plan validate row).
|
|
10
10
|
|
|
11
|
+
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
11
12
|
import { existsSync, mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs';
|
|
12
13
|
import { tmpdir } from 'node:os';
|
|
13
14
|
import path from 'node:path';
|
|
14
15
|
|
|
15
|
-
import { afterEach, beforeEach, describe, expect, test } from 'bun:test';
|
|
16
|
-
|
|
17
16
|
import { createGitLifecycle } from '../collab/git-lifecycle.ts';
|
|
18
17
|
import { createRegistry } from '../collab/registry.ts';
|
|
19
18
|
import type { RoomCallbacks } from '../collab/room.ts';
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
import { describe, expect, test } from 'bun:test';
|
|
6
6
|
|
|
7
7
|
import { buildLibMap, inlineUsedExports } from '../canvas-lib-inline.ts';
|
|
8
|
-
import {
|
|
8
|
+
import { applyHandoffStaticOverrides, HANDOFF_STATIC_FRAME_EXPORTS } from '../handoff.ts';
|
|
9
9
|
|
|
10
10
|
const LIB_PATH = '/virtual/_lib/canvas-lib.tsx';
|
|
11
11
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { describe, expect, test } from 'bun:test';
|
|
4
4
|
|
|
5
5
|
import { type Context, createBus } from '../context.ts';
|
|
6
|
-
import { HMR_DEBOUNCE_MS, type HmrMessage
|
|
6
|
+
import { createHmrBroadcaster, HMR_DEBOUNCE_MS, type HmrMessage } from '../hmr-broadcast.ts';
|
|
7
7
|
|
|
8
8
|
function mkCtx(): Context {
|
|
9
9
|
const bus = createBus();
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
// DDR-093 — `/_index-data` attaches a per-canvas design-system map so the
|
|
2
|
+
// client's canvasUrl() can inject each UI canvas's OWN tokens instead of always
|
|
3
|
+
// designSystems[0]. This is the server half of the
|
|
4
|
+
// "non-default-DS canvas renders unstyled" fix.
|
|
5
|
+
|
|
6
|
+
import { describe, expect, test } from 'bun:test';
|
|
7
|
+
import { mkdirSync, mkdtempSync, writeFileSync } from 'node:fs';
|
|
8
|
+
import { tmpdir } from 'node:os';
|
|
9
|
+
import { join } from 'node:path';
|
|
10
|
+
|
|
11
|
+
import { bootServer, killProc, nextPort } from './_helpers.ts';
|
|
12
|
+
|
|
13
|
+
// A two-DS sandbox: `project` is the default (ds0, rootClass mdcc), `maude` is
|
|
14
|
+
// the non-default one (rootClass maude) the bug broke.
|
|
15
|
+
function makeMultiDsSandbox(): { root: string; designRoot: string } {
|
|
16
|
+
const root = mkdtempSync(join(tmpdir(), 'mdcc-multids-'));
|
|
17
|
+
const designRoot = join(root, '.design');
|
|
18
|
+
mkdirSync(designRoot, { recursive: true });
|
|
19
|
+
writeFileSync(
|
|
20
|
+
join(designRoot, 'config.json'),
|
|
21
|
+
JSON.stringify(
|
|
22
|
+
{
|
|
23
|
+
name: 'multi-ds-test',
|
|
24
|
+
designRoot: '.design',
|
|
25
|
+
canvasGroups: [
|
|
26
|
+
{ label: 'Design system', path: 'system' },
|
|
27
|
+
{ label: 'UI kit', path: 'ui' },
|
|
28
|
+
],
|
|
29
|
+
designSystems: [
|
|
30
|
+
{ name: 'project', path: 'system/project', rootClass: 'mdcc' },
|
|
31
|
+
{ name: 'maude', path: 'system/maude', rootClass: 'maude' },
|
|
32
|
+
],
|
|
33
|
+
defaultDesignSystem: 'project',
|
|
34
|
+
},
|
|
35
|
+
null,
|
|
36
|
+
2
|
|
37
|
+
)
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
const tsx = 'export default function C(){return <main/>}\n';
|
|
41
|
+
|
|
42
|
+
// UI canvas authored under the NON-default DS — declares it in its sidecar.
|
|
43
|
+
mkdirSync(join(designRoot, 'ui'), { recursive: true });
|
|
44
|
+
writeFileSync(join(designRoot, 'ui', 'Studio.tsx'), tsx);
|
|
45
|
+
writeFileSync(
|
|
46
|
+
join(designRoot, 'ui', 'Studio.meta.json'),
|
|
47
|
+
JSON.stringify({ designSystem: 'maude' })
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
// UI canvas with a sidecar that omits designSystem → resolves to the default.
|
|
51
|
+
writeFileSync(join(designRoot, 'ui', 'Plain.tsx'), tsx);
|
|
52
|
+
writeFileSync(join(designRoot, 'ui', 'Plain.meta.json'), JSON.stringify({ title: 'Plain' }));
|
|
53
|
+
|
|
54
|
+
// UI canvas with NO sidecar at all → also defaults.
|
|
55
|
+
writeFileSync(join(designRoot, 'ui', 'Bare.tsx'), tsx);
|
|
56
|
+
|
|
57
|
+
// Specimens — DS resolved path-authoritatively (no sidecar needed).
|
|
58
|
+
mkdirSync(join(designRoot, 'system', 'maude', 'preview'), { recursive: true });
|
|
59
|
+
writeFileSync(join(designRoot, 'system', 'maude', 'preview', 'Buttons.tsx'), tsx);
|
|
60
|
+
mkdirSync(join(designRoot, 'system', 'project', 'preview'), { recursive: true });
|
|
61
|
+
writeFileSync(join(designRoot, 'system', 'project', 'preview', 'Cards.tsx'), tsx);
|
|
62
|
+
|
|
63
|
+
return { root, designRoot };
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
interface IndexData {
|
|
67
|
+
canvasDesignSystems?: Record<string, string>;
|
|
68
|
+
groups?: { paths?: string[] }[];
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
describe('/_index-data — per-canvas design-system map', () => {
|
|
72
|
+
test('attaches the right DS for UI canvases (sidecar) and specimens (path)', async () => {
|
|
73
|
+
const { root } = makeMultiDsSandbox();
|
|
74
|
+
const port = nextPort();
|
|
75
|
+
const proc = await bootServer(root, port);
|
|
76
|
+
try {
|
|
77
|
+
const r = await fetch(`http://localhost:${port}/_index-data`);
|
|
78
|
+
expect(r.status).toBe(200);
|
|
79
|
+
const data = (await r.json()) as IndexData;
|
|
80
|
+
const map = data.canvasDesignSystems ?? {};
|
|
81
|
+
|
|
82
|
+
// The bug: this used to be implicitly designSystems[0] ('project'). The
|
|
83
|
+
// sidecar declares 'maude', so the server must surface 'maude'.
|
|
84
|
+
expect(map['.design/ui/Studio.tsx']).toBe('maude');
|
|
85
|
+
|
|
86
|
+
// Sidecar without designSystem, and no sidecar at all → project default.
|
|
87
|
+
expect(map['.design/ui/Plain.tsx']).toBe('project');
|
|
88
|
+
expect(map['.design/ui/Bare.tsx']).toBe('project');
|
|
89
|
+
|
|
90
|
+
// Specimens resolve from their `system/<ds>/` folder.
|
|
91
|
+
expect(map['.design/system/maude/preview/Buttons.tsx']).toBe('maude');
|
|
92
|
+
expect(map['.design/system/project/preview/Cards.tsx']).toBe('project');
|
|
93
|
+
} finally {
|
|
94
|
+
await killProc(proc);
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Unit cover for the live-motion proof sampler's pure delta test. The browser
|
|
2
|
+
// drive itself is integration-shape (needs Chromium + a running dev server);
|
|
3
|
+
// here we pin the `signatureChanged` classifier that decides motion-proven vs
|
|
4
|
+
// dead-mechanism, so a regression can't silently turn a freeze-frame "pass"
|
|
5
|
+
// into a false motion confirmation (DDR-094 M1).
|
|
6
|
+
|
|
7
|
+
import { describe, expect, test } from 'bun:test';
|
|
8
|
+
import { signatureChanged } from '../bin/_motion-sample-playwright.mjs';
|
|
9
|
+
|
|
10
|
+
const base = { x: 10, y: 10, width: 80, height: 80, transform: 'none', opacity: 1 };
|
|
11
|
+
|
|
12
|
+
describe('signatureChanged', () => {
|
|
13
|
+
test('identical samples ⇒ no change (dead mechanism)', () => {
|
|
14
|
+
expect(signatureChanged(base, { ...base })).toBe(false);
|
|
15
|
+
});
|
|
16
|
+
test('a bbox shift (morph/scale/translate) ⇒ change', () => {
|
|
17
|
+
expect(signatureChanged(base, { ...base, width: 92 })).toBe(true);
|
|
18
|
+
});
|
|
19
|
+
test('a transform-matrix change ⇒ change (rotate/scale via CSS)', () => {
|
|
20
|
+
expect(signatureChanged(base, { ...base, transform: 'matrix(1,0.2,0,1,0,0)' })).toBe(true);
|
|
21
|
+
});
|
|
22
|
+
test('an opacity fade ⇒ change (no bbox delta)', () => {
|
|
23
|
+
expect(signatureChanged(base, { ...base, opacity: 0.4 })).toBe(true);
|
|
24
|
+
});
|
|
25
|
+
test('sub-epsilon numeric jitter is NOT a change (anti-flake)', () => {
|
|
26
|
+
expect(signatureChanged(base, { ...base, x: 10.1 })).toBe(false);
|
|
27
|
+
expect(signatureChanged(base, { ...base, x: 10.1 }, 0.05)).toBe(true); // tighter eps catches it
|
|
28
|
+
});
|
|
29
|
+
test('the internal __missing marker never counts as a change', () => {
|
|
30
|
+
expect(signatureChanged({ __missing: true }, { __missing: true })).toBe(false);
|
|
31
|
+
});
|
|
32
|
+
test('a null sample is not a change (fail closed)', () => {
|
|
33
|
+
expect(signatureChanged(null, base)).toBe(false);
|
|
34
|
+
});
|
|
35
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// Performance harness for Phase 3.4 budgets.
|
|
3
3
|
//
|
|
4
|
-
// bun run
|
|
4
|
+
// bun run apps/studio/test/perf-harness.ts
|
|
5
5
|
//
|
|
6
6
|
// Boots the dev-server against a synthetic .design/ fixture, measures the
|
|
7
7
|
// budget table from `.ai/plans/phase-3.4-architecture-refactor.md`, and writes
|
|
@@ -19,7 +19,9 @@ import { buildCanvasModule } from '../canvas-build.ts';
|
|
|
19
19
|
import { transpileCanvasSource } from '../canvas-pipeline.ts';
|
|
20
20
|
import { emitRegistryItem } from '../handoff.ts';
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
// apps/studio/test → ../../.. = repo root (DDR-095: was ../../../.. at the old
|
|
23
|
+
// plugins/design/dev-server/test depth).
|
|
24
|
+
const REPO_ROOT = path.resolve(import.meta.dir, '../../..');
|
|
23
25
|
const DESIGN_ROOT = path.join(REPO_ROOT, '.design');
|
|
24
26
|
const DOCS_SITE = path.join(DESIGN_ROOT, 'ui/Docs Site.tsx');
|
|
25
27
|
const CANVAS_VIEWPORT = path.join(DESIGN_ROOT, 'ui/Canvas Viewport.tsx');
|