@salesforce/plugin-org 4.3.0 → 4.3.1-dev.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -229,7 +229,7 @@ FLAG DESCRIPTIONS
229
229
  sandbox.
230
230
  ```
231
231
 
232
- _See code: [src/commands/org/create/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/create/sandbox.ts)_
232
+ _See code: [src/commands/org/create/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/create/sandbox.ts)_
233
233
 
234
234
  ## `sf org create scratch`
235
235
 
@@ -383,7 +383,7 @@ FLAG DESCRIPTIONS
383
383
  Omit this flag to have Salesforce generate a unique username for your org.
384
384
  ```
385
385
 
386
- _See code: [src/commands/org/create/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/create/scratch.ts)_
386
+ _See code: [src/commands/org/create/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/create/scratch.ts)_
387
387
 
388
388
  ## `sf org delete sandbox`
389
389
 
@@ -429,7 +429,7 @@ EXAMPLES
429
429
  $ sf org delete sandbox --target-org my-sandbox --no-prompt
430
430
  ```
431
431
 
432
- _See code: [src/commands/org/delete/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/delete/sandbox.ts)_
432
+ _See code: [src/commands/org/delete/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/delete/sandbox.ts)_
433
433
 
434
434
  ## `sf org delete scratch`
435
435
 
@@ -473,7 +473,7 @@ EXAMPLES
473
473
  $ sf org delete scratch --target-org my-scratch-org --no-prompt
474
474
  ```
475
475
 
476
- _See code: [src/commands/org/delete/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/delete/scratch.ts)_
476
+ _See code: [src/commands/org/delete/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/delete/scratch.ts)_
477
477
 
478
478
  ## `sf org disable tracking`
479
479
 
@@ -512,7 +512,7 @@ EXAMPLES
512
512
  $ sf org disable tracking
513
513
  ```
514
514
 
515
- _See code: [src/commands/org/disable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/disable/tracking.ts)_
515
+ _See code: [src/commands/org/disable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/disable/tracking.ts)_
516
516
 
517
517
  ## `sf org display`
518
518
 
@@ -557,7 +557,7 @@ EXAMPLES
557
557
  $ sf org display --target-org TestOrg1 --verbose
558
558
  ```
559
559
 
560
- _See code: [src/commands/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/display.ts)_
560
+ _See code: [src/commands/org/display.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/display.ts)_
561
561
 
562
562
  ## `sf org enable tracking`
563
563
 
@@ -599,7 +599,7 @@ EXAMPLES
599
599
  $ sf org enable tracking
600
600
  ```
601
601
 
602
- _See code: [src/commands/org/enable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/enable/tracking.ts)_
602
+ _See code: [src/commands/org/enable/tracking.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/enable/tracking.ts)_
603
603
 
604
604
  ## `sf org list`
605
605
 
@@ -638,7 +638,7 @@ EXAMPLES
638
638
  $ sf org list --clean
639
639
  ```
640
640
 
641
- _See code: [src/commands/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/list.ts)_
641
+ _See code: [src/commands/org/list.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/list.ts)_
642
642
 
643
643
  ## `sf org list metadata`
644
644
 
@@ -705,7 +705,7 @@ FLAG DESCRIPTIONS
705
705
  Examples of metadata types that use folders are Dashboard, Document, EmailTemplate, and Report.
706
706
  ```
707
707
 
708
- _See code: [src/commands/org/list/metadata.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/list/metadata.ts)_
708
+ _See code: [src/commands/org/list/metadata.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/list/metadata.ts)_
709
709
 
710
710
  ## `sf org list metadata-types`
711
711
 
@@ -760,7 +760,7 @@ FLAG DESCRIPTIONS
760
760
  Override the api version used for api requests made by this command
761
761
  ```
762
762
 
763
- _See code: [src/commands/org/list/metadata-types.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/list/metadata-types.ts)_
763
+ _See code: [src/commands/org/list/metadata-types.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/list/metadata-types.ts)_
764
764
 
765
765
  ## `sf org open`
766
766
 
@@ -832,7 +832,7 @@ EXAMPLES
832
832
  $ sf org open --source-file force-app/main/default/flows/Hello.flow-meta.xml
