update-versions 5.2.12 → 6.0.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/CHANGELOG.md +8 -2
- package/cli.js +40 -32
- package/package.json +14 -8
package/CHANGELOG.md
CHANGED
|
@@ -3,13 +3,19 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
## 6.0.0 (2022-12-01)
|
|
7
|
+
|
|
8
|
+
### BREAKING CHANGES
|
|
9
|
+
|
|
10
|
+
- Minimum supported Node version is v14.18; we're dropping v12 support
|
|
11
|
+
|
|
12
|
+
## 5.2.0 (2022-08-12)
|
|
7
13
|
|
|
8
14
|
### Features
|
|
9
15
|
|
|
10
16
|
- export types ([11b5fb9](https://github.com/codsen/codsen/commit/11b5fb936ce20e0a77c3a09806773e1cd7695c50))
|
|
11
17
|
|
|
12
|
-
|
|
18
|
+
## 5.1.0 (2022-04-11)
|
|
13
19
|
|
|
14
20
|
### Features
|
|
15
21
|
|
package/cli.js
CHANGED
|
@@ -36,7 +36,7 @@ const cli = meow(
|
|
|
36
36
|
$ upd YOURFILE.json
|
|
37
37
|
|
|
38
38
|
Options:
|
|
39
|
-
-m, --module
|
|
39
|
+
-m, --module Blacklist against bumping major any type=module packages
|
|
40
40
|
-h, --help Shows this help
|
|
41
41
|
-v, --version Shows the current installed version
|
|
42
42
|
`,
|
|
@@ -93,11 +93,10 @@ if (cli.flags) {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
let confLocation = "./upd.config.json";
|
|
96
|
-
let config;
|
|
97
96
|
let newConfig = {
|
|
98
97
|
noMajorBumping: [],
|
|
98
|
+
pin: {},
|
|
99
99
|
};
|
|
100
|
-
newConfig.noMajorBumping = new Set(newConfig.noMajorBumping);
|
|
101
100
|
|
|
102
101
|
let online = await isOnline();
|
|
103
102
|
if (!online) {
|
|
@@ -109,9 +108,7 @@ if (cli.flags) {
|
|
|
109
108
|
|
|
110
109
|
// try to read the local config if it's present
|
|
111
110
|
try {
|
|
112
|
-
|
|
113
|
-
newConfig = Object.assign({}, newConfig, config);
|
|
114
|
-
newConfig.noMajorBumping = new Set(newConfig.noMajorBumping);
|
|
111
|
+
newConfig = JSON.parse(readFileSync(confLocation, "utf8"));
|
|
115
112
|
} catch (err) {
|
|
116
113
|
console.log(
|
|
117
114
|
`\n${messagePrefix}${`\u001b[${90}m${`No config found, moving on.`}\u001b[${39}m`}\n`
|
|
@@ -221,7 +218,7 @@ if (cli.flags) {
|
|
|
221
218
|
(cli.flags.m || cli.flags.module) &&
|
|
222
219
|
pkg1.type === "module"
|
|
223
220
|
) {
|
|
224
|
-
newConfig.noMajorBumping.
|
|
221
|
+
newConfig.noMajorBumping.push(pkg1.name);
|
|
225
222
|
}
|
|
226
223
|
}
|
|
227
224
|
});
|
|
@@ -301,12 +298,27 @@ if (cli.flags) {
|
|
|
301
298
|
? "workspace:"
|
|
302
299
|
: "";
|
|
303
300
|
|
|
304
|
-
if (
|
|
301
|
+
if (Array.isArray(newConfig?.pin) && newConfig.pin[singleDepName]) {
|
|
302
|
+
finalContents = set(
|
|
303
|
+
finalContents,
|
|
304
|
+
`dependencies.${singleDepName}`,
|
|
305
|
+
newConfig.pin[singleDepName]
|
|
306
|
+
);
|
|
307
|
+
amended = true;
|
|
308
|
+
if (
|
|
309
|
+
!Object.prototype.hasOwnProperty.call(
|
|
310
|
+
updatedPackages,
|
|
311
|
+
singleDepName
|
|
312
|
+
)
|
|
313
|
+
) {
|
|
314
|
+
updatedPackages[singleDepName] = newConfig.pin[singleDepName];
|
|
315
|
+
}
|
|
316
|
+
} else if (
|
|
305
317
|
compiledDepNameVersionPairs[singleDepName] !== null &&
|
|
306
318
|
singleDepValue !==
|
|
307
319
|
`${workspacePrefix}^${compiledDepNameVersionPairs[singleDepName]}` &&
|
|
308
320
|
// either dependency is not blacklisted (so we don't care)
|
|
309
|
-
(!newConfig.noMajorBumping.
|
|
321
|
+
(!newConfig.noMajorBumping.includes(singleDepName) ||
|
|
310
322
|
// or it is blacklisted but the bump is within the same major semver digit
|
|
311
323
|
major(compiledDepNameVersionPairs[singleDepName]) ===
|
|
312
324
|
major(singleDepValue))
|
|
@@ -323,9 +335,8 @@ if (cli.flags) {
|
|
|
323
335
|
singleDepName
|
|
324
336
|
)
|
|
325
337
|
) {
|
|
326
|
-
updatedPackages[
|
|
327
|
-
singleDepName
|
|
328
|
-
] = `${compiledDepNameVersionPairs[singleDepName]}`;
|
|
338
|
+
updatedPackages[singleDepName] =
|
|
339
|
+
compiledDepNameVersionPairs[singleDepName];
|
|
329
340
|
}
|
|
330
341
|
}
|
|
331
342
|
|
|
@@ -383,12 +394,27 @@ if (cli.flags) {
|
|
|
383
394
|
? "workspace:"
|
|
384
395
|
: "";
|
|
385
396
|
|
|
386
|
-
if (
|
|
397
|
+
if (Array.isArray(newConfig?.pin) && newConfig.pin[singleDepName]) {
|
|
398
|
+
finalContents = set(
|
|
399
|
+
finalContents,
|
|
400
|
+
`dependencies.${singleDepName}`,
|
|
401
|
+
newConfig.pin[singleDepName]
|
|
402
|
+
);
|
|
403
|
+
amended = true;
|
|
404
|
+
if (
|
|
405
|
+
!Object.prototype.hasOwnProperty.call(
|
|
406
|
+
updatedPackages,
|
|
407
|
+
singleDepName
|
|
408
|
+
)
|
|
409
|
+
) {
|
|
410
|
+
updatedPackages[singleDepName] = newConfig.pin[singleDepName];
|
|
411
|
+
}
|
|
412
|
+
} else if (
|
|
387
413
|
compiledDepNameVersionPairs[singleDepName] !== null &&
|
|
388
414
|
singleDepValue !==
|
|
389
415
|
`${workspacePrefix}^${compiledDepNameVersionPairs[singleDepName]}` &&
|
|
390
416
|
// either dependency is not blacklisted (so we don't care)
|
|
391
|
-
(!newConfig.noMajorBumping.
|
|
417
|
+
(!newConfig.noMajorBumping.includes(singleDepName) ||
|
|
392
418
|
// or it is blacklisted but the bump is within the same major semver digit
|
|
393
419
|
major(compiledDepNameVersionPairs[singleDepName]) ===
|
|
394
420
|
major(singleDepValue))
|
|
@@ -457,22 +483,4 @@ if (cli.flags) {
|
|
|
457
483
|
diff.pipe(process.stdout);
|
|
458
484
|
|
|
459
485
|
await allProgressPromise;
|
|
460
|
-
|
|
461
|
-
// write the config back
|
|
462
|
-
if (
|
|
463
|
-
config &&
|
|
464
|
-
JSON.stringify(newConfig, null, 0) !== JSON.stringify(config, null, 0)
|
|
465
|
-
) {
|
|
466
|
-
newConfig.noMajorBumping = [...newConfig.noMajorBumping].sort();
|
|
467
|
-
try {
|
|
468
|
-
await write(
|
|
469
|
-
confLocation,
|
|
470
|
-
`${JSON.stringify(newConfig, null, 2).trim()}\n`
|
|
471
|
-
);
|
|
472
|
-
} catch (e) {
|
|
473
|
-
console.error(
|
|
474
|
-
`${messagePrefix}error happened when writing upd.config.json:\n${e}`
|
|
475
|
-
);
|
|
476
|
-
}
|
|
477
|
-
}
|
|
478
486
|
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "update-versions",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1",
|
|
4
4
|
"description": "Like npm-check-updates but supports Lerna monorepos and enforces strict semver values",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"app",
|
|
@@ -44,16 +44,22 @@
|
|
|
44
44
|
"cjs-off": "exit 0",
|
|
45
45
|
"cjs-on": "exit 0",
|
|
46
46
|
"dev": "exit 0",
|
|
47
|
+
"devtest": "npm run test",
|
|
48
|
+
"dts": "exit 0",
|
|
49
|
+
"examples": "exit 0",
|
|
47
50
|
"lect": "node '../../ops/lect/lect.js'",
|
|
48
|
-
"letspublish": "
|
|
51
|
+
"letspublish": "npm publish || :",
|
|
49
52
|
"lint": "eslint . --ext .js --ext .ts --fix",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
+
"perf": "exit 0",
|
|
54
|
+
"prep": "echo 'ready'",
|
|
55
|
+
"prettier": "prettier",
|
|
56
|
+
"prettier:format": "npm run prettier -- --write '**/*.{js,md}' --no-error-on-unmatched-pattern --loglevel 'silent'",
|
|
57
|
+
"pretest": "echo 0",
|
|
58
|
+
"test": "c8 npm run unit && npm run lint",
|
|
53
59
|
"unit": "uvu test"
|
|
54
60
|
},
|
|
55
61
|
"engines": {
|
|
56
|
-
"node": "
|
|
62
|
+
"node": ">=14.18.0"
|
|
57
63
|
},
|
|
58
64
|
"c8": {
|
|
59
65
|
"check-coverage": false,
|
|
@@ -70,7 +76,7 @@
|
|
|
70
76
|
},
|
|
71
77
|
"dependencies": {
|
|
72
78
|
"ansi-diff-stream": "^1.2.1",
|
|
73
|
-
"edit-package-json": "^0.
|
|
79
|
+
"edit-package-json": "^0.8.1",
|
|
74
80
|
"globby": "^13.1.2",
|
|
75
81
|
"is-online": "^10.0.0",
|
|
76
82
|
"lodash.isplainobject": "^4.0.6",
|
|
@@ -86,7 +92,7 @@
|
|
|
86
92
|
},
|
|
87
93
|
"devDependencies": {
|
|
88
94
|
"@types/lodash.isplainobject": "^4.0.7",
|
|
89
|
-
"fs-extra": "^
|
|
95
|
+
"fs-extra": "^11.1.0",
|
|
90
96
|
"lodash.clonedeep": "^4.5.0"
|
|
91
97
|
}
|
|
92
98
|
}
|