npm-update-package 4.0.5 → 4.0.7

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/app.js CHANGED
@@ -1,3 +1,3 @@
1
1
  export const name = 'npm-update-package';
2
- export const version = '4.0.5';
2
+ export const version = '4.0.7';
3
3
  export const homepage = 'https://github.com/npm-update-package/npm-update-package';
package/dist/git/Git.js CHANGED
@@ -13,8 +13,8 @@ export class Git {
13
13
  await this.terminal.run('git', 'checkout', '-b', branchName);
14
14
  }
15
15
  async getRemoteUrl() {
16
- const { stdout } = await this.terminal.run('git', 'remote', 'get-url', '--push', 'origin');
17
- return stdout.trim();
16
+ const output = await this.terminal.run('git', 'remote', 'get-url', '--push', 'origin');
17
+ return output.trim();
18
18
  }
19
19
  async push(branchName) {
20
20
  await this.terminal.run('git', 'push', 'origin', branchName);
@@ -1,4 +1,4 @@
1
- import { range } from '../util/range.js';
1
+ import range from 'lodash/range.js';
2
2
  export class GitHub {
3
3
  octokit;
4
4
  constructor(octokit) {
@@ -1,4 +1,4 @@
1
- import { sampleSize } from '../../../util/sampleSize.js';
1
+ import sampleSize from 'lodash/sampleSize.js';
2
2
  export class AssigneesAdder {
3
3
  github;
4
4
  gitRepo;
@@ -1,4 +1,4 @@
1
- import { sampleSize } from '../../../util/sampleSize.js';
1
+ import sampleSize from 'lodash/sampleSize.js';
2
2
  export class ReviewersAdder {
3
3
  github;
4
4
  gitRepo;
@@ -1,5 +1,5 @@
1
+ import { setTimeout } from 'node:timers/promises';
1
2
  import { gte, lte, valid } from 'semver';
2
- import { sleep } from '../../../util/sleep.js';
3
3
  // TODO: Split into multiple classes and functions
4
4
  export class ReleasesFetcher {
5
5
  options;
@@ -34,7 +34,7 @@ export class ReleasesFetcher {
34
34
  const releases = [];
35
35
  for (const [i, tag] of tags.entries()) {
36
36
  if (i > 0) {
37
- await sleep(this.options.fetchInterval);
37
+ await setTimeout(this.options.fetchInterval);
38
38
  }
39
39
  const release = await this.fetchReleaseByTag({
40
40
  gitRepo,
@@ -10,8 +10,8 @@ export class Npm {
10
10
  * @see https://docs.npmjs.com/cli/v8/commands/npm-view
11
11
  */
12
12
  async getVersions(packageName) {
13
- const { stdout } = await this.terminal.run('npm', 'info', packageName, 'versions', '--json');
14
- const versions = JSON.parse(stdout);
13
+ const output = await this.terminal.run('npm', 'info', packageName, 'versions', '--json');
14
+ const versions = JSON.parse(output);
15
15
  if (!isNpmVersions(versions)) {
16
16
  throw new Error(`Failed to parse versions. versions=${JSON.stringify(versions)}`);
17
17
  }
@@ -10,8 +10,8 @@ export class Yarn {
10
10
  * @see https://classic.yarnpkg.com/en/docs/cli/info
11
11
  */
12
12
  async getVersions(packageName) {
13
- const { stdout } = await this.terminal.run('yarn', 'info', packageName, 'versions', '--json');
14
- const versions = JSON.parse(stdout);
13
+ const output = await this.terminal.run('yarn', 'info', packageName, 'versions', '--json');
14
+ const versions = JSON.parse(output);
15
15
  if (!isYarnVersions(versions)) {
16
16
  throw new Error(`Failed to parse versions. versions=${JSON.stringify(versions)}`);
17
17
  }
@@ -1,7 +1,8 @@
1
- import execa from 'execa';
1
+ import { execa } from 'execa';
2
2
  // TODO: Add test
3
3
  export class Terminal {
4
4
  async run(command, ...args) {
5
- return await execa(command, args);
5
+ const { stdout } = await execa(command, args);
6
+ return stdout;
6
7
  }
7
8
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "4.0.5",
3
+ "version": "4.0.7",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -19,12 +19,12 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@octokit/rest": "20.1.1",
22
- "array-shuffle": "2.0.0",
23
22
  "commander": "12.0.0",
24
- "execa": "5.1.1",
23
+ "execa": "9.0.2",
25
24
  "fp-ts": "2.16.5",
26
25
  "http-status-codes": "2.3.0",
27
26
  "io-ts": "2.2.21",
27
+ "lodash": "4.17.21",
28
28
  "log4js": "6.9.1",
29
29
  "mustache": "4.2.0",
30
30
  "npm-check-updates": "16.3.11",
@@ -35,17 +35,19 @@
35
35
  "devDependencies": {
36
36
  "@munierujp/eslint-config-typescript": "44.0.0",
37
37
  "@tsconfig/node20": "20.1.4",
38
+ "@types/lodash": "4.17.1",
38
39
  "@types/mustache": "4.2.5",
39
40
  "@types/node": "20.12.11",
40
41
  "@types/parse-github-url": "1.0.3",
41
42
  "@types/semver": "7.5.8",
42
43
  "eslint": "8.57.0",
44
+ "eslint-config-lodash": "4.0.1",
43
45
  "eslint-plugin-jest": "28.5.0",
44
46
  "jest": "29.7.0",
45
- "npm-run-all": "4.1.5",
46
- "rimraf": "5.0.6",
47
+ "npm-run-all2": "6.1.2",
48
+ "rimraf": "5.0.7",
47
49
  "ts-jest": "29.1.2",
48
- "tsx": "4.9.4",
50
+ "tsx": "4.10.0",
49
51
  "typescript": "5.4.5",
50
52
  "utility-types": "3.11.0"
51
53
  },
@@ -1,5 +0,0 @@
1
- export function* range(start, end) {
2
- for (let i = start; i < end; i++) {
3
- yield i;
4
- }
5
- }
@@ -1,4 +0,0 @@
1
- import shuffle from 'array-shuffle';
2
- export const sampleSize = (array, size) => {
3
- return shuffle(array).slice(0, size);
4
- };
@@ -1,3 +0,0 @@
1
- export const sleep = async (ms) => {
2
- await new Promise(resolve => setTimeout(resolve, ms));
3
- };