833
833
  ```
834
834
 
835
- _See code: [src/commands/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/open.ts)_
835
+ _See code: [src/commands/org/open.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/open.ts)_
836
836
 
837
837
  ## `sf org refresh sandbox`
838
838
 
@@ -911,7 +911,7 @@ FLAG DESCRIPTIONS
911
911
  By default, a sandbox auto-activates after a refresh. Use this flag to control sandbox activation manually.
912
912
  ```
913
913
 
914
- _See code: [src/commands/org/refresh/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/refresh/sandbox.ts)_
914
+ _See code: [src/commands/org/refresh/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/refresh/sandbox.ts)_
915
915
 
916
916
  ## `sf org resume sandbox`
917
917
 
@@ -974,7 +974,7 @@ FLAG DESCRIPTIONS
974
974
  returns the job ID. To resume checking the sandbox creation, rerun this command.
975
975
  ```
976
976
 
977
- _See code: [src/commands/org/resume/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/resume/sandbox.ts)_
977
+ _See code: [src/commands/org/resume/sandbox.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/resume/sandbox.ts)_
978
978
 
979
979
  ## `sf org resume scratch`
980
980
 
@@ -1021,6 +1021,6 @@ FLAG DESCRIPTIONS
1021
1021
  The job ID is valid for 24 hours after you start the scratch org creation.
1022
1022
  ```
1023
1023
 
