semantic-release-lerna 2.7.0 → 2.8.0

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 (3) hide show
  1. package/README.md +21 -0
  2. package/dist/index.js +177 -133
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -74,6 +74,7 @@ The plugin can be configured in the [**semantic-release** configuration file](ht
74
74
 
75
75
  | Option | Description | Default |
76
76
  | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
77
+ | `generateNotes` | Set to `true` to enable generating release notes. See `generateNotes` step for more details. | `false` |
77
78
  | `npmVerifyAuth` | Set to `false` to disable verifying NPM registry credentials. | `true` |
78
79
  | `latch` | Latches package versions together. If the version bump is at least the given version all packages will be bumped regardless if the package has been touched or not. `"major", "minor", "patch", "prerelease", "none"` | `"minor"` |
79
80
  | `rootVersion` | Allow to update version on root `package.json`. | `true` |
@@ -86,3 +87,23 @@ The plugin can be configured in the [**semantic-release** configuration file](ht
86
87
 
87
88
  Configure `@semantic-release/git` to commit `lerna.json` and `package.json` from the package folders.
88
89
  See example configuration above.
90
+
91
+ ### Error: Cannot modify immutable object
92
+
93
+ The contentional changelog packages have mismatching versions.
94
+ This plugin supports both `conventional-changelog-writer` v7 and v8 as long as the preset has a matching version.
95
+
96
+ Assuming you use `conventional-changelog-conventionalcommits` as preset you can verify this with:
97
+
98
+ npm ls conventional-changelog-writer conventional-changelog-commits
99
+
100
+ If the major version of the packages differs you need to explicitly install the correct versions:
101
+
102
+ npm install conventional-changelog-writer@8 conventional-changelog-commits@8
103
+
104
+ Substitute `@8` with `@7` if you need to stay on v7.
105
+ Usually you can get away with removing the packages from `package.json` afterwards as long as the lockfile (e.g. `package-lock.json`) still retains the requested versions of the packages.
106
+
107
+ If you do not have a configured preset `conventional-changelog-angular` is used by default, same rule applies, the major version has to be the same.
108
+
109
+ Also note that `semantic-release` v24 requires v8 of thte conventional changelog packages.
package/dist/index.js CHANGED
@@ -8969,7 +8969,7 @@ var require_hosts = __commonJS({
8969
8969
  filetemplate: ({ domain, user, project, committish, path: path18 }) => `https://${domain}/${user}/${project}/blob/${maybeEncode(committish) || "HEAD"}/${path18}`,
8970
8970
  httpstemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}.git${maybeJoin("#", committish)}`,
8971
8971
  tarballtemplate: ({ domain, user, project, committish }) => `https://${domain}/${user}/${project}/archive/${maybeEncode(committish) || "HEAD"}.tar.gz`,
8972
- bugstemplate: ({ user, project }) => null,
8972
+ bugstemplate: () => null,
8973
8973
  extract: (url) => {
8974
8974
  let [, user, project, aux] = url.pathname.split("/", 4);
8975
8975
  if (["archive"].includes(aux)) {
@@ -9657,6 +9657,7 @@ var require_lrucache = __commonJS({
9657
9657
  // node_modules/semver/classes/range.js
9658
9658
  var require_range = __commonJS({
9659
9659
  "node_modules/semver/classes/range.js"(exports, module) {
9660
+ var SPACE_CHARACTERS = /\s+/g;
9660
9661
  var Range = class _Range {
9661
9662
  constructor(range, options) {
9662
9663
  options = parseOptions(options);
@@ -9670,13 +9671,13 @@ var require_range = __commonJS({
9670
9671
  if (range instanceof Comparator) {
9671
9672
  this.raw = range.value;
9672
9673
  this.set = [[range]];
9673
- this.format();
9674
+ this.formatted = void 0;
9674
9675
  return this;
9675
9676
  }
9676
9677
  this.options = options;
9677
9678
  this.loose = !!options.loose;
9678
9679
  this.includePrerelease = !!options.includePrerelease;
9679
- this.raw = range.trim().split(/\s+/).join(" ");
9680
+ this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
9680
9681
  this.set = this.raw.split("||").map((r) => this.parseRange(r.trim())).filter((c3) => c3.length);
9681
9682
  if (!this.set.length) {
9682
9683
  throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
@@ -9695,10 +9696,27 @@ var require_range = __commonJS({
9695
9696
  }
9696
9697
  }
9697
9698
  }
9698
- this.format();
9699
+ this.formatted = void 0;
9700
+ }
9701
+ get range() {
9702
+ if (this.formatted === void 0) {
9703
+ this.formatted = "";
9704
+ for (let i2 = 0; i2 < this.set.length; i2++) {
9705
+ if (i2 > 0) {
9706
+ this.formatted += "||";
9707
+ }
9708
+ const comps = this.set[i2];
9709
+ for (let k = 0; k < comps.length; k++) {
9710
+ if (k > 0) {
9711
+ this.formatted += " ";
9712
+ }
9713
+ this.formatted += comps[k].toString().trim();
9714
+ }
9715
+ }
9716
+ }
9717
+ return this.formatted;
9699
9718
  }
9700
9719
  format() {
9701
- this.range = this.set.map((comps) => comps.join(" ").trim()).join("||").trim();
9702
9720
  return this.range;
9703
9721
  }
9704
9722
  toString() {
@@ -10678,87 +10696,12 @@ var require_semver2 = __commonJS({
10678
10696
  }
10679
10697
  });
10680
10698
 
10681
- // node_modules/builtins/index.js
10682
- var require_builtins = __commonJS({
10683
- "node_modules/builtins/index.js"(exports, module) {
10684
- "use strict";
10685
- var semver = require_semver2();
10686
- var permanentModules = [
10687
- "assert",
10688
- "buffer",
10689
- "child_process",
10690
- "cluster",
10691
- "console",
10692
- "constants",
10693
- "crypto",
10694
- "dgram",
10695
- "dns",
10696
- "domain",
10697
- "events",
10698
- "fs",
10699
- "http",
10700
- "https",
10701
- "module",
10702
- "net",
10703
- "os",
10704
- "path",
10705
- "punycode",
10706
- "querystring",
10707
- "readline",
10708
- "repl",
10709
- "stream",
10710
- "string_decoder",
10711
- "sys",
10712
- "timers",
10713
- "tls",
10714
- "tty",
10715
- "url",
10716
- "util",
10717
- "vm",
10718
- "zlib"
10719
- ];
10720
- var versionLockedModules = {
10721
- freelist: "<6.0.0",
10722
- v8: ">=1.0.0",
10723
- process: ">=1.1.0",
10724
- inspector: ">=8.0.0",
10725
- async_hooks: ">=8.1.0",
10726
- http2: ">=8.4.0",
10727
- perf_hooks: ">=8.5.0",
10728
- trace_events: ">=10.0.0",
10729
- worker_threads: ">=12.0.0",
10730
- "node:test": ">=18.0.0"
10731
- };
10732
- var experimentalModules = {
10733
- worker_threads: ">=10.5.0",
10734
- wasi: ">=12.16.0",
10735
- diagnostics_channel: "^14.17.0 || >=15.1.0"
10736
- };
10737
- module.exports = ({ version = process.version, experimental = false } = {}) => {
10738
- const builtins = [...permanentModules];
10739
- for (const [name, semverRange] of Object.entries(versionLockedModules)) {
10740
- if (version === "*" || semver.satisfies(version, semverRange)) {
10741
- builtins.push(name);
10742
- }
10743
- }
10744
- if (experimental) {
10745
- for (const [name, semverRange] of Object.entries(experimentalModules)) {
10746
- if (!builtins.includes(name) && (version === "*" || semver.satisfies(version, semverRange))) {
10747
- builtins.push(name);
10748
- }
10749
- }
10750
- }
10751
- return builtins;
10752
- };
10753
- }
10754
- });
10755
-
10756
10699
  // node_modules/validate-npm-package-name/lib/index.js
10757
10700
  var require_lib2 = __commonJS({
10758
10701
  "node_modules/validate-npm-package-name/lib/index.js"(exports, module) {
10759
10702
  "use strict";
10703
+ var { builtinModules: builtins } = __require("module");
10760
10704
  var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$");
10761
- var builtins = require_builtins();
10762
10705
  var blacklist = [
10763
10706
  "node_modules",
10764
10707
  "favicon.ico"
@@ -10795,11 +10738,9 @@ var require_lib2 = __commonJS({
10795
10738
  errors.push(blacklistedName + " is a blacklisted name");
10796
10739
  }
10797
10740
  });
10798
- builtins({ version: "*" }).forEach(function(builtin) {
10799
- if (name.toLowerCase() === builtin) {
10800
- warnings.push(builtin + " is a core module name");
10801
- }
10802
- });
10741
+ if (builtins.includes(name.toLowerCase())) {
10742
+ warnings.push(name + " is a core module name");
10743
+ }
10803
10744
  if (name.length > 214) {
10804
10745
  warnings.push("name can no longer contain more than 214 characters");
10805
10746
  }
@@ -10844,13 +10785,22 @@ var require_lib2 = __commonJS({
10844
10785
  // node_modules/npm-package-arg/node_modules/proc-log/lib/index.js
10845
10786
  var require_lib3 = __commonJS({
10846
10787
  "node_modules/npm-package-arg/node_modules/proc-log/lib/index.js"(exports, module) {
10788
+ var META = Symbol("proc-log.meta");
10847
10789
  module.exports = {
10790
+ META,
10848
10791
  output: {
10849
10792
  LEVELS: [
10850
10793
  "standard",
10851
10794
  "error",
10852
- "buffer"
10795
+ "buffer",
10796
+ "flush"
10853
10797
  ],
10798
+ KEYS: {
10799
+ standard: "standard",
10800
+ error: "error",
10801
+ buffer: "buffer",
10802
+ flush: "flush"
10803
+ },
10854
10804
  standard: function(...args) {
10855
10805
  return process.emit("output", "standard", ...args);
10856
10806
  },
@@ -10859,6 +10809,9 @@ var require_lib3 = __commonJS({
10859
10809
  },
10860
10810
  buffer: function(...args) {
10861
10811
  return process.emit("output", "buffer", ...args);
10812
+ },
10813
+ flush: function(...args) {
10814
+ return process.emit("output", "flush", ...args);
10862
10815
  }
10863
10816
  },
10864
10817
  log: {
@@ -10874,6 +10827,18 @@ var require_lib3 = __commonJS({
10874
10827
  "pause",
10875
10828
  "resume"
10876
10829
  ],
10830
+ KEYS: {
10831
+ notice: "notice",
10832
+ error: "error",
10833
+ warn: "warn",
10834
+ info: "info",
10835
+ verbose: "verbose",
10836
+ http: "http",
10837
+ silly: "silly",
10838
+ timing: "timing",
10839
+ pause: "pause",
10840
+ resume: "resume"
10841
+ },
10877
10842
  error: function(...args) {
10878
10843
  return process.emit("log", "error", ...args);
10879
10844
  },
@@ -10898,11 +10863,78 @@ var require_lib3 = __commonJS({
10898
10863
  timing: function(...args) {
10899
10864
  return process.emit("log", "timing", ...args);
10900
10865
  },
10901
- pause: function(...args) {
10902
- return process.emit("log", "pause", ...args);
10866
+ pause: function() {
10867
+ return process.emit("log", "pause");
10868
+ },
10869
+ resume: function() {
10870
+ return process.emit("log", "resume");
10871
+ }
10872
+ },
10873
+ time: {
10874
+ LEVELS: [
10875
+ "start",
10876
+ "end"
10877
+ ],
10878
+ KEYS: {
10879
+ start: "start",
10880
+ end: "end"
10881
+ },
10882
+ start: function(name, fn) {
10883
+ process.emit("time", "start", name);
10884
+ function end() {
10885
+ return process.emit("time", "end", name);
10886
+ }
10887
+ if (typeof fn === "function") {
10888
+ const res = fn();
10889
+ if (res && res.finally) {
10890
+ return res.finally(end);
10891
+ }
10892
+ end();
10893
+ return res;
10894
+ }
10895
+ return end;
10896
+ },
10897
+ end: function(name) {
10898
+ return process.emit("time", "end", name);
10899
+ }
10900
+ },
10901
+ input: {
10902
+ LEVELS: [
10903
+ "start",
10904
+ "end",
10905
+ "read"
10906
+ ],
10907
+ KEYS: {
10908
+ start: "start",
10909
+ end: "end",
10910
+ read: "read"
10911
+ },
10912
+ start: function(fn) {
10913
+ process.emit("input", "start");
10914
+ function end() {
10915
+ return process.emit("input", "end");
10916
+ }
10917
+ if (typeof fn === "function") {
10918
+ const res = fn();
10919
+ if (res && res.finally) {
10920
+ return res.finally(end);
10921
+ }
10922
+ end();
10923
+ return res;
10924
+ }
10925
+ return end;
10926
+ },
10927
+ end: function() {
10928
+ return process.emit("input", "end");
10903
10929
  },
10904
- resume: function(...args) {
10905
- return process.emit("log", "resume", ...args);
10930
+ read: function(...args) {
10931
+ let resolve4, reject;
10932
+ const promise = new Promise((_resolve, _reject) => {
10933
+ resolve4 = _resolve;
10934
+ reject = _reject;
10935
+ });
10936
+ process.emit("input", "read", resolve4, reject, ...args);
10937
+ return promise;
10906
10938
  }
10907
10939
  }
10908
10940
  };
@@ -11224,6 +11256,9 @@ var require_npa = __commonJS({
11224
11256
  if (!subSpec.registry) {
11225
11257
  throw new Error("aliases only work for registry deps");
11226
11258
  }
11259
+ if (!subSpec.name) {
11260
+ throw new Error("aliases must have a name");
11261
+ }
11227
11262
  res.subSpec = subSpec;
11228
11263
  res.registry = true;
11229
11264
  res.type = "alias";
@@ -12197,47 +12232,55 @@ var require_lib4 = __commonJS({
12197
12232
  // node_modules/picocolors/picocolors.js
12198
12233
  var require_picocolors = __commonJS({
12199
12234
  "node_modules/picocolors/picocolors.js"(exports, module) {
12200
- var tty3 = __require("tty");
12201
- var isColorSupported = !("NO_COLOR" in process.env || process.argv.includes("--no-color")) && ("FORCE_COLOR" in process.env || process.argv.includes("--color") || process.platform === "win32" || tty3.isatty(1) && process.env.TERM !== "dumb" || "CI" in process.env);
12235
+ var argv = process.argv || [];
12236
+ var env = process.env;
12237
+ var isColorSupported = !("NO_COLOR" in env || argv.includes("--no-color")) && ("FORCE_COLOR" in env || argv.includes("--color") || process.platform === "win32" || __require != null && __require("tty").isatty(1) && env.TERM !== "dumb" || "CI" in env);
12202
12238
  var formatter = (open, close, replace = open) => (input) => {
12203
12239
  let string = "" + input;
12204
12240
  let index = string.indexOf(close, open.length);
12205
12241
  return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
12206
12242
  };
12207
12243
  var replaceClose = (string, close, replace, index) => {
12208
- let start = string.substring(0, index) + replace;
12209
- let end = string.substring(index + close.length);
12210
- let nextIndex = end.indexOf(close);
12211
- return ~nextIndex ? start + replaceClose(end, close, replace, nextIndex) : start + end;
12212
- };
12213
- var createColors = (enabled = isColorSupported) => ({
12214
- isColorSupported: enabled,
12215
- reset: enabled ? (s) => `\x1B[0m${s}\x1B[0m` : String,
12216
- bold: enabled ? formatter("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m") : String,
12217
- dim: enabled ? formatter("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m") : String,
12218
- italic: enabled ? formatter("\x1B[3m", "\x1B[23m") : String,
12219
- underline: enabled ? formatter("\x1B[4m", "\x1B[24m") : String,
12220
- inverse: enabled ? formatter("\x1B[7m", "\x1B[27m") : String,
12221
- hidden: enabled ? formatter("\x1B[8m", "\x1B[28m") : String,
12222
- strikethrough: enabled ? formatter("\x1B[9m", "\x1B[29m") : String,
12223
- black: enabled ? formatter("\x1B[30m", "\x1B[39m") : String,
12224
- red: enabled ? formatter("\x1B[31m", "\x1B[39m") : String,
12225
- green: enabled ? formatter("\x1B[32m", "\x1B[39m") : String,
12226
- yellow: enabled ? formatter("\x1B[33m", "\x1B[39m") : String,
12227
- blue: enabled ? formatter("\x1B[34m", "\x1B[39m") : String,
12228
- magenta: enabled ? formatter("\x1B[35m", "\x1B[39m") : String,
12229
- cyan: enabled ? formatter("\x1B[36m", "\x1B[39m") : String,
12230
- white: enabled ? formatter("\x1B[37m", "\x1B[39m") : String,
12231
- gray: enabled ? formatter("\x1B[90m", "\x1B[39m") : String,
12232
- bgBlack: enabled ? formatter("\x1B[40m", "\x1B[49m") : String,
12233
- bgRed: enabled ? formatter("\x1B[41m", "\x1B[49m") : String,
12234
- bgGreen: enabled ? formatter("\x1B[42m", "\x1B[49m") : String,
12235
- bgYellow: enabled ? formatter("\x1B[43m", "\x1B[49m") : String,
12236
- bgBlue: enabled ? formatter("\x1B[44m", "\x1B[49m") : String,
12237
- bgMagenta: enabled ? formatter("\x1B[45m", "\x1B[49m") : String,
12238
- bgCyan: enabled ? formatter("\x1B[46m", "\x1B[49m") : String,
12239
- bgWhite: enabled ? formatter("\x1B[47m", "\x1B[49m") : String
12240
- });
12244
+ let result = "";
12245
+ let cursor = 0;
12246
+ do {
12247
+ result += string.substring(cursor, index) + replace;
12248
+ cursor = index + close.length;
12249
+ index = string.indexOf(close, cursor);
12250
+ } while (~index);
12251
+ return result + string.substring(cursor);
12252
+ };
12253
+ var createColors = (enabled = isColorSupported) => {
12254
+ let init = enabled ? formatter : () => String;
12255
+ return {
12256
+ isColorSupported: enabled,
12257
+ reset: init("\x1B[0m", "\x1B[0m"),
12258
+ bold: init("\x1B[1m", "\x1B[22m", "\x1B[22m\x1B[1m"),
12259
+ dim: init("\x1B[2m", "\x1B[22m", "\x1B[22m\x1B[2m"),
12260
+ italic: init("\x1B[3m", "\x1B[23m"),
12261
+ underline: init("\x1B[4m", "\x1B[24m"),
12262
+ inverse: init("\x1B[7m", "\x1B[27m"),
12263
+ hidden: init("\x1B[8m", "\x1B[28m"),
12264
+ strikethrough: init("\x1B[9m", "\x1B[29m"),
12265
+ black: init("\x1B[30m", "\x1B[39m"),
12266
+ red: init("\x1B[31m", "\x1B[39m"),
12267
+ green: init("\x1B[32m", "\x1B[39m"),
12268
+ yellow: init("\x1B[33m", "\x1B[39m"),
12269
+ blue: init("\x1B[34m", "\x1B[39m"),
12270
+ magenta: init("\x1B[35m", "\x1B[39m"),
12271
+ cyan: init("\x1B[36m", "\x1B[39m"),
12272
+ white: init("\x1B[37m", "\x1B[39m"),
12273
+ gray: init("\x1B[90m", "\x1B[39m"),
12274
+ bgBlack: init("\x1B[40m", "\x1B[49m"),
12275
+ bgRed: init("\x1B[41m", "\x1B[49m"),
12276
+ bgGreen: init("\x1B[42m", "\x1B[49m"),
12277
+ bgYellow: init("\x1B[43m", "\x1B[49m"),
12278
+ bgBlue: init("\x1B[44m", "\x1B[49m"),
12279
+ bgMagenta: init("\x1B[45m", "\x1B[49m"),
12280
+ bgCyan: init("\x1B[46m", "\x1B[49m"),
12281
+ bgWhite: init("\x1B[47m", "\x1B[49m")
12282
+ };
12283
+ };
12241
12284
  module.exports = createColors();
12242
12285
  module.exports.createColors = createColors;
12243
12286
  }
@@ -15842,7 +15885,7 @@ var require_fixer = __commonJS({
15842
15885
  }, this);
15843
15886
  }
15844
15887
  },
15845
- fixDependencies: function(data, strict) {
15888
+ fixDependencies: function(data) {
15846
15889
  objectifyDeps(data, this.warn);
15847
15890
  addOptionalDepsToDeps(data, this.warn);
15848
15891
  this.fixBundleDependenciesField(data);
@@ -16082,7 +16125,7 @@ var require_fixer = __commonJS({
16082
16125
  }
16083
16126
  return obj;
16084
16127
  }
16085
- function addOptionalDepsToDeps(data, warn) {
16128
+ function addOptionalDepsToDeps(data) {
16086
16129
  var o2 = data.optionalDependencies;
16087
16130
  if (!o2) {
16088
16131
  return;
@@ -16239,7 +16282,7 @@ var require_normalize = __commonJS({
16239
16282
  strict = false;
16240
16283
  }
16241
16284
  if (!warn || data.private) {
16242
- warn = function(msg) {
16285
+ warn = function() {
16243
16286
  };
16244
16287
  }
16245
16288
  if (data.scripts && data.scripts.install === "node-gyp rebuild" && !data.scripts.preinstall) {
@@ -27714,10 +27757,11 @@ var Minimatch = class {
27714
27757
  for (let i2 = 0; i2 < globParts.length - 1; i2++) {
27715
27758
  for (let j = i2 + 1; j < globParts.length; j++) {
27716
27759
  const matched = this.partsMatch(globParts[i2], globParts[j], !this.preserveMultipleSlashes);
27717
- if (!matched)
27718
- continue;
27719
- globParts[i2] = matched;
27720
- globParts[j] = [];
27760
+ if (matched) {
27761
+ globParts[i2] = [];
27762
+ globParts[j] = matched;
27763
+ break;
27764
+ }
27721
27765
  }
27722
27766
  }
27723
27767
  return globParts.filter((gs) => gs.length);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-release-lerna",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "semantic-release plugin to publish lerna monorepo packages to npm",
5
5
  "keywords": [
6
6
  "npm",
@@ -43,7 +43,7 @@
43
43
  "semantic-release": "^22 || ^23 || ^24"
44
44
  },
45
45
  "engines": {
46
- "node": ">= 18.19"
46
+ "node": ">= 20.5"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public"