update-versions 5.1.1 → 5.1.4
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/cli.js +20 -16
- package/package.json +5 -5
package/cli.js
CHANGED
|
@@ -3,19 +3,23 @@
|
|
|
3
3
|
// VARS
|
|
4
4
|
// -----------------------------------------------------------------------------
|
|
5
5
|
|
|
6
|
-
import { promises, readFileSync } from "fs";
|
|
7
|
-
import write from "write-file-atomic";
|
|
8
|
-
import { globby } from "globby";
|
|
9
|
-
import pReduce from "p-reduce";
|
|
10
|
-
import pProgress, { PProgress } from "p-progress";
|
|
11
6
|
import meow from "meow";
|
|
12
|
-
// import updateNotifier from "update-notifier";
|
|
13
|
-
import isObj from "lodash.isplainobject";
|
|
14
7
|
import pacote from "pacote";
|
|
15
|
-
import
|
|
8
|
+
import pReduce from "p-reduce";
|
|
9
|
+
import { globby } from "globby";
|
|
10
|
+
import isOnline from "is-online";
|
|
16
11
|
import diff1 from "ansi-diff-stream";
|
|
12
|
+
import objectPath from "object-path";
|
|
13
|
+
import write from "write-file-atomic";
|
|
14
|
+
import { createRequire } from "module";
|
|
15
|
+
import isObj from "lodash.isplainobject";
|
|
16
|
+
import { promises, readFileSync } from "fs";
|
|
17
17
|
import { set, del } from "edit-package-json";
|
|
18
|
-
import
|
|
18
|
+
import updateNotifier from "update-notifier";
|
|
19
|
+
import pProgress, { PProgress } from "p-progress";
|
|
20
|
+
|
|
21
|
+
const require1 = createRequire(import.meta.url);
|
|
22
|
+
const pkg = require1("./package.json");
|
|
19
23
|
|
|
20
24
|
const { readFile } = promises;
|
|
21
25
|
const diff = diff1();
|
|
@@ -40,13 +44,13 @@ const cli = meow(
|
|
|
40
44
|
importMeta: import.meta,
|
|
41
45
|
}
|
|
42
46
|
);
|
|
43
|
-
|
|
47
|
+
updateNotifier({ pkg }).notify();
|
|
44
48
|
|
|
45
49
|
// Step #0. take care of -v and -h flags that are left out in meow.
|
|
46
50
|
// -----------------------------------------------------------------------------
|
|
47
51
|
|
|
48
52
|
if (cli.flags.v) {
|
|
49
|
-
log(
|
|
53
|
+
log(pkg.version);
|
|
50
54
|
process.exit(0);
|
|
51
55
|
} else if (cli.flags.h) {
|
|
52
56
|
log(cli.help);
|
|
@@ -205,19 +209,19 @@ if (cli.flags) {
|
|
|
205
209
|
.manifest(singleDepName, {
|
|
206
210
|
fullMetadata: true,
|
|
207
211
|
})
|
|
208
|
-
.then((
|
|
209
|
-
if (
|
|
212
|
+
.then((pkg1) => {
|
|
213
|
+
if (pkg1.version === null) {
|
|
210
214
|
throw new Error(
|
|
211
215
|
`${messagePrefix}${singleDepName} version from npm came as null, CLI will exit now, nothing was written.`
|
|
212
216
|
);
|
|
213
217
|
} else {
|
|
214
|
-
compiledDepNameVersionPairs[singleDepName] =
|
|
218
|
+
compiledDepNameVersionPairs[singleDepName] = pkg1.version;
|
|
215
219
|
|
|
216
220
|
if (
|
|
217
221
|
(cli.flags.m || cli.flags.module) &&
|
|
218
|
-
|
|
222
|
+
pkg1.type === "module"
|
|
219
223
|
) {
|
|
220
|
-
newConfig.noMajorBumping.add(
|
|
224
|
+
newConfig.noMajorBumping.add(pkg1.name);
|
|
221
225
|
}
|
|
222
226
|
}
|
|
223
227
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "update-versions",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.4",
|
|
4
4
|
"description": "Like npm-check-updates but supports Lerna monorepos and enforces strict semver values",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -68,11 +68,11 @@
|
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
70
|
"ansi-diff-stream": "^1.2.1",
|
|
71
|
-
"edit-package-json": "^0.6.
|
|
71
|
+
"edit-package-json": "^0.6.3",
|
|
72
72
|
"globby": "^13.1.1",
|
|
73
73
|
"is-online": "^9.0.1",
|
|
74
74
|
"lodash.isplainobject": "^4.0.6",
|
|
75
|
-
"log-update": "^5.0.
|
|
75
|
+
"log-update": "^5.0.1",
|
|
76
76
|
"meow": "^10.1.2",
|
|
77
77
|
"object-path": "^0.11.8",
|
|
78
78
|
"p-map": "^5.3.0",
|
|
@@ -83,8 +83,8 @@
|
|
|
83
83
|
"write-file-atomic": "^4.0.1"
|
|
84
84
|
},
|
|
85
85
|
"devDependencies": {
|
|
86
|
-
"@types/lodash.isplainobject": "^4.0.
|
|
87
|
-
"fs-extra": "^10.0
|
|
86
|
+
"@types/lodash.isplainobject": "^4.0.7",
|
|
87
|
+
"fs-extra": "^10.1.0",
|
|
88
88
|
"lodash.clonedeep": "^4.5.0"
|
|
89
89
|
}
|
|
90
90
|
}
|