shopify-cli 1.13.1 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (200) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +1 -1
  3. data/.github/CONTRIBUTING.md +7 -7
  4. data/.github/DESIGN.md +3 -3
  5. data/.github/workflows/build.yml +1 -1
  6. data/.gitignore +3 -0
  7. data/.rubocop.yml +3 -1
  8. data/.ruby-version +1 -1
  9. data/CHANGELOG.md +60 -26
  10. data/Gemfile +4 -0
  11. data/Gemfile.lock +32 -0
  12. data/LICENSE +4 -1
  13. data/README.md +94 -26
  14. data/RELEASING.md +31 -7
  15. data/Rakefile +2 -2
  16. data/SECURITY.md +1 -1
  17. data/THEMEKIT_MIGRATION.md +18 -0
  18. data/bin/load_shopify.rb +1 -1
  19. data/bin/shopify +3 -3
  20. data/dev.yml +1 -1
  21. data/docs/app/node/index.md +1 -1
  22. data/docs/app/rails/index.md +1 -1
  23. data/docs/core/index.md +1 -1
  24. data/docs/getting-started/index.md +1 -1
  25. data/docs/getting-started/install/index.md +1 -1
  26. data/docs/getting-started/migrate/index.md +1 -1
  27. data/docs/getting-started/uninstall/index.md +1 -1
  28. data/docs/getting-started/upgrade/index.md +1 -1
  29. data/docs/help/start-app/index.md +1 -1
  30. data/docs/index.md +1 -1
  31. data/ext/shopify-cli/extconf.rb +17 -5
  32. data/install.sh +1 -1
  33. data/lib/docgen/index_template.md.erb +2 -2
  34. data/lib/graphql/all_orgs_with_extensions.graphql +37 -0
  35. data/lib/graphql/api_versions.graphql +1 -1
  36. data/lib/graphql/find_organization.graphql +2 -1
  37. data/lib/project_types/extension/cli.rb +19 -15
  38. data/lib/project_types/extension/commands/build.rb +4 -5
  39. data/lib/project_types/extension/commands/check.rb +44 -0
  40. data/lib/project_types/extension/commands/connect.rb +35 -0
  41. data/lib/project_types/extension/commands/create.rb +12 -16
  42. data/lib/project_types/extension/commands/extension_command.rb +2 -2
  43. data/lib/project_types/extension/commands/info.rb +86 -0
  44. data/lib/project_types/extension/commands/push.rb +8 -7
  45. data/lib/project_types/extension/commands/register.rb +4 -5
  46. data/lib/project_types/extension/commands/serve.rb +5 -8
  47. data/lib/project_types/extension/commands/tunnel.rb +3 -1
  48. data/lib/project_types/extension/errors.rb +9 -0
  49. data/lib/project_types/extension/extension_project.rb +24 -1
  50. data/lib/project_types/extension/extension_project_keys.rb +1 -0
  51. data/lib/project_types/extension/features/argo.rb +6 -6
  52. data/lib/project_types/extension/features/argo_runtime.rb +22 -66
  53. data/lib/project_types/extension/features/argo_serve.rb +25 -18
  54. data/lib/project_types/extension/forms/connect.rb +42 -0
  55. data/lib/project_types/extension/forms/questions/ask_name.rb +14 -6
  56. data/lib/project_types/extension/forms/questions/ask_registration.rb +51 -0
  57. data/lib/project_types/extension/messages/messages.rb +84 -16
  58. data/lib/project_types/extension/models/specification.rb +1 -0
  59. data/lib/project_types/extension/models/specification_handlers/{checkout_argo_extension.rb → checkout_ui_extension.rb} +3 -1
  60. data/lib/project_types/extension/models/specification_handlers/default.rb +13 -3
  61. data/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +89 -0
  62. data/lib/project_types/extension/models/specifications.rb +1 -0
  63. data/lib/project_types/extension/tasks/configure_features.rb +6 -7
  64. data/lib/project_types/extension/tasks/configure_options.rb +20 -0
  65. data/lib/project_types/extension/tasks/get_extensions.rb +32 -0
  66. data/lib/project_types/node/cli.rb +9 -21
  67. data/lib/project_types/node/commands/connect.rb +8 -2
  68. data/lib/project_types/node/commands/create.rb +9 -5
  69. data/lib/project_types/node/commands/deploy.rb +15 -5
  70. data/lib/project_types/node/commands/deploy/heroku.rb +29 -29
  71. data/lib/project_types/node/commands/generate.rb +4 -2
  72. data/lib/project_types/node/commands/open.rb +4 -2
  73. data/lib/project_types/node/commands/serve.rb +3 -2
  74. data/lib/project_types/node/commands/tunnel.rb +4 -2
  75. data/lib/project_types/node/messages/messages.rb +47 -90
  76. data/lib/project_types/rails/cli.rb +9 -21
  77. data/lib/project_types/rails/commands/connect.rb +8 -2
  78. data/lib/project_types/rails/commands/create.rb +10 -6
  79. data/lib/project_types/rails/commands/deploy.rb +15 -5
  80. data/lib/project_types/rails/commands/deploy/heroku.rb +84 -82
  81. data/lib/project_types/rails/commands/generate.rb +15 -5
  82. data/lib/project_types/rails/commands/generate/webhook.rb +28 -26
  83. data/lib/project_types/rails/commands/open.rb +4 -2
  84. data/lib/project_types/rails/commands/serve.rb +3 -2
  85. data/lib/project_types/rails/commands/tunnel.rb +4 -2
  86. data/lib/project_types/rails/messages/messages.rb +72 -119
  87. data/lib/project_types/script/cli.rb +6 -8
  88. data/lib/project_types/script/commands/create.rb +3 -1
  89. data/lib/project_types/script/commands/push.rb +7 -4
  90. data/lib/project_types/script/graphql/app_script_update_or_create.graphql +9 -3
  91. data/lib/project_types/script/layers/application/create_script.rb +4 -3
  92. data/lib/project_types/script/layers/domain/errors.rb +6 -11
  93. data/lib/project_types/script/layers/domain/push_package.rb +4 -8
  94. data/lib/project_types/script/layers/domain/script_json.rb +32 -0
  95. data/lib/project_types/script/layers/domain/script_project.rb +1 -1
  96. data/lib/project_types/script/layers/infrastructure/errors.rb +13 -17
  97. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb +29 -21
  98. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +2 -4
  99. data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +45 -34
  100. data/lib/project_types/script/layers/infrastructure/script_service.rb +37 -16
  101. data/lib/project_types/script/messages/messages.rb +64 -54
  102. data/lib/project_types/script/tasks/ensure_env.rb +3 -1
  103. data/lib/project_types/script/ui/error_handler.rb +32 -32
  104. data/lib/project_types/theme/cli.rb +16 -27
  105. data/lib/project_types/theme/commands/check.rb +33 -0
  106. data/lib/project_types/theme/commands/delete.rb +64 -0
  107. data/lib/project_types/theme/commands/init.rb +42 -0
  108. data/lib/project_types/theme/commands/language_server.rb +16 -0
  109. data/lib/project_types/theme/commands/package.rb +55 -0
  110. data/lib/project_types/theme/commands/publish.rb +43 -0
  111. data/lib/project_types/theme/commands/pull.rb +51 -0
  112. data/lib/project_types/theme/commands/push.rb +58 -32
  113. data/lib/project_types/theme/commands/serve.rb +8 -16
  114. data/lib/project_types/theme/forms/confirm_store.rb +15 -0
  115. data/lib/project_types/theme/forms/select.rb +59 -0
  116. data/lib/project_types/theme/messages/messages.rb +118 -103
  117. data/lib/project_types/theme/ui/sync_progress_bar.rb +20 -0
  118. data/lib/shopify-cli/admin_api.rb +57 -38
  119. data/lib/shopify-cli/admin_api/populate_resource_command.rb +6 -14
  120. data/lib/shopify-cli/admin_api/schema.rb +1 -10
  121. data/lib/shopify-cli/api.rb +29 -14
  122. data/lib/shopify-cli/command.rb +15 -3
  123. data/lib/shopify-cli/commands.rb +7 -2
  124. data/lib/shopify-cli/commands/help.rb +2 -29
  125. data/lib/shopify-cli/commands/login.rb +95 -0
  126. data/lib/shopify-cli/commands/logout.rb +24 -8
  127. data/lib/shopify-cli/commands/populate.rb +23 -0
  128. data/lib/{project_types/node → shopify-cli}/commands/populate/customer.rb +2 -8
  129. data/lib/{project_types/node → shopify-cli}/commands/populate/draft_order.rb +2 -2
  130. data/lib/{project_types/node → shopify-cli}/commands/populate/product.rb +2 -8
  131. data/lib/shopify-cli/commands/store.rb +15 -0
  132. data/lib/shopify-cli/commands/switch.rb +39 -0
  133. data/lib/shopify-cli/commands/system.rb +12 -0
  134. data/lib/shopify-cli/commands/whoami.rb +28 -0
  135. data/lib/shopify-cli/connect.rb +32 -0
  136. data/lib/shopify-cli/context.rb +65 -4
  137. data/lib/shopify-cli/core/entry_point.rb +3 -22
  138. data/lib/shopify-cli/core/monorail.rb +6 -2
  139. data/lib/shopify-cli/db.rb +4 -4
  140. data/lib/shopify-cli/http_request.rb +16 -0
  141. data/lib/shopify-cli/identity_auth.rb +282 -0
  142. data/lib/shopify-cli/{oauth → identity_auth}/servlet.rb +11 -12
  143. data/lib/shopify-cli/messages/messages.rb +140 -46
  144. data/lib/shopify-cli/packager.rb +5 -5
  145. data/lib/shopify-cli/partners_api.rb +21 -44
  146. data/lib/shopify-cli/partners_api/organizations.rb +8 -0
  147. data/lib/shopify-cli/project_commands.rb +16 -0
  148. data/lib/shopify-cli/project_type.rb +0 -31
  149. data/lib/shopify-cli/shopifolk.rb +8 -11
  150. data/lib/shopify-cli/sub_command.rb +1 -0
  151. data/lib/shopify-cli/tasks.rb +3 -0
  152. data/lib/shopify-cli/tasks/confirm_store.rb +18 -0
  153. data/lib/shopify-cli/tasks/create_api_client.rb +2 -2
  154. data/lib/shopify-cli/tasks/ensure_authenticated.rb +13 -0
  155. data/lib/shopify-cli/tasks/ensure_loopback_url.rb +1 -1
  156. data/lib/shopify-cli/tasks/ensure_project_type.rb +12 -0
  157. data/lib/shopify-cli/tasks/select_org_and_shop.rb +0 -3
  158. data/lib/shopify-cli/theme/dev_server.rb +98 -0
  159. data/lib/shopify-cli/theme/dev_server/certificate_manager.rb +79 -0
  160. data/lib/shopify-cli/theme/dev_server/header_hash.rb +94 -0
  161. data/lib/shopify-cli/theme/dev_server/hot-reload.js +93 -0
  162. data/lib/shopify-cli/theme/dev_server/hot_reload.rb +76 -0
  163. data/lib/shopify-cli/theme/dev_server/local_assets.rb +87 -0
  164. data/lib/shopify-cli/theme/dev_server/proxy.rb +205 -0
  165. data/lib/shopify-cli/theme/dev_server/sse.rb +75 -0
  166. data/lib/shopify-cli/theme/dev_server/watcher.rb +59 -0
  167. data/lib/shopify-cli/theme/dev_server/web_server.rb +140 -0
  168. data/lib/shopify-cli/theme/development_theme.rb +69 -0
  169. data/lib/shopify-cli/theme/file.rb +112 -0
  170. data/lib/shopify-cli/theme/ignore_filter.rb +109 -0
  171. data/lib/shopify-cli/theme/mime_type.rb +34 -0
  172. data/lib/shopify-cli/theme/syncer.rb +332 -0
  173. data/lib/shopify-cli/theme/theme.rb +204 -0
  174. data/lib/shopify-cli/tunnel.rb +1 -1
  175. data/lib/shopify-cli/version.rb +1 -1
  176. data/lib/shopify_cli.rb +18 -11
  177. data/shopify-cli.gemspec +12 -5
  178. data/shopify.fish +1 -1
  179. data/shopify.sh +1 -1
  180. metadata +92 -35
  181. data/.github/workflows/release.yml +0 -59
  182. data/lib/project_types/extension/features/argo_serve_options.rb +0 -42
  183. data/lib/project_types/node/commands/populate.rb +0 -23
  184. data/lib/project_types/rails/commands/populate.rb +0 -23
  185. data/lib/project_types/rails/commands/populate/customer.rb +0 -31
  186. data/lib/project_types/rails/commands/populate/draft_order.rb +0 -28
  187. data/lib/project_types/rails/commands/populate/product.rb +0 -30
  188. data/lib/project_types/script/layers/domain/config_ui.rb +0 -16
  189. data/lib/project_types/theme/commands/connect.rb +0 -54
  190. data/lib/project_types/theme/commands/create.rb +0 -48
  191. data/lib/project_types/theme/commands/deploy.rb +0 -38
  192. data/lib/project_types/theme/commands/generate.rb +0 -20
  193. data/lib/project_types/theme/commands/generate/env.rb +0 -79
  194. data/lib/project_types/theme/forms/connect.rb +0 -34
  195. data/lib/project_types/theme/forms/create.rb +0 -22
  196. data/lib/project_types/theme/tasks/ensure_themekit_installed.rb +0 -78
  197. data/lib/project_types/theme/themekit.rb +0 -113
  198. data/lib/shopify-cli/commands/connect.rb +0 -64
  199. data/lib/shopify-cli/commands/create.rb +0 -50
  200. data/lib/shopify-cli/oauth.rb +0 -198
