@lerna-lite/publish 4.6.0 → 4.6.2

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.
package/README.md CHANGED
@@ -94,7 +94,8 @@ $ lerna publish --scope my-component test
94
94
  - [`--otp`](#--otp)
95
95
  - [`--preid`](#--preid)
96
96
  - [`--pre-dist-tag <tag>`](#--pre-dist-tag-tag)
97
- - [`--remove-package-fields <fields>`](#--remove-package-fields-fields)
97
+ - [`--remove-package-fields <fields>`](#--remove-package-fields-fields) (`@deprecated` and renamed to `--strip-package-keys`)
98
+ - [`--strip-package-keys <keys>`](#--strip-package-keys-keys)
98
99
  - [`--registry <url>`](#--registry-url)
99
100
  - [`--tag-version-prefix`](#--tag-version-prefix)
100
101
  - [`--temp-tag`](#--temp-tag)
@@ -309,22 +310,25 @@ lerna publish --pre-dist-tag next
309
310
  Works the same as [`--dist-tag`](#--dist-tag-tag), except only applies to packages being released with a prerelease version.
310
311
 
311
312
  ### `--remove-package-fields <fields>`
313
+ `@deprecated` and renamed as `strip-package-keys` (see below)
312
314
 
313
- Remove certain fields from every package before publishing them to the registry, we can also remove fields from a complex object structure via the dot notation (ie "scripts.build"). In summary this option is helpful in cleaning each "package.json" of every packages, it allows us to remove any extra fields that do not have any usage outside of the project itself (for example "devDependencies", "scripts", ...).
315
+ ### `--strip-package-keys <keys>`
316
+
317
+ Strip (remove) certain keys from every package before publishing them to the registry, we can also strip keys from a complex object structure via the dot notation (e.g. "scripts.build"). This option is helpful in cleaning up each "package.json" of every packages, it allows us to strip and remove any keys that do not have any usage outside of the project itself (e.g. "devDependencies", "scripts", ...).
314
318
 
315
319
  ```sh
316
- # remove "devDepencies" and "scripts" fields from all packages
317
- lerna version --remove-package-fields 'devDependencies' 'scripts'
320
+ # strip "devDepencies" and "scripts" fields from all packages
321
+ lerna version --strip-package-keys 'devDependencies' 'scripts'
318
322
  ```
319
323
 
320
- > **Note** lifecycle scripts (`prepublish`, `prepublishOnly`, `prepack`, `postpack`) are executed after the field removal process and for that reason if any of these scripts are found, it will leave them in place and skip the removal whenever found.
324
+ > **Note** lifecycle scripts (`prepublish`, `prepublishOnly`, `prepack`, `postpack`) are executed after the field removal process and for that reason, if any of these scripts are found, it will leave them in place and skip the removal whenever found.
321
325
 
322
- > **Note** this option will actually temporarily modify the actual `package.json` just before the publish process starts and will then revert the change after the publish process is completed. If for whatever reason, your publish process fails, it is possible that your each package, are now in an invalid state (e.g. `scripts` could be removed), so it very important to review your `package.json` after a publish failure.
326
+ > **Note** this option will actually temporarily modify the actual `package.json` just before the publish process starts and will then revert the changes after the publish process is completed. If for whatever reason, your publish process fails, it is possible that your packages are transformed into an invalid state (e.g. `scripts` could be stripped), so it very important to review your `package.json` after a publish failure.
323
327
 
324
328
  Removal of complex object value(s) are also supported via the dot notation as shown below.
325
329
 
326
330
  ```sh
327
- lerna version --remove-package-fields 'scripts.build'
331
+ lerna version --strip-package-keys 'scripts.build'
328
332
  ```
329
333
 
330
334
  ##### output
@@ -338,13 +342,13 @@ lerna version --remove-package-fields 'scripts.build'
338
342
  }
339
343
  ```
340
344
 
341
- This option is probably best specified in `lerna.json` configuration
345
+ This option might be better defined via `lerna.json` configuration
342
346
 
343
347
  ```json
344
348
  {
345
349
  "command": {
346
350
  "publish": {
347
- "removePackageFields": ["devDependencies", "scripts"]
351
+ "stripPackageKeys": ["devDependencies", "scripts"]
348
352
  }
349
353
  }
350
354
  }
@@ -1 +1 @@
1
- {"version":3,"file":"publish-command.d.ts","sourceRoot":"","sources":["../src/publish-command.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,WAAW,EACX,IAAI,EAEJ,OAAO,EACP,gBAAgB,EAChB,aAAa,EACb,oBAAoB,EAErB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAEL,OAAO,EAaR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAiChE,wBAAgB,OAAO,CA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AC,GAAG,IAAI,CAAC;IAC3D,YAAY,CAAC,EAAE,OAAO,CAAS;IAC/B,QAAQ,UAAS;IACjB,qBAAqB,UAAS;IAC9B,OAAO,EAAE,gBAAgB,EAAE,CAAM;IACjC,eAAe,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAEnC,IAAI,mBAAmB,aAGtB;IAED,IAAI,WAAW,YAGd;gBAEW,IAAI,EAAE,oBAAoB,GAAG,aAAa;IAItD,mBAAmB;IAqCnB,IAAI,SAAS,WAGZ;IAED,UAAU;IAuHJ,OAAO;IAgFb,sBAAsB;IAItB,aAAa;;;;;IAoCb,iBAAiB;;;;;IAwCjB,oBAAoB;;;;;IAiGpB,cAAc;IAoBd,qBAAqB;IA+BrB,sBAAsB;IAqCtB,oBAAoB;IA2BpB,2BAA2B;IAK3B,2BAA2B;IA0B3B,qCAAqC;IA0BrC,wCAAwC;IAkCxC,eAAe;IAiBf,gBAAgB;IAIhB,YAAY;IAkBZ,uBAAuB;IA6BvB,yBAAyB,CAAC,KAAK,EAAE,GAAG;IAapC,sBAAsB;IAgBtB,eAAe,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC;IAoBtD,WAAW;IAwDX,aAAa;IAuHb,iBAAiB;IAyCjB,UAAU;IAYV,aAAa,CAAC,GAAG,EAAE,OAAO;IAU1B,OAAO,CAAC,kBAAkB;CAuB3B"}
@@ -163,7 +163,7 @@ export class PublishCommand extends Command {
163
163
  await this.resolveLocalDependencyLinks();
164
164
  await this.resolveDependencyWithCatalogProtocols();
165
165
  await this.resolveLocalDependencyWorkspaceProtocols();
166
- if (this.options.removePackageFields) {
166
+ if (this.options.removePackageFields || this.options.stripPackageKeys) {
167
167
  await this.removePackageProperties();
168
168
  }
169
169
  if (this.options.publishConfigOverrides !== false) {
@@ -469,11 +469,14 @@ export class PublishCommand extends Command {
469
469
  });
470
470
  }
471
471
  removePackageProperties() {
472
- const { removePackageFields } = this.options;
472
+ const stripPackageKeys = this.options.removePackageFields || this.options.stripPackageKeys;
473
+ if (this.options.removePackageFields) {
474
+ this.logger.warn('DEPRECATION', '"--remove-package-fields" was renamed to "--strip-package-keys" and will be removed in the next major release.');
475
+ }
473
476
  return pMap(this.packagesToPublish, (node) => {
474
- if (Array.isArray(removePackageFields)) {
475
- for (const removeField of removePackageFields) {
476
- if (removeField === 'scripts') {
477
+ if (Array.isArray(stripPackageKeys)) {
478
+ for (const fieldToStrip of stripPackageKeys) {
479
+ if (fieldToStrip === 'scripts') {
477
480
  const scriptNames = Object.keys(node.pkg['scripts'] ?? {});
478
481
  const remainingScripts = excludeValuesFromArray(scriptNames, ['prepublish', 'prepublishOnly', 'prepack', 'postpack']);
479
482
  if (remainingScripts.length < scriptNames.length) {
@@ -481,7 +484,7 @@ export class PublishCommand extends Command {
481
484
  continue;
482
485
  }
483
486
  }
484
- deleteComplexObjectProp(node.pkg, removeField, `"${node.pkg.name}" package`);
487
+ deleteComplexObjectProp(node.pkg, fieldToStrip, `"${node.pkg.name}" package`);
485
488
  }
486
489
  }
487
490
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lerna-lite/publish",
3
3
  "description": "Publish packages in the current workspace",
4
- "version": "4.6.0",
4
+ "version": "4.6.2",
5
5
  "files": [
6
6
  "/dist"
7
7
  ],
@@ -29,21 +29,21 @@
29
29
  "node": "^20.17.0 || >=22.9.0"
30
30
  },
31
31
  "dependencies": {
32
- "@lerna-lite/cli": "4.6.0",
33
- "@lerna-lite/core": "4.6.0",
34
- "@lerna-lite/npmlog": "4.6.0",
35
- "@lerna-lite/version": "4.6.0",
36
- "@npmcli/arborist": "^9.1.2",
32
+ "@lerna-lite/cli": "4.6.2",
33
+ "@lerna-lite/core": "4.6.2",
34
+ "@lerna-lite/npmlog": "4.6.2",
35
+ "@lerna-lite/version": "4.6.2",
36
+ "@npmcli/arborist": "^9.1.3",
37
37
  "@npmcli/package-json": "^6.2.0",
38
38
  "byte-size": "^9.0.1",
39
39
  "columnify": "^1.6.0",
40
40
  "fs-extra": "^11.3.0",
41
41
  "has-unicode": "^2.0.1",
42
42
  "libnpmaccess": "^10.0.1",
43
- "libnpmpublish": "^11.0.1",
43
+ "libnpmpublish": "^11.1.0",
44
44
  "normalize-path": "^3.0.0",
45
- "npm-package-arg": "^12.0.2",
46
- "npm-packlist": "^10.0.0",
45
+ "npm-package-arg": "^13.0.0",
46
+ "npm-packlist": "^10.0.1",
47
47
  "npm-registry-fetch": "^18.0.2",
48
48
  "p-map": "^7.0.3",
49
49
  "p-pipe": "^4.0.0",
@@ -54,5 +54,5 @@
54
54
  "tinyglobby": "^0.2.14",
55
55
  "tinyrainbow": "^2.0.0"
56
56
  },
57
- "gitHead": "e0a0b1d36fe5382f2854dda2446f1ba75886a049"
57
+ "gitHead": "73bb9b1028613ad0362e7560eb0bb8fc499e5dfe"
58
58
  }