shopify-cli 1.11.0 → 2.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (207) 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/PULL_REQUEST_TEMPLATE.md +1 -1
  6. data/.github/workflows/build.yml +1 -1
  7. data/.gitignore +3 -0
  8. data/.rubocop.yml +3 -1
  9. data/.ruby-version +1 -1
  10. data/CHANGELOG.md +48 -20
  11. data/Gemfile +4 -0
  12. data/Gemfile.lock +32 -0
  13. data/LICENSE +4 -1
  14. data/README.md +92 -26
  15. data/RELEASING.md +29 -7
  16. data/Rakefile +2 -2
  17. data/SECURITY.md +1 -1
  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/find_organization.graphql +2 -1
  36. data/lib/project_types/extension/cli.rb +18 -15
  37. data/lib/project_types/extension/commands/build.rb +4 -5
  38. data/lib/project_types/extension/commands/connect.rb +35 -0
  39. data/lib/project_types/extension/commands/create.rb +12 -16
  40. data/lib/project_types/extension/commands/extension_command.rb +2 -2
  41. data/lib/project_types/extension/commands/info.rb +86 -0
  42. data/lib/project_types/extension/commands/push.rb +8 -7
  43. data/lib/project_types/extension/commands/register.rb +4 -5
  44. data/lib/project_types/extension/commands/serve.rb +5 -8
  45. data/lib/project_types/extension/commands/tunnel.rb +3 -1
  46. data/lib/project_types/extension/errors.rb +9 -0
  47. data/lib/project_types/extension/extension_project.rb +5 -0
  48. data/lib/project_types/extension/features/argo.rb +6 -6
  49. data/lib/project_types/extension/features/argo_runtime.rb +22 -38
  50. data/lib/project_types/extension/features/argo_serve.rb +25 -20
  51. data/lib/project_types/extension/forms/connect.rb +42 -0
  52. data/lib/project_types/extension/forms/questions/ask_name.rb +14 -6
  53. data/lib/project_types/extension/forms/questions/ask_registration.rb +51 -0
  54. data/lib/project_types/extension/messages/messages.rb +75 -11
  55. data/lib/project_types/extension/models/specification.rb +1 -0
  56. data/lib/project_types/extension/models/specification_handlers/{checkout_argo_extension.rb → checkout_ui_extension.rb} +3 -1
  57. data/lib/project_types/extension/models/specification_handlers/default.rb +21 -6
  58. data/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +86 -0
  59. data/lib/project_types/extension/models/specifications.rb +1 -0
  60. data/lib/project_types/extension/tasks/configure_features.rb +6 -7
  61. data/lib/project_types/extension/tasks/configure_options.rb +20 -0
  62. data/lib/project_types/extension/tasks/get_extensions.rb +32 -0
  63. data/lib/project_types/node/cli.rb +9 -21
  64. data/lib/project_types/node/commands/connect.rb +8 -2
  65. data/lib/project_types/node/commands/create.rb +9 -5
  66. data/lib/project_types/node/commands/deploy.rb +15 -5
  67. data/lib/project_types/node/commands/deploy/heroku.rb +29 -29
  68. data/lib/project_types/node/commands/generate.rb +4 -2
  69. data/lib/project_types/node/commands/open.rb +4 -2
  70. data/lib/project_types/node/commands/serve.rb +3 -2
  71. data/lib/project_types/node/commands/tunnel.rb +4 -2
  72. data/lib/project_types/node/messages/messages.rb +46 -89
  73. data/lib/project_types/rails/cli.rb +9 -21
  74. data/lib/project_types/rails/commands/connect.rb +8 -2
  75. data/lib/project_types/rails/commands/create.rb +10 -6
  76. data/lib/project_types/rails/commands/deploy.rb +15 -5
  77. data/lib/project_types/rails/commands/deploy/heroku.rb +84 -82
  78. data/lib/project_types/rails/commands/generate.rb +15 -5
  79. data/lib/project_types/rails/commands/generate/webhook.rb +28 -26
  80. data/lib/project_types/rails/commands/open.rb +4 -2
  81. data/lib/project_types/rails/commands/serve.rb +3 -2
  82. data/lib/project_types/rails/commands/tunnel.rb +4 -2
  83. data/lib/project_types/rails/messages/messages.rb +54 -101
  84. data/lib/project_types/script/cli.rb +18 -20
  85. data/lib/project_types/script/commands/create.rb +3 -1
  86. data/lib/project_types/script/commands/push.rb +12 -5
  87. data/lib/project_types/script/config/extension_points.yml +0 -3
  88. data/lib/project_types/script/graphql/app_script_update_or_create.graphql +9 -3
  89. data/lib/project_types/script/layers/application/create_script.rb +6 -5
  90. data/lib/project_types/script/layers/application/push_script.rb +2 -1
  91. data/lib/project_types/script/layers/domain/errors.rb +6 -11
  92. data/lib/project_types/script/layers/domain/push_package.rb +4 -8
  93. data/lib/project_types/script/layers/domain/script_json.rb +32 -0
  94. data/lib/project_types/script/layers/domain/script_project.rb +1 -1
  95. data/lib/project_types/script/layers/infrastructure/errors.rb +14 -18
  96. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb +105 -0
  97. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_task_runner.rb +103 -0
  98. data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +26 -0
  99. data/lib/project_types/script/layers/infrastructure/languages/rust_project_creator.rb +73 -0
  100. data/lib/project_types/script/layers/infrastructure/languages/rust_task_runner.rb +60 -0
  101. data/lib/project_types/script/layers/infrastructure/languages/task_runner.rb +21 -0
  102. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +2 -4
  103. data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +45 -34
  104. data/lib/project_types/script/layers/infrastructure/script_service.rb +20 -14
  105. data/lib/project_types/script/messages/messages.rb +66 -55
  106. data/lib/project_types/script/tasks/ensure_env.rb +22 -1
  107. data/lib/project_types/script/ui/error_handler.rb +32 -32
  108. data/lib/project_types/theme/cli.rb +15 -27
  109. data/lib/project_types/theme/commands/check.rb +33 -0
  110. data/lib/project_types/theme/commands/delete.rb +64 -0
  111. data/lib/project_types/theme/commands/language_server.rb +16 -0
  112. data/lib/project_types/theme/commands/package.rb +55 -0
  113. data/lib/project_types/theme/commands/publish.rb +43 -0
  114. data/lib/project_types/theme/commands/pull.rb +51 -0
  115. data/lib/project_types/theme/commands/push.rb +58 -32
  116. data/lib/project_types/theme/commands/serve.rb +7 -17
  117. data/lib/project_types/theme/forms/confirm_store.rb +15 -0
  118. data/lib/project_types/theme/forms/select.rb +59 -0
  119. data/lib/project_types/theme/messages/messages.rb +110 -106
  120. data/lib/project_types/theme/ui/sync_progress_bar.rb +20 -0
  121. data/lib/shopify-cli/admin_api.rb +53 -35
  122. data/lib/shopify-cli/admin_api/populate_resource_command.rb +6 -14
  123. data/lib/shopify-cli/admin_api/schema.rb +1 -10
  124. data/lib/shopify-cli/api.rb +29 -14
  125. data/lib/shopify-cli/command.rb +15 -3
  126. data/lib/shopify-cli/commands.rb +7 -2
  127. data/lib/shopify-cli/commands/help.rb +2 -29
  128. data/lib/shopify-cli/commands/login.rb +95 -0
  129. data/lib/shopify-cli/commands/logout.rb +24 -8
  130. data/lib/shopify-cli/commands/populate.rb +23 -0
  131. data/lib/{project_types/node → shopify-cli}/commands/populate/customer.rb +2 -8
  132. data/lib/{project_types/node → shopify-cli}/commands/populate/draft_order.rb +2 -2
  133. data/lib/{project_types/node → shopify-cli}/commands/populate/product.rb +2 -8
  134. data/lib/shopify-cli/commands/store.rb +15 -0
  135. data/lib/shopify-cli/commands/switch.rb +39 -0
  136. data/lib/shopify-cli/commands/system.rb +12 -0
  137. data/lib/shopify-cli/commands/whoami.rb +28 -0
  138. data/lib/shopify-cli/connect.rb +32 -0
  139. data/lib/shopify-cli/context.rb +65 -4
  140. data/lib/shopify-cli/core/entry_point.rb +3 -22
  141. data/lib/shopify-cli/db.rb +4 -4
  142. data/lib/shopify-cli/http_request.rb +10 -0
  143. data/lib/shopify-cli/identity_auth.rb +282 -0
  144. data/lib/shopify-cli/{oauth → identity_auth}/servlet.rb +11 -12
  145. data/lib/shopify-cli/messages/messages.rb +133 -39
  146. data/lib/shopify-cli/partners_api.rb +21 -41
  147. data/lib/shopify-cli/partners_api/organizations.rb +8 -0
  148. data/lib/shopify-cli/project_commands.rb +16 -0
  149. data/lib/shopify-cli/project_type.rb +0 -31
  150. data/lib/shopify-cli/resources/env_file.rb +1 -1
  151. data/lib/shopify-cli/shopifolk.rb +8 -11
  152. data/lib/shopify-cli/sub_command.rb +1 -0
  153. data/lib/shopify-cli/tasks.rb +3 -0
  154. data/lib/shopify-cli/tasks/confirm_store.rb +18 -0
  155. data/lib/shopify-cli/tasks/create_api_client.rb +2 -2
  156. data/lib/shopify-cli/tasks/ensure_authenticated.rb +13 -0
  157. data/lib/shopify-cli/tasks/ensure_loopback_url.rb +1 -1
  158. data/lib/shopify-cli/tasks/ensure_project_type.rb +12 -0
  159. data/lib/shopify-cli/tasks/select_org_and_shop.rb +0 -3
  160. data/lib/shopify-cli/theme/dev_server.rb +98 -0
  161. data/lib/shopify-cli/theme/dev_server/certificate_manager.rb +79 -0
  162. data/lib/shopify-cli/theme/dev_server/header_hash.rb +94 -0
  163. data/lib/shopify-cli/theme/dev_server/hot-reload.js +93 -0
  164. data/lib/shopify-cli/theme/dev_server/hot_reload.rb +76 -0
  165. data/lib/shopify-cli/theme/dev_server/local_assets.rb +87 -0
  166. data/lib/shopify-cli/theme/dev_server/proxy.rb +205 -0
  167. data/lib/shopify-cli/theme/dev_server/sse.rb +75 -0
  168. data/lib/shopify-cli/theme/dev_server/watcher.rb +59 -0
  169. data/lib/shopify-cli/theme/dev_server/web_server.rb +140 -0
  170. data/lib/shopify-cli/theme/development_theme.rb +69 -0
  171. data/lib/shopify-cli/theme/file.rb +112 -0
  172. data/lib/shopify-cli/theme/ignore_filter.rb +109 -0
  173. data/lib/shopify-cli/theme/mime_type.rb +34 -0
  174. data/lib/shopify-cli/theme/syncer.rb +328 -0
  175. data/lib/shopify-cli/theme/theme.rb +204 -0
  176. data/lib/shopify-cli/version.rb +1 -1
  177. data/lib/shopify_cli.rb +18 -11
  178. data/shopify-cli.gemspec +12 -5
  179. data/shopify.fish +1 -1
  180. data/shopify.sh +1 -1
  181. metadata +95 -41
  182. data/.github/workflows/release.yml +0 -61
  183. data/lib/project_types/extension/features/argo_serve_options.rb +0 -40
  184. data/lib/project_types/node/commands/populate.rb +0 -23
  185. data/lib/project_types/rails/commands/populate.rb +0 -23
  186. data/lib/project_types/rails/commands/populate/customer.rb +0 -31
  187. data/lib/project_types/rails/commands/populate/draft_order.rb +0 -28
  188. data/lib/project_types/rails/commands/populate/product.rb +0 -30
  189. data/lib/project_types/script/layers/domain/config_ui.rb +0 -16
  190. data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +0 -95
  191. data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +0 -101
  192. data/lib/project_types/script/layers/infrastructure/project_creator.rb +0 -24
  193. data/lib/project_types/script/layers/infrastructure/rust_project_creator.rb +0 -71
  194. data/lib/project_types/script/layers/infrastructure/rust_task_runner.rb +0 -58
  195. data/lib/project_types/script/layers/infrastructure/task_runner.rb +0 -19
  196. data/lib/project_types/theme/commands/connect.rb +0 -54
  197. data/lib/project_types/theme/commands/create.rb +0 -48
  198. data/lib/project_types/theme/commands/deploy.rb +0 -38
  199. data/lib/project_types/theme/commands/generate.rb +0 -20
  200. data/lib/project_types/theme/commands/generate/env.rb +0 -79
  201. data/lib/project_types/theme/forms/connect.rb +0 -34
  202. data/lib/project_types/theme/forms/create.rb +0 -22
  203. data/lib/project_types/theme/tasks/ensure_themekit_installed.rb +0 -78
  204. data/lib/project_types/theme/themekit.rb +0 -113
  205. data/lib/shopify-cli/commands/connect.rb +0 -64
  206. data/lib/shopify-cli/commands/create.rb +0 -50
  207. data/lib/shopify-cli/oauth.rb +0 -198