data/RELEASING.md CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  1. Check the Semantic Versioning page for info on how to version the new release: http://semver.org
4
4
 
5
- 1. Make sure you're on the most recent `master`
5
+ 1. Make sure you're on the most recent `main`
6
6
  ```
7
- $ git checkout master
7
+ $ git checkout main
8
8
  $ git pull
9
9
  ```
10
10
 
@@ -15,6 +15,8 @@
15
15
 
16
16
  1. Update the version of Shopify CLI in `lib/shopify-cli/version.rb`
17
17
 
18
+ 1. Update the version of Shopify CLI at the top of `Gemfile.lock` (failing to do so causes the CI build to fail)
19
+
18
20
  1. Add an entry for the new release to `CHANGELOG.md`
19
21
 
20
22
  1. Commit the changes with a commit message like "Packaging for release X.Y.Z"
@@ -31,11 +33,33 @@
31
33
 
32
34
  1. Deploy using Shipit
33
35
 
34
- 1. Check the "Actions" tab to see if the _Create Release_ workflow is successful.
35
- The workflow will automatically create a [release](https://github.com/Shopify/shopify-app-cli/releases) with the latest tag and `.deb`, `.rpm` assets attached.
36
+ 1. Update your `main` branch to the latest version
37
+ ```
38
+ $ git checkout main
39
+ $ git pull
40
+ ```
41
+
42
+ 1. On local machine and _AFTER_ gem has been published to https://rubygems.org, run
43
+ ```
44
+ $ rake package
45
+ ```
46
+ This will generate the `.deb`, `.rpm` and brew formula files, which will be located in `packaging/builds/X.Y.Z/`.
36
47
 
37
- 2. Check the `Shopify/homebrew-shopify` repository for new PR `shopify-cli {version}`
38
- * rename PR to `Packaging for release of v{version} of shopify-cli`
39
- * when PR is approved, merge into main branch
48
+ 1. Clone the `Shopify/homebrew-shopify` repository (if not already cloned), and then
49
+ * create a branch named `release_X_Y_Z_of_shopify-cli`
50
+ * update the brew formula in `shopify-cli.rb` with the generated formula in `packaging/builds/X.Y.Z/` in the `Shopify/shopify-cli` repo (from the `rake package` step above)
51
+ * commit the change and create a PR on the [Shopify Homebrew repository](https://github.com/Shopify/homebrew-shopify)
52
+ * when PR is approved, merge into main branch
40
53
 
54
+ 1. Go to [releases](https://github.com/Shopify/shopify-cli/releases) page of `Shopify/shopify-cli` repo and create a new release:
55
+ * use the tag created by Shipit (should be "vX.Y.Z")
56
+ * release title = "Version X.Y.Z"
57
+ * description should be
58
+ ```
59
+ Release of version X.Y.Z of Shopify CLI
41
60
 
61
+ Please refer to [CHANGELOG](https://github.com/Shopify/shopify-cli/blob/main/CHANGELOG.md) for details.
62
+ ```
63
+ * upload the `.deb` and `.rpm` files from `packaging/builds/X.Y.Z/` (generated in step 9)
64
+ * if it's a pre-release version, select the "This is a pre-release" checkbox
65
+ * and click "Publish release".
data/Rakefile CHANGED
@@ -20,7 +20,7 @@ task :console do
20
20
  end
21
21
 
22
22
  namespace :rdoc do
23
- repo = "https://github.com/Shopify/shopify-app-cli.wiki.git"
23
+ repo = "https://github.com/Shopify/shopify-cli.wiki.git"
24
24
  intermediate = "markdown_intermediate"
25
25
  file_to_doc = [
26
26
  "lib/shopify-cli/admin_api.rb",
@@ -29,6 +29,7 @@ namespace :rdoc do
29
29
  "lib/shopify-cli/git.rb",
30
30
  "lib/shopify-cli/heroku.rb",
31
31
  "lib/shopify-cli/js_deps.rb",
32
+ "lib/shopify-cli/lazy_delegator.rb",
32
33
  "lib/shopify-cli/method_object.rb",
33
34
  "lib/shopify-cli/partners_api.rb",
34
35
  "lib/shopify-cli/process_supervision.rb",
@@ -36,7 +37,6 @@ namespace :rdoc do
36
37
  "lib/shopify-cli/result.rb",
37
38
  "lib/shopify-cli/transform_data_structure.rb",
38
39
  "lib/shopify-cli/tunnel.rb",
39
- "lib/shopify-cli/lazy_delegator.rb",
40
40
  ]
41
41
 
42
42
  task all: [:markdown, :wiki, :cleanup]
data/SECURITY.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  ### New features
6
6
 
7
- New features will only be added to the master branch and will not be made available in point releases.
7
+ New features will only be added to the main branch and will not be made available in point releases.
8
8
 
9
9
  ### Bug fixes
10
10
 
@@ -0,0 +1,18 @@
1
+ # Theme Kit Migration
2
+
3
+ Shopify CLI is the recommended and officially supported tool for developing Themes and creating CI/CD workflows.
4
+
5
+ This guide shows how to achieve equivalent flows with the new version of the CLI.
6
+
7
+ ## Equivalent commands
8
+
9
+ | Theme Kit Command | Shopify CLI Equivalent | Objective |
10
+ |---|---|---|
11
+ |`theme deploy`|`shopify theme push`| Deploy a local (to the CLI) version of the Theme in the current working directory to a remote store.|
12
+ |`theme new`|`shopify theme init`| Scaffold a new theme. In the case of the CLI it clones Dawn to be used as a reference Theme. Alternatively, it's possible to simply clone Dawn `git clone git@github.com:Shopify/dawn.git` and use it with the CLI.
13
+ |`theme download`|`shopify theme pull`| Download your remote theme files.|
14
+ |`theme watch` & `theme open` | `shopify theme serve` | Start a theme server to locally preview changes with CSS & Section hot reload enabled|
15
+ |-| `shopify theme check`| Run the Theme Check linter on your theme codebase.|
16
+ |-|`shopify theme publish`| Set a remote theme as the live theme.|
17
+ |-|`shopify theme package`|Pack your Theme as a zip file ready for distribution and submission to the Theme Store.|
18
+ |`theme remove`| `shopify theme delete`| Theme kit removes files from the Theme whereas Shopify CLI will remotely destroy the specified theme.|
data/bin/load_shopify.rb CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby --disable=gems
1
+ #!/usr/bin/env ruby
2
2
 
3
3
  lib_path = File.expand_path("../../lib", __FILE__)
4
4
  $LOAD_PATH.unshift(lib_path) unless $LOAD_PATH.include?(lib_path)
data/bin/shopify CHANGED
@@ -1,4 +1,4 @@
1
- #!/usr/bin/env ruby --disable=gems
1
+ #!/usr/bin/env ruby
2
2
 
3
3
  module Kernel
4
4
  # make an alias of the original require
@@ -12,7 +12,7 @@ module Kernel
12
12
  raise if (name == "readline.so") && ShopifyCli::Context.new.windows?
13
13
  # Special case for psych (yaml), which rescues this itself
14
14
  raise if name == "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
15
- STDERR.puts "[Note] You cannot use gems with Shopify App CLI."
15
+ STDERR.puts "[Note] You cannot use gems with Shopify CLI."
16
16
  STDERR.puts "[LoadError] #{e.message}"
17
17
  if ENV["DEBUG"]
18
18
  STDERR.puts e.backtrace
@@ -21,7 +21,7 @@ module Kernel
21
21
  STDERR.puts " They are disabled."
22
22
  STDERR.puts " Please don't modify the CLI locally."
23
23
  STDERR.puts " If you would like to contribute to the CLI project, please refer to"
24
- STDERR.puts " https://github.com/Shopify/shopify-app-cli/blob/master/.github/CONTRIBUTING.md"
24
+ STDERR.puts " https://github.com/Shopify/shopify-cli/blob/main/.github/CONTRIBUTING.md"
25
25
  STDERR.puts "\n"
26
26
  raise
27
27
  end
data/dev.yml CHANGED
@@ -3,7 +3,7 @@ type:
3
3
  - ruby
4
4
 
5
5
  up:
6
- - ruby: 2.5.1
6
+ - ruby: 2.7.1
7
7
  - bundler
8
8
  - node:
9
9
  version: 14.9.0
@@ -1,4 +1,4 @@
1
1
  ---
2
- title: Getting started with Shopify App CLI
2
+ title: Getting started with Shopify CLI
3
3
  redirect_to: https://shopify.dev/tools/cli/getting-started
4
4
  ---
@@ -1,4 +1,4 @@
1
1
  ---
2
- title: Getting started with Shopify App CLI
2
+ title: Getting started with Shopify CLI
3
3
  redirect_to: https://shopify.dev/tools/cli/getting-started
4
4
  ---
data/docs/core/index.md CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- title: Shopify App CLI core commands
2
+ title: Shopify CLI core commands
3
3
  redirect_to: https://shopify.dev/tools/cli/reference
4
4
  ---
@@ -1,4 +1,4 @@
1
1
  ---
2
- title: Getting started with Shopify App CLI
2
+ title: Getting started with Shopify CLI
3
3
  redirect_to: https://shopify.dev/tools/cli/getting-started
4
4
  ---
@@ -1,4 +1,4 @@
1
1
  ---
2
- title: Install Shopify App CLI
2
+ title: Install Shopify CLI
3
3
  redirect_to: https://shopify.dev/tools/cli/installation
4
4
  ---
@@ -1,4 +1,4 @@
1
1
  ---
2
- title: Troubleshooting Shopify App CLI
2
+ title: Troubleshooting Shopify CLI
3
3
  redirect_to: https://shopify.dev/tools/cli/troubleshooting
4
4
  ---
@@ -1,4 +1,4 @@
1
1
  ---
2
- title: Troubleshooting Shopify App CLI
2
+ title: Troubleshooting Shopify CLI
3
3
  redirect_to: https://shopify.dev/tools/cli/troubleshooting
4
4
  ---
@@ -1,4 +1,4 @@
1
1
  ---
2
- title: Troubleshooting Shopify App CLI
2
+ title: Troubleshooting Shopify CLI
3
3
  redirect_to: https://shopify.dev/tools/cli/troubleshooting
4
4
  ---
@@ -1,4 +1,4 @@
1
1
  ---
2
- title: Getting started with Shopify App CLI
2
+ title: Getting started with Shopify CLI
3
3
  redirect_to: https://shopify.dev/tools/cli/getting-started
4
4
  ---
data/docs/index.md CHANGED
@@ -1,4 +1,4 @@
1
1
  ---
2
- title: Shopify App CLI
2
+ title: Shopify CLI
3
3
  redirect_to: https://shopify.dev/tools/cli
4
4
  ---
@@ -4,11 +4,23 @@ require "fileutils"
4
4
  gem = File.expand_path("../../../", __FILE__)
5
5
  exe = File.join(gem, "bin", "shopify")
6
6
 
7
- if RUBY_PLATFORM.match(/mingw32/)
7
+ # `--skip-cli-build` will be passed from the brew `shopify-cli.rb` formula, so
8
+ # as to prevent this extension builder doing the script and sym-link creation;
9
+ # the brew install process takes care of these itself - see
10
+ # https://github.com/Shopify/homebrew-shopify/shopify-cli.rb
11
+ if ARGV && ARGV[0]&.match(/skip-cli-build/)
12
+ makefile_content = <<~MAKEFILE
13
+ .PHONY: clean
14
+
15
+ clean: ;
16
+
17
+ install: ;
18
+ MAKEFILE
19
+ elsif RUBY_PLATFORM.match(/mswin|mingw|cygwin/)
8
20
  bat_path = File.dirname(RbConfig.ruby)
9
21
  bat = "#{bat_path}\\shopify.bat"
10
22
 
11
- script_content = "#{RbConfig.ruby} --disable=gems -I '#{gem}' '#{exe}' %*"
23
+ script_content = "#{RbConfig.ruby} -I '#{gem}' '#{exe}' %*"
12
24
 
13
25
  FileUtils.mkdir_p(bat_path)
14
26
  makefile_content = <<~MAKEFILE
@@ -27,7 +39,7 @@ else
27
39
 
28
40
  script_content = <<~SCRIPT
29
41
  #!/usr/bin/env bash
30
- #{RbConfig.ruby} --disable=gems -I #{gem} #{exe} $@
42
+ #{RbConfig.ruby} -I #{gem} #{exe} $@
31
43
  SCRIPT
32
44
 
33
45
  File.write(script, script_content)
@@ -35,10 +47,10 @@ else
35
47
 
36
48
  makefile_content = <<~MAKEFILE
37
49
  .PHONY: clean install
38
-
50
+
39
51
  clean:
40
52
  \t@sudo rm -f #{symlink}
41
-
53
+
42
54
  install: clean
43
55
  \t@sudo ln -s #{script} #{symlink}
44
56
  MAKEFILE
data/install.sh CHANGED
@@ -1,6 +1,6 @@
1
1
  # shellcheck shell=sh disable=1012,1001
2
2
  \cat << 'EOF'
3
- This install method for Shopify App CLI is no longer supported.
3
+ This install method for Shopify CLI is no longer supported.
4
4
 
5
5
  Please visit this page for complete instructions:
6
6
  https://shopify.dev/tools/cli/troubleshooting#migrate-from-a-legacy-version
@@ -1,5 +1,5 @@
1
- The Shopify App CLI has a set of core APIs that simplify the process of extending its functionality.
1
+ The Shopify CLI has a set of core APIs that simplify the process of extending its functionality.
2
2
 
3
3
  <%- classes.each do |method| -%>
4
- - [<%= method.title %>](https://github.com/Shopify/shopify-app-cli/wiki/<%= method.filename %>)
4
+ - [<%= method.title %>](https://github.com/Shopify/shopify-cli/wiki/<%= method.filename %>)
5
5
  <%- end -%>
@@ -0,0 +1,37 @@
1
+ query AllOrgs ($type: String) {
2
+ organizations {
3
+ nodes {
4
+ id
5
+ businessName
6
+ website
7
+ apps(first: 500) {
8
+ nodes {
9
+ id
10
+ title
11
+ apiKey
12
+ apiSecretKeys{
13
+ secret
14
+ }
15
+ appType
16
+ extensionRegistrations(specificationIdentifier: $type) {
17
+ id
18
+ type
19
+ uuid
20
+ title
21
+ draftVersion {
22
+ registrationId
23
+ context
24
+ lastUserInteractionAt
25
+ location
26
+ validationErrors { field message }
27
+
28
+ id
29
+ uuid
30
+ versionTag
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
36
+ }
37
+ }
@@ -1,6 +1,6 @@
1
1
  query {
2
2
  publicApiVersions {
3
3
  handle
4
- displayName
4
+ supported
5
5
  }
6
6
  }
@@ -9,9 +9,10 @@ query FindOrg($id: ID!) {
9
9
  link
10
10
  shopDomain
11
11
  shopName
12
+ transferDisabled
13
+ convertableToPartnerTest
12
14
  }
13
15
  }
14
16
  }
15
17
  }
16
18
  }
17
-
@@ -5,14 +5,6 @@ module Extension
5
5
 
6
6
  class Project < ShopifyCli::ProjectType
7
7
  hidden_feature
8
- title("App Extension")
9
- creator("Extension::Commands::Create")
10
-
11
- register_command("Extension::Commands::Build", "build")
12
- register_command("Extension::Commands::Register", "register")
13
- register_command("Extension::Commands::Push", "push")
14
- register_command("Extension::Commands::Serve", "serve")
15
- register_command("Extension::Commands::Tunnel", "tunnel")
16
8
 
17
9
  require Project.project_filepath("messages/messages")
18
10
  require Project.project_filepath("messages/message_loading")
@@ -20,15 +12,21 @@ module Extension
20
12
  register_messages(Extension::Messages::MessageLoading.load)
21
13
  end
22
14
 
23
- module Commands
15
+ class Command < ShopifyCli::ProjectCommands
16
+ hidden_feature
24
17
  autoload :ExtensionCommand, Project.project_filepath("commands/extension_command")
25
- autoload :Create, Project.project_filepath("commands/create")
26
- autoload :Register, Project.project_filepath("commands/register")
27
- autoload :Build, Project.project_filepath("commands/build")
28
- autoload :Serve, Project.project_filepath("commands/serve")
29
- autoload :Push, Project.project_filepath("commands/push")
30
- autoload :Tunnel, Project.project_filepath("commands/tunnel")
18
+
19
+ subcommand :Create, "create", Project.project_filepath("commands/create")
20
+ subcommand :Register, "register", Project.project_filepath("commands/register")
21
+ subcommand :Info, "info", Project.project_filepath("commands/info")
22
+ subcommand :Connect, "connect", Project.project_filepath("commands/connect")
23
+ subcommand :Build, "build", Project.project_filepath("commands/build")
24
+ subcommand :Serve, "serve", Project.project_filepath("commands/serve")
25
+ subcommand :Push, "push", Project.project_filepath("commands/push")
26
+ subcommand :Tunnel, "tunnel", Project.project_filepath("commands/tunnel")
27
+ subcommand :Check, "check", Project.project_filepath("commands/check")
31
28
  end
29
+ ShopifyCli::Commands.register("Extension::Command", "extension")
32
30
 
33
31
  module Tasks
34
32
  autoload :UserErrors, Project.project_filepath("tasks/user_errors")
@@ -38,8 +36,10 @@ module Extension
38
36
  autoload :UpdateDraft, Project.project_filepath("tasks/update_draft")
39
37
  autoload :FetchSpecifications, Project.project_filepath("tasks/fetch_specifications")
40
38
  autoload :ConfigureFeatures, Project.project_filepath("tasks/configure_features")
39
+ autoload :ConfigureOptions, Project.project_filepath("tasks/configure_options")
41
40
  autoload :ChooseNextAvailablePort, Project.project_filepath("tasks/choose_next_available_port")
42
41
  autoload :FindNpmPackages, Project.project_filepath("tasks/find_npm_packages")
42
+ autoload :GetExtensions, Project.project_filepath("tasks/get_extensions")
43
43
 
44
44
  module Converters
45
45
  autoload :RegistrationConverter, Project.project_filepath("tasks/converters/registration_converter")
@@ -54,10 +54,12 @@ module Extension
54
54
  autoload :AskApp, Project.project_filepath("forms/questions/ask_app")
55
55
  autoload :AskName, Project.project_filepath("forms/questions/ask_name")
56
56
  autoload :AskType, Project.project_filepath("forms/questions/ask_type")
57
+ autoload :AskRegistration, Project.project_filepath("forms/questions/ask_registration")
57
58
  end
58
59
 
59
60
  autoload :Create, Project.project_filepath("forms/create")
60
61
  autoload :Register, Project.project_filepath("forms/register")
62
+ autoload :Connect, Project.project_filepath("forms/connect")
61
63
  end
62
64
 
63
65
  module Features
@@ -75,6 +77,7 @@ module Extension
75
77
  module Models
76
78
  module SpecificationHandlers
77
79
  autoload :Default, Project.project_filepath("models/specification_handlers/default")
80
+ autoload :CheckoutArgoExtension, Project.project_filepath("models/specification_handlers/checkout_ui_extension")
78
81
  end
79
82
 
80
83
  autoload :App, Project.project_filepath("models/app")
@@ -89,4 +92,5 @@ module Extension
89
92
 
90
93
  autoload :ExtensionProjectKeys, Project.project_filepath("extension_project_keys")
91
94
  autoload :ExtensionProject, Project.project_filepath("extension_project")
95
+ autoload :Errors, Project.project_filepath("errors")
92
96
  end
@@ -2,10 +2,12 @@
2
2
  require "shopify_cli"
3
3
 
4
4
  module Extension
5
- module Commands
5
+ class Command
6
6
  class Build < ExtensionCommand
7
7
  hidden_feature
8
8
 
9
+ prerequisite_task ensure_project_type: :extension
10
+
9
11
  YARN_BUILD_COMMAND = %w(build)
10
12
  NPM_BUILD_COMMAND = %w(run-script build)
11
13
 
@@ -19,10 +21,7 @@ module Extension
19
21
  end
20
22
 
21
23
  def self.help
22
- <<~HELP
23
- Build your extension to prepare for deployment.
24
- Usage: {{command:#{ShopifyCli::TOOL_NAME} build}}
25
- HELP
24
+ ShopifyCli::Context.new.message("build.help", ShopifyCli::TOOL_NAME)
26
25
  end
27
26
  end
28
27
  end