@deot/dev-updater 2.8.0 → 2.9.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/dist/index.cjs +12 -7
- package/dist/index.js +12 -7
- package/package.json +8 -8
package/dist/index.cjs
CHANGED
|
@@ -30,8 +30,7 @@ const path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
|
30
30
|
|
|
31
31
|
const fitVersion = (versions, version, commandOptions) => {
|
|
32
32
|
const vRegex = /([\d]+\.[\d]+\..*)/;
|
|
33
|
-
if (!vRegex.test(version))
|
|
34
|
-
return version;
|
|
33
|
+
if (!vRegex.test(version)) return version;
|
|
35
34
|
const { major = false, minor = false, patch = false } = commandOptions || {};
|
|
36
35
|
const originalPrefix = (version.match(/([^\d]*).*/) || ["", ""])[1];
|
|
37
36
|
const prefix = major ? ">=" : minor ? "^" : patch ? "~" : originalPrefix;
|
|
@@ -140,7 +139,7 @@ class Update {
|
|
|
140
139
|
const locals = devShared.Locals.impl();
|
|
141
140
|
const { cwd } = locals;
|
|
142
141
|
await fs.remove(`${cwd}/node_modules`);
|
|
143
|
-
await devShared.Shell.spawn("npx", ["pnpm", "install", "--lockfile
|
|
142
|
+
await devShared.Shell.spawn("npx", ["pnpm", "install", "--no-frozen-lockfile"]);
|
|
144
143
|
}
|
|
145
144
|
}
|
|
146
145
|
async commit(message) {
|
|
@@ -205,11 +204,17 @@ ${message}`);
|
|
|
205
204
|
devShared.Logger.log(`${chalk.cyan(key)}: ${chalk.yellow(version)} -> ${chalk.green(changed[key][version])}`);
|
|
206
205
|
});
|
|
207
206
|
});
|
|
208
|
-
const { all } = this.commandOptions;
|
|
207
|
+
const { all, changeLog } = this.commandOptions;
|
|
209
208
|
let packageFolderNames = await this.updatePackageOptions(changed);
|
|
210
209
|
const hasChanged = packageFolderNames.length;
|
|
211
210
|
packageFolderNames = hasChanged && all ? ["*"] : packageFolderNames;
|
|
212
|
-
|
|
211
|
+
if (changeLog) {
|
|
212
|
+
message = `chore${hasChanged ? "(" : ""}${packageFolderNames.join(",")}${hasChanged ? ")" : ""}: ${message}`;
|
|
213
|
+
} else {
|
|
214
|
+
const locals = devShared.Locals.impl();
|
|
215
|
+
const { workspace } = locals;
|
|
216
|
+
message = `${workspace ? "chore" : "void"}: ${message}`;
|
|
217
|
+
}
|
|
213
218
|
await this.updateLock();
|
|
214
219
|
await this.test();
|
|
215
220
|
await this.commit(message);
|
|
@@ -234,14 +239,14 @@ const run = (options) => devShared.Utils.autoCatch(async () => {
|
|
|
234
239
|
commit: true,
|
|
235
240
|
push: true,
|
|
236
241
|
test: true,
|
|
242
|
+
changeLog: true,
|
|
237
243
|
major: false,
|
|
238
244
|
minor: false,
|
|
239
245
|
patch: false,
|
|
240
246
|
all: false,
|
|
241
247
|
...options
|
|
242
248
|
};
|
|
243
|
-
if (process.env.NODE_ENV === "UNIT")
|
|
244
|
-
return devShared.Shell.spawn(`echo update`);
|
|
249
|
+
if (process.env.NODE_ENV === "UNIT") return devShared.Shell.spawn(`echo update`);
|
|
245
250
|
await update(options).process();
|
|
246
251
|
}, {
|
|
247
252
|
onError: (e) => {
|
package/dist/index.js
CHANGED
|
@@ -7,8 +7,7 @@ import semver from 'semver';
|
|
|
7
7
|
|
|
8
8
|
const fitVersion = (versions, version, commandOptions) => {
|
|
9
9
|
const vRegex = /([\d]+\.[\d]+\..*)/;
|
|
10
|
-
if (!vRegex.test(version))
|
|
11
|
-
return version;
|
|
10
|
+
if (!vRegex.test(version)) return version;
|
|
12
11
|
const { major = false, minor = false, patch = false } = commandOptions || {};
|
|
13
12
|
const originalPrefix = (version.match(/([^\d]*).*/) || ["", ""])[1];
|
|
14
13
|
const prefix = major ? ">=" : minor ? "^" : patch ? "~" : originalPrefix;
|
|
@@ -117,7 +116,7 @@ class Update {
|
|
|
117
116
|
const locals = Locals.impl();
|
|
118
117
|
const { cwd } = locals;
|
|
119
118
|
await fs.remove(`${cwd}/node_modules`);
|
|
120
|
-
await Shell.spawn("npx", ["pnpm", "install", "--lockfile
|
|
119
|
+
await Shell.spawn("npx", ["pnpm", "install", "--no-frozen-lockfile"]);
|
|
121
120
|
}
|
|
122
121
|
}
|
|
123
122
|
async commit(message) {
|
|
@@ -182,11 +181,17 @@ ${message}`);
|
|
|
182
181
|
Logger.log(`${chalk.cyan(key)}: ${chalk.yellow(version)} -> ${chalk.green(changed[key][version])}`);
|
|
183
182
|
});
|
|
184
183
|
});
|
|
185
|
-
const { all } = this.commandOptions;
|
|
184
|
+
const { all, changeLog } = this.commandOptions;
|
|
186
185
|
let packageFolderNames = await this.updatePackageOptions(changed);
|
|
187
186
|
const hasChanged = packageFolderNames.length;
|
|
188
187
|
packageFolderNames = hasChanged && all ? ["*"] : packageFolderNames;
|
|
189
|
-
|
|
188
|
+
if (changeLog) {
|
|
189
|
+
message = `chore${hasChanged ? "(" : ""}${packageFolderNames.join(",")}${hasChanged ? ")" : ""}: ${message}`;
|
|
190
|
+
} else {
|
|
191
|
+
const locals = Locals.impl();
|
|
192
|
+
const { workspace } = locals;
|
|
193
|
+
message = `${workspace ? "chore" : "void"}: ${message}`;
|
|
194
|
+
}
|
|
190
195
|
await this.updateLock();
|
|
191
196
|
await this.test();
|
|
192
197
|
await this.commit(message);
|
|
@@ -211,14 +216,14 @@ const run = (options) => Utils.autoCatch(async () => {
|
|
|
211
216
|
commit: true,
|
|
212
217
|
push: true,
|
|
213
218
|
test: true,
|
|
219
|
+
changeLog: true,
|
|
214
220
|
major: false,
|
|
215
221
|
minor: false,
|
|
216
222
|
patch: false,
|
|
217
223
|
all: false,
|
|
218
224
|
...options
|
|
219
225
|
};
|
|
220
|
-
if (process.env.NODE_ENV === "UNIT")
|
|
221
|
-
return Shell.spawn(`echo update`);
|
|
226
|
+
if (process.env.NODE_ENV === "UNIT") return Shell.spawn(`echo update`);
|
|
222
227
|
await update(options).process();
|
|
223
228
|
}, {
|
|
224
229
|
onError: (e) => {
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deot/dev-updater",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
9
10
|
"import": "./dist/index.js",
|
|
10
|
-
"require": "./dist/index.cjs"
|
|
11
|
-
"types": "./dist/index.d.ts"
|
|
11
|
+
"require": "./dist/index.cjs"
|
|
12
12
|
}
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@deot/dev-shared": "^2.
|
|
23
|
-
"chalk": "^5.
|
|
24
|
-
"fs-extra": "^11.
|
|
25
|
-
"ora": "^
|
|
26
|
-
"semver": "^7.
|
|
22
|
+
"@deot/dev-shared": "^2.9.1",
|
|
23
|
+
"chalk": "^5.4.1",
|
|
24
|
+
"fs-extra": "^11.3.0",
|
|
25
|
+
"ora": "^8.2.0",
|
|
26
|
+
"semver": "^7.7.1"
|
|
27
27
|
}
|
|
28
28
|
}
|