@@ -0,0 +1,204 @@
1
+ # frozen_string_literal: true
2
+ require_relative "file"
3
+
4
+ require "pathname"
5
+ require "time"
6
+
7
+ module ShopifyCli
8
+ module Theme
9
+ class InvalidThemeRole < StandardError; end
10
+
11
+ class Theme
12
+ attr_reader :root, :id
13
+
14
+ def initialize(ctx, root: nil, id: nil, name: nil, role: nil)
15
+ @ctx = ctx
16
+ @root = Pathname.new(root) if root
17
+ @id = id
18
+ @name = name
19
+ @role = role
20
+ end
21
+
22
+ def theme_files
23
+ glob(["**/*.liquid", "**/*.json", "assets/*"])
24
+ end
25
+
26
+ def asset_files
27
+ glob("assets/*")
28
+ end
29
+
30
+ def liquid_files
31
+ glob("**/*.liquid")
32
+ end
33
+
34
+ def json_files
35
+ glob("**/*.json")
36
+ end
37
+
38
+ def glob(pattern)
39
+ root.glob(pattern).map { |path| File.new(path, root) }
40
+ end
41
+
42
+ def theme_file?(file)
43
+ theme_files.include?(self[file])
44
+ end
45
+
46
+ def asset_paths
47
+ asset_files.map(&:relative_path)
48
+ end
49
+
50
+ def [](file)
51
+ case file
52
+ when File
53
+ file
54
+ when Pathname
55
+ File.new(file, root)
56
+ when String
57
+ File.new(root.join(file), root)
58
+ end
59
+ end
60
+
61
+ def shop
62
+ AdminAPI.get_shop_or_abort(@ctx)
63
+ end
64
+
65
+ def editor_url
66
+ "https://#{shop}/admin/themes/#{id}/editor"
67
+ end
68
+
69
+ def name
70
+ return @name if @name
71
+ load_info_from_api.name
72
+ end
73
+
74
+ def role
75
+ if @role == "main"
76
+ # Main theme is called Live in UI
77
+ "live"
78
+ elsif @role
79
+ @role
80
+ else
81
+ load_info_from_api.role
82
+ end
83
+ end
84
+
85
+ def live?
86
+ role == "live"
87
+ end
88
+
89
+ def development?
90
+ role == "development"
91
+ end
92
+
93
+ def preview_url
94
+ if live?
95
+ "https://#{shop}/"
96
+ else
97
+ "https://#{shop}/?preview_theme_id=#{id}"
98
+ end
99
+ end
100
+
101
+ def create
102
+ raise InvalidThemeRole, "Can't create live theme. Use publish." if live?
103
+
104
+ _status, body = ShopifyCli::AdminAPI.rest_request(
105
+ @ctx,
106
+ shop: shop,
107
+ path: "themes.json",
108
+ body: JSON.generate({
109
+ theme: {
110
+ name: name,
111
+ role: role,
112
+ },
113
+ }),
114
+ method: "POST",
115
+ api_version: "unstable",
116
+ )
117
+
118
+ @id = body["theme"]["id"]
119
+ end
120
+
121
+ def delete
122
+ AdminAPI.rest_request(
123
+ @ctx,
124
+ shop: shop,
125
+ method: "DELETE",
126
+ path: "themes/#{id}.json",
127
+ api_version: "unstable",
128
+ )
129
+ end
130
+
131
+ def publish
132
+ return if live?
133
+ AdminAPI.rest_request(
134
+ @ctx,
135
+ shop: shop,
136
+ method: "PUT",
137
+ path: "themes/#{id}.json",
138
+ api_version: "unstable",
139
+ body: JSON.generate(theme: {
140
+ role: "main",
141
+ })
142
+ )
143
+ @role = "live"
144
+ end
145
+
146
+ def current_development?
147
+ development? && id == ShopifyCli::DB.get(:development_theme_id)
148
+ end
149
+
150
+ def foreign_development?
151
+ development? && id != ShopifyCli::DB.get(:development_theme_id)
152
+ end
153
+
154
+ def to_h
155
+ {
156
+ id: id,
157
+ name: name,
158
+ role: role,
159
+ shop: shop,
160
+ editor_url: editor_url,
161
+ preview_url: preview_url,
162
+ }
163
+ end
164
+
165
+ def self.all(ctx, root: nil)
166
+ _status, body = AdminAPI.rest_request(
167
+ ctx,
168
+ shop: AdminAPI.get_shop_or_abort(ctx),
169
+ path: "themes.json",
170
+ api_version: "unstable",
171
+ )
172
+
173
+ body["themes"]
174
+ .sort_by { |attributes| Time.parse(attributes["updated_at"]) }
175
+ .reverse
176
+ .map do |attributes|
177
+ new(
178
+ ctx,
179
+ root: root,
180
+ id: attributes["id"],
181
+ name: attributes["name"],
182
+ role: attributes["role"],
183
+ )
184
+ end
185
+ end
186
+
187
+ private
188
+
189
+ def load_info_from_api
190
+ _status, body = AdminAPI.rest_request(
191
+ @ctx,
192
+ shop: shop,
193
+ path: "themes/#{id}.json",
194
+ api_version: "unstable",
195
+ )
196
+
197
+ @name = body.dig("theme", "name")
198
+ @role = body.dig("theme", "role")
199
+
200
+ self
201
+ end
202
+ end
203
+ end
204
+ end
@@ -1,3 +1,3 @@
1
1
  module ShopifyCli