1024
- _See code: [src/commands/org/resume/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.0/src/commands/org/resume/scratch.ts)_
1024
+ _See code: [src/commands/org/resume/scratch.ts](https://github.com/salesforcecli/plugin-org/blob/4.3.1-dev.0/src/commands/org/resume/scratch.ts)_
1025
1025
 
1026
1026
  <!-- commandsstop -->
@@ -4,12 +4,124 @@
4
4
  * Licensed under the BSD 3-Clause license.
5
5
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
6
  */
7
- import { Lifecycle, Messages, Org, scratchOrgCreate, scratchOrgLifecycleEventName, SfError, } from '@salesforce/core';
7
+ import { Lifecycle, Messages, Org, scratchOrgCreate, scratchOrgLifecycleEventName, scratchOrgLifecycleStages, SfError, } from '@salesforce/core';
8
8
  import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
9
9
  import { Duration } from '@salesforce/kit';
10
+ import React from 'react';
11
+ import { Box, Newline, Text } from 'ink';
12
+ import { capitalCase } from 'change-case';
13
+ import { Spinner, SpinnerOrError } from '../../../components/spinner.js';
10
14
  import { buildScratchOrgRequest } from '../../../shared/scratchOrgRequest.js';
11
- import { buildStatus } from '../../../shared/scratchOrgOutput.js';
12
- Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
15
+ import { formatOrgId, formatRequest, formatUsername } from '../../../shared/scratchOrgOutput.js';
16
+ import { render, BaseComponent } from '../../../components/baseComponent.js';
17
+ function Status(props) {
18
+ return (React.createElement(Box, { flexDirection: "column" },
19
+ React.createElement(Text, { bold: true }, "Creating Scratch Org"),
20
+ React.createElement(Box, { flexDirection: "column", marginRight: 2, padding: 1 },
21
+ (props.data?.scratchOrgInfo?.Id && (React.createElement(Text, null,
22
+ "Request Id: ",
23
+ formatRequest(props.baseUrl, props.data?.scratchOrgInfo?.Id)))) ?? (React.createElement(Box, null,
24
+ React.createElement(Text, null, "Request Id: "),
25
+ React.createElement(SpinnerOrError, { error: props.error, type: "simpleDotsScrolling" }))),
26
+ (props.data?.scratchOrgInfo?.ScratchOrg && (React.createElement(Text, null,
27
+ "OrgId: ",
28
+ formatOrgId(props.data?.scratchOrgInfo?.ScratchOrg)))) ?? (React.createElement(Box, null,
29
+ React.createElement(Text, null, "OrgId: "),
30
+ React.createElement(SpinnerOrError, { error: props.error, type: "simpleDotsScrolling" }))),
31
+ (props.data?.scratchOrgInfo?.SignupUsername && (React.createElement(Text, null,
32
+ "Username: ",
33
+ formatUsername(props.data?.scratchOrgInfo?.SignupUsername)))) ?? (React.createElement(Box, null,
34
+ React.createElement(Text, null, "Username: "),
35
+ React.createElement(SpinnerOrError, { error: props.error, type: "simpleDotsScrolling" })))),
36
+ React.createElement(Box, { flexDirection: "column" }, scratchOrgLifecycleStages.map((stage, stageIndex) => {
37
+ // current stage
38
+ if (props.data.stage === stage && stage !== 'done')
39
+ return (React.createElement(Box, { key: stage },
40
+ React.createElement(SpinnerOrError, { isBold: true, error: props.error, type: "arc" }),
41
+ React.createElement(Text, { bold: true, color: "magenta" },
42
+ ' ',
43
+ capitalCase(stage))));
44
+ // completed stages
45
+ if (scratchOrgLifecycleStages.indexOf(props.data.stage) > stageIndex)
46
+ return (React.createElement(Text, { key: stage, bold: true, color: "green" },
47
+ "\u2713 ",
48
+ capitalCase(stage)));
49
+ // done stage
50
+ if (props.data.stage === stage && stage === 'done')
51
+ return (React.createElement(Text, { key: stage, bold: true, color: "blue" }, capitalCase(stage)));
52
+ if (stage !== 'done') {
53
+ // future stage
54
+ return (React.createElement(Text, { key: stage, color: "dim" },
55
+ "\u25FC ",
56
+ capitalCase(stage)));
57
+ }
58
+ })),
59
+ props.data?.stage === 'done' && (React.createElement(Text, { bold: true, color: "green" },
60
+ React.createElement(Newline, null),
61
+ messages.getMessage('success')))));
62
+ }
63
+ class CreateScratchView extends BaseComponent {
64
+ state = {};
65
+ constructor(props) {
66
+ super(props);
67
+ }
68
+ async componentDidMount() {
69
+ if (!this.props.async) {
70
+ const lifecycle = Lifecycle.getInstance();
71
+ lifecycle.on(scratchOrgLifecycleEventName, async (data) => {
72
+ this.setState({ data });
73
+ return Promise.resolve();
74
+ });
75
+ }
76
+ try {
77
+ const { username, scratchOrgInfo, authFields, warnings } = await scratchOrgCreate(this.props.createCommandOptions);
78
+ if (!scratchOrgInfo) {
79
+ this.setError(new SfError('The scratch org did not return with any information'));
80
+ }
81
+ else {
82
+ this.setState({ scratchOrgInfoId: scratchOrgInfo.Id });
83
+ }
84
+ this.setState({
85
+ result: {
86
+ username,
87
+ scratchOrgInfo,
88
+ authFields,
89
+ warnings,
90
+ orgId: authFields?.orgId,
91
+ },
92
+ });
93
+ }
94
+ catch (error) {
95
+ if (error instanceof SfError && error.name === 'ScratchOrgInfoTimeoutError') {
96
+ this.setError(error);
97
+ const scratchOrgInfoId = error.data.scratchOrgInfoId;
98
+ this.setState({ showResumeMessage: true, scratchOrgInfoId });
99
+ }
100
+ if (error instanceof SfError || error instanceof Error) {
101
+ this.setError(error);
102
+ }
103
+ }
104
+ }
105
+ render() {
106
+ if (this.props.async) {
107
+ if (this.state.scratchOrgInfoId) {
108
+ return (React.createElement(Text, { color: "dim" }, messages.getMessage('action.resume', [this.props.config.bin, this.state.scratchOrgInfoId])));
109
+ }
110
+ else {
111
+ return (React.createElement(Box, null,
112
+ React.createElement(Text, null, "Requesting Scratch Org (will not wait for completion because --async) "),
113
+ React.createElement(Spinner, { type: "dots" })));
114
+ }
115
+ }
116
+ if (this.state.data) {
117
+ return (React.createElement(Box, { flexDirection: "column" },
118
+ React.createElement(Status, { data: this.state.data, baseUrl: this.props.baseUrl, error: this.getError() }),
119
+ this.state.showResumeMessage && this.state.scratchOrgInfoId && (React.createElement(Box, { flexDirection: "column" },
120
+ React.createElement(Newline, null),
121
+ React.createElement(Text, { color: "dim" }, messages.getMessage('action.resume', [this.props.config.bin, this.state.scratchOrgInfoId]))))));
122
+ }
123
+ }
124
+ }
13
125
  const messages = Messages.loadMessages('@salesforce/plugin-org', 'create_scratch');
14
126
  const definitionFileHelpGroupName = 'Definition File Override';
15
127
  export default class OrgCreateScratch extends SfCommand {
@@ -142,50 +254,14 @@ export default class OrgCreateScratch extends SfCommand {
142
254
  }),
143
255
  };
