@frsource/release-it-config 1.4.0 → 1.6.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/monorepoIndependent.cjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frsource/release-it-config",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"main": "index.cjs",
|
|
5
5
|
"types": "index.d.cts",
|
|
6
6
|
"type": "module",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"globals": "^15.0.0",
|
|
12
12
|
"release-it": "^17.2.0",
|
|
13
13
|
"typescript": "^5.4.5",
|
|
14
|
-
"@frsource/eslint-config": "1.
|
|
15
|
-
"@frsource/prettier-config": "1.
|
|
14
|
+
"@frsource/eslint-config": "1.3.0",
|
|
15
|
+
"@frsource/prettier-config": "1.3.0"
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {
|
|
18
18
|
"release-it": ">= 17"
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"publishConfig": {
|
|
32
32
|
"access": "public"
|
|
33
33
|
},
|
|
34
|
-
"packageManager": "pnpm@8.
|
|
34
|
+
"packageManager": "pnpm@8.15.7",
|
|
35
35
|
"keywords": [
|
|
36
36
|
"release-it",
|
|
37
37
|
"release-it config"
|
package/version-file-plugin.mjs
CHANGED
|
@@ -18,19 +18,41 @@ class VersionFilePlugin extends Plugin {
|
|
|
18
18
|
super(...args);
|
|
19
19
|
this.setContext({ versionFile: path.resolve('./VERSION') });
|
|
20
20
|
}
|
|
21
|
-
|
|
21
|
+
|
|
22
|
+
getVersion() {
|
|
23
|
+
let isFilePresent = true;
|
|
22
24
|
try {
|
|
23
25
|
fs.accessSync(this.getContext('versionFile'));
|
|
24
26
|
} catch {
|
|
25
|
-
|
|
27
|
+
isFilePresent = false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (isFilePresent) {
|
|
31
|
+
const data = fs.readFileSync(this.getContext('versionFile'));
|
|
32
|
+
return data.toString().trim();
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
getIncrement({ latestVersion }) {
|
|
37
|
+
const newVersion = this.getVersion();
|
|
38
|
+
if (!newVersion && this.options.skipReleaseIfNotPresent) {
|
|
39
|
+
throw e('Skipping release: VERSION file not present.', '', false);
|
|
40
|
+
}
|
|
41
|
+
if (latestVersion === newVersion) {
|
|
42
|
+
throw e(
|
|
43
|
+
'Skipping release: version from VERSION file was already released.',
|
|
44
|
+
'',
|
|
45
|
+
false,
|
|
46
|
+
);
|
|
26
47
|
}
|
|
27
48
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
49
|
+
return newVersion || null;
|
|
50
|
+
}
|
|
51
|
+
getIncrementedVersion(...args) {
|
|
52
|
+
return this.getIncrement(...args);
|
|
31
53
|
}
|
|
32
|
-
|
|
33
|
-
return this.
|
|
54
|
+
getIncrementedVersionCI(...args) {
|
|
55
|
+
return this.getIncrement(...args);
|
|
34
56
|
}
|
|
35
57
|
bump(version) {
|
|
36
58
|
this.setContext({ version });
|