shopify-cli 1.14.0 → 2.0.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.
Files changed (179) 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 +35 -29
  10. data/Gemfile +4 -0
  11. data/Gemfile.lock +32 -0
  12. data/LICENSE +4 -1
  13. data/README.md +92 -26
  14. data/RELEASING.md +29 -7
  15. data/Rakefile +2 -2
  16. data/SECURITY.md +1 -1
  17. data/bin/load_shopify.rb +1 -1
  18. data/bin/shopify +3 -3
  19. data/dev.yml +1 -1
  20. data/docs/app/node/index.md +1 -1
  21. data/docs/app/rails/index.md +1 -1
  22. data/docs/core/index.md +1 -1
  23. data/docs/getting-started/index.md +1 -1
  24. data/docs/getting-started/install/index.md +1 -1
  25. data/docs/getting-started/migrate/index.md +1 -1
  26. data/docs/getting-started/uninstall/index.md +1 -1
  27. data/docs/getting-started/upgrade/index.md +1 -1
  28. data/docs/help/start-app/index.md +1 -1
  29. data/docs/index.md +1 -1
  30. data/ext/shopify-cli/extconf.rb +17 -5
  31. data/install.sh +1 -1
  32. data/lib/docgen/index_template.md.erb +2 -2
  33. data/lib/graphql/all_orgs_with_extensions.graphql +37 -0
  34. data/lib/graphql/find_organization.graphql +2 -1
  35. data/lib/project_types/extension/cli.rb +18 -15
  36. data/lib/project_types/extension/commands/build.rb +4 -5
  37. data/lib/project_types/extension/commands/connect.rb +35 -0
  38. data/lib/project_types/extension/commands/create.rb +12 -16
  39. data/lib/project_types/extension/commands/extension_command.rb +2 -2
  40. data/lib/project_types/extension/commands/info.rb +86 -0
  41. data/lib/project_types/extension/commands/push.rb +8 -7
  42. data/lib/project_types/extension/commands/register.rb +4 -5
  43. data/lib/project_types/extension/commands/serve.rb +5 -8
  44. data/lib/project_types/extension/commands/tunnel.rb +3 -1
  45. data/lib/project_types/extension/errors.rb +9 -0
  46. data/lib/project_types/extension/extension_project.rb +5 -0
  47. data/lib/project_types/extension/features/argo.rb +6 -6
  48. data/lib/project_types/extension/features/argo_runtime.rb +22 -66
  49. data/lib/project_types/extension/features/argo_serve.rb +25 -18
  50. data/lib/project_types/extension/forms/connect.rb +42 -0
  51. data/lib/project_types/extension/forms/questions/ask_name.rb +14 -6
  52. data/lib/project_types/extension/forms/questions/ask_registration.rb +51 -0
  53. data/lib/project_types/extension/messages/messages.rb +75 -11
  54. data/lib/project_types/extension/models/specification.rb +1 -0
  55. data/lib/project_types/extension/models/specification_handlers/{checkout_argo_extension.rb → checkout_ui_extension.rb} +3 -1
  56. data/lib/project_types/extension/models/specification_handlers/default.rb +13 -3
  57. data/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +86 -0
  58. data/lib/project_types/extension/models/specifications.rb +1 -0
  59. data/lib/project_types/extension/tasks/configure_features.rb +6 -7
  60. data/lib/project_types/extension/tasks/configure_options.rb +20 -0
  61. data/lib/project_types/extension/tasks/get_extensions.rb +32 -0
  62. data/lib/project_types/node/cli.rb +9 -21
  63. data/lib/project_types/node/commands/connect.rb +8 -2
  64. data/lib/project_types/node/commands/create.rb +9 -5
  65. data/lib/project_types/node/commands/deploy.rb +15 -5
  66. data/lib/project_types/node/commands/deploy/heroku.rb +29 -29
  67. data/lib/project_types/node/commands/generate.rb +4 -2
  68. data/lib/project_types/node/commands/open.rb +4 -2
  69. data/lib/project_types/node/commands/serve.rb +3 -2
  70. data/lib/project_types/node/commands/tunnel.rb +4 -2
  71. data/lib/project_types/node/messages/messages.rb +46 -89
  72. data/lib/project_types/rails/cli.rb +9 -21
  73. data/lib/project_types/rails/commands/connect.rb +8 -2
  74. data/lib/project_types/rails/commands/create.rb +10 -6
  75. data/lib/project_types/rails/commands/deploy.rb +15 -5
  76. data/lib/project_types/rails/commands/deploy/heroku.rb +84 -82
  77. data/lib/project_types/rails/commands/generate.rb +15 -5
  78. data/lib/project_types/rails/commands/generate/webhook.rb +28 -26
  79. data/lib/project_types/rails/commands/open.rb +4 -2
  80. data/lib/project_types/rails/commands/serve.rb +3 -2
  81. data/lib/project_types/rails/commands/tunnel.rb +4 -2
  82. data/lib/project_types/rails/messages/messages.rb +54 -101
  83. data/lib/project_types/script/cli.rb +5 -7
  84. data/lib/project_types/script/commands/create.rb +3 -1
  85. data/lib/project_types/script/commands/push.rb +4 -2
  86. data/lib/project_types/script/messages/messages.rb +52 -45
  87. data/lib/project_types/script/ui/error_handler.rb +2 -2
  88. data/lib/project_types/theme/cli.rb +15 -27
  89. data/lib/project_types/theme/commands/check.rb +33 -0
  90. data/lib/project_types/theme/commands/delete.rb +64 -0
  91. data/lib/project_types/theme/commands/language_server.rb +16 -0
  92. data/lib/project_types/theme/commands/package.rb +55 -0
  93. data/lib/project_types/theme/commands/publish.rb +43 -0
  94. data/lib/project_types/theme/commands/pull.rb +51 -0
  95. data/lib/project_types/theme/commands/push.rb +58 -32
  96. data/lib/project_types/theme/commands/serve.rb +7 -17
  97. data/lib/project_types/theme/forms/confirm_store.rb +15 -0
  98. data/lib/project_types/theme/forms/select.rb +59 -0
  99. data/lib/project_types/theme/messages/messages.rb +110 -106
  100. data/lib/project_types/theme/ui/sync_progress_bar.rb +20 -0
  101. data/lib/shopify-cli/admin_api.rb +53 -38
  102. data/lib/shopify-cli/admin_api/populate_resource_command.rb +6 -14
  103. data/lib/shopify-cli/admin_api/schema.rb +1 -10
  104. data/lib/shopify-cli/api.rb +29 -14
  105. data/lib/shopify-cli/command.rb +15 -3
  106. data/lib/shopify-cli/commands.rb +7 -2
  107. data/lib/shopify-cli/commands/help.rb +2 -29
  108. data/lib/shopify-cli/commands/login.rb +95 -0
  109. data/lib/shopify-cli/commands/logout.rb +24 -8
  110. data/lib/shopify-cli/commands/populate.rb +23 -0
  111. data/lib/{project_types/node → shopify-cli}/commands/populate/customer.rb +2 -8
  112. data/lib/{project_types/node → shopify-cli}/commands/populate/draft_order.rb +2 -2
  113. data/lib/{project_types/node → shopify-cli}/commands/populate/product.rb +2 -8
  114. data/lib/shopify-cli/commands/store.rb +15 -0
  115. data/lib/shopify-cli/commands/switch.rb +39 -0
  116. data/lib/shopify-cli/commands/system.rb +12 -0
  117. data/lib/shopify-cli/commands/whoami.rb +28 -0
  118. data/lib/shopify-cli/connect.rb +32 -0
  119. data/lib/shopify-cli/context.rb +52 -4
  120. data/lib/shopify-cli/core/entry_point.rb +3 -22
  121. data/lib/shopify-cli/db.rb +4 -4
  122. data/lib/shopify-cli/http_request.rb +10 -0
  123. data/lib/shopify-cli/identity_auth.rb +282 -0
  124. data/lib/shopify-cli/{oauth → identity_auth}/servlet.rb +11 -12
  125. data/lib/shopify-cli/messages/messages.rb +132 -39
  126. data/lib/shopify-cli/partners_api.rb +21 -44
  127. data/lib/shopify-cli/partners_api/organizations.rb +8 -0
  128. data/lib/shopify-cli/project_commands.rb +16 -0
  129. data/lib/shopify-cli/project_type.rb +0 -31
  130. data/lib/shopify-cli/shopifolk.rb +8 -11
  131. data/lib/shopify-cli/sub_command.rb +1 -0
  132. data/lib/shopify-cli/tasks.rb +3 -0
  133. data/lib/shopify-cli/tasks/confirm_store.rb +18 -0
  134. data/lib/shopify-cli/tasks/create_api_client.rb +2 -2
  135. data/lib/shopify-cli/tasks/ensure_authenticated.rb +13 -0
  136. data/lib/shopify-cli/tasks/ensure_loopback_url.rb +1 -1
  137. data/lib/shopify-cli/tasks/ensure_project_type.rb +12 -0
  138. data/lib/shopify-cli/tasks/select_org_and_shop.rb +0 -3
  139. data/lib/shopify-cli/theme/dev_server.rb +98 -0
  140. data/lib/shopify-cli/theme/dev_server/certificate_manager.rb +79 -0
  141. data/lib/shopify-cli/theme/dev_server/header_hash.rb +94 -0
  142. data/lib/shopify-cli/theme/dev_server/hot-reload.js +93 -0
  143. data/lib/shopify-cli/theme/dev_server/hot_reload.rb +76 -0
  144. data/lib/shopify-cli/theme/dev_server/local_assets.rb +87 -0
  145. data/lib/shopify-cli/theme/dev_server/proxy.rb +205 -0
  146. data/lib/shopify-cli/theme/dev_server/sse.rb +75 -0
  147. data/lib/shopify-cli/theme/dev_server/watcher.rb +59 -0
  148. data/lib/shopify-cli/theme/dev_server/web_server.rb +140 -0
  149. data/lib/shopify-cli/theme/development_theme.rb +69 -0
  150. data/lib/shopify-cli/theme/file.rb +112 -0
  151. data/lib/shopify-cli/theme/ignore_filter.rb +109 -0
  152. data/lib/shopify-cli/theme/mime_type.rb +34 -0
  153. data/lib/shopify-cli/theme/syncer.rb +328 -0
  154. data/lib/shopify-cli/theme/theme.rb +204 -0
  155. data/lib/shopify-cli/version.rb +1 -1
  156. data/lib/shopify_cli.rb +18 -11
  157. data/shopify-cli.gemspec +12 -5
  158. data/shopify.fish +1 -1
  159. data/shopify.sh +1 -1
  160. metadata +88 -34
  161. data/.github/workflows/release.yml +0 -59
  162. data/lib/project_types/extension/features/argo_serve_options.rb +0 -42
  163. data/lib/project_types/node/commands/populate.rb +0 -23
  164. data/lib/project_types/rails/commands/populate.rb +0 -23
  165. data/lib/project_types/rails/commands/populate/customer.rb +0 -31
  166. data/lib/project_types/rails/commands/populate/draft_order.rb +0 -28
  167. data/lib/project_types/rails/commands/populate/product.rb +0 -30
  168. data/lib/project_types/theme/commands/connect.rb +0 -54
  169. data/lib/project_types/theme/commands/create.rb +0 -48
  170. data/lib/project_types/theme/commands/deploy.rb +0 -38
  171. data/lib/project_types/theme/commands/generate.rb +0 -20
  172. data/lib/project_types/theme/commands/generate/env.rb +0 -79
  173. data/lib/project_types/theme/forms/connect.rb +0 -34
  174. data/lib/project_types/theme/forms/create.rb +0 -22
  175. data/lib/project_types/theme/tasks/ensure_themekit_installed.rb +0 -78
  176. data/lib/project_types/theme/themekit.rb +0 -113
  177. data/lib/shopify-cli/commands/connect.rb +0 -64
  178. data/lib/shopify-cli/commands/create.rb +0 -50
  179. 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
 
