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.
Files changed (179) hide show
  1. package/.eslintignore +3 -0
  2. package/.eslintrc.js +23 -0
  3. package/.github/renovate.json +15 -0
  4. package/.github/workflows/eslint.yml +14 -0
  5. package/.github/workflows/test.yml +20 -0
  6. package/.husky/pre-commit +4 -0
  7. package/.nvmrc +1 -0
  8. package/dist/package.json +65 -0
  9. package/dist/{bin.js → src/bin.js} +6 -3
  10. package/dist/{core → src/core}/FailedResult.js +0 -0
  11. package/dist/{core → src/core}/OutdatedPackage.js +0 -0
  12. package/dist/{core → src/core}/OutdatedPackageProcessor.js +0 -0
  13. package/dist/{core → src/core}/OutdatedPackagesProcessor.js +0 -0
  14. package/dist/{core → src/core}/SucceededResult.js +0 -0
  15. package/dist/{core → src/core}/index.js +0 -0
  16. package/dist/{file → src/file}/index.js +0 -0
  17. package/dist/{file → src/file}/readFile.js +0 -0
  18. package/dist/{git → src/git}/CommitMessageCreator.js +0 -0
  19. package/dist/{git → src/git}/Git.js +0 -0
  20. package/dist/{git → src/git}/GitRepository.js +0 -0
  21. package/dist/{git → src/git}/createBranchName.js +0 -0
  22. package/dist/{git → src/git}/index.js +0 -0
  23. package/dist/{github → src/github}/GitHub.js +0 -0
  24. package/dist/{github → src/github}/branch/finder/BranchFinder.js +0 -0
  25. package/dist/{github → src/github}/branch/finder/index.js +0 -0
  26. package/dist/{github → src/github}/branch/index.js +0 -0
  27. package/dist/{github → src/github}/createGitHub.js +0 -0
  28. package/dist/{github → src/github}/createOctokit.js +5 -2
  29. package/dist/{github → src/github}/errors/NotFoundError.js +0 -0
  30. package/dist/{github → src/github}/errors/index.js +0 -0
  31. package/dist/{github → src/github}/index.js +0 -0
  32. package/dist/{github → src/github}/label/creator/LabelCreator.js +0 -0
  33. package/dist/{github → src/github}/label/creator/index.js +0 -0
  34. package/dist/{github → src/github}/label/index.js +0 -0
  35. package/dist/{github → src/github}/pull-request/closer/PullRequestCloser.js +0 -0
  36. package/dist/{github → src/github}/pull-request/closer/index.js +0 -0
  37. package/dist/{github → src/github}/pull-request/creator/PullRequestCreator.js +0 -0
  38. package/dist/{github → src/github}/pull-request/creator/PullRequestTitleCreator.js +0 -0
  39. package/dist/{github → src/github}/pull-request/creator/createPullRequestBody.js +5 -5
  40. package/dist/{github → src/github}/pull-request/creator/index.js +0 -0
  41. package/dist/{github → src/github}/pull-request/finder/PullRequestFinder.js +0 -0
  42. package/dist/{github → src/github}/pull-request/finder/index.js +0 -0
  43. package/dist/{github → src/github}/pull-request/finder/isPullRequestByNpmUpdatePackage.js +0 -0
  44. package/dist/{github → src/github}/pull-request/index.js +0 -0
  45. package/dist/{github → src/github}/pull-request/metadata/PullRequestMetadata.js +0 -0
  46. package/dist/{github → src/github}/pull-request/metadata/createPullRequestMetadata.js +5 -2
  47. package/dist/{github → src/github}/pull-request/metadata/extractPullRequestMetadata.js +0 -0
  48. package/dist/{github → src/github}/pull-request/metadata/index.js +0 -0
  49. package/dist/{json → src/json}/index.js +0 -0
  50. package/dist/{json → src/json}/toJSON.js +0 -0
  51. package/dist/{logger → src/logger}/LogLevel.js +0 -0
  52. package/dist/{logger → src/logger}/Logger.js +0 -0
  53. package/dist/{logger → src/logger}/createLogger.js +0 -0
  54. package/dist/{logger → src/logger}/index.js +0 -0
  55. package/dist/{main.js → src/main.js} +0 -0
  56. package/dist/{ncu → src/ncu}/Ncu.js +0 -0
  57. package/dist/{ncu → src/ncu}/NcuResult.js +0 -0
  58. package/dist/{ncu → src/ncu}/index.js +0 -0
  59. package/dist/{options → src/options}/CLIOption.js +0 -0
  60. package/dist/{options → src/options}/OptionType.js +0 -0
  61. package/dist/{options → src/options}/Options.js +0 -0
  62. package/dist/{options → src/options}/cliOptions.js +0 -0
  63. package/dist/{options → src/options}/index.js +0 -0
  64. package/dist/{options → src/options}/initOptions.js +5 -2
  65. package/dist/{options → src/options}/toCommanderOption.js +0 -0
  66. package/dist/{package-json → src/package-json}/PackageMetadata.js +0 -0
  67. package/dist/{package-json → src/package-json}/PackageMetadataDependencies.js +0 -0
  68. package/dist/{package-json → src/package-json}/index.js +0 -0
  69. package/dist/{package-json → src/package-json}/parsePackageJson.js +0 -0
  70. package/dist/{package-manager → src/package-manager}/Npm.js +0 -0
  71. package/dist/{package-manager → src/package-manager}/PackageManager.js +0 -0
  72. package/dist/{package-manager → src/package-manager}/PackageManagerName.js +0 -0
  73. package/dist/{package-manager → src/package-manager}/Yarn.js +0 -0
  74. package/dist/{package-manager → src/package-manager}/createPackageManager.js +0 -0
  75. package/dist/{package-manager → src/package-manager}/index.js +0 -0
  76. package/dist/{semver → src/semver}/SemVer.js +0 -0
  77. package/dist/{semver → src/semver}/SemVerLevel.js +0 -0
  78. package/dist/{semver → src/semver}/compareSemVers.js +0 -0
  79. package/dist/{semver → src/semver}/index.js +0 -0
  80. package/dist/{terminal → src/terminal}/Terminal.js +0 -0
  81. package/dist/{terminal → src/terminal}/index.js +0 -0
  82. package/jest.config.ts +12 -0
  83. package/lint-staged.config.js +4 -0
  84. package/npm-update-package.code-workspace +10 -0
  85. package/package.json +2 -5
  86. package/src/bin.ts +22 -0
  87. package/src/core/FailedResult.ts +6 -0
  88. package/src/core/OutdatedPackage.ts +11 -0
  89. package/src/core/OutdatedPackageProcessor.ts +136 -0
  90. package/src/core/OutdatedPackagesProcessor.ts +35 -0
  91. package/src/core/SucceededResult.ts +7 -0
  92. package/src/core/index.ts +5 -0
  93. package/src/file/index.ts +1 -0
  94. package/src/file/readFile.ts +6 -0
  95. package/src/git/CommitMessageCreator.test.ts +17 -0
  96. package/src/git/CommitMessageCreator.ts +19 -0
  97. package/src/git/Git.ts +59 -0
  98. package/src/git/GitRepository.test.ts +82 -0
  99. package/src/git/GitRepository.ts +57 -0
  100. package/src/git/createBranchName.test.ts +14 -0
  101. package/src/git/createBranchName.ts +7 -0
  102. package/src/git/index.ts +4 -0
  103. package/src/github/GitHub.ts +198 -0
  104. package/src/github/branch/finder/BranchFinder.test.ts +21 -0
  105. package/src/github/branch/finder/BranchFinder.ts +9 -0
  106. package/src/github/branch/finder/index.ts +1 -0
  107. package/src/github/branch/index.ts +1 -0
  108. package/src/github/createGitHub.test.ts +16 -0
  109. package/src/github/createGitHub.ts +17 -0
  110. package/src/github/createOctokit.test.ts +27 -0
  111. package/src/github/createOctokit.ts +27 -0
  112. package/src/github/errors/NotFoundError.ts +11 -0
  113. package/src/github/errors/index.ts +1 -0
  114. package/src/github/index.ts +5 -0
  115. package/src/github/label/creator/LabelCreator.ts +71 -0
  116. package/src/github/label/creator/index.ts +1 -0
  117. package/src/github/label/index.ts +1 -0
  118. package/src/github/pull-request/closer/PullRequestCloser.test.ts +53 -0
  119. package/src/github/pull-request/closer/PullRequestCloser.ts +21 -0
  120. package/src/github/pull-request/closer/index.ts +1 -0
  121. package/src/github/pull-request/creator/PullRequestCreator.test.ts +98 -0
  122. package/src/github/pull-request/creator/PullRequestCreator.ts +84 -0
  123. package/src/github/pull-request/creator/PullRequestTitleCreator.test.ts +17 -0
  124. package/src/github/pull-request/creator/PullRequestTitleCreator.ts +19 -0
  125. package/src/github/pull-request/creator/createPullRequestBody.test.ts +47 -0
  126. package/src/github/pull-request/creator/createPullRequestBody.ts +35 -0
  127. package/src/github/pull-request/creator/index.ts +2 -0
  128. package/src/github/pull-request/finder/PullRequestFinder.ts +27 -0
  129. package/src/github/pull-request/finder/index.ts +1 -0
  130. package/src/github/pull-request/finder/isPullRequestByNpmUpdatePackage.test.ts +24 -0
  131. package/src/github/pull-request/finder/isPullRequestByNpmUpdatePackage.ts +5 -0
  132. package/src/github/pull-request/index.ts +3 -0
  133. package/src/github/pull-request/metadata/PullRequestMetadata.ts +22 -0
  134. package/src/github/pull-request/metadata/createPullRequestMetadata.test.ts +31 -0
  135. package/src/github/pull-request/metadata/createPullRequestMetadata.ts +21 -0
  136. package/src/github/pull-request/metadata/extractPullRequestMetadata.test.ts +53 -0
  137. package/src/github/pull-request/metadata/extractPullRequestMetadata.ts +21 -0
  138. package/src/github/pull-request/metadata/index.ts +3 -0
  139. package/src/json/index.ts +1 -0
  140. package/src/json/toJSON.test.ts +65 -0
  141. package/src/json/toJSON.ts +13 -0
  142. package/src/logger/LogLevel.ts +13 -0
  143. package/src/logger/Logger.ts +1 -0
  144. package/src/logger/createLogger.ts +10 -0
  145. package/src/logger/index.ts +3 -0
  146. package/src/main.ts +149 -0
  147. package/src/ncu/Ncu.ts +84 -0
  148. package/src/ncu/NcuResult.ts +10 -0
  149. package/src/ncu/index.ts +1 -0
  150. package/src/options/CLIOption.ts +19 -0
  151. package/src/options/OptionType.ts +8 -0
  152. package/src/options/Options.ts +40 -0
  153. package/src/options/cliOptions.ts +60 -0
  154. package/src/options/index.ts +2 -0
  155. package/src/options/initOptions.ts +24 -0
  156. package/src/options/toCommanderOption.ts +35 -0
  157. package/src/package-json/PackageMetadata.ts +24 -0
  158. package/src/package-json/PackageMetadataDependencies.ts +10 -0
  159. package/src/package-json/index.ts +2 -0
  160. package/src/package-json/parsePackageJson.ts +15 -0
  161. package/src/package-manager/Npm.ts +17 -0
  162. package/src/package-manager/PackageManager.ts +5 -0
  163. package/src/package-manager/PackageManagerName.ts +8 -0
  164. package/src/package-manager/Yarn.ts +17 -0
  165. package/src/package-manager/createPackageManager.test.ts +27 -0
  166. package/src/package-manager/createPackageManager.ts +20 -0
  167. package/src/package-manager/index.ts +5 -0
  168. package/src/semver/SemVer.test.ts +17 -0
  169. package/src/semver/SemVer.ts +40 -0
  170. package/src/semver/SemVerLevel.ts +9 -0
  171. package/src/semver/compareSemVers.test.ts +21 -0
  172. package/src/semver/compareSemVers.ts +16 -0
  173. package/src/semver/index.ts +3 -0
  174. package/src/terminal/Terminal.ts +12 -0
  175. package/src/terminal/index.ts +1 -0
  176. package/tsconfig.base.json +7 -0
  177. package/tsconfig.build.json +12 -0
  178. package/tsconfig.json +9 -0
  179. package/dist/app.js +0 -8
