update-versions 5.0.4 → 5.0.10
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/CHANGELOG.md +0 -10
- package/LICENSE +1 -1
- package/README.md +4 -3
- package/cli.js +21 -21
- package/package.json +20 -47
package/CHANGELOG.md
CHANGED
|
@@ -9,16 +9,6 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
|
|
|
9
9
|
|
|
10
10
|
- update the API to match the updated p-progress ([8aa235c](https://github.com/codsen/codsen/commit/8aa235c8ced8daefcfdab14e380d9765f980ef8d))
|
|
11
11
|
|
|
12
|
-
## 5.0.3 (2021-11-02)
|
|
13
|
-
|
|
14
|
-
### Features
|
|
15
|
-
|
|
16
|
-
- migrate to ES Modules ([c579dff](https://github.com/codsen/codsen/commit/c579dff3b23205e383035ca10ddcec671e35d0fe))
|
|
17
|
-
|
|
18
|
-
### BREAKING CHANGES
|
|
19
|
-
|
|
20
|
-
- programs now are in ES Modules and won't work with Common JS require()
|
|
21
|
-
|
|
22
12
|
## 5.0.0 (2021-09-09)
|
|
23
13
|
|
|
24
14
|
### Features
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2010
|
|
3
|
+
Copyright (c) 2010-2021 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -32,15 +32,16 @@ This package is ESM only: Node 12+ is needed to use it and it must be imported i
|
|
|
32
32
|
npm i -g update-versions
|
|
33
33
|
```
|
|
34
34
|
|
|
35
|
+
|
|
36
|
+
|
|
35
37
|
Then, call it from the command line using keyword:
|
|
36
38
|
|
|
37
39
|
```bash
|
|
38
40
|
upd
|
|
39
41
|
```
|
|
40
|
-
|
|
41
42
|
## Documentation
|
|
42
43
|
|
|
43
|
-
Please [visit codsen.com](https://codsen.com/os/update-versions/) for a full description of the API
|
|
44
|
+
Please [visit codsen.com](https://codsen.com/os/update-versions/) for a full description of the API.
|
|
44
45
|
|
|
45
46
|
## Contributing
|
|
46
47
|
|
|
@@ -52,6 +53,6 @@ MIT License
|
|
|
52
53
|
|
|
53
54
|
Copyright (c) 2010-2021 Roy Revelt and other contributors
|
|
54
55
|
|
|
55
|
-
uses adapted p-progress, MIT Licence, Copyright (c) Sindre Sorhus https://github.com/sindresorhus/p-progress/blob/master/license
|
|
56
56
|
|
|
57
57
|
<img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center">
|
|
58
|
+
|
package/cli.js
CHANGED
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
// -----------------------------------------------------------------------------
|
|
5
5
|
|
|
6
6
|
import { promises, readFileSync } from "fs";
|
|
7
|
-
const { readFile } = promises;
|
|
8
7
|
import write from "write-file-atomic";
|
|
9
8
|
import { globby } from "globby";
|
|
10
9
|
import pReduce from "p-reduce";
|
|
@@ -15,11 +14,12 @@ import isObj from "lodash.isplainobject";
|
|
|
15
14
|
import pacote from "pacote";
|
|
16
15
|
import objectPath from "object-path";
|
|
17
16
|
import diff1 from "ansi-diff-stream";
|
|
18
|
-
const diff = diff1();
|
|
19
|
-
|
|
20
17
|
import { set, del } from "edit-package-json";
|
|
21
18
|
import isOnline from "is-online";
|
|
22
19
|
|
|
20
|
+
const { readFile } = promises;
|
|
21
|
+
const diff = diff1();
|
|
22
|
+
|
|
23
23
|
const { log } = console;
|
|
24
24
|
const sparkles = "\u2728"; // https://emojipedia.org/sparkles/
|
|
25
25
|
const messagePrefix = `\u001b[${90}m${`${sparkles} update-versions: `}\u001b[${39}m`;
|
|
@@ -74,7 +74,7 @@ if (cli.flags) {
|
|
|
74
74
|
|
|
75
75
|
(async () => {
|
|
76
76
|
// we'll use the object below to distill all unique package updates
|
|
77
|
-
|
|
77
|
+
let updatedPackages = {};
|
|
78
78
|
function printUpdated() {
|
|
79
79
|
return Object.keys(updatedPackages)
|
|
80
80
|
.sort()
|
|
@@ -88,14 +88,14 @@ if (cli.flags) {
|
|
|
88
88
|
return versNum;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
|
|
91
|
+
let confLocation = "./upd.config.json";
|
|
92
92
|
let config;
|
|
93
93
|
let newConfig = {
|
|
94
94
|
noMajorBumping: [],
|
|
95
95
|
};
|
|
96
96
|
newConfig.noMajorBumping = new Set(newConfig.noMajorBumping);
|
|
97
97
|
|
|
98
|
-
|
|
98
|
+
let online = await isOnline();
|
|
99
99
|
if (!online) {
|
|
100
100
|
console.error(
|
|
101
101
|
`\n${messagePrefix}${`\u001b[${31}m${`Please check your internet connection.`}\u001b[${39}m`}\n`
|
|
@@ -114,7 +114,7 @@ if (cli.flags) {
|
|
|
114
114
|
);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
let pathsPromise = await globby([
|
|
118
118
|
"**/package.json",
|
|
119
119
|
"!**/node_modules/**",
|
|
120
120
|
"!**/test/**",
|
|
@@ -124,7 +124,7 @@ if (cli.flags) {
|
|
|
124
124
|
(mapReceived, currentPath) =>
|
|
125
125
|
readFile(currentPath, "utf8")
|
|
126
126
|
.then((packContentsStr) => {
|
|
127
|
-
|
|
127
|
+
let parsedContents = JSON.parse(packContentsStr);
|
|
128
128
|
mapReceived.namesList.push(parsedContents.name);
|
|
129
129
|
mapReceived.pathsList.push(currentPath);
|
|
130
130
|
mapReceived.pathsByName[parsedContents.name] = currentPath;
|
|
@@ -148,16 +148,16 @@ if (cli.flags) {
|
|
|
148
148
|
)
|
|
149
149
|
);
|
|
150
150
|
|
|
151
|
-
|
|
151
|
+
let allProgressPromise = PProgress.all(
|
|
152
152
|
pathsPromise.pathsList.map((oneOfPaths) =>
|
|
153
153
|
pProgress(async (progress) => {
|
|
154
154
|
// call progress() like progress(0.14);
|
|
155
155
|
|
|
156
156
|
let amended = false;
|
|
157
157
|
let finalContents = pathsPromise.contentsStr[oneOfPaths];
|
|
158
|
-
|
|
158
|
+
let parsedContents = pathsPromise.contentsObj[oneOfPaths];
|
|
159
159
|
|
|
160
|
-
|
|
160
|
+
let totalDeps = (
|
|
161
161
|
isObj(parsedContents.dependencies)
|
|
162
162
|
? Object.keys(parsedContents.dependencies)
|
|
163
163
|
: []
|
|
@@ -190,8 +190,8 @@ if (cli.flags) {
|
|
|
190
190
|
// this is the first 75% of per-package progress
|
|
191
191
|
// https://github.com/sindresorhus/p-progress#pprogressallpromises-options
|
|
192
192
|
|
|
193
|
-
|
|
194
|
-
|
|
193
|
+
let compiledDepNameVersionPairs = {};
|
|
194
|
+
let allProgressPromise2 = PProgress.all(
|
|
195
195
|
totalDeps.map(async (singleDepName) => {
|
|
196
196
|
if (pathsPromise.namesList.includes(singleDepName)) {
|
|
197
197
|
compiledDepNameVersionPairs[singleDepName] =
|
|
@@ -259,7 +259,7 @@ if (cli.flags) {
|
|
|
259
259
|
//
|
|
260
260
|
|
|
261
261
|
if (isObj(parsedContents.dependencies)) {
|
|
262
|
-
|
|
262
|
+
let keys = Object.keys(parsedContents.dependencies);
|
|
263
263
|
for (let y = 0, len2 = keys.length; y < len2; y++) {
|
|
264
264
|
// delete this dependency from lect.various.devDependencies if present
|
|
265
265
|
// ---------------------
|
|
@@ -269,7 +269,7 @@ if (cli.flags) {
|
|
|
269
269
|
parsedContents.lect.various.devDependencies.includes(keys[y])
|
|
270
270
|
) {
|
|
271
271
|
let foundIdx;
|
|
272
|
-
|
|
272
|
+
let newVal = parsedContents.lect.various.devDependencies.filter(
|
|
273
273
|
(dep, z) => {
|
|
274
274
|
if (dep === keys[y]) {
|
|
275
275
|
foundIdx = z;
|
|
@@ -288,12 +288,12 @@ if (cli.flags) {
|
|
|
288
288
|
// tackle the deps list:
|
|
289
289
|
// ---------------------
|
|
290
290
|
|
|
291
|
-
|
|
292
|
-
|
|
291
|
+
let singleDepName = keys[y];
|
|
292
|
+
let singleDepValue = parsedContents.dependencies[keys[y]];
|
|
293
293
|
if (singleDepValue.startsWith("file:")) {
|
|
294
294
|
continue;
|
|
295
295
|
}
|
|
296
|
-
|
|
296
|
+
let workspacePrefix = singleDepValue.startsWith("workspace:")
|
|
297
297
|
? "workspace:"
|
|
298
298
|
: "";
|
|
299
299
|
|
|
@@ -370,12 +370,12 @@ if (cli.flags) {
|
|
|
370
370
|
});
|
|
371
371
|
}
|
|
372
372
|
for (let y = 0, len2 = keys.length; y < len2; y++) {
|
|
373
|
-
|
|
374
|
-
|
|
373
|
+
let singleDepName = keys[y];
|
|
374
|
+
let singleDepValue = parsedContents.devDependencies[keys[y]];
|
|
375
375
|
if (singleDepValue.startsWith("file:")) {
|
|
376
376
|
continue;
|
|
377
377
|
}
|
|
378
|
-
|
|
378
|
+
let workspacePrefix = singleDepValue.startsWith("workspace:")
|
|
379
379
|
? "workspace:"
|
|
380
380
|
: "";
|
|
381
381
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "update-versions",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.10",
|
|
4
4
|
"description": "Like npm-check-updates but supports Lerna monorepos and enforces strict semver values",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -40,54 +40,39 @@
|
|
|
40
40
|
"upd": "cli.js"
|
|
41
41
|
},
|
|
42
42
|
"scripts": {
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"republish": "npm publish || :",
|
|
52
|
-
"tap": "tap",
|
|
53
|
-
"test": "npm run lint && npm run unittest && npm run format",
|
|
54
|
-
"unittest": "tap --no-only --output-file=testStats.md --reporter=terse && npm run clean_cov"
|
|
43
|
+
"build": "echo 'no build needed'",
|
|
44
|
+
"dev": "echo 'no build needed'",
|
|
45
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
46
|
+
"letspublish": "yarn publish || :",
|
|
47
|
+
"lint": "eslint . --fix",
|
|
48
|
+
"prepare": "echo 'ready'",
|
|
49
|
+
"test": "c8 yarn run unit && yarn run lint",
|
|
50
|
+
"unit": "uvu test"
|
|
55
51
|
},
|
|
56
|
-
"
|
|
52
|
+
"engines": {
|
|
53
|
+
"node": "^12.20.0 || ^14.13.1 || >=16.0.0"
|
|
54
|
+
},
|
|
55
|
+
"c8": {
|
|
57
56
|
"check-coverage": false,
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
|
|
61
|
-
],
|
|
62
|
-
"node-arg": [
|
|
63
|
-
"--no-warnings",
|
|
64
|
-
"--experimental-loader",
|
|
65
|
-
"@istanbuljs/esm-loader-hook"
|
|
66
|
-
],
|
|
67
|
-
"timeout": 0
|
|
57
|
+
"exclude": [
|
|
58
|
+
"**/test/**/*.*"
|
|
59
|
+
]
|
|
68
60
|
},
|
|
69
61
|
"lect": {
|
|
70
62
|
"licence": {
|
|
71
63
|
"extras": [
|
|
72
|
-
"
|
|
73
|
-
]
|
|
74
|
-
},
|
|
75
|
-
"various": {
|
|
76
|
-
"devDependencies": [
|
|
77
|
-
"@types/lodash.isplainobject",
|
|
78
|
-
"fs-extra",
|
|
79
|
-
"lodash.clonedeep"
|
|
64
|
+
""
|
|
80
65
|
]
|
|
81
66
|
}
|
|
82
67
|
},
|
|
83
68
|
"dependencies": {
|
|
84
69
|
"ansi-diff-stream": "^1.2.1",
|
|
85
|
-
"edit-package-json": "^0.5.
|
|
70
|
+
"edit-package-json": "^0.5.10",
|
|
86
71
|
"globby": "^12.0.2",
|
|
87
72
|
"is-online": "^9.0.1",
|
|
88
73
|
"lodash.isplainobject": "^4.0.6",
|
|
89
74
|
"log-update": "^5.0.0",
|
|
90
|
-
"meow": "^10.1.
|
|
75
|
+
"meow": "^10.1.2",
|
|
91
76
|
"object-path": "^0.11.8",
|
|
92
77
|
"p-map": "^5.3.0",
|
|
93
78
|
"p-progress": "^0.6.0",
|
|
@@ -97,20 +82,8 @@
|
|
|
97
82
|
"write-file-atomic": "^3.0.3"
|
|
98
83
|
},
|
|
99
84
|
"devDependencies": {
|
|
100
|
-
"@istanbuljs/esm-loader-hook": "^0.1.2",
|
|
101
85
|
"@types/lodash.isplainobject": "^4.0.6",
|
|
102
|
-
"core-js": "^3.19.1",
|
|
103
|
-
"cross-env": "^7.0.3",
|
|
104
|
-
"eslint": "^8.1.0",
|
|
105
|
-
"execa": "^5.1.1",
|
|
106
86
|
"fs-extra": "^10.0.0",
|
|
107
|
-
"
|
|
108
|
-
"lodash.clonedeep": "^4.5.0",
|
|
109
|
-
"tap": "^15.0.10",
|
|
110
|
-
"tempy": "^2.0.0",
|
|
111
|
-
"tslib": "^2.3.1"
|
|
112
|
-
},
|
|
113
|
-
"engines": {
|
|
114
|
-
"node": ">=12"
|
|
87
|
+
"lodash.clonedeep": "^4.5.0"
|
|
115
88
|
}
|
|
116
89
|
}
|