isolate-package 1.6.0 → 1.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +19 -36
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -46,8 +46,8 @@ that includes internal dependencies and a compatible lockfile.
46
46
  - Isolate a monorepo package with its internal dependencies to form a
47
47
  self-contained installable package.
48
48
  - Deterministic deployment by generating an isolated lockfile based on the
49
- existing monorepo lockfile. Currently this feature is only supported for PNPM.
50
- See [lockfiles](#lockfiles) for more information.
49
+ existing monorepo lockfile. Currently this feature is only supported for NPM
50
+ and PNPM. See [lockfiles](#lockfiles) for more information.
51
51
  - Zero-config for the vast majority of use-cases, with no manual steps involved.
52
52
  - Support for PNPM, NPM and Yarn.
53
53
  - Compatible with the Firebase tools CLI, incl 1st gen and 2nd gen Firebase
@@ -337,12 +337,11 @@ Type: `boolean`, default: Depends on package manager.
337
337
 
338
338
  Sets the inclusion or exclusion of the lockfile as part of the deployment.
339
339
 
340
- PNPM lockfiles are regenerated based on the isolated output, so they are
341
- included by default.
340
+ Isolated NPM and PNPM lockfiles are generated based on the existing root
341
+ lockfile, and they are included by default.
342
342
 
343
- For NPM and Yarn the lockfiles are excluded by default because they are
344
- currently copied as-is to the isolate output and can lead to issues during
345
- deployment installs. For more information see [lockfiles](#lockfiles).
343
+ The lockfile for Yarn is excluded by default. For more information see
344
+ [lockfiles](#lockfiles).
346
345
 
347
346
  ### includeDevDependencies
348
347
 
@@ -443,9 +442,6 @@ isolate process manually with `npx isolate` and possibly
443
442
 
444
443
  ## Lockfiles
445
444
 
446
- Deploying the isolated code together with a valid lockfile turned out to be the
447
- biggest challenge of this solution.
448
-
449
445
  A lockfile in a monorepo describes the dependencies of all packages, and does
450
446
  not necessarily translate to the isolated output without altering it. Different
451
447
  package managers use very different formats, and it might not be enough to do a
@@ -458,28 +454,15 @@ it would negate the whole point of having a lockfile in the first place.
458
454
  What we need is to re-generate a lockfile for the isolated output based on the
459
455
  versions that are currently installed and locked in the monorepo lockfile.
460
456
 
461
- ### PNPM
462
-
463
- For PNPM a new isolated lockfile is generated.
464
-
465
- ### NPM
457
+ ### NPM and PNPM
466
458
 
467
- For now, NPM lockfiles are simply copied over to the isolated output. I have
468
- seen Firebase deployments work with it, but likely you are going to run into an
469
- error like this:
459
+ For NPM and PNPM a lockfile is generated and included in the isolated output.
470
460
 
471
- > `npm ci` can only install packages when your package.json and
472
- > package-lock.json or npm-shrinkwrap.json are in sync. Please update your lock
473
- > file with `npm install` before continuing.
474
-
475
- If you experience this issue, you can choose to exclude the lockfile from
476
- deployment by setting `"excludeLockfile": false` in your isolate.config.json
477
- file, or make the move to PNPM (recommended).
461
+ @TODO write about how it works an how we got there.
478
462
 
479
- A real solution, regenerating an isolated lockfile, should be possible based on
480
- the
481
- [NPM CLI Arborist](https://github.com/npm/cli/tree/latest/workspaces/arborist)
482
- code, so I plan to look into that in the near future.
463
+ If you do somehow run into a problem related to the lockfile, you can opt-out of
464
+ this by setting `excludeLockfile: true` in the `isolate.config.json`
465
+ configuration file.
483
466
 
484
467
  ### Yarn
485
468
 
@@ -494,16 +477,16 @@ file, or make the move to PNPM (recommended).
494
477
  I am not aware of any code in the official Yarn repository for re-generating a
495
478
  lockfile, and I am reluctant to work on this feature based on user-land code.
496
479
 
497
- Personally, I do not think Yarn is very relevant anymore in 2023 and I recommend
498
- switching to PNPM.
480
+ Personally, I do not think Yarn is very relevant anymore in 2023 and I
481
+ personally recommend switching to PNPM.
499
482
 
500
483
  ### A Partial Workaround
501
484
 
502
- If you can not use a lockfile, because you depend on NPM or Yarn, a partial
503
- workaround would be to declare dependencies using exact versions in your package
504
- manifest. This doesn't prevent your dependencies-dependencies from installing
505
- newer versions, like a lockfile would, but at least you minimize the risk of
506
- things breaking.
485
+ If you can not use a lockfile, because you depend on Yarn, a partial workaround
486
+ would be to declare dependencies using exact versions in your package manifest.
487
+ This doesn't prevent your dependencies-dependencies from installing newer
488
+ versions, like a lockfile would, but at least you minimize the risk of things
489
+ breaking.
507
490
 
508
491
  ## Different Package Managers
509
492
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "isolate-package",
3
- "version": "1.6.0",
3
+ "version": "1.6.1",
4
4
  "description": "Isolate a monorepo package with its shared dependencies to form a self-contained directory, compatible with Firebase deploy",
5
5
  "author": "Thijs Koerselman",
6
6
  "license": "MIT",