@jsenv/monorepo 0.2.20 → 0.3.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.
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsenv/monorepo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Helpers to manage packages in a monorepo",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/jsenv/core",
|
|
9
|
-
"directory": "packages/
|
|
9
|
+
"directory": "packages/tooling/monorepo"
|
|
10
10
|
},
|
|
11
11
|
"engines": {
|
|
12
12
|
"node": ">=20.0.0"
|
|
@@ -26,10 +26,10 @@
|
|
|
26
26
|
"/src/"
|
|
27
27
|
],
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@jsenv/urls": "2.7.
|
|
30
|
-
"@jsenv/filesystem": "4.15.
|
|
31
|
-
"@jsenv/package-publish": "1.11.
|
|
32
|
-
"@jsenv/humanize": "1.5.
|
|
29
|
+
"@jsenv/urls": "2.7.4",
|
|
30
|
+
"@jsenv/filesystem": "4.15.2",
|
|
31
|
+
"@jsenv/package-publish": "1.11.30",
|
|
32
|
+
"@jsenv/humanize": "1.5.2",
|
|
33
33
|
"semver": "7.7.1"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -4,8 +4,14 @@ const require = createRequire(import.meta.url);
|
|
|
4
4
|
// https://github.com/npm/node-semver#readme
|
|
5
5
|
const { parse, inc } = require("semver");
|
|
6
6
|
|
|
7
|
-
export const increaseVersion = (version) => {
|
|
8
|
-
const
|
|
7
|
+
export const increaseVersion = (version, fileUrl) => {
|
|
8
|
+
const result = parse(version);
|
|
9
|
+
if (!result) {
|
|
10
|
+
throw new Error(
|
|
11
|
+
`unable to increase version ${version}${fileUrl ? ` for ${fileUrl}` : ``}`,
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
const { prerelease } = result;
|
|
9
15
|
if (prerelease.length === 0) {
|
|
10
16
|
return inc(version, "patch");
|
|
11
17
|
}
|
|
@@ -137,12 +137,15 @@ Use a tool like "git diff" to see the new versions and ensure this is what you w
|
|
|
137
137
|
to: version,
|
|
138
138
|
});
|
|
139
139
|
if (!toPublishPackageNames.includes(packageName)) {
|
|
140
|
-
updateVersion({
|
|
141
|
-
packageName,
|
|
142
|
-
from: workspacePackage.packageObject.version,
|
|
143
|
-
to: increaseVersion(workspacePackage.packageObject.version),
|
|
144
|
-
});
|
|
145
140
|
if (!workspacePackage.packageObject.private) {
|
|
141
|
+
updateVersion({
|
|
142
|
+
packageName,
|
|
143
|
+
from: workspacePackage.packageObject.version,
|
|
144
|
+
to: increaseVersion(
|
|
145
|
+
workspacePackage.packageObject.version,
|
|
146
|
+
workspacePackage.packageUrl,
|
|
147
|
+
),
|
|
148
|
+
});
|
|
146
149
|
toPublishPackageNames.push(packageName);
|
|
147
150
|
}
|
|
148
151
|
}
|
|
@@ -196,7 +199,10 @@ Use a tool like "git diff" to see the new versions and ensure this is what you w
|
|
|
196
199
|
updateVersion({
|
|
197
200
|
packageName,
|
|
198
201
|
from: packageInfo.packageObject.version,
|
|
199
|
-
to: increaseVersion(
|
|
202
|
+
to: increaseVersion(
|
|
203
|
+
packageInfo.packageObject.version,
|
|
204
|
+
packageInfo.packageUrl,
|
|
205
|
+
),
|
|
200
206
|
});
|
|
201
207
|
}
|
|
202
208
|
});
|
|
@@ -154,6 +154,7 @@ export const upgradeExternalVersions = async ({
|
|
|
154
154
|
someInternalUpdate = true;
|
|
155
155
|
internalPackageObject.version = increaseVersion(
|
|
156
156
|
internalPackageObject.version,
|
|
157
|
+
internalPackageObject.packageUrl,
|
|
157
158
|
);
|
|
158
159
|
}
|
|
159
160
|
internalPackageDeps[externalPackageName] = registryLatestVersion;
|