Skip to content

Conversation

@mmaietta
Copy link
Collaborator

@mmaietta mmaietta commented Oct 12, 2025

  • This rewrites the yarn parser to no longer use npm list and instead use yarn list. The JSON format is entirely different and doesn't possess the same tree setup that npm list returns, but in this migration, we can officially support corepack for yarn classic (as npm list won't run if corepack enable has run).
  • Adds new functionality, dedicated support for Yarn Berry. Only Yarn v1 can use CLI. We should use pnp.cjs for PnP, but we can't access the files due to virtual file paths within zipped modules. (e.g. <package_name>.zip/<file_path>) We fallback to npm node module collection (since Yarn Berry could have npm-like structure OR pnpm-like structure, depending on nmHoistingLimits configuration). In the latter case, we still can't assume pnpm is installed, so we still try to use npm collection as a best-effort attempt.
  • If all options fail for npm or yarn berry....added new functionality to parse the node_module tree manually as the ultimate fallback 😅

All filesystem operations are async and memoized.

Migrated packTester to leverage corepack for isolating text/fixture environments and the various installation/hoisting setups they can have.
Using specific installation methods in new unit tests (+ snapshot verification) of package manager implementations

Investigating fixes for: #9025 #9239 #9240 #8870 #9310

@changeset-bot
Copy link

changeset-bot bot commented Oct 12, 2025

🦋 Changeset detected

Latest commit: d6254ed

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
electron-builder Major
app-builder-lib Major
dmg-builder Major
electron-builder-squirrel-windows Major
electron-forge-maker-appimage Major
electron-forge-maker-nsis-web Major
electron-forge-maker-nsis Major
electron-forge-maker-snap Major

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@socket-security
Copy link

socket-security bot commented Oct 12, 2025

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

…environments and using specific installation methods (+ snapshot verification) of package manager implementations
@socket-security
Copy link

socket-security bot commented Nov 6, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedfoo@​1.0.0661005175100
Addedms@​2.0.01001008389100
Addedelectron-log@​2.2.99910010087100

View full report

@mmaietta mmaietta mentioned this pull request Nov 7, 2025
@mmaietta mmaietta marked this pull request as ready for review November 7, 2025 02:06
@mmaietta mmaietta changed the title feat: support corepack packageManager and add related unit tests [WIP] feat: support corepack packageManager and add related unit tests Nov 7, 2025
@lyswhut
Copy link

lyswhut commented Nov 21, 2025

After updating to 26.3.0, I started getting many warning logs during the build:

https://github.com/any-listen/any-listen-desktop/actions/runs/19556675629/job/56000457263

These warning logs look like the following:

  • could not resolve package  packageName=desktop fromDir=D:\a\any-listen-desktop\any-listen-desktop\any-listen\packages\desktop error=Cannot find module 'desktop/package.json'
Require stack:
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\node-module-collector\nodeModulesCollector.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\node-module-collector\npmNodeModulesCollector.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\node-module-collector\index.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\util\appFileCopier.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\asar\asarUtil.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\platformPackager.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\electron\electronMac.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\electron\ElectronFramework.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\packager.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\index.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_ele_e71062a326f89487266806fa0758190d\node_modules\electron-builder\out\builder.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_ele_e71062a326f89487266806fa0758190d\node_modules\electron-builder\out\index.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\packages\desktop\build-config\build-pack.cjs
  • could not resolve package  packageName=undefined fromDir=D:\a\any-listen-desktop\any-listen-desktop\any-listen\packages\shared\i18n error=Cannot find module 'undefined/package.json'
Require stack:
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\node-module-collector\nodeModulesCollector.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\node-module-collector\npmNodeModulesCollector.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\node-module-collector\index.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\util\appFileCopier.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\asar\asarUtil.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\platformPackager.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\electron\electronMac.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\electron\ElectronFramework.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\packager.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_dmg-_95299a558654435db9abdafa0a6b6e09\node_modules\app-builder-lib\out\index.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_ele_e71062a326f89487266806fa0758190d\node_modules\electron-builder\out\builder.js
- D:\a\any-listen-desktop\any-listen-desktop\any-listen\node_modules\.pnpm\[email protected]_ele_e71062a326f89487266806fa0758190d\node_modules\electron-builder\out\index.js

These warnings appear in builds on Windows, macOS, and Linux.

I noticed that these warnings did not exist in version 26.2.0.
Is this a known issue? How should I resolve these warnings?

@mmaietta
Copy link
Collaborator Author

@lyswhut that's a new report. Can you please open a GH issue and follow the ISSUE_TEMPLATE.md to provide console logs with DEBUG=electron-builder env var set?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

3 participants