From 12a8d1fa05faa8dc0f454d8e8773685f88cd71ee Mon Sep 17 00:00:00 2001 From: Roy Razon Date: Mon, 27 Nov 2023 09:40:57 +0200 Subject: [PATCH] publish patched @oclif/core --- .github/workflows/npm-publish-canary.yaml | 2 +- package.json | 4 +-- packages/cli-common/package.json | 2 +- packages/cli/package.json | 7 +++-- packages/cli/scripts/validate-tsconfig | 14 +++++++++ packages/cli/tsconfig.json | 4 +-- packages/cli/validate-tsconfig.js | 0 packages/driver-azure/package.json | 2 +- packages/driver-gce/package.json | 2 +- packages/driver-kube-pod/package.json | 2 +- packages/driver-lightsail/package.json | 2 +- packages/plugin-github/package.json | 2 +- patches/@oclif+core+3.12.0.patch | 38 ----------------------- yarn.lock | 34 +++++++++++++++++++- 14 files changed, 61 insertions(+), 54 deletions(-) create mode 100755 packages/cli/scripts/validate-tsconfig create mode 100644 packages/cli/validate-tsconfig.js delete mode 100644 patches/@oclif+core+3.12.0.patch diff --git a/.github/workflows/npm-publish-canary.yaml b/.github/workflows/npm-publish-canary.yaml index 6f92e073..838f8542 100644 --- a/.github/workflows/npm-publish-canary.yaml +++ b/.github/workflows/npm-publish-canary.yaml @@ -64,7 +64,7 @@ jobs: git commit -m "canary version $VERSION" lerna.json packages/*/package.json # publish - yarn -s lerna publish from-package --pre-dist-tag $GIT_ID --yes + yarn -s lerna publish from-package --pre-dist-tag $GIT_ID --dist-tag $GIT_ID --yes # undo the commit git reset --hard HEAD^1 diff --git a/package.json b/package.json index 2287254d..987b3b9b 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,6 @@ { "private": true, - "workspaces": [ - "packages/*" - ], + "workspaces": ["packages/*"], "devDependencies": { "husky": "^8.0.0", "lerna": "^6.6.2", diff --git a/packages/cli-common/package.json b/packages/cli-common/package.json index debfdddd..6dd4687f 100644 --- a/packages/cli-common/package.json +++ b/packages/cli-common/package.json @@ -8,7 +8,7 @@ ], "license": "Apache-2.0", "dependencies": { - "@oclif/core": "^3", + "@oclif/core": "livecycle/oclif-core-patched-for-preevy#v3.12.0-preevy-patch", "@preevy/core": "0.0.56", "chalk": "^4.1.2", "iter-tools-es": "^7.5.3", diff --git a/packages/cli/package.json b/packages/cli/package.json index 531d0cd6..5db1798a 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -15,11 +15,12 @@ "/static", "/dist", "/yarn.lock", - "/oclif.manifest.json" + "/oclif.manifest.json", + "/patches" ], "dependencies": { "@inquirer/confirm": "^2.0.14", - "@oclif/core": "^3", + "@oclif/core": "livecycle/oclif-core-patched-for-preevy#v3.12.0-preevy-patch", "@oclif/plugin-help": "^5", "@preevy/cli-common": "0.0.56", "@preevy/common": "0.0.56", @@ -102,7 +103,7 @@ "lint": "eslint . --ext .ts --cache", "postpack": "shx rm -f oclif.manifest.json", "posttest": "yarn lint", - "prepack": "yarn build && oclif manifest && oclif readme --dir docs --multi && ./scripts/prepare_and_copy_docs.sh", + "prepack": "yarn build && ./scripts/validate-tsconfig && oclif manifest && oclif readme --dir docs --multi && ./scripts/prepare_and_copy_docs.sh", "cli": "./bin/dev", "version": "oclif readme && git add README.md" }, diff --git a/packages/cli/scripts/validate-tsconfig b/packages/cli/scripts/validate-tsconfig new file mode 100755 index 00000000..507b6b0d --- /dev/null +++ b/packages/cli/scripts/validate-tsconfig @@ -0,0 +1,14 @@ +#!/usr/bin/env node +const path = require('path') +const util = require('util') +const fs = require('fs') + +const tsConfig = path.join(__dirname, '..', './tsconfig.json') + +try { + JSON.parse(fs.readFileSync('./tsconfig.json')) +} catch (e) { + console.error('Error parsing %s: oclif expects valid JSON: %j', tsConfig, util.inspect(e)) + process.exit(1) +} + diff --git a/packages/cli/tsconfig.json b/packages/cli/tsconfig.json index 6a6122df..9712537f 100644 --- a/packages/cli/tsconfig.json +++ b/packages/cli/tsconfig.json @@ -10,7 +10,7 @@ "lib": ["es2022"], "esModuleInterop": true, "sourceMap": true, - "baseUrl": ".", + "baseUrl": "." }, "include": [ "src/**/*" @@ -25,6 +25,6 @@ { "path": "../driver-gce" }, { "path": "../driver-azure" }, { "path": "../driver-kube-pod" }, - { "path": "../plugin-github" }, + { "path": "../plugin-github" } ] } diff --git a/packages/cli/validate-tsconfig.js b/packages/cli/validate-tsconfig.js new file mode 100644 index 00000000..e69de29b diff --git a/packages/driver-azure/package.json b/packages/driver-azure/package.json index ece83d7b..c74b7020 100644 --- a/packages/driver-azure/package.json +++ b/packages/driver-azure/package.json @@ -17,7 +17,7 @@ "@azure/arm-subscriptions": "^5.1.0", "@azure/identity": "^3.2.2", "@azure/logger": "^1.0.4", - "@oclif/core": "^3", + "@oclif/core": "livecycle/oclif-core-patched-for-preevy#v3.12.0-preevy-patch", "@preevy/core": "0.0.56", "inquirer": "^8.0.0", "inquirer-autocomplete-prompt": "^2.0.0", diff --git a/packages/driver-gce/package.json b/packages/driver-gce/package.json index 9e734f4e..31af21ca 100644 --- a/packages/driver-gce/package.json +++ b/packages/driver-gce/package.json @@ -12,7 +12,7 @@ "dependencies": { "@google-cloud/compute": "^4.0.1", "@google-cloud/storage": "^6.9.5", - "@oclif/core": "^3", + "@oclif/core": "livecycle/oclif-core-patched-for-preevy#v3.12.0-preevy-patch", "@preevy/core": "0.0.56", "google-auth-library": "^8.7.0", "google-gax": "^4.0.4", diff --git a/packages/driver-kube-pod/package.json b/packages/driver-kube-pod/package.json index e558b85b..49cd4205 100644 --- a/packages/driver-kube-pod/package.json +++ b/packages/driver-kube-pod/package.json @@ -11,7 +11,7 @@ "license": "Apache-2.0", "dependencies": { "@kubernetes/client-node": "^0.18.1", - "@oclif/core": "^3", + "@oclif/core": "livecycle/oclif-core-patched-for-preevy#v3.12.0-preevy-patch", "@preevy/common": "0.0.56", "@preevy/core": "0.0.56", "fast-safe-stringify": "^2.1.1", diff --git a/packages/driver-lightsail/package.json b/packages/driver-lightsail/package.json index ca075b2b..ed54614a 100644 --- a/packages/driver-lightsail/package.json +++ b/packages/driver-lightsail/package.json @@ -14,7 +14,7 @@ "@aws-sdk/client-s3": "^3.271.0", "@aws-sdk/client-sts": "^3.289.0", "@aws-sdk/util-waiter": "^3.271.0", - "@oclif/core": "^3", + "@oclif/core": "livecycle/oclif-core-patched-for-preevy#v3.12.0-preevy-patch", "@preevy/core": "0.0.56", "inquirer": "^8.0.0", "inquirer-autocomplete-prompt": "^2.0.0", diff --git a/packages/plugin-github/package.json b/packages/plugin-github/package.json index 3e29ed36..0b90c301 100644 --- a/packages/plugin-github/package.json +++ b/packages/plugin-github/package.json @@ -8,7 +8,7 @@ ], "license": "Apache-2.0", "dependencies": { - "@oclif/core": "^3", + "@oclif/core": "livecycle/oclif-core-patched-for-preevy#v3.12.0-preevy-patch", "@preevy/cli-common": "0.0.56", "@preevy/core": "0.0.56", "lodash": "^4.17.21", diff --git a/patches/@oclif+core+3.12.0.patch b/patches/@oclif+core+3.12.0.patch deleted file mode 100644 index 1c47b06b..00000000 --- a/patches/@oclif+core+3.12.0.patch +++ /dev/null @@ -1,38 +0,0 @@ -diff --git a/node_modules/@oclif/core/lib/help/util.js b/node_modules/@oclif/core/lib/help/util.js -index 6c97a31..3a7ace6 100644 ---- a/node_modules/@oclif/core/lib/help/util.js -+++ b/node_modules/@oclif/core/lib/help/util.js -@@ -43,7 +43,7 @@ function collateSpacedCmdIDFromArgs(argv, config) { - const ids = (0, util_1.collectUsableIds)(config.commandIDs); - const final = []; - const idPresent = (id) => ids.has(id); -- const finalizeId = (s) => (s ? [...final, s].join(':') : final.join(':')); -+ const finalizeId = (s) => (s ? [...final, s] : final).filter(Boolean).join(':'); - const hasArgs = () => { - const id = finalizeId(); - if (!id) -diff --git a/node_modules/@oclif/core/lib/interfaces/parser.d.ts b/node_modules/@oclif/core/lib/interfaces/parser.d.ts -index acb8583..2d53745 100644 ---- a/node_modules/@oclif/core/lib/interfaces/parser.d.ts -+++ b/node_modules/@oclif/core/lib/interfaces/parser.d.ts -@@ -200,6 +200,7 @@ export type OptionFlagProps = FlagProps & { - helpValue?: string; - options?: readonly string[]; - multiple?: boolean; -+ singleValue?: boolean; - /** - * Delimiter to separate the values for a multiple value flag. - * Only respected if multiple is set to true. Default behavior is to -diff --git a/node_modules/@oclif/core/lib/parser/parse.js b/node_modules/@oclif/core/lib/parser/parse.js -index 032063d..72d2ed5 100644 ---- a/node_modules/@oclif/core/lib/parser/parse.js -+++ b/node_modules/@oclif/core/lib/parser/parse.js -@@ -145,7 +145,7 @@ class Parser { - continue; - } - } -- if (parsingFlags && this.currentFlag && this.currentFlag.multiple) { -+ if (parsingFlags && this.currentFlag && this.currentFlag.multiple && !this.currentFlag.singleValue) { - this.raw.push({ flag: this.currentFlag.name, input, type: 'flag' }); - continue; - } diff --git a/yarn.lock b/yarn.lock index 0fa88379..585bd3b5 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2562,7 +2562,7 @@ wordwrap "^1.0.0" wrap-ansi "^7.0.0" -"@oclif/core@^3", "@oclif/core@^3.0.4", "@oclif/core@^3.11.0": +"@oclif/core@^3.0.4", "@oclif/core@^3.11.0": version "3.12.0" resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.12.0.tgz#4b38b1b5dab2f7585f89c3927a8a157b258b4bd6" integrity sha512-mT1Vpd1E20IJ7P6GDYOivylPdTHq/xVgFjeCDjitFW86UAklFM8BEFyFB7KpsTvpmjRbCoda3yU10lSI1224lw== @@ -2595,6 +2595,38 @@ wordwrap "^1.0.0" wrap-ansi "^7.0.0" +"@oclif/core@livecycle/oclif-core-patched-for-preevy#v3.12.0-preevy-patch": + version "3.12.0" + resolved "https://codeload.github.com/livecycle/oclif-core-patched-for-preevy/tar.gz/dab8b2ff6fb68b264d6633679826e7b6f9d428f6" + dependencies: + 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" + natural-orderby "^2.0.3" + object-treeify "^1.1.33" + 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" + tsconfck "^3.0.0" + widest-line "^3.1.0" + wordwrap "^1.0.0" + wrap-ansi "^7.0.0" + "@oclif/plugin-help@^5", "@oclif/plugin-help@^5.2.14": version "5.2.20" resolved "https://registry.yarnpkg.com/@oclif/plugin-help/-/plugin-help-5.2.20.tgz#4035a0ac231f95fb8e334da342175e3ca00f6abc"