0x80 / isolate-package

Isolate a monorepo package with its internal dependencies to form a self-contained directory with a pruned lockfile
MIT License
121 stars 13 forks source link

Add support for pnpm v9 #71

Closed matallui closed 6 months ago

matallui commented 6 months ago

After upgrading to pnpm v9, the isolate script is now failing. Here's what I see in the logs:

i  functions: Start isolating the source folder...
info Generating PNPM lockfile...
i  functions: +++ Failed to isolate: Failed to generate lockfile: value.startsWith is not a function

I know that the lockfile format has changed in PNPM v9. Could it be related to that?

0x80 commented 6 months ago

I noticed this too yesterday. The imported pnpm functions do not seem to be compatible with v9. If the v9 logic is not backwards compatible with v8 it might be tricky to solve because we can not link two versions of pnpm in the dependencies.

Possibly we could then just release a v2 of this library that is only compatible with v9 of pnpm.

I don't expect to work on this in the coming days or even weeks, so I suggest to stick with v8 for now.

vajahath commented 6 months ago

I was about to open this issue.

0x80 commented 6 months ago

It seems you can install 2 versions of the same dependency. That means I should be able to use the pnpm lockfile handling functions from v8 next to v9, and that would make it possible to support v9 while staying backwards compatible with v8.

I will try to allocate some time for this soon.

0x80 commented 6 months ago

Support was added in 1.14.0 via #76

I will now adopt the firebase-tools-with-isolate fork to include it.