Problem
Renderer code imports local workspace packages such as @shift/types, @shift/geo, and @shift/validation. If a local package is not explicitly aliased to source and excluded from Vite dependency optimization, Vite can serve a stale optimized bundle from apps/desktop/node_modules/.vite/deps.
We hit this with clipboard paste: Clipboard.ts called ValidateClipboard.isShiftContent, but the optimized @shift_validation.js bundle still exposed an older API shape. Typecheck passed against source, runtime imported stale optimized output, and Shift's own clipboard JSON was reported as unsupported.
Desired rule
Every local @shift/* package imported by renderer code should be listed in both places in apps/desktop/vite.renderer.config.ts:
resolve.alias
optimizeDeps.exclude
Acceptance criteria
- Audit renderer-imported local
@shift/* packages and ensure each has source alias + optimizeDeps exclusion.
- Add a small check/lint script so adding a new renderer
@shift/* import cannot silently miss Vite config.
- Document the debugging pattern for stale
.vite/deps package output.
Obsidian context: Ticket - Renderer Vite Workspace Package Dependencies.md.
Problem
Renderer code imports local workspace packages such as
@shift/types,@shift/geo, and@shift/validation. If a local package is not explicitly aliased to source and excluded from Vite dependency optimization, Vite can serve a stale optimized bundle fromapps/desktop/node_modules/.vite/deps.We hit this with clipboard paste:
Clipboard.tscalledValidateClipboard.isShiftContent, but the optimized@shift_validation.jsbundle still exposed an older API shape. Typecheck passed against source, runtime imported stale optimized output, and Shift's own clipboard JSON was reported as unsupported.Desired rule
Every local
@shift/*package imported by renderer code should be listed in both places inapps/desktop/vite.renderer.config.ts:resolve.aliasoptimizeDeps.excludeAcceptance criteria
@shift/*packages and ensure each has source alias + optimizeDeps exclusion.@shift/*import cannot silently miss Vite config..vite/depspackage output.Obsidian context:
Ticket - Renderer Vite Workspace Package Dependencies.md.