app-builder icon indicating copy to clipboard operation
app-builder copied to clipboard

app-builder node-dep-tree should return node_modules shape or dependency tree ?

Open fabienr opened this issue 1 year ago • 1 comments

  • App-builder Version: 3.5.10
  • Node Version: v18.19.0
  • npm Version : 10.2.3
  • Electron-Builder Version: 24.9.1

Ran into difficulties to build an electron app because npm ci hoist dependencies without making any links (looks like pnpm from what I read but did not try it myself). app-builder node-dep-tree return a dependency tree which reflect module depends but not where they reside on the filesystem. electron-builder use this tree to copy all depends from a project to a dist bundle asar.

One solution is to also hoist the depends thus json output match node_modules shape instead of the dependency tree. What are your opinion, should electron-builder handle hoisted module itself or is it something all app-builder consumers need ? Perhaps a new command node-dep-paths ?

Please find a quick diff, with this I'm able to use electron-builder. See (https://github.com/electron-userland/electron-builder/issues/8068). patch-pkg_node-modules_nodeModuleCollector_go.patch

fabienr avatar Feb 21 '24 21:02 fabienr

Probably would be useful for all app-builder consumers. I've put app-builder in an alpha release stage, so we could theoretically change the API since breaking changes will now be allowed for an app-builder 5.0.0

mmaietta avatar Mar 15 '24 16:03 mmaietta