@shopify/cli-kit 3.0.25 → 3.1.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 +34 -0
- package/assets/auth-error.html +2 -4
- package/assets/empty-url.html +2 -4
- package/assets/missing-code.html +2 -4
- package/assets/missing-state.html +2 -4
- package/assets/style.css +5 -8
- package/assets/success.html +1 -1
- package/dist/abort.d.ts +1 -0
- package/dist/abort.js +2 -0
- package/dist/abort.js.map +1 -0
- package/dist/analytics.d.ts +13 -0
- package/dist/analytics.js +111 -0
- package/dist/analytics.js.map +1 -0
- package/dist/api/admin.d.ts +3 -0
- package/dist/api/admin.js +80 -0
- package/dist/api/admin.js.map +1 -0
- package/dist/api/common.d.ts +11 -0
- package/dist/api/common.js +40 -0
- package/dist/api/common.js.map +1 -0
- package/dist/api/graphql/all_app_extension_registrations.d.ts +14 -0
- package/dist/api/graphql/all_app_extension_registrations.js +14 -0
- package/dist/api/graphql/all_app_extension_registrations.js.map +1 -0
- package/dist/api/graphql/all_orgs.d.ts +12 -0
- package/dist/api/graphql/all_orgs.js +14 -0
- package/dist/api/graphql/all_orgs.js.map +1 -0
- package/dist/api/graphql/all_stores_by_org.d.ts +18 -0
- package/dist/api/graphql/all_stores_by_org.js +21 -0
- package/dist/api/graphql/all_stores_by_org.js.map +1 -0
- package/dist/api/graphql/convert_dev_to_test_store.d.ts +16 -0
- package/dist/api/graphql/convert_dev_to_test_store.js +13 -0
- package/dist/api/graphql/convert_dev_to_test_store.js.map +1 -0
- package/dist/api/graphql/create_app.d.ts +28 -0
- package/dist/api/graphql/create_app.js +32 -0
- package/dist/api/graphql/create_app.js.map +1 -0
- package/dist/api/graphql/create_deployment.d.ts +33 -0
- package/dist/api/graphql/create_deployment.js +25 -0
- package/dist/api/graphql/create_deployment.js.map +1 -0
- package/dist/api/graphql/extension_create.d.ts +30 -0
- package/dist/api/graphql/extension_create.js +26 -0
- package/dist/api/graphql/extension_create.js.map +1 -0
- package/dist/api/graphql/extension_specifications.d.ts +18 -0
- package/dist/api/graphql/extension_specifications.js +18 -0
- package/dist/api/graphql/extension_specifications.js.map +1 -0
- package/dist/api/graphql/find_app.d.ts +13 -0
- package/dist/api/graphql/find_app.js +16 -0
- package/dist/api/graphql/find_app.js.map +1 -0
- package/dist/api/graphql/find_org.d.ts +23 -0
- package/dist/api/graphql/find_org.js +26 -0
- package/dist/api/graphql/find_org.js.map +1 -0
- package/dist/api/graphql/find_org_basic.d.ts +11 -0
- package/dist/api/graphql/find_org_basic.js +14 -0
- package/dist/api/graphql/find_org_basic.js.map +1 -0
- package/dist/api/graphql/find_store_by_domain.d.ts +21 -0
- package/dist/api/graphql/find_store_by_domain.js +24 -0
- package/dist/api/graphql/find_store_by_domain.js.map +1 -0
- package/dist/api/graphql/functions/app_function_set.d.ts +43 -0
- package/dist/api/graphql/functions/app_function_set.js +52 -0
- package/dist/api/graphql/functions/app_function_set.js.map +1 -0
- package/dist/api/graphql/functions/compile_module.d.ts +15 -0
- package/dist/api/graphql/functions/compile_module.js +13 -0
- package/dist/api/graphql/functions/compile_module.js.map +1 -0
- package/dist/api/graphql/functions/function_service_proxy.d.ts +4 -0
- package/dist/api/graphql/functions/function_service_proxy.js +7 -0
- package/dist/api/graphql/functions/function_service_proxy.js.map +1 -0
- package/dist/api/graphql/functions/get_app_functions.d.ts +1 -0
- package/dist/api/graphql/functions/get_app_functions.js +10 -0
- package/dist/api/graphql/functions/get_app_functions.js.map +1 -0
- package/dist/api/graphql/functions/module_compilation_status.d.ts +15 -0
- package/dist/api/graphql/functions/module_compilation_status.js +13 -0
- package/dist/api/graphql/functions/module_compilation_status.js.map +1 -0
- package/dist/api/graphql/functions/module_upload_url_generate.d.ts +18 -0
- package/dist/api/graphql/functions/module_upload_url_generate.js +17 -0
- package/dist/api/graphql/functions/module_upload_url_generate.js.map +1 -0
- package/dist/api/graphql/generate_signed_upload_url.d.ts +15 -0
- package/dist/api/graphql/generate_signed_upload_url.js +15 -0
- package/dist/api/graphql/generate_signed_upload_url.js.map +1 -0
- package/dist/api/graphql/get_variant_id.d.ts +17 -0
- package/dist/api/graphql/get_variant_id.js +20 -0
- package/dist/api/graphql/get_variant_id.js.map +1 -0
- package/dist/api/graphql/index.d.ts +22 -0
- package/dist/api/graphql/index.js +23 -0
- package/dist/api/graphql/index.js.map +1 -0
- package/dist/api/graphql/update_draft.d.ts +33 -0
- package/dist/api/graphql/update_draft.js +24 -0
- package/dist/api/graphql/update_draft.js.map +1 -0
- package/dist/api/graphql/update_urls.d.ts +14 -0
- package/dist/api/graphql/update_urls.js +12 -0
- package/dist/api/graphql/update_urls.js.map +1 -0
- package/dist/api/identity.d.ts +1 -0
- package/dist/api/identity.js +32 -0
- package/dist/api/identity.js.map +1 -0
- package/dist/api/partners.d.ts +25 -0
- package/dist/api/partners.js +100 -0
- package/dist/api/partners.js.map +1 -0
- package/dist/api.d.ts +5 -0
- package/dist/api.js +6 -0
- package/dist/api.js.map +1 -0
- package/dist/cli.d.ts +7 -0
- package/dist/cli.js +13 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants.d.ts +43 -0
- package/dist/constants.js +63 -0
- package/dist/constants.js.map +1 -0
- package/dist/environment/fqdn.d.ts +23 -0
- package/dist/environment/fqdn.js +61 -0
- package/dist/environment/fqdn.js.map +1 -0
- package/dist/environment/local.d.ts +48 -0
- package/dist/environment/local.js +82 -0
- package/dist/environment/local.js.map +1 -0
- package/dist/environment/service.d.ts +17 -0
- package/dist/environment/service.js +41 -0
- package/dist/environment/service.js.map +1 -0
- package/dist/environment/spin.d.ts +47 -0
- package/dist/environment/spin.js +83 -0
- package/dist/environment/spin.js.map +1 -0
- package/dist/environment/utilities.d.ts +6 -0
- package/dist/environment/utilities.js +12 -0
- package/dist/environment/utilities.js.map +1 -0
- package/dist/environment.d.ts +5 -0
- package/dist/environment.js +6 -0
- package/dist/environment.js.map +1 -0
- package/dist/error.d.ts +44 -0
- package/dist/error.js +91 -0
- package/dist/error.js.map +1 -0
- package/dist/file.d.ts +67 -0
- package/dist/file.js +165 -0
- package/dist/file.js.map +1 -0
- package/dist/git.d.ts +15 -0
- package/dist/git.js +48 -0
- package/dist/git.js.map +1 -0
- package/dist/github.d.ts +33 -0
- package/dist/github.js +56 -0
- package/dist/github.js.map +1 -0
- package/dist/haiku.d.ts +1 -0
- package/dist/haiku.js +8 -0
- package/dist/haiku.js.map +1 -0
- package/dist/http/fetch.d.ts +16 -0
- package/dist/http/fetch.js +18 -0
- package/dist/http/fetch.js.map +1 -0
- package/dist/http/formdata.d.ts +3 -0
- package/dist/http/formdata.js +6 -0
- package/dist/http/formdata.js.map +1 -0
- package/dist/http.d.ts +2 -0
- package/dist/http.js +3 -0
- package/dist/http.js.map +1 -0
- package/dist/id.d.ts +6 -0
- package/dist/id.js +18 -0
- package/dist/id.js.map +1 -0
- package/dist/index.d.ts +33 -2179
- package/dist/index.js +34 -3264
- package/dist/index.js.map +1 -1
- package/dist/network/api.d.ts +2 -0
- package/dist/network/api.js +2 -0
- package/dist/network/api.js.map +1 -0
- package/dist/network/service.d.ts +16 -0
- package/dist/network/service.js +12 -0
- package/dist/network/service.js.map +1 -0
- package/dist/{archiver.d.ts → node/archiver.d.ts} +1 -4
- package/dist/node/archiver.js +22 -42
- package/dist/node/archiver.js.map +1 -1
- package/dist/node/checksum.d.ts +20 -0
- package/dist/node/checksum.js +32 -0
- package/dist/node/checksum.js.map +1 -0
- package/dist/node/cli.d.ts +18 -0
- package/dist/node/cli.js +96 -0
- package/dist/node/cli.js.map +1 -0
- package/dist/node/colors.d.ts +1 -0
- package/dist/node/colors.js +8 -0
- package/dist/node/colors.js.map +1 -0
- package/dist/node/dot-env.d.ts +33 -0
- package/dist/node/dot-env.js +36 -0
- package/dist/node/dot-env.js.map +1 -0
- package/dist/node/node-package-manager.d.ts +197 -0
- package/dist/node/node-package-manager.js +309 -0
- package/dist/node/node-package-manager.js.map +1 -0
- package/dist/node/ruby.d.ts +30 -0
- package/dist/node/ruby.js +197 -0
- package/dist/node/ruby.js.map +1 -0
- package/dist/npm.d.ts +27 -0
- package/dist/npm.js +20 -0
- package/dist/npm.js.map +1 -0
- package/dist/os.d.ts +10 -0
- package/dist/os.js +70 -0
- package/dist/os.js.map +1 -0
- package/dist/output.d.ts +149 -0
- package/dist/output.js +515 -0
- package/dist/output.js.map +1 -0
- package/dist/path.d.ts +22 -0
- package/dist/path.js +43 -0
- package/dist/path.js.map +1 -0
- package/dist/plugins.d.ts +9 -0
- package/dist/plugins.js +12 -0
- package/dist/plugins.js.map +1 -0
- package/dist/port.d.ts +5 -0
- package/dist/port.js +35 -0
- package/dist/port.js.map +1 -0
- package/dist/schema.d.ts +1 -0
- package/dist/schema.js +2 -0
- package/dist/schema.js.map +1 -0
- package/dist/secure-store.d.ts +19 -0
- package/dist/secure-store.js +63 -0
- package/dist/secure-store.js.map +1 -0
- package/dist/semver.d.ts +3 -0
- package/dist/semver.js +6 -0
- package/dist/semver.js.map +1 -0
- package/dist/session/authorize.d.ts +7 -0
- package/dist/session/authorize.js +40 -0
- package/dist/session/authorize.js.map +1 -0
- package/dist/session/exchange.d.ts +42 -0
- package/dist/session/exchange.js +144 -0
- package/dist/session/exchange.js.map +1 -0
- package/dist/session/identity.d.ts +3 -0
- package/dist/session/identity.js +58 -0
- package/dist/session/identity.js.map +1 -0
- package/dist/session/post-auth.d.ts +13 -0
- package/dist/session/post-auth.js +56 -0
- package/dist/session/post-auth.js.map +1 -0
- package/dist/session/redirect-listener.d.ts +34 -0
- package/dist/session/redirect-listener.js +97 -0
- package/dist/session/redirect-listener.js.map +1 -0
- package/dist/session/schema.d.ts +174 -0
- package/dist/session/schema.js +59 -0
- package/dist/session/schema.js.map +1 -0
- package/dist/session/scopes.d.ts +16 -0
- package/dist/session/scopes.js +53 -0
- package/dist/session/scopes.js.map +1 -0
- package/dist/session/store.d.ts +24 -0
- package/dist/session/store.js +88 -0
- package/dist/session/store.js.map +1 -0
- package/dist/session/token.d.ts +40 -0
- package/dist/session/token.js +22 -0
- package/dist/session/token.js.map +1 -0
- package/dist/session/validate.d.ts +17 -0
- package/dist/session/validate.js +75 -0
- package/dist/session/validate.js.map +1 -0
- package/dist/session.d.ts +88 -0
- package/dist/session.js +251 -0
- package/dist/session.js.map +1 -0
- package/dist/store/schema.d.ts +3 -0
- package/dist/store/schema.js +27 -0
- package/dist/store/schema.js.map +1 -0
- package/dist/store.d.ts +32 -0
- package/dist/store.js +102 -0
- package/dist/store.js.map +1 -0
- package/dist/string.d.ts +22 -0
- package/dist/string.js +38 -0
- package/dist/string.js.map +1 -0
- package/dist/system.d.ts +53 -0
- package/dist/system.js +109 -0
- package/dist/system.js.map +1 -0
- package/dist/template.d.ts +11 -0
- package/dist/template.js +50 -0
- package/dist/template.js.map +1 -0
- package/dist/testing/output.d.ts +9 -0
- package/dist/testing/output.js +15 -0
- package/dist/testing/output.js.map +1 -0
- package/dist/testing/store.d.ts +7 -0
- package/dist/testing/store.js +26 -0
- package/dist/testing/store.js.map +1 -0
- package/dist/toml.d.ts +3 -0
- package/dist/toml.js +8 -0
- package/dist/toml.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/dist/ui/autocomplete.d.ts +7 -0
- package/dist/ui/autocomplete.js +43 -0
- package/dist/ui/autocomplete.js.map +1 -0
- package/dist/ui/input.d.ts +7 -0
- package/dist/ui/input.js +48 -0
- package/dist/ui/input.js.map +1 -0
- package/dist/ui/select.d.ts +6 -0
- package/dist/ui/select.js +30 -0
- package/dist/ui/select.js.map +1 -0
- package/dist/ui.d.ts +36 -0
- package/dist/ui.js +124 -0
- package/dist/ui.js.map +1 -0
- package/dist/version.d.ts +19 -0
- package/dist/version.js +34 -0
- package/dist/version.js.map +1 -0
- package/dist/vscode.d.ts +8 -0
- package/dist/vscode.js +36 -0
- package/dist/vscode.js.map +1 -0
- package/dist/yaml.d.ts +2 -0
- package/dist/yaml.js +8 -0
- package/dist/yaml.js.map +1 -0
- package/package.json +19 -8
- package/dist/archiver.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/local-d0094ffe.js +0 -1344
- package/dist/local-d0094ffe.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../src/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AACjD,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAChC,OAAO,IAAc,MAAM,MAAM,CAAA;AAEjC,6DAA6D;AAC7D,aAAa;AAEb,MAAM,UAAU,GAAG,EAAE,CAAA;AAgBrB,MAAM,MAAM,GAAG;IACb,OAAO,EAAE;QACP,IAAI,EAAE,OAAO;QACb,KAAK,EAAE;YACL,IAAI,EAAE,QAAQ;YACd,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;iBACf;gBACD,SAAS,EAAE;oBACT,IAAI,EAAE,QAAQ;iBACf;aACF;SACF;KACF;CAC+B,CAAA;AAElC,IAAI,SAAkC,CAAA;AAEtC,MAAM,UAAU,WAAW;IACzB,IAAI,CAAC,SAAS,EAAE;QACd,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAA;KACpE;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,qBAAqB;IACzC,IAAI,CAAC,SAAS,EAAE;QACd,kDAAkD;QAClD,SAAS,GAAG,IAAI,WAAW,CAAC;YAC1B,MAAM;YACN,UAAU;YACV,WAAW,EAAE,iBAAiB;YAC9B,cAAc,EAAE,MAAM,SAAS,CAAC,QAAQ,CAAC,MAAM,EAAE;SAClD,CAAC,CAAA;KACH;AACH,CAAC;AAED,MAAM,OAAO,WAAY,SAAQ,IAAgB;IAC/C,UAAU,CAA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abort} from './error.js'\nimport Conf, {Schema} from 'conf'\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore\n\nconst migrations = {}\n\nexport interface CachedAppInfo {\n directory: string\n appId: string\n title?: string\n orgId?: string\n storeFqdn?: string\n}\n\ninterface ConfSchema {\n appInfo: CachedAppInfo[]\n themeStore: string\n session: string\n}\n\nconst schema = {\n appInfo: {\n type: 'array',\n items: {\n type: 'object',\n properties: {\n appId: {\n type: 'string',\n },\n orgId: {\n type: 'string',\n },\n storeFqdn: {\n type: 'string',\n },\n },\n },\n },\n} as unknown as Schema<ConfSchema>\n\nlet _instance: CLIKitStore | undefined\n\nexport function cliKitStore() {\n if (!_instance) {\n throw new Abort(\"The CLIKitStore instance hasn't been initialized\")\n }\n return _instance\n}\n\nexport async function initializeCliKitStore() {\n if (!_instance) {\n // eslint-disable-next-line require-atomic-updates\n _instance = new CLIKitStore({\n schema,\n migrations,\n projectName: 'shopify-cli-kit',\n projectVersion: await constants.versions.cliKit(),\n })\n }\n}\n\nexport class CLIKitStore extends Conf<ConfSchema> {\n getAppInfo(directory: string): CachedAppInfo | undefined {\n debug(content`Reading cached app information for directory ${token.path(directory)}...`)\n const apps = this.get('appInfo') ?? []\n return apps.find((app: CachedAppInfo) => app.directory === directory)\n }\n\n setAppInfo(options: {directory: string; appId: string; title?: string; storeFqdn?: string; orgId?: string}): void {\n debug(content`Storing app information for directory ${token.path(options.directory)}:\n${token.json(options)}\n`)\n const apps = this.get('appInfo') ?? []\n const index = apps.findIndex((saved: CachedAppInfo) => saved.directory === options.directory)\n if (index === -1) {\n apps.push(options)\n } else {\n const app: CachedAppInfo = apps[index]\n apps[index] = {\n appId: options.appId,\n directory: options.directory,\n title: options.title ?? app.title,\n storeFqdn: options.storeFqdn ?? app.storeFqdn,\n orgId: options.orgId ?? app.orgId,\n }\n }\n this.set('appInfo', apps)\n }\n\n clearAppInfo(directory: string): void {\n debug(content`Clearning app information for directory ${token.path(directory)}...`)\n const apps = this.get('appInfo') ?? []\n const index = apps.findIndex((saved: CachedAppInfo) => saved.directory === directory)\n if (index !== -1) {\n apps.splice(index, 1)\n }\n this.set('appInfo', apps)\n }\n\n getTheme(): string | undefined {\n debug(content`Getting theme store...`)\n return this.get('themeStore')\n }\n\n setTheme(store: string): void {\n debug(content`Setting theme store...`)\n this.set('themeStore', store)\n }\n\n getSession(): string | undefined {\n debug(content`Getting session store...`)\n return this.get('sessionStore')\n }\n\n setSession(store: string): void {\n debug(content`Setting session store...`)\n this.set('sessionStore', store)\n }\n\n removeSession(): void {\n debug(content`Removing session store...`)\n this.set('sessionStore', '')\n }\n}\n"]}
|
package/dist/string.d.ts
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export { camelCase as camelize } from 'change-case';
|
|
2
|
+
export { paramCase as hyphenize } from 'change-case';
|
|
3
|
+
export { snakeCase as underscore } from 'change-case';
|
|
4
|
+
export { constantCase as constantize } from 'change-case';
|
|
5
|
+
/** Returns a random string */
|
|
6
|
+
export declare function randomHex(size: number): string;
|
|
7
|
+
export declare function generateRandomChallengePair(): {
|
|
8
|
+
codeVerifier: string;
|
|
9
|
+
codeChallenge: string;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* Given a string, it returns it with the first letter capitalized.
|
|
13
|
+
* @param string {string} String whose first letter will be caplitalized.
|
|
14
|
+
* @returns The given string with its first letter capitalized.
|
|
15
|
+
*/
|
|
16
|
+
export declare function capitalize(string: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Given a store, returns a valid store fqdn removing protocol and adding .myshopify.com domain
|
|
19
|
+
* @param store Original store name provided by the user
|
|
20
|
+
* @returns a valid store fqdn
|
|
21
|
+
*/
|
|
22
|
+
export declare function normalizeStoreName(store: string): string;
|
package/dist/string.js
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import crypto from 'crypto';
|
|
2
|
+
export { camelCase as camelize } from 'change-case';
|
|
3
|
+
export { paramCase as hyphenize } from 'change-case';
|
|
4
|
+
export { snakeCase as underscore } from 'change-case';
|
|
5
|
+
export { constantCase as constantize } from 'change-case';
|
|
6
|
+
/** Returns a random string */
|
|
7
|
+
export function randomHex(size) {
|
|
8
|
+
return crypto.randomBytes(size).toString('hex');
|
|
9
|
+
}
|
|
10
|
+
export function generateRandomChallengePair() {
|
|
11
|
+
const codeVerifier = base64URLEncode(crypto.randomBytes(32));
|
|
12
|
+
const codeChallenge = base64URLEncode(sha256(codeVerifier));
|
|
13
|
+
return { codeVerifier, codeChallenge };
|
|
14
|
+
}
|
|
15
|
+
function base64URLEncode(str) {
|
|
16
|
+
return str.toString('base64').replace(/\+/g, '-').replace(/\//g, '_').replace(/[=]/g, '');
|
|
17
|
+
}
|
|
18
|
+
function sha256(str) {
|
|
19
|
+
return crypto.createHash('sha256').update(str).digest();
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Given a string, it returns it with the first letter capitalized.
|
|
23
|
+
* @param string {string} String whose first letter will be caplitalized.
|
|
24
|
+
* @returns The given string with its first letter capitalized.
|
|
25
|
+
*/
|
|
26
|
+
export function capitalize(string) {
|
|
27
|
+
return string.substring(0, 1).toUpperCase() + string.substring(1);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Given a store, returns a valid store fqdn removing protocol and adding .myshopify.com domain
|
|
31
|
+
* @param store Original store name provided by the user
|
|
32
|
+
* @returns a valid store fqdn
|
|
33
|
+
*/
|
|
34
|
+
export function normalizeStoreName(store) {
|
|
35
|
+
const storeFqdn = store.replace(/^https?:\/\//, '').replace(/\/$/, '');
|
|
36
|
+
return storeFqdn.includes('.myshopify.com') ? storeFqdn : `${storeFqdn}.myshopify.com`;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=string.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"string.js","sourceRoot":"","sources":["../src/string.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,OAAO,E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IAC9C,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IACtE,OAAO,SAAS,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,SAAS,gBAAgB,CAAA;AACxF,CAAC","sourcesContent":["import crypto from 'crypto'\n\nexport {camelCase as camelize} from 'change-case'\nexport {paramCase as hyphenize} from 'change-case'\nexport {snakeCase as underscore} from 'change-case'\nexport {constantCase as constantize} from 'change-case'\n\n/** Returns a random string */\nexport function randomHex(size: number): string {\n return crypto.randomBytes(size).toString('hex')\n}\n\nexport function generateRandomChallengePair() {\n const codeVerifier = base64URLEncode(crypto.randomBytes(32))\n const codeChallenge = base64URLEncode(sha256(codeVerifier))\n return {codeVerifier, codeChallenge}\n}\n\nfunction base64URLEncode(str: Buffer) {\n return str.toString('base64').replace(/\\+/g, '-').replace(/\\//g, '_').replace(/[=]/g, '')\n}\n\nfunction sha256(str: string) {\n return crypto.createHash('sha256').update(str).digest()\n}\n\n/**\n * Given a string, it returns it with the first letter capitalized.\n * @param string {string} String whose first letter will be caplitalized.\n * @returns The given string with its first letter capitalized.\n */\nexport function capitalize(string: string) {\n return string.substring(0, 1).toUpperCase() + string.substring(1)\n}\n\n/**\n * Given a store, returns a valid store fqdn removing protocol and adding .myshopify.com domain\n * @param store Original store name provided by the user\n * @returns a valid store fqdn\n */\nexport function normalizeStoreName(store: string) {\n const storeFqdn = store.replace(/^https?:\\/\\//, '').replace(/\\/$/, '')\n return storeFqdn.includes('.myshopify.com') ? storeFqdn : `${storeFqdn}.myshopify.com`\n}\n"]}
|
package/dist/system.d.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { AbortSignal } from 'abort-controller';
|
|
3
|
+
import type { Writable, Readable } from 'node:stream';
|
|
4
|
+
export interface ExecOptions {
|
|
5
|
+
cwd?: string;
|
|
6
|
+
env?: {
|
|
7
|
+
[key: string]: string | undefined;
|
|
8
|
+
};
|
|
9
|
+
stdout?: Writable | 'inherit';
|
|
10
|
+
stderr?: Writable;
|
|
11
|
+
stdio?: Readable | 'inherit';
|
|
12
|
+
stdin?: string;
|
|
13
|
+
signal?: AbortSignal;
|
|
14
|
+
}
|
|
15
|
+
export declare type WritableExecOptions = Omit<ExecOptions, 'stdout'> & {
|
|
16
|
+
stdout?: Writable;
|
|
17
|
+
};
|
|
18
|
+
export declare const open: (url: string) => Promise<void>;
|
|
19
|
+
/**
|
|
20
|
+
* Runs a command asynchronously, aggregates the stdout data, and returns it.
|
|
21
|
+
* @param command {string} Command to be executed.
|
|
22
|
+
* @param args {string[]} Arguments to pass to the command.
|
|
23
|
+
* @returns A promise that resolves with the aggregatted stdout of the command.
|
|
24
|
+
*/
|
|
25
|
+
export declare const captureOutput: (command: string, args: string[], options?: ExecOptions) => Promise<string>;
|
|
26
|
+
export declare const exec: (command: string, args: string[], options?: ExecOptions) => Promise<void>;
|
|
27
|
+
interface ConcurrentExecCommand {
|
|
28
|
+
prefix: string;
|
|
29
|
+
executable: string;
|
|
30
|
+
args: string[];
|
|
31
|
+
cwd: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Runs commands concurrently and combines the standard output and error data
|
|
35
|
+
* into a single stream that differenciates the sources using a colored prefix:
|
|
36
|
+
*
|
|
37
|
+
* Example:
|
|
38
|
+
* [my-extension] Log coming from my-extension
|
|
39
|
+
* [my-script] Log coming from my script
|
|
40
|
+
*
|
|
41
|
+
* If one of the processes fails, it aborts the running ones and exits with that error.
|
|
42
|
+
* @param commands {ConcurrentExecCommand[]} Commands to execute.
|
|
43
|
+
*/
|
|
44
|
+
export declare const concurrentExec: (commands: ConcurrentExecCommand[]) => Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Displays a large file using the terminal pager set by the user, or a
|
|
47
|
+
* reasonable default for the user's OS:
|
|
48
|
+
*
|
|
49
|
+
* @param filename string The path to the file to be displayed.
|
|
50
|
+
*/
|
|
51
|
+
export declare function page(filename: string): Promise<void>;
|
|
52
|
+
export declare function sleep(seconds: number): Promise<unknown>;
|
|
53
|
+
export {};
|
package/dist/system.js
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { concurrent as concurrentOutput, shouldDisplayColors, debug } from './output.js';
|
|
2
|
+
import { platformAndArch } from './os.js';
|
|
3
|
+
import { Abort } from './error.js';
|
|
4
|
+
import { execa } from 'execa';
|
|
5
|
+
export const open = async (url) => {
|
|
6
|
+
const externalOpen = await import('open');
|
|
7
|
+
await externalOpen.default(url);
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Runs a command asynchronously, aggregates the stdout data, and returns it.
|
|
11
|
+
* @param command {string} Command to be executed.
|
|
12
|
+
* @param args {string[]} Arguments to pass to the command.
|
|
13
|
+
* @returns A promise that resolves with the aggregatted stdout of the command.
|
|
14
|
+
*/
|
|
15
|
+
export const captureOutput = async (command, args, options) => {
|
|
16
|
+
const result = await buildExec(command, args, options);
|
|
17
|
+
return result.stdout;
|
|
18
|
+
};
|
|
19
|
+
export const exec = async (command, args, options) => {
|
|
20
|
+
const commandProcess = buildExec(command, args, options);
|
|
21
|
+
if (options?.stderr) {
|
|
22
|
+
commandProcess.stderr?.pipe(options.stderr);
|
|
23
|
+
}
|
|
24
|
+
if (options?.stdout && options.stdout !== 'inherit') {
|
|
25
|
+
commandProcess.stdout?.pipe(options.stdout);
|
|
26
|
+
}
|
|
27
|
+
options?.signal?.addEventListener('abort', () => {
|
|
28
|
+
commandProcess.kill('SIGTERM', { forceKillAfterTimeout: 1000 });
|
|
29
|
+
});
|
|
30
|
+
try {
|
|
31
|
+
await commandProcess;
|
|
32
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
+
}
|
|
34
|
+
catch (processError) {
|
|
35
|
+
const abortError = new Abort(processError.message);
|
|
36
|
+
abortError.stack = processError.stack;
|
|
37
|
+
throw abortError;
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
const buildExec = (command, args, options) => {
|
|
41
|
+
const env = options?.env ?? process.env;
|
|
42
|
+
if (shouldDisplayColors()) {
|
|
43
|
+
env.FORCE_COLOR = '1';
|
|
44
|
+
}
|
|
45
|
+
const commandProcess = execa(command, args, {
|
|
46
|
+
env,
|
|
47
|
+
cwd: options?.cwd,
|
|
48
|
+
input: options?.stdin,
|
|
49
|
+
stdout: options?.stdout === 'inherit' ? 'inherit' : undefined,
|
|
50
|
+
});
|
|
51
|
+
debug(`
|
|
52
|
+
Running system process:
|
|
53
|
+
· Command: ${command} ${args.join(' ')}
|
|
54
|
+
· Working directory: ${options?.cwd ?? process.cwd()}
|
|
55
|
+
`);
|
|
56
|
+
return commandProcess;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Runs commands concurrently and combines the standard output and error data
|
|
60
|
+
* into a single stream that differenciates the sources using a colored prefix:
|
|
61
|
+
*
|
|
62
|
+
* Example:
|
|
63
|
+
* [my-extension] Log coming from my-extension
|
|
64
|
+
* [my-script] Log coming from my script
|
|
65
|
+
*
|
|
66
|
+
* If one of the processes fails, it aborts the running ones and exits with that error.
|
|
67
|
+
* @param commands {ConcurrentExecCommand[]} Commands to execute.
|
|
68
|
+
*/
|
|
69
|
+
export const concurrentExec = async (commands) => {
|
|
70
|
+
await concurrentOutput(commands.map((command) => {
|
|
71
|
+
return {
|
|
72
|
+
prefix: command.prefix,
|
|
73
|
+
action: async (stdout, stderr, signal) => {
|
|
74
|
+
await exec(command.executable, command.args, {
|
|
75
|
+
stdout,
|
|
76
|
+
stderr,
|
|
77
|
+
cwd: command.cwd,
|
|
78
|
+
signal,
|
|
79
|
+
});
|
|
80
|
+
},
|
|
81
|
+
};
|
|
82
|
+
}));
|
|
83
|
+
};
|
|
84
|
+
/**
|
|
85
|
+
* Displays a large file using the terminal pager set by the user, or a
|
|
86
|
+
* reasonable default for the user's OS:
|
|
87
|
+
*
|
|
88
|
+
* @param filename string The path to the file to be displayed.
|
|
89
|
+
*/
|
|
90
|
+
export async function page(filename) {
|
|
91
|
+
let executable;
|
|
92
|
+
if (process.env.PAGER) {
|
|
93
|
+
executable = process.env.PAGER;
|
|
94
|
+
}
|
|
95
|
+
else if ((await platformAndArch()).platform === 'windows') {
|
|
96
|
+
executable = 'more';
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
executable = 'less -NR';
|
|
100
|
+
}
|
|
101
|
+
const [command, ...args] = [...executable.split(' '), filename];
|
|
102
|
+
await exec(command, args, { stdout: 'inherit', stdin: 'inherit' });
|
|
103
|
+
}
|
|
104
|
+
export async function sleep(seconds) {
|
|
105
|
+
return new Promise((resolve) => {
|
|
106
|
+
setTimeout(resolve, 1000 * seconds);
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=system.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"system.js","sourceRoot":"","sources":["../src/system.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,IAAI,gBAAgB,EAAE,mBAAmB,EAAE,KAAK,EAAC,MAAM,aAAa,CAAA;AACtF,OAAO,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;AACvC,OAAO,EAAC,KAAK,EAAC,MAAM,YAAY,CAAA;AAChC,OAAO,EAAC,KAAK,EAAoB,MAAM,OAAO,CAAA;AAe9C,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EAAE,GAAW,EAAE,EAAE;IACxC,MAAM,YAAY,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,CAAA;IACzC,MAAM,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,CAAA;AACjC,CAAC,CAAA;AAED;;;;;GAKG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,EAAE,OAAe,EAAE,IAAc,EAAE,OAAqB,EAAmB,EAAE;IAC7G,MAAM,MAA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U,GAAG,MAAM,CAAA;KACpB;SAAM;QACL,UAAU,GAAG,UAAU,CAAA;KACxB;IACD,MAAM,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,UAAU,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,CAAA;IAC/D,MAAM,IAAI,CAAC,OAAO,EAAE,IAAI,EAAE,EAAC,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,SAAS,EAAC,CAAC,CAAA;AAClE,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,KAAK,CAAC,OAAe;IACzC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;QAC7B,UAAU,CAAC,OAAO,EAAE,IAAI,GAAG,OAAO,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC","sourcesContent":["import {concurrent as concurrentOutput, shouldDisplayColors, debug} from './output.js'\nimport {platformAndArch} from './os.js'\nimport {Abort} from './error.js'\nimport {execa, ExecaChildProcess} from 'execa'\nimport {AbortSignal} from 'abort-controller'\nimport type {Writable, Readable} from 'node:stream'\n\nexport interface ExecOptions {\n cwd?: string\n env?: {[key: string]: string | undefined}\n stdout?: Writable | 'inherit'\n stderr?: Writable\n stdio?: Readable | 'inherit'\n stdin?: string\n signal?: AbortSignal\n}\nexport type WritableExecOptions = Omit<ExecOptions, 'stdout'> & {stdout?: Writable}\n\nexport const open = async (url: string) => {\n const externalOpen = await import('open')\n await externalOpen.default(url)\n}\n\n/**\n * Runs a command asynchronously, aggregates the stdout data, and returns it.\n * @param command {string} Command to be executed.\n * @param args {string[]} Arguments to pass to the command.\n * @returns A promise that resolves with the aggregatted stdout of the command.\n */\nexport const captureOutput = async (command: string, args: string[], options?: ExecOptions): Promise<string> => {\n const result = await buildExec(command, args, options)\n return result.stdout\n}\n\nexport const exec = async (command: string, args: string[], options?: ExecOptions) => {\n const commandProcess = buildExec(command, args, options)\n if (options?.stderr) {\n commandProcess.stderr?.pipe(options.stderr)\n }\n if (options?.stdout && options.stdout !== 'inherit') {\n commandProcess.stdout?.pipe(options.stdout)\n }\n options?.signal?.addEventListener('abort', () => {\n commandProcess.kill('SIGTERM', {forceKillAfterTimeout: 1000})\n })\n try {\n await commandProcess\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (processError: any) {\n const abortError = new Abort(processError.message)\n abortError.stack = processError.stack\n throw abortError\n }\n}\n\nconst buildExec = (command: string, args: string[], options?: ExecOptions): ExecaChildProcess<string> => {\n const env = options?.env ?? process.env\n if (shouldDisplayColors()) {\n env.FORCE_COLOR = '1'\n }\n const commandProcess = execa(command, args, {\n env,\n cwd: options?.cwd,\n input: options?.stdin,\n stdout: options?.stdout === 'inherit' ? 'inherit' : undefined,\n })\n debug(`\nRunning system process:\n · Command: ${command} ${args.join(' ')}\n · Working directory: ${options?.cwd ?? process.cwd()}\n`)\n return commandProcess\n}\n\ninterface ConcurrentExecCommand {\n prefix: string\n executable: string\n args: string[]\n cwd: string\n}\n\n/**\n * Runs commands concurrently and combines the standard output and error data\n * into a single stream that differenciates the sources using a colored prefix:\n *\n * Example:\n * [my-extension] Log coming from my-extension\n * [my-script] Log coming from my script\n *\n * If one of the processes fails, it aborts the running ones and exits with that error.\n * @param commands {ConcurrentExecCommand[]} Commands to execute.\n */\nexport const concurrentExec = async (commands: ConcurrentExecCommand[]): Promise<void> => {\n await concurrentOutput(\n commands.map((command) => {\n return {\n prefix: command.prefix,\n action: async (stdout, stderr, signal) => {\n await exec(command.executable, command.args, {\n stdout,\n stderr,\n cwd: command.cwd,\n signal,\n })\n },\n }\n }),\n )\n}\n\n/**\n * Displays a large file using the terminal pager set by the user, or a\n * reasonable default for the user's OS:\n *\n * @param filename string The path to the file to be displayed.\n */\nexport async function page(filename: string) {\n let executable: string\n if (process.env.PAGER) {\n executable = process.env.PAGER\n } else if ((await platformAndArch()).platform === 'windows') {\n executable = 'more'\n } else {\n executable = 'less -NR'\n }\n const [command, ...args] = [...executable.split(' '), filename]\n await exec(command, args, {stdout: 'inherit', stdin: 'inherit'})\n}\n\nexport async function sleep(seconds: number) {\n return new Promise((resolve) => {\n setTimeout(resolve, 1000 * seconds)\n })\n}\n"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare function create(templateContent: string): (data: object) => Promise<string>;
|
|
2
|
+
/**
|
|
3
|
+
* Given a directory, it traverses the files and directories recursively
|
|
4
|
+
* and replaces variables in directory and file names, and files' content
|
|
5
|
+
* using the Liquid template engine.
|
|
6
|
+
* Files indicate that they are liquid template by using the .liquid extension.
|
|
7
|
+
* @param from {string} Directory that contains the template.
|
|
8
|
+
* @param to {string} Output directory.
|
|
9
|
+
* @param data {string} Data to feed the template engine.
|
|
10
|
+
*/
|
|
11
|
+
export declare function recursiveDirectoryCopy(from: string, to: string, data: object): Promise<void>;
|
package/dist/template.js
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { glob, join, dirname, relative } from './path.js';
|
|
2
|
+
import { mkdir, read, copy, chmod, isDirectory, write, hasExecutablePermissions } from './file.js';
|
|
3
|
+
import { content, token, debug } from './output.js';
|
|
4
|
+
import { Liquid } from 'liquidjs';
|
|
5
|
+
// This line is necessary to register additional helpers.
|
|
6
|
+
export function create(templateContent) {
|
|
7
|
+
return (data) => {
|
|
8
|
+
const engine = new Liquid();
|
|
9
|
+
return engine.render(engine.parse(templateContent), data);
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Given a directory, it traverses the files and directories recursively
|
|
14
|
+
* and replaces variables in directory and file names, and files' content
|
|
15
|
+
* using the Liquid template engine.
|
|
16
|
+
* Files indicate that they are liquid template by using the .liquid extension.
|
|
17
|
+
* @param from {string} Directory that contains the template.
|
|
18
|
+
* @param to {string} Output directory.
|
|
19
|
+
* @param data {string} Data to feed the template engine.
|
|
20
|
+
*/
|
|
21
|
+
export async function recursiveDirectoryCopy(from, to, data) {
|
|
22
|
+
debug(content `Copying template from directory ${token.path(from)} to ${token.path(to)}`);
|
|
23
|
+
const templateFiles = await glob(join(from, '**/*'), { dot: true });
|
|
24
|
+
const sortedTemplateFiles = templateFiles
|
|
25
|
+
.map((path) => path.split('/'))
|
|
26
|
+
.sort((lhs, rhs) => (lhs.length < rhs.length ? 1 : -1))
|
|
27
|
+
.map((components) => components.join('/'));
|
|
28
|
+
await Promise.all(sortedTemplateFiles.map(async (templateItemPath) => {
|
|
29
|
+
const outputPath = await create(join(to, relative(from, templateItemPath)))(data);
|
|
30
|
+
if (await isDirectory(templateItemPath)) {
|
|
31
|
+
await mkdir(outputPath);
|
|
32
|
+
}
|
|
33
|
+
else if (templateItemPath.endsWith('.liquid')) {
|
|
34
|
+
await mkdir(dirname(outputPath));
|
|
35
|
+
const content = await read(templateItemPath);
|
|
36
|
+
const contentOutput = await create(content)(data);
|
|
37
|
+
const isExecutable = await hasExecutablePermissions(templateItemPath);
|
|
38
|
+
const outputPathWithoutLiquid = outputPath.replace('.liquid', '');
|
|
39
|
+
await copy(templateItemPath, outputPathWithoutLiquid);
|
|
40
|
+
await write(outputPathWithoutLiquid, contentOutput);
|
|
41
|
+
if (isExecutable) {
|
|
42
|
+
await chmod(outputPathWithoutLiquid, 0o755);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
await copy(templateItemPath, outputPath);
|
|
47
|
+
}
|
|
48
|
+
}));
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=template.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.js","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAC,MAAM,WAAW,CAAA;AACvD,OAAO,EAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,wBAAwB,EAAC,MAAM,WAAW,CAAA;AAChG,OAAO,EAAC,OAAO,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MAAM,MAAM,CAAC,IAAI,CAAC,EAAE,EAAE,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;QACjF,IAAI,MAAM,WAAW,CAAC,gBAAgB,CAAC,EAAE;YACvC,MAAM,KAAK,CAAC,UAAU,CAAC,CAAA;SACxB;aAAM,IAAI,gBAAgB,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE;YAC/C,MAAM,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;YAChC,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,CAAA;YAC5C,MAAM,aAAa,GAAG,MAAM,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAA;YACjD,MAAM,YAAY,GAAG,MAAM,wBAAwB,CAAC,gBAAgB,CAAC,CAAA;YACrE,MAAM,uBAAuB,GAAG,UAAU,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAA;YACjE,MAAM,IAAI,CAAC,gBAAgB,EAAE,uBAAuB,CAAC,CAAA;YACrD,MAAM,KAAK,CAAC,uBAAuB,EAAE,aAAa,CAAC,CAAA;YACnD,IAAI,YAAY,EAAE;gBAChB,MAAM,KAAK,CAAC,uBAAuB,EAAE,KAAK,CAAC,CAAA;aAC5C;SACF;aAAM;YACL,MAAM,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAA;SACzC;IACH,CAAC,CAAC,CACH,CAAA;AACH,CAAC","sourcesContent":["import {glob, join, dirname, relative} from './path.js'\nimport {mkdir, read, copy, chmod, isDirectory, write, hasExecutablePermissions} from './file.js'\nimport {content, token, debug} from './output.js'\nimport {Liquid} from 'liquidjs'\n\n// This line is necessary to register additional helpers.\nexport function create(templateContent: string) {\n return (data: object): Promise<string> => {\n const engine = new Liquid()\n return engine.render(engine.parse(templateContent), data)\n }\n}\n\n/**\n * Given a directory, it traverses the files and directories recursively\n * and replaces variables in directory and file names, and files' content\n * using the Liquid template engine.\n * Files indicate that they are liquid template by using the .liquid extension.\n * @param from {string} Directory that contains the template.\n * @param to {string} Output directory.\n * @param data {string} Data to feed the template engine.\n */\nexport async function recursiveDirectoryCopy(from: string, to: string, data: object) {\n debug(content`Copying template from directory ${token.path(from)} to ${token.path(to)}`)\n const templateFiles: string[] = await glob(join(from, '**/*'), {dot: true})\n\n const sortedTemplateFiles = templateFiles\n .map((path) => path.split('/'))\n .sort((lhs, rhs) => (lhs.length < rhs.length ? 1 : -1))\n .map((components) => components.join('/'))\n await Promise.all(\n sortedTemplateFiles.map(async (templateItemPath) => {\n const outputPath = await create(join(to, relative(from, templateItemPath)))(data)\n if (await isDirectory(templateItemPath)) {\n await mkdir(outputPath)\n } else if (templateItemPath.endsWith('.liquid')) {\n await mkdir(dirname(outputPath))\n const content = await read(templateItemPath)\n const contentOutput = await create(content)(data)\n const isExecutable = await hasExecutablePermissions(templateItemPath)\n const outputPathWithoutLiquid = outputPath.replace('.liquid', '')\n await copy(templateItemPath, outputPathWithoutLiquid)\n await write(outputPathWithoutLiquid, contentOutput)\n if (isExecutable) {\n await chmod(outputPathWithoutLiquid, 0o755)\n }\n } else {\n await copy(templateItemPath, outputPath)\n }\n }),\n )\n}\n"]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as output from '../output.js';
|
|
2
|
+
export function mockAndCaptureOutput() {
|
|
3
|
+
return {
|
|
4
|
+
output: () => output.collectedLogs.output.join('\n'),
|
|
5
|
+
info: () => output.collectedLogs.info.join('\n'),
|
|
6
|
+
debug: () => output.collectedLogs.debug.join('\n'),
|
|
7
|
+
success: () => output.collectedLogs.success.join('\n'),
|
|
8
|
+
completed: () => output.collectedLogs.completed.join('\n'),
|
|
9
|
+
warn: () => output.collectedLogs.warn.join('\n'),
|
|
10
|
+
clear: () => {
|
|
11
|
+
output.clearCollectedLogs();
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=output.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"output.js","sourceRoot":"","sources":["../../src/testing/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,cAAc,CAAA;AAEtC,MAAM,UAAU,oBAAoB;IAClC,OAAO;QACL,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;QACpD,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QAChD,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;QAClD,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QACtD,SAAS,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;QAC1D,IAAI,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;QAChD,KAAK,EAAE,GAAG,EAAE;YACV,MAAM,CAAC,kBAAkB,EAAE,CAAA;QAC7B,CAAC;KACF,CAAA;AACH,CAAC","sourcesContent":["import * as output from '../output.js'\n\nexport function mockAndCaptureOutput() {\n return {\n output: () => output.collectedLogs.output.join('\\n'),\n info: () => output.collectedLogs.info.join('\\n'),\n debug: () => output.collectedLogs.debug.join('\\n'),\n success: () => output.collectedLogs.success.join('\\n'),\n completed: () => output.collectedLogs.completed.join('\\n'),\n warn: () => output.collectedLogs.warn.join('\\n'),\n clear: () => {\n output.clearCollectedLogs()\n },\n }\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CLIKitStore } from '../store.js';
|
|
2
|
+
/**
|
|
3
|
+
* Creates a temporary configuration store and ties its lifecycle to the callback.
|
|
4
|
+
* @param callback {(string) => void} Callback to execute. When the callback exits, the local config is destroyed.
|
|
5
|
+
* @returns {Promise<T>} Promise that resolves with the value returned by the callback.
|
|
6
|
+
*/
|
|
7
|
+
export declare function temporaryTestStore<T>(callback: (store: CLIKitStore) => Promise<T>): Promise<T>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CLIKitStore } from '../store.js';
|
|
2
|
+
import { remove } from '../file.js';
|
|
3
|
+
import uniqueString from 'unique-string';
|
|
4
|
+
/**
|
|
5
|
+
* Creates a temporary configuration store and ties its lifecycle to the callback.
|
|
6
|
+
* @param callback {(string) => void} Callback to execute. When the callback exits, the local config is destroyed.
|
|
7
|
+
* @returns {Promise<T>} Promise that resolves with the value returned by the callback.
|
|
8
|
+
*/
|
|
9
|
+
export async function temporaryTestStore(callback) {
|
|
10
|
+
let localConf;
|
|
11
|
+
try {
|
|
12
|
+
const name = `shopify-cli-test-${uniqueString()}`;
|
|
13
|
+
localConf = new CLIKitStore({ projectName: name });
|
|
14
|
+
// eslint-disable-next-line node/callback-return
|
|
15
|
+
const result = callback(localConf);
|
|
16
|
+
return result;
|
|
17
|
+
}
|
|
18
|
+
finally {
|
|
19
|
+
if (localConf) {
|
|
20
|
+
await remove(localConf.path);
|
|
21
|
+
const configFolder = localConf.path.replace(/\/config.json$/, '');
|
|
22
|
+
await remove(configFolder);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/testing/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,aAAa,CAAA;AACvC,OAAO,EAAC,MAAM,EAAC,MAAM,YAAY,CAAA;AACjC,OAAO,YAAY,MAAM,eAAe,CAAA;AAExC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,kBAAkB,CAAI,QAA4C;IACtF,IAAI,SAAkC,CAAA;IACtC,IAAI;QACF,MAAM,IAAI,GAAG,oBAAoB,YAAY,EAAE,EAAE,CAAA;QACjD,SAAS,GAAG,IAAI,WAAW,CAAC,EAAC,WAAW,EAAE,IAAI,EAAC,CAAC,CAAA;QAChD,gDAAgD;QAChD,MAAM,MAAM,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAA;QAClC,OAAO,MAAM,CAAA;KACd;YAAS;QACR,IAAI,SAAS,EAAE;YACb,MAAM,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;YAC5B,MAAM,YAAY,GAAG,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC,CAAA;YACjE,MAAM,MAAM,CAAC,YAAY,CAAC,CAAA;SAC3B;KACF;AACH,CAAC","sourcesContent":["import {CLIKitStore} from '../store.js'\nimport {remove} from '../file.js'\nimport uniqueString from 'unique-string'\n\n/**\n * Creates a temporary configuration store and ties its lifecycle to the callback.\n * @param callback {(string) => void} Callback to execute. When the callback exits, the local config is destroyed.\n * @returns {Promise<T>} Promise that resolves with the value returned by the callback.\n */\nexport async function temporaryTestStore<T>(callback: (store: CLIKitStore) => Promise<T>): Promise<T> {\n let localConf: CLIKitStore | undefined\n try {\n const name = `shopify-cli-test-${uniqueString()}`\n localConf = new CLIKitStore({projectName: name})\n // eslint-disable-next-line node/callback-return\n const result = callback(localConf)\n return result\n } finally {\n if (localConf) {\n await remove(localConf.path)\n const configFolder = localConf.path.replace(/\\/config.json$/, '')\n await remove(configFolder)\n }\n }\n}\n"]}
|
package/dist/toml.d.ts
ADDED
package/dist/toml.js
ADDED
package/dist/toml.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toml.js","sourceRoot":"","sources":["../src/toml.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,aAAa,CAAA;AAEnC,MAAM,UAAU,MAAM,CAAC,KAAa;IAClC,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;AAC1B,CAAC;AAED,MAAM,UAAU,MAAM,CAAC,OAAqB;IAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAA;AAChC,CAAC","sourcesContent":["import * as toml from '@iarna/toml'\n\nexport function decode(input: string): object {\n return toml.parse(input)\n}\n\nexport function encode(content: toml.JsonMap): string {\n return toml.stringify(content)\n}\n"]}
|