From 37f9563ad20dc041b07a3ff9e30cdc6f927f74e5 Mon Sep 17 00:00:00 2001 From: Samir AMZANI Date: Wed, 13 Mar 2024 08:27:59 +0100 Subject: [PATCH] feat: migrate @oclif/core from v2 to v3 --- bin/dev | 20 +-- bin/run | 9 +- package-lock.json | 358 ++++++++++++------------------------------- package.json | 2 +- src/commands/diff.ts | 2 +- src/parser.ts | 6 +- 6 files changed, 110 insertions(+), 287 deletions(-) diff --git a/bin/dev b/bin/dev index b3a84cbba1b..213d8904f67 100644 --- a/bin/dev +++ b/bin/dev @@ -1,18 +1,4 @@ -#!/usr/bin/env nod - -const oclif = require('@oclif/core') - -const path = require('path') -const project = path.join(__dirname, '..', 'tsconfig.json') - -// In dev mode -> use ts-node and dev plugins -process.env.NODE_ENV = 'development' - -require('ts-node').register({project}) - -// In dev mode, always show stack traces -oclif.settings.debug = true; - -// Start the CLI -oclif.run().then(oclif.flush).catch(oclif.Errors.handle) +#!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning +import {execute} from '@oclif/core'; +await execute({development: true, dir: import.meta.url}); diff --git a/bin/run b/bin/run index 330b6c39987..3def21a6611 100755 --- a/bin/run +++ b/bin/run @@ -1,11 +1,6 @@ #!/usr/bin/env node -const oclif = require('@oclif/core'); +import {execute} from '@oclif/core'; -oclif.run() - .then(require('@oclif/core/flush')) - .catch((err) => { - const oclifHandler = require('@oclif/core/handle'); - return oclifHandler(err.message); - }); +await execute({dir: import.meta.url}); diff --git a/package-lock.json b/package-lock.json index 59bc0376882..0f2bb8bc16a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -21,7 +21,7 @@ "@asyncapi/protobuf-schema-parser": "^3.2.4", "@asyncapi/raml-dt-schema-parser": "^4.0.14", "@asyncapi/studio": "^0.20.0", - "@oclif/core": "^2", + "@oclif/core": "^3", "@oclif/errors": "^1.3.6", "@oclif/plugin-not-found": "^2.3.22", "@smoya/multi-parser": "^4.0.0", @@ -5038,41 +5038,41 @@ } }, "node_modules/@oclif/core": { - "version": "2.15.0", - "resolved": "https://registry.npmjs.org/@oclif/core/-/core-2.15.0.tgz", - "integrity": "sha512-fNEMG5DzJHhYmI3MgpByTvltBOMyFcnRIUMxbiz2ai8rhaYgaTHMG3Q38HcosfIvtw9nCjxpcQtC8MN8QtVCcA==", + "version": "3.25.0", + "resolved": "https://registry.npmjs.org/@oclif/core/-/core-3.25.0.tgz", + "integrity": "sha512-6O6Q2buS4uZcH0l5YDo3rYQyquRm6uoshEFE1O1RGQsZhT7PCXo3PAoBU8SKLBZoUIurupXZqNJpW+BHUmatBw==", "dependencies": { - "@types/cli-progress": "^3.11.0", + "@types/cli-progress": "^3.11.5", "ansi-escapes": "^4.3.2", "ansi-styles": "^4.3.0", "cardinal": "^2.1.1", "chalk": "^4.1.2", "clean-stack": "^3.0.1", "cli-progress": "^3.12.0", + "color": "^4.2.3", "debug": "^4.3.4", - "ejs": "^3.1.8", + "ejs": "^3.1.9", "get-package-type": "^0.1.0", "globby": "^11.1.0", "hyperlinker": "^1.0.0", "indent-string": "^4.0.0", "is-wsl": "^2.2.0", "js-yaml": "^3.14.1", + "minimatch": "^9.0.3", "natural-orderby": "^2.0.3", "object-treeify": "^1.1.33", - "password-prompt": "^1.1.2", + "password-prompt": "^1.1.3", "slice-ansi": "^4.0.0", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "supports-color": "^8.1.1", "supports-hyperlinks": "^2.2.0", - "ts-node": "^10.9.1", - "tslib": "^2.5.0", "widest-line": "^3.1.0", "wordwrap": "^1.0.0", "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=14.0.0" + "node": ">=18.0.0" } }, "node_modules/@oclif/core/node_modules/argparse": { @@ -5082,6 +5082,14 @@ "sprintf-js": "~1.0.2" } }, + "node_modules/@oclif/core/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, "node_modules/@oclif/core/node_modules/globby": { "version": "11.1.0", "license": "MIT", @@ -5111,6 +5119,20 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/@oclif/core/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/@oclif/core/node_modules/wrap-ansi": { "version": "7.0.0", "license": "MIT", @@ -5192,45 +5214,57 @@ "node": ">=18.0.0" } }, - "node_modules/@oclif/plugin-help/node_modules/@oclif/core": { - "version": "3.24.0", - "resolved": "https://registry.npmjs.org/@oclif/core/-/core-3.24.0.tgz", - "integrity": "sha512-7winwcmTwimbihdDT8NjHppOEJG40DODLpP/F5DqLb+tVTxC8oFsoB7T9Ocj7fZyelgmMtnUz7XgvSZHj+6eCQ==", + "node_modules/@oclif/plugin-not-found": { + "version": "2.4.3", + "license": "MIT", "dependencies": { - "@types/cli-progress": "^3.11.5", + "@oclif/core": "^2.15.0", + "chalk": "^4", + "fast-levenshtein": "^3.0.0" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@oclif/plugin-not-found/node_modules/@oclif/core": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/@oclif/core/-/core-2.15.0.tgz", + "integrity": "sha512-fNEMG5DzJHhYmI3MgpByTvltBOMyFcnRIUMxbiz2ai8rhaYgaTHMG3Q38HcosfIvtw9nCjxpcQtC8MN8QtVCcA==", + "dependencies": { + "@types/cli-progress": "^3.11.0", "ansi-escapes": "^4.3.2", "ansi-styles": "^4.3.0", "cardinal": "^2.1.1", "chalk": "^4.1.2", "clean-stack": "^3.0.1", "cli-progress": "^3.12.0", - "color": "^4.2.3", "debug": "^4.3.4", - "ejs": "^3.1.9", + "ejs": "^3.1.8", "get-package-type": "^0.1.0", "globby": "^11.1.0", "hyperlinker": "^1.0.0", "indent-string": "^4.0.0", "is-wsl": "^2.2.0", "js-yaml": "^3.14.1", - "minimatch": "^9.0.3", "natural-orderby": "^2.0.3", "object-treeify": "^1.1.33", - "password-prompt": "^1.1.3", + "password-prompt": "^1.1.2", "slice-ansi": "^4.0.0", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "supports-color": "^8.1.1", "supports-hyperlinks": "^2.2.0", + "ts-node": "^10.9.1", + "tslib": "^2.5.0", "widest-line": "^3.1.0", "wordwrap": "^1.0.0", "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=18.0.0" + "node": ">=14.0.0" } }, - "node_modules/@oclif/plugin-help/node_modules/argparse": { + "node_modules/@oclif/plugin-not-found/node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", @@ -5238,15 +5272,7 @@ "sprintf-js": "~1.0.2" } }, - "node_modules/@oclif/plugin-help/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@oclif/plugin-help/node_modules/globby": { + "node_modules/@oclif/plugin-not-found/node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", @@ -5265,7 +5291,7 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@oclif/plugin-help/node_modules/js-yaml": { + "node_modules/@oclif/plugin-not-found/node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", @@ -5277,21 +5303,7 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@oclif/plugin-help/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@oclif/plugin-help/node_modules/wrap-ansi": { + "node_modules/@oclif/plugin-not-found/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", @@ -5307,18 +5319,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@oclif/plugin-not-found": { - "version": "2.4.3", - "license": "MIT", - "dependencies": { - "@oclif/core": "^2.15.0", - "chalk": "^4", - "fast-levenshtein": "^3.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/@oclif/plugin-warn-if-update-available": { "version": "3.0.12", "resolved": "https://registry.npmjs.org/@oclif/plugin-warn-if-update-available/-/plugin-warn-if-update-available-3.0.12.tgz", @@ -5334,101 +5334,82 @@ "node": ">=18.0.0" } }, - "node_modules/@oclif/plugin-warn-if-update-available/node_modules/@oclif/core": { - "version": "3.24.0", - "resolved": "https://registry.npmjs.org/@oclif/core/-/core-3.24.0.tgz", - "integrity": "sha512-7winwcmTwimbihdDT8NjHppOEJG40DODLpP/F5DqLb+tVTxC8oFsoB7T9Ocj7fZyelgmMtnUz7XgvSZHj+6eCQ==", + "node_modules/@oclif/plugin-warn-if-update-available/node_modules/chalk": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", + "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@oclif/test": { + "version": "2.5.6", + "dev": true, + "license": "MIT", "dependencies": { - "@types/cli-progress": "^3.11.5", + "@oclif/core": "^2.15.0", + "fancy-test": "^2.0.42" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@oclif/test/node_modules/@oclif/core": { + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/@oclif/core/-/core-2.15.0.tgz", + "integrity": "sha512-fNEMG5DzJHhYmI3MgpByTvltBOMyFcnRIUMxbiz2ai8rhaYgaTHMG3Q38HcosfIvtw9nCjxpcQtC8MN8QtVCcA==", + "dev": true, + "dependencies": { + "@types/cli-progress": "^3.11.0", "ansi-escapes": "^4.3.2", "ansi-styles": "^4.3.0", "cardinal": "^2.1.1", "chalk": "^4.1.2", "clean-stack": "^3.0.1", "cli-progress": "^3.12.0", - "color": "^4.2.3", "debug": "^4.3.4", - "ejs": "^3.1.9", + "ejs": "^3.1.8", "get-package-type": "^0.1.0", "globby": "^11.1.0", "hyperlinker": "^1.0.0", "indent-string": "^4.0.0", "is-wsl": "^2.2.0", "js-yaml": "^3.14.1", - "minimatch": "^9.0.3", "natural-orderby": "^2.0.3", "object-treeify": "^1.1.33", - "password-prompt": "^1.1.3", + "password-prompt": "^1.1.2", "slice-ansi": "^4.0.0", "string-width": "^4.2.3", "strip-ansi": "^6.0.1", "supports-color": "^8.1.1", "supports-hyperlinks": "^2.2.0", + "ts-node": "^10.9.1", + "tslib": "^2.5.0", "widest-line": "^3.1.0", "wordwrap": "^1.0.0", "wrap-ansi": "^7.0.0" }, "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/@oclif/plugin-warn-if-update-available/node_modules/@oclif/core/node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@oclif/plugin-warn-if-update-available/node_modules/@oclif/core/node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" + "node": ">=14.0.0" } }, - "node_modules/@oclif/plugin-warn-if-update-available/node_modules/argparse": { + "node_modules/@oclif/test/node_modules/argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, "dependencies": { "sprintf-js": "~1.0.2" } }, - "node_modules/@oclif/plugin-warn-if-update-available/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/@oclif/plugin-warn-if-update-available/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/@oclif/plugin-warn-if-update-available/node_modules/globby": { + "node_modules/@oclif/test/node_modules/globby": { "version": "11.1.0", "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "dependencies": { "array-union": "^2.1.0", "dir-glob": "^3.0.1", @@ -5444,10 +5425,11 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@oclif/plugin-warn-if-update-available/node_modules/js-yaml": { + "node_modules/@oclif/test/node_modules/js-yaml": { "version": "3.14.1", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -5456,24 +5438,11 @@ "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@oclif/plugin-warn-if-update-available/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/@oclif/plugin-warn-if-update-available/node_modules/wrap-ansi": { + "node_modules/@oclif/test/node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -5486,18 +5455,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@oclif/test": { - "version": "2.5.6", - "dev": true, - "license": "MIT", - "dependencies": { - "@oclif/core": "^2.15.0", - "fancy-test": "^2.0.42" - }, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/@octokit/auth-token": { "version": "2.5.0", "license": "MIT", @@ -15923,44 +15880,6 @@ "node": ">=18.0.0" } }, - "node_modules/oclif/node_modules/@oclif/core": { - "version": "3.24.0", - "resolved": "https://registry.npmjs.org/@oclif/core/-/core-3.24.0.tgz", - "integrity": "sha512-7winwcmTwimbihdDT8NjHppOEJG40DODLpP/F5DqLb+tVTxC8oFsoB7T9Ocj7fZyelgmMtnUz7XgvSZHj+6eCQ==", - "dependencies": { - "@types/cli-progress": "^3.11.5", - "ansi-escapes": "^4.3.2", - "ansi-styles": "^4.3.0", - "cardinal": "^2.1.1", - "chalk": "^4.1.2", - "clean-stack": "^3.0.1", - "cli-progress": "^3.12.0", - "color": "^4.2.3", - "debug": "^4.3.4", - "ejs": "^3.1.9", - "get-package-type": "^0.1.0", - "globby": "^11.1.0", - "hyperlinker": "^1.0.0", - "indent-string": "^4.0.0", - "is-wsl": "^2.2.0", - "js-yaml": "^3.14.1", - "minimatch": "^9.0.3", - "natural-orderby": "^2.0.3", - "object-treeify": "^1.1.33", - "password-prompt": "^1.1.3", - "slice-ansi": "^4.0.0", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "supports-color": "^8.1.1", - "supports-hyperlinks": "^2.2.0", - "widest-line": "^3.1.0", - "wordwrap": "^1.0.0", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, "node_modules/oclif/node_modules/@oclif/plugin-not-found": { "version": "3.0.13", "resolved": "https://registry.npmjs.org/@oclif/plugin-not-found/-/plugin-not-found-3.0.13.tgz", @@ -15985,22 +15904,6 @@ "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/oclif/node_modules/argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", - "dependencies": { - "sprintf-js": "~1.0.2" - } - }, - "node_modules/oclif/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dependencies": { - "balanced-match": "^1.0.0" - } - }, "node_modules/oclif/node_modules/builtins": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", @@ -16021,37 +15924,6 @@ "node": ">=6 <7 || >=8" } }, - "node_modules/oclif/node_modules/globby": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", - "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", - "dependencies": { - "array-union": "^2.1.0", - "dir-glob": "^3.0.1", - "fast-glob": "^3.2.9", - "ignore": "^5.2.0", - "merge2": "^1.4.1", - "slash": "^3.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/oclif/node_modules/js-yaml": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", - "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", - "dependencies": { - "argparse": "^1.0.7", - "esprima": "^4.0.0" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, "node_modules/oclif/node_modules/jsonfile": { "version": "4.0.0", "license": "MIT", @@ -16059,20 +15931,6 @@ "graceful-fs": "^4.1.6" } }, - "node_modules/oclif/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "node_modules/oclif/node_modules/universalify": { "version": "0.1.2", "license": "MIT", @@ -16091,22 +15949,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/oclif/node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, "node_modules/once": { "version": "1.4.0", "license": "ISC", diff --git a/package.json b/package.json index db742a6713d..1a10fc11589 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "@asyncapi/protobuf-schema-parser": "^3.2.4", "@asyncapi/raml-dt-schema-parser": "^4.0.14", "@asyncapi/studio": "^0.20.0", - "@oclif/core": "^2", + "@oclif/core": "^3", "@oclif/errors": "^1.3.6", "@oclif/plugin-not-found": "^2.3.22", "@smoya/multi-parser": "^4.0.0", diff --git a/src/commands/diff.ts b/src/commands/diff.ts index 993111e2e24..009e00911e9 100644 --- a/src/commands/diff.ts +++ b/src/commands/diff.ts @@ -74,7 +74,7 @@ export default class Diff extends Command { let firstDocument: Specification, secondDocument: Specification; checkAndWarnFalseFlag(outputFormat, markdownSubtype); - markdownSubtype = setDefaultMarkdownSubtype(outputFormat, markdownSubtype); + markdownSubtype = setDefaultMarkdownSubtype(outputFormat, markdownSubtype) as string; try { firstDocument = await load(firstDocumentPath); diff --git a/src/parser.ts b/src/parser.ts index 131bad7e5da..97de707aede 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -40,14 +40,14 @@ export function validationFlags({ logDiagnostics = true }: ValidationFlagsOption default: logDiagnostics, allowNo: true, }), - 'diagnostics-format': Flags.custom({ + 'diagnostics-format': Flags.option({ description: 'format to use for validation diagnostics', options: Object.values(OutputFormat), default: OutputFormat.STYLISH, })(), - 'fail-severity': Flags.custom({ + 'fail-severity': Flags.option({ description: 'diagnostics of this level or above will trigger a failure exit code', - options: ['error', 'warn', 'info', 'hint'], + options: ['error', 'warn', 'info', 'hint'] as const, default: 'error', })(), };