@@ -31,11 +31,33 @@
31
31
 
32
32
  1. Deploy using Shipit
33
33
 
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.
34
+ 1. Update your `main` branch to the latest version
35
+ ```
36
+ $ git checkout main
37
+ $ git pull
38
+ ```
39
+
40
+ 1. On local machine and _AFTER_ gem has been published to https://rubygems.org, run
41
+ ```
42
+ $ rake package
43
+ ```
44
+ This will generate the `.deb`, `.rpm` and brew formula files, which will be located in `packaging/builds/X.Y.Z/`.
36
45
 
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
46
+ 1. Clone the `Shopify/homebrew-shopify` repository (if not already cloned), and then
47
+ * create a branch named `release_X_Y_Z_of_shopify-cli`
48
+ * 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)
49
+ * commit the change and create a PR on the [Shopify Homebrew repository](https://github.com/Shopify/homebrew-shopify)
50
+ * when PR is approved, merge into main branch
40
51
 
52
+ 1. Go to [releases](https://github.com/Shopify/shopify-cli/releases) page of `Shopify/shopify-cli` repo and create a new release:
53
+ * use the tag created by Shipit (should be "vX.Y.Z")
54
+ * release title = "Version X.Y.Z"
55
+ * description should be
56
+ ```
57
+ Release of version X.Y.Z of Shopify CLI
41
58
 
59
+ Please refer to [CHANGELOG](https://github.com/Shopify/shopify-cli/blob/main/CHANGELOG.md) for details.
60
+ ```
61
+ * upload the `.deb` and `.rpm` files from `packaging/builds/X.Y.Z/` (generated in step 9)
62
+ * if it's a pre-release version, select the "This is a pre-release" checkbox
63
+ * 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
 
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
+ }
@@ -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,20 @@ 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")
31
27
  end
28
+ ShopifyCli::Commands.register("Extension::Command", "extension")
32
29
 
33
30
  module Tasks
34
31
  autoload :UserErrors, Project.project_filepath("tasks/user_errors")
@@ -38,8 +35,10 @@ module Extension
38
35
  autoload :UpdateDraft, Project.project_filepath("tasks/update_draft")
39
36
  autoload :FetchSpecifications, Project.project_filepath("tasks/fetch_specifications")
40
37
  autoload :ConfigureFeatures, Project.project_filepath("tasks/configure_features")
38
+ autoload :ConfigureOptions, Project.project_filepath("tasks/configure_options")
41
39
  autoload :ChooseNextAvailablePort, Project.project_filepath("tasks/choose_next_available_port")
42
40
  autoload :FindNpmPackages, Project.project_filepath("tasks/find_npm_packages")
41
+ autoload :GetExtensions, Project.project_filepath("tasks/get_extensions")
43
42
 
44
43
  module Converters
45
44
  autoload :RegistrationConverter, Project.project_filepath("tasks/converters/registration_converter")
@@ -54,10 +53,12 @@ module Extension
54
53
  autoload :AskApp, Project.project_filepath("forms/questions/ask_app")
55
54
  autoload :AskName, Project.project_filepath("forms/questions/ask_name")
56
55
  autoload :AskType, Project.project_filepath("forms/questions/ask_type")
56
+ autoload :AskRegistration, Project.project_filepath("forms/questions/ask_registration")
57
57
  end
58
58
 
59
59
  autoload :Create, Project.project_filepath("forms/create")
60
60
  autoload :Register, Project.project_filepath("forms/register")
61
+ autoload :Connect, Project.project_filepath("forms/connect")
61
62
  end
62
63
 
63
64
  module Features
@@ -75,6 +76,7 @@ module Extension
75
76
  module Models
76
77
  module SpecificationHandlers
77
78
  autoload :Default, Project.project_filepath("models/specification_handlers/default")
79
+ autoload :CheckoutArgoExtension, Project.project_filepath("models/specification_handlers/checkout_ui_extension")
78
80
  end
79
81
 
80
82
  autoload :App, Project.project_filepath("models/app")
@@ -89,4 +91,5 @@ module Extension
89
91
 
90
92
  autoload :ExtensionProjectKeys, Project.project_filepath("extension_project_keys")
91
93
  autoload :ExtensionProject, Project.project_filepath("extension_project")
94
+ autoload :Errors, Project.project_filepath("errors")
92
95
  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
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+ module Extension
3
+ class Command
4
+ class Connect < ExtensionCommand
5
+ prerequisite_task :ensure_authenticated
6
+
7
+ def call(args, _)
8
+ with_connect_form(args) do |form|
9
+ ExtensionProject.write_env_file(
10
+ context: @ctx,
11
+ api_key: form.app.api_key,
12
+ api_secret: form.app.secret,
13
+ registration_id: form.registration.id,
14
+ registration_uuid: form.registration.uuid,
15
+ title: form.registration.title
16
+ )
17
+ @ctx.done(@ctx.message("connect.connected", form.app.title, form.registration.title))
18
+ end
19
+ end
20
+
21
+ def self.help
22
+ ShopifyCli::Context.new.message("connect.help", ShopifyCli::TOOL_NAME, ShopifyCli::TOOL_NAME)
23
+ end
24
+
25
+ private
26
+
27
+ def with_connect_form(args)
28
+ form = Forms::Connect.ask(@ctx, args, { type: specification_handler.identifier.downcase })
29
+ return @ctx.puts(self.class.help) if form.nil?
30
+
31
+ yield form
32
+ end
33
+ end
34
+ end
35
+ end