2
- VERSION = "1.11.0"
2
+ VERSION = "2.0.0"
3
3
  end
data/lib/shopify_cli.rb CHANGED
@@ -27,15 +27,15 @@ require "smart_properties"
27
27
  require_relative "shopify-cli/version"
28
28
 
29
29
  # Enable stdout routing. At this point all calls to STDOUT (and STDERR) will go through this class.
30
- # See https://github.com/Shopify/cli-ui/blob/master/lib/cli/ui/stdout_router.rb for more info
30
+ # See https://github.com/Shopify/cli-ui/blob/main/lib/cli/ui/stdout_router.rb for more info
31
31
  CLI::UI::StdoutRouter.enable
32
32
 
33
- # The main file to load for `shopify-app-cli`
33
+ # The main file to load for `shopify-cli`
34
34
  # Contains all high level constants, exit management, exception management,
35
35
  # autoloads for commands, tasks, helpers, etc
36
36
  #
37
37
  # It is recommended to read through CLI Kit (https://github.com/shopify/cli-kit) and a CLI Kit example
38
- # (https://github.com/Shopify/cli-kit-example) to fully understand how shopify-app-cli functions
38
+ # (https://github.com/Shopify/cli-kit-example) to fully understand how shopify-cli functions
39
39
  module ShopifyCli
40
40
  extend CLI::Kit::Autocall
41
41
 
@@ -50,8 +50,8 @@ module ShopifyCli
50
50
  # shrug or boom emoji
51
51
  FAILMOJI = ROOT == "/opt/shopify" ? "\u{1f937}" : "\u{1f4a5}"
52
52
 
53
- # Exit management in `shopify-app-cli` follows the management set out by CLI Kit.
54
- # https://github.com/Shopify/cli-kit/blob/master/lib/cli/kit.rb
53
+ # Exit management in `shopify-cli` follows the management set out by CLI Kit.
54
+ # https://github.com/Shopify/cli-kit/blob/main/lib/cli/kit.rb
55
55
  # That is to say, we differentiate between exit success (0), exit failure (1), and exit bug (not 1)
56
56
  #
57
57
  # These should *never* be called outside of the entrypoint and its delegations.
@@ -59,8 +59,8 @@ module ShopifyCli
59
59
  EXIT_BUG = CLI::Kit::EXIT_BUG
60
60
  EXIT_SUCCESS = CLI::Kit::EXIT_SUCCESS
61
61
 
62
- # `shopify-app-cli` uses CLI Kit's exception management
63
- # These are documented here: https://github.com/Shopify/cli-kit/blob/master/lib/cli/kit.rb
62
+ # `shopify-cli` uses CLI Kit's exception management
63
+ # These are documented here: https://github.com/Shopify/cli-kit/blob/main/lib/cli/kit.rb
64
64
  #
65
65
  # You should never subclass these exceptions, but instead rescue another exception and re-raise.
66
66
  # AbortSilent and BugSilent should never have messages. They are mostly used when we output explanations
@@ -71,9 +71,9 @@ module ShopifyCli
71
71
  BugSilent = CLI::Kit::BugSilent
72
72
  AbortSilent = CLI::Kit::AbortSilent
73
73
 
74
- # The rest of this file outlines classes and modules required by the shopify-app-cli
74
+ # The rest of this file outlines classes and modules required by the shopify-cli
75
75
  # application and CLI kit framework.
76
- # To understand how this works, read https://github.com/Shopify/cli-kit/blob/master/lib/cli/kit.rb
76
+ # To understand how this works, read https://github.com/Shopify/cli-kit/blob/main/lib/cli/kit.rb
77
77
 
78
78
  # ShopifyCli::Config
79
79
  autocall(:Config) { CLI::Kit::Config.new(tool_name: TOOL_NAME) }
@@ -98,6 +98,7 @@ module ShopifyCli
98
98
  autoload :API, "shopify-cli/api"
99
99
  autoload :Command, "shopify-cli/command"
100
100
  autoload :Commands, "shopify-cli/commands"
101
+ autoload :Connect, "shopify-cli/connect"
101
102
  autoload :Context, "shopify-cli/context"
102
103
  autoload :Core, "shopify-cli/core"
103
104
  autoload :DB, "shopify-cli/db"
@@ -106,15 +107,16 @@ module ShopifyCli
106
107
  autoload :Git, "shopify-cli/git"
107
108
  autoload :Helpers, "shopify-cli/helpers"
108
109
  autoload :Heroku, "shopify-cli/heroku"
110
+ autoload :IdentityAuth, "shopify-cli/identity_auth"
109
111
  autoload :JsDeps, "shopify-cli/js_deps"
110
112
  autoload :JsSystem, "shopify-cli/js_system"
111
- autoload :MethodObject, "shopify-cli/method_object"
112
113
  autoload :LazyDelegator, "shopify-cli/lazy_delegator"
113
- autoload :OAuth, "shopify-cli/oauth"
114
+ autoload :MethodObject, "shopify-cli/method_object"
114
115
  autoload :Options, "shopify-cli/options"
115
116
  autoload :PartnersAPI, "shopify-cli/partners_api"
116
117
  autoload :ProcessSupervision, "shopify-cli/process_supervision"
117
118
  autoload :Project, "shopify-cli/project"
119
+ autoload :ProjectCommands, "shopify-cli/project_commands"
118
120
  autoload :ProjectType, "shopify-cli/project_type"
119
121
  autoload :ResolveConstant, "shopify-cli/resolve_constant"
120
122
  autoload :Resources, "shopify-cli/resources"
@@ -161,4 +163,9 @@ module ShopifyCli
161
163
  def self.debug_log_file
162
164
  File.join(tool_config_path, "logs", "debug.log")
163
165
  end
166
+
167
+ def self.sha
168
+ return @sha if defined?(@sha)
169
+ @sha = Git.sha(dir: ShopifyCli::ROOT)
170
+ end
164
171
  end
data/shopify-cli.gemspec CHANGED
@@ -14,14 +14,14 @@ Gem::Specification.new do |spec|
14
14
  development process and lets you quickly add popular features, such as billing
15
15
  and webhooks.
16
16
  HERE
17
- spec.homepage = "https://shopify.github.io/shopify-app-cli/"
18
- spec.required_ruby_version = Gem::Requirement.new(">= 2.5")
17
+ spec.homepage = "https://shopify.github.io/shopify-cli/"
18
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.6")
19
19
 
20
20
  spec.metadata["allowed_push_host"] = "https://rubygems.org"
21
21
 
22
22
  spec.metadata["homepage_uri"] = spec.homepage
23
- spec.metadata["source_code_uri"] = "https://github.com/Shopify/shopify-app-cli"
24
- spec.metadata["changelog_uri"] = "https://github.com/Shopify/shopify-app-cli/blob/master/CHANGELOG.md"
23
+ spec.metadata["source_code_uri"] = "https://github.com/Shopify/shopify-cli"
24
+ spec.metadata["changelog_uri"] = "https://github.com/Shopify/shopify-cli/blob/main/CHANGELOG.md"
25
25
 
26
26
  # Specify which files should be added to the gem when it is released.
27
27
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -34,8 +34,15 @@ Gem::Specification.new do |spec|
34
34
  spec.bindir = "bin"
35
35
  spec.require_paths = ["lib", "vendor"]
36
36
  spec.extensions = ["ext/shopify-cli/extconf.rb"]
37
+ # Do NOT include `shopify` as a listed executable via `spec.executables`.
38
+ # `ext/shopify-cli/extconf.rb` will dynamically create a script and soft-link
39
+ # `/usr/local/bin/shopify` to that script, in order to "lock" the Ruby used to
40
+ # a single Ruby (useful for debugging in multi-Ruby environments)
37
41
 
38
- spec.add_development_dependency("bundler", "~> 1.17")
42
+ spec.add_development_dependency("bundler", "~> 2.1.4")
39
43
  spec.add_development_dependency("rake", "~> 12.3", ">= 12.3.3")
40
44
  spec.add_development_dependency("minitest", "~> 5.0")
45
+
46
+ spec.add_dependency("listen", "~> 3.5")
47
+ spec.add_dependency("theme-check", "~> 1.0")
41
48
  end
data/shopify.fish CHANGED
@@ -4,7 +4,7 @@
4
4
  # If we're not already in a shim environment but still tried to set up a shim, print out the re-installation warning
5
5
  type -t shopify > /dev/null 2>&1
6
6
  if [ $status != "0" ]
7
- echo "This version of Shopify App CLI is no longer supported. You’ll need to migrate to the new CLI version to continue.
7
+ echo "This version of Shopify CLI is no longer supported. You’ll need to migrate to the new CLI version to continue.
8
8
 
9
9
  Please visit this page for complete instructions:
10
10
  https://shopify.dev/tools/cli/troubleshooting#migrate-from-a-legacy-version
data/shopify.sh CHANGED
@@ -3,7 +3,7 @@
3
3
  # If we're not already in a shim environment but still tried to set up a shim, print out the re-installation warning
4
4
  typeset -f shopify > /dev/null 2>&1
5
5
  if [ "$?" != "0" ]; then
6
- echo "This version of Shopify App CLI is no longer supported. You’ll need to migrate to the new CLI version to continue.
6
+ echo "This version of Shopify CLI is no longer supported. You’ll need to migrate to the new CLI version to continue.
7
7
 
8
8
  Please visit this page for complete instructions:
9
9
  https://shopify.dev/tools/cli/troubleshooting#migrate-from-a-legacy-version
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shopify-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.0
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shopify
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-19 00:00:00.000000000 Z
11
+ date: 2021-06-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.17'
19
+ version: 2.1.4
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.17'
26
+ version: 2.1.4
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rake
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -58,6 +58,34 @@ dependencies:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: '5.0'
61
+ - !ruby/object:Gem::Dependency
62
+ name: listen
63
+ requirement: !ruby/object:Gem::Requirement
64
+ requirements:
65
+ - - "~>"
66
+ - !ruby/object:Gem::Version
67
+ version: '3.5'
68
+ type: :runtime
69
+ prerelease: false
70
+ version_requirements: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - "~>"
73
+ - !ruby/object:Gem::Version
74
+ version: '3.5'
75
+ - !ruby/object:Gem::Dependency
76
+ name: theme-check
77
+ requirement: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - "~>"
80
+ - !ruby/object:Gem::Version
81
+ version: '1.0'
82
+ type: :runtime
83
+ prerelease: false
84
+ version_requirements: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
87
+ - !ruby/object:Gem::Version
88
+ version: '1.0'
61
89
  description: |
62
90
  Shopify CLI helps you build Shopify apps faster. It quickly scaffolds Node.js
63
91
  and Ruby on Rails embedded apps. It also automates many common tasks in the
@@ -78,7 +106,6 @@ files:
78
106
  - ".github/PULL_REQUEST_TEMPLATE.md"
79
107
  - ".github/probots.yml"
80
108
  - ".github/workflows/build.yml"
81
- - ".github/workflows/release.yml"
82
109
  - ".github/workflows/triage.yml"
83
110
  - ".gitignore"
84
111
  - ".rubocop.yml"
@@ -118,6 +145,7 @@ files:
118
145
  - lib/graphql/admin_introspection.graphql
119
146
  - lib/graphql/all_organizations.graphql
120
147
  - lib/graphql/all_orgs_with_apps.graphql
148
+ - lib/graphql/all_orgs_with_extensions.graphql
121
149
  - lib/graphql/api_versions.graphql
122
150
  - lib/graphql/convert_dev_to_test_store.graphql
123
151
  - lib/graphql/create_app.graphql
@@ -133,12 +161,15 @@ files:
133
161
  - lib/graphql/update_dashboard_urls.graphql
134
162
  - lib/project_types/extension/cli.rb
135
163
  - lib/project_types/extension/commands/build.rb
164
+ - lib/project_types/extension/commands/connect.rb
136
165
  - lib/project_types/extension/commands/create.rb
137
166
  - lib/project_types/extension/commands/extension_command.rb
167
+ - lib/project_types/extension/commands/info.rb
138
168
  - lib/project_types/extension/commands/push.rb
139
169
  - lib/project_types/extension/commands/register.rb
140
170
  - lib/project_types/extension/commands/serve.rb
141
171
  - lib/project_types/extension/commands/tunnel.rb
172
+ - lib/project_types/extension/errors.rb
142
173
  - lib/project_types/extension/extension_project.rb
143
174
  - lib/project_types/extension/extension_project_keys.rb
144
175
  - lib/project_types/extension/features/argo.rb
@@ -146,13 +177,14 @@ files:
146
177
  - lib/project_types/extension/features/argo_dependencies.rb
147
178
  - lib/project_types/extension/features/argo_runtime.rb
148
179
  - lib/project_types/extension/features/argo_serve.rb
149
- - lib/project_types/extension/features/argo_serve_options.rb
150
180
  - lib/project_types/extension/features/argo_setup.rb
151
181
  - lib/project_types/extension/features/argo_setup_step.rb
152
182
  - lib/project_types/extension/features/argo_setup_steps.rb
183
+ - lib/project_types/extension/forms/connect.rb
153
184
  - lib/project_types/extension/forms/create.rb
154
185
  - lib/project_types/extension/forms/questions/ask_app.rb
155
186
  - lib/project_types/extension/forms/questions/ask_name.rb
187
+ - lib/project_types/extension/forms/questions/ask_registration.rb
156
188
  - lib/project_types/extension/forms/questions/ask_type.rb
157
189
  - lib/project_types/extension/messages/message_loading.rb
158
190
  - lib/project_types/extension/messages/messages.rb
@@ -161,14 +193,16 @@ files:
161
193
  - lib/project_types/extension/models/npm_package.rb
162
194
  - lib/project_types/extension/models/registration.rb
163
195
  - lib/project_types/extension/models/specification.rb
164
- - lib/project_types/extension/models/specification_handlers/checkout_argo_extension.rb
165
196
  - lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb
197
+ - lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
166
198
  - lib/project_types/extension/models/specification_handlers/default.rb
199
+ - lib/project_types/extension/models/specification_handlers/theme_app_extension.rb
167
200
  - lib/project_types/extension/models/specifications.rb
168
201
  - lib/project_types/extension/models/validation_error.rb
169
202
  - lib/project_types/extension/models/version.rb
170
203
  - lib/project_types/extension/tasks/choose_next_available_port.rb
171
204
  - lib/project_types/extension/tasks/configure_features.rb
205
+ - lib/project_types/extension/tasks/configure_options.rb
172
206
  - lib/project_types/extension/tasks/converters/app_converter.rb
173
207
  - lib/project_types/extension/tasks/converters/registration_converter.rb
174
208
  - lib/project_types/extension/tasks/converters/validation_error_converter.rb
@@ -178,6 +212,7 @@ files:
178
212
  - lib/project_types/extension/tasks/find_npm_packages.rb
179
213
  - lib/project_types/extension/tasks/get_app.rb
180
214
  - lib/project_types/extension/tasks/get_apps.rb
215
+ - lib/project_types/extension/tasks/get_extensions.rb
181
216
  - lib/project_types/extension/tasks/update_draft.rb
182
217
  - lib/project_types/extension/tasks/user_errors.rb
183
218
  - lib/project_types/node/cli.rb
@@ -187,10 +222,6 @@ files:
187
222
  - lib/project_types/node/commands/deploy/heroku.rb
188
223
  - lib/project_types/node/commands/generate.rb
189
224
  - lib/project_types/node/commands/open.rb
190
- - lib/project_types/node/commands/populate.rb
191
- - lib/project_types/node/commands/populate/customer.rb
192
- - lib/project_types/node/commands/populate/draft_order.rb
193
- - lib/project_types/node/commands/populate/product.rb
194
225
  - lib/project_types/node/commands/serve.rb
195
226
  - lib/project_types/node/commands/tunnel.rb
196
227
  - lib/project_types/node/forms/create.rb
@@ -203,10 +234,6 @@ files:
203
234
  - lib/project_types/rails/commands/generate.rb
204
235
  - lib/project_types/rails/commands/generate/webhook.rb
205
236
  - lib/project_types/rails/commands/open.rb
206
- - lib/project_types/rails/commands/populate.rb
207
- - lib/project_types/rails/commands/populate/customer.rb
208
- - lib/project_types/rails/commands/populate/draft_order.rb
209
- - lib/project_types/rails/commands/populate/product.rb
210
237
  - lib/project_types/rails/commands/serve.rb
211
238
  - lib/project_types/rails/commands/tunnel.rb
212
239
  - lib/project_types/rails/forms/create.rb
@@ -227,42 +254,42 @@ files:
227
254
  - lib/project_types/script/layers/application/extension_points.rb
228
255
  - lib/project_types/script/layers/application/project_dependencies.rb
229
256
  - lib/project_types/script/layers/application/push_script.rb
230
- - lib/project_types/script/layers/domain/config_ui.rb
231
257
  - lib/project_types/script/layers/domain/errors.rb
232
258
  - lib/project_types/script/layers/domain/extension_point.rb
233
259
  - lib/project_types/script/layers/domain/metadata.rb
234
260
  - lib/project_types/script/layers/domain/push_package.rb
261
+ - lib/project_types/script/layers/domain/script_json.rb
235
262
  - lib/project_types/script/layers/domain/script_project.rb
236
- - lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb
237
- - lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb
238
263
  - lib/project_types/script/layers/infrastructure/command_runner.rb
239
264
  - lib/project_types/script/layers/infrastructure/errors.rb
240
265
  - lib/project_types/script/layers/infrastructure/extension_point_repository.rb
241
- - lib/project_types/script/layers/infrastructure/project_creator.rb
266
+ - lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb
267
+ - lib/project_types/script/layers/infrastructure/languages/assemblyscript_task_runner.rb
268
+ - lib/project_types/script/layers/infrastructure/languages/project_creator.rb
269
+ - lib/project_types/script/layers/infrastructure/languages/rust_project_creator.rb
270
+ - lib/project_types/script/layers/infrastructure/languages/rust_task_runner.rb
271
+ - lib/project_types/script/layers/infrastructure/languages/task_runner.rb
242
272
  - lib/project_types/script/layers/infrastructure/push_package_repository.rb
243
- - lib/project_types/script/layers/infrastructure/rust_project_creator.rb
244
- - lib/project_types/script/layers/infrastructure/rust_task_runner.rb
245
273
  - lib/project_types/script/layers/infrastructure/script_project_repository.rb
246
274
  - lib/project_types/script/layers/infrastructure/script_service.rb
247
- - lib/project_types/script/layers/infrastructure/task_runner.rb
248
275
  - lib/project_types/script/messages/messages.rb
249
276
  - lib/project_types/script/tasks/ensure_env.rb
250
277
  - lib/project_types/script/ui/error_handler.rb
251
278
  - lib/project_types/script/ui/printing_spinner.rb
252
279
  - lib/project_types/script/ui/strict_spinner.rb
253
280
  - lib/project_types/theme/cli.rb
254
- - lib/project_types/theme/commands/connect.rb
255
- - lib/project_types/theme/commands/create.rb
256
- - lib/project_types/theme/commands/deploy.rb
257
- - lib/project_types/theme/commands/generate.rb
258
- - lib/project_types/theme/commands/generate/env.rb
281
+ - lib/project_types/theme/commands/check.rb
282
+ - lib/project_types/theme/commands/delete.rb
283
+ - lib/project_types/theme/commands/language_server.rb
284
+ - lib/project_types/theme/commands/package.rb
285
+ - lib/project_types/theme/commands/publish.rb
286
+ - lib/project_types/theme/commands/pull.rb
259
287
  - lib/project_types/theme/commands/push.rb
260
288
  - lib/project_types/theme/commands/serve.rb
261
- - lib/project_types/theme/forms/connect.rb
262
- - lib/project_types/theme/forms/create.rb
289
+ - lib/project_types/theme/forms/confirm_store.rb
290
+ - lib/project_types/theme/forms/select.rb
263
291
  - lib/project_types/theme/messages/messages.rb
264
- - lib/project_types/theme/tasks/ensure_themekit_installed.rb
265
- - lib/project_types/theme/themekit.rb
292
+ - lib/project_types/theme/ui/sync_progress_bar.rb
266
293
  - lib/rubygems_plugin.rb
267
294
  - lib/shopify-cli/admin_api.rb
268
295
  - lib/shopify-cli/admin_api/populate_resource_command.rb
@@ -271,12 +298,19 @@ files:
271
298
  - lib/shopify-cli/command.rb
272
299
  - lib/shopify-cli/commands.rb
273
300
  - lib/shopify-cli/commands/config.rb
274
- - lib/shopify-cli/commands/connect.rb
275
- - lib/shopify-cli/commands/create.rb
276
301
  - lib/shopify-cli/commands/help.rb
302
+ - lib/shopify-cli/commands/login.rb
277
303
  - lib/shopify-cli/commands/logout.rb
304
+ - lib/shopify-cli/commands/populate.rb
305
+ - lib/shopify-cli/commands/populate/customer.rb
306
+ - lib/shopify-cli/commands/populate/draft_order.rb
307
+ - lib/shopify-cli/commands/populate/product.rb
308
+ - lib/shopify-cli/commands/store.rb
309
+ - lib/shopify-cli/commands/switch.rb
278
310
  - lib/shopify-cli/commands/system.rb
279
311
  - lib/shopify-cli/commands/version.rb
312
+ - lib/shopify-cli/commands/whoami.rb
313
+ - lib/shopify-cli/connect.rb
280
314
  - lib/shopify-cli/context.rb
281
315
  - lib/shopify-cli/core.rb
282
316
  - lib/shopify-cli/core/entry_point.rb
@@ -292,19 +326,20 @@ files:
292
326
  - lib/shopify-cli/helpers/haikunator.rb
293
327
  - lib/shopify-cli/heroku.rb
294
328
  - lib/shopify-cli/http_request.rb
329
+ - lib/shopify-cli/identity_auth.rb
330
+ - lib/shopify-cli/identity_auth/servlet.rb
295
331
  - lib/shopify-cli/js_deps.rb
296
332
  - lib/shopify-cli/js_system.rb
297
333
  - lib/shopify-cli/lazy_delegator.rb
298
334
  - lib/shopify-cli/messages/messages.rb
299
335
  - lib/shopify-cli/method_object.rb
300
- - lib/shopify-cli/oauth.rb
301
- - lib/shopify-cli/oauth/servlet.rb
302
336
  - lib/shopify-cli/options.rb
303
337
  - lib/shopify-cli/packager.rb
304
338
  - lib/shopify-cli/partners_api.rb
305
339
  - lib/shopify-cli/partners_api/organizations.rb
306
340
  - lib/shopify-cli/process_supervision.rb
307
341
  - lib/shopify-cli/project.rb
342
+ - lib/shopify-cli/project_commands.rb
308
343
  - lib/shopify-cli/project_type.rb
309
344
  - lib/shopify-cli/resolve_constant.rb
310
345
  - lib/shopify-cli/resources.rb
@@ -314,12 +349,31 @@ files:
314
349
  - lib/shopify-cli/sub_command.rb
315
350
  - lib/shopify-cli/task.rb
316
351
  - lib/shopify-cli/tasks.rb
352
+ - lib/shopify-cli/tasks/confirm_store.rb
317
353
  - lib/shopify-cli/tasks/create_api_client.rb
354
+ - lib/shopify-cli/tasks/ensure_authenticated.rb
318
355
  - lib/shopify-cli/tasks/ensure_dev_store.rb
319
356
  - lib/shopify-cli/tasks/ensure_env.rb
320
357
  - lib/shopify-cli/tasks/ensure_loopback_url.rb
358
+ - lib/shopify-cli/tasks/ensure_project_type.rb
321
359
  - lib/shopify-cli/tasks/select_org_and_shop.rb
322
360
  - lib/shopify-cli/tasks/update_dashboard_urls.rb
361
+ - lib/shopify-cli/theme/dev_server.rb
362
+ - lib/shopify-cli/theme/dev_server/certificate_manager.rb
363
+ - lib/shopify-cli/theme/dev_server/header_hash.rb
364
+ - lib/shopify-cli/theme/dev_server/hot-reload.js
365
+ - lib/shopify-cli/theme/dev_server/hot_reload.rb
366
+ - lib/shopify-cli/theme/dev_server/local_assets.rb
367
+ - lib/shopify-cli/theme/dev_server/proxy.rb
368
+ - lib/shopify-cli/theme/dev_server/sse.rb
369
+ - lib/shopify-cli/theme/dev_server/watcher.rb
370
+ - lib/shopify-cli/theme/dev_server/web_server.rb
371
+ - lib/shopify-cli/theme/development_theme.rb
372
+ - lib/shopify-cli/theme/file.rb
373
+ - lib/shopify-cli/theme/ignore_filter.rb
374
+ - lib/shopify-cli/theme/mime_type.rb
375
+ - lib/shopify-cli/theme/syncer.rb
376
+ - lib/shopify-cli/theme/theme.rb
323
377
  - lib/shopify-cli/transform_data_structure.rb
324
378
  - lib/shopify-cli/tunnel.rb
325
379
  - lib/shopify-cli/version.rb
@@ -447,14 +501,14 @@ files:
447
501
  - vendor/lib/semantic/LICENSE
448
502
  - vendor/lib/semantic/semantic.rb
449
503
  - vendor/lib/semantic/version.rb
450
- homepage: https://shopify.github.io/shopify-app-cli/
504
+ homepage: https://shopify.github.io/shopify-cli/
451
505
  licenses:
452
506
  - MIT
453
507
  metadata:
454
508
  allowed_push_host: https://rubygems.org
455
- homepage_uri: https://shopify.github.io/shopify-app-cli/
456
- source_code_uri: https://github.com/Shopify/shopify-app-cli
457
- changelog_uri: https://github.com/Shopify/shopify-app-cli/blob/master/CHANGELOG.md
509
+ homepage_uri: https://shopify.github.io/shopify-cli/
510
+ source_code_uri: https://github.com/Shopify/shopify-cli
511
+ changelog_uri: https://github.com/Shopify/shopify-cli/blob/main/CHANGELOG.md
458
512
  post_install_message:
459
513
  rdoc_options: []
460
514
  require_paths:
@@ -464,14 +518,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
464
518
  requirements:
465
519
  - - ">="
466
520
  - !ruby/object:Gem::Version
467
- version: '2.5'
521
+ version: '2.6'
468
522
  required_rubygems_version: !ruby/object:Gem::Requirement
469
523
  requirements:
470
524
  - - ">="
471
525
  - !ruby/object:Gem::Version
472
526
  version: '0'
473
527
  requirements: []
474
- rubygems_version: 3.2.17
528
+ rubygems_version: 3.2.20
475
529
  signing_key:
476
530
  specification_version: 4
477
531
  summary: Shopify CLI helps you build Shopify apps faster.