improve electron support #5146
Replies: 4 comments 7 replies
-
@pnpm/collaborators I would like to know what you all think about this. To be honest I don't know how to write a pnpm dependency and child dependency lookup tool, if someone could help me write a similar tool it would be very helpful, I would optimize it and rewrite it in Golang (the electron-builder dependency lookup is written in Golang) |
Beta Was this translation helpful? Give feedback.
-
As far as I know, some electron packagers do not handle dependency lookups properly. |
Beta Was this translation helpful? Give feedback.
-
I have come up with an idea, please correct me if there are problems.
Pseudocode: const hoisted = () => {
// return `node-linker=hoisted` result;
}
const resovleNodeModules = () => {
for (item of hoisted()) {
cp(item.realPath, `electron/dist/node_modules/${item.hoistedPath}`)
}
}
type Item {
realPath: string; // .pnpm/[email protected]/node_modules/got/
hoistedPath: string; // got
} |
Beta Was this translation helpful? Give feedback.
-
@BlackHole1 |
Beta Was this translation helpful? Give feedback.
-
Currently, if an electron application uses pnpm, it must use
node-linker=hoisted
.See: electron-userland/electron-builder#6289 (comment)However, it would be better to have
electron-builder
/electron-packager
/electron-forge
support pnpm directly.This is not easy to do, however, as pnpm's unique node_modules directory structure makes finding dependencies and child dependencies somewhat difficult.
Also, as I am a member of both electron and pnpm, I would like to make some efforts in this direction.
If this issue is resolved, it will benefit both the electron and pnpm communities and help the development of the community.
But I may not be able to do it well on my own and I need some help.
Beta Was this translation helpful? Give feedback.
All reactions