@shopify/cli-kit 3.37.0 → 3.39.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/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/private/common/json.d.ts +2 -2
- package/dist/private/common/lodash.d.ts +4 -4
- package/dist/private/common/ts/overloaded-parameters.d.ts +5 -5
- package/dist/private/node/api/graphql.js +7 -7
- package/dist/private/node/api/graphql.js.map +1 -1
- package/dist/private/node/api/headers.d.ts +1 -1
- package/dist/private/node/api.d.ts +2 -0
- package/dist/{network → private/node}/api.js +0 -0
- package/dist/private/node/api.js.map +1 -0
- package/dist/private/node/conf-store.js +4 -4
- package/dist/private/node/conf-store.js.map +1 -1
- package/dist/private/node/constants.d.ts +2 -2
- package/dist/{content-tokens.d.ts → private/node/content-tokens.d.ts} +11 -11
- package/dist/{content-tokens.js → private/node/content-tokens.js} +3 -3
- package/dist/private/node/content-tokens.js.map +1 -0
- package/dist/private/node/environment/service.d.ts +1 -1
- package/dist/private/node/error-handler.d.ts +2 -0
- package/dist/private/node/error-handler.js +5 -0
- package/dist/private/node/error-handler.js.map +1 -0
- package/dist/private/node/secure-store.js +4 -4
- package/dist/private/node/secure-store.js.map +1 -1
- package/dist/private/node/session/authorize.js +3 -3
- package/dist/private/node/session/authorize.js.map +1 -1
- package/dist/private/node/session/device-authorization.js +6 -6
- package/dist/private/node/session/device-authorization.js.map +1 -1
- package/dist/private/node/session/exchange.d.ts +1 -1
- package/dist/private/node/session/exchange.js.map +1 -1
- package/dist/private/node/session/identity-token-validation.js +5 -5
- package/dist/private/node/session/identity-token-validation.js.map +1 -1
- package/dist/private/node/session/identity.d.ts +1 -1
- package/dist/private/node/session/identity.js.map +1 -1
- package/dist/private/node/session/redirect-listener.d.ts +1 -1
- package/dist/private/node/session/redirect-listener.js +7 -7
- package/dist/private/node/session/redirect-listener.js.map +1 -1
- package/dist/private/node/session/schema.d.ts +3 -3
- package/dist/private/node/session/scopes.d.ts +1 -1
- package/dist/private/node/session/scopes.js +1 -1
- package/dist/private/node/session/scopes.js.map +1 -1
- package/dist/private/node/session/store.js +4 -4
- package/dist/private/node/session/store.js.map +1 -1
- package/dist/private/node/session/validate.d.ts +1 -1
- package/dist/private/node/session/validate.js +2 -2
- package/dist/private/node/session/validate.js.map +1 -1
- package/dist/private/node/session.d.ts +4 -4
- package/dist/private/node/session.js +19 -19
- package/dist/private/node/session.js.map +1 -1
- package/dist/private/node/ui/alert.js +1 -1
- package/dist/private/node/ui/alert.js.map +1 -1
- package/dist/private/node/ui/components/Alert.test.js +1 -1
- package/dist/private/node/ui/components/Alert.test.js.map +1 -1
- package/dist/private/node/ui/components/AutocompletePrompt.d.ts +9 -2
- package/dist/private/node/ui/components/AutocompletePrompt.js +8 -4
- package/dist/private/node/ui/components/AutocompletePrompt.js.map +1 -1
- package/dist/private/node/ui/components/AutocompletePrompt.test.js +62 -8
- package/dist/private/node/ui/components/AutocompletePrompt.test.js.map +1 -1
- package/dist/private/node/ui/components/Banner.d.ts +1 -1
- package/dist/private/node/ui/components/ConcurrentOutput.d.ts +3 -3
- package/dist/private/node/ui/components/ConcurrentOutput.js.map +1 -1
- package/dist/private/node/ui/components/ConcurrentOutput.test.js +1 -1
- package/dist/private/node/ui/components/ConcurrentOutput.test.js.map +1 -1
- package/dist/private/node/ui/components/FatalError.test.js +1 -1
- package/dist/private/node/ui/components/FatalError.test.js.map +1 -1
- package/dist/private/node/ui/components/List.test.js +1 -1
- package/dist/private/node/ui/components/List.test.js.map +1 -1
- package/dist/private/node/ui/components/SelectInput.d.ts +3 -1
- package/dist/private/node/ui/components/SelectInput.js +8 -2
- package/dist/private/node/ui/components/SelectInput.js.map +1 -1
- package/dist/private/node/ui/components/SelectInput.test.js +26 -0
- package/dist/private/node/ui/components/SelectInput.test.js.map +1 -1
- package/dist/private/node/ui/components/SelectPrompt.test.js +1 -1
- package/dist/private/node/ui/components/SelectPrompt.test.js.map +1 -1
- package/dist/private/node/ui/components/Table/Row.d.ts +1 -1
- package/dist/private/node/ui/components/Table/ScalarDict.d.ts +1 -1
- package/dist/private/node/ui/components/Table/Table.d.ts +1 -1
- package/dist/private/node/ui/components/Tasks.d.ts +5 -1
- package/dist/private/node/ui/components/Tasks.js +31 -6
- package/dist/private/node/ui/components/Tasks.js.map +1 -1
- package/dist/private/node/ui/components/Tasks.test.js +260 -20
- package/dist/private/node/ui/components/Tasks.test.js.map +1 -1
- package/dist/private/node/ui/components/TextPrompt.test.js +1 -1
- package/dist/private/node/ui/components/TextPrompt.test.js.map +1 -1
- package/dist/private/node/ui/components/TokenizedText.d.ts +2 -2
- package/dist/private/node/ui/components/TokenizedText.test.js +1 -1
- package/dist/private/node/ui/components/TokenizedText.test.js.map +1 -1
- package/dist/private/node/ui.d.ts +2 -2
- package/dist/private/node/ui.js +1 -1
- package/dist/private/node/ui.js.map +1 -1
- package/dist/public/common/string.d.ts +1 -1
- package/dist/public/common/string.js +1 -1
- package/dist/public/common/string.js.map +1 -1
- package/dist/{private → public}/common/ts/deep-required.d.ts +2 -1
- package/dist/{private → public}/common/ts/deep-required.js +0 -0
- package/dist/public/common/ts/deep-required.js.map +1 -0
- package/dist/public/common/ts/pick-by-prefix.d.ts +2 -1
- package/dist/public/common/ts/pick-by-prefix.js.map +1 -1
- package/dist/public/common/version.d.ts +1 -1
- package/dist/public/common/version.js +1 -1
- package/dist/public/common/version.js.map +1 -1
- package/dist/public/node/analytics.js +5 -5
- package/dist/public/node/analytics.js.map +1 -1
- package/dist/public/node/api/admin.js +2 -2
- package/dist/public/node/api/admin.js.map +1 -1
- package/dist/public/node/api/http.d.ts +1 -0
- package/dist/public/node/api/http.js +1 -1
- package/dist/public/node/archiver.d.ts +20 -6
- package/dist/public/node/archiver.js +16 -15
- package/dist/public/node/archiver.js.map +1 -1
- package/dist/public/node/base-command.js +4 -4
- package/dist/public/node/base-command.js.map +1 -1
- package/dist/public/node/crypto.d.ts +1 -1
- package/dist/public/node/dot-env.js +4 -2
- package/dist/public/node/dot-env.js.map +1 -1
- package/dist/public/node/environment/local.d.ts +1 -1
- package/dist/public/node/environment/spin.d.ts +1 -1
- package/dist/public/node/environment/spin.js +2 -2
- package/dist/public/node/environment/spin.js.map +1 -1
- package/dist/public/node/error-handler.d.ts +1 -2
- package/dist/public/node/error-handler.js +15 -5
- package/dist/public/node/error-handler.js.map +1 -1
- package/dist/public/node/error.d.ts +5 -5
- package/dist/public/node/error.js +1 -1
- package/dist/public/node/error.js.map +1 -1
- package/dist/public/node/fs.d.ts +24 -4
- package/dist/public/node/fs.js +50 -21
- package/dist/public/node/fs.js.map +1 -1
- package/dist/public/node/git.d.ts +9 -1
- package/dist/public/node/git.js +39 -9
- package/dist/public/node/git.js.map +1 -1
- package/dist/public/node/github.js +2 -2
- package/dist/public/node/github.js.map +1 -1
- package/dist/public/node/hooks/postrun.js +2 -2
- package/dist/public/node/hooks/postrun.js.map +1 -1
- package/dist/public/node/hooks/prerun.js +2 -2
- package/dist/public/node/hooks/prerun.js.map +1 -1
- package/dist/public/node/http.d.ts +9 -1
- package/dist/public/node/http.js +37 -3
- package/dist/public/node/http.js.map +1 -1
- package/dist/public/node/liquid.js +2 -2
- package/dist/public/node/liquid.js.map +1 -1
- package/dist/public/node/metadata.d.ts +7 -7
- package/dist/public/node/monorail.d.ts +6 -6
- package/dist/public/node/monorail.js +4 -4
- package/dist/public/node/monorail.js.map +1 -1
- package/dist/public/node/node-package-manager.d.ts +5 -5
- package/dist/public/node/node-package-manager.js +9 -9
- package/dist/public/node/node-package-manager.js.map +1 -1
- package/dist/public/node/os.d.ts +2 -2
- package/dist/public/node/os.js +2 -2
- package/dist/public/node/os.js.map +1 -1
- package/dist/public/node/output.d.ts +188 -0
- package/dist/{output.js → public/node/output.js} +129 -50
- package/dist/public/node/output.js.map +1 -0
- package/dist/public/node/path.d.ts +1 -1
- package/dist/public/node/plugins/tunnel.d.ts +5 -5
- package/dist/public/node/plugins.d.ts +4 -4
- package/dist/public/node/result.d.ts +1 -1
- package/dist/public/node/ruby.d.ts +1 -1
- package/dist/public/node/ruby.js +7 -5
- package/dist/public/node/ruby.js.map +1 -1
- package/dist/public/node/session.d.ts +1 -1
- package/dist/public/node/session.js +9 -9
- package/dist/public/node/session.js.map +1 -1
- package/dist/public/node/system.d.ts +1 -1
- package/dist/public/node/system.js +2 -2
- package/dist/public/node/system.js.map +1 -1
- package/dist/public/node/tcp.js +4 -4
- package/dist/public/node/tcp.js.map +1 -1
- package/dist/public/node/testing/output.js +10 -9
- package/dist/public/node/testing/output.js.map +1 -1
- package/dist/public/node/ui.d.ts +11 -6
- package/dist/public/node/ui.js +5 -4
- package/dist/public/node/ui.js.map +1 -1
- package/dist/public/node/vscode.js +4 -4
- package/dist/public/node/vscode.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui.d.ts +6 -20
- package/dist/ui.js +8 -28
- package/dist/ui.js.map +1 -1
- package/package.json +6 -7
- package/dist/content-tokens.js.map +0 -1
- package/dist/network/api.d.ts +0 -2
- package/dist/network/api.js.map +0 -1
- package/dist/output.d.ts +0 -129
- package/dist/output.js.map +0 -1
- package/dist/private/common/ts/deep-required.js.map +0 -1
- package/dist/private/node/simple-definitions.d.ts +0 -4
- package/dist/private/node/simple-definitions.js +0 -2
- package/dist/private/node/simple-definitions.js.map +0 -1
package/dist/ui.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { Listr as OriginalListr, ListrTask, ListrBaseClassOptions } from 'listr2';
|
|
2
|
-
export declare function newListr(tasks: ListrTask[], options?: object | ListrBaseClassOptions): OriginalListr<any, any, "verbose">;
|
|
3
|
-
export declare type ListrTasks = ConstructorParameters<typeof OriginalListr>[0];
|
|
4
|
-
export type { ListrTaskWrapper, ListrDefaultRenderer, ListrTask } from 'listr2';
|
|
5
1
|
export interface PromptAnswer {
|
|
6
2
|
name: string;
|
|
7
3
|
value: string;
|
|
8
4
|
}
|
|
9
|
-
export
|
|
5
|
+
export type FilterFunction = (answers: PromptAnswer[], input: string) => Promise<PromptAnswer[]>;
|
|
10
6
|
interface BaseQuestion<TName extends string> {
|
|
11
7
|
name: TName;
|
|
12
8
|
message: string;
|
|
@@ -17,18 +13,18 @@ interface BaseQuestion<TName extends string> {
|
|
|
17
13
|
choices?: QuestionChoiceType[];
|
|
18
14
|
source?: (filter: FilterFunction) => FilterFunction;
|
|
19
15
|
}
|
|
20
|
-
|
|
16
|
+
type TextQuestion<TName extends string> = BaseQuestion<TName> & {
|
|
21
17
|
type: 'input';
|
|
22
18
|
default: string;
|
|
23
19
|
};
|
|
24
|
-
|
|
20
|
+
type PasswordQuestion<TName extends string> = BaseQuestion<TName> & {
|
|
25
21
|
type: 'password';
|
|
26
22
|
};
|
|
27
|
-
|
|
23
|
+
type SelectableQuestion<TName extends string> = BaseQuestion<TName> & {
|
|
28
24
|
type: 'select' | 'autocomplete';
|
|
29
25
|
choices: QuestionChoiceType[];
|
|
30
26
|
};
|
|
31
|
-
export
|
|
27
|
+
export type Question<TName extends string = string> = TextQuestion<TName> | SelectableQuestion<TName> | PasswordQuestion<TName>;
|
|
32
28
|
export interface QuestionChoiceType {
|
|
33
29
|
name: string;
|
|
34
30
|
value: string;
|
|
@@ -37,18 +33,8 @@ export interface QuestionChoiceType {
|
|
|
37
33
|
order: number;
|
|
38
34
|
};
|
|
39
35
|
}
|
|
40
|
-
/**
|
|
41
|
-
* Performs a task with the title kept up to date and stdout available to the
|
|
42
|
-
* task while it runs (there is no re-writing stdout while the task runs).
|
|
43
|
-
*/
|
|
44
|
-
export interface TaskOptions {
|
|
45
|
-
title: string;
|
|
46
|
-
task: () => Promise<void | {
|
|
47
|
-
successMessage: string;
|
|
48
|
-
}>;
|
|
49
|
-
}
|
|
50
|
-
export declare const task: ({ title, task }: TaskOptions) => Promise<void>;
|
|
51
36
|
export declare const prompt: <TName extends string & keyof TAnswers, TAnswers extends { [key in TName]: string; } = { [key_1 in TName]: string; }>(questions: readonly Question<TName>[]) => Promise<TAnswers>;
|
|
52
37
|
export declare function nonEmptyDirectoryPrompt(directory: string): Promise<void>;
|
|
53
38
|
export declare function terminateBlockingPortProcessPrompt(port: number, stepDescription?: string): Promise<boolean>;
|
|
54
39
|
export declare const keypress: () => Promise<unknown>;
|
|
40
|
+
export {};
|
package/dist/ui.js
CHANGED
|
@@ -1,50 +1,30 @@
|
|
|
1
1
|
import { CancelExecution, AbortError, AbortSilentError } from './public/node/error.js';
|
|
2
2
|
import { removeFile, fileExists } from './public/node/fs.js';
|
|
3
|
-
import {
|
|
3
|
+
import { outputInfo, outputContent, outputToken, stringifyMessage, outputDebug, } from './public/node/output.js';
|
|
4
4
|
import colors from './public/node/colors.js';
|
|
5
5
|
import { relativizePath } from './public/node/path.js';
|
|
6
6
|
import { isTerminalInteractive } from './public/node/environment/local.js';
|
|
7
7
|
import { run as executorUI } from './ui/executor.js';
|
|
8
|
-
import { Listr as OriginalListr } from 'listr2';
|
|
9
8
|
import findProcess from 'find-process';
|
|
10
|
-
export function newListr(tasks, options) {
|
|
11
|
-
const listr = new OriginalListr(tasks, options);
|
|
12
|
-
return listr;
|
|
13
|
-
}
|
|
14
9
|
const started = (content, logger) => {
|
|
15
10
|
const message = `${colors.yellow('❯')} ${stringifyMessage(content)}`;
|
|
16
|
-
|
|
11
|
+
outputInfo(message, logger);
|
|
17
12
|
};
|
|
18
13
|
const failed = (content, logger) => {
|
|
19
14
|
const message = `${colors.red('✖')} ${stringifyMessage(content)}`;
|
|
20
|
-
|
|
21
|
-
};
|
|
22
|
-
export const task = async ({ title, task }) => {
|
|
23
|
-
let success;
|
|
24
|
-
started(title, logUpdate);
|
|
25
|
-
try {
|
|
26
|
-
const result = await task();
|
|
27
|
-
success = result?.successMessage || title;
|
|
28
|
-
}
|
|
29
|
-
catch (err) {
|
|
30
|
-
failed(title, logUpdate);
|
|
31
|
-
logUpdate.done();
|
|
32
|
-
throw err;
|
|
33
|
-
}
|
|
34
|
-
completed(success, logUpdate);
|
|
35
|
-
logUpdate.done();
|
|
15
|
+
outputInfo(message, logger);
|
|
36
16
|
};
|
|
37
17
|
export const prompt = async (questions) => {
|
|
38
18
|
if (!isTerminalInteractive() && questions.length !== 0) {
|
|
39
|
-
throw new AbortError(
|
|
19
|
+
throw new AbortError(outputContent `
|
|
40
20
|
The CLI prompted in a non-interactive terminal with the following questions:
|
|
41
|
-
${
|
|
21
|
+
${outputToken.json(questions)}
|
|
42
22
|
`);
|
|
43
23
|
}
|
|
44
24
|
const value = {};
|
|
45
25
|
for (const question of questions) {
|
|
46
26
|
if (question.preface) {
|
|
47
|
-
|
|
27
|
+
outputInfo(question.preface);
|
|
48
28
|
}
|
|
49
29
|
// eslint-disable-next-line no-await-in-loop
|
|
50
30
|
value[question.name] = (await executorUI(question));
|
|
@@ -75,7 +55,7 @@ export async function terminateBlockingPortProcessPrompt(port, stepDescription)
|
|
|
75
55
|
const stepDescriptionContent = stepDescription ?? 'current step';
|
|
76
56
|
const processInfo = await findProcess('port', port);
|
|
77
57
|
const formattedProcessName = processInfo && processInfo.length > 0 && processInfo[0]?.name
|
|
78
|
-
? ` ${
|
|
58
|
+
? ` ${outputContent `${outputToken.italic(`(${processInfo[0].name})`)}`.value}`
|
|
79
59
|
: '';
|
|
80
60
|
const options = [
|
|
81
61
|
{ name: 'Yes, terminate process in order to log in now', value: 'finish' },
|
|
@@ -98,7 +78,7 @@ export const keypress = async () => {
|
|
|
98
78
|
process.stdin.pause();
|
|
99
79
|
const bytes = Array.from(buffer);
|
|
100
80
|
if (bytes.length && bytes[0] === 3) {
|
|
101
|
-
|
|
81
|
+
outputDebug('Canceled keypress, User pressed CTRL+C');
|
|
102
82
|
reject(new AbortSilentError());
|
|
103
83
|
}
|
|
104
84
|
process.nextTick(resolve);
|
package/dist/ui.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EA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;YACd,IAAI,EAAE,OAAO;YACb,OAAO,EAAE,GAAG,sBAAsB,oBAAoB,IAAI,2DAA2D,oBAAoB,4BAA4B;YACrK,OAAO,EAAE,OAAO;SACjB;KACF,CAAC,CAAA;IACF,OAAO,MAAM,CAAC,KAAK,KAAK,QAAQ,CAAA;AAClC,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAG,KAAK,IAAI,EAAE;IACjC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,OAAO,GAAG,CAAC,MAAc,EAAE,EAAE;YACjC,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;YAC/B,OAAO,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;YAErB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAEhC,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;gBAClC,KAAK,CAAC,wCAAwC,CAAC,CAAA;gBAC/C,MAAM,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAA;aAC/B;YACD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC3B,CAAC,CAAA;QAED,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,CAAA;QACtB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QAC9B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import {CancelExecution, AbortError, AbortSilentError} from './public/node/error.js'\nimport {removeFile, fileExists} from './public/node/fs.js'\nimport {info, completed, content, token, logUpdate, Message, Logger, stringifyMessage, debug} from './output.js'\nimport colors from './public/node/colors.js'\nimport {relativizePath} from './public/node/path.js'\nimport {isTerminalInteractive} from './public/node/environment/local.js'\nimport {run as executorUI} from './ui/executor.js'\nimport {Listr as OriginalListr, ListrTask, ListrBaseClassOptions} from 'listr2'\nimport findProcess from 'find-process'\n\nexport function newListr(tasks: ListrTask[], options?: object | ListrBaseClassOptions) {\n const listr = new OriginalListr(tasks, options)\n return listr\n}\n\nexport type ListrTasks = ConstructorParameters<typeof OriginalListr>[0]\nexport type {ListrTaskWrapper, ListrDefaultRenderer, ListrTask} from 'listr2'\n\nexport interface PromptAnswer {\n name: string\n value: string\n}\nexport type FilterFunction = (answers: PromptAnswer[], input: string) => Promise<PromptAnswer[]>\n\ninterface BaseQuestion<TName extends string> {\n name: TName\n message: string\n preface?: string\n validate?: (value: string) => string | true\n default?: string\n result?: (value: string) => string | boolean\n choices?: QuestionChoiceType[]\n source?: (filter: FilterFunction) => FilterFunction\n}\n\ntype TextQuestion<TName extends string> = BaseQuestion<TName> & {\n type: 'input'\n // a default is required, otherwise we'd show a prompt like 'undefined'\n default: string\n}\n\ntype PasswordQuestion<TName extends string> = BaseQuestion<TName> & {\n type: 'password'\n}\n\ntype SelectableQuestion<TName extends string> = BaseQuestion<TName> & {\n type: 'select' | 'autocomplete'\n choices: QuestionChoiceType[]\n}\n\nexport type Question<TName extends string = string> =\n | TextQuestion<TName>\n | SelectableQuestion<TName>\n | PasswordQuestion<TName>\n\nexport interface QuestionChoiceType {\n name: string\n value: string\n group?: {name: string; order: number}\n}\n\nconst started = (content: Message, logger: Logger) => {\n const message = `${colors.yellow('❯')} ${stringifyMessage(content)}`\n info(message, logger)\n}\n\nconst failed = (content: Message, logger: Logger) => {\n const message = `${colors.red('✖')} ${stringifyMessage(content)}`\n info(message, logger)\n}\n\n/**\n * Performs a task with the title kept up to date and stdout available to the\n * task while it runs (there is no re-writing stdout while the task runs).\n */\nexport interface TaskOptions {\n title: string\n task: () => Promise<void | {successMessage: string}>\n}\nexport const task = async ({title, task}: TaskOptions) => {\n let success\n started(title, logUpdate)\n try {\n const result = await task()\n success = result?.successMessage || title\n } catch (err) {\n failed(title, logUpdate)\n logUpdate.done()\n throw err\n }\n completed(success, logUpdate)\n logUpdate.done()\n}\nexport const prompt = async <\n TName extends string & keyof TAnswers,\n TAnswers extends {[key in TName]: string} = {[key in TName]: string},\n>(\n questions: ReadonlyArray<Question<TName>>,\n): Promise<TAnswers> => {\n if (!isTerminalInteractive() && questions.length !== 0) {\n throw new AbortError(content`\nThe CLI prompted in a non-interactive terminal with the following questions:\n${token.json(questions)}\n `)\n }\n\n const value = {} as TAnswers\n for (const question of questions) {\n if (question.preface) {\n info(question.preface)\n }\n\n // eslint-disable-next-line no-await-in-loop\n value[question.name] = (await executorUI(question)) as TAnswers[TName]\n }\n return value\n}\n\nexport async function nonEmptyDirectoryPrompt(directory: string) {\n if (await fileExists(directory)) {\n const options = [\n {name: 'No, don’t delete the files', value: 'abort'},\n {name: 'Yes, delete the files', value: 'overwrite'},\n ]\n\n const relativeDirectory = relativizePath(directory)\n\n const questions: Question<'value'> = {\n type: 'select',\n name: 'value',\n message: `${relativeDirectory} is not an empty directory. Do you want to delete the existing files and continue?`,\n choices: options,\n }\n\n const choice = await prompt([questions])\n\n if (choice.value === 'abort') {\n throw new CancelExecution()\n }\n\n await removeFile(directory)\n }\n}\n\nexport async function terminateBlockingPortProcessPrompt(port: number, stepDescription?: string): Promise<boolean> {\n const stepDescriptionContent = stepDescription ?? 'current step'\n\n const processInfo = await findProcess('port', port)\n const formattedProcessName =\n processInfo && processInfo.length > 0 && processInfo[0]?.name\n ? ` ${content`${token.italic(`(${processInfo[0].name})`)}`.value}`\n : ''\n\n const options = [\n {name: 'Yes, terminate process in order to log in now', value: 'finish'},\n {name: `No, cancel command and try later`, value: 'cancel'},\n ]\n\n const choice = await prompt([\n {\n type: 'select',\n name: 'value',\n message: `${stepDescriptionContent} requires a port ${port} that's unavailable because it's running another process${formattedProcessName}. Terminate that process? `,\n choices: options,\n },\n ])\n return choice.value === 'finish'\n}\n\nexport const keypress = async () => {\n return new Promise((resolve, reject) => {\n const handler = (buffer: Buffer) => {\n process.stdin.setRawMode(false)\n process.stdin.pause()\n\n const bytes = Array.from(buffer)\n\n if (bytes.length && bytes[0] === 3) {\n debug('Canceled keypress, User pressed CTRL+C')\n reject(new AbortSilentError())\n }\n process.nextTick(resolve)\n }\n\n process.stdin.resume()\n process.stdin.setRawMode(true)\n process.stdin.once('data', handler)\n })\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAE,UAAU,EAAE,gBAAgB,EAAC,MAAM,wBAAwB,CAAA;AACpF,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,qBAAqB,CAAA;AAC1D,OAAO,EACL,UAAU,EACV,aAAa,EACb,WAAW,EAGX,gBAAgB,EAChB,WAAW,GACZ,MAAM,yBAAyB,CAAA;AAChC,OAAO,MAAM,MAAM,yBAAyB,CAAA;AAC5C,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAA;AACpD,OAAO,EAAC,qBAAqB,EAAC,MAAM,oCAAoC,CAAA;AACxE,OAAO,EAAC,GAAG,IAAI,UAAU,EAAC,MAAM,kBAAkB,CAAA;AAClD,OAAO,WAAW,MAAM,cAAc,CAAA;AA6CtC,MAAM,OAAO,GAAG,CAAC,OAAsB,EAAE,MAAc,EAAE,EAAE;IACzD,MAAM,OAAO,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAA;IACpE,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;AAC7B,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,CAAC,OAAsB,EAAE,MAAc,EAAE,EAAE;IACxD,MAAM,OAAO,GAAG,GAAG,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE,CAAA;IACjE,UAAU,CAAC,OAAO,EAAE,MAAM,CAAC,CAA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C,KAAK,EAAE,CAAA;YAErB,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;YAEhC,IAAI,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE;gBAClC,WAAW,CAAC,wCAAwC,CAAC,CAAA;gBACrD,MAAM,CAAC,IAAI,gBAAgB,EAAE,CAAC,CAAA;aAC/B;YACD,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAA;QAC3B,CAAC,CAAA;QAED,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE,CAAA;QACtB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAA;QAC9B,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAA","sourcesContent":["import {CancelExecution, AbortError, AbortSilentError} from './public/node/error.js'\nimport {removeFile, fileExists} from './public/node/fs.js'\nimport {\n outputInfo,\n outputContent,\n outputToken,\n OutputMessage,\n Logger,\n stringifyMessage,\n outputDebug,\n} from './public/node/output.js'\nimport colors from './public/node/colors.js'\nimport {relativizePath} from './public/node/path.js'\nimport {isTerminalInteractive} from './public/node/environment/local.js'\nimport {run as executorUI} from './ui/executor.js'\nimport findProcess from 'find-process'\n\nexport interface PromptAnswer {\n name: string\n value: string\n}\nexport type FilterFunction = (answers: PromptAnswer[], input: string) => Promise<PromptAnswer[]>\n\ninterface BaseQuestion<TName extends string> {\n name: TName\n message: string\n preface?: string\n validate?: (value: string) => string | true\n default?: string\n result?: (value: string) => string | boolean\n choices?: QuestionChoiceType[]\n source?: (filter: FilterFunction) => FilterFunction\n}\n\ntype TextQuestion<TName extends string> = BaseQuestion<TName> & {\n type: 'input'\n // a default is required, otherwise we'd show a prompt like 'undefined'\n default: string\n}\n\ntype PasswordQuestion<TName extends string> = BaseQuestion<TName> & {\n type: 'password'\n}\n\ntype SelectableQuestion<TName extends string> = BaseQuestion<TName> & {\n type: 'select' | 'autocomplete'\n choices: QuestionChoiceType[]\n}\n\nexport type Question<TName extends string = string> =\n | TextQuestion<TName>\n | SelectableQuestion<TName>\n | PasswordQuestion<TName>\n\nexport interface QuestionChoiceType {\n name: string\n value: string\n group?: {name: string; order: number}\n}\n\nconst started = (content: OutputMessage, logger: Logger) => {\n const message = `${colors.yellow('❯')} ${stringifyMessage(content)}`\n outputInfo(message, logger)\n}\n\nconst failed = (content: OutputMessage, logger: Logger) => {\n const message = `${colors.red('✖')} ${stringifyMessage(content)}`\n outputInfo(message, logger)\n}\n\nexport const prompt = async <\n TName extends string & keyof TAnswers,\n TAnswers extends {[key in TName]: string} = {[key in TName]: string},\n>(\n questions: ReadonlyArray<Question<TName>>,\n): Promise<TAnswers> => {\n if (!isTerminalInteractive() && questions.length !== 0) {\n throw new AbortError(outputContent`\nThe CLI prompted in a non-interactive terminal with the following questions:\n${outputToken.json(questions)}\n `)\n }\n\n const value = {} as TAnswers\n for (const question of questions) {\n if (question.preface) {\n outputInfo(question.preface)\n }\n\n // eslint-disable-next-line no-await-in-loop\n value[question.name] = (await executorUI(question)) as TAnswers[TName]\n }\n return value\n}\n\nexport async function nonEmptyDirectoryPrompt(directory: string) {\n if (await fileExists(directory)) {\n const options = [\n {name: 'No, don’t delete the files', value: 'abort'},\n {name: 'Yes, delete the files', value: 'overwrite'},\n ]\n\n const relativeDirectory = relativizePath(directory)\n\n const questions: Question<'value'> = {\n type: 'select',\n name: 'value',\n message: `${relativeDirectory} is not an empty directory. Do you want to delete the existing files and continue?`,\n choices: options,\n }\n\n const choice = await prompt([questions])\n\n if (choice.value === 'abort') {\n throw new CancelExecution()\n }\n\n await removeFile(directory)\n }\n}\n\nexport async function terminateBlockingPortProcessPrompt(port: number, stepDescription?: string): Promise<boolean> {\n const stepDescriptionContent = stepDescription ?? 'current step'\n\n const processInfo = await findProcess('port', port)\n const formattedProcessName =\n processInfo && processInfo.length > 0 && processInfo[0]?.name\n ? ` ${outputContent`${outputToken.italic(`(${processInfo[0].name})`)}`.value}`\n : ''\n\n const options = [\n {name: 'Yes, terminate process in order to log in now', value: 'finish'},\n {name: `No, cancel command and try later`, value: 'cancel'},\n ]\n\n const choice = await prompt([\n {\n type: 'select',\n name: 'value',\n message: `${stepDescriptionContent} requires a port ${port} that's unavailable because it's running another process${formattedProcessName}. Terminate that process? `,\n choices: options,\n },\n ])\n return choice.value === 'finish'\n}\n\nexport const keypress = async () => {\n return new Promise((resolve, reject) => {\n const handler = (buffer: Buffer) => {\n process.stdin.setRawMode(false)\n process.stdin.pause()\n\n const bytes = Array.from(buffer)\n\n if (bytes.length && bytes[0] === 3) {\n outputDebug('Canceled keypress, User pressed CTRL+C')\n reject(new AbortSilentError())\n }\n process.nextTick(resolve)\n }\n\n process.stdin.resume()\n process.stdin.setRawMode(true)\n process.stdin.once('data', handler)\n })\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shopify/cli-kit",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.39.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A set of utilities, interfaces, and models that are common across all the platform features",
|
|
6
6
|
"keywords": [
|
|
@@ -84,9 +84,9 @@
|
|
|
84
84
|
"archiver": "5.3.1",
|
|
85
85
|
"chalk": "5.1.0",
|
|
86
86
|
"change-case": "4.1.2",
|
|
87
|
-
"color-json": "
|
|
87
|
+
"color-json": "3.0.0",
|
|
88
88
|
"commondir": "1.0.1",
|
|
89
|
-
"conf": "
|
|
89
|
+
"conf": "11.0.1",
|
|
90
90
|
"cross-zip": "4.0.0",
|
|
91
91
|
"deepmerge": "4.2.2",
|
|
92
92
|
"del": "6.0.0",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"form-data": "4.0.0",
|
|
102
102
|
"fs-extra": "11.1.0",
|
|
103
103
|
"fuzzy": "0.1.3",
|
|
104
|
-
"get-port-please": "
|
|
104
|
+
"get-port-please": "3.0.1",
|
|
105
105
|
"gradient-string": "2.0.2",
|
|
106
106
|
"graphql": "16.4.0",
|
|
107
107
|
"graphql-request": "4.3.0",
|
|
@@ -113,7 +113,6 @@
|
|
|
113
113
|
"kill-port-process": "3.1.0",
|
|
114
114
|
"latest-version": "7.0.0",
|
|
115
115
|
"liquidjs": "9.36.0",
|
|
116
|
-
"listr2": "4.0.5",
|
|
117
116
|
"lodash": "4.17.21",
|
|
118
117
|
"log-update": "4.0.0",
|
|
119
118
|
"macaddress": "0.5.3",
|
|
@@ -124,7 +123,7 @@
|
|
|
124
123
|
"prettier": "2.7.1",
|
|
125
124
|
"react": "17.0.2",
|
|
126
125
|
"semver": "7.3.6",
|
|
127
|
-
"simple-git": "3.
|
|
126
|
+
"simple-git": "3.16.0",
|
|
128
127
|
"source-map-support": "0.5.21",
|
|
129
128
|
"stacktracey": "2.1.8",
|
|
130
129
|
"strip-ansi": "7.0.1",
|
|
@@ -143,7 +142,7 @@
|
|
|
143
142
|
"@types/fs-extra": "9.0.13",
|
|
144
143
|
"@types/gradient-string": "^1.1.2",
|
|
145
144
|
"@types/lodash": "4.14.191",
|
|
146
|
-
"@types/node": "14.
|
|
145
|
+
"@types/node": "14.18.36",
|
|
147
146
|
"@types/react": "17.0.2",
|
|
148
147
|
"@types/semver": "^7.3.9",
|
|
149
148
|
"@vitest/coverage-istanbul": "^0.26.3",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-tokens.js","sourceRoot":"","sources":["../src/content-tokens.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,cAAc,EAAC,MAAM,uBAAuB,CAAA;AACpD,OAAO,MAAM,MAAM,yBAAyB,CAAA;AAC5C,OAAO,EAAU,gBAAgB,EAAC,MAAM,aAAa,CAAA;AACrD,OAAO,YAAY,MAAM,eAAe,CAAA;AACxC,OAAO,GAAG,MAAM,YAAY,CAAA;AAG5B,MAAM,OAAgB,YAAY;I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AK,CAAC,CAAC,CAAA;IAC5D,CAAC;CACF;AAED,MAAM,OAAO,gBAAiB,SAAQ,YAAqB;IACzD,MAAM;QACJ,OAAO,cAAc,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IACrD,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,SAAQ,YAAqB;IAC5D,MAAM;QACJ,OAAO,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IAC5D,CAAC;CACF;AAED,MAAM,OAAO,sBAAuB,SAAQ,YAAqB;IAC/D,MAAM;QACJ,OAAO,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IACvD,CAAC;CACF;AAED,MAAM,OAAO,kBAAmB,SAAQ,YAAqB;IAC3D,MAAM;QACJ,OAAO,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAA;IACpD,CAAC;CACF","sourcesContent":["import {relativizePath} from './public/node/path.js'\nimport colors from './public/node/colors.js'\nimport {Message, stringifyMessage} from './output.js'\nimport terminalLink from 'terminal-link'\nimport cjs from 'color-json'\nimport type {Change} from 'diff'\n\nexport abstract class ContentToken<T> {\n value: T\n\n constructor(value: T) {\n this.value = value\n }\n\n abstract output(): string | string[]\n}\n\nexport class RawContentToken extends ContentToken<string> {\n output(): string {\n return this.value\n }\n}\n\nexport class LinkContentToken extends ContentToken<Message> {\n link: string\n\n constructor(value: Message, link: string) {\n super(value)\n this.link = link\n }\n\n output() {\n const text = colors.green(stringifyMessage(this.value))\n const url = this.link ?? ''\n return terminalLink(text, url, {fallback: () => `${text} ( ${url} )`})\n }\n}\n\nexport class CommandContentToken extends ContentToken<Message> {\n output(): string {\n return colors.bold(colors.yellow(stringifyMessage(this.value)))\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport class JsonContentToken extends ContentToken<any> {\n output(): string {\n try {\n return cjs(stringifyMessage(this.value) ?? {})\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch (_) {\n return JSON.stringify(stringifyMessage(this.value) ?? {}, null, 2)\n }\n }\n}\n\nexport class LinesDiffContentToken extends ContentToken<Change[]> {\n output(): string[] {\n return this.value\n .map((part) => {\n if (part.added) {\n return part.value\n .split(/\\n/)\n .filter((line) => line !== '')\n .map((line) => {\n return colors.green(`+ ${line}\\n`)\n })\n } else if (part.removed) {\n return part.value\n .split(/\\n/)\n .filter((line) => line !== '')\n .map((line) => {\n return colors.magenta(`- ${line}\\n`)\n })\n } else {\n return part.value\n }\n })\n .flat()\n }\n}\n\nexport class ColorContentToken extends ContentToken<Message> {\n color: (text: string) => string\n\n constructor(value: Message, color: (text: string) => string) {\n super(value)\n this.color = color\n }\n\n output(): string {\n return this.color(stringifyMessage(this.value))\n }\n}\n\nexport class ErrorContentToken extends ContentToken<Message> {\n output(): string {\n return colors.bold.redBright(stringifyMessage(this.value))\n }\n}\n\nexport class PathContentToken extends ContentToken<Message> {\n output(): string {\n return relativizePath(stringifyMessage(this.value))\n }\n}\n\nexport class HeadingContentToken extends ContentToken<Message> {\n output(): string {\n return colors.bold.underline(stringifyMessage(this.value))\n }\n}\n\nexport class SubHeadingContentToken extends ContentToken<Message> {\n output(): string {\n return colors.underline(stringifyMessage(this.value))\n }\n}\n\nexport class ItalicContentToken extends ContentToken<Message> {\n output(): string {\n return colors.italic(stringifyMessage(this.value))\n }\n}\n"]}
|
package/dist/network/api.d.ts
DELETED
package/dist/network/api.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"api.js","sourceRoot":"","sources":["../../src/network/api.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,OAAO,GAAU,CAAC,OAAO,EAAE,qBAAqB,EAAE,UAAU,CAAC,CAAA","sourcesContent":["export type API = 'admin' | 'storefront-renderer' | 'partners'\n\nexport const allAPIs: API[] = ['admin', 'storefront-renderer', 'partners']\n"]}
|
package/dist/output.d.ts
DELETED
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { PackageManager } from './public/node/node-package-manager.js';
|
|
3
|
-
import { ColorContentToken, CommandContentToken, ContentToken, ErrorContentToken, HeadingContentToken, ItalicContentToken, JsonContentToken, LinesDiffContentToken, LinkContentToken, PathContentToken, RawContentToken, SubHeadingContentToken } from './content-tokens.js';
|
|
4
|
-
import { AbortSignal } from '@shopify/cli-kit/node/abort';
|
|
5
|
-
import { Writable } from 'stream';
|
|
6
|
-
import type { Change } from 'diff';
|
|
7
|
-
export { default as logUpdate } from 'log-update';
|
|
8
|
-
export declare type Logger = Writable | ((message: string) => void);
|
|
9
|
-
export declare class TokenizedString {
|
|
10
|
-
value: string;
|
|
11
|
-
constructor(value: string);
|
|
12
|
-
}
|
|
13
|
-
export declare type Message = string | TokenizedString;
|
|
14
|
-
export declare const token: {
|
|
15
|
-
raw: (value: string) => RawContentToken;
|
|
16
|
-
genericShellCommand: (value: Message) => CommandContentToken;
|
|
17
|
-
json: (value: any) => JsonContentToken;
|
|
18
|
-
path: (value: Message) => PathContentToken;
|
|
19
|
-
link: (value: Message, link: string) => LinkContentToken;
|
|
20
|
-
heading: (value: Message) => HeadingContentToken;
|
|
21
|
-
subheading: (value: Message) => SubHeadingContentToken;
|
|
22
|
-
italic: (value: Message) => ItalicContentToken;
|
|
23
|
-
errorText: (value: Message) => ErrorContentToken;
|
|
24
|
-
cyan: (value: Message) => ColorContentToken;
|
|
25
|
-
yellow: (value: Message) => ColorContentToken;
|
|
26
|
-
magenta: (value: Message) => ColorContentToken;
|
|
27
|
-
green: (value: Message) => ColorContentToken;
|
|
28
|
-
packagejsonScript: (packageManager: PackageManager, scriptName: string, ...scriptArgs: string[]) => CommandContentToken;
|
|
29
|
-
successIcon: () => ColorContentToken;
|
|
30
|
-
failIcon: () => ErrorContentToken;
|
|
31
|
-
linesDiff: (value: Change[]) => LinesDiffContentToken;
|
|
32
|
-
};
|
|
33
|
-
export declare function formatPackageManagerCommand(packageManager: PackageManager, scriptName: string, ...scriptArgs: string[]): string;
|
|
34
|
-
export declare function content(strings: TemplateStringsArray, ...keys: (ContentToken<unknown> | string)[]): TokenizedString;
|
|
35
|
-
/** Log levels */
|
|
36
|
-
export declare type LogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent';
|
|
37
|
-
/**
|
|
38
|
-
*
|
|
39
|
-
* @returns It returns the log level set by the user.
|
|
40
|
-
*/
|
|
41
|
-
export declare const currentLogLevel: () => LogLevel;
|
|
42
|
-
export declare const shouldOutput: (logLevel: LogLevel) => boolean;
|
|
43
|
-
export declare let collectedLogs: {
|
|
44
|
-
[key: string]: string[];
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* This is only used during UnitTesting.
|
|
48
|
-
* If we are in a testing context, instead of printing the logs to the console,
|
|
49
|
-
* we will store them in a variable that can be accessed from the tests.
|
|
50
|
-
* @param key - The key of the log.
|
|
51
|
-
* @param content - The content of the log.
|
|
52
|
-
*/
|
|
53
|
-
export declare const collectLog: (key: string, content: Message) => void;
|
|
54
|
-
export declare const clearCollectedLogs: () => void;
|
|
55
|
-
/**
|
|
56
|
-
* Ouputs information to the user.
|
|
57
|
-
* Info messages don't get additional formatting.
|
|
58
|
-
* Note: Info messages are sent through the standard output.
|
|
59
|
-
* @param content - The content to be output to the user.
|
|
60
|
-
* @param logger - The logging function to use to output to the user.
|
|
61
|
-
*/
|
|
62
|
-
export declare const info: (content: Message, logger?: Logger) => void;
|
|
63
|
-
/**
|
|
64
|
-
* Outputs a success message to the user.
|
|
65
|
-
* Success messages receive a special formatting to make them stand out in the console.
|
|
66
|
-
* Note: Success messages are sent through the standard output.
|
|
67
|
-
* @param content - The content to be output to the user.
|
|
68
|
-
* @param logger - The logging function to use to output to the user.
|
|
69
|
-
*/
|
|
70
|
-
export declare const success: (content: Message, logger?: Logger) => void;
|
|
71
|
-
/**
|
|
72
|
-
* Outputs a completed message to the user.
|
|
73
|
-
* Completed message receive a special formatting to make them stand out in the console.
|
|
74
|
-
* Note: Completed messages are sent through the standard output.
|
|
75
|
-
* @param content - The content to be output to the user.
|
|
76
|
-
* @param logger - The logging function to use to output to the user.
|
|
77
|
-
*/
|
|
78
|
-
export declare const completed: (content: Message, logger?: Logger) => void;
|
|
79
|
-
/**
|
|
80
|
-
* Ouputs debug information to the user. By default these output is hidden unless the user calls the CLI with --verbose.
|
|
81
|
-
* Debug messages don't get additional formatting.
|
|
82
|
-
* Note: Debug messages are sent through the standard output.
|
|
83
|
-
* @param content - The content to be output to the user.
|
|
84
|
-
* @param logger - The logging function to use to output to the user.
|
|
85
|
-
*/
|
|
86
|
-
export declare const debug: (content: Message, logger?: Logger) => void;
|
|
87
|
-
/**
|
|
88
|
-
* Outputs a warning message to the user.
|
|
89
|
-
* Warning messages receive a special formatting to make them stand out in the console.
|
|
90
|
-
* Note: Warning messages are sent through the standard output.
|
|
91
|
-
* @param content - The content to be output to the user.
|
|
92
|
-
* @param logger - The logging function to use to output to the user.
|
|
93
|
-
*/
|
|
94
|
-
export declare const warn: (content: Message, logger?: Logger) => void;
|
|
95
|
-
/**
|
|
96
|
-
* Prints a new line in the terminal.
|
|
97
|
-
*/
|
|
98
|
-
export declare const newline: () => void;
|
|
99
|
-
export declare function stringifyMessage(message: Message): string;
|
|
100
|
-
export interface OutputProcess {
|
|
101
|
-
/** The prefix to include in the logs
|
|
102
|
-
* [vite] Output coming from Vite
|
|
103
|
-
*/
|
|
104
|
-
prefix: string;
|
|
105
|
-
/**
|
|
106
|
-
* A callback to invoke the process. stdout and stderr should be used
|
|
107
|
-
* to send standard output and error data that gets formatted with the
|
|
108
|
-
* right prefix.
|
|
109
|
-
*/
|
|
110
|
-
action: (stdout: Writable, stderr: Writable, signal: AbortSignal) => Promise<void>;
|
|
111
|
-
}
|
|
112
|
-
export declare function consoleLog(message: string): void;
|
|
113
|
-
export declare function consoleError(message: string): void;
|
|
114
|
-
export declare function consoleWarn(message: string): void;
|
|
115
|
-
export declare function outputWhereAppropriate(logLevel: LogLevel, logger: Logger, message: string): void;
|
|
116
|
-
export declare function unstyled(message: string): string;
|
|
117
|
-
export declare function shouldDisplayColors(): boolean;
|
|
118
|
-
/**
|
|
119
|
-
* @param packageManager - The package manager that is being used.
|
|
120
|
-
* @param version - The version to update to
|
|
121
|
-
*/
|
|
122
|
-
export declare function getOutputUpdateCLIReminder(packageManager: PackageManager | 'unknown' | undefined, version: string): string;
|
|
123
|
-
/**
|
|
124
|
-
* Parse title and body to be a single formatted string
|
|
125
|
-
* @param title - The title of the message. Will be formatted as a heading.
|
|
126
|
-
* @param body - The body of the message. Will respect the original formatting.
|
|
127
|
-
* @returns The formatted message.
|
|
128
|
-
*/
|
|
129
|
-
export declare function section(title: string, body: string): string;
|
package/dist/output.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,oCAAoC,CAAA;AAExE,OAAO,MAAM,MAAM,yBAAyB,CAAA;AAC5C,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EAEnB,iBAAiB,EACjB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,sBAAsB,GACvB,MAAM,qBAAqB,CAAA;AAC5B,OAAO,SAAS,MAAM,YAAY,CAAA;AAElC,OAAO,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAA;AAG/B,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,YAAY,CAAA;AAI/C,MAAM,OAAO,eAAe;IAE1B,YAAY,KAAa;QACvB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;IACpB,CAAC;CACF;AAID,MAAM,CAA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8B","sourcesContent":["/* eslint-disable no-console */\nimport {isUnitTest, isVerbose} from './public/node/environment/local.js'\nimport {PackageManager} from './public/node/node-package-manager.js'\nimport colors from './public/node/colors.js'\nimport {\n ColorContentToken,\n CommandContentToken,\n ContentToken,\n ErrorContentToken,\n HeadingContentToken,\n ItalicContentToken,\n JsonContentToken,\n LinesDiffContentToken,\n LinkContentToken,\n PathContentToken,\n RawContentToken,\n SubHeadingContentToken,\n} from './content-tokens.js'\nimport stripAnsi from 'strip-ansi'\nimport {AbortSignal} from '@shopify/cli-kit/node/abort'\nimport {Writable} from 'stream'\nimport type {Change} from 'diff'\n\nexport {default as logUpdate} from 'log-update'\n\nexport type Logger = Writable | ((message: string) => void)\n\nexport class TokenizedString {\n value: string\n constructor(value: string) {\n this.value = value\n }\n}\n\nexport type Message = string | TokenizedString\n\nexport const token = {\n raw: (value: string) => {\n return new RawContentToken(value)\n },\n genericShellCommand: (value: Message) => {\n return new CommandContentToken(value)\n },\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n json: (value: any) => {\n return new JsonContentToken(value)\n },\n path: (value: Message) => {\n return new PathContentToken(value)\n },\n link: (value: Message, link: string) => {\n return new LinkContentToken(value, link)\n },\n heading: (value: Message) => {\n return new HeadingContentToken(value)\n },\n subheading: (value: Message) => {\n return new SubHeadingContentToken(value)\n },\n italic: (value: Message) => {\n return new ItalicContentToken(value)\n },\n errorText: (value: Message) => {\n return new ErrorContentToken(value)\n },\n cyan: (value: Message) => {\n return new ColorContentToken(value, colors.cyan)\n },\n yellow: (value: Message) => {\n return new ColorContentToken(value, colors.yellow)\n },\n magenta: (value: Message) => {\n return new ColorContentToken(value, colors.magenta)\n },\n green: (value: Message) => {\n return new ColorContentToken(value, colors.green)\n },\n packagejsonScript: (packageManager: PackageManager, scriptName: string, ...scriptArgs: string[]) => {\n return new CommandContentToken(formatPackageManagerCommand(packageManager, scriptName, ...scriptArgs))\n },\n successIcon: () => {\n return new ColorContentToken('✔', colors.green)\n },\n failIcon: () => {\n return new ErrorContentToken('✖')\n },\n linesDiff: (value: Change[]) => {\n return new LinesDiffContentToken(value)\n },\n}\n\nexport function formatPackageManagerCommand(\n packageManager: PackageManager,\n scriptName: string,\n ...scriptArgs: string[]\n): string {\n switch (packageManager) {\n case 'pnpm':\n case 'yarn': {\n const pieces = [packageManager, scriptName, ...scriptArgs]\n return pieces.join(' ')\n }\n case 'npm': {\n const pieces = ['npm', 'run', scriptName]\n if (scriptArgs.length > 0) {\n pieces.push('--')\n pieces.push(...scriptArgs)\n }\n return pieces.join(' ')\n }\n }\n}\n\nexport function content(strings: TemplateStringsArray, ...keys: (ContentToken<unknown> | string)[]): TokenizedString {\n let output = ``\n strings.forEach((string, i) => {\n output += string\n if (i >= keys.length) {\n return\n }\n const token = keys[i]!\n\n if (typeof token === 'string') {\n output += token\n } else {\n const enumTokenOutput = token.output()\n\n if (Array.isArray(enumTokenOutput)) {\n enumTokenOutput.forEach((line: string) => {\n output += line\n })\n } else {\n output += enumTokenOutput\n }\n }\n })\n return new TokenizedString(output)\n}\n\n/** Log levels */\nexport type LogLevel = 'fatal' | 'error' | 'warn' | 'info' | 'debug' | 'trace' | 'silent'\n\n/**\n * It maps a level to a numeric value.\n * @param level - The level for which we'll return its numeric value.\n * @returns The numeric value of the level.\n */\nconst logLevelValue = (level: LogLevel): number => {\n switch (level) {\n case 'trace':\n return 10\n case 'debug':\n return 20\n case 'info':\n return 30\n case 'warn':\n return 40\n case 'error':\n return 50\n case 'fatal':\n return 60\n default:\n return 30\n }\n}\n\n/**\n *\n * @returns It returns the log level set by the user.\n */\nexport const currentLogLevel = (): LogLevel => {\n if (isVerbose()) {\n return 'debug'\n } else {\n return 'info'\n }\n}\n\nexport const shouldOutput = (logLevel: LogLevel): boolean => {\n if (isUnitTest()) {\n return false\n }\n const currentLogLevelValue = logLevelValue(currentLogLevel())\n const messageLogLevelValue = logLevelValue(logLevel)\n return messageLogLevelValue >= currentLogLevelValue\n}\n\n// eslint-disable-next-line import/no-mutable-exports\nexport let collectedLogs: {[key: string]: string[]} = {}\n\n/**\n * This is only used during UnitTesting.\n * If we are in a testing context, instead of printing the logs to the console,\n * we will store them in a variable that can be accessed from the tests.\n * @param key - The key of the log.\n * @param content - The content of the log.\n */\nexport const collectLog = (key: string, content: Message) => {\n const output = collectedLogs.output ?? []\n const data = collectedLogs[key] ?? []\n data.push(stripAnsi(stringifyMessage(content) ?? ''))\n output.push(stripAnsi(stringifyMessage(content) ?? ''))\n collectedLogs[key] = data\n collectedLogs.output = output\n}\n\nexport const clearCollectedLogs = () => {\n collectedLogs = {}\n}\n\n/**\n * Ouputs information to the user.\n * Info messages don't get additional formatting.\n * Note: Info messages are sent through the standard output.\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport const info = (content: Message, logger: Logger = consoleLog) => {\n const message = stringifyMessage(content)\n if (isUnitTest()) collectLog('info', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Outputs a success message to the user.\n * Success messages receive a special formatting to make them stand out in the console.\n * Note: Success messages are sent through the standard output.\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport const success = (content: Message, logger: Logger = consoleLog) => {\n const message = colors.bold(`✅ Success! ${stringifyMessage(content)}.`)\n if (isUnitTest()) collectLog('success', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Outputs a completed message to the user.\n * Completed message receive a special formatting to make them stand out in the console.\n * Note: Completed messages are sent through the standard output.\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport const completed = (content: Message, logger: Logger = consoleLog) => {\n const message = `${colors.green('✔')} ${stringifyMessage(content)}`\n if (isUnitTest()) collectLog('completed', content)\n outputWhereAppropriate('info', logger, message)\n}\n\n/**\n * Ouputs debug information to the user. By default these output is hidden unless the user calls the CLI with --verbose.\n * Debug messages don't get additional formatting.\n * Note: Debug messages are sent through the standard output.\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport const debug = (content: Message, logger: Logger = consoleLog) => {\n if (isUnitTest()) collectLog('debug', content)\n const message = colors.gray(stringifyMessage(content))\n outputWhereAppropriate('debug', logger, `${new Date().toISOString()}: ${message}`)\n}\n\n/**\n * Outputs a warning message to the user.\n * Warning messages receive a special formatting to make them stand out in the console.\n * Note: Warning messages are sent through the standard output.\n * @param content - The content to be output to the user.\n * @param logger - The logging function to use to output to the user.\n */\nexport const warn = (content: Message, logger: Logger = consoleWarn) => {\n if (isUnitTest()) collectLog('warn', content)\n const message = colors.yellow(stringifyMessage(content))\n outputWhereAppropriate('warn', logger, message)\n}\n\n/**\n * Prints a new line in the terminal.\n */\nexport const newline = () => {\n console.log()\n}\n\nexport function stringifyMessage(message: Message): string {\n if (message instanceof TokenizedString) {\n return message.value\n } else {\n return message\n }\n}\n\nexport interface OutputProcess {\n /** The prefix to include in the logs\n * [vite] Output coming from Vite\n */\n prefix: string\n /**\n * A callback to invoke the process. stdout and stderr should be used\n * to send standard output and error data that gets formatted with the\n * right prefix.\n */\n action: (stdout: Writable, stderr: Writable, signal: AbortSignal) => Promise<void>\n}\n\nexport function consoleLog(message: string): void {\n console.log(withOrWithoutStyle(message))\n}\n\nexport function consoleError(message: string): void {\n console.error(withOrWithoutStyle(message))\n}\n\nexport function consoleWarn(message: string): void {\n console.warn(withOrWithoutStyle(message))\n}\n\nexport function outputWhereAppropriate(logLevel: LogLevel, logger: Logger, message: string): void {\n if (shouldOutput(logLevel)) {\n if (logger instanceof Writable) {\n logger.write(message)\n } else {\n logger(message)\n }\n }\n}\n\nfunction withOrWithoutStyle(message: string): string {\n if (shouldDisplayColors()) {\n return message\n } else {\n return unstyled(message)\n }\n}\n\nexport function unstyled(message: string): string {\n return stripAnsi(message)\n}\n\nexport function shouldDisplayColors(): boolean {\n return Boolean(process.stdout.isTTY || process.env.FORCE_COLOR)\n}\n\n/**\n * @param packageManager - The package manager that is being used.\n * @param version - The version to update to\n */\nexport function getOutputUpdateCLIReminder(\n packageManager: PackageManager | 'unknown' | undefined,\n version: string,\n): string {\n const versionMessage = `💡 Version ${version} available!`\n if (!packageManager || packageManager === 'unknown') return versionMessage\n\n const updateCommand = token.packagejsonScript(packageManager, 'shopify upgrade')\n return content`${versionMessage} Run ${updateCommand}`.value\n}\n\n/**\n * Parse title and body to be a single formatted string\n * @param title - The title of the message. Will be formatted as a heading.\n * @param body - The body of the message. Will respect the original formatting.\n * @returns The formatted message.\n */\nexport function section(title: string, body: string): string {\n const formattedTitle = `${title.toUpperCase()}${' '.repeat(35 - title.length)}`\n return content`${token.heading(formattedTitle)}\\n${body}`.value\n}\n\n/* eslint-enable no-console */\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"deep-required.js","sourceRoot":"","sources":["../../../../src/private/common/ts/deep-required.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Converts a mapping type to be non-optional.\n *\n * ```ts\n * type T = DeepRequired<{optionalKey?: string, nullableValue: string | null, undefinableValue: string | undefined}>\n * T = {optionalKey: string, nullableValue: string, undefinableValue: string}\n * ```\n *.\n */\nexport type DeepRequired<T> = {\n [TKey in keyof Required<T>]: NonNullable<Required<T>[TKey]>\n}\n"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"simple-definitions.js","sourceRoot":"","sources":["../../../src/private/node/simple-definitions.ts"],"names":[],"mappings":"","sourcesContent":["declare module 'color-json' {\n function colour(content: string | object): string\n export default colour\n}\n"]}
|