v2.1.2 — external library dependency resolution & import reliability#26
Merged
Conversation
…llbacks (v2.1.2) Imported variables referencing unconnected team libraries collapsed to 0. This release fixes the full external-dependency workflow: Import re-linking - Alias resolution matches by content: exact collection/path -> unique path across collections -> loose collection-name match (whitespace runs collapsed); ambiguous matches refuse to guess and use the fallback value - New pure-logic test suite for the matcher (pnpm test, 7 cases) Export fallback capture - Chained library aliases resolve recursively per mode for $localValue - Chains crossing into unfetchable library-internal primitives resolve via Variable.resolveForConsumer on a temporary hidden node pinned to the exported mode (applies to preserve-bindings and raw-values modes) Import UX - Asset Sources card is content-aware: per-library status connected / matched-by-name / provided-by-this-import / partial / missing - Import Behaviour defaults from the dependency check: Smart Merge when deps are already present in the file (Clean Import would wipe them), Clean Import otherwise; manual choice always wins; Simple mode follows - Simple tab Import button: removed phantom gap from the empty undo slot (display: contents) Docs: CHANGELOG 2.1.2 entry, 2.1.0 marked released, version bumps across ui.html / code.ts title / package.json / READMEs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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
Corrections release behind the v2.1.2 Community publish. Fixes imported variables that referenced external (team library) collections collapsing to
0when the library wasn't connected to the target file — discovered via a real-world round trip (shadcn studio kit JSON imported into a file carrying Myna UI Tailwind tokens).Import re-linking (
src/code.ts)collection/path→ unique path match across all collections → loose collection-name match (whitespace runs collapsed — fixes☀️ Modevs☀️ Mode). Ambiguous matches refuse to guess and use the preserved fallback value instead of mis-linking.Export fallback capture (
src/code.ts)$localValue(previously dropped → importer had nothing →0).Variable.resolveForConsumeron a throwaway hidden node pinned to the exported mode. Applies to both preserve-bindings and raw-values export.Import UX (
ui.html+ backend)connected/matched by name to variables in this file/provided by this import/partial/missing, computed by checking each referenced path against the file and the import payload itself — replaces the name-only "not connected" false alarm.display: contents(verified by rect measurement in a live preview;:emptywould not have worked since the slot holds a hidden undo section).Tests & docs
pnpm test(7 cases, including the real-world whitespace collision).package.json,ui.html, plugin window title, README badges.Security notes
No permission or network changes — plugin remains
networkAccess: ["none"],permissions: []. NewresolveViaConsumercreates and removes a hidden 1×1 frame during export only when a chain dead-ends (net-zero document change). All new UI strings render through the existingescapeHtmlsanitizer.Test plan
pnpm test— 7/7 matcher casespnpm build— tsc strict + terser clean2. Theme/☀️ Mode/💨 Tailwindre-link,Shape/Corner/Nonefalls back to measured value; Smart Merge auto-selected🤖 Generated with Claude Code