feat: support pnpm
Signed-off-by: Yi Yang [email protected]
- [x] I have read the contribution documentation for this project.
- [x] I agree to follow the code of conduct that this project follows, as appropriate.
- [x] The changes are appropriately documented (if applicable).
- [x] The changes have sufficient test coverage (if applicable).
- [x] The testsuite passes successfully on my local machine (if applicable).
Summarize your changes:
Adding PNPM support - picking up where https://github.com/electron/forge/pull/3351 left off.
Related issue: https://github.com/electron/forge/issues/2633
Is this PR ready to go? If so, is there an ETA on when it might get merged?
I wasn't the original author of this code but happy to do what it takes to get this one released - we use PNPM in WDIO and native support here would definitely help.
I think there are some legitimate test failures that we'll have to investigate in slow-tests.
It may be that pnpm is hanging somewhere along the line? It seems like all 3 platforms are hanging and CircleCI is cutting off the CI jobs.
It is hanging on this line, the package step of the import test.
Added more logging to core/api/package.ts and it seems this await never resolves...
More digging. All of the tests passed in d334388 and subsequently broke with the merge in cf43b13.
Debugging the utils/core-utils/src/rebuild.ts results in the following:
electron-forge:rebuild Spawning a remote rebuilder process with options: {
buildPath: '/var/folders/g6/0tqr_59j76n0g6zxxq_0tq3c0000gn/T/electron-packager/tmp-ukJFul/Electron.app/Contents/Resources/app',
electronVersion: '30.0.6',
arch: 'arm64'
}
electron-forge:rebuild Received message from rebuilder: {
msg: 'rebuild-error',
err: {
message: "ENOENT: no such file or directory, stat '/private/var/folders/g6/0tqr_59j76n0g6zxxq_0tq3c0000gn/T/electron-packager/tmp-ukJFul/Electron.app/Contents/Resources/app/node_modules/electron-squirrel-startup'",
stack: "Error: ENOENT: no such file or directory, stat '/private/var/folders/g6/0tqr_59j76n0g6zxxq_0tq3c0000gn/T/electron-packager/tmp-ukJFul/Electron.app/Contents/Resources/app/node_modules/electron-squirrel-startup'"
}
}
There are two symlinks in the node_modules dir:
lrwxr-xr-x@ electron -> .pnpm/[email protected]/node_modules/electron
lrwxr-xr-x@ electron-squirrel-startup -> .pnpm/[email protected]/node_modules/electron-squirrel-startup
I wonder if this is an issue with @electron/rebuild. Could be related to https://github.com/electron/rebuild/issues/547.
Not sure what is going on here and at the moment I don't have the time to dedicate to it. Hopefully I get some more time, happy for someone else to pick this up though.