144
256
  async run() {
145
- const lifecycle = Lifecycle.getInstance();
146
257
  const { flags } = await this.parse(OrgCreateScratch);
147
258
  const baseUrl = flags['target-dev-hub'].getField(Org.Fields.INSTANCE_URL)?.toString();
148
259
  if (!baseUrl) {
149
260
  throw new SfError('No instance URL found for the dev hub');
150
261
  }
151
262
  const createCommandOptions = await buildScratchOrgRequest(flags, flags['client-id'] ? await this.secretPrompt({ message: messages.getMessage('prompt.secret') }) : undefined);
152
- let lastStatus;
153
- if (!flags.async) {
154
- lifecycle.on(scratchOrgLifecycleEventName, async (data) => {
155
- lastStatus = buildStatus(data, baseUrl);
156
- this.spinner.status = lastStatus;
157
- return Promise.resolve();
158
- });
159
- }
160
- this.log();
161
- this.spinner.start(flags.async ? 'Requesting Scratch Org (will not wait for completion because --async)' : 'Creating Scratch Org');
162
- try {
163
- const { username, scratchOrgInfo, authFields, warnings } = await scratchOrgCreate(createCommandOptions);
164
- this.spinner.stop(lastStatus);
165
- if (!scratchOrgInfo) {
166
- throw new SfError('The scratch org did not return with any information');
167
- }
168
- this.log();
169
- if (flags.async) {
170
- this.info(messages.getMessage('action.resume', [this.config.bin, scratchOrgInfo.Id]));
171
- }
172
- else {
173
- this.logSuccess(messages.getMessage('success'));
174
- }
175
- return { username, scratchOrgInfo, authFields, warnings, orgId: authFields?.orgId };
176
- }
177
- catch (error) {
178
- if (error instanceof SfError && error.name === 'ScratchOrgInfoTimeoutError') {
179
- this.spinner.stop(lastStatus);
180
- const scratchOrgInfoId = error.data.scratchOrgInfoId;
181
- const resumeMessage = messages.getMessage('action.resume', [this.config.bin, scratchOrgInfoId]);
182
- this.info(resumeMessage);
183
- this.error('The scratch org did not complete within your wait time', { code: '69', exit: 69 });
184
- }
185
- else {
186
- throw error;
187
- }
188
- }
263
+ const { finalState } = await render(React.createElement(CreateScratchView, { async: flags.async, baseUrl: baseUrl, config: this.config, createCommandOptions: createCommandOptions }), this.jsonEnabled());
264
+ return finalState.result;
189
265
  }
190
266
  }
