@shopify/cli 3.0.23 → 3.0.26

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +38 -0
  2. package/README.md +56 -0
  3. package/dist/cli/commands/auth/logout.d.ts +5 -0
  4. package/dist/cli/commands/auth/logout.js +11 -0
  5. package/dist/cli/commands/auth/logout.js.map +1 -0
  6. package/dist/cli/commands/editions.d.ts +6 -0
  7. package/dist/cli/commands/editions.js +93 -0
  8. package/dist/cli/commands/editions.js.map +1 -0
  9. package/dist/cli/commands/logs.d.ts +5 -0
  10. package/dist/cli/commands/logs.js +9 -0
  11. package/dist/cli/commands/logs.js.map +1 -0
  12. package/dist/cli/commands/upgrade.d.ts +13 -0
  13. package/dist/cli/commands/upgrade.js +66 -0
  14. package/dist/cli/commands/upgrade.js.map +1 -0
  15. package/dist/cli/commands/version.d.ts +6 -0
  16. package/dist/cli/commands/version.js +18 -0
  17. package/dist/cli/commands/version.js.map +1 -0
  18. package/dist/hooks/postrun.d.ts +2 -0
  19. package/dist/hooks/postrun.js +4 -7
  20. package/dist/hooks/postrun.js.map +1 -1
  21. package/dist/hooks/prerun.d.ts +2 -0
  22. package/dist/hooks/prerun.js +8 -0
  23. package/dist/hooks/prerun.js.map +1 -0
  24. package/dist/index.d.ts +2 -0
  25. package/dist/index.js +7 -48
  26. package/dist/index.js.map +1 -1
  27. package/dist/tsconfig.tsbuildinfo +1 -0
  28. package/package.json +11 -7
  29. package/dist/commands/auth/logout.js +0 -14
  30. package/dist/commands/auth/logout.js.map +0 -1
  31. package/dist/commands/editions.js +0 -104
  32. package/dist/commands/editions.js.map +0 -1
  33. package/dist/commands/logs.js +0 -12
  34. package/dist/commands/logs.js.map +0 -1
  35. package/dist/commands/upgrade.js +0 -70
  36. package/dist/commands/upgrade.js.map +0 -1
  37. package/dist/commands/version.js +0 -22
  38. package/dist/commands/version.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,43 @@
1
1
  # @shopify/cli
2
2
 
3
+ ## 3.0.26
4
+
5
+ ### Patch Changes
6
+
7
+ - 022a4e24: Internal: build cli-kit using tsc instead of rollup+esbuild
8
+ - e81e52b1: Report error events
9
+ - 168bb4c6: Add total time to analytics reports
10
+ - Updated dependencies [dbcffdbb]
11
+ - Updated dependencies [022a4e24]
12
+ - Updated dependencies [e81e52b1]
13
+ - Updated dependencies [c16035f1]
14
+ - Updated dependencies [61f595df]
15
+ - Updated dependencies [87f7843f]
16
+ - Updated dependencies [8ff4e3d7]
17
+ - Updated dependencies [168bb4c6]
18
+ - Updated dependencies [0a9dbc63]
19
+ - Updated dependencies [2d8e4458]
20
+ - @shopify/cli-kit@3.0.26
21
+
22
+ ## 3.0.25
23
+
24
+ ### Patch Changes
25
+
26
+ - a6ea9c8d: Fix shopify upgrade
27
+ - Updated dependencies [a6ea9c8d]
28
+ - Updated dependencies [822d0fd3]
29
+ - Updated dependencies [bf8137c2]
30
+ - Updated dependencies [e650b499]
31
+ - Updated dependencies [3360289d]
32
+ - Updated dependencies [2a666db7]
33
+ - @shopify/cli-kit@3.0.25
34
+
35
+ ## 3.0.24
36
+
37
+ ### Patch Changes
38
+
39
+ - @shopify/cli-kit@3.0.24
40
+
3
41
  ## 3.0.23
4
42
 
5
43
  ### Patch Changes
