update-versions 5.0.6 → 5.0.12

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.
Files changed (4) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +2 -6
  3. package/cli.js +21 -21
  4. package/package.json +22 -46
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2010-2021 Roy Revelt and other contributors
3
+ Copyright (c) 2010-2022 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
@@ -26,8 +26,6 @@
26
26
 
27
27
  ## Install
28
28
 
29
- This package is ESM only: Node 12+ is needed to use it and it must be imported instead of required:
30
-
31
29
  ```bash
32
30
  npm i -g update-versions
33
31
  ```
@@ -40,7 +38,7 @@ upd
40
38
 
41
39
  ## Documentation
42
40
 
43
- Please [visit codsen.com](https://codsen.com/os/update-versions/) for a full description of the API and examples.
41
+ Please [visit codsen.com](https://codsen.com/os/update-versions/) for a full description of the API.
44
42
 
45
43
  ## Contributing
46
44
 
@@ -50,8 +48,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
50
48
 
51
49
  MIT License
52
50
 
53
- Copyright (c) 2010-2021 Roy Revelt and other contributors
54
-
55
- uses adapted p-progress, MIT Licence, Copyright (c) Sindre Sorhus https://github.com/sindresorhus/p-progress/blob/master/license
51
+ Copyright (c) 2010-2022 Roy Revelt and other contributors
56
52
 
57
53
  <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">
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
- const updatedPackages = {};
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
- const confLocation = "./upd.config.json";
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
- const online = await isOnline();
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
- const pathsPromise = await globby([
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
- const parsedContents = JSON.parse(packContentsStr);
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
- const allProgressPromise = PProgress.all(
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
- const parsedContents = pathsPromise.contentsObj[oneOfPaths];
158
+ let parsedContents = pathsPromise.contentsObj[oneOfPaths];
159
159
 
160
- const totalDeps = (
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
- const compiledDepNameVersionPairs = {};
194
- const allProgressPromise2 = PProgress.all(
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
- const keys = Object.keys(parsedContents.dependencies);
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
- const newVal = parsedContents.lect.various.devDependencies.filter(
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
- const singleDepName = keys[y];
292
- const singleDepValue = parsedContents.dependencies[keys[y]];
291
+ let singleDepName = keys[y];
292
+ let singleDepValue = parsedContents.dependencies[keys[y]];
293
293
  if (singleDepValue.startsWith("file:")) {
294
294
  continue;
295
295
  }
296
- const workspacePrefix = singleDepValue.startsWith("workspace:")
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
- const singleDepName = keys[y];
374
- const singleDepValue = parsedContents.devDependencies[keys[y]];
373
+ let singleDepName = keys[y];
374
+ let singleDepValue = parsedContents.devDependencies[keys[y]];
375
375
  if (singleDepValue.startsWith("file:")) {
376
376
  continue;
377
377
  }
378
- const workspacePrefix = singleDepValue.startsWith("workspace:")
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.6",
3
+ "version": "5.0.12",
4
4
  "description": "Like npm-check-updates but supports Lerna monorepos and enforces strict semver values",
5
5
  "keywords": [
6
6
  "app",
@@ -40,48 +40,36 @@
40
40
  "upd": "cli.js"
41
41
  },
42
42
  "scripts": {
43
- "build": "echo 'skip build step for a CLI'",
44
- "ci_test": "npm run format && tap --no-only --reporter=silent",
45
- "clean_cov": "../../scripts/leaveCoverageTotalOnly.js",
46
- "dev": "echo\"\"",
47
- "devunittest": "npm run dev && tap --only -R 'base'",
48
- "format": "npm run lect && npm run prettier && npm run lint",
49
- "lect": "lect",
50
- "lint": "../../node_modules/eslint/bin/eslint.js . --ext .js --fix --config \"../../.eslintrc.json\" --quiet",
51
- "prettier": "../../node_modules/prettier/bin-prettier.js '*.{js,css,scss,vue,md,ts}' --write --loglevel silent",
52
- "republish": "npm publish || :",
53
- "tap": "tap",
54
- "test": "npm run test:ci",
55
- "test:ci": "npm run lint && npm run unittest && npm run format",
56
- "unittest": "tap --no-only --reporter=terse"
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
+ "prettier:format": "prettier --write '**/*.{js,md}' --no-error-on-unmatched-pattern",
50
+ "test": "c8 yarn run unit && yarn run lint",
51
+ "unit": "uvu test"
57
52
  },
58
- "tap": {
53
+ "engines": {
54
+ "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
55
+ },
56
+ "c8": {
59
57
  "check-coverage": false,
60
- "node-arg": [
61
- "--no-warnings",
62
- "--experimental-loader",
63
- "@istanbuljs/esm-loader-hook"
64
- ],
65
- "timeout": 0
58
+ "exclude": [
59
+ "**/test/**/*.*"
60
+ ]
66
61
  },
67
62
  "lect": {
68
63
  "licence": {
69
64
  "extras": [
70
- "uses adapted p-progress, MIT Licence, Copyright (c) Sindre Sorhus https://github.com/sindresorhus/p-progress/blob/master/license"
71
- ]
72
- },
73
- "various": {
74
- "devDependencies": [
75
- "@types/lodash.isplainobject",
76
- "fs-extra",
77
- "lodash.clonedeep"
65
+ ""
78
66
  ]
79
67
  }
80
68
  },
81
69
  "dependencies": {
82
70
  "ansi-diff-stream": "^1.2.1",
83
- "edit-package-json": "^0.5.6",
84
- "globby": "^12.0.2",
71
+ "edit-package-json": "^0.5.12",
72
+ "globby": "^12.2.0",
85
73
  "is-online": "^9.0.1",
86
74
  "lodash.isplainobject": "^4.0.6",
87
75
  "log-update": "^5.0.0",
@@ -92,23 +80,11 @@
92
80
  "p-reduce": "^3.0.0",
93
81
  "pacote": "^12.0.2",
94
82
  "update-notifier": "^5.1.0",
95
- "write-file-atomic": "^3.0.3"
83
+ "write-file-atomic": "^4.0.0"
96
84
  },
97
85
  "devDependencies": {
98
- "@istanbuljs/esm-loader-hook": "^0.1.2",
99
86
  "@types/lodash.isplainobject": "^4.0.6",
100
- "core-js": "^3.19.1",
101
- "cross-env": "^7.0.3",
102
- "eslint": "^8.3.0",
103
- "execa": "^6.0.0",
104
87
  "fs-extra": "^10.0.0",
105
- "lect": "^0.18.6",
106
- "lodash.clonedeep": "^4.5.0",
107
- "tap": "^15.1.2",
108
- "tempy": "^2.0.0",
109
- "tslib": "^2.3.1"
110
- },
111
- "engines": {
112
- "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
88
+ "lodash.clonedeep": "^4.5.0"
113
89
  }
114
90
  }