From f6dd2f943f35b6a9f243fa50f1cfbd0ac8103ffc Mon Sep 17 00:00:00 2001 From: Roy Razon Date: Sun, 26 Nov 2023 15:30:58 +0200 Subject: [PATCH] fix: command id parsing bug in oclif patch for PR https://github.com/oclif/core/pull/886 --- packages/cli/package.json | 3 ++- patches/@oclif+core+3.12.0.patch | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/packages/cli/package.json b/packages/cli/package.json index f39d14b0..42da07e7 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -34,6 +34,7 @@ "inquirer-autocomplete-prompt": "^2.0.0", "iter-tools-es": "^7.5.3", "lodash": "^4.17.21", + "patch-package": "^8.0.0", "shell-escape": "^0.2.0", "yaml": "^2.3.2" }, @@ -104,7 +105,7 @@ "prepack": "yarn build && oclif manifest && oclif readme --dir docs --multi && ./scripts/prepare_and_copy_docs.sh", "cli": "./bin/dev", "version": "oclif readme && git add README.md", - "bump-to": "yarn version --no-commit-hooks --no-git-tag-version --new-version" + "postinstall": "$(npm bin)/patch-package" }, "engines": { "node": ">=18.0.0" diff --git a/patches/@oclif+core+3.12.0.patch b/patches/@oclif+core+3.12.0.patch index 4b6f2b58..1c47b06b 100644 --- a/patches/@oclif+core+3.12.0.patch +++ b/patches/@oclif+core+3.12.0.patch @@ -1,3 +1,16 @@ +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