Skip to content

Commit

Permalink
Prerelease/v4 (#394)
Browse files Browse the repository at this point in the history
* feat: use oclif/core v3

* chore: cleanup

* chore: bump deps

* test: dont rm core for external nuts

* chore: bump core

* feat: bump oclif/core

* chore(release): 4.0.0-beta.1 [skip ci]

* chore(release): 4.0.0-beta.2 [skip ci]

* fix: bump oclif/core

* chore(release): 4.0.0-beta.3 [skip ci]

* fix: bump core

* chore: yarn.lock conflicts

* fix: bump core

* chore(release): 4.0.0-beta.4 [skip ci]

* chore: revert change to test.yml

* chore(release): 4.0.0-beta.5 [skip ci]

* chore: use latest core

---------

Co-authored-by: svc-cli-bot <[email protected]>
  • Loading branch information
mdonnalley and svc-cli-bot authored Oct 4, 2023
1 parent 737acf0 commit b196d81
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 20 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -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",
Expand Down
24 changes: 8 additions & 16 deletions src/flags/orgFlags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,10 @@ export const getHubOrThrow = async (aliasOrUsername?: string): Promise<Org> => {
*/
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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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();
Expand Down
4 changes: 2 additions & 2 deletions test/unit/ux/spinner.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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', () => {
Expand All @@ -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', () => {
Expand Down
31 changes: 31 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit b196d81

Please sign in to comment.