Repository navigation
fix: restore local builds after monorepo split - #4361
Merged
Merged
Conversation
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]>
|
Website preview ready: https://pr-4361-marktext-website.ransixi.workers.dev Built from |
|
Build artifacts for PR #4361: Run: https://github.com/marktext/marktext/actions/runs/26932123363
|
1 of 2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two regressions from the monorepo split (#4302, #4314) broke
pnpm run build:mac/win/linuxoutside CI. Verified locally by producingdist/marktext-mac-arm64-0.20.0-dev.dmg.electronto the workspace root.electronis only adevDependencyofpackages/desktop. With pnpm workspaces,shamefully-hoist=truedoes not surface workspace devDeps at the root, soelectron-vite'srequire.resolve('electron/package.json')(resolved from its own.pnpmlocation) walks upward and fails. Pinningelectronat the root forces it into rootnode_modules.packages/muyajs/lib/renderers/index.jsdynamicallyimport()sflowchart.js,mermaid,vega-embed, but those specifiers only existed inpackages/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 installclean — rootnode_modules/electronsymlink is createdpnpm run build:macproduces a working arm64 DMG + zip indist/build:win/build:linuxon CI runners🤖 Generated with Claude Code