Stabilize workspace Vitest coverage for plugin diagnostics settings #228

Closed
opened 2026-06-02 13:35:08 +00:00 by steve · 0 comments
Owner

Problem

The milestone added workspace UI helpers for plugin configuration and
diagnostics, but focused workspace Vitest coverage for those helpers is not
currently runnable. Running the diagnostic/settings tests directly fails during
collection with a Vite SSR export error before assertions execute, while the
workspace package check:all script is still a no-op. That leaves milestone
diagnostic behavior under-tested in the normal package validation path.

Goal

Make the workspace diagnostic/settings test path runnable and wire the relevant
coverage into the workspace package's normal validation gate.

Scope

  • Fix the workspace Vitest/Svelte test configuration or module import pattern
    that causes direct diagnostic/settings tests to fail before collection.
  • Add or restore focused tests for plugin feature sections, settings search, and
    warning/error visibility for plugin runtime diagnostics.
  • Replace the no-op workspace check:all with a meaningful narrow validation
    path that includes these tests or an equivalent package-local gate.
  • Document any intentionally unsupported test entry points if there is a
    narrower supported command.

Non-goals

  • Full app smoke coverage for every plugin-loading scenario.
  • Broad refactors of the workspace UI component model outside the diagnostic
    testability issue.
  • Changing diagnostic semantics already covered by API tests unless needed to
    expose them correctly in workspace UI.

Acceptance Criteria

  • Focused workspace tests for plugin diagnostics/settings run successfully from
    the repo root.
  • pnpm --filter @lapis-notes/workspace check:all is no longer a no-op and
    fails when the diagnostic/settings test coverage fails.
  • Tests assert at least one plugin loader warning and one plugin loader error
    path are visible/searchable in the configuration UI helper layer.
  • The package spec or maintenance docs describe the supported workspace test
    command if the package keeps multiple test modes.
  • Validation does not require the full app smoke suite unless implementation
    changes affect app boot or runtime behavior.

Implementation Notes

  • The audit failure was:
    ReferenceError: __vite_ssr_exportName__ is not defined while running focused
    workspace Vitest files.
  • Closed issue #175 noted a previous test removal because workspace lacked a
    working runtime-import Vitest path; reuse that context rather than re-adding
    brittle tests.
  • Keep this scoped to package-local validation and diagnostic/settings coverage
    unless the fix touches boot/runtime code.

Suggested Files or Specs To Inspect

  • packages/workspace/package.json
  • packages/workspace/src/lib/components/configuration/plugin-feature-sections.test.ts
  • packages/workspace/src/lib/components/configuration/settings-search.test.ts
  • packages/workspace/src/lib/components/configuration/plugin-feature-sections.ts
  • packages/workspace/src/lib/components/configuration/use-text-highlight.ts
  • spec/src/20-packages/workspace/index.md
  • spec/src/80-maintenance/monorepo-scripts.md

Validation Commands

  • pnpm --filter @lapis-notes/workspace exec vitest run src/lib/components/configuration/plugin-feature-sections.test.ts src/lib/components/configuration/settings-search.test.ts
  • pnpm --filter @lapis-notes/workspace check:all
  • make spec-lint
  • mdbook build spec

Follow-up Tasks

Implementation Summary

Added workspace Vitest configuration with first-party source resolution and renderer shims, upgraded workspace Vitest to 4.1.7, wired check:all to the focused unit gate, and documented the supported workspace unit command.

## Problem The milestone added workspace UI helpers for plugin configuration and diagnostics, but focused workspace Vitest coverage for those helpers is not currently runnable. Running the diagnostic/settings tests directly fails during collection with a Vite SSR export error before assertions execute, while the workspace package `check:all` script is still a no-op. That leaves milestone diagnostic behavior under-tested in the normal package validation path. ## Goal Make the workspace diagnostic/settings test path runnable and wire the relevant coverage into the workspace package's normal validation gate. ## Scope - Fix the workspace Vitest/Svelte test configuration or module import pattern that causes direct diagnostic/settings tests to fail before collection. - Add or restore focused tests for plugin feature sections, settings search, and warning/error visibility for plugin runtime diagnostics. - Replace the no-op workspace `check:all` with a meaningful narrow validation path that includes these tests or an equivalent package-local gate. - Document any intentionally unsupported test entry points if there is a narrower supported command. ## Non-goals - Full app smoke coverage for every plugin-loading scenario. - Broad refactors of the workspace UI component model outside the diagnostic testability issue. - Changing diagnostic semantics already covered by API tests unless needed to expose them correctly in workspace UI. ## Acceptance Criteria - Focused workspace tests for plugin diagnostics/settings run successfully from the repo root. - `pnpm --filter @lapis-notes/workspace check:all` is no longer a no-op and fails when the diagnostic/settings test coverage fails. - Tests assert at least one plugin loader warning and one plugin loader error path are visible/searchable in the configuration UI helper layer. - The package spec or maintenance docs describe the supported workspace test command if the package keeps multiple test modes. - Validation does not require the full app smoke suite unless implementation changes affect app boot or runtime behavior. ## Implementation Notes - The audit failure was: `ReferenceError: __vite_ssr_exportName__ is not defined` while running focused workspace Vitest files. - Closed issue #175 noted a previous test removal because workspace lacked a working runtime-import Vitest path; reuse that context rather than re-adding brittle tests. - Keep this scoped to package-local validation and diagnostic/settings coverage unless the fix touches boot/runtime code. ## Suggested Files or Specs To Inspect - `packages/workspace/package.json` - `packages/workspace/src/lib/components/configuration/plugin-feature-sections.test.ts` - `packages/workspace/src/lib/components/configuration/settings-search.test.ts` - `packages/workspace/src/lib/components/configuration/plugin-feature-sections.ts` - `packages/workspace/src/lib/components/configuration/use-text-highlight.ts` - `spec/src/20-packages/workspace/index.md` - `spec/src/80-maintenance/monorepo-scripts.md` ## Validation Commands - `pnpm --filter @lapis-notes/workspace exec vitest run src/lib/components/configuration/plugin-feature-sections.test.ts src/lib/components/configuration/settings-search.test.ts` - `pnpm --filter @lapis-notes/workspace check:all` - `make spec-lint` - `mdbook build spec` ## Related Issues - Follow-up to #223 — [[docs/ui] Document plugin module loading and expose diagnostics](../closed/223-docs-ui-document-plugin-module-loading-and-expose-diagnostics.md) ## Follow-up Tasks ## Implementation Summary Added workspace Vitest configuration with first-party source resolution and renderer shims, upgraded workspace Vitest to 4.1.7, wired check:all to the focused unit gate, and documented the supported workspace unit command. <!-- backlog:task_id=TASK-PLUGIN-LOADER-014 source_spec=spec/src/20-packages/workspace/index.md related_issue=223 -->
Sign in to join this conversation.
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#228
No description provided.