Skip to content

fix: restore local builds after monorepo split - #4361

Merged
Jocs merged 1 commit into
developfrom
fix/local-build-monorepo-deps
Jun 4, 2026
Merged

Jocs merged 1 commit into
developfrom
fix/local-build-monorepo-deps

Conversation

@Jocs

@Jocs Jocs commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

Two regressions from the monorepo split (#4302, #4314) broke pnpm run build:mac/win/linux outside CI. Verified locally by producing dist/marktext-mac-arm64-0.20.0-dev.dmg.

  • Hoist electron to the workspace root. electron is only a devDependency of packages/desktop. With pnpm workspaces, shamefully-hoist=true does not surface workspace devDeps at the root, so electron-vite's require.resolve('electron/package.json') (resolved from its own .pnpm location) walks upward and fails. Pinning electron at the root forces it into root node_modules.
  • Declare muyajs's actual deps in muyajs. packages/muyajs/lib/renderers/index.js dynamically import()s flowchart.js, mermaid, vega-embed, but those specifiers only existed in packages/desktop/package.json. Vite/Rollup can't resolve them when bundling muyajs in a strict pnpm layout. Each package now owns what it imports.

Test plan

  • pnpm install clean — root node_modules/electron symlink is created
  • pnpm run build:mac produces a working arm64 DMG + zip in dist/
  • CI passes
  • (Maintainer) confirm build:win / build:linux on CI runners

🤖 Generated with Claude Code

Two regressions from the monorepo conversion (#4302, #4314) broke
`pnpm run build:mac/win/linux` outside CI:

- electron is only a devDependency of packages/desktop. With pnpm
  workspaces, `shamefully-hoist=true` does not surface it at the
  workspace root, so electron-vite's `require.resolve('electron/
  package.json')` (resolved from its own .pnpm location) fails. Pin
  electron at the workspace root so it is hoisted into root
  node_modules.

- packages/muyajs/lib/renderers/index.js dynamically imports
  flowchart.js, mermaid and vega-embed, but these were only declared
  in packages/desktop. Vite/Rollup can resolve them when bundling the
  renderer alone, but in a strict pnpm layout muyajs cannot see its
  sibling's deps. Declare them as muyajs's own dependencies so each
  package owns what it imports.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Website preview ready: https://pr-4361-marktext-website.ransixi.workers.dev

Built from 0e0c3527685f478c2745576fe21024eb22d0d002 · Worker: marktext-website · Version: c5e81592-21fd-4717-9c7e-3b24a190f02d · Alias: pr-4361

@github-actions

github-actions Bot commented Jun 4, 2026

Copy link
Copy Markdown

Build artifacts for PR #4361:

Run: https://github.com/marktext/marktext/actions/runs/26932123363

Artifact Size Link
marktext-windows-arm64 249.6 MB Download
marktext-macos-x64 249.2 MB Download
marktext-linux 540.7 MB Download
marktext-windows-x64 250.9 MB Download
marktext-macos-arm64 238.9 MB Download

@Jocs
Jocs merged commit dc3d309 into develop Jun 4, 2026
18 checks passed
@Jocs
Jocs deleted the fix/local-build-monorepo-deps branch June 4, 2026 12:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant