npm-update-package 4.0.10-alpha.5 → 4.0.10-alpha.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/{src/bin → bin}/npm-update-package.js +2 -1
- package/dist/{src/github → github}/createOctokit.js +2 -1
- package/dist/github/pull-request/creator/createFooter.js +5 -0
- package/dist/{src/github → github}/pull-request/metadata/createPullRequestMetadata.js +2 -1
- package/dist/{src/options → options}/createOptions.js +2 -1
- package/dist/{src/package-json → package-json}/PackageMetadata.js +2 -1
- package/dist/package.json +72 -71
- package/dist/util/createRequirePackageJSON.js +21 -0
- package/package.json +3 -2
- package/dist/src/github/pull-request/creator/createFooter.js +0 -4
- /package/dist/{src/core → core}/FailedResult.js +0 -0
- /package/dist/{src/core → core}/OutdatedPackage.js +0 -0
- /package/dist/{src/core → core}/OutdatedPackagesProcessor.js +0 -0
- /package/dist/{src/core → core}/PackageUpdater.js +0 -0
- /package/dist/{src/core → core}/SucceededResult.js +0 -0
- /package/dist/{src/file → file}/canReadWrite.js +0 -0
- /package/dist/{src/git → git}/CommitMessageCreator.js +0 -0
- /package/dist/{src/git → git}/Git.js +0 -0
- /package/dist/{src/git → git}/GitConfigInitializer.js +0 -0
- /package/dist/{src/git → git}/GitRepository.js +0 -0
- /package/dist/{src/git → git}/GitTransaction.js +0 -0
- /package/dist/{src/git → git}/createBranchName.js +0 -0
- /package/dist/{src/github → github}/GitHub.js +0 -0
- /package/dist/{src/github → github}/branch/finder/BranchFinder.js +0 -0
- /package/dist/{src/github → github}/createGitHub.js +0 -0
- /package/dist/{src/github → github}/errors/NotFoundError.js +0 -0
- /package/dist/{src/github → github}/label/creator/LabelCreator.js +0 -0
- /package/dist/{src/github → github}/pull-request/closer/PullRequestCloser.js +0 -0
- /package/dist/{src/github → github}/pull-request/closer/PullRequestsCloser.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/AssigneesAdder.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/GitHubUrlOptimizer.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/LabelsAdder.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/PackageDiffsSectionCreator.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/PullRequestBodyCreator.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/PullRequestCreator.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/PullRequestTitleCreator.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/ReleaseNotesSectionCreator.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/ReviewersAdder.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/createMetadataSection.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/createNotesSection.js +0 -0
- /package/dist/{src/github → github}/pull-request/creator/createOutdatedPackagesTable.js +0 -0
- /package/dist/{src/github → github}/pull-request/finder/PullRequestFinder.js +0 -0
- /package/dist/{src/github → github}/pull-request/finder/isPullRequestByNpmUpdatePackage.js +0 -0
- /package/dist/{src/github → github}/pull-request/metadata/PullRequestMetadata.js +0 -0
- /package/dist/{src/github → github}/pull-request/metadata/extractPullRequestMetadata.js +0 -0
- /package/dist/{src/github → github}/releases/Release.js +0 -0
- /package/dist/{src/github → github}/releases/fetcher/ReleasesFetcher.js +0 -0
- /package/dist/{src/json → json}/toJSON.js +0 -0
- /package/dist/{src/logger → logger}/LogLevel.js +0 -0
- /package/dist/{src/logger → logger}/logger.js +0 -0
- /package/dist/{src/main.js → main.js} +0 -0
- /package/dist/{src/npm-check-updates → npm-check-updates}/Dependency.js +0 -0
- /package/dist/{src/npm-check-updates → npm-check-updates}/NpmCheckUpdates.js +0 -0
- /package/dist/{src/npm-check-updates → npm-check-updates}/NpmCheckUpdatesResult.js +0 -0
- /package/dist/{src/npm-check-updates → npm-check-updates}/createDepOptionValue.js +0 -0
- /package/dist/{src/npm-check-updates → npm-check-updates}/toDependency.js +0 -0
- /package/dist/{src/options → options}/CLIOption.js +0 -0
- /package/dist/{src/options → options}/OptionType.js +0 -0
- /package/dist/{src/options → options}/Options.js +0 -0
- /package/dist/{src/options → options}/cliOptions.js +0 -0
- /package/dist/{src/options → options}/initOptions.js +0 -0
- /package/dist/{src/options → options}/parseBooleanOption.js +0 -0
- /package/dist/{src/options → options}/parseNumberOption.js +0 -0
- /package/dist/{src/options → options}/toCommanderOption.js +0 -0
- /package/dist/{src/outdated-package-processor → outdated-package-processor}/OutdatedPackageProcessor.js +0 -0
- /package/dist/{src/outdated-package-processor → outdated-package-processor}/OutdatedPackageProcessorCreator.js +0 -0
- /package/dist/{src/outdated-package-processor → outdated-package-processor}/OutdatedPullRequestStrategy.js +0 -0
- /package/dist/{src/outdated-package-processor → outdated-package-processor}/create/Create.js +0 -0
- /package/dist/{src/outdated-package-processor → outdated-package-processor}/recreate/Recreate.js +0 -0
- /package/dist/{src/outdated-package-processor → outdated-package-processor}/skip/Skip.js +0 -0
- /package/dist/{src/package-json → package-json}/DependencyType.js +0 -0
- /package/dist/{src/package-json → package-json}/PackageMetadataDependencies.js +0 -0
- /package/dist/{src/package-json → package-json}/PackageMetadataRepository.js +0 -0
- /package/dist/{src/package-json → package-json}/extractRepository.js +0 -0
- /package/dist/{src/package-json → package-json}/parsePackageJson.js +0 -0
- /package/dist/{src/package-json → package-json}/readPackageJson.js +0 -0
- /package/dist/{src/package-manager → package-manager}/PackageManager.js +0 -0
- /package/dist/{src/package-manager → package-manager}/PackageManagerCreator.js +0 -0
- /package/dist/{src/package-manager → package-manager}/PackageManagerName.js +0 -0
- /package/dist/{src/package-manager → package-manager}/detectPackageManager.js +0 -0
- /package/dist/{src/package-manager → package-manager}/npm/Npm.js +0 -0
- /package/dist/{src/package-manager → package-manager}/npm/NpmVersions.js +0 -0
- /package/dist/{src/package-manager → package-manager}/yarn/Yarn.js +0 -0
- /package/dist/{src/package-manager → package-manager}/yarn/YarnVersions.js +0 -0
- /package/dist/{src/semver → semver}/SemVer.js +0 -0
- /package/dist/{src/semver → semver}/SemVerLevel.js +0 -0
- /package/dist/{src/semver → semver}/compareSemVers.js +0 -0
- /package/dist/{src/terminal → terminal}/Terminal.js +0 -0
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
import { logger } from '../logger/logger.js';
|
|
3
3
|
import { main } from '../main.js';
|
|
4
4
|
import { initOptions } from '../options/initOptions.js';
|
|
5
|
-
|
|
5
|
+
import { createRequirePackageJSON } from '../util/createRequirePackageJSON.js';
|
|
6
|
+
const pkg = createRequirePackageJSON(import.meta.url)('../../package.json');
|
|
6
7
|
try {
|
|
7
8
|
const options = initOptions();
|
|
8
9
|
logger.level = options.logLevel;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Octokit } from '@octokit/rest';
|
|
2
|
-
|
|
2
|
+
import { createRequirePackageJSON } from '../util/createRequirePackageJSON.js';
|
|
3
|
+
const pkg = createRequirePackageJSON(import.meta.url)('../../package.json');
|
|
3
4
|
export const createOctokit = ({ host, token }) => {
|
|
4
5
|
const userAgent = `${pkg.name}/${pkg.version}`;
|
|
5
6
|
if (token === undefined) {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { createRequirePackageJSON } from '../../../util/createRequirePackageJSON.js';
|
|
2
|
+
const pkg = createRequirePackageJSON(import.meta.url)('../../../../package.json');
|
|
3
|
+
export const createFooter = () => {
|
|
4
|
+
return `This PR has been generated by [${pkg.name}](${pkg.homepage}) v${pkg.version}`;
|
|
5
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import { createRequirePackageJSON } from '../../../util/createRequirePackageJSON.js';
|
|
2
|
+
const pkg = createRequirePackageJSON(import.meta.url)('../../../../package.json');
|
|
2
3
|
export const createPullRequestMetadata = (outdatedPackages) => {
|
|
3
4
|
return {
|
|
4
5
|
version: pkg.version,
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { program } from 'commander';
|
|
2
|
+
import { createRequirePackageJSON } from '../util/createRequirePackageJSON.js';
|
|
2
3
|
import { isOptions } from './Options.js';
|
|
3
4
|
import { toCommanderOption } from './toCommanderOption.js';
|
|
4
|
-
const
|
|
5
|
+
const pkg = createRequirePackageJSON(import.meta.url)('../../package.json');
|
|
5
6
|
export const createOptions = (cliOptions) => {
|
|
6
7
|
program.version(pkg.version);
|
|
7
8
|
cliOptions
|
|
@@ -12,7 +12,8 @@ const PackageMetadata = intersection([
|
|
|
12
12
|
peerDependencies: PackageMetadataDependencies,
|
|
13
13
|
bundledDependencies: PackageMetadataDependencies,
|
|
14
14
|
optionalDependencies: PackageMetadataDependencies,
|
|
15
|
-
repository: union([string, PackageMetadataRepository])
|
|
15
|
+
repository: union([string, PackageMetadataRepository]),
|
|
16
|
+
homepage: string
|
|
16
17
|
})
|
|
17
18
|
]);
|
|
18
19
|
export const isPackageMetadata = PackageMetadata.is;
|
package/dist/package.json
CHANGED
|
@@ -1,73 +1,74 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
2
|
+
"name": "npm-update-package",
|
|
3
|
+
"version": "4.0.10-alpha.7",
|
|
4
|
+
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"build": "tsc --project tsconfig.build.json",
|
|
8
|
+
"clean": "rimraf dist",
|
|
9
|
+
"lint": "eslint '**/*.{js,mjs,cjs,ts,mts,cts}'",
|
|
10
|
+
"postbuild": "cp package.json dist/package.json",
|
|
11
|
+
"prebuild": "npm run clean",
|
|
12
|
+
"prepublishOnly": "npm-run-all lint test build",
|
|
13
|
+
"test": "glob -c 'tsx --test' 'src/**/*.test.ts'"
|
|
14
|
+
},
|
|
15
|
+
"bin": "dist/bin/npm-update-package.js",
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=20"
|
|
18
|
+
},
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@octokit/rest": "20.1.1",
|
|
21
|
+
"commander": "12.1.0",
|
|
22
|
+
"execa": "9.1.0",
|
|
23
|
+
"fp-ts": "2.16.6",
|
|
24
|
+
"http-status-codes": "2.3.0",
|
|
25
|
+
"io-ts": "2.2.21",
|
|
26
|
+
"lodash": "4.17.21",
|
|
27
|
+
"log4js": "6.9.1",
|
|
28
|
+
"mustache": "4.2.0",
|
|
29
|
+
"npm-check-updates": "16.3.11",
|
|
30
|
+
"parse-github-url": "1.0.2",
|
|
31
|
+
"semver": "7.5.4",
|
|
32
|
+
"type-guards": "0.15.0"
|
|
33
|
+
},
|
|
34
|
+
"devDependencies": {
|
|
35
|
+
"@munierujp/eslint-config-typescript": "46.0.1",
|
|
36
|
+
"@tsconfig/node20": "20.1.4",
|
|
37
|
+
"@types/lodash": "4.17.4",
|
|
38
|
+
"@types/mustache": "4.2.5",
|
|
39
|
+
"@types/node": "20.12.12",
|
|
40
|
+
"@types/parse-github-url": "1.0.3",
|
|
41
|
+
"@types/semver": "7.5.8",
|
|
42
|
+
"eslint": "8.57.0",
|
|
43
|
+
"eslint-config-lodash": "4.0.3",
|
|
44
|
+
"glob": "10.3.15",
|
|
45
|
+
"nock": "14.0.0-beta.6",
|
|
46
|
+
"npm-run-all2": "6.2.0",
|
|
47
|
+
"rimraf": "5.0.7",
|
|
48
|
+
"test-each": "7.0.0",
|
|
49
|
+
"tsx": "4.11.0",
|
|
50
|
+
"typescript": "5.4.5",
|
|
51
|
+
"utility-types": "3.11.0"
|
|
52
|
+
},
|
|
53
|
+
"repository": {
|
|
54
|
+
"type": "git",
|
|
55
|
+
"url": "https://github.com/npm-update-package/npm-update-package.git"
|
|
56
|
+
},
|
|
57
|
+
"bugs": {
|
|
58
|
+
"url": "https://github.com/npm-update-package/npm-update-package/issues"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://github.com/npm-update-package/npm-update-package",
|
|
61
|
+
"license": "MIT",
|
|
62
|
+
"keywords": [
|
|
63
|
+
"dependencies",
|
|
64
|
+
"dependency",
|
|
65
|
+
"github enterprise",
|
|
66
|
+
"github",
|
|
67
|
+
"node",
|
|
68
|
+
"npm",
|
|
69
|
+
"outdated",
|
|
70
|
+
"package",
|
|
71
|
+
"update",
|
|
72
|
+
"yarn"
|
|
73
|
+
]
|
|
73
74
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import { isPackageMetadata } from '../package-json/PackageMetadata.js';
|
|
3
|
+
/**
|
|
4
|
+
* @example
|
|
5
|
+
* ```typescript
|
|
6
|
+
* const requirePackageJSON = createRequirePackageJSON(import.meta.url)
|
|
7
|
+
* const packageJSON = requirePackageJSON('path/to/package.json')
|
|
8
|
+
* ```
|
|
9
|
+
*/
|
|
10
|
+
export const createRequirePackageJSON = (path) => {
|
|
11
|
+
const require = createRequire(path);
|
|
12
|
+
return (id) => {
|
|
13
|
+
const packageJSON = require(id);
|
|
14
|
+
if (isPackageMetadata(packageJSON)) {
|
|
15
|
+
return packageJSON;
|
|
16
|
+
}
|
|
17
|
+
else {
|
|
18
|
+
throw new Error(`Invalid package.json. path=${path.toString()}, id=${id}`);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
};
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "npm-update-package",
|
|
3
|
-
"version": "4.0.10-alpha.
|
|
3
|
+
"version": "4.0.10-alpha.7",
|
|
4
4
|
"description": "CLI tool for creating pull requests to update npm packages",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
7
7
|
"build": "tsc --project tsconfig.build.json",
|
|
8
8
|
"clean": "rimraf dist",
|
|
9
9
|
"lint": "eslint '**/*.{js,mjs,cjs,ts,mts,cts}'",
|
|
10
|
+
"postbuild": "cp package.json dist/package.json",
|
|
10
11
|
"prebuild": "npm run clean",
|
|
11
12
|
"prepublishOnly": "npm-run-all lint test build",
|
|
12
13
|
"test": "glob -c 'tsx --test' 'src/**/*.test.ts'"
|
|
13
14
|
},
|
|
14
|
-
"bin": "dist/
|
|
15
|
+
"bin": "dist/bin/npm-update-package.js",
|
|
15
16
|
"engines": {
|
|
16
17
|
"node": ">=20"
|
|
17
18
|
},
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/{src/outdated-package-processor → outdated-package-processor}/create/Create.js
RENAMED
|
File without changes
|
/package/dist/{src/outdated-package-processor → outdated-package-processor}/recreate/Recreate.js
RENAMED
|
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
|
|
File without changes
|
|
File without changes
|