Fix workspace and desktop app-host vite resolution for ui table-dnd subpaths #276

Closed
opened 2026-06-04 20:27:47 +00:00 by steve · 0 comments
Owner

Workspace and desktop smoke fail because app-host Vite configs duplicate the first-party source resolver without the table-dnd/* subpath handlers added in #266.

Problem

CI smoke boots workspace with a clean tree (no packages/ui/dist). Plugin markdown and CSV import @lapis-notes/ui/table-dnd/sensors and @lapis-notes/ui/table-dnd/utils. Package-local Vite configs resolve those via scripts/first-party-source-resolution.mjs, but packages/workspace/vite.config.ts and packages/desktop-electron/vite.config.ts keep inline registries that still miss the subpaths.

Goal

App-host dev Vite resolves explicit UI table-dnd subpaths to source, and check:source-resolution catches future drift between shared and app-host registries.

Scope

  • Add table-dnd/utils and table-dnd/sensors handlers to workspace and desktop-electron UI resolveSubpath.
  • Extend check-first-party-source-resolution.mjs to validate explicit subpath entrypoints through app-host Vite configs using real cross-package importers.

Non-goals

  • Replacing the entire inline app-host resolver with the shared module in this issue (follow-up if desired).

Acceptance Criteria

  • Workspace and desktop Vite dev resolve @lapis-notes/ui/table-dnd/sensors and /utils to UI source files.
  • pnpm check:source-resolution fails if app-host registries drop explicit subpath handlers again.
  • pnpm test:smoke passes (workspace boot reaches vault chooser without Vite transform errors).

Implementation Notes

Mirror the handlers already present in firstPartySourcePackages for @lapis-notes/ui inside both app-host vite configs. Export firstPartySourceExplicitSubpathEntrypoints and add an app-host leg to the source-resolution guard.

Suggested Files or Specs To Inspect

  • packages/workspace/vite.config.ts
  • packages/desktop-electron/vite.config.ts
  • scripts/check-first-party-source-resolution.mjs
  • scripts/first-party-source-resolution.mjs
  • spec/src/30-cross-package-contracts/first-party-source-resolution.md

Validation Commands

  • pnpm check:source-resolution
  • pnpm test:scripts
  • pnpm test:smoke

Follow-up Tasks

Implementation Summary

Added table-dnd/utils and table-dnd/sensors resolveSubpath handlers to workspace and desktop-electron vite configs; exported firstPartySourceExplicitSubpathEntrypoints and extended check-first-party-source-resolution to validate explicit subpaths through app-host Vite using real cross-package importers. Validated: pnpm check:source-resolution, pnpm test:scripts, make spec-lint, workspace test:e2e:smoke (3 passed).

Workspace and desktop smoke fail because app-host Vite configs duplicate the first-party source resolver without the `table-dnd/*` subpath handlers added in #266. ## Problem CI smoke boots workspace with a clean tree (no `packages/ui/dist`). Plugin markdown and CSV import `@lapis-notes/ui/table-dnd/sensors` and `@lapis-notes/ui/table-dnd/utils`. Package-local Vite configs resolve those via `scripts/first-party-source-resolution.mjs`, but `packages/workspace/vite.config.ts` and `packages/desktop-electron/vite.config.ts` keep inline registries that still miss the subpaths. ## Goal App-host dev Vite resolves explicit UI table-dnd subpaths to source, and `check:source-resolution` catches future drift between shared and app-host registries. ## Scope - Add `table-dnd/utils` and `table-dnd/sensors` handlers to workspace and desktop-electron UI `resolveSubpath`. - Extend `check-first-party-source-resolution.mjs` to validate explicit subpath entrypoints through app-host Vite configs using real cross-package importers. ## Non-goals - Replacing the entire inline app-host resolver with the shared module in this issue (follow-up if desired). ## Acceptance Criteria - [ ] Workspace and desktop Vite dev resolve `@lapis-notes/ui/table-dnd/sensors` and `/utils` to UI source files. - [ ] `pnpm check:source-resolution` fails if app-host registries drop explicit subpath handlers again. - [ ] `pnpm test:smoke` passes (workspace boot reaches vault chooser without Vite transform errors). ## Implementation Notes Mirror the handlers already present in `firstPartySourcePackages` for `@lapis-notes/ui` inside both app-host vite configs. Export `firstPartySourceExplicitSubpathEntrypoints` and add an app-host leg to the source-resolution guard. ## Suggested Files or Specs To Inspect - `packages/workspace/vite.config.ts` - `packages/desktop-electron/vite.config.ts` - `scripts/check-first-party-source-resolution.mjs` - `scripts/first-party-source-resolution.mjs` - `spec/src/30-cross-package-contracts/first-party-source-resolution.md` ## Validation Commands - `pnpm check:source-resolution` - `pnpm test:scripts` - `pnpm test:smoke` ## Related Issues - Follow-up to #266 — [Fix first-party source resolution for ui table-dnd subpaths](../closed/266-fix-first-party-source-resolution-for-ui-table-dnd-subpaths.md) ## Follow-up Tasks ## Implementation Summary Added table-dnd/utils and table-dnd/sensors resolveSubpath handlers to workspace and desktop-electron vite configs; exported firstPartySourceExplicitSubpathEntrypoints and extended check-first-party-source-resolution to validate explicit subpaths through app-host Vite using real cross-package importers. Validated: pnpm check:source-resolution, pnpm test:scripts, make spec-lint, workspace test:e2e:smoke (3 passed). <!-- backlog:task_id=TASK-UI-TABLE-DND-APP-HOST-VITE source_spec=scripts/first-party-source-resolution.mjs related_issue=266 -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#276
No description provided.