@preapexis/pi-kit 1.1.0 → 1.1.2
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/.github/workflows/publish.yml +2 -2
- package/package.json +1 -1
- package/scripts/git-release.mjs +26 -23
package/package.json
CHANGED
package/scripts/git-release.mjs
CHANGED
|
@@ -8,7 +8,7 @@ const rl = readline.createInterface({ input, output });
|
|
|
8
8
|
const message =
|
|
9
9
|
process.env.npm_config_msg ||
|
|
10
10
|
process.argv.slice(2).join(" ") ||
|
|
11
|
-
"chore:
|
|
11
|
+
"chore: update";
|
|
12
12
|
|
|
13
13
|
function run(command, args) {
|
|
14
14
|
console.log(`\n> ${command} ${args.join(" ")}\n`);
|
|
@@ -104,38 +104,41 @@ function updatePackageVersion(nextVersion) {
|
|
|
104
104
|
}
|
|
105
105
|
|
|
106
106
|
try {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
true
|
|
110
|
-
);
|
|
111
|
-
let nextVersion = null;
|
|
107
|
+
const shouldPublish = await askYesNo("Do you want to publish to npm?", false);
|
|
108
|
+
|
|
112
109
|
let tag = null;
|
|
113
110
|
|
|
114
|
-
if (
|
|
115
|
-
const
|
|
116
|
-
|
|
111
|
+
if (shouldPublish) {
|
|
112
|
+
const shouldBump = await askYesNo(
|
|
113
|
+
"Do you want to bump package version?",
|
|
114
|
+
true
|
|
115
|
+
);
|
|
117
116
|
|
|
118
|
-
|
|
119
|
-
|
|
117
|
+
if (shouldBump) {
|
|
118
|
+
const bumpType = await askVersionType();
|
|
119
|
+
const pkg = readJson("package.json");
|
|
120
|
+
const nextVersion = bumpVersion(pkg.version, bumpType);
|
|
120
121
|
|
|
121
|
-
|
|
122
|
+
updatePackageVersion(nextVersion);
|
|
123
|
+
tag = `v${nextVersion}`;
|
|
122
124
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
+
console.log(`\nBumped version to ${nextVersion}\n`);
|
|
126
|
+
} else {
|
|
127
|
+
const pkg = readJson("package.json");
|
|
128
|
+
tag = `v${pkg.version}`;
|
|
125
129
|
|
|
126
|
-
|
|
130
|
+
console.log(`\nUsing existing version tag: ${tag}\n`);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
127
133
|
|
|
128
134
|
run("git", ["add", "."]);
|
|
129
135
|
run("git", ["commit", "-m", `"${message}"`]);
|
|
130
136
|
|
|
131
|
-
if (tag) {
|
|
132
|
-
run("git", ["tag", tag]);
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
if (shouldPublish) {
|
|
138
|
-
run("npm", ["publish", "--access", "public"]);
|
|
137
|
+
if (shouldPublish && tag) {
|
|
138
|
+
run("git", ["tag", "-a", tag, "-m", tag]);
|
|
139
|
+
run("git", ["push", "--follow-tags"]);
|
|
140
|
+
} else {
|
|
141
|
+
run("git", ["push"]);
|
|
139
142
|
}
|
|
140
143
|
|
|
141
144
|
console.log("\nDone.\n");
|