Fix desktop release plugin-tasks build race under parallel pnpm #301

Closed
opened 2026-06-05 17:43:29 +00:00 by steve · 0 comments
Owner

Problem

Forgejo release-desktop macOS/Linux jobs fail intermittently while building
@lapis-notes/tasks during pnpm --filter @lapis-notes/desktop-electron dist:mac:all / dist:linux. The desktop shell's
build:workspace-plugin-dist script used pnpm --filter … run build, which
runs matching workspace packages concurrently. @lapis-notes/tasks bundles
@lapis-notes/markdown dist exports during its production Vite build, so
tasks can start before markdown dist/ exists or while markdown prepack is
still running.

Observed failures include:

  • Failed to resolve entry for package "@lapis-notes/markdown"
  • Rollup failed to resolve import "micromark-util-symbol" from plugin-markdown/dist/...

Goal

Desktop release builds must produce bundled first-party plugin dist outputs in
dependency order so @lapis-notes/tasks never builds against incomplete
markdown artifacts.

Scope

  • packages/desktop-electron/package.json (build:workspace-plugin-dist)
  • packages/desktop-electron/spec.md

Non-goals

  • Refactoring plugin-tasks Vite config to externalize markdown (separate
    bundle-size/ownership follow-up)
  • Changing unrelated release workflow steps

Acceptance Criteria

  • build:workspace-plugin-dist uses Turborepo so ^build dependency order
    is enforced for bundled plugins
  • Clean repeated runs of the desktop plugin-dist step succeed locally
  • Desktop package spec documents the turbo-ordered plugin dist prebuild

Implementation Notes

Replace the parallel pnpm --filter … run build invocation with
pnpm exec turbo run build using the same bundled plugin filters. Turbo already
declares build.dependsOn = ["^build"], which builds @lapis-notes/markdown
before @lapis-notes/tasks.

Suggested Files or Specs To Inspect

  • packages/desktop-electron/package.json
  • turbo.json
  • packages/plugins/plugin-tasks/vite.config.ts
  • packages/plugins/plugin-tasks/package.json

Validation Commands

  • Repeated clean pnpm --filter @lapis-notes/desktop-electron run build:workspace-plugin-dist
  • pnpm --filter @lapis-notes/desktop-electron check:all

Follow-up Tasks

Implementation Summary

Switched desktop build:workspace-plugin-dist from parallel pnpm filters to turbo run build so ^build dependency order builds @lapis-notes/markdown before @lapis-notes/tasks. Updated desktop-electron spec. Validated with three clean plugin-dist runs and one uncached turbo --force build.

## Problem Forgejo `release-desktop` macOS/Linux jobs fail intermittently while building `@lapis-notes/tasks` during `pnpm --filter @lapis-notes/desktop-electron dist:mac:all` / `dist:linux`. The desktop shell's `build:workspace-plugin-dist` script used `pnpm --filter … run build`, which runs matching workspace packages concurrently. `@lapis-notes/tasks` bundles `@lapis-notes/markdown` dist exports during its production Vite build, so tasks can start before markdown `dist/` exists or while markdown prepack is still running. Observed failures include: - `Failed to resolve entry for package "@lapis-notes/markdown"` - `Rollup failed to resolve import "micromark-util-symbol" from plugin-markdown/dist/...` ## Goal Desktop release builds must produce bundled first-party plugin dist outputs in dependency order so `@lapis-notes/tasks` never builds against incomplete markdown artifacts. ## Scope - `packages/desktop-electron/package.json` (`build:workspace-plugin-dist`) - `packages/desktop-electron/spec.md` ## Non-goals - Refactoring plugin-tasks Vite config to externalize markdown (separate bundle-size/ownership follow-up) - Changing unrelated release workflow steps ## Acceptance Criteria - [ ] `build:workspace-plugin-dist` uses Turborepo so `^build` dependency order is enforced for bundled plugins - [ ] Clean repeated runs of the desktop plugin-dist step succeed locally - [ ] Desktop package spec documents the turbo-ordered plugin dist prebuild ## Implementation Notes Replace the parallel `pnpm --filter … run build` invocation with `pnpm exec turbo run build` using the same bundled plugin filters. Turbo already declares `build.dependsOn = ["^build"]`, which builds `@lapis-notes/markdown` before `@lapis-notes/tasks`. ## Suggested Files or Specs To Inspect - `packages/desktop-electron/package.json` - `turbo.json` - `packages/plugins/plugin-tasks/vite.config.ts` - `packages/plugins/plugin-tasks/package.json` ## Validation Commands - Repeated clean `pnpm --filter @lapis-notes/desktop-electron run build:workspace-plugin-dist` - `pnpm --filter @lapis-notes/desktop-electron check:all` ## Related Issues - Follow-up to #286 — [Fix desktop release plugin-history dist styles-entry ENOENT](../closed/286-fix-desktop-release-plugin-history-dist-styles-entry-enoent.md) ## Follow-up Tasks ## Implementation Summary Switched desktop build:workspace-plugin-dist from parallel pnpm filters to turbo run build so ^build dependency order builds @lapis-notes/markdown before @lapis-notes/tasks. Updated desktop-electron spec. Validated with three clean plugin-dist runs and one uncached turbo --force build. <!-- backlog:task_id=TASK-DESKTOP-PLUGIN-TASKS-BUILD-ORDER source_spec=spec/src/20-packages/desktop-electron/index.md related_issue=286 -->
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#301
No description provided.