npm-update-package 0.30.0 → 0.31.3
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/.eslintignore +3 -0
- package/.eslintrc.js +23 -0
- package/.github/renovate.json +15 -0
- package/.github/workflows/eslint.yml +14 -0
- package/.github/workflows/test.yml +20 -0
- package/.husky/pre-commit +4 -0
- package/.nvmrc +1 -0
- package/dist/package.json +65 -0
- package/dist/{bin.js → src/bin.js} +6 -3
- package/dist/{core → src/core}/FailedResult.js +0 -0
- package/dist/{core → src/core}/OutdatedPackage.js +0 -0
- package/dist/{core → src/core}/OutdatedPackageProcessor.js +0 -0
- package/dist/{core → src/core}/OutdatedPackagesProcessor.js +0 -0
- package/dist/{core → src/core}/SucceededResult.js +0 -0
- package/dist/{core → src/core}/index.js +0 -0
- package/dist/{file → src/file}/index.js +0 -0
- package/dist/{file → src/file}/readFile.js +0 -0
- package/dist/{git → src/git}/CommitMessageCreator.js +0 -0
- package/dist/{git → src/git}/Git.js +0 -0
- package/dist/{git → src/git}/GitRepository.js +0 -0
- package/dist/{git → src/git}/createBranchName.js +0 -0
- package/dist/{git → src/git}/index.js +0 -0
- package/dist/{github → src/github}/GitHub.js +0 -0
- package/dist/{github → src/github}/branch/finder/BranchFinder.js +0 -0
- package/dist/{github → src/github}/branch/finder/index.js +0 -0
- package/dist/{github → src/github}/branch/index.js +0 -0
- package/dist/{github → src/github}/createGitHub.js +0 -0
- package/dist/{github → src/github}/createOctokit.js +5 -2
- package/dist/{github → src/github}/errors/NotFoundError.js +0 -0
- package/dist/{github → src/github}/errors/index.js +0 -0
- package/dist/{github → src/github}/index.js +0 -0
- package/dist/{github → src/github}/label/creator/LabelCreator.js +0 -0
- package/dist/{github → src/github}/label/creator/index.js +0 -0
- package/dist/{github → src/github}/label/index.js +0 -0
- package/dist/{github → src/github}/pull-request/closer/PullRequestCloser.js +0 -0
- package/dist/{github → src/github}/pull-request/closer/index.js +0 -0
- package/dist/{github → src/github}/pull-request/creator/PullRequestCreator.js +0 -0
- package/dist/{github → src/github}/pull-request/creator/PullRequestTitleCreator.js +0 -0
- package/dist/{github → src/github}/pull-request/creator/createPullRequestBody.js +5 -5
- package/dist/{github → src/github}/pull-request/creator/index.js +0 -0
- package/dist/{github → src/github}/pull-request/finder/PullRequestFinder.js +0 -0
- package/dist/{github → src/github}/pull-request/finder/index.js +0 -0
- package/dist/{github → src/github}/pull-request/finder/isPullRequestByNpmUpdatePackage.js +0 -0
- package/dist/{github → src/github}/pull-request/index.js +0 -0
- package/dist/{github → src/github}/pull-request/metadata/PullRequestMetadata.js +0 -0
- package/dist/{github → src/github}/pull-request/metadata/createPullRequestMetadata.js +5 -2
- package/dist/{github → src/github}/pull-request/metadata/extractPullRequestMetadata.js +0 -0
- package/dist/{github → src/github}/pull-request/metadata/index.js +0 -0
- package/dist/{json → src/json}/index.js +0 -0
- package/dist/{json → src/json}/toJSON.js +0 -0
- package/dist/{logger → src/logger}/LogLevel.js +0 -0
- package/dist/{logger → src/logger}/Logger.js +0 -0
- package/dist/{logger → src/logger}/createLogger.js +0 -0
- package/dist/{logger → src/logger}/index.js +0 -0
- package/dist/{main.js → src/main.js} +0 -0
- package/dist/{ncu → src/ncu}/Ncu.js +0 -0
- package/dist/{ncu → src/ncu}/NcuResult.js +0 -0
- package/dist/{ncu → src/ncu}/index.js +0 -0
- package/dist/{options → src/options}/CLIOption.js +0 -0
- package/dist/{options → src/options}/OptionType.js +0 -0
- package/dist/{options → src/options}/Options.js +0 -0
- package/dist/{options → src/options}/cliOptions.js +0 -0
- package/dist/{options → src/options}/index.js +0 -0
- package/dist/{options → src/options}/initOptions.js +5 -2
- package/dist/{options → src/options}/toCommanderOption.js +0 -0
- package/dist/{package-json → src/package-json}/PackageMetadata.js +0 -0
- package/dist/{package-json → src/package-json}/PackageMetadataDependencies.js +0 -0
- package/dist/{package-json → src/package-json}/index.js +0 -0
- package/dist/{package-json → src/package-json}/parsePackageJson.js +0 -0
- package/dist/{package-manager → src/package-manager}/Npm.js +0 -0
- package/dist/{package-manager → src/package-manager}/PackageManager.js +0 -0
- package/dist/{package-manager → src/package-manager}/PackageManagerName.js +0 -0
- package/dist/{package-manager → src/package-manager}/Yarn.js +0 -0
- package/dist/{package-manager → src/package-manager}/createPackageManager.js +0 -0
- package/dist/{package-manager → src/package-manager}/index.js +0 -0
- package/dist/{semver → src/semver}/SemVer.js +0 -0
- package/dist/{semver → src/semver}/SemVerLevel.js +0 -0
- package/dist/{semver → src/semver}/compareSemVers.js +0 -0
- package/dist/{semver → src/semver}/index.js +0 -0
- package/dist/{terminal → src/terminal}/Terminal.js +0 -0
- package/dist/{terminal → src/terminal}/index.js +0 -0
- package/jest.config.ts +12 -0
- package/lint-staged.config.js +4 -0
- package/npm-update-package.code-workspace +10 -0
- package/package.json +2 -5
- package/src/bin.ts +22 -0
- package/src/core/FailedResult.ts +6 -0
- package/src/core/OutdatedPackage.ts +11 -0
- package/src/core/OutdatedPackageProcessor.ts +136 -0
- package/src/core/OutdatedPackagesProcessor.ts +35 -0
- package/src/core/SucceededResult.ts +7 -0
- package/src/core/index.ts +5 -0
- package/src/file/index.ts +1 -0
- package/src/file/readFile.ts +6 -0
- package/src/git/CommitMessageCreator.test.ts +17 -0
- package/src/git/CommitMessageCreator.ts +19 -0
- package/src/git/Git.ts +59 -0
- package/src/git/GitRepository.test.ts +82 -0
- package/src/git/GitRepository.ts +57 -0
- package/src/git/createBranchName.test.ts +14 -0
- package/src/git/createBranchName.ts +7 -0
- package/src/git/index.ts +4 -0
- package/src/github/GitHub.ts +198 -0
- package/src/github/branch/finder/BranchFinder.test.ts +21 -0
- package/src/github/branch/finder/BranchFinder.ts +9 -0
- package/src/github/branch/finder/index.ts +1 -0
- package/src/github/branch/index.ts +1 -0
- package/src/github/createGitHub.test.ts +16 -0
- package/src/github/createGitHub.ts +17 -0
- package/src/github/createOctokit.test.ts +27 -0
- package/src/github/createOctokit.ts +27 -0
- package/src/github/errors/NotFoundError.ts +11 -0
- package/src/github/errors/index.ts +1 -0
- package/src/github/index.ts +5 -0
- package/src/github/label/creator/LabelCreator.ts +71 -0
- package/src/github/label/creator/index.ts +1 -0
- package/src/github/label/index.ts +1 -0
- package/src/github/pull-request/closer/PullRequestCloser.test.ts +53 -0
- package/src/github/pull-request/closer/PullRequestCloser.ts +21 -0
- package/src/github/pull-request/closer/index.ts +1 -0
- package/src/github/pull-request/creator/PullRequestCreator.test.ts +98 -0
- package/src/github/pull-request/creator/PullRequestCreator.ts +84 -0
- package/src/github/pull-request/creator/PullRequestTitleCreator.test.ts +17 -0
- package/src/github/pull-request/creator/PullRequestTitleCreator.ts +19 -0
- package/src/github/pull-request/creator/createPullRequestBody.test.ts +47 -0
- package/src/github/pull-request/creator/createPullRequestBody.ts +35 -0
- package/src/github/pull-request/creator/index.ts +2 -0
- package/src/github/pull-request/finder/PullRequestFinder.ts +27 -0
- package/src/github/pull-request/finder/index.ts +1 -0
- package/src/github/pull-request/finder/isPullRequestByNpmUpdatePackage.test.ts +24 -0
- package/src/github/pull-request/finder/isPullRequestByNpmUpdatePackage.ts +5 -0
- package/src/github/pull-request/index.ts +3 -0
- package/src/github/pull-request/metadata/PullRequestMetadata.ts +22 -0
- package/src/github/pull-request/metadata/createPullRequestMetadata.test.ts +31 -0
- package/src/github/pull-request/metadata/createPullRequestMetadata.ts +21 -0
- package/src/github/pull-request/metadata/extractPullRequestMetadata.test.ts +53 -0
- package/src/github/pull-request/metadata/extractPullRequestMetadata.ts +21 -0
- package/src/github/pull-request/metadata/index.ts +3 -0
- package/src/json/index.ts +1 -0
- package/src/json/toJSON.test.ts +65 -0
- package/src/json/toJSON.ts +13 -0
- package/src/logger/LogLevel.ts +13 -0
- package/src/logger/Logger.ts +1 -0
- package/src/logger/createLogger.ts +10 -0
- package/src/logger/index.ts +3 -0
- package/src/main.ts +149 -0
- package/src/ncu/Ncu.ts +84 -0
- package/src/ncu/NcuResult.ts +10 -0
- package/src/ncu/index.ts +1 -0
- package/src/options/CLIOption.ts +19 -0
- package/src/options/OptionType.ts +8 -0
- package/src/options/Options.ts +40 -0
- package/src/options/cliOptions.ts +60 -0
- package/src/options/index.ts +2 -0
- package/src/options/initOptions.ts +24 -0
- package/src/options/toCommanderOption.ts +35 -0
- package/src/package-json/PackageMetadata.ts +24 -0
- package/src/package-json/PackageMetadataDependencies.ts +10 -0
- package/src/package-json/index.ts +2 -0
- package/src/package-json/parsePackageJson.ts +15 -0
- package/src/package-manager/Npm.ts +17 -0
- package/src/package-manager/PackageManager.ts +5 -0
- package/src/package-manager/PackageManagerName.ts +8 -0
- package/src/package-manager/Yarn.ts +17 -0
- package/src/package-manager/createPackageManager.test.ts +27 -0
- package/src/package-manager/createPackageManager.ts +20 -0
- package/src/package-manager/index.ts +5 -0
- package/src/semver/SemVer.test.ts +17 -0
- package/src/semver/SemVer.ts +40 -0
- package/src/semver/SemVerLevel.ts +9 -0
- package/src/semver/compareSemVers.test.ts +21 -0
- package/src/semver/compareSemVers.ts +16 -0
- package/src/semver/index.ts +3 -0
- package/src/terminal/Terminal.ts +12 -0
- package/src/terminal/index.ts +1 -0
- package/tsconfig.base.json +7 -0
- package/tsconfig.build.json +12 -0
- package/tsconfig.json +9 -0
- package/dist/app.js +0 -8
package/.eslintignore
ADDED
package/.eslintrc.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
extends: [
|
|
3
|
+
'standard-with-typescript',
|
|
4
|
+
'plugin:jest/recommended'
|
|
5
|
+
],
|
|
6
|
+
plugins: [
|
|
7
|
+
'eslint-plugin-tsdoc'
|
|
8
|
+
],
|
|
9
|
+
parserOptions: {
|
|
10
|
+
project: './tsconfig.json'
|
|
11
|
+
},
|
|
12
|
+
rules: {
|
|
13
|
+
'import/order': ['error', {
|
|
14
|
+
alphabetize: {
|
|
15
|
+
order: 'asc',
|
|
16
|
+
caseInsensitive: true
|
|
17
|
+
}
|
|
18
|
+
}],
|
|
19
|
+
'no-console': 'error',
|
|
20
|
+
'sort-imports': 'off',
|
|
21
|
+
'tsdoc/syntax': 'warn'
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
name: eslint
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
branches: [ master ]
|
|
5
|
+
jobs:
|
|
6
|
+
eslint:
|
|
7
|
+
name: runner / eslint
|
|
8
|
+
runs-on: ubuntu-latest
|
|
9
|
+
steps:
|
|
10
|
+
- uses: actions/checkout@v2
|
|
11
|
+
- name: eslint
|
|
12
|
+
uses: reviewdog/action-eslint@v1
|
|
13
|
+
with:
|
|
14
|
+
reporter: github-pr-check
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
name: test
|
|
2
|
+
on:
|
|
3
|
+
pull_request:
|
|
4
|
+
branches: [ master ]
|
|
5
|
+
jobs:
|
|
6
|
+
test:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
strategy:
|
|
9
|
+
matrix:
|
|
10
|
+
# https://nodejs.org/en/about/releases/
|
|
11
|
+
node-version: ['12', '14', '16']
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v2
|
|
14
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
15
|
+
uses: actions/setup-node@v2
|
|
16
|
+
with:
|
|
17
|
+
node-version: ${{ matrix.node-version }}
|
|
18
|
+
- run: npm ci
|
|
19
|
+
- run: npm run build --if-present
|
|
20
|
+
- run: npm test
|
package/.nvmrc
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
12.20.2
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "npm-update-package",
|
|
3
|
+
"version": "0.31.3",
|
|
4
|
+
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "tsc --project tsconfig.build.json",
|
|
7
|
+
"clean": "rimraf dist",
|
|
8
|
+
"lint": "eslint '**/*.{js,ts}'",
|
|
9
|
+
"prebuild": "npm run clean",
|
|
10
|
+
"prepare": "husky install",
|
|
11
|
+
"prepublish": "npm-run-all lint test build",
|
|
12
|
+
"start": "ts-node src/bin.ts",
|
|
13
|
+
"test": "jest --passWithNoTests"
|
|
14
|
+
},
|
|
15
|
+
"bin": "dist/src/bin.js",
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@octokit/rest": "18.12.0",
|
|
18
|
+
"commander": "8.3.0",
|
|
19
|
+
"execa": "5.1.1",
|
|
20
|
+
"fp-ts": "2.11.8",
|
|
21
|
+
"http-status-codes": "2.2.0",
|
|
22
|
+
"io-ts": "2.2.16",
|
|
23
|
+
"log4js": "6.4.1",
|
|
24
|
+
"mustache": "4.1.0",
|
|
25
|
+
"npm-check-updates": "12.2.1",
|
|
26
|
+
"parse-github-url": "1.0.2",
|
|
27
|
+
"semver": "7.3.5",
|
|
28
|
+
"type-guards": "0.15.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@jest/types": "27.4.2",
|
|
32
|
+
"@tsconfig/node12": "1.0.9",
|
|
33
|
+
"@types/jest": "27.4.0",
|
|
34
|
+
"@types/mustache": "4.1.2",
|
|
35
|
+
"@types/node": "12.20.40",
|
|
36
|
+
"@types/parse-github-url": "1.0.0",
|
|
37
|
+
"@types/semver": "7.3.9",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "5.10.1",
|
|
39
|
+
"eslint": "8.7.0",
|
|
40
|
+
"eslint-config-standard-with-typescript": "21.0.1",
|
|
41
|
+
"eslint-plugin-import": "2.25.4",
|
|
42
|
+
"eslint-plugin-jest": "26.0.0",
|
|
43
|
+
"eslint-plugin-node": "11.1.0",
|
|
44
|
+
"eslint-plugin-promise": "6.0.0",
|
|
45
|
+
"eslint-plugin-tsdoc": "0.2.14",
|
|
46
|
+
"husky": "7.0.4",
|
|
47
|
+
"jest": "27.4.7",
|
|
48
|
+
"lint-staged": "12.3.1",
|
|
49
|
+
"npm-run-all": "4.1.5",
|
|
50
|
+
"rimraf": "3.0.2",
|
|
51
|
+
"ts-jest": "27.1.3",
|
|
52
|
+
"ts-node": "10.4.0",
|
|
53
|
+
"typescript": "4.5.5",
|
|
54
|
+
"utility-types": "3.10.0"
|
|
55
|
+
},
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "https://github.com/npm-update-package/npm-update-package.git"
|
|
59
|
+
},
|
|
60
|
+
"bugs": {
|
|
61
|
+
"url": "https://github.com/npm-update-package/npm-update-package/issues"
|
|
62
|
+
},
|
|
63
|
+
"homepage": "https://github.com/npm-update-package/npm-update-package",
|
|
64
|
+
"license": "MIT"
|
|
65
|
+
}
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
3
6
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
const
|
|
7
|
+
const package_json_1 = __importDefault(require("../package.json"));
|
|
5
8
|
const logger_1 = require("./logger");
|
|
6
9
|
const main_1 = require("./main");
|
|
7
10
|
const options_1 = require("./options");
|
|
8
11
|
const options = (0, options_1.initOptions)();
|
|
9
12
|
const logger = (0, logger_1.createLogger)(options.logLevel);
|
|
10
|
-
logger.info(`Start ${
|
|
13
|
+
logger.info(`Start ${package_json_1.default.name} v${package_json_1.default.version}`);
|
|
11
14
|
(0, main_1.main)({
|
|
12
15
|
options,
|
|
13
16
|
logger
|
|
14
17
|
})
|
|
15
18
|
.then(() => {
|
|
16
|
-
logger.info(`End ${
|
|
19
|
+
logger.info(`End ${package_json_1.default.name} v${package_json_1.default.version}`);
|
|
17
20
|
})
|
|
18
21
|
.catch((error) => {
|
|
19
22
|
logger.fatal(error);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.createOctokit = void 0;
|
|
4
7
|
const rest_1 = require("@octokit/rest");
|
|
5
|
-
const
|
|
8
|
+
const package_json_1 = __importDefault(require("../../package.json"));
|
|
6
9
|
const createOctokit = ({ repository, token }) => {
|
|
7
10
|
const auth = `token ${token}`;
|
|
8
|
-
const userAgent = `${
|
|
11
|
+
const userAgent = `${package_json_1.default.name}/${package_json_1.default.version}`;
|
|
9
12
|
if (repository.isGitHubDotCom) {
|
|
10
13
|
return new rest_1.Octokit({
|
|
11
14
|
auth,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.createPullRequestBody = void 0;
|
|
4
|
-
const
|
|
7
|
+
const package_json_1 = __importDefault(require("../../../../package.json"));
|
|
5
8
|
const json_1 = require("../../../json");
|
|
6
9
|
const metadata_1 = require("../metadata");
|
|
7
10
|
const createPullRequestBody = (outdatedPackage) => {
|
|
8
|
-
const appName = app_1.app.name;
|
|
9
|
-
const appVersion = app_1.app.version;
|
|
10
|
-
const appWeb = app_1.app.web;
|
|
11
11
|
const currentVersion = outdatedPackage.currentVersion.version;
|
|
12
12
|
const newVersion = outdatedPackage.newVersion.version;
|
|
13
13
|
const packageName = outdatedPackage.name;
|
|
@@ -34,6 +34,6 @@ ${metadata}
|
|
|
34
34
|
</details>
|
|
35
35
|
|
|
36
36
|
---
|
|
37
|
-
This PR has been generated by [${
|
|
37
|
+
This PR has been generated by [${package_json_1.default.name}](${package_json_1.default.homepage}) v${package_json_1.default.version}`;
|
|
38
38
|
};
|
|
39
39
|
exports.createPullRequestBody = createPullRequestBody;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.createPullRequestMetadata = void 0;
|
|
4
|
-
const
|
|
7
|
+
const package_json_1 = __importDefault(require("../../../../package.json"));
|
|
5
8
|
const createPullRequestMetadata = (outdatedPackages) => {
|
|
6
9
|
return {
|
|
7
|
-
version:
|
|
10
|
+
version: package_json_1.default.version,
|
|
8
11
|
packages: outdatedPackages.map(({ name, currentVersion, newVersion, level }) => ({
|
|
9
12
|
name,
|
|
10
13
|
currentVersion: currentVersion.version,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,14 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.initOptions = void 0;
|
|
4
7
|
const commander_1 = require("commander");
|
|
5
|
-
const
|
|
8
|
+
const package_json_1 = __importDefault(require("../../package.json"));
|
|
6
9
|
const cliOptions_1 = require("./cliOptions");
|
|
7
10
|
const Options_1 = require("./Options");
|
|
8
11
|
const toCommanderOption_1 = require("./toCommanderOption");
|
|
9
12
|
// TODO: add test
|
|
10
13
|
const initOptions = () => {
|
|
11
|
-
commander_1.program.version(
|
|
14
|
+
commander_1.program.version(package_json_1.default.version);
|
|
12
15
|
cliOptions_1.cliOptions
|
|
13
16
|
.map(toCommanderOption_1.toCommanderOption)
|
|
14
17
|
.forEach(option => commander_1.program.addOption(option));
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/jest.config.ts
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.3",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "tsc --project tsconfig.build.json",
|
|
@@ -12,10 +12,7 @@
|
|
|
12
12
|
"start": "ts-node src/bin.ts",
|
|
13
13
|
"test": "jest --passWithNoTests"
|
|
14
14
|
},
|
|
15
|
-
"
|
|
16
|
-
"dist"
|
|
17
|
-
],
|
|
18
|
-
"bin": "dist/bin.js",
|
|
15
|
+
"bin": "dist/src/bin.js",
|
|
19
16
|
"dependencies": {
|
|
20
17
|
"@octokit/rest": "18.12.0",
|
|
21
18
|
"commander": "8.3.0",
|
package/src/bin.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import pkg from '../package.json'
|
|
4
|
+
import { createLogger } from './logger'
|
|
5
|
+
import { main } from './main'
|
|
6
|
+
import { initOptions } from './options'
|
|
7
|
+
|
|
8
|
+
const options = initOptions()
|
|
9
|
+
const logger = createLogger(options.logLevel)
|
|
10
|
+
logger.info(`Start ${pkg.name} v${pkg.version}`)
|
|
11
|
+
|
|
12
|
+
main({
|
|
13
|
+
options,
|
|
14
|
+
logger
|
|
15
|
+
})
|
|
16
|
+
.then(() => {
|
|
17
|
+
logger.info(`End ${pkg.name} v${pkg.version}`)
|
|
18
|
+
})
|
|
19
|
+
.catch((error: unknown) => {
|
|
20
|
+
logger.fatal(error)
|
|
21
|
+
throw error
|
|
22
|
+
})
|