semantic-release-lerna 0.7.3 → 0.8.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.
package/README.md CHANGED
@@ -77,7 +77,7 @@ To use legacy auth set `NPM_USERNAME`, `NPM_PASSWORD` and `NPM_EMAIL`.
77
77
  | Option | Description | Default |
78
78
  | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------- |
79
79
  | `npmVerifyAuth` | Set to `false` to disable verifying NPM registry credentials. | `true` |
80
- | `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", "none"` | `"minor"` |
80
+ | `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"` |
81
81
  | `rootVersion` | Allow to update version on root `package.json`. | `true` |
82
82
 
83
83
  ## Troubleshooting
@@ -89,7 +89,7 @@ function collectUpdates(filteredPackages, packageGraph, execOptions, commandOpti
89
89
  }
90
90
 
91
91
  /**
92
- * @param {"major" | "minor" | "patch" | "none"} latch
92
+ * @param {"major" | "minor" | "patch" | "prerelease" | "none"} latch
93
93
  * @param {any} context
94
94
  * @returns {Promise<any[]>}
95
95
  */
@@ -1,12 +1,14 @@
1
+ /* eslint-disable security/detect-unsafe-regex */
1
2
  const latchMajor = /^\d+\.0\.0$/;
2
3
  const latchMinor = /^\d+\.\d+\.0$/;
3
- const latchPatch = /^\d+\.\d\.\d+$/;
4
+ const latchPatch = /^\d+\.\d+\.\d+$/;
5
+ const latchPrerelease = /^\d+\.\d+\.\d+(-(.*\.)?\d+)?$/;
4
6
 
5
7
  /**
6
8
  * Returns true if version should be latched together
7
9
  *
8
10
  * @param {string} version
9
- * @param {"major" | "minor" | "patch" | "none"} latch
11
+ * @param {"major" | "minor" | "patch" | "prerelease" | "none"} latch
10
12
  * @returns {boolean}
11
13
  */
12
14
  function shouldLatch(version, latch) {
@@ -17,6 +19,8 @@ function shouldLatch(version, latch) {
17
19
  return latchMinor.test(version);
18
20
  case "patch":
19
21
  return latchPatch.test(version);
22
+ case "prerelease":
23
+ return latchPrerelease.test(version);
20
24
  default:
21
25
  return false;
22
26
  }
@@ -3,7 +3,7 @@
3
3
  const semver = require("semver");
4
4
  const shouldLatch = require("./should-latch");
5
5
 
6
- const version = "1.0.0";
6
+ const version = "1.10.10";
7
7
 
8
8
  describe("latch none", () => {
9
9
  it.each`
@@ -56,3 +56,16 @@ describe("latch patch", () => {
56
56
  expect(shouldLatch(next, "patch")).toBe(result);
57
57
  });
58
58
  });
59
+
60
+ describe("latch prerelease", () => {
61
+ it.each`
62
+ bump | result | version | next
63
+ ${"major"} | ${true} | ${version} | ${semver.inc(version, "major")}
64
+ ${"minor"} | ${true} | ${version} | ${semver.inc(version, "minor")}
65
+ ${"patch"} | ${true} | ${version} | ${semver.inc(version, "patch")}
66
+ ${"prerelease"} | ${true} | ${version} | ${semver.inc(version, "prerelease")}
67
+ `("should return $result when version bump is $bump ($version -> $next)", ({ result, next }) => {
68
+ expect.assertions(1);
69
+ expect(shouldLatch(next, "prerelease")).toBe(result);
70
+ });
71
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "semantic-release-lerna",
3
- "version": "0.7.3",
3
+ "version": "0.8.1",
4
4
  "description": "semantic-release plugin to publish lerna monorepo packages to npm",
5
5
  "keywords": [
6
6
  "npm",
@@ -68,18 +68,18 @@
68
68
  "write-json-file": "^4.0.0"
69
69
  },
70
70
  "devDependencies": {
71
- "@html-validate/eslint-config": "5.5.19",
71
+ "@html-validate/eslint-config": "5.5.27",
72
72
  "@html-validate/eslint-config-jest": "5.5.18",
73
- "@html-validate/prettier-config": "2.3.3",
73
+ "@html-validate/prettier-config": "2.3.6",
74
74
  "@semantic-release/npm": "9.0.2",
75
- "@types/jest": "29.2.5",
75
+ "@types/jest": "29.4.1",
76
76
  "codecov": "3.8.3",
77
77
  "fs-extra": "11.1.0",
78
78
  "got": "11.8.6",
79
- "jest": "29.3.1",
80
- "lerna": "6.4.1",
81
- "prettier": "2.8.3",
82
- "semantic-release": "20.0.2",
79
+ "jest": "29.5.0",
80
+ "lerna": "6.5.1",
81
+ "prettier": "2.8.4",
82
+ "semantic-release": "20.1.1",
83
83
  "stream-buffers": "3.0.2",
84
84
  "verdaccio": "5.19.1"
85
85
  },