npm-update-package 0.43.3 → 0.43.6

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,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.43.3",
3
+ "version": "0.43.6",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -49,8 +49,8 @@
49
49
  "npm-run-all": "4.1.5",
50
50
  "rimraf": "3.0.2",
51
51
  "ts-jest": "27.1.3",
52
- "ts-node": "10.6.0",
53
- "typescript": "4.5.5",
52
+ "ts-node": "10.7.0",
53
+ "typescript": "4.6.2",
54
54
  "utility-types": "3.10.0"
55
55
  },
56
56
  "repository": {
@@ -5,7 +5,7 @@ const Either_1 = require("fp-ts/lib/Either");
5
5
  const git_1 = require("../git");
6
6
  // TODO: add test
7
7
  class OutdatedPackageProcessor {
8
- constructor({ git, ncu, packageManager, pullRequestCreator, branchFinder, logger, commitMessageCreator, pullRequestFinder, pullRequestCloser, options }) {
8
+ constructor({ git, ncu, packageManager, pullRequestCreator, branchFinder, logger, commitMessageCreator, pullRequestFinder, pullRequestCloser }) {
9
9
  this.git = git;
10
10
  this.ncu = ncu;
11
11
  this.packageManager = packageManager;
@@ -15,21 +15,11 @@ class OutdatedPackageProcessor {
15
15
  this.commitMessageCreator = commitMessageCreator;
16
16
  this.pullRequestFinder = pullRequestFinder;
17
17
  this.pullRequestCloser = pullRequestCloser;
18
- this.options = options;
19
18
  }
20
19
  /**
21
20
  * Don't run in parallel because it includes file operations.
22
21
  */
23
22
  async process(outdatedPackage) {
24
- var _a;
25
- const ignoredPackages = (_a = this.options.ignorePackages) !== null && _a !== void 0 ? _a : [];
26
- if (ignoredPackages.includes(outdatedPackage.name)) {
27
- this.logger.info(`Skip ${outdatedPackage.name} because ignorePackages contains it.`);
28
- return (0, Either_1.right)({
29
- outdatedPackage,
30
- skipped: true
31
- });
32
- }
33
23
  const branchName = (0, git_1.createBranchName)(outdatedPackage);
34
24
  this.logger.debug(`branchName=${branchName}`);
35
25
  if (this.branchFinder.findByName(branchName) !== undefined) {
package/dist/src/main.js CHANGED
@@ -14,7 +14,10 @@ const main = async ({ options, logger }) => {
14
14
  ...options,
15
15
  githubToken: options.githubToken !== '' ? '***' : ''
16
16
  })}`);
17
- const ncu = new ncu_1.Ncu(logger);
17
+ const ncu = new ncu_1.Ncu({
18
+ options,
19
+ logger
20
+ });
18
21
  const outdatedPackages = await ncu.check();
19
22
  logger.debug(`outdatedPackages=${JSON.stringify(outdatedPackages)}`);
20
23
  if (outdatedPackages.length === 0) {
@@ -89,8 +92,7 @@ const main = async ({ options, logger }) => {
89
92
  logger,
90
93
  commitMessageCreator,
91
94
  pullRequestFinder,
92
- pullRequestCloser,
93
- options
95
+ pullRequestCloser
94
96
  });
95
97
  const outdatedPackagesProcessor = new core_1.OutdatedPackagesProcessor({
96
98
  outdatedPackageProcessor,
@@ -117,5 +119,8 @@ const main = async ({ options, logger }) => {
117
119
  - ${createdPackages.length} packages: created (${createdPackages.map(({ name }) => name).join(',')})
118
120
  - ${skippedPackages.length} packages: skipped: (${skippedPackages.map(({ name }) => name).join(',')})
119
121
  - ${failedPackages.length} packages: failed: (${failedPackages.map(({ name }) => name).join(',')})`);
122
+ if (options.ignorePackages !== undefined) {
123
+ logger.info(`Ignored ${options.ignorePackages.length} packages: ${options.ignorePackages.join(',')}`);
124
+ }
120
125
  };
121
126
  exports.main = main;
@@ -9,12 +9,14 @@ const semver_1 = require("../semver");
9
9
  const NcuResult_1 = require("./NcuResult");
10
10
  // TODO: add test
11
11
  class Ncu {
12
- constructor(logger) {
12
+ constructor({ options, logger }) {
13
+ this.options = options;
13
14
  this.logger = logger;
14
15
  }
15
16
  async check() {
16
17
  return await this.run({
17
- jsonUpgraded: true
18
+ jsonUpgraded: true,
19
+ reject: this.options.ignorePackages
18
20
  });
19
21
  }
20
22
  async update(outdatedPackage) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "npm-update-package",
3
- "version": "0.43.3",
3
+ "version": "0.43.6",
4
4
  "description": "CLI tool for creating pull requests to update npm packages",
5
5
  "scripts": {
6
6
  "build": "tsc --project tsconfig.build.json",
@@ -49,8 +49,8 @@
49
49
  "npm-run-all": "4.1.5",
50
50
  "rimraf": "3.0.2",
51
51
  "ts-jest": "27.1.3",
52
- "ts-node": "10.6.0",
53
- "typescript": "4.5.5",
52
+ "ts-node": "10.7.0",
53
+ "typescript": "4.6.2",
54
54
  "utility-types": "3.10.0"
55
55
  },
56
56
  "repository": {