package/.eslintignore ADDED
@@ -0,0 +1,3 @@
1
+ /coverage
2
+ /dist
3
+ /node_modules
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,15 @@
1
+ {
2
+ "extends": [
3
+ "config:base"
4
+ ],
5
+ "packageRules": [
6
+ {
7
+ "matchPackageNames": ["@types/node"],
8
+ "allowedVersions": "<13"
9
+ },
10
+ {
11
+ "matchPackageNames": ["node"],
12
+ "allowedVersions": "<13"
13
+ }
14
+ ]
15
+ }
@@ -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
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ npx lint-staged
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 app_1 = require("./app");
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 ${app_1.app.name} v${app_1.app.version}`);
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 ${app_1.app.name} v${app_1.app.version}`);
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
@@ -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 app_1 = require("../app");
8
+ const package_json_1 = __importDefault(require("../../package.json"));
6
9
  const createOctokit = ({ repository, token }) => {
7
10
  const auth = `token ${token}`;
8
- const userAgent = `${app_1.app.name}/${app_1.app.version}`;
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
@@ -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 app_1 = require("../../../app");
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 [${appName}](${appWeb}) v${appVersion}`;
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;
@@ -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 app_1 = require("../../../app");
7
+ const package_json_1 = __importDefault(require("../../../../package.json"));
5
8
  const createPullRequestMetadata = (outdatedPackages) => {
6
9
  return {
7
- version: app_1.app.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
@@ -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 app_1 = require("../app");
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(app_1.app.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
package/jest.config.ts ADDED
@@ -0,0 +1,12 @@
1
+ import type { Config } from '@jest/types'
2
+
3
+ const config: Config.InitialOptions = {
4
+ preset: 'ts-jest',
5
+ collectCoverage: true,
6
+ collectCoverageFrom: [
7
+ 'src/**/*.ts',
8
+ '!src/**/index.ts'
9
+ ]
10
+ }
11
+
12
+ export default config
@@ -0,0 +1,4 @@
1
+ module.exports = {
2
+ '*.js': 'eslint',
3
+ '*.ts': 'eslint'
4
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "folders": [
3
+ {
4
+ "path": "."
5
+ }
6
+ ],
7
+ "settings": {
8
+ "typescript.tsdk": "node_modules/typescript/lib"
9
+ }
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.30.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
- "files": [
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
+ })
@@ -0,0 +1,6 @@
1
+ import type { OutdatedPackage } from './OutdatedPackage'
2
+
3
+ export interface FailedResult {
4
+ outdatedPackage: OutdatedPackage
5
+ error: unknown
6
+ }
@@ -0,0 +1,11 @@
1
+ import type {
2
+ SemVer,
3
+ SemVerLevel
4
+ } from '../semver'
5
+
6
+ export interface OutdatedPackage {
7
+ name: string
8
+ currentVersion: SemVer
9
+ newVersion: SemVer
10
+ level: SemVerLevel
11
+ }