Fix plugin-markdown styles build UI CSS resolution for desktop release #297

Closed
opened 2026-06-05 15:33:12 +00:00 by steve · 0 comments
Owner

Problem

Forgejo release-desktop Linux and macOS build jobs fail while building
@lapis-notes/markdown because vite.styles.config.ts has no first-party CSS
aliases. Plugin markdown styles @reference packages/workspace/src/app.css,
which imports @lapis-notes/ui/theme.css. Tailwind cannot resolve that package
specifier during the styles build, so desktop dist:linux / dist:mac:all abort.

Goal

Plugin markdown styles build resolves shared UI CSS entrypoints from source and
desktop release builds complete on Linux and macOS.

Scope

  • packages/plugins/plugin-markdown/vite.styles.config.ts
  • scripts/check-first-party-source-resolution.mjs guard for plugin styles
    build configs

Non-goals

  • Refactoring every plugin vite.styles.config.ts (only markdown references
    workspace app.css today)
  • Changing workspace or desktop app-host Vite configs (already alias UI CSS)

Acceptance Criteria

  • vite.styles.config.ts aliases @lapis-notes/ui/* CSS entrypoints to
    source via createFirstPartySourceCssAliases
  • pnpm check:source-resolution validates plugin markdown styles build
    resolution from workspace app.css
  • Desktop release build path can build plugin markdown styles without
    requiring prebuilt packages/ui/dist

Implementation Notes

Wire createFirstPartySourceCssAliases(["@lapis-notes/ui"]) into plugin
markdown vite.styles.config.ts. Extend the source-resolution guard with a
build-mode check that resolves UI CSS imports from workspace app.css through
that config.

Suggested Files or Specs To Inspect

  • packages/plugins/plugin-markdown/vite.styles.config.ts
  • packages/plugins/plugin-markdown/src/style.css
  • packages/workspace/src/app.css
  • scripts/first-party-source-resolution.mjs

Validation Commands

  • pnpm check:source-resolution
  • pnpm --filter @lapis-notes/markdown build
  • pnpm --filter @lapis-notes/desktop-electron build (release path)

Follow-up Tasks

Implementation Summary

Added createFirstPartySourceCssAliases to plugin-markdown vite.styles.config.ts so Tailwind can resolve @lapis-notes/ui/theme.css when styles @reference workspace app.css during desktop release builds. Extended check-first-party-source-resolution with a build-mode guard for that config. Validated with node --test on source-resolution tests and pnpm spec:lint.

## Problem Forgejo `release-desktop` Linux and macOS build jobs fail while building `@lapis-notes/markdown` because `vite.styles.config.ts` has no first-party CSS aliases. Plugin markdown styles `@reference` `packages/workspace/src/app.css`, which imports `@lapis-notes/ui/theme.css`. Tailwind cannot resolve that package specifier during the styles build, so desktop `dist:linux` / `dist:mac:all` abort. ## Goal Plugin markdown styles build resolves shared UI CSS entrypoints from source and desktop release builds complete on Linux and macOS. ## Scope - `packages/plugins/plugin-markdown/vite.styles.config.ts` - `scripts/check-first-party-source-resolution.mjs` guard for plugin styles build configs ## Non-goals - Refactoring every plugin `vite.styles.config.ts` (only markdown references workspace `app.css` today) - Changing workspace or desktop app-host Vite configs (already alias UI CSS) ## Acceptance Criteria - [ ] `vite.styles.config.ts` aliases `@lapis-notes/ui/*` CSS entrypoints to source via `createFirstPartySourceCssAliases` - [ ] `pnpm check:source-resolution` validates plugin markdown styles build resolution from workspace `app.css` - [ ] Desktop release build path can build plugin markdown styles without requiring prebuilt `packages/ui/dist` ## Implementation Notes Wire `createFirstPartySourceCssAliases(["@lapis-notes/ui"])` into plugin markdown `vite.styles.config.ts`. Extend the source-resolution guard with a build-mode check that resolves UI CSS imports from workspace `app.css` through that config. ## Suggested Files or Specs To Inspect - `packages/plugins/plugin-markdown/vite.styles.config.ts` - `packages/plugins/plugin-markdown/src/style.css` - `packages/workspace/src/app.css` - `scripts/first-party-source-resolution.mjs` ## Validation Commands - `pnpm check:source-resolution` - `pnpm --filter @lapis-notes/markdown build` - `pnpm --filter @lapis-notes/desktop-electron build` (release path) ## Related Issues - Follow-up to #276 — [Fix workspace and desktop app-host vite resolution for ui table-dnd subpaths](../closed/276-fix-workspace-and-desktop-app-host-vite-resolution-for-ui-table-dnd-subpaths.md) ## Follow-up Tasks ## Implementation Summary Added createFirstPartySourceCssAliases to plugin-markdown vite.styles.config.ts so Tailwind can resolve @lapis-notes/ui/theme.css when styles @reference workspace app.css during desktop release builds. Extended check-first-party-source-resolution with a build-mode guard for that config. Validated with node --test on source-resolution tests and pnpm spec:lint. <!-- backlog:task_id=TASK-MARKDOWN-STYLES-UI-CSS source_spec=scripts/first-party-source-resolution.mjs related_issue=276 -->
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#297
No description provided.