update-versions 5.1.3 → 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.
Files changed (2) hide show
  1. package/cli.js +20 -16
  2. package/package.json +4 -4
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 objectPath from "object-path";
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 isOnline from "is-online";
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
- // updateNotifier({ pkg: cli.pkg }).notify();
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(cli.pkg.version);
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((pkg) => {
209
- if (pkg.version === null) {
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] = pkg.version;
218
+ compiledDepNameVersionPairs[singleDepName] = pkg1.version;
215
219
 
216
220
  if (
217
221
  (cli.flags.m || cli.flags.module) &&
218
- pkg.type === "module"
222
+ pkg1.type === "module"
219
223
  ) {
220
- newConfig.noMajorBumping.add(pkg.name);
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",
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",
@@ -72,7 +72,7 @@
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.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.6",
87
- "fs-extra": "^10.0.1",
86
+ "@types/lodash.isplainobject": "^4.0.7",
87
+ "fs-extra": "^10.1.0",
88
88
  "lodash.clonedeep": "^4.5.0"
89
89
  }
90
90
  }