npm-update-package 0.45.12 → 0.45.15

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/dist/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.45.12",
3
+ "version": "0.45.15",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "badges": "jest-coverage-badges output docs",
7
7
  "build": "tsc --project tsconfig.build.json",
8
8
  "clean": "rimraf dist",
9
9
  "lint": "eslint '**/*.{js,ts}'",
10
- "prebadges": "npm test",
10
+ "posttest": "npm run badges",
11
11
  "prebuild": "npm run clean",
12
12
  "prepare": "husky install",
13
13
  "prepublish": "npm-run-all lint test build",
@@ -19,7 +19,7 @@
19
19
  "@octokit/rest": "18.12.0",
20
20
  "commander": "8.3.0",
21
21
  "execa": "5.1.1",
22
- "fp-ts": "2.11.8",
22
+ "fp-ts": "2.11.9",
23
23
  "http-status-codes": "2.2.0",
24
24
  "io-ts": "2.2.16",
25
25
  "lodash": "4.14.2",
@@ -1,17 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Npm = void 0;
4
- const Versions_1 = require("./Versions");
4
+ const NpmVersions_1 = require("./NpmVersions");
5
5
  class Npm {
6
6
  constructor(terminal) {
7
7
  this.terminal = terminal;
8
8
  this.packageFile = 'package.json';
9
9
  this.lockFile = 'package-lock.json';
10
10
  }
11
+ /**
12
+ * @see https://docs.npmjs.com/cli/v8/commands/npm-view
13
+ */
11
14
  async getVersions(packageName) {
12
15
  const { stdout } = await this.terminal.run('npm', 'info', packageName, 'versions', '--json');
13
16
  const versions = JSON.parse(stdout);
14
- if (!(0, Versions_1.isVersions)(versions)) {
17
+ if (!(0, NpmVersions_1.isNpmVersions)(versions)) {
15
18
  throw new Error(`Failed to parse versions. versions=${JSON.stringify(versions)}`);
16
19
  }
17
20
  return versions;
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isNpmVersions = exports.NpmVersions = void 0;
4
+ const io_ts_1 = require("io-ts");
5
+ exports.NpmVersions = (0, io_ts_1.array)(io_ts_1.string);
6
+ exports.isNpmVersions = exports.NpmVersions.is;
@@ -1,20 +1,23 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.Yarn = void 0;
4
- const Versions_1 = require("./Versions");
4
+ const YarnVersions_1 = require("./YarnVersions");
5
5
  class Yarn {
6
6
  constructor(terminal) {
7
7
  this.terminal = terminal;
8
8
  this.packageFile = 'package.json';
9
9
  this.lockFile = 'yarn.lock';
10
10
  }
11
+ /**
12
+ * @see https://classic.yarnpkg.com/en/docs/cli/info
13
+ */
11
14
  async getVersions(packageName) {
12
15
  const { stdout } = await this.terminal.run('yarn', 'info', packageName, 'versions', '--json');
13
16
  const versions = JSON.parse(stdout);
14
- if (!(0, Versions_1.isVersions)(versions)) {
17
+ if (!(0, YarnVersions_1.isYarnVersions)(versions)) {
15
18
  throw new Error(`Failed to parse versions. versions=${JSON.stringify(versions)}`);
16
19
  }
17
- return versions;
20
+ return versions.data;
18
21
  }
19
22
  /**
20
23
  * @see https://classic.yarnpkg.com/en/docs/cli/install
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isYarnVersions = exports.YarnVersions = void 0;
4
+ const io_ts_1 = require("io-ts");
5
+ exports.YarnVersions = (0, io_ts_1.type)({
6
+ type: io_ts_1.string,
7
+ data: (0, io_ts_1.array)(io_ts_1.string)
8
+ });
9
+ exports.isYarnVersions = exports.YarnVersions.is;
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.45.12",
3
+ "version": "0.45.15",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "badges": "jest-coverage-badges output docs",
7
7
  "build": "tsc --project tsconfig.build.json",
8
8
  "clean": "rimraf dist",
9
9
  "lint": "eslint '**/*.{js,ts}'",
10
- "prebadges": "npm test",
10
+ "posttest": "npm run badges",
11
11
  "prebuild": "npm run clean",
12
12
  "prepare": "husky install",
13
13
  "prepublish": "npm-run-all lint test build",
@@ -19,7 +19,7 @@
19
19
  "@octokit/rest": "18.12.0",
20
20
  "commander": "8.3.0",
21
21
  "execa": "5.1.1",
22
- "fp-ts": "2.11.8",
22
+ "fp-ts": "2.11.9",
23
23
  "http-status-codes": "2.2.0",
24
24
  "io-ts": "2.2.16",
25
25
  "lodash": "4.14.2",
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isVersions = exports.Versions = void 0;
4
- const io_ts_1 = require("io-ts");
5
- exports.Versions = (0, io_ts_1.array)(io_ts_1.string);
6
- exports.isVersions = exports.Versions.is;