@timeax/scaffold 0.0.12 → 0.0.13
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/.vscode/settings.json +0 -1
- package/package.json +4 -2
- package/scripts/postpublish.mjs +16 -6
package/.vscode/settings.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timeax/scaffold",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.13",
|
|
5
5
|
"description": "A CLI tool that scaffolds project file structures based on a user-defined, type-safe configuration file.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"scaffold"
|
|
@@ -22,10 +22,12 @@
|
|
|
22
22
|
"types": "dist/index.d.ts",
|
|
23
23
|
"exports": {
|
|
24
24
|
".": {
|
|
25
|
+
"types": "./dist/index.d.ts",
|
|
25
26
|
"import": "./dist/index.mjs",
|
|
26
27
|
"require": "./dist/index.cjs"
|
|
27
28
|
},
|
|
28
29
|
"./ast": {
|
|
30
|
+
"types": "./dist/ast.d.ts",
|
|
29
31
|
"import": "./dist/ast.mjs",
|
|
30
32
|
"require": "./dist/ast.cjs"
|
|
31
33
|
}
|
|
@@ -55,4 +57,4 @@
|
|
|
55
57
|
"esbuild": "^0.27.0",
|
|
56
58
|
"minimatch": "^10.1.1"
|
|
57
59
|
}
|
|
58
|
-
}
|
|
60
|
+
}
|
package/scripts/postpublish.mjs
CHANGED
|
@@ -11,10 +11,11 @@ function incrementPatch(version) {
|
|
|
11
11
|
throw new Error(`[postpublish] Unsupported version format: "${version}"`);
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
let [majorRaw, minorRaw, patchRaw] = parts;
|
|
15
|
+
|
|
16
|
+
let major = Number(majorRaw);
|
|
17
|
+
let minor = Number(minorRaw);
|
|
18
|
+
let patch = Number(patchRaw);
|
|
18
19
|
|
|
19
20
|
if (Number.isNaN(major) || Number.isNaN(minor) || Number.isNaN(patch)) {
|
|
20
21
|
throw new Error(
|
|
@@ -22,8 +23,17 @@ function incrementPatch(version) {
|
|
|
22
23
|
);
|
|
23
24
|
}
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
// Single-digit patch rule:
|
|
27
|
+
// - If patch >= 9, roll into next minor and reset patch to 0.
|
|
28
|
+
// - Otherwise, just increment patch.
|
|
29
|
+
if (patch >= 9) {
|
|
30
|
+
patch = 0;
|
|
31
|
+
minor += 1;
|
|
32
|
+
} else {
|
|
33
|
+
patch += 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return `${major}.${minor}.${patch}`;
|
|
27
37
|
}
|
|
28
38
|
|
|
29
39
|
function main() {
|