@shopify/cli-kit 4.6.0 → 4.7.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/private/node/analytics/bounded-collections.js +1 -4
- package/dist/private/node/analytics/bounded-collections.js.map +1 -1
- package/dist/private/node/analytics/graphql-error-codes.d.ts +2 -2
- package/dist/private/node/analytics/graphql-error-codes.js +2 -2
- package/dist/private/node/analytics/graphql-error-codes.js.map +1 -1
- package/dist/private/node/analytics.js +12 -7
- package/dist/private/node/analytics.js.map +1 -1
- package/dist/private/node/api/headers.js +3 -0
- package/dist/private/node/api/headers.js.map +1 -1
- package/dist/private/node/api.js +8 -8
- package/dist/private/node/api.js.map +1 -1
- package/dist/private/node/conf-store.js +1 -1
- package/dist/private/node/conf-store.js.map +1 -1
- package/dist/private/node/content-tokens.js +27 -2
- package/dist/private/node/content-tokens.js.map +1 -1
- package/dist/private/node/otel-metrics.d.ts +1 -1
- package/dist/private/node/otel-metrics.js +5 -2
- package/dist/private/node/otel-metrics.js.map +1 -1
- package/dist/private/node/plugin-hints.d.ts +16 -0
- package/dist/private/node/plugin-hints.js +29 -0
- package/dist/private/node/plugin-hints.js.map +1 -0
- package/dist/private/node/request-ids.js +2 -3
- package/dist/private/node/request-ids.js.map +1 -1
- package/dist/private/node/session/device-authorization.js +4 -7
- package/dist/private/node/session/device-authorization.js.map +1 -1
- package/dist/private/node/session/exchange.d.ts +4 -4
- package/dist/private/node/session/exchange.js +21 -5
- package/dist/private/node/session/exchange.js.map +1 -1
- package/dist/private/node/testing/ui.js +18 -19
- package/dist/private/node/testing/ui.js.map +1 -1
- package/dist/private/node/ui/components/Alert.d.ts +1 -1
- package/dist/private/node/ui/components/Alert.js.map +1 -1
- package/dist/private/node/ui/components/ConcurrentOutput.test.js +2 -0
- package/dist/private/node/ui/components/ConcurrentOutput.test.js.map +1 -1
- package/dist/private/node/ui/components/DangerousConfirmationPrompt.d.ts +1 -1
- package/dist/private/node/ui/components/DangerousConfirmationPrompt.js.map +1 -1
- package/dist/private/node/ui/components/List.d.ts +1 -1
- package/dist/private/node/ui/components/List.js.map +1 -1
- package/dist/private/node/ui/components/Prompts/InfoMessage.d.ts +1 -1
- package/dist/private/node/ui/components/Prompts/InfoMessage.js.map +1 -1
- package/dist/private/node/ui/components/Prompts/InfoTable.d.ts +1 -1
- package/dist/private/node/ui/components/Prompts/InfoTable.js.map +1 -1
- package/dist/private/node/ui/components/Prompts/PromptLayout.d.ts +1 -1
- package/dist/private/node/ui/components/Prompts/PromptLayout.js.map +1 -1
- package/dist/private/node/ui/components/SingleTask.test.js +1 -0
- package/dist/private/node/ui/components/SingleTask.test.js.map +1 -1
- package/dist/private/node/ui/components/TabularData.d.ts +1 -1
- package/dist/private/node/ui/components/TabularData.js +2 -1
- package/dist/private/node/ui/components/TabularData.js.map +1 -1
- package/dist/private/node/ui/components/TextPrompt.d.ts +1 -1
- package/dist/private/node/ui/components/TextPrompt.js.map +1 -1
- package/dist/private/node/ui/components/TokenizedText.d.ts +1 -38
- package/dist/private/node/ui/components/TokenizedText.js +0 -54
- package/dist/private/node/ui/components/TokenizedText.js.map +1 -1
- package/dist/private/node/ui/components/TokenizedText.test.js +2 -1
- package/dist/private/node/ui/components/TokenizedText.test.js.map +1 -1
- package/dist/private/node/ui/components/token-item.d.ts +38 -0
- package/dist/private/node/ui/components/token-item.js +63 -0
- package/dist/private/node/ui/components/token-item.js.map +1 -0
- package/dist/private/node/ui/hooks/use-abort-signal.js +5 -4
- package/dist/private/node/ui/hooks/use-abort-signal.js.map +1 -1
- package/dist/private/node/ui/hooks/use-select-state.js +2 -1
- package/dist/private/node/ui/hooks/use-select-state.js.map +1 -1
- package/dist/private/node/ui/utilities.d.ts +6 -6
- package/dist/private/node/ui/utilities.js +1 -1
- package/dist/private/node/ui/utilities.js.map +1 -1
- package/dist/private/node/ui.js +18 -15
- package/dist/private/node/ui.js.map +1 -1
- package/dist/public/common/string.d.ts +1 -1
- package/dist/public/common/string.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/abort.d.ts +14 -6
- package/dist/public/node/abort.js +7 -6
- package/dist/public/node/abort.js.map +1 -1
- package/dist/public/node/analytics.d.ts +1 -0
- package/dist/public/node/analytics.js +79 -32
- package/dist/public/node/analytics.js.map +1 -1
- package/dist/public/node/api/admin.js +1 -1
- package/dist/public/node/api/admin.js.map +1 -1
- package/dist/public/node/base-command.d.ts +10 -0
- package/dist/public/node/base-command.js +31 -8
- package/dist/public/node/base-command.js.map +1 -1
- package/dist/public/node/cli.d.ts +13 -0
- package/dist/public/node/cli.js +18 -2
- package/dist/public/node/cli.js.map +1 -1
- package/dist/public/node/context/local.d.ts +3 -1
- package/dist/public/node/context/local.js +14 -7
- package/dist/public/node/context/local.js.map +1 -1
- package/dist/public/node/custom-oclif-loader.js +19 -16
- package/dist/public/node/custom-oclif-loader.js.map +1 -1
- package/dist/public/node/doctor/framework.js +4 -5
- package/dist/public/node/doctor/framework.js.map +1 -1
- package/dist/public/node/environment.js +8 -11
- package/dist/public/node/environment.js.map +1 -1
- package/dist/public/node/error.d.ts +1 -4
- package/dist/public/node/error.js +20 -7
- package/dist/public/node/error.js.map +1 -1
- package/dist/public/node/git.js +7 -5
- package/dist/public/node/git.js.map +1 -1
- package/dist/public/node/global-context.js +1 -1
- package/dist/public/node/global-context.js.map +1 -1
- package/dist/public/node/hidden-folder.js +2 -4
- package/dist/public/node/hidden-folder.js.map +1 -1
- package/dist/public/node/hooks/postrun.js +1 -1
- package/dist/public/node/hooks/postrun.js.map +1 -1
- package/dist/public/node/hooks/prerun.js +5 -1
- package/dist/public/node/hooks/prerun.js.map +1 -1
- package/dist/public/node/local-storage.js +1 -0
- package/dist/public/node/local-storage.js.map +1 -1
- package/dist/public/node/metadata.d.ts +3 -0
- package/dist/public/node/metadata.js.map +1 -1
- package/dist/public/node/mimes.js +1 -3
- package/dist/public/node/mimes.js.map +1 -1
- package/dist/public/node/node-package-manager.js +31 -73
- package/dist/public/node/node-package-manager.js.map +1 -1
- package/dist/public/node/notifications-system.js +19 -3
- package/dist/public/node/notifications-system.js.map +1 -1
- package/dist/public/node/os.js +5 -10
- package/dist/public/node/os.js.map +1 -1
- package/dist/public/node/output.js +11 -20
- package/dist/public/node/output.js.map +1 -1
- package/dist/public/node/plugins/tunnel.d.ts +1 -2
- package/dist/public/node/plugins/tunnel.js +2 -2
- package/dist/public/node/plugins/tunnel.js.map +1 -1
- package/dist/public/node/result.js +4 -2
- package/dist/public/node/result.js.map +1 -1
- package/dist/public/node/serial-batch-processor.js +4 -3
- package/dist/public/node/serial-batch-processor.js.map +1 -1
- package/dist/public/node/store-auth-session.js +1 -1
- package/dist/public/node/store-auth-session.js.map +1 -1
- package/dist/public/node/system.d.ts +15 -1
- package/dist/public/node/system.js +42 -6
- package/dist/public/node/system.js.map +1 -1
- package/dist/public/node/themes/conf.js +2 -2
- package/dist/public/node/themes/conf.js.map +1 -1
- package/dist/public/node/themes/factories.js +2 -2
- package/dist/public/node/themes/factories.js.map +1 -1
- package/dist/public/node/themes/theme-manager.js +2 -0
- package/dist/public/node/themes/theme-manager.js.map +1 -1
- package/dist/public/node/themes/urls.js +7 -7
- package/dist/public/node/themes/urls.js.map +1 -1
- package/dist/public/node/toml/toml-file.js +12 -13
- package/dist/public/node/toml/toml-file.js.map +1 -1
- package/dist/public/node/ui.d.ts +1 -1
- package/dist/public/node/ui.js +1 -1
- package/dist/public/node/ui.js.map +1 -1
- package/dist/public/node/vendor/dev_server/dev-server-2024.js +14 -2
- package/dist/public/node/vendor/dev_server/dev-server-2024.js.map +1 -1
- package/dist/public/node/vendor/dev_server/dev-server.js +3 -0
- package/dist/public/node/vendor/dev_server/dev-server.js.map +1 -1
- package/dist/public/node/vendor/dev_server/network/index.js +1 -1
- package/dist/public/node/vendor/dev_server/network/index.js.map +1 -1
- package/dist/public/node/vendor/otel-js/export/InstantaneousMetricReader.js +1 -0
- package/dist/public/node/vendor/otel-js/export/InstantaneousMetricReader.js.map +1 -1
- package/dist/public/node/vendor/otel-js/service/BaseOtelService/BaseOtelService.js +5 -2
- package/dist/public/node/vendor/otel-js/service/BaseOtelService/BaseOtelService.js.map +1 -1
- package/dist/public/node/vendor/otel-js/service/types.d.ts +2 -2
- package/dist/public/node/vendor/otel-js/service/types.js.map +1 -1
- package/dist/public/node/vscode.js +12 -11
- package/dist/public/node/vscode.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -9
|
@@ -10,6 +10,13 @@ import { setCurrentCommandId } from './global-context.js';
|
|
|
10
10
|
import { underscore } from '../common/string.js';
|
|
11
11
|
import { Command, Errors } from '@oclif/core';
|
|
12
12
|
class BaseCommand extends Command {
|
|
13
|
+
static baseFlags = {};
|
|
14
|
+
static get requiresSyncAnalytics() {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
static nonTTYFlagRequirements(_flags) {
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
13
20
|
// Replace markdown links to plain text like: "link label" (url)
|
|
14
21
|
static descriptionWithoutMarkdown() {
|
|
15
22
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -77,6 +84,7 @@ class BaseCommand extends Command {
|
|
|
77
84
|
result = await this.resultWithEnvironment(result, options, argv);
|
|
78
85
|
await setCurrentSessionAlias(result.flags['auth-alias']);
|
|
79
86
|
await addFromParsedFlags(result.flags);
|
|
87
|
+
this.failMissingNonTTYFlagRequirements(result.flags, this.applicableNonTTYFlagRequirements(result.flags));
|
|
80
88
|
return { ...result, ...{ argv: result.argv } };
|
|
81
89
|
}
|
|
82
90
|
environmentsFilename() {
|
|
@@ -84,17 +92,33 @@ class BaseCommand extends Command {
|
|
|
84
92
|
return undefined;
|
|
85
93
|
}
|
|
86
94
|
failMissingNonTTYFlags(flags, requiredFlags) {
|
|
95
|
+
this.failMissingNonTTYFlagRequirements(flags, requiredFlags.map((flag) => ({ flags: [flag] })));
|
|
96
|
+
}
|
|
97
|
+
failMissingNonTTYFlagRequirements(flags, requirements) {
|
|
87
98
|
if (terminalSupportsPrompting())
|
|
88
99
|
return;
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
100
|
+
const missingRequirements = requirements.filter((requirement) => requirement.flags.every((flag) => flags[flag] === undefined || flags[flag] === false));
|
|
101
|
+
if (missingRequirements.length === 0)
|
|
102
|
+
return;
|
|
103
|
+
const heading = missingRequirements.length === 1 ? 'Flag not specified' : 'Flags not specified';
|
|
104
|
+
const formattedRequirements = missingRequirements
|
|
105
|
+
.map((requirement) => requirement.flags.map((flag) => `--${flag}`).join(' or '))
|
|
106
|
+
.join('\n');
|
|
107
|
+
const explanation = missingRequirements.length === 1 ? 'This flag is required' : 'These flags are required';
|
|
108
|
+
throw new AbortError(outputContent `${heading}:
|
|
92
109
|
|
|
93
|
-
${outputToken.cyan(
|
|
110
|
+
${outputToken.cyan(formattedRequirements)}
|
|
94
111
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
112
|
+
${explanation} in non-interactive terminal environments, such as a CI environment, or when piping input from another process.`, 'To resolve this, specify the options in the command, or run the command in an interactive environment such as your local terminal.');
|
|
113
|
+
}
|
|
114
|
+
applicableNonTTYFlagRequirements(flags) {
|
|
115
|
+
const command = this.constructor;
|
|
116
|
+
const allFlags = { ...command.baseFlags, ...command.flags };
|
|
117
|
+
const requirementsFromFlags = Object.entries(allFlags)
|
|
118
|
+
.filter(([, flag]) => Boolean(flag.requiredIfNonInteractive))
|
|
119
|
+
.map(([name]) => ({ flags: [name] }));
|
|
120
|
+
const commandRequirements = (command.nonTTYFlagRequirements?.(flags) ?? []).filter((requirement) => requirement.when?.(flags) ?? true);
|
|
121
|
+
return [...requirementsFromFlags, ...commandRequirements];
|
|
98
122
|
}
|
|
99
123
|
async resultWithEnvironment(originalResult, options, argv) {
|
|
100
124
|
const flags = originalResult.flags;
|
|
@@ -150,7 +174,6 @@ This flag is required in non-interactive terminal environments, such as a CI env
|
|
|
150
174
|
return { environment, isDefaultEnvironment: true };
|
|
151
175
|
}
|
|
152
176
|
}
|
|
153
|
-
BaseCommand.baseFlags = {};
|
|
154
177
|
export async function addFromParsedFlags(flags) {
|
|
155
178
|
await addPublicMetadata(() => ({
|
|
156
179
|
cmd_all_verbose: flags.verbose,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-command.js","sourceRoot":"","sources":["../../../src/public/node/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAA;AACrC,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,WAAW,EAAC,MAAM,aAAa,CAAA;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,cAAc,CAAA;AACnD,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAA;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAA;AACtC,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAA;AAEvD,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAC,OAAO,EAAU,MAAM,EAAC,MAAM,aAAa,CAAA;AAcnD,MAAe,WAAY,SAAQ,OAAO;IAGxC,gEAAgE;IACzD,MAAM,CAAC,0BAA0B;QACtC,8DAA8D;QAC9D,OAAO,CAAE,IAAY,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,6BAA6B,EAAE,WAAW,CAAC,CAAA;IAC1G,CAAC;IAEM,MAAM,CAAC,qBAAqB;QACjC,OAAO,SAAS,CAAA;IAClB,CAAC;IAEM,MAAM,CAAC,oBAAoB;QAChC,OAAO,SAAS,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,CAAC,CAAA;IACJ,CAAC;IACD,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IACxF,6GAA6G;IAC7G,MAAM,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AAClF,CAAC;AAED,eAAe,WAAW,CAAA","sourcesContent":["import {isDevelopment} from './context/local.js'\nimport {addPublicMetadata} from './metadata.js'\nimport {AbortError} from './error.js'\nimport {outputContent, outputResult, outputToken} from './output.js'\nimport {setCurrentSessionAlias} from './session.js'\nimport {terminalSupportsPrompting} from './system.js'\nimport {hashString} from './crypto.js'\nimport {isTruthy} from './context/utilities.js'\nimport {setCurrentCommandId} from './global-context.js'\nimport {JsonMap} from '../../private/common/json.js'\nimport {underscore} from '../common/string.js'\nimport {Command, Config, Errors} from '@oclif/core'\nimport {OutputFlags, Input, ParserOutput, FlagInput, OutputArgs} from '@oclif/core/parser'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ArgOutput = OutputArgs<any>\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type FlagOutput = OutputFlags<any>\n\ninterface EnvironmentFlags {\n 'auth-alias'?: string\n environment?: string[]\n path?: string\n}\n\nabstract class BaseCommand extends Command {\n static baseFlags: FlagInput<{}> = {}\n\n // Replace markdown links to plain text like: \"link label\" (url)\n public static descriptionWithoutMarkdown(): string | undefined {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return ((this as any).descriptionWithMarkdown ?? '').replace(/(\\[)(.*?)(])(\\()(.*?)(\\))/gm, '\"$2\" ($5)')\n }\n\n public static analyticsNameOverride(): string | undefined {\n return undefined\n }\n\n public static analyticsStopCommand(): string | undefined {\n return undefined\n }\n\n async catch(error: Error & {skipOclifErrorHandling: boolean}): Promise<void> {\n error.skipOclifErrorHandling = true\n const {errorHandler} = await import('./error-handler.js')\n await errorHandler(error, this.config)\n return Errors.handle(error)\n }\n\n protected async init(): Promise<unknown> {\n this.exitWithTimestampWhenEnvVariablePresent()\n setCurrentCommandId(this.id ?? '')\n if (!isDevelopment()) {\n // This function runs just prior to `run`\n const {registerCleanBugsnagErrorsFromWithinPlugins} = await import('./error-handler.js')\n await registerCleanBugsnagErrorsFromWithinPlugins(this.config)\n }\n await removeDuplicatedPlugins(this.config)\n this.showNpmFlagWarning()\n const {showNotificationsIfNeeded} = await import('./notifications-system.js')\n await showNotificationsIfNeeded()\n return super.init()\n }\n\n // NPM creates an environment variable for every flag passed to a script.\n // This function checks for the presence of any of the available CLI flags\n // and warns the user to use the `--` separator.\n protected showNpmFlagWarning(): void {\n const commandVariables = this.constructor as unknown as {flags: JsonMap}\n const commandFlags = Object.keys(commandVariables.flags || {})\n const possibleNpmEnvVars = commandFlags.map((key) => `npm_config_${underscore(key).replace(/^no_/, '')}`)\n\n if (possibleNpmEnvVars.some((flag) => process.env[flag] !== undefined)) {\n // eslint-disable-next-line no-void\n void import('./ui.js').then(({renderWarning}) => {\n renderWarning({\n body: [\n 'NPM scripts require an extra',\n {command: '--'},\n 'separator to pass the flags. Example:',\n {command: 'npm run dev -- --reset'},\n ],\n })\n })\n }\n }\n\n protected exitWithTimestampWhenEnvVariablePresent() {\n if (isTruthy(process.env.SHOPIFY_CLI_ENV_STARTUP_PERFORMANCE_RUN)) {\n outputResult(`\n SHOPIFY_CLI_TIMESTAMP_START\n { \"timestamp\": ${Date.now()} }\n SHOPIFY_CLI_TIMESTAMP_END\n `)\n process.exit(0)\n }\n }\n\n protected async parse<\n TFlags extends FlagOutput & {path?: string; verbose?: boolean; 'auth-alias'?: string},\n TGlobalFlags extends FlagOutput,\n TArgs extends ArgOutput,\n >(\n options?: Input<TFlags, TGlobalFlags, TArgs>,\n argv?: string[],\n ): Promise<ParserOutput<TFlags, TGlobalFlags, TArgs> & {argv: string[]}> {\n let result = await super.parse<TFlags, TGlobalFlags, TArgs>(options, argv)\n result = await this.resultWithEnvironment<TFlags, TGlobalFlags, TArgs>(result, options, argv)\n await setCurrentSessionAlias(result.flags['auth-alias'])\n await addFromParsedFlags(result.flags)\n return {...result, ...{argv: result.argv as string[]}}\n }\n\n protected environmentsFilename(): string | undefined {\n // To be re-implemented if needed\n return undefined\n }\n\n protected failMissingNonTTYFlags(flags: FlagOutput, requiredFlags: string[]): void {\n if (terminalSupportsPrompting()) return\n\n requiredFlags.forEach((name: string) => {\n if (!(name in flags)) {\n throw new AbortError(\n outputContent`Flag not specified:\n\n${outputToken.cyan(name)}\n\nThis flag is required in non-interactive terminal environments, such as a CI environment, or when piping input from another process.`,\n 'To resolve this, specify the option in the command, or run the command in an interactive environment such as your local terminal.',\n )\n }\n })\n }\n\n private async resultWithEnvironment<\n TFlags extends FlagOutput & {path?: string; verbose?: boolean},\n TGlobalFlags extends FlagOutput,\n TArgs extends ArgOutput,\n >(\n originalResult: ParserOutput<TFlags, TGlobalFlags, TArgs>,\n options?: Input<TFlags, TGlobalFlags, TArgs>,\n argv?: string[],\n ): Promise<ParserOutput<TFlags, TGlobalFlags, TArgs>> {\n const flags = originalResult.flags as EnvironmentFlags\n const environmentsFileName = this.environmentsFilename()\n\n if (!environmentsFileName) return originalResult\n\n const {environmentFilePath} = await import('./environments.js')\n const environmentFileExists = await environmentFilePath(environmentsFileName, {from: flags.path})\n\n // Handle both string and array cases for environment flag\n let environments: string[] = []\n if (flags.environment) {\n environments = Array.isArray(flags.environment) ? flags.environment : [flags.environment]\n }\n\n const environmentSpecified = environments.length > 0\n\n // Noop if no environment file exists and none was specified\n if (!environmentFileExists && !environmentSpecified) return originalResult\n\n // Noop if multiple environments were specified (let commands handle this)\n if (environmentSpecified && environments.length > 1) return originalResult\n\n const {environment, isDefaultEnvironment} = await this.loadEnvironmentForCommand(\n flags.path,\n environmentsFileName,\n environments[0],\n )\n\n if (!environment) return originalResult\n if (isDefaultEnvironment && !commandSupportsFlag(options?.flags, 'environment')) return originalResult\n\n // Parse using noDefaultsOptions to derive a list of flags specified as\n // command-line arguments.\n const noDefaultsResult = await super.parse<TFlags, TGlobalFlags, TArgs>(noDefaultsOptions(options), argv)\n\n // Add the environment's settings to argv and pass them to `super.parse`. This\n // invokes oclif's validation system without breaking the oclif black box.\n // Replace the original result with this one.\n const result = await super.parse<TFlags, TGlobalFlags, TArgs>(options, [\n // Need to specify argv default because we're merging with argsFromEnvironment.\n ...(argv ?? this.argv),\n ...argsFromEnvironment<TFlags, TGlobalFlags, TArgs>(environment, options, noDefaultsResult),\n ...(isDefaultEnvironment ? ['--environment', 'default'] : []),\n ])\n\n // Report successful application of the environment.\n reportEnvironmentApplication<TFlags, TGlobalFlags, TArgs>(\n noDefaultsResult.flags,\n result.flags,\n isDefaultEnvironment ? 'default' : (environments[0] as string),\n environment,\n )\n\n return result\n }\n\n /**\n * Tries to load an environment to forward to the command. If no environment\n * is specified it will try to load a default environment.\n */\n private async loadEnvironmentForCommand(\n path: string | undefined,\n environmentsFileName: string,\n specifiedEnvironment: string | undefined,\n ): Promise<{environment: JsonMap | undefined; isDefaultEnvironment: boolean}> {\n const {loadEnvironment} = await import('./environments.js')\n if (specifiedEnvironment) {\n const environment = await loadEnvironment(specifiedEnvironment, environmentsFileName, {from: path})\n return {environment, isDefaultEnvironment: false}\n }\n\n const environment = await loadEnvironment('default', environmentsFileName, {from: path, silent: true})\n return {environment, isDefaultEnvironment: true}\n }\n}\n\nexport async function addFromParsedFlags(flags: {path?: string; verbose?: boolean}): Promise<void> {\n await addPublicMetadata(() => ({\n cmd_all_verbose: flags.verbose,\n cmd_all_path_override: flags.path !== undefined,\n cmd_all_path_override_hash: flags.path === undefined ? undefined : hashString(flags.path),\n }))\n}\n\n/**\n * Any flag which is:\n *\n * 1. Present in the final set of flags\n * 2. Specified in the environment\n * 3. Not specified by the user as a command line argument\n *\n * should be reported.\n *\n * It doesn't matter if the environment flag's value was the same as the default; from\n * the user's perspective, they want to know their environment was applied.\n */\nfunction reportEnvironmentApplication<\n TFlags extends FlagOutput,\n TGlobalFlags extends FlagOutput,\n TArgs extends ArgOutput,\n>(\n noDefaultsFlags: ParserOutput<TFlags, TGlobalFlags, TArgs>['flags'],\n flagsWithEnvironments: ParserOutput<TFlags, TGlobalFlags, TArgs>['flags'],\n environmentName: string,\n environment: JsonMap,\n): void {\n const changes: JsonMap = {}\n for (const [name, value] of Object.entries(flagsWithEnvironments)) {\n const userSpecifiedThisFlag = Object.prototype.hasOwnProperty.call(noDefaultsFlags, name)\n const environmentContainsFlag = Object.prototype.hasOwnProperty.call(environment, name)\n if (!userSpecifiedThisFlag && environmentContainsFlag) {\n const valueToReport = name === 'password' ? `********${value.substr(-4)}` : value\n changes[name] = valueToReport\n }\n }\n if (Object.keys(changes).length === 0) return\n\n const items = Object.entries(changes).map(([name, value]) => `${name}: ${value}`)\n // eslint-disable-next-line no-void\n void import('./ui.js').then(({renderInfo}) => {\n renderInfo({\n headline: ['Using applicable flags from', {userInput: environmentName}, 'environment:'],\n body: [{list: {items}}],\n })\n })\n}\n\n/**\n * Strips the defaults from configured flags. For example, if flags contains:\n *\n * ```\n * someFlag: Flags.boolean({\n * description: 'some flag',\n * default: false\n * })\n * ```\n *\n * it becomes:\n *\n * ```\n * someFlag: Flags.boolean({\n * description: 'some flag'\n * })\n * ```\n *\n * If we parse using this configuration, the only specified flags will be those\n * the user actually passed on the command line.\n */\nexport function noDefaultsOptions<TFlags extends FlagOutput, TGlobalFlags extends FlagOutput, TArgs extends ArgOutput>(\n options: Input<TFlags, TGlobalFlags, TArgs> | undefined,\n): Input<TFlags, TGlobalFlags, TArgs> | undefined {\n if (!options?.flags) return options\n return {\n ...options,\n flags: Object.fromEntries(\n Object.entries(options.flags).map(([label, settings]) => {\n const copiedSettings = {...(settings as {default?: unknown})}\n delete copiedSettings.default\n return [label, copiedSettings]\n }),\n ) as FlagInput<TFlags>,\n }\n}\n\n/**\n * Converts the environment's settings to arguments as though passed on the command\n * line, skipping any arguments the user specified on the command line.\n */\nfunction argsFromEnvironment<TFlags extends FlagOutput, TGlobalFlags extends FlagOutput, TArgs extends ArgOutput>(\n environment: JsonMap,\n options: Input<TFlags, TGlobalFlags, TArgs> | undefined,\n noDefaultsResult: ParserOutput<TFlags, TArgs>,\n): string[] {\n const args: string[] = []\n for (const [label, value] of Object.entries(environment)) {\n const flagIsRelevantToCommand = commandSupportsFlag(options?.flags, label)\n const userSpecifiedThisFlag =\n noDefaultsResult.flags && Object.prototype.hasOwnProperty.call(noDefaultsResult.flags, label)\n if (flagIsRelevantToCommand && !userSpecifiedThisFlag) {\n if (typeof value === 'boolean') {\n if (value) {\n args.push(`--${label}`)\n } else {\n throw new AbortError(\n outputContent`Environments can only specify true for boolean flags. Attempted to set ${outputToken.yellow(\n label,\n )} to false.`,\n )\n }\n } else if (Array.isArray(value)) {\n value.forEach((element) => args.push(`--${label}`, `${element}`))\n } else {\n args.push(`--${label}`, `${value}`)\n }\n }\n }\n return args\n}\n\nfunction commandSupportsFlag(flags: FlagInput | undefined, flagName: string): boolean {\n return Boolean(flags) && Object.prototype.hasOwnProperty.call(flags, flagName)\n}\n\nasync function removeDuplicatedPlugins(config: Config): Promise<void> {\n const plugins = Array.from(config.plugins.values())\n const bundlePlugins = ['@shopify/app', '@shopify/plugin-cloudflare']\n const pluginsToRemove = plugins.filter((plugin) => bundlePlugins.includes(plugin.name))\n if (pluginsToRemove.length > 0) {\n const commandsToRun = pluginsToRemove.map((plugin) => ` - shopify plugins remove ${plugin.name}`).join('\\n')\n const {renderWarning} = await import('./ui.js')\n renderWarning({\n headline: `Unsupported plugins detected: ${pluginsToRemove.map((plugin) => plugin.name).join(', ')}`,\n body: [\n 'They are already included in the CLI and installing them as custom plugins can cause conflicts.',\n `You can fix it by running:\\n${commandsToRun}`,\n ],\n })\n }\n const filteredPlugins = plugins.filter((plugin) => !bundlePlugins.includes(plugin.name))\n // eslint-disable-next-line require-atomic-updates -- config.plugins won't be modified by renderWarning above\n config.plugins = new Map(filteredPlugins.map((plugin) => [plugin.name, plugin]))\n}\n\nexport default BaseCommand\n"]}
|
|
1
|
+
{"version":3,"file":"base-command.js","sourceRoot":"","sources":["../../../src/public/node/base-command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,aAAa,EAAC,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAC,UAAU,EAAC,MAAM,YAAY,CAAA;AACrC,OAAO,EAAC,aAAa,EAAE,YAAY,EAAE,WAAW,EAAC,MAAM,aAAa,CAAA;AACpE,OAAO,EAAC,sBAAsB,EAAC,MAAM,cAAc,CAAA;AACnD,OAAO,EAAC,yBAAyB,EAAC,MAAM,aAAa,CAAA;AACrD,OAAO,EAAC,UAAU,EAAC,MAAM,aAAa,CAAA;AACtC,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAC,mBAAmB,EAAC,MAAM,qBAAqB,CAAA;AAEvD,OAAO,EAAC,UAAU,EAAC,MAAM,qBAAqB,CAAA;AAC9C,OAAO,EAAC,OAAO,EAAU,MAAM,EAAC,MAAM,aAAa,CAAA;AAqBnD,MAAe,WAAY,SAAQ,OAAO;IACxC,MAAM,CAAC,SAAS,GAAkB,EAAE,CAAA;IAE7B,MAAM,KAAK,qBAAqB;QACrC,OAAO,KAAK,CAAA;IACd,CAAC;IAEM,MAAM,CAAC,sBAAsB,CAAC,MAAkB;QACrD,OAAO,EAAE,CAAA;IACX,CAAC;IAED,gEAAgE;IACzD,MAAM,CAAC,0BAA0B;QACtC,8DAA8D;QAC9D,OAAO,CAAE,IAAY,CAAC,uBAAuB,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,6BAA6B,EAAE,WAAW,CAAC,CAAA;IAC1G,CAAC;IAEM,MAAM,CAAC,qBAAqB;QACjC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AAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IACvF,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,MAAM,aAAa,GAAG,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,8BAA8B,MAAM,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAC7G,MAAM,EAAC,aAAa,EAAC,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAA;QAC/C,aAAa,CAAC;YACZ,QAAQ,EAAE,iCAAiC,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;YACpG,IAAI,EAAE;gBACJ,iGAAiG;gBACjG,+BAA+B,aAAa,EAAE;aAC/C;SACF,CAAC,CAAA;IACJ,CAAC;IACD,MAAM,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAA;IACxF,6GAA6G;IAC7G,MAAM,CAAC,OAAO,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,CAAC,CAAA;AAClF,CAAC;AAED,eAAe,WAAW,CAAA","sourcesContent":["import {isDevelopment} from './context/local.js'\nimport {addPublicMetadata} from './metadata.js'\nimport {AbortError} from './error.js'\nimport {outputContent, outputResult, outputToken} from './output.js'\nimport {setCurrentSessionAlias} from './session.js'\nimport {terminalSupportsPrompting} from './system.js'\nimport {hashString} from './crypto.js'\nimport {isTruthy} from './context/utilities.js'\nimport {setCurrentCommandId} from './global-context.js'\nimport {JsonMap} from '../../private/common/json.js'\nimport {underscore} from '../common/string.js'\nimport {Command, Config, Errors} from '@oclif/core'\nimport {OutputFlags, Input, ParserOutput, FlagInput, OutputArgs} from '@oclif/core/parser'\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type ArgOutput = OutputArgs<any>\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type FlagOutput = OutputFlags<any>\n\nexport interface NonTTYFlagRequirement {\n /** At least one of these flags must be present when the requirement applies. */\n flags: string[]\n /** Determines whether the requirement applies to the parsed flags. */\n when?: (flags: FlagOutput) => boolean\n}\n\ninterface EnvironmentFlags {\n 'auth-alias'?: string\n environment?: string[]\n path?: string\n}\n\nabstract class BaseCommand extends Command {\n static baseFlags: FlagInput<{}> = {}\n\n public static get requiresSyncAnalytics(): boolean {\n return false\n }\n\n public static nonTTYFlagRequirements(_flags: FlagOutput): NonTTYFlagRequirement[] {\n return []\n }\n\n // Replace markdown links to plain text like: \"link label\" (url)\n public static descriptionWithoutMarkdown(): string | undefined {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return ((this as any).descriptionWithMarkdown ?? '').replace(/(\\[)(.*?)(])(\\()(.*?)(\\))/gm, '\"$2\" ($5)')\n }\n\n public static analyticsNameOverride(): string | undefined {\n return undefined\n }\n\n public static analyticsStopCommand(): string | undefined {\n return undefined\n }\n\n async catch(error: Error & {skipOclifErrorHandling: boolean}): Promise<void> {\n error.skipOclifErrorHandling = true\n const {errorHandler} = await import('./error-handler.js')\n await errorHandler(error, this.config)\n return Errors.handle(error)\n }\n\n protected async init(): Promise<unknown> {\n this.exitWithTimestampWhenEnvVariablePresent()\n setCurrentCommandId(this.id ?? '')\n if (!isDevelopment()) {\n // This function runs just prior to `run`\n const {registerCleanBugsnagErrorsFromWithinPlugins} = await import('./error-handler.js')\n await registerCleanBugsnagErrorsFromWithinPlugins(this.config)\n }\n await removeDuplicatedPlugins(this.config)\n this.showNpmFlagWarning()\n const {showNotificationsIfNeeded} = await import('./notifications-system.js')\n await showNotificationsIfNeeded()\n return super.init()\n }\n\n // NPM creates an environment variable for every flag passed to a script.\n // This function checks for the presence of any of the available CLI flags\n // and warns the user to use the `--` separator.\n protected showNpmFlagWarning(): void {\n const commandVariables = this.constructor as unknown as {flags: JsonMap}\n const commandFlags = Object.keys(commandVariables.flags || {})\n const possibleNpmEnvVars = commandFlags.map((key) => `npm_config_${underscore(key).replace(/^no_/, '')}`)\n\n if (possibleNpmEnvVars.some((flag) => process.env[flag] !== undefined)) {\n // eslint-disable-next-line no-void\n void import('./ui.js').then(({renderWarning}) => {\n renderWarning({\n body: [\n 'NPM scripts require an extra',\n {command: '--'},\n 'separator to pass the flags. Example:',\n {command: 'npm run dev -- --reset'},\n ],\n })\n })\n }\n }\n\n protected exitWithTimestampWhenEnvVariablePresent() {\n if (isTruthy(process.env.SHOPIFY_CLI_ENV_STARTUP_PERFORMANCE_RUN)) {\n outputResult(`\n SHOPIFY_CLI_TIMESTAMP_START\n { \"timestamp\": ${Date.now()} }\n SHOPIFY_CLI_TIMESTAMP_END\n `)\n process.exit(0)\n }\n }\n\n protected async parse<\n TFlags extends FlagOutput & {path?: string; verbose?: boolean; 'auth-alias'?: string},\n TGlobalFlags extends FlagOutput,\n TArgs extends ArgOutput,\n >(\n options?: Input<TFlags, TGlobalFlags, TArgs>,\n argv?: string[],\n ): Promise<ParserOutput<TFlags, TGlobalFlags, TArgs> & {argv: string[]}> {\n let result = await super.parse<TFlags, TGlobalFlags, TArgs>(options, argv)\n result = await this.resultWithEnvironment<TFlags, TGlobalFlags, TArgs>(result, options, argv)\n await setCurrentSessionAlias(result.flags['auth-alias'])\n await addFromParsedFlags(result.flags)\n this.failMissingNonTTYFlagRequirements(result.flags, this.applicableNonTTYFlagRequirements(result.flags))\n return {...result, ...{argv: result.argv as string[]}}\n }\n\n protected environmentsFilename(): string | undefined {\n // To be re-implemented if needed\n return undefined\n }\n\n protected failMissingNonTTYFlags(flags: FlagOutput, requiredFlags: string[]): void {\n this.failMissingNonTTYFlagRequirements(\n flags,\n requiredFlags.map((flag) => ({flags: [flag]})),\n )\n }\n\n private failMissingNonTTYFlagRequirements(flags: FlagOutput, requirements: NonTTYFlagRequirement[]): void {\n if (terminalSupportsPrompting()) return\n\n const missingRequirements = requirements.filter((requirement) =>\n requirement.flags.every((flag) => flags[flag] === undefined || flags[flag] === false),\n )\n if (missingRequirements.length === 0) return\n\n const heading = missingRequirements.length === 1 ? 'Flag not specified' : 'Flags not specified'\n const formattedRequirements = missingRequirements\n .map((requirement) => requirement.flags.map((flag) => `--${flag}`).join(' or '))\n .join('\\n')\n const explanation = missingRequirements.length === 1 ? 'This flag is required' : 'These flags are required'\n\n throw new AbortError(\n outputContent`${heading}:\n\n${outputToken.cyan(formattedRequirements)}\n\n${explanation} in non-interactive terminal environments, such as a CI environment, or when piping input from another process.`,\n 'To resolve this, specify the options in the command, or run the command in an interactive environment such as your local terminal.',\n )\n }\n\n private applicableNonTTYFlagRequirements(flags: FlagOutput): NonTTYFlagRequirement[] {\n const command = this.constructor as unknown as {\n flags?: FlagInput\n baseFlags?: FlagInput\n nonTTYFlagRequirements?: (flags: FlagOutput) => NonTTYFlagRequirement[]\n }\n const allFlags = {...command.baseFlags, ...command.flags}\n const requirementsFromFlags = Object.entries(allFlags)\n .filter(([, flag]) => Boolean((flag as {requiredIfNonInteractive?: boolean}).requiredIfNonInteractive))\n .map(([name]) => ({flags: [name]}))\n const commandRequirements = (command.nonTTYFlagRequirements?.(flags) ?? []).filter(\n (requirement) => requirement.when?.(flags) ?? true,\n )\n\n return [...requirementsFromFlags, ...commandRequirements]\n }\n\n private async resultWithEnvironment<\n TFlags extends FlagOutput & {path?: string; verbose?: boolean},\n TGlobalFlags extends FlagOutput,\n TArgs extends ArgOutput,\n >(\n originalResult: ParserOutput<TFlags, TGlobalFlags, TArgs>,\n options?: Input<TFlags, TGlobalFlags, TArgs>,\n argv?: string[],\n ): Promise<ParserOutput<TFlags, TGlobalFlags, TArgs>> {\n const flags = originalResult.flags as EnvironmentFlags\n const environmentsFileName = this.environmentsFilename()\n\n if (!environmentsFileName) return originalResult\n\n const {environmentFilePath} = await import('./environments.js')\n const environmentFileExists = await environmentFilePath(environmentsFileName, {from: flags.path})\n\n // Handle both string and array cases for environment flag\n let environments: string[] = []\n if (flags.environment) {\n environments = Array.isArray(flags.environment) ? flags.environment : [flags.environment]\n }\n\n const environmentSpecified = environments.length > 0\n\n // Noop if no environment file exists and none was specified\n if (!environmentFileExists && !environmentSpecified) return originalResult\n\n // Noop if multiple environments were specified (let commands handle this)\n if (environmentSpecified && environments.length > 1) return originalResult\n\n const {environment, isDefaultEnvironment} = await this.loadEnvironmentForCommand(\n flags.path,\n environmentsFileName,\n environments[0],\n )\n\n if (!environment) return originalResult\n if (isDefaultEnvironment && !commandSupportsFlag(options?.flags, 'environment')) return originalResult\n\n // Parse using noDefaultsOptions to derive a list of flags specified as\n // command-line arguments.\n const noDefaultsResult = await super.parse<TFlags, TGlobalFlags, TArgs>(noDefaultsOptions(options), argv)\n\n // Add the environment's settings to argv and pass them to `super.parse`. This\n // invokes oclif's validation system without breaking the oclif black box.\n // Replace the original result with this one.\n const result = await super.parse<TFlags, TGlobalFlags, TArgs>(options, [\n // Need to specify argv default because we're merging with argsFromEnvironment.\n ...(argv ?? this.argv),\n ...argsFromEnvironment<TFlags, TGlobalFlags, TArgs>(environment, options, noDefaultsResult),\n ...(isDefaultEnvironment ? ['--environment', 'default'] : []),\n ])\n\n // Report successful application of the environment.\n reportEnvironmentApplication<TFlags, TGlobalFlags, TArgs>(\n noDefaultsResult.flags,\n result.flags,\n isDefaultEnvironment ? 'default' : (environments[0] as string),\n environment,\n )\n\n return result\n }\n\n /**\n * Tries to load an environment to forward to the command. If no environment\n * is specified it will try to load a default environment.\n */\n private async loadEnvironmentForCommand(\n path: string | undefined,\n environmentsFileName: string,\n specifiedEnvironment: string | undefined,\n ): Promise<{environment: JsonMap | undefined; isDefaultEnvironment: boolean}> {\n const {loadEnvironment} = await import('./environments.js')\n if (specifiedEnvironment) {\n const environment = await loadEnvironment(specifiedEnvironment, environmentsFileName, {from: path})\n return {environment, isDefaultEnvironment: false}\n }\n\n const environment = await loadEnvironment('default', environmentsFileName, {from: path, silent: true})\n return {environment, isDefaultEnvironment: true}\n }\n}\n\nexport async function addFromParsedFlags(flags: {path?: string; verbose?: boolean}): Promise<void> {\n await addPublicMetadata(() => ({\n cmd_all_verbose: flags.verbose,\n cmd_all_path_override: flags.path !== undefined,\n cmd_all_path_override_hash: flags.path === undefined ? undefined : hashString(flags.path),\n }))\n}\n\n/**\n * Any flag which is:\n *\n * 1. Present in the final set of flags\n * 2. Specified in the environment\n * 3. Not specified by the user as a command line argument\n *\n * should be reported.\n *\n * It doesn't matter if the environment flag's value was the same as the default; from\n * the user's perspective, they want to know their environment was applied.\n */\nfunction reportEnvironmentApplication<\n TFlags extends FlagOutput,\n TGlobalFlags extends FlagOutput,\n TArgs extends ArgOutput,\n>(\n noDefaultsFlags: ParserOutput<TFlags, TGlobalFlags, TArgs>['flags'],\n flagsWithEnvironments: ParserOutput<TFlags, TGlobalFlags, TArgs>['flags'],\n environmentName: string,\n environment: JsonMap,\n): void {\n const changes: JsonMap = {}\n for (const [name, value] of Object.entries(flagsWithEnvironments)) {\n const userSpecifiedThisFlag = Object.prototype.hasOwnProperty.call(noDefaultsFlags, name)\n const environmentContainsFlag = Object.prototype.hasOwnProperty.call(environment, name)\n if (!userSpecifiedThisFlag && environmentContainsFlag) {\n const valueToReport = name === 'password' ? `********${value.substr(-4)}` : value\n changes[name] = valueToReport\n }\n }\n if (Object.keys(changes).length === 0) return\n\n const items = Object.entries(changes).map(([name, value]) => `${name}: ${value}`)\n // eslint-disable-next-line no-void\n void import('./ui.js').then(({renderInfo}) => {\n renderInfo({\n headline: ['Using applicable flags from', {userInput: environmentName}, 'environment:'],\n body: [{list: {items}}],\n })\n })\n}\n\n/**\n * Strips the defaults from configured flags. For example, if flags contains:\n *\n * ```\n * someFlag: Flags.boolean({\n * description: 'some flag',\n * default: false\n * })\n * ```\n *\n * it becomes:\n *\n * ```\n * someFlag: Flags.boolean({\n * description: 'some flag'\n * })\n * ```\n *\n * If we parse using this configuration, the only specified flags will be those\n * the user actually passed on the command line.\n */\nexport function noDefaultsOptions<TFlags extends FlagOutput, TGlobalFlags extends FlagOutput, TArgs extends ArgOutput>(\n options: Input<TFlags, TGlobalFlags, TArgs> | undefined,\n): Input<TFlags, TGlobalFlags, TArgs> | undefined {\n if (!options?.flags) return options\n return {\n ...options,\n flags: Object.fromEntries(\n Object.entries(options.flags).map(([label, settings]) => {\n const copiedSettings = {...(settings as {default?: unknown})}\n delete copiedSettings.default\n return [label, copiedSettings]\n }),\n ) as FlagInput<TFlags>,\n }\n}\n\n/**\n * Converts the environment's settings to arguments as though passed on the command\n * line, skipping any arguments the user specified on the command line.\n */\nfunction argsFromEnvironment<TFlags extends FlagOutput, TGlobalFlags extends FlagOutput, TArgs extends ArgOutput>(\n environment: JsonMap,\n options: Input<TFlags, TGlobalFlags, TArgs> | undefined,\n noDefaultsResult: ParserOutput<TFlags, TArgs>,\n): string[] {\n const args: string[] = []\n for (const [label, value] of Object.entries(environment)) {\n const flagIsRelevantToCommand = commandSupportsFlag(options?.flags, label)\n const userSpecifiedThisFlag =\n noDefaultsResult.flags && Object.prototype.hasOwnProperty.call(noDefaultsResult.flags, label)\n if (flagIsRelevantToCommand && !userSpecifiedThisFlag) {\n if (typeof value === 'boolean') {\n if (value) {\n args.push(`--${label}`)\n } else {\n throw new AbortError(\n outputContent`Environments can only specify true for boolean flags. Attempted to set ${outputToken.yellow(\n label,\n )} to false.`,\n )\n }\n } else if (Array.isArray(value)) {\n value.forEach((element) => args.push(`--${label}`, `${element}`))\n } else {\n args.push(`--${label}`, `${value}`)\n }\n }\n }\n return args\n}\n\nfunction commandSupportsFlag(flags: FlagInput | undefined, flagName: string): boolean {\n return Boolean(flags) && Object.prototype.hasOwnProperty.call(flags, flagName)\n}\n\nasync function removeDuplicatedPlugins(config: Config): Promise<void> {\n const plugins = Array.from(config.plugins.values())\n const bundlePlugins = ['@shopify/app', '@shopify/plugin-cloudflare']\n const pluginsToRemove = plugins.filter((plugin) => bundlePlugins.includes(plugin.name))\n if (pluginsToRemove.length > 0) {\n const commandsToRun = pluginsToRemove.map((plugin) => ` - shopify plugins remove ${plugin.name}`).join('\\n')\n const {renderWarning} = await import('./ui.js')\n renderWarning({\n headline: `Unsupported plugins detected: ${pluginsToRemove.map((plugin) => plugin.name).join(', ')}`,\n body: [\n 'They are already included in the CLI and installing them as custom plugins can cause conflicts.',\n `You can fix it by running:\\n${commandsToRun}`,\n ],\n })\n }\n const filteredPlugins = plugins.filter((plugin) => !bundlePlugins.includes(plugin.name))\n // eslint-disable-next-line require-atomic-updates -- config.plugins won't be modified by renderWarning above\n config.plugins = new Map(filteredPlugins.map((plugin) => [plugin.name, plugin]))\n}\n\nexport default BaseCommand\n"]}
|
|
@@ -55,6 +55,19 @@ export declare const portFlag: (options?: {
|
|
|
55
55
|
env?: string;
|
|
56
56
|
hidden?: boolean;
|
|
57
57
|
}) => import("@oclif/core/interfaces").OptionFlag<number | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
58
|
+
/**
|
|
59
|
+
* Marks a flag as required when the CLI cannot prompt for a value.
|
|
60
|
+
*
|
|
61
|
+
* The flag remains optional in interactive terminals. In non-interactive environments,
|
|
62
|
+
* `BaseCommand` validates the flag automatically and the requirement is shown in `--help`.
|
|
63
|
+
* Use `BaseCommand.nonTTYFlagRequirements` for conditional or alternative requirements.
|
|
64
|
+
*
|
|
65
|
+
* @param flag - An oclif flag definition.
|
|
66
|
+
* @returns A new flag definition annotated for non-interactive validation and help output.
|
|
67
|
+
*/
|
|
68
|
+
export declare function requiredIfNonInteractive<TFlag extends {
|
|
69
|
+
description?: string;
|
|
70
|
+
}>(flag: TFlag): TFlag;
|
|
58
71
|
/**
|
|
59
72
|
* Clear the CLI cache, used to store some API responses and handle notifications status
|
|
60
73
|
*/
|
package/dist/public/node/cli.js
CHANGED
|
@@ -5,7 +5,7 @@ import { Flags } from '@oclif/core';
|
|
|
5
5
|
async function exitIfOldNodeVersion(versions = process.versions) {
|
|
6
6
|
const nodeVersion = versions.node;
|
|
7
7
|
const nodeMajorVersion = Number(nodeVersion.split('.')[0]);
|
|
8
|
-
const currentSupportedNodeVersion =
|
|
8
|
+
const currentSupportedNodeVersion = 22;
|
|
9
9
|
if (nodeMajorVersion < currentSupportedNodeVersion) {
|
|
10
10
|
const { renderError } = await import('./ui.js');
|
|
11
11
|
renderError({
|
|
@@ -94,7 +94,7 @@ export const globalFlags = {
|
|
|
94
94
|
}),
|
|
95
95
|
verbose: Flags.boolean({
|
|
96
96
|
hidden: false,
|
|
97
|
-
description: 'Increase the verbosity of the output.',
|
|
97
|
+
description: 'Increase the verbosity of the output. May include sensitive data.',
|
|
98
98
|
env: 'SHOPIFY_FLAG_VERBOSE',
|
|
99
99
|
}),
|
|
100
100
|
};
|
|
@@ -125,6 +125,22 @@ export const portFlag = (options = {}) => {
|
|
|
125
125
|
const description = [options.description, 'Must be between 1 and 65535.'].filter(Boolean).join(' ');
|
|
126
126
|
return Flags.integer({ min: 1, max: 65535, ...options, description });
|
|
127
127
|
};
|
|
128
|
+
/**
|
|
129
|
+
* Marks a flag as required when the CLI cannot prompt for a value.
|
|
130
|
+
*
|
|
131
|
+
* The flag remains optional in interactive terminals. In non-interactive environments,
|
|
132
|
+
* `BaseCommand` validates the flag automatically and the requirement is shown in `--help`.
|
|
133
|
+
* Use `BaseCommand.nonTTYFlagRequirements` for conditional or alternative requirements.
|
|
134
|
+
*
|
|
135
|
+
* @param flag - An oclif flag definition.
|
|
136
|
+
* @returns A new flag definition annotated for non-interactive validation and help output.
|
|
137
|
+
*/
|
|
138
|
+
export function requiredIfNonInteractive(flag) {
|
|
139
|
+
const existingDescription = flag.description?.trimEnd();
|
|
140
|
+
const punctuatedDescription = existingDescription && !existingDescription.endsWith('.') ? `${existingDescription}.` : existingDescription;
|
|
141
|
+
const description = [punctuatedDescription, 'Required if non interactive.'].filter(Boolean).join(' ');
|
|
142
|
+
return { ...flag, description, requiredIfNonInteractive: true };
|
|
143
|
+
}
|
|
128
144
|
/**
|
|
129
145
|
* Clear the CLI cache, used to store some API responses and handle notifications status
|
|
130
146
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/public/node/cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAA;AAC/C,OAAO,EAAC,SAAS,IAAI,gBAAgB,EAAC,MAAM,mBAAmB,CAAA;AAC/D,OAAO,EAAC,oBAAoB,EAAC,MAAM,iCAAiC,CAAA;AACpE,OAAO,EAAC,KAAK,EAAC,MAAM,aAAa,CAAA;AAgBjC,KAAK,UAAU,oBAAoB,CAAC,WAAmC,OAAO,CAAC,QAAQ;IACrF,MAAM,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAA;IACjC,MAAM,gBAAgB,GAAG,MAAM,CAAC,WAAW,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAE1D,MAAM,2BAA2B,GAAG,EAAE,CAAA;IACtC,IAAI,gBAAgB,GAAG,2BAA2B,EAAE,CAAC;QACnD,MAAM,EAAC,WAAW,EAAC,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,CAAA;QAC7C,WAAW,CAAC;YACV,QAAQ,EAAE,0CAA0C;YACpD,IAAI,EAAE;gBACJ,QAAQ,gBAAgB,0EAA0E;gBAClG;oBACE,IAAI,EAAE;wBACJ,GAAG,EAAE,+CAA+C;wBACpD,KAAK,EAAE,mBAAmB;qBAC3B;iBACF;gBACD,EAAC,IAAI,EAAE,GAAG,EAAC;gBACX,yDAAyD;aAC1D;SACF,CAAC,CAAA;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACjB,CAAC;AACH,CAAC;AAED,SAAS,yBAAyB,CAChC,OAA2C,EAC3C,OAAiB,OAAO,CAA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C,CAAC,CAAA;AACrE,CAAC,CAAA;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,EAAC,UAAU,EAAC,GAAG,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAAA;IACrE,UAAU,EAAE,CAAA;AACd,CAAC","sourcesContent":["import {isTruthy} from './context/utilities.js'\nimport {launchCLI as defaultLaunchCli} from './cli-launcher.js'\nimport {environmentVariables} from '../../private/node/constants.js'\nimport {Flags} from '@oclif/core'\nimport type {LazyCommandLoader} from './custom-oclif-loader.js'\n\n/**\n * IMPORTANT NOTE: Imports in this module are dynamic to ensure that \"setupEnvironmentVariables\" can dynamically\n * set the DEBUG environment variable before the 'debug' package sets up its configuration when modules\n * are loaded statically.\n */\ninterface RunCLIOptions {\n /** The value of import.meta.url of the CLI executable module */\n moduleURL: string\n development: boolean\n /** Optional lazy command loader for on-demand command loading */\n lazyCommandLoader?: LazyCommandLoader\n}\n\nasync function exitIfOldNodeVersion(versions: NodeJS.ProcessVersions = process.versions) {\n const nodeVersion = versions.node\n const nodeMajorVersion = Number(nodeVersion.split('.')[0])\n\n const currentSupportedNodeVersion = 18\n if (nodeMajorVersion < currentSupportedNodeVersion) {\n const {renderError} = await import('./ui.js')\n renderError({\n headline: 'Upgrade to a supported Node version now.',\n body: [\n `Node ${nodeMajorVersion} has reached end-of-life and poses security risks. When you upgrade to a`,\n {\n link: {\n url: 'https://nodejs.dev/en/about/previous-releases',\n label: 'supported version',\n },\n },\n {char: ','},\n \"you'll be able to use Shopify CLI without interruption.\",\n ],\n })\n process.exit(1)\n }\n}\n\nfunction setupEnvironmentVariables(\n options: Pick<RunCLIOptions, 'development'>,\n argv: string[] = process.argv,\n env: NodeJS.ProcessEnv = process.env,\n) {\n /**\n * By setting DEBUG=* when --verbose is passed we are increasing the\n * verbosity of oclif. Oclif uses debug (https://www.npmjs.com/package/debug)\n * for logging, and it's configured through the DEBUG= environment variable.\n */\n if (argv.includes('--verbose')) {\n env.DEBUG = env.DEBUG ?? '*'\n }\n if (options.development) {\n env.SHOPIFY_CLI_ENV = env.SHOPIFY_CLI_ENV ?? 'development'\n }\n}\n\nfunction forceNoColor(argv: string[] = process.argv, env: NodeJS.ProcessEnv = process.env) {\n if (\n argv.includes('--no-color') ||\n argv.includes('--json') ||\n argv.includes('-j') ||\n isTruthy(env.NO_COLOR) ||\n isTruthy(env.SHOPIFY_FLAG_NO_COLOR) ||\n isTruthy(env[environmentVariables.json]) ||\n env.TERM === 'dumb'\n ) {\n env.FORCE_COLOR = '0'\n }\n}\n\n/**\n * A function that abstracts away setting up the environment and running\n * a CLI\n * @param options - Options.\n */\nexport async function runCLI(\n options: RunCLIOptions & {runInCreateMode?: boolean},\n launchCLI: (options: {moduleURL: string; lazyCommandLoader?: LazyCommandLoader}) => Promise<void> = defaultLaunchCli,\n argv: string[] = process.argv,\n env: NodeJS.ProcessEnv = process.env,\n versions: NodeJS.ProcessVersions = process.versions,\n): Promise<void> {\n setupEnvironmentVariables(options, argv, env)\n if (options.runInCreateMode) {\n await addInitToArgvWhenRunningCreateCLI(options, argv)\n }\n forceNoColor(argv, env)\n await exitIfOldNodeVersion(versions)\n return launchCLI({moduleURL: options.moduleURL, lazyCommandLoader: options.lazyCommandLoader})\n}\n\nasync function addInitToArgvWhenRunningCreateCLI(\n options: Pick<RunCLIOptions, 'moduleURL'>,\n argv: string[] = process.argv,\n): Promise<void> {\n const {findUpAndReadPackageJson} = await import('./node-package-manager.js')\n const {moduleDirectory} = await import('./path.js')\n\n const packageJson = await findUpAndReadPackageJson(moduleDirectory(options.moduleURL))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const packageName = (packageJson.content as any).name as string\n const name = packageName.replace('@shopify/create-', '')\n const initIndex = argv.findIndex((arg) => arg.includes('init'))\n if (initIndex === -1) {\n const initIndex = argv.findIndex((arg) => arg.match(new RegExp(`bin(\\\\/|\\\\\\\\)+(create-${name}|dev|run)`))) + 1\n argv.splice(initIndex, 0, 'init')\n }\n}\n\n/**\n * A function for create-x CLIs that automatically runs the \"init\" command.\n */\nexport async function runCreateCLI(\n options: RunCLIOptions,\n launchCLI: (options: {moduleURL: string}) => Promise<void> = defaultLaunchCli,\n argv: string[] = process.argv,\n env: NodeJS.ProcessEnv = process.env,\n versions: NodeJS.ProcessVersions = process.versions,\n): Promise<void> {\n return runCLI({...options, runInCreateMode: true}, launchCLI, argv, env, versions)\n}\n\n/**\n * An object that contains the flags that\n * are shared across all the commands.\n */\nexport const globalFlags = {\n 'no-color': Flags.boolean({\n hidden: false,\n description: 'Disable color output.',\n env: 'SHOPIFY_FLAG_NO_COLOR',\n }),\n verbose: Flags.boolean({\n hidden: false,\n description: 'Increase the verbosity of the output.',\n env: 'SHOPIFY_FLAG_VERBOSE',\n }),\n}\n\nexport const jsonFlag = {\n json: Flags.boolean({\n char: 'j',\n description: 'Output the result as JSON. Automatically disables color output.',\n hidden: false,\n default: false,\n env: environmentVariables.json,\n }),\n}\n\nexport const authAliasFlag = {\n 'auth-alias': Flags.string({\n description: 'Alias of the Shopify account to use for authentication.',\n env: 'SHOPIFY_FLAG_AUTH_ALIAS',\n }),\n}\n\n/**\n * Builds a `--port` flag that only accepts a valid port number. The flag parses its\n * value as an integer and rejects anything that isn't a whole number between 1 and\n * 65535, so commands fail with a clear message instead of crashing on an out-of-range\n * port. The accepted range is appended to the description so it shows up in `--help`.\n * @param options - Optional overrides for the flag's description, environment variable, and visibility.\n * @returns An oclif integer flag constrained to the valid port range.\n */\nexport const portFlag = (options: {description?: string; env?: string; hidden?: boolean} = {}) => {\n const description = [options.description, 'Must be between 1 and 65535.'].filter(Boolean).join(' ')\n return Flags.integer({min: 1, max: 65535, ...options, description})\n}\n\n/**\n * Clear the CLI cache, used to store some API responses and handle notifications status\n */\nexport async function clearCache(): Promise<void> {\n const {cacheClear} = await import('../../private/node/conf-store.js')\n cacheClear()\n}\n"]}
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../../../src/public/node/cli.ts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C,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,mBAAmB,GAAG,CAAC,CAAC,CAAC,mBAAmB,CAAA;IAC7G,MAAM,WAAW,GAAG,CAAC,qBAAqB,EAAE,8BAA8B,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IAErG,OAAO,EAAC,GAAG,IAAI,EAAE,WAAW,EAAE,wBAAwB,EAAE,IAAI,EAAC,CAAA;AAC/D,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU;IAC9B,MAAM,EAAC,UAAU,EAAC,GAAG,MAAM,MAAM,CAAC,kCAAkC,CAAC,CAAA;IACrE,UAAU,EAAE,CAAA;AACd,CAAC","sourcesContent":["import {isTruthy} from './context/utilities.js'\nimport {launchCLI as defaultLaunchCli} from './cli-launcher.js'\nimport {environmentVariables} from '../../private/node/constants.js'\nimport {Flags} from '@oclif/core'\nimport type {LazyCommandLoader} from './custom-oclif-loader.js'\n\n/**\n * IMPORTANT NOTE: Imports in this module are dynamic to ensure that \"setupEnvironmentVariables\" can dynamically\n * set the DEBUG environment variable before the 'debug' package sets up its configuration when modules\n * are loaded statically.\n */\ninterface RunCLIOptions {\n /** The value of import.meta.url of the CLI executable module */\n moduleURL: string\n development: boolean\n /** Optional lazy command loader for on-demand command loading */\n lazyCommandLoader?: LazyCommandLoader\n}\n\nasync function exitIfOldNodeVersion(versions: NodeJS.ProcessVersions = process.versions) {\n const nodeVersion = versions.node\n const nodeMajorVersion = Number(nodeVersion.split('.')[0])\n\n const currentSupportedNodeVersion = 22\n if (nodeMajorVersion < currentSupportedNodeVersion) {\n const {renderError} = await import('./ui.js')\n renderError({\n headline: 'Upgrade to a supported Node version now.',\n body: [\n `Node ${nodeMajorVersion} has reached end-of-life and poses security risks. When you upgrade to a`,\n {\n link: {\n url: 'https://nodejs.dev/en/about/previous-releases',\n label: 'supported version',\n },\n },\n {char: ','},\n \"you'll be able to use Shopify CLI without interruption.\",\n ],\n })\n process.exit(1)\n }\n}\n\nfunction setupEnvironmentVariables(\n options: Pick<RunCLIOptions, 'development'>,\n argv: string[] = process.argv,\n env: NodeJS.ProcessEnv = process.env,\n) {\n /**\n * By setting DEBUG=* when --verbose is passed we are increasing the\n * verbosity of oclif. Oclif uses debug (https://www.npmjs.com/package/debug)\n * for logging, and it's configured through the DEBUG= environment variable.\n */\n if (argv.includes('--verbose')) {\n env.DEBUG = env.DEBUG ?? '*'\n }\n if (options.development) {\n env.SHOPIFY_CLI_ENV = env.SHOPIFY_CLI_ENV ?? 'development'\n }\n}\n\nfunction forceNoColor(argv: string[] = process.argv, env: NodeJS.ProcessEnv = process.env) {\n if (\n argv.includes('--no-color') ||\n argv.includes('--json') ||\n argv.includes('-j') ||\n isTruthy(env.NO_COLOR) ||\n isTruthy(env.SHOPIFY_FLAG_NO_COLOR) ||\n isTruthy(env[environmentVariables.json]) ||\n env.TERM === 'dumb'\n ) {\n env.FORCE_COLOR = '0'\n }\n}\n\n/**\n * A function that abstracts away setting up the environment and running\n * a CLI\n * @param options - Options.\n */\nexport async function runCLI(\n options: RunCLIOptions & {runInCreateMode?: boolean},\n launchCLI: (options: {moduleURL: string; lazyCommandLoader?: LazyCommandLoader}) => Promise<void> = defaultLaunchCli,\n argv: string[] = process.argv,\n env: NodeJS.ProcessEnv = process.env,\n versions: NodeJS.ProcessVersions = process.versions,\n): Promise<void> {\n setupEnvironmentVariables(options, argv, env)\n if (options.runInCreateMode) {\n await addInitToArgvWhenRunningCreateCLI(options, argv)\n }\n forceNoColor(argv, env)\n await exitIfOldNodeVersion(versions)\n return launchCLI({moduleURL: options.moduleURL, lazyCommandLoader: options.lazyCommandLoader})\n}\n\nasync function addInitToArgvWhenRunningCreateCLI(\n options: Pick<RunCLIOptions, 'moduleURL'>,\n argv: string[] = process.argv,\n): Promise<void> {\n const {findUpAndReadPackageJson} = await import('./node-package-manager.js')\n const {moduleDirectory} = await import('./path.js')\n\n const packageJson = await findUpAndReadPackageJson(moduleDirectory(options.moduleURL))\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const packageName = (packageJson.content as any).name as string\n const name = packageName.replace('@shopify/create-', '')\n const initIndex = argv.findIndex((arg) => arg.includes('init'))\n if (initIndex === -1) {\n const initIndex = argv.findIndex((arg) => arg.match(new RegExp(`bin(\\\\/|\\\\\\\\)+(create-${name}|dev|run)`))) + 1\n argv.splice(initIndex, 0, 'init')\n }\n}\n\n/**\n * A function for create-x CLIs that automatically runs the \"init\" command.\n */\nexport async function runCreateCLI(\n options: RunCLIOptions,\n launchCLI: (options: {moduleURL: string}) => Promise<void> = defaultLaunchCli,\n argv: string[] = process.argv,\n env: NodeJS.ProcessEnv = process.env,\n versions: NodeJS.ProcessVersions = process.versions,\n): Promise<void> {\n return runCLI({...options, runInCreateMode: true}, launchCLI, argv, env, versions)\n}\n\n/**\n * An object that contains the flags that\n * are shared across all the commands.\n */\nexport const globalFlags = {\n 'no-color': Flags.boolean({\n hidden: false,\n description: 'Disable color output.',\n env: 'SHOPIFY_FLAG_NO_COLOR',\n }),\n verbose: Flags.boolean({\n hidden: false,\n description: 'Increase the verbosity of the output. May include sensitive data.',\n env: 'SHOPIFY_FLAG_VERBOSE',\n }),\n}\n\nexport const jsonFlag = {\n json: Flags.boolean({\n char: 'j',\n description: 'Output the result as JSON. Automatically disables color output.',\n hidden: false,\n default: false,\n env: environmentVariables.json,\n }),\n}\n\nexport const authAliasFlag = {\n 'auth-alias': Flags.string({\n description: 'Alias of the Shopify account to use for authentication.',\n env: 'SHOPIFY_FLAG_AUTH_ALIAS',\n }),\n}\n\n/**\n * Builds a `--port` flag that only accepts a valid port number. The flag parses its\n * value as an integer and rejects anything that isn't a whole number between 1 and\n * 65535, so commands fail with a clear message instead of crashing on an out-of-range\n * port. The accepted range is appended to the description so it shows up in `--help`.\n * @param options - Optional overrides for the flag's description, environment variable, and visibility.\n * @returns An oclif integer flag constrained to the valid port range.\n */\nexport const portFlag = (options: {description?: string; env?: string; hidden?: boolean} = {}) => {\n const description = [options.description, 'Must be between 1 and 65535.'].filter(Boolean).join(' ')\n return Flags.integer({min: 1, max: 65535, ...options, description})\n}\n\n/**\n * Marks a flag as required when the CLI cannot prompt for a value.\n *\n * The flag remains optional in interactive terminals. In non-interactive environments,\n * `BaseCommand` validates the flag automatically and the requirement is shown in `--help`.\n * Use `BaseCommand.nonTTYFlagRequirements` for conditional or alternative requirements.\n *\n * @param flag - An oclif flag definition.\n * @returns A new flag definition annotated for non-interactive validation and help output.\n */\nexport function requiredIfNonInteractive<TFlag extends {description?: string}>(flag: TFlag): TFlag {\n const existingDescription = flag.description?.trimEnd()\n const punctuatedDescription =\n existingDescription && !existingDescription.endsWith('.') ? `${existingDescription}.` : existingDescription\n const description = [punctuatedDescription, 'Required if non interactive.'].filter(Boolean).join(' ')\n\n return {...flag, description, requiredIfNonInteractive: true}\n}\n\n/**\n * Clear the CLI cache, used to store some API responses and handle notifications status\n */\nexport async function clearCache(): Promise<void> {\n const {cacheClear} = await import('../../private/node/conf-store.js')\n cacheClear()\n}\n"]}
|
|
@@ -141,7 +141,9 @@ export declare function ciPlatform(env?: NodeJS.ProcessEnv): {
|
|
|
141
141
|
metadata?: undefined;
|
|
142
142
|
};
|
|
143
143
|
/**
|
|
144
|
-
* Returns the first mac address found.
|
|
144
|
+
* Returns the first mac address found, preferring external interfaces. Returns a random
|
|
145
|
+
* value when no interface has a MAC, so callers hashing it as a device id don't group
|
|
146
|
+
* unrelated devices together.
|
|
145
147
|
*
|
|
146
148
|
* @returns Mac address.
|
|
147
149
|
*/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { isTruthy } from './utilities.js';
|
|
2
2
|
import { getCIMetadata, isSet } from '../../../private/node/context/utilities.js';
|
|
3
3
|
import { defaultThemeKitAccessDomain, environmentVariables, pathConstants } from '../../../private/node/constants.js';
|
|
4
|
-
import
|
|
5
|
-
import { homedir } from 'os';
|
|
4
|
+
import { randomUUID } from 'crypto';
|
|
5
|
+
import { homedir, networkInterfaces } from 'os';
|
|
6
6
|
// Dynamic imports to avoid circular dependency: context/local → fs → output → context/local
|
|
7
7
|
// fileExists and exec are only used in specific async functions, not at module init.
|
|
8
8
|
async function lazyFileExists(path) {
|
|
@@ -56,7 +56,7 @@ export function isVerbose(env = process.env) {
|
|
|
56
56
|
if (env === process.env) {
|
|
57
57
|
// Memoize the result to avoid repeated scans of process.argv and env lookups
|
|
58
58
|
// in high-frequency paths like outputDebug.
|
|
59
|
-
return (memoizedIsVerbose
|
|
59
|
+
return (memoizedIsVerbose ??= isTruthy(env[environmentVariables.verbose]) || process.argv.includes('--verbose'));
|
|
60
60
|
}
|
|
61
61
|
return isTruthy(env[environmentVariables.verbose]) || process.argv.includes('--verbose');
|
|
62
62
|
}
|
|
@@ -86,7 +86,7 @@ export function isUnitTest(env = process.env) {
|
|
|
86
86
|
if (env === process.env) {
|
|
87
87
|
// Memoize the result as SHOPIFY_UNIT_TEST is static during execution
|
|
88
88
|
// and checked frequently to suppress output.
|
|
89
|
-
return (memoizedIsUnitTest
|
|
89
|
+
return (memoizedIsUnitTest ??= isTruthy(env[environmentVariables.unitTest]));
|
|
90
90
|
}
|
|
91
91
|
return isTruthy(env[environmentVariables.unitTest]);
|
|
92
92
|
}
|
|
@@ -252,12 +252,19 @@ export function ciPlatform(env = process.env) {
|
|
|
252
252
|
};
|
|
253
253
|
}
|
|
254
254
|
/**
|
|
255
|
-
* Returns the first mac address found.
|
|
255
|
+
* Returns the first mac address found, preferring external interfaces. Returns a random
|
|
256
|
+
* value when no interface has a MAC, so callers hashing it as a device id don't group
|
|
257
|
+
* unrelated devices together.
|
|
256
258
|
*
|
|
257
259
|
* @returns Mac address.
|
|
258
260
|
*/
|
|
259
|
-
export function macAddress() {
|
|
260
|
-
|
|
261
|
+
export async function macAddress() {
|
|
262
|
+
const emptyMac = '00:00:00:00:00:00';
|
|
263
|
+
const interfacesWithMac = Object.values(networkInterfaces())
|
|
264
|
+
.flat()
|
|
265
|
+
.filter((iface) => Boolean(iface && iface.mac !== emptyMac));
|
|
266
|
+
const bestInterface = interfacesWithMac.find((iface) => !iface.internal) ?? interfacesWithMac[0];
|
|
267
|
+
return bestInterface?.mac ?? randomUUID();
|
|
261
268
|
}
|
|
262
269
|
/**
|
|
263
270
|
* Get the domain for theme kit access.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../../../src/public/node/context/local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAC,aAAa,EAAE,KAAK,EAAW,MAAM,4CAA4C,CAAA;AACzF,OAAO,EAAC,2BAA2B,EAAE,oBAAoB,EAAE,aAAa,EAAC,MAAM,oCAAoC,CAAA;AACnH,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,EAAC,OAAO,EAAC,MAAM,IAAI,CAAA;AAE1B,4FAA4F;AAC5F,qFAAqF;AACrF,KAAK,UAAU,cAAc,CAAC,IAAY;IACxC,MAAM,EAAC,UAAU,EAAC,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAA;IAC7C,OAAO,UAAU,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC;AAED,KAAK,UAAU,QAAQ,CAAC,OAAe,EAAE,IAAc;IACrD,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,MAAM,CAAC,cAAc,CAAC,CAAA;IAC3C,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AAC3B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAA;AAC/F,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,OA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,CAAC,OAAO,EAAE,GAAG,CAAC;SACtC,CAAA;IACH,CAAC;IACD,OAAO;QACL,IAAI,EAAE,KAAK;KACZ,CAAA;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU;IACxB,OAAO,UAAU,CAAC,GAAG,EAAE,CAAA;AACzB,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG;IACvD,MAAM,MAAM,GAAG,GAAG,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAA;IAE7D,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,2BAA2B,CAAA;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG;IACnD,MAAM,MAAM,GAAG,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;IAEhD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,iDAAiD,CAAA;AACnF,CAAC","sourcesContent":["import {isTruthy} from './utilities.js'\nimport {getCIMetadata, isSet, Metadata} from '../../../private/node/context/utilities.js'\nimport {defaultThemeKitAccessDomain, environmentVariables, pathConstants} from '../../../private/node/constants.js'\nimport macaddress from 'macaddress'\nimport {homedir} from 'os'\n\n// Dynamic imports to avoid circular dependency: context/local → fs → output → context/local\n// fileExists and exec are only used in specific async functions, not at module init.\nasync function lazyFileExists(path: string): Promise<boolean> {\n const {fileExists} = await import('../fs.js')\n return fileExists(path)\n}\n\nasync function lazyExec(command: string, args: string[]): Promise<void> {\n const {exec} = await import('../system.js')\n await exec(command, args)\n}\n\n/**\n * It returns true if the terminal is interactive.\n *\n * @returns True if the terminal is interactive.\n */\nexport function isTerminalInteractive(): boolean {\n return Boolean(process.stdout.isTTY && process.env.TERM !== 'dumb' && !('CI' in process.env))\n}\n\n/**\n * Returns the path to the user's home directory.\n *\n * @returns The path to the user's home directory.\n */\nexport function homeDirectory(): string {\n return homedir()\n}\n\n/**\n * Memoized value for the verbose check.\n */\nlet memoizedIsVerbose: boolean | undefined\n\n/**\n * Memoized value for the unit test check.\n */\nlet memoizedIsUnitTest: boolean | undefined\n\n/**\n * Returns true if the CLI is running in debug mode.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_ENV is development.\n */\nexport function isDevelopment(env = process.env): boolean {\n return env[environmentVariables.env] === 'development'\n}\n\n/**\n * Returns true if the CLI is running in verbose mode.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_FLAG_VERBOSE is truthy or the flag --verbose has been passed.\n */\nexport function isVerbose(env = process.env): boolean {\n if (env === process.env) {\n // Memoize the result to avoid repeated scans of process.argv and env lookups\n // in high-frequency paths like outputDebug.\n return (memoizedIsVerbose ??= isTruthy(env[environmentVariables.verbose]) || process.argv.includes('--verbose'))\n }\n return isTruthy(env[environmentVariables.verbose]) || process.argv.includes('--verbose')\n}\n\n/**\n * Returns true if the environment in which the CLI is running is either\n * a local environment (where dev is present).\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the CLI is used in a Shopify environment.\n */\nexport async function isShopify(env = process.env): Promise<boolean> {\n if (Object.prototype.hasOwnProperty.call(env, environmentVariables.runAsUser)) {\n return !isTruthy(env[environmentVariables.runAsUser])\n }\n const devInstalled = await lazyFileExists(pathConstants.executables.dev)\n return devInstalled\n}\n\n/**\n * This variable is used when running unit tests to indicate that the CLI's business logic\n * is run as a subject of a unit test. We can use this variable to disable output through\n * the standard streams.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the SHOPIFY_UNIT_TEST environment variable is truthy.\n */\nexport function isUnitTest(env = process.env): boolean {\n if (env === process.env) {\n // Memoize the result as SHOPIFY_UNIT_TEST is static during execution\n // and checked frequently to suppress output.\n return (memoizedIsUnitTest ??= isTruthy(env[environmentVariables.unitTest]))\n }\n return isTruthy(env[environmentVariables.unitTest])\n}\n\n/**\n * Returns true if reporting analytics is enabled.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True unless SHOPIFY_CLI_NO_ANALYTICS or OPT_OUT_INSTRUMENTATION is truthy, or debug mode is enabled.\n */\nexport function analyticsDisabled(env = process.env): boolean {\n return (\n isTruthy(env[environmentVariables.noAnalytics]) ||\n isTruthy(env[environmentVariables.optOutInstrumentation]) ||\n isDevelopment(env)\n )\n}\n\n/**\n * Returns true if reporting analytics should always happen, regardless of DEBUG mode etc.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_CLI_ALWAYS_LOG_ANALYTICS is truthy.\n */\nexport function alwaysLogAnalytics(env = process.env): boolean {\n return isTruthy(env[environmentVariables.alwaysLogAnalytics])\n}\n\n/**\n * Returns true if reporting metrics should always happen, regardless of DEBUG mode etc.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_CLI_ALWAYS_LOG_METRICS is truthy.\n */\nexport function alwaysLogMetrics(env = process.env): boolean {\n return isTruthy(env[environmentVariables.alwaysLogMetrics])\n}\n\n/**\n * Returns true if the CLI can run the \"doctor-release\" command.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the CLI can run the \"doctor-release\" command.\n */\nexport function canRunDoctorRelease(env = process.env): boolean {\n return isTruthy(env[environmentVariables.doctor])\n}\n\n/**\n * Return gitpodURL if we are running in gitpod.\n * Https://www.gitpod.io/docs/environment-variables#default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The gitpod URL.\n */\nexport function gitpodURL(env = process.env): string | undefined {\n return env[environmentVariables.gitpod]\n}\n\n/**\n * Return codespaceURL if we are running in codespaces.\n * Https://docs.github.com/en/codespaces/developing-in-codespaces/default-environment-variables-for-your-codespace#list-of-default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The codespace URL.\n */\nexport function codespaceURL(env = process.env): string | undefined {\n return env[environmentVariables.codespaceName]\n}\n\n/**\n * Return codespacePortForwardingDomain if we are running in codespaces.\n * Https://docs.github.com/en/codespaces/developing-in-codespaces/default-environment-variables-for-your-codespace#list-of-default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The codespace port forwarding domain.\n */\nexport function codespacePortForwardingDomain(env = process.env): string | undefined {\n return env[environmentVariables.codespacePortForwardingDomain]\n}\n\n/**\n * Checks if the CLI is run from a cloud environment.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns True in case the CLI is run from a cloud environment.\n */\nexport function isCloudEnvironment(env: NodeJS.ProcessEnv = process.env): boolean {\n return cloudEnvironment(env).platform !== 'localhost'\n}\n\n/**\n * The token used to run a theme command with a custom password.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns A string with the token.\n */\nexport function themeToken(env = process.env): string | undefined {\n return env[environmentVariables.themeToken]\n}\n\n/**\n * Returns the cloud environment platform name and if the platform support online IDE in case the CLI is run from one of\n * them. Platform name 'localhost' is returned otherwise.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns Cloud platform information.\n */\nexport function cloudEnvironment(env: NodeJS.ProcessEnv = process.env): {\n platform: 'codespaces' | 'gitpod' | 'cloudShell' | 'localhost'\n editor: boolean\n} {\n if (isSet(env[environmentVariables.codespaces])) {\n return {platform: 'codespaces', editor: true}\n }\n if (isSet(env[environmentVariables.gitpod])) {\n return {platform: 'gitpod', editor: true}\n }\n if (isSet(env[environmentVariables.cloudShell])) {\n return {platform: 'cloudShell', editor: true}\n }\n return {platform: 'localhost', editor: false}\n}\n\n/**\n * Returns whether the environment has Git available.\n *\n * @returns A promise that resolves with the value.\n */\nexport async function hasGit(): Promise<boolean> {\n try {\n await lazyExec('git', ['--version'])\n return true\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch {\n return false\n }\n}\n\n/**\n * Gets info on the CI platform the CLI is running on, if applicable.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The CI platform info.\n */\nexport function ciPlatform(\n env = process.env,\n): {isCI: true; name: string; metadata: Metadata} | {isCI: false; name?: undefined; metadata?: undefined} {\n if (isTruthy(env.CI)) {\n let name = 'unknown'\n if (isSet(env.BITBUCKET_BUILD_NUMBER)) {\n name = 'bitbucket'\n } else if (isTruthy(env.CIRCLECI)) {\n name = 'circleci'\n } else if (isSet(env.GITHUB_ACTION)) {\n name = 'github'\n } else if (isTruthy(env.GITLAB_CI)) {\n name = 'gitlab'\n } else if (isSet(env.BUILDKITE)) {\n name = 'buildkite'\n }\n\n return {\n isCI: true,\n name,\n metadata: getCIMetadata(name, env),\n }\n } else if (isTruthy(env.TF_BUILD)) {\n return {\n isCI: true,\n name: 'azure',\n metadata: getCIMetadata('azure', env),\n }\n }\n return {\n isCI: false,\n }\n}\n\n/**\n * Returns the first mac address found.\n *\n * @returns Mac address.\n */\nexport function macAddress(): Promise<string> {\n return macaddress.one()\n}\n\n/**\n * Get the domain for theme kit access.\n *\n * It can be overridden via the SHOPIFY_CLI_THEME_KIT_ACCESS_DOMAIN environment\n * variable.\n *\n * @param env - The environment variables from the environment of the process.\n *\n * @returns The domain for theme kit access.\n */\nexport function getThemeKitAccessDomain(env = process.env): string {\n const domain = env[environmentVariables.themeKitAccessDomain]\n\n return isSet(domain) ? domain : defaultThemeKitAccessDomain\n}\n\n/**\n * Get the domain to send OTEL metrics to.\n *\n * It can be overridden via the SHOPIFY_CLI_OTEL_EXPORTER_OTLP_ENDPOINT environment variable.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The domain to send OTEL metrics to.\n */\nexport function opentelemetryDomain(env = process.env): string {\n const domain = env[environmentVariables.otelURL]\n\n return isSet(domain) ? domain : 'https://otlp-http-production-cli.shopifysvc.com'\n}\n\nexport type CIMetadata = Metadata\n"]}
|
|
1
|
+
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../../../src/public/node/context/local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,QAAQ,EAAC,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAC,aAAa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C,GAAG,KAAK,QAAQ,CAAC,CAAC,CAAA;IAClG,MAAM,aAAa,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,iBAAiB,CAAC,CAAC,CAAC,CAAA;IAChG,OAAO,aAAa,EAAE,GAAG,IAAI,UAAU,EAAE,CAAA;AAC3C,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,uBAAuB,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG;IACvD,MAAM,MAAM,GAAG,GAAG,CAAC,oBAAoB,CAAC,oBAAoB,CAAC,CAAA;IAE7D,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,2BAA2B,CAAA;AAC7D,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG;IACnD,MAAM,MAAM,GAAG,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAA;IAEhD,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,iDAAiD,CAAA;AACnF,CAAC","sourcesContent":["import {isTruthy} from './utilities.js'\nimport {getCIMetadata, isSet, Metadata} from '../../../private/node/context/utilities.js'\nimport {defaultThemeKitAccessDomain, environmentVariables, pathConstants} from '../../../private/node/constants.js'\nimport {randomUUID} from 'crypto'\nimport {homedir, networkInterfaces} from 'os'\n\n// Dynamic imports to avoid circular dependency: context/local → fs → output → context/local\n// fileExists and exec are only used in specific async functions, not at module init.\nasync function lazyFileExists(path: string): Promise<boolean> {\n const {fileExists} = await import('../fs.js')\n return fileExists(path)\n}\n\nasync function lazyExec(command: string, args: string[]): Promise<void> {\n const {exec} = await import('../system.js')\n await exec(command, args)\n}\n\n/**\n * It returns true if the terminal is interactive.\n *\n * @returns True if the terminal is interactive.\n */\nexport function isTerminalInteractive(): boolean {\n return Boolean(process.stdout.isTTY && process.env.TERM !== 'dumb' && !('CI' in process.env))\n}\n\n/**\n * Returns the path to the user's home directory.\n *\n * @returns The path to the user's home directory.\n */\nexport function homeDirectory(): string {\n return homedir()\n}\n\n/**\n * Memoized value for the verbose check.\n */\nlet memoizedIsVerbose: boolean | undefined\n\n/**\n * Memoized value for the unit test check.\n */\nlet memoizedIsUnitTest: boolean | undefined\n\n/**\n * Returns true if the CLI is running in debug mode.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_ENV is development.\n */\nexport function isDevelopment(env = process.env): boolean {\n return env[environmentVariables.env] === 'development'\n}\n\n/**\n * Returns true if the CLI is running in verbose mode.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_FLAG_VERBOSE is truthy or the flag --verbose has been passed.\n */\nexport function isVerbose(env = process.env): boolean {\n if (env === process.env) {\n // Memoize the result to avoid repeated scans of process.argv and env lookups\n // in high-frequency paths like outputDebug.\n return (memoizedIsVerbose ??= isTruthy(env[environmentVariables.verbose]) || process.argv.includes('--verbose'))\n }\n return isTruthy(env[environmentVariables.verbose]) || process.argv.includes('--verbose')\n}\n\n/**\n * Returns true if the environment in which the CLI is running is either\n * a local environment (where dev is present).\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the CLI is used in a Shopify environment.\n */\nexport async function isShopify(env = process.env): Promise<boolean> {\n if (Object.prototype.hasOwnProperty.call(env, environmentVariables.runAsUser)) {\n return !isTruthy(env[environmentVariables.runAsUser])\n }\n const devInstalled = await lazyFileExists(pathConstants.executables.dev)\n return devInstalled\n}\n\n/**\n * This variable is used when running unit tests to indicate that the CLI's business logic\n * is run as a subject of a unit test. We can use this variable to disable output through\n * the standard streams.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the SHOPIFY_UNIT_TEST environment variable is truthy.\n */\nexport function isUnitTest(env = process.env): boolean {\n if (env === process.env) {\n // Memoize the result as SHOPIFY_UNIT_TEST is static during execution\n // and checked frequently to suppress output.\n return (memoizedIsUnitTest ??= isTruthy(env[environmentVariables.unitTest]))\n }\n return isTruthy(env[environmentVariables.unitTest])\n}\n\n/**\n * Returns true if reporting analytics is enabled.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True unless SHOPIFY_CLI_NO_ANALYTICS or OPT_OUT_INSTRUMENTATION is truthy, or debug mode is enabled.\n */\nexport function analyticsDisabled(env = process.env): boolean {\n return (\n isTruthy(env[environmentVariables.noAnalytics]) ||\n isTruthy(env[environmentVariables.optOutInstrumentation]) ||\n isDevelopment(env)\n )\n}\n\n/**\n * Returns true if reporting analytics should always happen, regardless of DEBUG mode etc.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_CLI_ALWAYS_LOG_ANALYTICS is truthy.\n */\nexport function alwaysLogAnalytics(env = process.env): boolean {\n return isTruthy(env[environmentVariables.alwaysLogAnalytics])\n}\n\n/**\n * Returns true if reporting metrics should always happen, regardless of DEBUG mode etc.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if SHOPIFY_CLI_ALWAYS_LOG_METRICS is truthy.\n */\nexport function alwaysLogMetrics(env = process.env): boolean {\n return isTruthy(env[environmentVariables.alwaysLogMetrics])\n}\n\n/**\n * Returns true if the CLI can run the \"doctor-release\" command.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns True if the CLI can run the \"doctor-release\" command.\n */\nexport function canRunDoctorRelease(env = process.env): boolean {\n return isTruthy(env[environmentVariables.doctor])\n}\n\n/**\n * Return gitpodURL if we are running in gitpod.\n * Https://www.gitpod.io/docs/environment-variables#default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The gitpod URL.\n */\nexport function gitpodURL(env = process.env): string | undefined {\n return env[environmentVariables.gitpod]\n}\n\n/**\n * Return codespaceURL if we are running in codespaces.\n * Https://docs.github.com/en/codespaces/developing-in-codespaces/default-environment-variables-for-your-codespace#list-of-default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The codespace URL.\n */\nexport function codespaceURL(env = process.env): string | undefined {\n return env[environmentVariables.codespaceName]\n}\n\n/**\n * Return codespacePortForwardingDomain if we are running in codespaces.\n * Https://docs.github.com/en/codespaces/developing-in-codespaces/default-environment-variables-for-your-codespace#list-of-default-environment-variables.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The codespace port forwarding domain.\n */\nexport function codespacePortForwardingDomain(env = process.env): string | undefined {\n return env[environmentVariables.codespacePortForwardingDomain]\n}\n\n/**\n * Checks if the CLI is run from a cloud environment.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns True in case the CLI is run from a cloud environment.\n */\nexport function isCloudEnvironment(env: NodeJS.ProcessEnv = process.env): boolean {\n return cloudEnvironment(env).platform !== 'localhost'\n}\n\n/**\n * The token used to run a theme command with a custom password.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns A string with the token.\n */\nexport function themeToken(env = process.env): string | undefined {\n return env[environmentVariables.themeToken]\n}\n\n/**\n * Returns the cloud environment platform name and if the platform support online IDE in case the CLI is run from one of\n * them. Platform name 'localhost' is returned otherwise.\n *\n * @param env - Environment variables used when the cli is launched.\n * @returns Cloud platform information.\n */\nexport function cloudEnvironment(env: NodeJS.ProcessEnv = process.env): {\n platform: 'codespaces' | 'gitpod' | 'cloudShell' | 'localhost'\n editor: boolean\n} {\n if (isSet(env[environmentVariables.codespaces])) {\n return {platform: 'codespaces', editor: true}\n }\n if (isSet(env[environmentVariables.gitpod])) {\n return {platform: 'gitpod', editor: true}\n }\n if (isSet(env[environmentVariables.cloudShell])) {\n return {platform: 'cloudShell', editor: true}\n }\n return {platform: 'localhost', editor: false}\n}\n\n/**\n * Returns whether the environment has Git available.\n *\n * @returns A promise that resolves with the value.\n */\nexport async function hasGit(): Promise<boolean> {\n try {\n await lazyExec('git', ['--version'])\n return true\n // eslint-disable-next-line no-catch-all/no-catch-all\n } catch {\n return false\n }\n}\n\n/**\n * Gets info on the CI platform the CLI is running on, if applicable.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The CI platform info.\n */\nexport function ciPlatform(\n env = process.env,\n): {isCI: true; name: string; metadata: Metadata} | {isCI: false; name?: undefined; metadata?: undefined} {\n if (isTruthy(env.CI)) {\n let name = 'unknown'\n if (isSet(env.BITBUCKET_BUILD_NUMBER)) {\n name = 'bitbucket'\n } else if (isTruthy(env.CIRCLECI)) {\n name = 'circleci'\n } else if (isSet(env.GITHUB_ACTION)) {\n name = 'github'\n } else if (isTruthy(env.GITLAB_CI)) {\n name = 'gitlab'\n } else if (isSet(env.BUILDKITE)) {\n name = 'buildkite'\n }\n\n return {\n isCI: true,\n name,\n metadata: getCIMetadata(name, env),\n }\n } else if (isTruthy(env.TF_BUILD)) {\n return {\n isCI: true,\n name: 'azure',\n metadata: getCIMetadata('azure', env),\n }\n }\n return {\n isCI: false,\n }\n}\n\n/**\n * Returns the first mac address found, preferring external interfaces. Returns a random\n * value when no interface has a MAC, so callers hashing it as a device id don't group\n * unrelated devices together.\n *\n * @returns Mac address.\n */\nexport async function macAddress(): Promise<string> {\n const emptyMac = '00:00:00:00:00:00'\n const interfacesWithMac = Object.values(networkInterfaces())\n .flat()\n .filter((iface): iface is NonNullable<typeof iface> => Boolean(iface && iface.mac !== emptyMac))\n const bestInterface = interfacesWithMac.find((iface) => !iface.internal) ?? interfacesWithMac[0]\n return bestInterface?.mac ?? randomUUID()\n}\n\n/**\n * Get the domain for theme kit access.\n *\n * It can be overridden via the SHOPIFY_CLI_THEME_KIT_ACCESS_DOMAIN environment\n * variable.\n *\n * @param env - The environment variables from the environment of the process.\n *\n * @returns The domain for theme kit access.\n */\nexport function getThemeKitAccessDomain(env = process.env): string {\n const domain = env[environmentVariables.themeKitAccessDomain]\n\n return isSet(domain) ? domain : defaultThemeKitAccessDomain\n}\n\n/**\n * Get the domain to send OTEL metrics to.\n *\n * It can be overridden via the SHOPIFY_CLI_OTEL_EXPORTER_OTLP_ENDPOINT environment variable.\n *\n * @param env - The environment variables from the environment of the current process.\n * @returns The domain to send OTEL metrics to.\n */\nexport function opentelemetryDomain(env = process.env): string {\n const domain = env[environmentVariables.otelURL]\n\n return isSet(domain) ? domain : 'https://otlp-http-production-cli.shopifysvc.com'\n}\n\nexport type CIMetadata = Metadata\n"]}
|
|
@@ -3,6 +3,7 @@ import { Config } from '@oclif/core';
|
|
|
3
3
|
* Subclass of oclif's Config that loads command classes on demand for faster CLI startup.
|
|
4
4
|
*/
|
|
5
5
|
export class ShopifyConfig extends Config {
|
|
6
|
+
lazyCommandLoader;
|
|
6
7
|
/**
|
|
7
8
|
* Set a lazy command loader that will be used to load individual command classes on demand,
|
|
8
9
|
* bypassing the default oclif behavior of importing the entire COMMANDS module.
|
|
@@ -23,23 +24,25 @@ export class ShopifyConfig extends Config {
|
|
|
23
24
|
* @returns The command result.
|
|
24
25
|
*/
|
|
25
26
|
async runCommand(id, argv = [], cachedCommand = null) {
|
|
26
|
-
if (this.lazyCommandLoader) {
|
|
27
|
-
|
|
28
|
-
if (cmd) {
|
|
29
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
-
const commandClass = (await this.lazyCommandLoader(id));
|
|
31
|
-
if (commandClass) {
|
|
32
|
-
commandClass.id = id;
|
|
33
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
-
commandClass.plugin = cmd.plugin ?? this.rootPlugin;
|
|
35
|
-
await this.runHook('prerun', { argv, Command: commandClass });
|
|
36
|
-
const result = (await commandClass.run(argv, this));
|
|
37
|
-
await this.runHook('postrun', { argv, Command: commandClass, result });
|
|
38
|
-
return result;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
27
|
+
if (!this.lazyCommandLoader) {
|
|
28
|
+
return super.runCommand(id, argv, cachedCommand);
|
|
41
29
|
}
|
|
42
|
-
|
|
30
|
+
const cmd = cachedCommand ?? this.findCommand(id);
|
|
31
|
+
if (!cmd) {
|
|
32
|
+
return super.runCommand(id, argv, cachedCommand);
|
|
33
|
+
}
|
|
34
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
|
+
const commandClass = (await this.lazyCommandLoader(id));
|
|
36
|
+
if (!commandClass) {
|
|
37
|
+
return super.runCommand(id, argv, cachedCommand);
|
|
38
|
+
}
|
|
39
|
+
commandClass.id = id;
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
commandClass.plugin = cmd.plugin ?? this.rootPlugin;
|
|
42
|
+
await this.runHook('prerun', { argv, Command: commandClass });
|
|
43
|
+
const result = (await commandClass.run(argv, this));
|
|
44
|
+
await this.runHook('postrun', { argv, Command: commandClass, result });
|
|
45
|
+
return result;
|
|
43
46
|
}
|
|
44
47
|
}
|
|
45
48
|
//# sourceMappingURL=custom-oclif-loader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"custom-oclif-loader.js","sourceRoot":"","sources":["../../../src/public/node/custom-oclif-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAC,MAAM,aAAa,CAAA;AAS3C;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,MAAM;
|
|
1
|
+
{"version":3,"file":"custom-oclif-loader.js","sourceRoot":"","sources":["../../../src/public/node/custom-oclif-loader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,MAAM,EAAC,MAAM,aAAa,CAAA;AAS3C;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,MAAM;IAC/B,iBAAiB,CAAoB;IAE7C;;;;;OAKG;IACH,oBAAoB,CAAC,MAAyB;QAC5C,IAAI,CAAC,iBAAiB,GAAG,MAAM,CAAA;IACjC,CAAC;IAED;;;;;;;;;OASG;IACH,KAAK,CAAC,UAAU,CACd,EAAU,EACV,OAAiB,EAAE,EACnB,gBAAyC,IAAI;QAE7C,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC5B,OAAO,KAAK,CAAC,UAAU,CAAI,EAAE,EAAE,IAAI,EAAE,aAAa,CAAC,CAAA;QACrD,CAAC;QAED,MAAM,GAAG,GAAG,aAAa,IAAI,IAAI,CAAC,WAAW,CAAC,EAAE,CAAC,CAAA;QACjD,IAAI,CAAC,GAAG,EAAE,CAAC;YACT,OAAO,KAAK,CAAC,UAAU,CAAI,EAAE,EAAE,IAAI,EAAE,aAAa,CAAC,CAAA;QACrD,CAAC;QAED,8DAA8D;QAC9D,MAAM,YAAY,GAAG,CAAC,MAAM,IAAI,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAQ,CAAA;QAC9D,IAAI,CAAC,YAAY,EAAE,CAAC;YAClB,OAAO,KAAK,CAAC,UAAU,CAAI,EAAE,EAAE,IAAI,EAAE,aAAa,CAAC,CAAA;QACrD,CAAC;QAED,YAAY,CAAC,EAAE,GAAG,EAAE,CAAA;QACpB,8DAA8D;QAC9D,YAAY,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,IAAK,IAAY,CAAC,UAAU,CAAA;QAC5D,MAAM,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAC,CAAC,CAAA;QAC3D,MAAM,MAAM,GAAG,CAAC,MAAM,YAAY,CAAC,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAM,CAAA;QACxD,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,EAAC,CAAC,CAAA;QACpE,OAAO,MAAM,CAAA;IACf,CAAC;CACF","sourcesContent":["import {Command, Config} from '@oclif/core'\n\n/**\n * Optional lazy command loader function.\n * If set, ShopifyConfig will use it to load individual commands on demand\n * instead of importing the entire COMMANDS module (which triggers loading all packages).\n */\nexport type LazyCommandLoader = (id: string) => Promise<typeof Command | undefined>\n\n/**\n * Subclass of oclif's Config that loads command classes on demand for faster CLI startup.\n */\nexport class ShopifyConfig extends Config {\n private lazyCommandLoader?: LazyCommandLoader\n\n /**\n * Set a lazy command loader that will be used to load individual command classes on demand,\n * bypassing the default oclif behavior of importing the entire COMMANDS module.\n *\n * @param loader - The lazy command loader function.\n */\n setLazyCommandLoader(loader: LazyCommandLoader): void {\n this.lazyCommandLoader = loader\n }\n\n /**\n * Override runCommand to use lazy loading when available.\n * Instead of calling cmd.load() which triggers loading ALL commands via index.js,\n * we directly import only the needed command module.\n *\n * @param id - The command ID to run.\n * @param argv - The arguments to pass to the command.\n * @param cachedCommand - An optional cached command loadable.\n * @returns The command result.\n */\n async runCommand<T = unknown>(\n id: string,\n argv: string[] = [],\n cachedCommand: Command.Loadable | null = null,\n ): Promise<T> {\n if (!this.lazyCommandLoader) {\n return super.runCommand<T>(id, argv, cachedCommand)\n }\n\n const cmd = cachedCommand ?? this.findCommand(id)\n if (!cmd) {\n return super.runCommand<T>(id, argv, cachedCommand)\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const commandClass = (await this.lazyCommandLoader(id)) as any\n if (!commandClass) {\n return super.runCommand<T>(id, argv, cachedCommand)\n }\n\n commandClass.id = id\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n commandClass.plugin = cmd.plugin ?? (this as any).rootPlugin\n await this.runHook('prerun', {argv, Command: commandClass})\n const result = (await commandClass.run(argv, this)) as T\n await this.runHook('postrun', {argv, Command: commandClass, result})\n return result\n }\n}\n"]}
|
|
@@ -25,10 +25,10 @@ import { execCommand, captureCommandWithExitCode } from '../system.js';
|
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
27
27
|
export class DoctorSuite {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
static description = 'Doctor test suite';
|
|
29
|
+
context;
|
|
30
|
+
assertions = [];
|
|
31
|
+
registeredTests = [];
|
|
32
32
|
/**
|
|
33
33
|
* Run the entire test suite.
|
|
34
34
|
*
|
|
@@ -358,5 +358,4 @@ export class DoctorSuite {
|
|
|
358
358
|
return this.assertions.some((assertion) => !assertion.passed);
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
DoctorSuite.description = 'Doctor test suite';
|
|
362
361
|
//# sourceMappingURL=framework.js.map
|