From 2235c29834dd7fb0670ba87ef4d9b83768465eb4 Mon Sep 17 00:00:00 2001 From: Raine Revere <raine@cybersemics.org> Date: Thu, 14 Mar 2024 19:36:51 +0000 Subject: [PATCH] Upgrade typescript-json-schema. Cannot leave lone @ in jsdoc comment in typescript-json-schema >= v0.60.0. See: https://github.com/YousefED/typescript-json-schema/issues/568 --- .ncurc.js | 3 --- README.md | 4 ++-- package-lock.json | 20 +++++++++----------- package.json | 2 +- src/cli-options.ts | 2 +- src/types/RunOptions.json | 8 +++----- src/types/RunOptions.ts | 2 +- 7 files changed, 17 insertions(+), 24 deletions(-) diff --git a/.ncurc.js b/.ncurc.js index 9deb0988..014c5351 100644 --- a/.ncurc.js +++ b/.ncurc.js @@ -9,8 +9,5 @@ module.exports = { 'untildify', // major changes required to upgrade to v3 'spawn-please', - // v0.60.0 breaks cli option description output - // https://github.com/YousefED/typescript-json-schema/issues/568 - 'typescript-json-schema', ], } diff --git a/README.md b/README.md index ce8149d9..96b8f566 100644 --- a/README.md +++ b/README.md @@ -344,7 +344,7 @@ Options that take no arguments can be negated by prefixing them with `--no-`, e. </tr> <tr> <td><a href="#target">-t, --target <value></a></td> - <td>Determines the version to upgrade to: latest, newest, greatest, minor, patch, semver, @[tag], or [function]. (default: latest)</td> + <td>Determines the version to upgrade to: latest, newest, greatest, minor, patch, semver, <code>@[tag]<code>, or [function]. (default: latest)</td> </tr> <tr> <td>--timeout <ms></td> @@ -715,7 +715,7 @@ The predicate function is only available in .ncurc.js or when importing npm-chec (See: https://git.coolaj86.com/coolaj86/semver-utils.js#semverutils-parse-semverstring) @returns True if the package should be excluded, false if it should be included. */ -filterVersionFunction: (name, semver) => { +rejectVersionFunction: (name, semver) => { if (name.startsWith('@myorg/') && parseInt(semver[0]?.major) > 5) { return true } diff --git a/package-lock.json b/package-lock.json index d5fd9d46..3c5e2239 100644 --- a/package-lock.json +++ b/package-lock.json @@ -94,7 +94,7 @@ "strip-ansi": "^7.1.0", "ts-node": "^10.9.2", "typescript": "^5.4.2", - "typescript-json-schema": "^0.57.0", + "typescript-json-schema": "^0.63.0", "yarn": "^1.22.22" }, "engines": { @@ -8621,11 +8621,10 @@ } }, "node_modules/typescript-json-schema": { - "version": "0.57.0", - "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.57.0.tgz", - "integrity": "sha512-xirQK0s95K3OL7Knve0OOxQHErByCxUsgXr5oCHa9J0jWgiA+9/tidHWPu1UMjRv7MoX5ViP6QmOrWCi+dvRew==", + "version": "0.63.0", + "resolved": "https://registry.npmjs.org/typescript-json-schema/-/typescript-json-schema-0.63.0.tgz", + "integrity": "sha512-vBfMBq4U/rZ5FIRi7u4o/YAdeRHsSabdGHogUlCPi0cYU0CGvS4Bdu8bSzyUsF+Kf5PTQUGh2TictJuQTDK6eQ==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "@types/json-schema": "^7.0.9", "@types/node": "^16.9.2", @@ -8633,7 +8632,7 @@ "path-equal": "^1.2.5", "safe-stable-stringify": "^2.2.0", "ts-node": "^10.9.1", - "typescript": "~4.9.5", + "typescript": "~5.1.0", "yargs": "^17.1.1" }, "bin": { @@ -8789,17 +8788,16 @@ } }, "node_modules/typescript-json-schema/node_modules/typescript": { - "version": "4.9.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", - "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", "dev": true, - "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=4.2.0" + "node": ">=14.17" } }, "node_modules/typescript-json-schema/node_modules/wrap-ansi": { diff --git a/package.json b/package.json index 241f9146..33aec74e 100644 --- a/package.json +++ b/package.json @@ -141,7 +141,7 @@ "strip-ansi": "^7.1.0", "ts-node": "^10.9.2", "typescript": "^5.4.2", - "typescript-json-schema": "^0.57.0", + "typescript-json-schema": "^0.63.0", "yarn": "^1.22.22" }, "files": [ diff --git a/src/cli-options.ts b/src/cli-options.ts index 9773abbc..75d7d7bc 100755 --- a/src/cli-options.ts +++ b/src/cli-options.ts @@ -842,7 +842,7 @@ const cliOptions: CLIOption[] = [ long: 'target', short: 't', arg: 'value', - description: `Determines the version to upgrade to: latest, newest, greatest, minor, patch, semver, @[tag], or [function]. (default: latest)`, + description: `Determines the version to upgrade to: latest, newest, greatest, minor, patch, semver, \`@[tag]\`, or [function]. (default: latest)`, help: extendedHelpTarget, // eslint-disable-next-line no-template-curly-in-string type: `${supportedVersionTargets.map(s => `'${s}'`).join(' | ')} | ${'`@${string}`'} | TargetFunction`, diff --git a/src/types/RunOptions.json b/src/types/RunOptions.json index e235553e..9cbcd30d 100644 --- a/src/types/RunOptions.json +++ b/src/types/RunOptions.json @@ -474,10 +474,8 @@ "target": { "anyOf": [ { - "items": { - "type": "string" - }, - "type": "array" + "pattern": "^@.*$", + "type": "string" }, { "description": "A function that can be provided to the --target option for custom filtering.", @@ -488,7 +486,7 @@ "type": "string" } ], - "description": "Determines the version to upgrade to: latest, newest, greatest, minor, patch, semver, @[tag], or [function]. (default: latest) Run \"ncu --help --target\" for details." + "description": "Determines the version to upgrade to: latest, newest, greatest, minor, patch, semver, `@[tag]`, or [function]. (default: latest) Run \"ncu --help --target\" for details." }, "timeout": { "description": "Global timeout in milliseconds. (default: no global timeout and 30 seconds per npm-registry-fetch)", diff --git a/src/types/RunOptions.ts b/src/types/RunOptions.ts index 84611895..e488a911 100644 --- a/src/types/RunOptions.ts +++ b/src/types/RunOptions.ts @@ -172,7 +172,7 @@ export interface RunOptions { /** Read package.json from stdin. */ stdin?: string - /** Determines the version to upgrade to: latest, newest, greatest, minor, patch, semver, @[tag], or [function]. (default: latest) Run "ncu --help --target" for details. */ + /** Determines the version to upgrade to: latest, newest, greatest, minor, patch, semver, `@[tag]`, or [function]. (default: latest) Run "ncu --help --target" for details. */ target?: 'latest' | 'newest' | 'greatest' | 'minor' | 'patch' | 'semver' | `@${string}` | TargetFunction /** Global timeout in milliseconds. (default: no global timeout and 30 seconds per npm-registry-fetch) */