develar / app-builder

Generic helper tool to build app in a distributable format
MIT License
123 stars 62 forks source link

feat: resolve all the pnpm issues without hostied config #136

Closed beyondkmp closed 2 months ago

beyondkmp commented 2 months ago

In this PR(https://github.com/develar/app-builder/pull/132), only the case of files with the same name has been fixed. If it's not a file but a folder, and there's a package.json inside, it will lead to obtaining the wrong package.

Therefore, FindParentWithFile is incorrect. It shouldn't directly search upwards, as searching upwards can result in finding packages outside of node_modules.

To implement the non-hoisted mode under pnpm, we just need to replace the dir in the dependency with the actual dir.

https://github.com/develar/app-builder/blob/82d3a963bed48f8eb623db0d805a72f0cd72396d/pkg/node-modules/nodeModuleCollector.go#L299

Combined with the hoisted conversion algorithm in this MR(https://github.com/develar/app-builder/pull/134), it can solve the issues mentioned below.

fix:
https://github.com/develar/app-builder/issues/84 https://github.com/develar/app-builder/issues/92 https://github.com/develar/app-builder/pull/93

changeset-bot[bot] commented 2 months ago

🦋 Changeset detected

Latest commit: f2c9989a4e97fbb36470f56ea2f90cfdb0e6637a

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

This PR includes changesets to release 1 package | Name | Type | | --------------- | ----- | | app-builder-bin | Patch |

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