refactor(frame): canonicalize createEmptyMap in @variscout/core#96
Merged
Conversation
Both PWA and Azure FrameView shipped byte-identical 10-line createEmptyMap helpers. Move the factory to @variscout/core/frame so ProcessMap construction has a single home as Phase 2 of the Layered Process View grows. Pure refactor — zero behavior change. Adds 3 unit tests covering shape, timestamp, and instance independence. Phase 2 PR #1 of N (per ~/.claude/plans/lets-create-a-plan-proud-island.md). Co-Authored-By: ruflo <ruv@ruv.net>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
createEmptyMaphelper from PWA + Azure FrameView into@variscout/core/frame.Why
PR #95 (V1) shipped two identical 10-line
createEmptyMapimplementations inapps/pwa/src/components/views/FrameView.tsxandapps/azure/src/components/editor/FrameView.tsx. Recorded as a V1 follow-up. Canonicalizing now means PR #2 (PWA parity for ProcessHubCurrentStatePanel) and PR #3 (snapshot-mode wiring) inherit one source of truth.Plan reference:
~/.claude/plans/lets-create-a-plan-proud-island.mdChanges
packages/core/src/frame/factories.ts(new):createEmptyMap()factory.packages/core/src/frame/__tests__/factories.test.ts(new): 3 tests — shape, ISO timestamps, instance independence.packages/core/src/frame/index.ts: exportcreateEmptyMap.apps/pwa/src/components/views/FrameView.tsx: import from core, drop local helper.apps/azure/src/components/editor/FrameView.tsx: import from core, drop local helper.Verification
pnpm --filter @variscout/core exec vitest run— 137 files / 2805 tests pass (incl. 3 new).pnpm --filter @variscout/pwa exec vitest run— 17 files / 124 tests pass.pnpm --filter @variscout/azure-app exec vitest run— 64 files / 924 tests pass.pnpm --filter @variscout/ui build— clean tsc + vite build.bash scripts/pr-ready-check.sh— all checks green.Test plan
processContext.processMapis undefined (covered by existing FrameView tests in both packages).Out of scope
apps/pwa/src/App.tsxAppMain — preexisting tech debt; needs dev-server reproduction before fix; deferred.ProcessMapBaseandLayeredProcessView— folded into PR chore(deps): bump @microsoft/teams-js from 2.49.0 to 2.50.0 #4 where snapshot-mode makes the ownership obvious.🤖 Generated with Claude Code