diff --git a/package.json b/package.json index 1336977c..a05a0794 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@salesforce/sf-plugins-core", - "version": "3.1.28", + "version": "4.0.0-beta.5", "description": "Utils for writing Salesforce CLI plugins", "main": "lib/exported", "types": "lib/exported.d.ts", @@ -35,7 +35,7 @@ "node": ">=16.0.0" }, "dependencies": { - "@oclif/core": "^2.15.0", + "@oclif/core": "^3.0.0", "@salesforce/core": "^5.3.1", "@salesforce/kit": "^3.0.13", "@salesforce/ts-types": "^2.0.7", diff --git a/src/flags/orgFlags.ts b/src/flags/orgFlags.ts index 7e4bc9bd..b0981a6f 100644 --- a/src/flags/orgFlags.ts +++ b/src/flags/orgFlags.ts @@ -100,12 +100,10 @@ export const getHubOrThrow = async (aliasOrUsername?: string): Promise => { */ export const optionalOrgFlag = Flags.custom({ char: 'o', + noCacheDefault: true, parse: async (input: string | undefined) => maybeGetOrg(input), default: async () => maybeGetOrg(), - defaultHelp: async (context, isWritingManifest) => { - if (isWritingManifest) { - return undefined; - } + defaultHelp: async (context) => { if (context.options instanceof Org) { const org = context.options as Org; return org.getUsername(); @@ -139,12 +137,10 @@ export const optionalOrgFlag = Flags.custom({ export const requiredOrgFlag = Flags.custom({ char: 'o', summary: messages.getMessage('flags.targetOrg.summary'), + noCacheDefault: true, parse: async (input: string | undefined) => getOrgOrThrow(input), default: async () => getOrgOrThrow(), - defaultHelp: async (context, isWritingManifest) => { - if (isWritingManifest) { - return undefined; - } + defaultHelp: async (context) => { if (context.options instanceof Org) { const org = context.options as Org; return org.getUsername(); @@ -179,12 +175,10 @@ export const requiredOrgFlag = Flags.custom({ export const requiredHubFlag = Flags.custom({ char: 'v', summary: messages.getMessage('flags.targetDevHubOrg.summary'), + noCacheDefault: true, parse: async (input: string | undefined) => getHubOrThrow(input), default: async () => getHubOrThrow(), - defaultHelp: async (context, isWritingManifest) => { - if (isWritingManifest) { - return undefined; - } + defaultHelp: async (context) => { if (context.options instanceof Org) { const org = context.options as Org; return org.getUsername(); @@ -218,12 +212,10 @@ export const requiredHubFlag = Flags.custom({ export const optionalHubFlag = Flags.custom({ char: 'v', summary: messages.getMessage('flags.targetDevHubOrg.summary'), + noCacheDefault: true, parse: async (input: string | undefined) => maybeGetHub(input), default: async () => maybeGetHub(), - defaultHelp: async (context, isWritingManifest) => { - if (isWritingManifest) { - return undefined; - } + defaultHelp: async (context) => { if (context.options instanceof Org) { const org = context.options as Org; return org.getUsername(); diff --git a/test/unit/ux/spinner.test.ts b/test/unit/ux/spinner.test.ts index 9ce638e0..786076fb 100644 --- a/test/unit/ux/spinner.test.ts +++ b/test/unit/ux/spinner.test.ts @@ -28,7 +28,7 @@ describe('Spinner', () => { const spinner = new Spinner(true); spinner.start('Doing things'); spinner.stop('Finished'); - expect(writeStub.firstCall.args).to.deep.equal(['stderr', 'Doing things...\n']); + expect(writeStub.firstCall.args).to.deep.equal(['stderr', 'Doing things...']); }); it('should not log anything if output is not enabled', () => { @@ -45,7 +45,7 @@ describe('Spinner', () => { spinner.start('Doing things'); spinner.pause(() => {}); spinner.stop('Finished'); - expect(writeStub.firstCall.args).to.deep.equal(['stderr', 'Doing things...\n']); + expect(writeStub.firstCall.args).to.deep.equal(['stderr', 'Doing things...']); }); it('should not log anything if output is not enabled', () => { diff --git a/yarn.lock b/yarn.lock index a7472409..c6e67328 100644 --- a/yarn.lock +++ b/yarn.lock @@ -566,6 +566,37 @@ wordwrap "^1.0.0" wrap-ansi "^7.0.0" +"@oclif/core@^3.0.0": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@oclif/core/-/core-3.0.0.tgz#9326d1cbd036ce20a1cda5e1854c1ec4d50dd717" + integrity sha512-zFHDOizZxRmmuPe6Jba3lLPXpjBxDNWIWSiV87E5DdSbzBPiUsWgXUNfDQENP2EL1vdRIPOeTPmFyob7K1tbBg== + 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" + debug "^4.3.4" + 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" + 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" + widest-line "^3.1.0" + wordwrap "^1.0.0" + wrap-ansi "^7.0.0" + "@oclif/test@^2.5.6": version "2.5.6" resolved "https://registry.yarnpkg.com/@oclif/test/-/test-2.5.6.tgz#454ae74260123f1436babbda8f93223079f3b66c"