semantic-release-lerna 3.1.2 → 3.1.4

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/dist/index.js +31 -10
  2. package/package.json +8 -2
package/dist/index.js CHANGED
@@ -15,7 +15,11 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
15
15
  throw Error('Dynamic require of "' + x + '" is not supported');
16
16
  });
17
17
  var __commonJS = (cb, mod) => function __require2() {
18
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
18
+ try {
19
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
20
+ } catch (e) {
21
+ throw mod = 0, e;
22
+ }
19
23
  };
20
24
  var __export = (target, all) => {
21
25
  for (var name in all)
@@ -718,6 +722,18 @@ var require_semver = __commonJS({
718
722
  var { safeRe: re, t } = require_re();
719
723
  var parseOptions = require_parse_options();
720
724
  var { compareIdentifiers } = require_identifiers();
725
+ var isPrereleaseIdentifier = (prerelease, identifier) => {
726
+ const identifiers = identifier.split(".");
727
+ if (identifiers.length > prerelease.length) {
728
+ return false;
729
+ }
730
+ for (let i2 = 0; i2 < identifiers.length; i2++) {
731
+ if (compareIdentifiers(prerelease[i2], identifiers[i2]) !== 0) {
732
+ return false;
733
+ }
734
+ }
735
+ return true;
736
+ };
721
737
  var SemVer = class _SemVer {
722
738
  constructor(version, options) {
723
739
  options = parseOptions(options);
@@ -964,8 +980,9 @@ var require_semver = __commonJS({
964
980
  if (identifierBase === false) {
965
981
  prerelease = [identifier];
966
982
  }
967
- if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
968
- if (isNaN(this.prerelease[1])) {
983
+ if (isPrereleaseIdentifier(this.prerelease, identifier)) {
984
+ const prereleaseBase = this.prerelease[identifier.split(".").length];
985
+ if (isNaN(prereleaseBase)) {
969
986
  this.prerelease = prerelease;
970
987
  }
971
988
  } else {
@@ -1635,6 +1652,7 @@ var require_range = __commonJS({
1635
1652
  return comp;
1636
1653
  };
1637
1654
  var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
1655
+ var invalidXRangeOrder = (M, m, p) => isX(M) && !isX(m) || isX(m) && p && !isX(p);
1638
1656
  var replaceTildes = (comp, options) => {
1639
1657
  return comp.trim().split(/\s+/).map((c3) => replaceTilde(c3, options)).join(" ");
1640
1658
  };
@@ -1694,9 +1712,9 @@ var require_range = __commonJS({
1694
1712
  debug2("no pr");
1695
1713
  if (M === "0") {
1696
1714
  if (m === "0") {
1697
- ret = `>=${M}.${m}.${p}${z} <${M}.${m}.${+p + 1}-0`;
1715
+ ret = `>=${M}.${m}.${p} <${M}.${m}.${+p + 1}-0`;
1698
1716
  } else {
1699
- ret = `>=${M}.${m}.${p}${z} <${M}.${+m + 1}.0-0`;
1717
+ ret = `>=${M}.${m}.${p} <${M}.${+m + 1}.0-0`;
1700
1718
  }
1701
1719
  } else {
1702
1720
  ret = `>=${M}.${m}.${p} <${+M + 1}.0.0-0`;
@@ -1715,6 +1733,9 @@ var require_range = __commonJS({
1715
1733
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE];
1716
1734
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
1717
1735
  debug2("xRange", comp, ret, gtlt, M, m, p, pr);
1736
+ if (invalidXRangeOrder(M, m, p)) {
1737
+ return comp;
1738
+ }
1718
1739
  const xM = isX(M);
1719
1740
  const xm = xM || isX(m);
1720
1741
  const xp = xm || isX(p);
@@ -22854,7 +22875,7 @@ var PackageGraph = class extends Map {
22854
22875
  if (isWorkspaceSpec) {
22855
22876
  fullWorkspaceSpec = spec;
22856
22877
  spec = spec.replace(/^workspace:/, "");
22857
- if (spec === "*" || spec === "^" || spec === "~") {
22878
+ if (["*", "^", "~"].includes(spec)) {
22858
22879
  workspaceAlias = spec;
22859
22880
  if (depNode?.version) {
22860
22881
  const prefix = spec === "*" ? "" : spec;
@@ -28932,7 +28953,7 @@ var Project = class {
28932
28953
  var latchMajor = /^\d+\.0\.0$/;
28933
28954
  var latchMinor = /^\d+\.\d+\.0$/;
28934
28955
  var latchPatch = /^\d+\.\d+\.\d+$/;
28935
- var latchPrerelease = /^\d+\.\d+\.\d+(-(.*\.)?\d+)?$/;
28956
+ var latchPrerelease = /^\d+\.\d+\.\d+(?:-(?:.*\.)?\d+)?$/;
28936
28957
  function shouldLatch(version, latch) {
28937
28958
  switch (latch) {
28938
28959
  case "major":
@@ -29071,7 +29092,7 @@ function getUpdateLockFileCommand(packageManager, npmrc2) {
29071
29092
 
29072
29093
  // src/prepare.js
29073
29094
  async function readJson(path26) {
29074
- return JSON.parse(await fs7.readFile(path26));
29095
+ return JSON.parse(await fs7.readFile(path26, "utf8"));
29075
29096
  }
29076
29097
  async function updateLernaJson(basePath, context) {
29077
29098
  const {
@@ -29231,7 +29252,7 @@ var GITLAB_PIPELINES_PROVIDER_NAME = "GitLab CI/CD";
29231
29252
  // src/get-registry.js
29232
29253
  function getRegistry({ publishConfig: { registry } = {}, name }, { cwd, env }) {
29233
29254
  return registry || env.NPM_CONFIG_REGISTRY || getRegistryUrl(
29234
- name.split("/")[0],
29255
+ name.split("/", 1)[0],
29235
29256
  (0, import_rc.default)(
29236
29257
  "npm",
29237
29258
  { registry: OFFICIAL_REGISTRY },
@@ -34254,7 +34275,7 @@ async function generateNotes(pluginConfig, context) {
34254
34275
  return parsedCommit;
34255
34276
  }
34256
34277
  const [match2, auth, host, path26] = (
34257
- /* eslint-disable-next-line security/detect-unsafe-regex, sonarjs/slow-regex -- technical debt */
34278
+ /* eslint-disable-next-line security/detect-unsafe-regex, sonarjs/slow-regex, regexp/no-super-linear-backtracking -- technical debt */
34258
34279
  /^(?!.+:\/\/)(?:(?<auth>.*)@)?(?<host>.*?):(?<path>.*)$/.exec(repositoryUrl) || []
34259
34280
  );
34260
34281
  const authString = auth ? `${auth}@` : "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-release-lerna",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "semantic-release plugin to publish lerna monorepo packages to npm",
5
5
  "keywords": [
6
6
  "npm",
@@ -41,7 +41,7 @@
41
41
  "@semantic-release/error": "^4.0.0",
42
42
  "conventional-changelog-angular": "^7.0.0 || ^8.0.0",
43
43
  "conventional-changelog-writer": "^7.0.0 || ^8.0.0",
44
- "cosmiconfig": "^9.0.1",
44
+ "cosmiconfig": "^9.0.2",
45
45
  "libnpmversion": "^8.0.4",
46
46
  "registry-auth-token": "^5.1.1"
47
47
  },
@@ -55,5 +55,11 @@
55
55
  "publishConfig": {
56
56
  "access": "public",
57
57
  "provenance": true
58
+ },
59
+ "allowScripts": {
60
+ "esbuild": true,
61
+ "nx": false,
62
+ "fsevents": false,
63
+ "unrs-resolver": true
58
64
  }
59
65
  }