191
267
  //# sourceMappingURL=scratch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scratch.js","sourceRoot":"","sources":["../../../../src/commands/org/create/scratch.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,SAAS,EACT,QAAQ,EACR,GAAG,EACH,gBAAgB,EAEhB,4BAA4B,EAC5B,OAAO,GACR,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,qCAAqC,CAAC;AAGlE,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,wBAAwB,EAAE,gBAAgB,CAAC,CAAC;AAEnF,MAAM,2BAA2B,GAAG,0BAA0B,CAAC;AAC/D,MAAM,CAAC,OAAO,OAAO,gBAAiB,SAAQ,SAAgC;IACrE,MAAM,CAAU,OAAO,GAAG,QAAQ,CAAC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EAAE,QAAQ,CAAC,UAAU,CAAC,0BAA0B,CAAC;YACxD,UAAU,EAAE,KAAK;YACjB,MAAM,EAAE,EAAE;YACV,SAAS,EAAE,2BAA2B;YACtC,wEAAwE;YACxE,IAAI,EAAE,SAAS;SAChB,CAAC;KACH,CAAC;IAEK,KAAK,CAAC,GAAG;QACd,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,gBAAgB,CAAC,CAAC;QACrD,MAAM,OAAO,GAAG,KAAK,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,EAAE,QAAQ,EAAE,CAAC;QACtF,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,OAAO,CAAC,uCAAuC,CAAC,CAAC;QAC7D,CAAC;QAED,MAAM,oBAAoB,GAAG,MAAM,sBAAsB,CACvD,KAAK,EACL,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,IAAI,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS,CAC5G,CAAC;QAEF,MAAM,EAAE,UAAU,EAAE,GAAG,MAAM,MAAM,CACjC,oBAAC,iBAAiB,IAChB,KAAK,EAAE,KAAK,CAAC,KAAK,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,oBAAoB,EAAE,oBAAoB,GAC1C,EACF,IAAI,CAAC,WAAW,EAAE,CACnB,CAAC;QAEF,OAAO,UAAU,CAAC,MAAO,CAAC;IAC5B,CAAC"}
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { Instance } from 'ink';
3
+ import { SfError } from '@salesforce/core';
4
+ declare const ERROR_KEY: unique symbol;
5
+ declare const Context: React.Context<(_state: any) => void>;
6
+ type BaseState<T = Record<string | symbol, unknown>> = T & {
7
+ readonly [ERROR_KEY]?: SfError | Error;
8
+ };
9
+ export declare abstract class BaseComponent<Props = Record<string, unknown>, State = Readonly<BaseState>> extends React.Component<Props, State> {
10
+ static contextType: React.Context<(_state: any) => void>;
11
+ context: React.ContextType<typeof Context>;
12
+ private error;
13
+ componentWillUnmount(): void;
14
+ setError(error: SfError | Error | undefined): void;
15
+ getError(): SfError | Error | undefined;
16
+ }
17
+ export declare function render<T extends Record<string | symbol, unknown>>(component: React.ReactElement, jsonEnabled?: boolean): Promise<{
18
+ instance: Instance;
19
+ finalState: T;
20
+ }>;
21
+ export {};
@@ -0,0 +1,51 @@
1
+ /*
2
+ * Copyright (c) 2023, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ import { WriteStream } from 'node:tty';
8
+ import React from 'react';
9
+ import { render as inkRender } from 'ink';
10
+ const ERROR_KEY = Symbol('error');
11
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars, @typescript-eslint/no-explicit-any
12
+ const Context = React.createContext((_state) => { });
13
+ export class BaseComponent extends React.Component {
14
+ static contextType = Context;
15
+ error;
16
+ componentWillUnmount() {
17
+ this.context(this.state);
18
+ }
19
+ setError(error) {
20
+ this.error = error;
21
+ this.context({ ...this.state, [ERROR_KEY]: error });
22
+ }
23
+ getError() {
24
+ return this.error;
25
+ }
26
+ }
27
+ function getStream(channel, jsonEnabled) {
28
+ if (jsonEnabled) {
29
+ // If JSON is enabled, we need to return a stream that does nothing
30
+ const stream = new WriteStream(0);
31
+ stream.write = () => true;
32
+ return stream;
33
+ }
34
+ return process[channel];
35
+ }
36
+ export async function render(component, jsonEnabled = false) {
37
+ let finalState = {};
38
+ const cb = (state) => {
39
+ finalState = { ...finalState, ...state };
40
+ };
41
+ const instance = inkRender(React.createElement(Context.Provider, { value: cb }, component), {
42
+ stdout: getStream('stdout', jsonEnabled),
43
+ stderr: getStream('stderr', jsonEnabled),
44
+ });
45
+ await instance.waitUntilExit();
46
+ if (finalState[ERROR_KEY]) {
47
+ throw finalState[ERROR_KEY];
48
+ }
49
+ return { instance, finalState };
50
+ }
51
+ //# sourceMappingURL=baseComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"baseComponent.js","sourceRoot":"","sources":["../../src/components/baseComponent.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,IAAI,SAAS,EAAY,MAAM,KAAK,CAAC;AAGpD,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;AAElC,iGAAiG;AACjG,MAAM,OAAO,GAAG,KAAK,CAAC,aAAa,CAAC,CAAC,MAAW,EAAE,EAAE,GAAE,CAAC,CAAC,CAAC;AAMzD,MAAM,OAAgB,aAGpB,SAAQ,KAAK,CAAC,SAAuB;IAC9B,MAAM,CAAC,WAAW,GAAG,OAAO,CAAC;IAK5B,KAAK,CAA8B;IAEpC,oBAAoB;QACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IAEM,QAAQ,CAAC,KAAkC;QAChD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;IACtD,CAAC;IAEM,QAAQ;QACb,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;;AAGH,SAAS,SAAS,CAAC,OAA4B,EAAE,WAAoB;IACnE,IAAI,WAAW,EAAE,CAAC;QAChB,mEAAmE;QACnE,MAAM,MAAM,GAAG,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC;QAClC,MAAM,CAAC,KAAK,GAAG,GAAY,EAAE,CAAC,IAAI,CAAC;QACnC,OAAO,MAAM,CAAC;IAChB,CAAC;IAED,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC;AAC1B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,SAA6B,EAC7B,WAAW,GAAG,KAAK;IAEnB,IAAI,UAAU,GAAG,EAAO,CAAC;IACzB,MAAM,EAAE,GAAG,CAAC,KAAQ,EAAQ,EAAE;QAC5B,UAAU,GAAG,EAAE,GAAG,UAAU,EAAE,GAAG,KAAK,EAAE,CAAC;IAC3C,CAAC,CAAC;IAEF,MAAM,QAAQ,GAAG,SAAS,CAAC,oBAAC,OAAO,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,IAAG,SAAS,CAAoB,EAAE;QACtF,MAAM,EAAE,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC;QACxC,MAAM,EAAE,SAAS,CAAC,QAAQ,EAAE,WAAW,CAAC;KACzC,CAAC,CAAC;IACH,MAAM,QAAQ,CAAC,aAAa,EAAE,CAAC;IAE/B,IAAI,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC1B,MAAM,UAAU,CAAC,SAAS,CAAC,CAAC;IAC9B,CAAC;IAED,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,CAAC;AAClC,CAAC"}
@@ -0,0 +1,26 @@
1
+ /// <reference types="react" />
2
+ import { type SpinnerName } from 'cli-spinners';
3
+ export type UseSpinnerProps = {
4
+ /**
5
+ * Type of a spinner.
6
+ * See [cli-spinners](https://github.com/sindresorhus/cli-spinners) for available spinners.
7
+ *
8
+ * @default dots
9
+ */
10
+ readonly type?: SpinnerName;
11
+ };
12
+ export type UseSpinnerResult = {
13
+ frame: string;
14
+ };
15
+ export declare function useSpinner({ type }: UseSpinnerProps): UseSpinnerResult;
16
+ export type SpinnerProps = UseSpinnerProps & {
17
+ /**
18
+ * Label to show near the spinner.
19
+ */
20
+ readonly label?: string;
21
+ readonly isBold?: boolean;
22
+ };
23
+ export declare function Spinner({ isBold, label, type }: SpinnerProps): JSX.Element;
24
+ export declare function SpinnerOrError({ error, ...props }: SpinnerProps & {
25
+ readonly error?: Error;
26
+ }): JSX.Element;
@@ -0,0 +1,40 @@
1
+ /*
2
+ * Copyright (c) 2024, salesforce.com, inc.
3
+ * All rights reserved.
4
+ * Licensed under the BSD 3-Clause license.
5
+ * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
6
+ */
7
+ import React, { useEffect, useState } from 'react';
8
+ import spinners from 'cli-spinners';
9
+ import { Box, Text } from 'ink';
10
+ export function useSpinner({ type = 'dots' }) {
11
+ const [frame, setFrame] = useState(0);
12
+ const spinner = spinners[type];
13
+ useEffect(() => {
14
+ const timer = setInterval(() => {
15
+ setFrame((previousFrame) => {
16
+ const isLastFrame = previousFrame === spinner.frames.length - 1;
17
+ return isLastFrame ? 0 : previousFrame + 1;
18
+ });
19
+ }, spinner.interval);
20
+ return () => {
21
+ clearInterval(timer);
22
+ };
23
+ }, [spinner]);
24
+ return {
25
+ frame: spinner.frames[frame] ?? '',
26
+ };
27
+ }
28
+ export function Spinner({ isBold, label, type }) {
29
+ const { frame } = useSpinner({ type });
30
+ return (React.createElement(Box, null,
31
+ isBold ? (React.createElement(Text, { bold: true, color: "magenta" }, frame)) : (React.createElement(Text, { color: "magenta" }, frame)),
32
+ label && React.createElement(Text, null, label)));
33
+ }
34
+ export function SpinnerOrError({ error, ...props }) {
35
+ if (error) {
36
+ return React.createElement(Text, { color: "red" }, "\u2716");
37
+ }
38
+ return React.createElement(Spinner, { ...props });
39
+ }
40
+ //# sourceMappingURL=spinner.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spinner.js","sourceRoot":"","sources":["../../src/components/spinner.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,QAA8B,MAAM,cAAc,CAAC;AAC1D,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AK,IAAI,oBAAC,IAAI,QAAE,KAAK,CAAQ,CAC1B,CACP,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,EAAE,KAAK,EAAE,GAAG,KAAK,EAA6C;IAC3F,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,aAAS,CAAC;IACpC,CAAC;IAED,OAAO,oBAAC,OAAO,OAAK,KAAK,GAAI,CAAC;AAChC,CAAC"}
@@ -1982,5 +1982,5 @@
1982
1982
  ]
