@shopify/create-hydrogen 0.23.0 → 0.24.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/CHANGELOG.md
CHANGED
package/dist/commands/init.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import require$$0$c, { promises, constants as constants$2 } from 'fs';
|
|
2
2
|
import require$$0$3, { dirname as dirname$3, resolve as resolve$1, relative, join, basename, parse as parse$7 } from 'path';
|
|
3
|
-
import { e as enquirer, c as commonjsGlobal$1, a as commonjsRequire, b as ansiStyles$2, s as supportsColor_1$1, g as gracefulFs$1, o as out, d as ansiEscapes$1, t as through$1, f as cliCursor$3, h as stripAnsi$2, i as stringWidth$1, S as Storage } from '../store-
|
|
3
|
+
import { e as enquirer, c as commonjsGlobal$1, a as commonjsRequire, b as ansiStyles$2, s as supportsColor_1$1, g as gracefulFs$1, o as out, d as ansiEscapes$1, t as through$1, f as cliCursor$3, h as stripAnsi$2, i as stringWidth$1, S as Storage } from '../store-07cc6f36.js';
|
|
4
4
|
import require$$0$4 from 'events';
|
|
5
5
|
import require$$0$5 from 'stream';
|
|
6
6
|
import require$$7$1 from 'string_decoder';
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { settings, run, flush, Errors } from '@oclif/core';
|
|
2
|
-
import './store-
|
|
2
|
+
import './store-07cc6f36.js';
|
|
3
3
|
import 'node:buffer';
|
|
4
4
|
import 'node:path';
|
|
5
5
|
import 'node:child_process';
|
|
@@ -56,7 +56,7 @@ function isDebug(env = process.env) {
|
|
|
56
56
|
function runCreateHydrogen() {
|
|
57
57
|
const initIndex = process.argv.findIndex((arg) => arg.includes("init"));
|
|
58
58
|
if (initIndex === -1) {
|
|
59
|
-
const initIndex2 = process.argv.findIndex((arg) => arg.includes("bin/create-hydrogen") || arg.includes("bin/dev")) + 1;
|
|
59
|
+
const initIndex2 = process.argv.findIndex((arg) => arg.includes("bin/create-hydrogen") || arg.includes("bin/dev") || arg.includes("bin/run")) + 1;
|
|
60
60
|
process.argv.splice(initIndex2, 0, "init");
|
|
61
61
|
}
|
|
62
62
|
if (isDebug()) {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../cli-kit/src/error.ts","../../cli-kit/src/constants.ts","../../cli-kit/src/environment.ts","../src/index.ts"],"sourcesContent":["/**\n * A fatal error represents an error shouldn't be rescued and that causes the execution to terminate.\n * There shouldn't be code that catches fatal errors.\n */\nexport class Fatal extends Error {\n tryMessage: string | null;\n constructor(message: string, tryMessage: string | null = null) {\n super(message);\n this.tryMessage = tryMessage;\n }\n}\n\n/**\n * An abort error is a fatal error that shouldn't be reported as a bug.\n * Those usually represent unexpected scenarios that we can't handle and that usually require some action from the developer\n */\nexport class Abort extends Fatal {}\n\n/**\n * A bug error is an error that represents a bug and therefore should be reported.\n */\nexport class Bug extends Fatal {}\n\n/**\n * A function that handles errors that blow up in the CLI.\n * @param error Error to be handled.\n * @returns A promise that resolves with the error passed.\n */\nexport function handler(error: Error): Promise<Error> {\n return Promise.resolve(error);\n}\n","const constants = {\n environmentVariables: {\n debug: 'DEBUG',\n partnersApiEnv: 'SHOPIFY_PARTNERS_API_ENV',\n adminApiEnv: 'SHOPIFY_ADMIN_API_ENV',\n storefrontRendererApiEnv: 'SHOPIFY_STOREFRONT_RENDERER_API_ENV',\n identityEnv: 'SHOPIFY_IDENTITY_ENV',\n },\n};\n\nexport default constants;\n","import constants from './constants';\nimport {Environment} from './network/service';\n\n/**\n * Given an environment variable that represents the environment to use for a given serve,\n * it returns the environment as a enum;\n * @param value The environment variable value.\n * @returns {ServiceEnvironment} representing the environment to use.\n */\nfunction serviceEnvironment(value: undefined | string): Environment {\n if (value === 'local') {\n return Environment.Local;\n } else if (value === 'spin') {\n return Environment.Spin;\n } else {\n return Environment.Production;\n }\n}\n\nfunction isTruthy(variable: string | undefined): boolean {\n if (!variable) {\n return false;\n }\n return ['1', 'true', 'TRUE', 'yes', 'YES'].includes(variable);\n}\n\n/**\n * Returns true if the CLI is running in debug mode.\n * @param env The environment variables from the environment of the current process.\n * @returns true if SHOPIFY_CONFIG is debug\n */\nexport function isDebug(env = process.env): boolean {\n return isTruthy(env[constants.environmentVariables.debug]);\n}\n\n/**\n * Returns the environment to be used for the interactions with the partners' CLI API.\n * @param env The environment variables from the environment of the current process.\n */\nexport function partnersApiEnvironment(env = process.env): Environment {\n return serviceEnvironment(env[constants.environmentVariables.partnersApiEnv]);\n}\n\n/**\n * Returns the environment to be used for the interactions with the admin API.\n * @param env The environment variables from the environment of the current process.\n */\nexport function adminApiEnvironment(env = process.env): Environment {\n return serviceEnvironment(env[constants.environmentVariables.adminApiEnv]);\n}\n\n/**\n * Returns the environment to be used for the interactions with the storefront renderer API.\n * @param env The environment variables from the environment of the current process.\n */\nexport function storefrontRendererApiEnvironment(\n env = process.env,\n): Environment {\n return serviceEnvironment(\n env[constants.environmentVariables.storefrontRendererApiEnv],\n );\n}\n\n/**\n * Returns the environment to be used for the interactions with identity.\n * @param env The environment variables from the environment of the current process.\n */\nexport function identityEnvironment(env = process.env): Environment {\n return serviceEnvironment(env[constants.environmentVariables.identityEnv]);\n}\n","import {run, flush, settings, Errors} from '@oclif/core';\nimport {error as kitError, environment} from '@shopify/cli-kit';\n\nfunction runCreateHydrogen() {\n const initIndex = process.argv.findIndex((arg) => arg.includes('init'));\n if (initIndex === -1) {\n const initIndex =\n process.argv.findIndex(\n (arg)
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../cli-kit/src/error.ts","../../cli-kit/src/constants.ts","../../cli-kit/src/environment.ts","../src/index.ts"],"sourcesContent":["/**\n * A fatal error represents an error shouldn't be rescued and that causes the execution to terminate.\n * There shouldn't be code that catches fatal errors.\n */\nexport class Fatal extends Error {\n tryMessage: string | null;\n constructor(message: string, tryMessage: string | null = null) {\n super(message);\n this.tryMessage = tryMessage;\n }\n}\n\n/**\n * An abort error is a fatal error that shouldn't be reported as a bug.\n * Those usually represent unexpected scenarios that we can't handle and that usually require some action from the developer\n */\nexport class Abort extends Fatal {}\n\n/**\n * A bug error is an error that represents a bug and therefore should be reported.\n */\nexport class Bug extends Fatal {}\n\n/**\n * A function that handles errors that blow up in the CLI.\n * @param error Error to be handled.\n * @returns A promise that resolves with the error passed.\n */\nexport function handler(error: Error): Promise<Error> {\n return Promise.resolve(error);\n}\n","const constants = {\n environmentVariables: {\n debug: 'DEBUG',\n partnersApiEnv: 'SHOPIFY_PARTNERS_API_ENV',\n adminApiEnv: 'SHOPIFY_ADMIN_API_ENV',\n storefrontRendererApiEnv: 'SHOPIFY_STOREFRONT_RENDERER_API_ENV',\n identityEnv: 'SHOPIFY_IDENTITY_ENV',\n },\n};\n\nexport default constants;\n","import constants from './constants';\nimport {Environment} from './network/service';\n\n/**\n * Given an environment variable that represents the environment to use for a given serve,\n * it returns the environment as a enum;\n * @param value The environment variable value.\n * @returns {ServiceEnvironment} representing the environment to use.\n */\nfunction serviceEnvironment(value: undefined | string): Environment {\n if (value === 'local') {\n return Environment.Local;\n } else if (value === 'spin') {\n return Environment.Spin;\n } else {\n return Environment.Production;\n }\n}\n\nfunction isTruthy(variable: string | undefined): boolean {\n if (!variable) {\n return false;\n }\n return ['1', 'true', 'TRUE', 'yes', 'YES'].includes(variable);\n}\n\n/**\n * Returns true if the CLI is running in debug mode.\n * @param env The environment variables from the environment of the current process.\n * @returns true if SHOPIFY_CONFIG is debug\n */\nexport function isDebug(env = process.env): boolean {\n return isTruthy(env[constants.environmentVariables.debug]);\n}\n\n/**\n * Returns the environment to be used for the interactions with the partners' CLI API.\n * @param env The environment variables from the environment of the current process.\n */\nexport function partnersApiEnvironment(env = process.env): Environment {\n return serviceEnvironment(env[constants.environmentVariables.partnersApiEnv]);\n}\n\n/**\n * Returns the environment to be used for the interactions with the admin API.\n * @param env The environment variables from the environment of the current process.\n */\nexport function adminApiEnvironment(env = process.env): Environment {\n return serviceEnvironment(env[constants.environmentVariables.adminApiEnv]);\n}\n\n/**\n * Returns the environment to be used for the interactions with the storefront renderer API.\n * @param env The environment variables from the environment of the current process.\n */\nexport function storefrontRendererApiEnvironment(\n env = process.env,\n): Environment {\n return serviceEnvironment(\n env[constants.environmentVariables.storefrontRendererApiEnv],\n );\n}\n\n/**\n * Returns the environment to be used for the interactions with identity.\n * @param env The environment variables from the environment of the current process.\n */\nexport function identityEnvironment(env = process.env): Environment {\n return serviceEnvironment(env[constants.environmentVariables.identityEnv]);\n}\n","import {run, flush, settings, Errors} from '@oclif/core';\nimport {args} from '@oclif/core/lib/parser';\nimport {error as kitError, environment} from '@shopify/cli-kit';\n\nfunction runCreateHydrogen() {\n const initIndex = process.argv.findIndex((arg) => arg.includes('init'));\n if (initIndex === -1) {\n const initIndex =\n process.argv.findIndex(\n (arg) =>\n arg.includes('bin/create-hydrogen') ||\n arg.includes('bin/dev') ||\n arg.includes('bin/run'),\n ) + 1;\n process.argv.splice(initIndex, 0, 'init');\n }\n\n if (environment.isDebug()) {\n settings.debug = true;\n }\n\n // Start the CLI\n run(undefined, import.meta.url)\n .then(flush)\n .catch((error: Error): Promise<void | Error> => {\n const oclifHandle = Errors.handle;\n const kitHandle = kitError.handler;\n // eslint-disable-next-line promise/no-nesting\n return kitHandle(error).then(oclifHandle);\n });\n}\n\nexport default runCreateHydrogen;\n"],"names":["environment.isDebug","kitError.handler"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUO,SAAS,OAAO,CAAC,KAAK,EAAE;AAC/B,EAAE,OAAO,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAChC;;ACZA,MAAM,SAAS,GAAG;AAClB,EAAE,oBAAoB,EAAE;AACxB,IAAI,KAAK,EAAE,OAAO;AAClB,IAAI,cAAc,EAAE,0BAA0B;AAC9C,IAAI,WAAW,EAAE,uBAAuB;AACxC,IAAI,wBAAwB,EAAE,qCAAqC;AACnE,IAAI,WAAW,EAAE,sBAAsB;AACvC,GA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,IAAI,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC;AACtC,IAAI,MAAM,SAAS,GAAGC,OAAgB,CAAC;AACvC,IAAI,OAAO,SAAS,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;AAC9C,GAAG,CAAC,CAAC;AACL;;;;"}
|
|
@@ -48863,4 +48863,4 @@ new Storage({
|
|
|
48863
48863
|
});
|
|
48864
48864
|
|
|
48865
48865
|
export { Storage as S, commonjsRequire as a, ansiStyles$2 as b, commonjsGlobal as c, ansiEscapes$2 as d, enquirer as e, cliCursor$1 as f, gracefulFs$1 as g, stripAnsi$2 as h, stringWidth$2 as i, out as o, supportsColor_1 as s, through as t };
|
|
48866
|
-
//# sourceMappingURL=store-
|
|
48866
|
+
//# sourceMappingURL=store-07cc6f36.js.map
|