package/README.md ADDED
@@ -0,0 +1,56 @@
1
+ <img src="https://github.com/Shopify/cli/blob/main/assets/logo.png?raw=true" width="150"/>
2
+
3
+ # Shopify CLI
4
+ <a href="http://twitter.com/ShopifyDevs"><img src="https://img.shields.io/twitter/follow/ShopifyDevs?style=flat-square" alt="Twitter Followers"></a>
5
+ <img src="https://img.shields.io/badge/License-MIT-green.svg" alt="License">
6
+ <a href="https://github.com/Shopify/cli/actions/workflows/shopify-cli.yml">![badge](https://github.com/Shopify/cli/actions/workflows/shopify-cli.yml/badge.svg)</a>
7
+
8
+ With the Shopify command line interface (Shopify CLI 3.0), you can:
9
+ - build custom storefronts and manage their hosting
10
+ - initialize, build, dev, and deploy Shopify apps — and scaffold app extensions
11
+
12
+ <p>&nbsp;</p>
13
+
14
+ ### Before you begin ###
15
+
16
+ Install the latest version of [Node.js](https://nodejs.org/en/download/) and [npm](https://docs.npmjs.com/getting-started) (or another package manager of your choice).
17
+
18
+ <p>&nbsp;</p>
19
+
20
+ ## Developing apps with Shopify CLI
21
+
22
+ When you’re building a Shopify app, you can initialize your project using your preferred package manager. A single command will install all the dependencies you need — including Shopify CLI itself.
23
+
24
+ Initialize your project using one of the following commands:
25
+ - `npx @shopify/create-app@latest` (installed by default with Node)
26
+ - `pnpm create @shopify/create-app@latest`
27
+ - `yarn create @shopify/app`
28
+
29
+ Learn more in the docs: [Create an app](https://shopify.dev/apps/getting-started/create)
30
+
31
+ <p>&nbsp;</p>
32
+
33
+ ## Developing Hydrogen custom storefronts with Shopify CLI ##
34
+
35
+ When you’re building a custom storefront, use Hydrogen, Shopify’s React-based framework optimized for headless commerce. Initialize a new Hydrogen app with a fully-featured Demo Store template, or start from scratch with the minimal Hello World template. Shopify Plus stores can deploy their Hydrogen apps to Oxygen, Shopify’s global hosting solution, at no extra cost.
36
+
37
+ Get started using one of the following commands:
38
+ - `npm init @shopify/hydrogen@latest`
39
+ - `npx @shopify/create-hydrogen@latest`
40
+ - `pnpm create @shopify/create-hydrogen@latest`
41
+ - `yarn create @shopify/hydrogen`
42
+
43
+ <p>&nbsp;</p>
44
+
45
+ ## Help 🖐
46
+
47
+ If you encounter issues using the CLI or have feedback you'd like to share with us, below are some options:
48
+
49
+ - [Open a GitHub issue](https://github.com/Shopify/cli/issues) - To report bugs or request new features, open an issue in the Shopify CLI repository.
50
+ - [Shopify Community Forums](https://community.shopify.com/) - Visit our forums to connect with the community and learn more about Shopify CLI development.
51
+
52
+ <p>&nbsp;</p>
53
+
54
+ ## References
55
+
56
+ - [oclif](https://oclif.io/)
@@ -0,0 +1,5 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Logout extends Command {
3
+ static description: string;
4
+ run(): Promise<void>;
5
+ }
@@ -0,0 +1,11 @@
1
+ import { Command } from '@oclif/core';
2
+ import { output, session, store } from '@shopify/cli-kit';
3
+ export default class Logout extends Command {
4
+ async run() {
5
+ await session.logout();
6
+ store.cliKitStore().removeSession();
7
+ output.success('Logged out from Shopify');
8
+ }
9
+ }
10
+ Logout.description = 'Logout from Shopify';
11
+ //# sourceMappingURL=logout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logout.js","sourceRoot":"","sources":["../../../../src/cli/commands/auth/logout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAA;AACnC,OAAO,EAAC,MAAM,EAAE,OAAO,EAAE,KAAK,EAAC,MAAM,kBAAkB,CAAA;AAEvD,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,OAAO;IAGzC,KAAK,CAAC,GAAG;QACP,MAAM,OAAO,CAAC,MAAM,EAAE,CAAA;QACtB,KAAK,CAAC,WAAW,EAAE,CAAC,aAAa,EAAE,CAAA;QACnC,MAAM,CAAC,OAAO,CAAC,yBAAyB,CAAC,CAAA;IAC3C,CAAC;;AANM,kBAAW,GAAG,qBAAqB,CAAA","sourcesContent":["import {Command} from '@oclif/core'\nimport {output, session, store} from '@shopify/cli-kit'\n\nexport default class Logout extends Command {\n static description = 'Logout from Shopify'\n\n async run(): Promise<void> {\n await session.logout()\n store.cliKitStore().removeSession()\n output.success('Logged out from Shopify')\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Editions extends Command {
3
+ static description: string;
4
+ static hidden: boolean;
5
+ run(): Promise<void>;
6
+ }
@@ -0,0 +1,93 @@
1
+ import { Command } from '@oclif/core';
2
+ import { output, ui } from '@shopify/cli-kit';
3
+ const subcommands = {
4
+ bfs: () => {
5
+ output.info(unindent(`
6
+ - Built for Shopify: Build great commerce apps that look and perform like they’re part of Shopify
7
+ - Shopify Functions: New ways to extend Shopify: Build custom discounts, shipping, and payments
8
+ - Checkout Extensibility: Apps for checkout are here: Powerful customizations that work with Shop Pay
9
+ `));
10
+ output.info(`\n\n`);
11
+ output.info(output.content `${output.token.yellow('Read more here: https://shopify.com/editions/dev#chapter-1')}`);
12
+ },
13
+ devtools: () => {
14
+ output.info(unindent(`
15
+ - Developer Experience: Simplified updates to write and distribute an app
16
+ - Embedded App Improvements: Offer a truly seamless app experience
17
+ - Data Protection: Future-proof the apps you build
18
+ `));
19
+ output.info(`\n\n`);
20
+ output.info(output.content `${output.token.yellow('Read more here: https://shopify.com/editions/dev#chapter-2')}`);
21
+ },
22
+ hydrogen: () => {
23
+ output.info(unindent(`
24
+ - Hydrogen + Oxygen: The Shopify stack for headless commerce
25
+ - Pixels: Intelligent interactions—powered by secure data
26
+ - Marketplace Kit: Add commerce to any platform
27
+ `));
28
+ output.info(`\n\n`);
29
+ output.info(output.content `${output.token.yellow('Read more here: https://shopify.com/editions/dev#chapter-3')}`);
30
+ },
31
+ };
32
+ export default class Editions extends Command {
33
+ async run() {
34
+ output.info(output.content `${output.token.green(unindent(`
35
+ _____ __ _ ____ ______ ___ __ _
36
+ / ___// /_ ____ ____ (_) __/_ __ / ____/___/ (_) /_(_)___ ____ _____
37
+ \\__ \\/ __ \\/ __ \\/ __ \\/ / /_/ / / / / __/ / __ / / __/ / __ \\/ __ \\/ ___/
38
+ ___/ / / / / /_/ / /_/ / / __/ /_/ / / /___/ /_/ / / /_/ / /_/ / / / (__ )
39
+ /____/_/ /_/\\____/ .___/_/_/ \\__, / /_____/\\__,_/_/\\__/_/\\____/_/ /_/____/
40
+ /_/ /____/
41
+ ____ __ ___ __
42
+ / __ \\___ _ __ / |/ /___ ____/ /__
43
+ / / / / _ \\ | / / / /|_/ / __ \\/ __ / _ \\
44
+ / /_/ / __/ |/ / / / / / /_/ / /_/ / __/
45
+ /_____/\\___/|___/ /_/ /_/\\____/\\__,_/\\___/
46
+ `))}`);
47
+ output.info(unindent(`
48
+
49
+
50
+ Welcome to Dev Mode for the Summer 2022 Edition
51
+ https://shopify.com/editions/dev
52
+
53
+
54
+ `));
55
+ const answer = await ui.prompt([
56
+ {
57
+ name: 'editionschoice',
58
+ type: 'select',
59
+ message: 'What are you looking to solve?',
60
+ choices: [
61
+ {
62
+ value: 'bfs',
63
+ name: 'NEW WAYS TO BUILD GREAT APPS',
64
+ },
65
+ {
66
+ value: 'devtools',
67
+ name: 'IMPROVED DEV TOOLS',
68
+ },
69
+ {
70
+ value: 'hydrogen',
71
+ name: 'NEXT LEVEL STOREFRONT BUILDING',
72
+ },
73
+ ],
74
+ },
75
+ ]);
76
+ await subcommands[answer.editionschoice]?.();
77
+ output.info(`\n\n\n`);
78
+ }
79
+ }
80
+ Editions.description = 'Shopify editions';
81
+ Editions.hidden = true;
82
+ function unindent(value) {
83
+ const lines = value.split('\n');
84
+ // Remove empty lines at start and end
85
+ if (lines[0].trim() === '')
86
+ lines.shift();
87
+ if (lines.at(-1)?.trim() === '')
88
+ lines.pop();
89
+ const nonEmptyLines = lines.filter((line) => line.trim().length > 0);
90
+ const numSpacesToCut = Math.min(...nonEmptyLines.map((line) => (/^[\s]*[^\s]/.exec(line)?.[0].length || 1) - 1));
91
+ return lines.map((line) => line.slice(numSpacesToCut)).join('\n');
92
+ }
93
+ //# sourceMappingURL=editions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editions.js","sourceRoot":"","sources":["../../../src/cli/commands/editions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAA;AACnC,OAAO,EAAC,MAAM,EAAE,EAAE,EAAC,MAAM,kBAAkB,CAAA;AAI3C,MAAM,WAAW,GAAkD;IACjE,GAAG,EAAE,GAAG,EAAE;QACR,MAAM,CAAC,IAAI,CACT,QAAQ,CAAC;;;;OAIR,CAAC,CACH,CAAA;QACD,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QACnB,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,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opify/cli-kit'\n\ntype Choice = 'bfs' | 'hydrogen' | 'devtools'\n\nconst subcommands: {[key in Choice]: () => void | Promise<void>} = {\n bfs: () => {\n output.info(\n unindent(`\n - Built for Shopify: Build great commerce apps that look and perform like they’re part of Shopify\n - Shopify Functions: New ways to extend Shopify: Build custom discounts, shipping, and payments\n - Checkout Extensibility: Apps for checkout are here: Powerful customizations that work with Shop Pay\n `),\n )\n output.info(`\\n\\n`)\n output.info(output.content`${output.token.yellow('Read more here: https://shopify.com/editions/dev#chapter-1')}`)\n },\n devtools: () => {\n output.info(\n unindent(`\n - Developer Experience: Simplified updates to write and distribute an app\n - Embedded App Improvements: Offer a truly seamless app experience\n - Data Protection: Future-proof the apps you build\n `),\n )\n output.info(`\\n\\n`)\n output.info(output.content`${output.token.yellow('Read more here: https://shopify.com/editions/dev#chapter-2')}`)\n },\n hydrogen: () => {\n output.info(\n unindent(`\n - Hydrogen + Oxygen: The Shopify stack for headless commerce\n - Pixels: Intelligent interactions—powered by secure data\n - Marketplace Kit: Add commerce to any platform\n `),\n )\n output.info(`\\n\\n`)\n output.info(output.content`${output.token.yellow('Read more here: https://shopify.com/editions/dev#chapter-3')}`)\n },\n}\nexport default class Editions extends Command {\n static description = 'Shopify editions'\n static hidden = true\n\n async run(): Promise<void> {\n output.info(\n output.content`${output.token.green(\n unindent(`\n _____ __ _ ____ ______ ___ __ _\n / ___// /_ ____ ____ (_) __/_ __ / ____/___/ (_) /_(_)___ ____ _____\n \\\\__ \\\\/ __ \\\\/ __ \\\\/ __ \\\\/ / /_/ / / / / __/ / __ / / __/ / __ \\\\/ __ \\\\/ ___/\n ___/ / / / / /_/ / /_/ / / __/ /_/ / / /___/ /_/ / / /_/ / /_/ / / / (__ )\n /____/_/ /_/\\\\____/ .___/_/_/ \\\\__, / /_____/\\\\__,_/_/\\\\__/_/\\\\____/_/ /_/____/\n /_/ /____/\n ____ __ ___ __\n / __ \\\\___ _ __ / |/ /___ ____/ /__\n / / / / _ \\\\ | / / / /|_/ / __ \\\\/ __ / _ \\\\\n / /_/ / __/ |/ / / / / / /_/ / /_/ / __/\n /_____/\\\\___/|___/ /_/ /_/\\\\____/\\\\__,_/\\\\___/\n `),\n )}`,\n )\n\n output.info(\n unindent(`\n\n\n Welcome to Dev Mode for the Summer 2022 Edition\n https://shopify.com/editions/dev\n\n\n `),\n )\n\n const answer: {editionschoice: Choice} = await ui.prompt([\n {\n name: 'editionschoice',\n type: 'select',\n message: 'What are you looking to solve?',\n choices: [\n {\n value: 'bfs',\n name: 'NEW WAYS TO BUILD GREAT APPS',\n },\n {\n value: 'devtools',\n name: 'IMPROVED DEV TOOLS',\n },\n {\n value: 'hydrogen',\n name: 'NEXT LEVEL STOREFRONT BUILDING',\n },\n ],\n },\n ])\n\n await subcommands[answer.editionschoice]?.()\n output.info(`\\n\\n\\n`)\n }\n}\n\nfunction unindent(value: string): string {\n const lines = value.split('\\n')\n // Remove empty lines at start and end\n if (lines[0].trim() === '') lines.shift()\n if (lines.at(-1)?.trim() === '') lines.pop()\n const nonEmptyLines = lines.filter((line) => line.trim().length > 0)\n const numSpacesToCut = Math.min(...nonEmptyLines.map((line) => (/^[\\s]*[^\\s]/.exec(line)?.[0].length || 1) - 1))\n return lines.map((line) => line.slice(numSpacesToCut)).join('\\n')\n}\n"]}
@@ -0,0 +1,5 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Logs extends Command {
3
+ static description: string;
4
+ run(): Promise<void>;
5
+ }
@@ -0,0 +1,9 @@
1
+ import { Command } from '@oclif/core';
2
+ import { output } from '@shopify/cli-kit';
3
+ export default class Logs extends Command {
4
+ async run() {
5
+ await output.pageLogs();
6
+ }
7
+ }
8
+ Logs.description = 'View full debug logs from the Shopify CLI';
9
+ //# sourceMappingURL=logs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logs.js","sourceRoot":"","sources":["../../../src/cli/commands/logs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAA;AACnC,OAAO,EAAC,MAAM,EAAC,MAAM,kBAAkB,CAAA;AAEvC,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,OAAO;IAGvC,KAAK,CAAC,GAAG;QACP,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAA;IACzB,CAAC;;AAJM,gBAAW,GAAG,2CAA2C,CAAA","sourcesContent":["import {Command} from '@oclif/core'\nimport {output} from '@shopify/cli-kit'\n\nexport default class Logs extends Command {\n static description = 'View full debug logs from the Shopify CLI'\n\n async run(): Promise<void> {\n await output.pageLogs()\n }\n}\n"]}
@@ -0,0 +1,13 @@
1
+ import { Command } from '@oclif/core';
2
+ import { dependency } from '@shopify/cli-kit';
3
+ export default class Upgrade extends Command {
4
+ static description: string;
5
+ static flags: {
6
+ path: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
7
+ };
8
+ run(): Promise<void>;
9
+ getProjectDir(directory: string): Promise<string | undefined>;
10
+ installJsonDependencies(depsEnv: dependency.DependencyType, deps: {
11
+ [key: string]: string;
12
+ }, directory: string): Promise<void>;
13
+ }
@@ -0,0 +1,66 @@
1
+ import { Command, Flags } from '@oclif/core';
2
+ import { dependency, error, file, output, path } from '@shopify/cli-kit';
3
+ export default class Upgrade extends Command {
4
+ async run() {
5
+ const { flags } = await this.parse(Upgrade);
6
+ const directory = flags.path ? path.resolve(flags.path) : process.cwd();
7
+ const projectDir = await this.getProjectDir(directory);
8
+ if (!projectDir) {
9
+ throw new error.Abort(output.content `Couldn't find the configuration file for ${output.token.path(directory)}, are you in a Shopify project directory?`);
10
+ }
11
+ const packageJson = JSON.parse(await file.read(path.join(projectDir, 'package.json')));
12
+ const packageJsonDependencies = packageJson.dependencies || {};
13
+ const packageJsonDevDependencies = packageJson.devDependencies || {};
14
+ const cliDependency = '@shopify/cli';
15
+ let currentVersion = { ...packageJsonDependencies, ...packageJsonDevDependencies }[cliDependency];
16
+ if (currentVersion.slice(0, 1).match(/[\^~]/))
17
+ currentVersion = this.config.version;
18
+ const newestVersion = await dependency.checkForNewVersion(cliDependency, currentVersion);
19
+ if (!newestVersion) {
20
+ output.info(output.content `You're on the latest version, ${output.token.yellow(currentVersion)}, no need to upgrade!`);
21
+ return;
22
+ }
23
+ output.info(output.content `Upgrading CLI from ${output.token.yellow(currentVersion)} to ${output.token.yellow(newestVersion)}...`);
24
+ await this.installJsonDependencies('prod', packageJsonDependencies, projectDir);
25
+ await this.installJsonDependencies('dev', packageJsonDevDependencies, projectDir);
26
+ output.success(`Upgraded Shopify CLI to version ${newestVersion}`);
27
+ }
28
+ async getProjectDir(directory) {
29
+ return path.findUp(async (dir) => {
30
+ const configFilesExist = await Promise.all(['shopify.app.toml', 'hydrogen.config.js', 'hydrogen.config.ts'].map(async (configFile) => {
31
+ return file.exists(path.join(dir, configFile));
32
+ }));
33
+ if (configFilesExist.some((bool) => bool))
34
+ return dir;
35
+ }, {
36
+ cwd: directory,
37
+ type: 'directory',
38
+ });
39
+ }
40
+ async installJsonDependencies(depsEnv, deps, directory) {
41
+ const packages = ['@shopify/cli', '@shopify/app', '@shopify/cli-hydrogen'];
42
+ const packagesToUpdate = packages.filter((pkg) => {
43
+ const pkgRequirement = deps[pkg];
44
+ return Boolean(pkgRequirement);
45
+ });
46
+ if (packagesToUpdate.length > 0) {
47
+ await dependency.addLatestNPMDependencies(packagesToUpdate, {
48
+ dependencyManager: await dependency.getDependencyManager(directory),
49
+ type: depsEnv,
50
+ directory,
51
+ stdout: process.stdout,
52
+ stderr: process.stderr,
53
+ });
54
+ }
55
+ }
56
+ }
57
+ Upgrade.description = 'Upgrade the Shopify CLI';
58
+ Upgrade.flags = {
59
+ path: Flags.string({
60
+ hidden: false,
61
+ description: 'The path to your project directory.',
62
+ parse: (input, _) => Promise.resolve(path.resolve(input)),
63
+ env: 'SHOPIFY_FLAG_PATH',
64
+ }),
65
+ };
66
+ //# sourceMappingURL=upgrade.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upgrade.js","sourceRoot":"","sources":["../../../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AO,GAAG,CAAA;QACvD,CAAC,EACD;YACE,GAAG,EAAE,SAAS;YACd,IAAI,EAAE,WAAW;SAClB,CACF,CAAA;IACH,CAAC;IAED,KAAK,CAAC,uBAAuB,CAC3B,OAAkC,EAClC,IAA6B,EAC7B,SAAiB;QAEjB,MAAM,QAAQ,GAAG,CAAC,cAAc,EAAE,cAAc,EAAE,uBAAuB,CAAC,CAAA;QAC1E,MAAM,gBAAgB,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC,GAAW,EAAW,EAAE;YAChE,MAAM,cAAc,GAAuB,IAAI,CAAC,GAAG,CAAC,CAAA;YACpD,OAAO,OAAO,CAAC,cAAc,CAAC,CAAA;QAChC,CAAC,CAAC,CAAA;QAEF,IAAI,gBAAgB,CAAC,MAAM,GAAG,CAAC,EAAE;YAC/B,MAAM,UAAU,CAAC,wBAAwB,CAAC,gBAAgB,EAAE;gBAC1D,iBAAiB,EAAE,MAAM,UAAU,CAAC,oBAAoB,CAAC,SAAS,CAAC;gBACnE,IAAI,EAAE,OAAO;gBACb,SAAS;gBACT,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,MAAM,EAAE,OAAO,CAAC,MAAM;aACvB,CAAC,CAAA;SACH;IACH,CAAC;;AAxFM,mBAAW,GAAG,yBAAyB,CAAA;AAEvC,aAAK,GAAG;IACb,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;QACjB,MAAM,EAAE,KAAK;QACb,WAAW,EAAE,qCAAqC;QAClD,KAAK,EAAE,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACzD,GAAG,EAAE,mBAAmB;KACzB,CAAC;CACH,CAAA","sourcesContent":["import {Command, Flags} from '@oclif/core'\nimport {dependency, error, file, output, path} from '@shopify/cli-kit'\n\nexport default class Upgrade extends Command {\n static description = 'Upgrade the Shopify CLI'\n\n static flags = {\n path: Flags.string({\n hidden: false,\n description: 'The path to your project directory.',\n parse: (input, _) => Promise.resolve(path.resolve(input)),\n env: 'SHOPIFY_FLAG_PATH',\n }),\n }\n\n async run(): Promise<void> {\n const {flags} = await this.parse(Upgrade)\n const directory = flags.path ? path.resolve(flags.path) : process.cwd()\n\n const projectDir = await this.getProjectDir(directory)\n if (!projectDir) {\n throw new error.Abort(\n output.content`Couldn't find the configuration file for ${output.token.path(\n directory,\n )}, are you in a Shopify project directory?`,\n )\n }\n const packageJson = JSON.parse(await file.read(path.join(projectDir, 'package.json')))\n const packageJsonDependencies: {[key: string]: string} = packageJson.dependencies || {}\n const packageJsonDevDependencies: {[key: string]: string} = packageJson.devDependencies || {}\n\n const cliDependency = '@shopify/cli'\n let currentVersion: string = {...packageJsonDependencies, ...packageJsonDevDependencies}[cliDependency]\n if (currentVersion.slice(0, 1).match(/[\\^~]/)) currentVersion = this.config.version\n const newestVersion = await dependency.checkForNewVersion(cliDependency, currentVersion)\n\n if (!newestVersion) {\n output.info(\n output.content`You're on the latest version, ${output.token.yellow(currentVersion)}, no need to upgrade!`,\n )\n return\n }\n\n output.info(\n output.content`Upgrading CLI from ${output.token.yellow(currentVersion)} to ${output.token.yellow(\n newestVersion,\n )}...`,\n )\n\n await this.installJsonDependencies('prod', packageJsonDependencies, projectDir)\n await this.installJsonDependencies('dev', packageJsonDevDependencies, projectDir)\n\n output.success(`Upgraded Shopify CLI to version ${newestVersion}`)\n }\n\n async getProjectDir(directory: string) {\n return path.findUp(\n async (dir: string) => {\n const configFilesExist = await Promise.all(\n ['shopify.app.toml', 'hydrogen.config.js', 'hydrogen.config.ts'].map(async (configFile) => {\n return file.exists(path.join(dir, configFile))\n }),\n )\n if (configFilesExist.some((bool) => bool)) return dir\n },\n {\n cwd: directory,\n type: 'directory',\n },\n )\n }\n\n async installJsonDependencies(\n depsEnv: dependency.DependencyType,\n deps: {[key: string]: string},\n directory: string,\n ): Promise<void> {\n const packages = ['@shopify/cli', '@shopify/app', '@shopify/cli-hydrogen']\n const packagesToUpdate = packages.filter((pkg: string): boolean => {\n const pkgRequirement: string | undefined = deps[pkg]\n return Boolean(pkgRequirement)\n })\n\n if (packagesToUpdate.length > 0) {\n await dependency.addLatestNPMDependencies(packagesToUpdate, {\n dependencyManager: await dependency.getDependencyManager(directory),\n type: depsEnv,\n directory,\n stdout: process.stdout,\n stderr: process.stderr,\n })\n }\n }\n}\n"]}
@@ -0,0 +1,6 @@
1
+ import { Command } from '@oclif/core';
2
+ export default class Version extends Command {
3
+ static description: string;
4
+ run(): Promise<void>;
5
+ getCurrentVersion(): string;
6
+ }
@@ -0,0 +1,18 @@
1
+ import { Command } from '@oclif/core';
2
+ import { output, dependency } from '@shopify/cli-kit';
3
+ export default class Version extends Command {
4
+ async run() {
5
+ const cliDependency = '@shopify/cli';
6
+ const currentVersion = this.getCurrentVersion();
7
+ output.info(output.content `Current ${Version.description}: ${output.token.yellow(currentVersion)}`.value);
8
+ const lastVersion = await dependency.checkForNewVersion(cliDependency, currentVersion);
9
+ if (lastVersion) {
10
+ output.info(dependency.getOutputUpdateCLIReminder(dependency.dependencyManagerUsedForCreating(), lastVersion));
11
+ }
12
+ }
13
+ getCurrentVersion() {
14
+ return this.config.version;
15
+ }
16
+ }
17
+ Version.description = 'Shopify CLI version';
18
+ //# sourceMappingURL=version.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../../src/cli/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,aAAa,CAAA;AACnC,OAAO,EAAC,MAAM,EAAE,UAAU,EAAC,MAAM,kBAAkB,CAAA;AAEnD,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,OAAO;IAG1C,KAAK,CAAC,GAAG;QACP,MAAM,aAAa,GAAG,cAAc,CAAA;QACpC,MAAM,cAAc,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAA;QAC/C,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA,WAAW,OAAO,CAAC,WAAW,KAAK,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE,CAAC,KAAK,CAAC,CAAA;QACzG,MAAM,WAAW,GAAG,MAAM,UAAU,CAAC,kBAAkB,CAAC,aAAa,EAAE,cAAc,CAAC,CAAA;QACtF,IAAI,WAAW,EAAE;YACf,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,0BAA0B,CAAC,UAAU,CAAC,gCAAgC,EAAE,EAAE,WAAW,CAAC,CAAC,CAAA;SAC/G;IACH,CAAC;IAED,iBAAiB;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,CAAA;IAC5B,CAAC;;AAdM,mBAAW,GAAG,qBAAqB,CAAA","sourcesContent":["import {Command} from '@oclif/core'\nimport {output, dependency} from '@shopify/cli-kit'\n\nexport default class Version extends Command {\n static description = 'Shopify CLI version'\n\n async run(): Promise<void> {\n const cliDependency = '@shopify/cli'\n const currentVersion = this.getCurrentVersion()\n output.info(output.content`Current ${Version.description}: ${output.token.yellow(currentVersion)}`.value)\n const lastVersion = await dependency.checkForNewVersion(cliDependency, currentVersion)\n if (lastVersion) {\n output.info(dependency.getOutputUpdateCLIReminder(dependency.dependencyManagerUsedForCreating(), lastVersion))\n }\n }\n\n getCurrentVersion(): string {\n return this.config.version\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { Hook } from '@oclif/core';
2
+ export declare const hook: Hook.Postrun;
@@ -1,9 +1,6 @@
1
1
  import { analytics } from '@shopify/cli-kit';
2
-
3
- const hook = async (options) => {
4
- const command = options.Command.id.replace(/:/g, " ");
5
- await analytics.reportEvent(command, options.argv);
2
+ // This hook is called after each successful command run. More info: https://oclif.io/docs/hooks
3
+ export const hook = async (_options) => {
4
+ await analytics.reportEvent();
6
5
  };
7
-
8
- export { hook };
9
- //# sourceMappingURL=postrun.js.map
6
+ //# sourceMappingURL=postrun.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"postrun.js","sources":["../../src/hooks/postrun.ts"],"sourcesContent":["import {analytics} from '@shopify/cli-kit'\nimport {Hook} from '@oclif/core'\n\n// This hook is called after each successful command run. More info: https://oclif.io/docs/hooks\nexport const hook: Hook.Postrun = async (options) => {\n const command = options.Command.id.replace(/:/g, ' ')\n await analytics.reportEvent(command, options.argv)\n}\n"],"names":[],"mappings":";;AAIa,MAAA,IAAA,GAAqB,OAAO,OAAY,KAAA;AACnD,EAAA,MAAM,UAAU,OAAQ,CAAA,OAAA,CAAQ,EAAG,CAAA,OAAA,CAAQ,MAAM,GAAG,CAAA,CAAA;AACpD,EAAA,MAAM,SAAU,CAAA,WAAA,CAAY,OAAS,EAAA,OAAA,CAAQ,IAAI,CAAA,CAAA;AACnD;;;;"}
1
+ {"version":3,"file":"postrun.js","sourceRoot":"","sources":["../../src/hooks/postrun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAA;AAG1C,gGAAgG;AAChG,MAAM,CAAC,MAAM,IAAI,GAAiB,KAAK,EAAE,QAAQ,EAAE,EAAE;IACnD,MAAM,SAAS,CAAC,WAAW,EAAE,CAAA;AAC/B,CAAC,CAAA","sourcesContent":["import {analytics} from '@shopify/cli-kit'\nimport {Hook} from '@oclif/core'\n\n// This hook is called after each successful command run. More info: https://oclif.io/docs/hooks\nexport const hook: Hook.Postrun = async (_options) => {\n await analytics.reportEvent()\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { Hook } from '@oclif/core';
2
+ export declare const hook: Hook.Prerun;
@@ -0,0 +1,8 @@
1
+ import { analytics } from '@shopify/cli-kit';
2
+ // This hook is called before each command run. More info: https://oclif.io/docs/hooks
3
+ export const hook = async (options) => {
4
+ const command = options.Command.id.replace(/:/g, ' ');
5
+ const args = options.argv.join(' ');
6
+ analytics.start({ command, args });
7
+ };
8
+ //# sourceMappingURL=prerun.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"prerun.js","sourceRoot":"","sources":["../../src/hooks/prerun.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAC,MAAM,kBAAkB,CAAA;AAG1C,sFAAsF;AACtF,MAAM,CAAC,MAAM,IAAI,GAAgB,KAAK,EAAE,OAAO,EAAE,EAAE;IACjD,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IACrD,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACnC,SAAS,CAAC,KAAK,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAA;AAClC,CAAC,CAAA","sourcesContent":["import {analytics} from '@shopify/cli-kit'\nimport {Hook} from '@oclif/core'\n\n// This hook is called before each command run. More info: https://oclif.io/docs/hooks\nexport const hook: Hook.Prerun = async (options) => {\n const command = options.Command.id.replace(/:/g, ' ')\n const args = options.argv.join(' ')\n analytics.start({command, args})\n}\n"]}
@@ -0,0 +1,2 @@
1
+ declare function runShopifyCLI(): Promise<void>;
2
+ export default runShopifyCLI;
package/dist/index.js CHANGED
@@ -1,50 +1,9 @@
1
- import { settings, run, flush } from '@oclif/core';
2
- import Bugsnag from '@bugsnag/js';
3
- import { output, environment, error } from '@shopify/cli-kit';
4
-
5
- var version = "3.0.23";
6
-
7
- function runCLI() {
8
- output.initiateLogging({ filename: "shopify.cli.log" });
9
- if (environment.local.isDebug()) {
10
- settings.debug = true;
11
- } else {
12
- Bugsnag.start({
13
- apiKey: "9e1e6889176fd0c795d5c659225e0fae",
14
- logger: null,
15
- appVersion: version,
16
- autoTrackSessions: false
1
+ import { runCLI } from '@shopify/cli-kit/node/cli';
2
+ async function runShopifyCLI() {
3
+ await runCLI({
4
+ moduleURL: import.meta.url,
5
+ logFilename: 'shopify.cli.log',
17
6
  });
18
- }
19
- run(void 0, import.meta.url).then(flush).catch((error$1) => {
20
- if (error$1 instanceof error.AbortSilent) {
21
- process.exit(1);
22
- }
23
- const kitMapper = error.mapper;
24
- const kitHandle = error.handler;
25
- return kitMapper(error$1).then(bugsnagHandle).then((error2) => {
26
- return kitHandle(error2);
27
- }).then(() => {
28
- process.exit(1);
29
- });
30
- });
31
7
  }
32
- const bugsnagHandle = async (errorToReport) => {
33
- if (!settings.debug && error.shouldReport(errorToReport)) {
34
- let mappedError;
35
- if (Object.prototype.isPrototypeOf(errorToReport)) {
36
- const mappedError2 = Object.assign(Object.create(errorToReport), {});
37
- if (mappedError2.stack)
38
- mappedError2.stack = mappedError2.stack.replace(new RegExp("file:///", "g"), "/");
39
- } else {
40
- mappedError = errorToReport;
41
- }
42
- await new Promise((resolve, reject) => {
43
- Bugsnag.notify(mappedError, void 0, resolve);
44
- });
45
- }
46
- return Promise.resolve(errorToReport);
47
- };
48
-
49
- export { runCLI as default };
50
- //# sourceMappingURL=index.js.map
8
+ export default runShopifyCLI;
9
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/index.ts"],"sourcesContent":["// CLI\nimport {version as cliVersion} from '../package.json'\nimport {run, settings, flush} from '@oclif/core'\nimport Bugsnag from '@bugsnag/js'\nimport {error as kitError, environment, output} from '@shopify/cli-kit'\n\nfunction runCLI() {\n output.initiateLogging({filename: 'shopify.cli.log'})\n if (environment.local.isDebug()) {\n settings.debug = true\n } else {\n Bugsnag.start({\n apiKey: '9e1e6889176fd0c795d5c659225e0fae',\n logger: null,\n appVersion: cliVersion,\n autoTrackSessions: false,\n })\n }\n\n run(undefined, import.meta.url)\n .then(flush)\n .catch((error: Error): Promise<void | Error> => {\n if (error instanceof kitError.AbortSilent) {\n process.exit(1)\n }\n const kitMapper = kitError.mapper\n const kitHandle = kitError.handler\n // eslint-disable-next-line promise/no-nesting\n return kitMapper(error)\n .then(bugsnagHandle)\n .then((error: Error) => {\n return kitHandle(error)\n })\n .then(() => {\n process.exit(1)\n })\n })\n}\n\nconst bugsnagHandle = async (errorToReport: Error): Promise<Error> => {\n if (!settings.debug && kitError.shouldReport(errorToReport)) {\n let mappedError: Error\n // eslint-disable-next-line no-prototype-builtins\n if (Object.prototype.isPrototypeOf(errorToReport)) {\n const mappedError = Object.assign(Object.create(errorToReport), {})\n if (mappedError.stack) mappedError.stack = mappedError.stack.replace(new RegExp('file:///', 'g'), '/')\n } else {\n mappedError = errorToReport\n }\n await new Promise((resolve, reject) => {\n Bugsnag.notify(mappedError, undefined, resolve)\n })\n }\n return Promise.resolve(errorToReport)\n}\n\nexport default runCLI\n"],"names":["cliVersion","error","kitError"],"mappings":";;;;;;AAMA,SAAkB,MAAA,GAAA;AAChB,EAAA,MAAA,CAAO,eAAgB,CAAA,EAAC,QAAU,EAAA,iBAAA,EAAkB,CAAA,CAAA;AACpD,EAAI,IAAA,WAAA,CAAY,KAAM,CAAA,OAAA,EAAW,EAAA;AAC/B,IAAA,QAAA,CAAS,KAAQ,GAAA,IAAA,CAAA;AAAA,GACZ,MAAA;AACL,IAAA,OAAA,CAAQ,KAAM,CAAA;AAAA,MACZ,MAAQ,EAAA,kCAAA;AAAA,MACR,MAAQ,EAAA,IAAA;AAAA,MACR,UAAY,EAAAA,OAAA;AAAA,MACZ,iBAAmB,EAAA,KAAA;AAAA,KACpB,CAAA,CAAA;AAAA,GACH;AAEA,EAAI,GAAA,CAAA,KAAA,CAAA,EAAW,YAAY,GAAG,CAAA,CAC3B,KAAK,KAAK,CAAA,CACV,KAAM,CAAA,CAACC,OAAwC,KAAA;AAC9C,IAAI,IAAAA,OAAA,YAAiBC,MAAS,WAAa,EAAA;AACzC,MAAA,OAAA,CAAQ,KAAK,CAAC,CAAA,CAAA;AAAA,KAChB;AACA,IAAA,MAAM,YAAYA,KAAS,CAAA,MAAA,CAAA;AAC3B,IAAA,MAAM,YAAYA,KAAS,CAAA,OAAA,CAAA;AAE3B,IAAO,OAAA,SAAA,CAAUD,OAAK,CACnB,CAAA,IAAA,CAAK,aAAa,CAClB,CAAA,IAAA,CAAK,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,CAAC,IAAI,CAAC,GAAG;QAC1B,WAAW,EAAE,iBAAiB;KAC/B,CAAC,CAAA;AACJ,CAAC;AAED,eAAe,aAAa,CAAA","sourcesContent":["import {runCLI} from '@shopify/cli-kit/node/cli'\n\nasync function runShopifyCLI() {\n await runCLI({\n moduleURL: import.meta.url,\n logFilename: 'shopify.cli.log',\n })\n}\n\nexport default runShopifyCLI\n"]}