1983
1983
  }
1984
1984
  },
1985
- "version": "4.3.0"
1985
+ "version": "4.3.1-dev.0"
1986
1986
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@salesforce/plugin-org",
3
3
  "description": "Commands to interact with Salesforce orgs",
4
- "version": "4.3.0",
4
+ "version": "4.3.1-dev.0",
5
5
  "author": "Salesforce",
6
6
  "bugs": "https://github.com/forcedotcom/cli/issues",
7
7
  "dependencies": {
@@ -12,8 +12,11 @@
12
12
  "@salesforce/source-deploy-retrieve": "^12.0.1",
13
13
  "ansis": "^3.2.0",
14
14
  "change-case": "^5.4.4",
15
+ "cli-spinners": "^2",
16
+ "ink": "^5.0.1",
15
17
  "is-wsl": "^3.1.0",
16
- "open": "^10.1.0"
18
+ "open": "^10.1.0",
19
+ "react": "^18.3.1"
17
20
  },
18
21
  "devDependencies": {
19
22
  "@oclif/plugin-command-snapshot": "^5.2.3",
@@ -21,6 +24,11 @@
21
24
  "@salesforce/dev-scripts": "^10.2.2",
22
25
  "@salesforce/plugin-command-reference": "^3.1.5",
23
26
  "@salesforce/ts-sinon": "1.4.22",
27
+ "@types/react": "^18.3.3",
28
+ "eslint-config-xo": "^0.45.0",
29
+ "eslint-config-xo-react": "^0.27.0",
30
+ "eslint-plugin-react": "^7.34.3",
31
+ "eslint-plugin-react-hooks": "^4.6.2",
24
32
  "eslint-plugin-sf-plugin": "^1.18.8",
25
33
  "moment": "^2.30.1",
26
34
  "oclif": "^4.13.9",
@@ -86,6 +94,9 @@
86
94
  "description": "Manage your sandbox and scratch orgs."
87
95
  }
88
96
  }
97
+ },
98
+ "foo": {
99
+ "description": "description for foo"
89
100
  }
90
101
  },
91
102
  "flexibleTaxonomy": true,
@@ -233,7 +244,7 @@
233
244
  "exports": "./lib/index.js",
234
245
  "type": "module",
235
246
  "sfdx": {
236
- "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.3.0.crt",
237
- "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.3.0.sig"
247
+ "publicKeyUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.3.1-dev.0.crt",
248
+ "signatureUrl": "https://developer.salesforce.com/media/salesforce-cli/security/@salesforce/plugin-org/4.3.1-dev.0.sig"
238
249
  }
239
250
  }