npm-update-package 2.0.2 → 3.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/README.md +1 -1
- package/dist/package.json +13 -13
- package/dist/src/core/OutdatedPackagesProcessor.js +1 -0
- package/dist/src/core/PackageUpdater.js +2 -0
- package/dist/src/git/CommitMessageCreator.js +1 -0
- package/dist/src/git/Git.js +1 -0
- package/dist/src/git/GitConfigInitializer.js +2 -0
- package/dist/src/git/GitRepository.js +4 -0
- package/dist/src/git/GitTransaction.js +3 -0
- package/dist/src/github/GitHub.js +1 -0
- package/dist/src/github/branch/finder/BranchFinder.js +1 -0
- package/dist/src/github/label/creator/LabelCreator.js +2 -0
- package/dist/src/github/pull-request/closer/PullRequestCloser.js +1 -0
- package/dist/src/github/pull-request/closer/PullRequestsCloser.js +1 -0
- package/dist/src/github/pull-request/creator/AssigneesAdder.js +2 -0
- package/dist/src/github/pull-request/creator/GitHubUrlOptimizer.js +1 -0
- package/dist/src/github/pull-request/creator/LabelsAdder.js +3 -0
- package/dist/src/github/pull-request/creator/PackageDiffsSectionCreator.js +1 -0
- package/dist/src/github/pull-request/creator/PullRequestBodyCreator.js +4 -0
- package/dist/src/github/pull-request/creator/PullRequestCreator.js +9 -0
- package/dist/src/github/pull-request/creator/PullRequestTitleCreator.js +1 -0
- package/dist/src/github/pull-request/creator/ReleaseNotesSectionCreator.js +1 -0
- package/dist/src/github/pull-request/creator/ReviewersAdder.js +2 -0
- package/dist/src/github/pull-request/finder/PullRequestFinder.js +1 -0
- package/dist/src/github/releases/fetcher/ReleasesFetcher.js +2 -1
- package/dist/src/npm-check-updates/NpmCheckUpdates.js +1 -0
- package/dist/src/outdated-package-processor/OutdatedPackageProcessorCreator.js +1 -0
- package/dist/src/outdated-package-processor/create/Create.js +6 -0
- package/dist/src/outdated-package-processor/recreate/Recreate.js +8 -0
- package/dist/src/outdated-package-processor/skip/Skip.js +7 -0
- package/dist/src/package-manager/PackageManagerCreator.js +1 -0
- package/dist/src/package-manager/npm/Npm.js +3 -2
- package/dist/src/package-manager/yarn/Yarn.js +3 -2
- package/dist/src/semver/SemVer.js +4 -0
- package/package.json +13 -13
package/README.md
CHANGED
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --project tsconfig.build.json",
|
|
@@ -13,38 +13,38 @@
|
|
|
13
13
|
},
|
|
14
14
|
"bin": "dist/src/bin/npm-update-package.js",
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": ">=
|
|
16
|
+
"node": ">=18"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@octokit/rest": "19.0.
|
|
19
|
+
"@octokit/rest": "19.0.13",
|
|
20
20
|
"array-shuffle": "2.0.0",
|
|
21
|
-
"commander": "
|
|
21
|
+
"commander": "11.0.0",
|
|
22
22
|
"execa": "5.1.1",
|
|
23
|
-
"fp-ts": "2.
|
|
23
|
+
"fp-ts": "2.16.1",
|
|
24
24
|
"http-status-codes": "2.2.0",
|
|
25
25
|
"io-ts": "2.2.20",
|
|
26
26
|
"log4js": "6.9.1",
|
|
27
27
|
"mustache": "4.2.0",
|
|
28
|
-
"node-fetch": "2.6.
|
|
28
|
+
"node-fetch": "2.6.13",
|
|
29
29
|
"npm-check-updates": "16.3.11",
|
|
30
30
|
"parse-github-url": "1.0.2",
|
|
31
|
-
"semver": "7.
|
|
31
|
+
"semver": "7.5.4",
|
|
32
32
|
"type-guards": "0.15.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@npm-update-package/eslint-config-typescript": "2.0.0",
|
|
36
|
-
"@tsconfig/
|
|
36
|
+
"@tsconfig/node18": "18.2.2",
|
|
37
37
|
"@types/mustache": "4.2.2",
|
|
38
|
-
"@types/node": "
|
|
38
|
+
"@types/node": "18.17.15",
|
|
39
39
|
"@types/node-fetch": "2.6.4",
|
|
40
40
|
"@types/parse-github-url": "1.0.0",
|
|
41
|
-
"@types/semver": "7.
|
|
41
|
+
"@types/semver": "7.5.1",
|
|
42
42
|
"eslint": "8.39.0",
|
|
43
|
-
"eslint-plugin-jest": "27.2.
|
|
44
|
-
"jest": "29.
|
|
43
|
+
"eslint-plugin-jest": "27.2.3",
|
|
44
|
+
"jest": "29.7.0",
|
|
45
45
|
"npm-run-all": "4.1.5",
|
|
46
46
|
"rimraf": "5.0.1",
|
|
47
|
-
"ts-jest": "29.1.
|
|
47
|
+
"ts-jest": "29.1.1",
|
|
48
48
|
"ts-node": "10.9.1",
|
|
49
49
|
"typescript": "5.0.4",
|
|
50
50
|
"utility-types": "3.10.0"
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.OutdatedPackagesProcessor = void 0;
|
|
4
4
|
const logger_1 = require("../logger");
|
|
5
5
|
class OutdatedPackagesProcessor {
|
|
6
|
+
outdatedPackageProcessor;
|
|
6
7
|
constructor(outdatedPackageProcessor) {
|
|
7
8
|
this.outdatedPackageProcessor = outdatedPackageProcessor;
|
|
8
9
|
}
|
package/dist/src/git/Git.js
CHANGED
|
@@ -8,6 +8,10 @@ const node_url_1 = require("node:url");
|
|
|
8
8
|
const parse_github_url_1 = __importDefault(require("parse-github-url"));
|
|
9
9
|
const HOST_GITHUB = 'github.com';
|
|
10
10
|
class GitRepository {
|
|
11
|
+
url;
|
|
12
|
+
owner;
|
|
13
|
+
name;
|
|
14
|
+
isGitHub;
|
|
11
15
|
constructor({ url, owner, name, isGitHub }) {
|
|
12
16
|
this.url = url;
|
|
13
17
|
this.owner = owner;
|
|
@@ -5,6 +5,8 @@ const logger_1 = require("../../../logger");
|
|
|
5
5
|
const errors_1 = require("../../errors");
|
|
6
6
|
// TODO: Split into multiple classes and functions
|
|
7
7
|
class LabelCreator {
|
|
8
|
+
github;
|
|
9
|
+
gitRepo;
|
|
8
10
|
constructor({ github, gitRepo }) {
|
|
9
11
|
this.github = github;
|
|
10
12
|
this.gitRepo = gitRepo;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PullRequestsCloser = void 0;
|
|
4
4
|
const logger_1 = require("../../../logger");
|
|
5
5
|
class PullRequestsCloser {
|
|
6
|
+
pullRequestCloser;
|
|
6
7
|
constructor(pullRequestCloser) {
|
|
7
8
|
this.pullRequestCloser = pullRequestCloser;
|
|
8
9
|
}
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AssigneesAdder = void 0;
|
|
4
4
|
const util_1 = require("../../../util");
|
|
5
5
|
class AssigneesAdder {
|
|
6
|
+
github;
|
|
7
|
+
gitRepo;
|
|
6
8
|
constructor({ github, gitRepo }) {
|
|
7
9
|
this.github = github;
|
|
8
10
|
this.gitRepo = gitRepo;
|
|
@@ -3,6 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.LabelsAdder = void 0;
|
|
4
4
|
const DEFAULT_LABELS = ['npm-update-package'];
|
|
5
5
|
class LabelsAdder {
|
|
6
|
+
options;
|
|
7
|
+
github;
|
|
8
|
+
gitRepo;
|
|
6
9
|
constructor({ options, github, gitRepo }) {
|
|
7
10
|
this.options = options;
|
|
8
11
|
this.github = github;
|
|
@@ -9,6 +9,10 @@ const createNotesSection_1 = require("./createNotesSection");
|
|
|
9
9
|
const createOutdatedPackagesTable_1 = require("./createOutdatedPackagesTable");
|
|
10
10
|
// TODO: Split into multiple classes and functions
|
|
11
11
|
class PullRequestBodyCreator {
|
|
12
|
+
options;
|
|
13
|
+
releasesFetcher;
|
|
14
|
+
packageDiffsSectionCreator;
|
|
15
|
+
releaseNotesSectionCreator;
|
|
12
16
|
constructor({ options, releasesFetcher, packageDiffsSectionCreator, releaseNotesSectionCreator }) {
|
|
13
17
|
this.options = options;
|
|
14
18
|
this.releasesFetcher = releasesFetcher;
|
|
@@ -3,6 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.PullRequestCreator = void 0;
|
|
4
4
|
const logger_1 = require("../../../logger");
|
|
5
5
|
class PullRequestCreator {
|
|
6
|
+
options;
|
|
7
|
+
github;
|
|
8
|
+
gitRepo;
|
|
9
|
+
githubRepo;
|
|
10
|
+
pullRequestTitleCreator;
|
|
11
|
+
pullRequestBodyCreator;
|
|
12
|
+
labelsAdder;
|
|
13
|
+
assigneesAdder;
|
|
14
|
+
reviewersAdder;
|
|
6
15
|
constructor({ options, github, gitRepo, githubRepo, pullRequestTitleCreator, pullRequestBodyCreator, labelsAdder, assigneesAdder, reviewersAdder }) {
|
|
7
16
|
this.options = options;
|
|
8
17
|
this.github = github;
|
|
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ReviewersAdder = void 0;
|
|
4
4
|
const util_1 = require("../../../util");
|
|
5
5
|
class ReviewersAdder {
|
|
6
|
+
github;
|
|
7
|
+
gitRepo;
|
|
6
8
|
constructor({ github, gitRepo }) {
|
|
7
9
|
this.github = github;
|
|
8
10
|
this.gitRepo = gitRepo;
|
|
@@ -4,6 +4,7 @@ exports.PullRequestFinder = void 0;
|
|
|
4
4
|
const metadata_1 = require("../metadata");
|
|
5
5
|
const isPullRequestByNpmUpdatePackage_1 = require("./isPullRequestByNpmUpdatePackage");
|
|
6
6
|
class PullRequestFinder {
|
|
7
|
+
pullRequests;
|
|
7
8
|
constructor(pullRequests) {
|
|
8
9
|
this.pullRequests = pullRequests;
|
|
9
10
|
}
|
|
@@ -4,12 +4,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.ReleasesFetcher = void 0;
|
|
7
|
-
// TODO [engine:node@>=18]: Replace with global fetch and remove node-fetch from dependencies when the minimum supported Node.js version becomes v18 or later.
|
|
8
7
|
const node_fetch_1 = __importDefault(require("node-fetch"));
|
|
9
8
|
const semver_1 = require("semver");
|
|
10
9
|
const util_1 = require("../../../util");
|
|
11
10
|
// TODO: Split into multiple classes and functions
|
|
12
11
|
class ReleasesFetcher {
|
|
12
|
+
options;
|
|
13
|
+
packageManager;
|
|
13
14
|
constructor({ options, packageManager }) {
|
|
14
15
|
this.options = options;
|
|
15
16
|
this.packageManager = packageManager;
|
|
@@ -6,6 +6,7 @@ const OutdatedPullRequestStrategy_1 = require("./OutdatedPullRequestStrategy");
|
|
|
6
6
|
const recreate_1 = require("./recreate");
|
|
7
7
|
const skip_1 = require("./skip");
|
|
8
8
|
class OutdatedPackageProcessorCreator {
|
|
9
|
+
options;
|
|
9
10
|
constructor(options) {
|
|
10
11
|
this.options = options;
|
|
11
12
|
}
|
|
@@ -6,6 +6,12 @@ const git_1 = require("../../git");
|
|
|
6
6
|
const logger_1 = require("../../logger");
|
|
7
7
|
// TODO: Add test
|
|
8
8
|
class Create {
|
|
9
|
+
git;
|
|
10
|
+
packageManager;
|
|
11
|
+
pullRequestCreator;
|
|
12
|
+
branchFinder;
|
|
13
|
+
commitMessageCreator;
|
|
14
|
+
packageUpdater;
|
|
9
15
|
constructor({ git, packageManager, pullRequestCreator, branchFinder, commitMessageCreator, packageUpdater }) {
|
|
10
16
|
this.git = git;
|
|
11
17
|
this.packageManager = packageManager;
|
|
@@ -6,6 +6,14 @@ const git_1 = require("../../git");
|
|
|
6
6
|
const logger_1 = require("../../logger");
|
|
7
7
|
// TODO: Add test
|
|
8
8
|
class Recreate {
|
|
9
|
+
git;
|
|
10
|
+
packageManager;
|
|
11
|
+
pullRequestCreator;
|
|
12
|
+
branchFinder;
|
|
13
|
+
commitMessageCreator;
|
|
14
|
+
packageUpdater;
|
|
15
|
+
pullRequestFinder;
|
|
16
|
+
pullRequestsCloser;
|
|
9
17
|
constructor({ git, packageManager, pullRequestCreator, branchFinder, commitMessageCreator, packageUpdater, pullRequestFinder, pullRequestsCloser }) {
|
|
10
18
|
this.git = git;
|
|
11
19
|
this.packageManager = packageManager;
|
|
@@ -6,6 +6,13 @@ const git_1 = require("../../git");
|
|
|
6
6
|
const logger_1 = require("../../logger");
|
|
7
7
|
// TODO: Add test
|
|
8
8
|
class Skip {
|
|
9
|
+
git;
|
|
10
|
+
packageManager;
|
|
11
|
+
pullRequestCreator;
|
|
12
|
+
branchFinder;
|
|
13
|
+
commitMessageCreator;
|
|
14
|
+
packageUpdater;
|
|
15
|
+
pullRequestFinder;
|
|
9
16
|
constructor({ git, packageManager, pullRequestCreator, branchFinder, commitMessageCreator, packageUpdater, pullRequestFinder }) {
|
|
10
17
|
this.git = git;
|
|
11
18
|
this.packageManager = packageManager;
|
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Npm = void 0;
|
|
4
4
|
const NpmVersions_1 = require("./NpmVersions");
|
|
5
5
|
class Npm {
|
|
6
|
+
terminal;
|
|
7
|
+
packageFile = 'package.json';
|
|
8
|
+
lockFile = 'package-lock.json';
|
|
6
9
|
constructor(terminal) {
|
|
7
10
|
this.terminal = terminal;
|
|
8
|
-
this.packageFile = 'package.json';
|
|
9
|
-
this.lockFile = 'package-lock.json';
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* @see https://docs.npmjs.com/cli/v8/commands/npm-view
|
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Yarn = void 0;
|
|
4
4
|
const YarnVersions_1 = require("./YarnVersions");
|
|
5
5
|
class Yarn {
|
|
6
|
+
terminal;
|
|
7
|
+
packageFile = 'package.json';
|
|
8
|
+
lockFile = 'yarn.lock';
|
|
6
9
|
constructor(terminal) {
|
|
7
10
|
this.terminal = terminal;
|
|
8
|
-
this.packageFile = 'package.json';
|
|
9
|
-
this.lockFile = 'yarn.lock';
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* @see https://classic.yarnpkg.com/en/docs/cli/info
|
|
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.SemVer = void 0;
|
|
4
4
|
const semver_1 = require("semver");
|
|
5
5
|
class SemVer {
|
|
6
|
+
version;
|
|
7
|
+
major;
|
|
8
|
+
minor;
|
|
9
|
+
patch;
|
|
6
10
|
constructor({ version, major, minor, patch }) {
|
|
7
11
|
this.version = version;
|
|
8
12
|
this.major = major;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.1",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --project tsconfig.build.json",
|
|
@@ -13,38 +13,38 @@
|
|
|
13
13
|
},
|
|
14
14
|
"bin": "dist/src/bin/npm-update-package.js",
|
|
15
15
|
"engines": {
|
|
16
|
-
"node": ">=
|
|
16
|
+
"node": ">=18"
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@octokit/rest": "19.0.
|
|
19
|
+
"@octokit/rest": "19.0.13",
|
|
20
20
|
"array-shuffle": "2.0.0",
|
|
21
|
-
"commander": "
|
|
21
|
+
"commander": "11.0.0",
|
|
22
22
|
"execa": "5.1.1",
|
|
23
|
-
"fp-ts": "2.
|
|
23
|
+
"fp-ts": "2.16.1",
|
|
24
24
|
"http-status-codes": "2.2.0",
|
|
25
25
|
"io-ts": "2.2.20",
|
|
26
26
|
"log4js": "6.9.1",
|
|
27
27
|
"mustache": "4.2.0",
|
|
28
|
-
"node-fetch": "2.6.
|
|
28
|
+
"node-fetch": "2.6.13",
|
|
29
29
|
"npm-check-updates": "16.3.11",
|
|
30
30
|
"parse-github-url": "1.0.2",
|
|
31
|
-
"semver": "7.
|
|
31
|
+
"semver": "7.5.4",
|
|
32
32
|
"type-guards": "0.15.0"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@npm-update-package/eslint-config-typescript": "2.0.0",
|
|
36
|
-
"@tsconfig/
|
|
36
|
+
"@tsconfig/node18": "18.2.2",
|
|
37
37
|
"@types/mustache": "4.2.2",
|
|
38
|
-
"@types/node": "
|
|
38
|
+
"@types/node": "18.17.15",
|
|
39
39
|
"@types/node-fetch": "2.6.4",
|
|
40
40
|
"@types/parse-github-url": "1.0.0",
|
|
41
|
-
"@types/semver": "7.
|
|
41
|
+
"@types/semver": "7.5.1",
|
|
42
42
|
"eslint": "8.39.0",
|
|
43
|
-
"eslint-plugin-jest": "27.2.
|
|
44
|
-
"jest": "29.
|
|
43
|
+
"eslint-plugin-jest": "27.2.3",
|
|
44
|
+
"jest": "29.7.0",
|
|
45
45
|
"npm-run-all": "4.1.5",
|
|
46
46
|
"rimraf": "5.0.1",
|
|
47
|
-
"ts-jest": "29.1.
|
|
47
|
+
"ts-jest": "29.1.1",
|
|
48
48
|
"ts-node": "10.9.1",
|
|
49
49
|
"typescript": "5.0.4",
|
|
50
50
|
"utility-types": "3.10.0"
|