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
@@ -1,49 +1,75 @@
1
1
  # frozen_string_literal: true
2
- module Theme
3
- module Commands
4
- class Push < ShopifyCli::Command
5
- prerequisite_task :ensure_themekit_installed
2
+ require "shopify-cli/theme/theme"
3
+ require "shopify-cli/theme/development_theme"
4
+ require "shopify-cli/theme/ignore_filter"
5
+ require "shopify-cli/theme/syncer"
6
6
 
7
+ module Theme
8
+ class Command
9
+ class Push < ShopifyCli::SubCommand
7
10
  options do |parser, flags|
8
- parser.on("--remove") { flags["remove"] = true }
9
- parser.on("--nodelete") { flags["nodelete"] = true }
10
- parser.on("--allow-live") { flags["allow-live"] = true }
11
- parser.on("--env=ENV") { |env| flags[:env] = env }
11
+ parser.on("-n", "--nodelete") { flags[:nodelete] = true }
12
+ parser.on("-i", "--themeid=ID") { |theme_id| flags[:theme_id] = theme_id }
13
+ parser.on("-d", "--development") { flags[:development] = true }
14
+ parser.on("-u", "--unpublished") { flags[:unpublished] = true }
15
+ parser.on("-j", "--json") { flags[:json] = true }
16
+ parser.on("-a", "--allow-live") { flags[:allow_live] = true }
17
+ parser.on("-p", "--publish") { flags[:publish] = true }
12
18
  end
13
19
 
14
20
  def call(args, _name)
15
- if options.flags["remove"]
16
- remove = true
17
- options.flags.delete("remove")
18
- end
21
+ root = args.first || "."
22
+ delete = !options.flags[:nodelete]
19
23
 
20
- if options.flags[:env]
21
- env = options.flags[:env]
22
- options.flags.delete(:env)
24
+ theme = if (theme_id = options.flags[:theme_id])
25
+ ShopifyCli::Theme::Theme.new(@ctx, root: root, id: theme_id)
26
+ elsif options.flags[:development]
27
+ theme = ShopifyCli::Theme::DevelopmentTheme.new(@ctx, root: root)
28
+ theme.ensure_exists!
29
+ theme
30
+ elsif options.flags[:unpublished]
31
+ name = CLI::UI::Prompt.ask(@ctx.message("theme.push.name"), allow_empty: false)
32
+ theme = ShopifyCli::Theme::Theme.new(@ctx, root: root, name: name, role: "unpublished")
33
+ theme.create
34
+ theme
35
+ else
36
+ form = Forms::Select.ask(
37
+ @ctx,
38
+ [],
39
+ title: @ctx.message("theme.push.select"),
40
+ root: root,
41
+ )
42
+ return unless form
43
+ form.theme
23
44
  end
24
45
 
25
- flags = Themekit.add_flags(options.flags)
26
-
27
- if remove
28
- CLI::UI::Frame.open(@ctx.message("theme.push.remove")) do
29
- unless CLI::UI::Prompt.confirm(@ctx.message("theme.push.remove_confirm"))
30
- @ctx.abort(@ctx.message("theme.push.remove_abort"))
31
- end
46
+ if theme.live? && !options.flags[:allow_live]
47
+ return unless CLI::UI::Prompt.confirm(@ctx.message("theme.push.live"))
48
+ end
32
49
 
33
- unless Themekit.push(@ctx, files: args, flags: flags, remove: remove, env: env)
34
- @ctx.abort(@ctx.message("theme.push.error.remove_error"))
50
+ ignore_filter = ShopifyCli::Theme::IgnoreFilter.from_path(root)
51
+ syncer = ShopifyCli::Theme::Syncer.new(@ctx, theme: theme, ignore_filter: ignore_filter)
52
+ begin
53
+ syncer.start_threads
54
+ if options.flags[:json]
55
+ syncer.upload_theme!(delete: delete)
56
+ puts(JSON.generate(theme: theme.to_h))
57
+ else
58
+ CLI::UI::Frame.open(@ctx.message("theme.push.info.pushing", theme.name, theme.id, theme.shop)) do
59
+ UI::SyncProgressBar.new(syncer).progress(:upload_theme!, delete: delete)
35
60
  end
36
- end
37
61
 
38
- @ctx.done(@ctx.message("theme.push.info.remove", @ctx.root))
39
- else
40
- CLI::UI::Frame.open(@ctx.message("theme.push.push")) do
41
- unless Themekit.push(@ctx, files: args, flags: flags, remove: remove, env: env)
42
- @ctx.abort(@ctx.message("theme.push.error.push_error"))
62
+ if options.flags[:publish]
63
+ theme.publish
64
+ @ctx.done(@ctx.message("theme.publish.done", theme.preview_url))
65
+ else
66
+ @ctx.done(@ctx.message("theme.push.done", theme.preview_url, theme.editor_url))
43
67
  end
44
68
  end
45
-
46
- @ctx.done(@ctx.message("theme.push.info.push", @ctx.root))
69
+ rescue ShopifyCli::API::APIRequestNotFoundError
70
+ @ctx.abort(@ctx.message("theme.push.theme_not_found", theme.id))
71
+ ensure
72
+ syncer.shutdown
47
73
  end
48
74
  end
49
75
 
@@ -1,26 +1,16 @@
1
1
  # frozen_string_literal: true
2
- module Theme
3
- module Commands
4
- class Serve < ShopifyCli::Command
5
- prerequisite_task :ensure_themekit_installed
2
+ require "shopify-cli/theme/dev_server"
6
3
 
4
+ module Theme
5
+ class Command
6
+ class Serve < ShopifyCli::SubCommand
7
7
  options do |parser, flags|
8
- parser.on("--env=ENV") { |env| flags[:env] = env }
9
- parser.on("--allow-live") { flags["allow-live"] = true }
10
- parser.on("--notify=FILES") { |files| flags["notify"] = files }
8
+ parser.on("--port=PORT") { |port| flags[:port] = port.to_i }
11
9
  end
12
10
 
13
11
  def call(*)
14
- if options.flags[:env]
15
- env = options.flags[:env]
16
- options.flags.delete(:env)
17
- end
18
-
19
- flags = Themekit.add_flags(options.flags)
20
-
21
- CLI::UI::Frame.open(@ctx.message("theme.serve.serve")) do
22
- Themekit.serve(@ctx, flags: flags, env: env)
23
- end
12
+ flags = options.flags.dup
13
+ ShopifyCli::Theme::DevServer.start(@ctx, ".", **flags)
24
14
  end
25
15
 
26
16
  def self.help
@@ -0,0 +1,15 @@
1
+ module Theme
2
+ module Forms
3
+ class ConfirmStore < ShopifyCli::Form
4
+ flag_arguments :title, :force
5
+
6
+ def ask
7
+ @confirmed = force || CLI::UI::Prompt.confirm(title, default: false)
8
+ end
9
+
10
+ def confirmed?
11
+ @confirmed
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,59 @@
1
+ module Theme
2
+ module Forms
3
+ class Select < ShopifyCli::Form
4
+ attr_accessor :theme
5
+ flag_arguments :root, :title, :exclude_roles, :include_foreign_developments
6
+
7
+ def ask
8
+ self.theme = CLI::UI::Prompt.ask(title, allow_empty: false) do |handler|
9
+ themes.each do |theme|
10
+ next if exclude_roles&.include?(theme.role)
11
+ next if !include_foreign_developments && theme.foreign_development?
12
+ handler.option("#{theme.name} #{theme_tags(theme)}") { theme }
13
+ end
14
+ end
15
+ end
16
+
17
+ private
18
+
19
+ def themes
20
+ @themes ||= ShopifyCli::Theme::Theme.all(@ctx, root: root)
21
+ .sort_by { |theme| theme_sort_order(theme) }
22
+ end
23
+
24
+ def theme_sort_order(theme)
25
+ case theme.role
26
+ when "live"
27
+ 0
28
+ when "unpublished"
29
+ 1
30
+ when "development"
31
+ 2
32
+ else
33
+ 3
34
+ end
35
+ end
36
+
37
+ def theme_tags(theme)
38
+ color = case theme.role
39
+ when "live"
40
+ "green"
41
+ when "unpublished"
42
+ "yellow"
43
+ when "development"
44
+ "blue"
45
+ else
46
+ "grey"
47
+ end
48
+
49
+ tags = ["{{#{color}:[#{theme.role}]}}"]
50
+
51
+ if theme.current_development?
52
+ tags << "{{cyan:[yours]}}}}"
53
+ end
54
+
55
+ tags.join(" ")
56
+ end
57
+ end
58
+ end
59
+ end
@@ -3,143 +3,147 @@ module Theme
3
3
  module Messages
4
4
  MESSAGES = {
5
5
  theme: {
6
- connect: {
7
- duplicate: "Duplicate directory, theme files weren't connected",
8
- help: <<~HELP,
9
- {{command:%s connect theme}}: Connects an existing theme in your store to Shopify App CLI. Downloads a copy of the theme files to your local development environment.
10
- Usage: {{command:%s connect theme}}
11
- Options:
12
- {{command:--store=MYSHOPIFYDOMAIN}} Store URL. Must be an existing store with private apps enabled.
13
- {{command:--password=PASSWORD}} Private app password. App must have Read and Write Theme access.
14
- {{command:--themeid=THEMEID}} Theme ID. Must be an existing theme on your store.
15
- HELP
16
- inside_project: "You are inside an existing theme, theme files weren't connected",
17
- connect: "Downloading theme files...",
18
- failed: "Couldn't download theme files from store",
19
- connected: "{{green:%s}} files were downloaded from {{underline:%s}} to {{green:%s}}",
20
- },
21
- create: {
22
- creating_theme: "Creating theme %s",
23
- duplicate_theme: "Duplicate theme",
24
- failed: "Couldn't create the theme",
25
- help: <<~HELP,
26
- {{command:%s create theme}}: Creates a theme.
27
- Usage: {{command:%s create theme}}
28
- Options:
29
- {{command:--store=MYSHOPIFYDOMAIN}} Store URL. Must be an existing store with private apps enabled.
30
- {{command:--password=PASSWORD}} Private app password. App must have Read and Write Theme access.
31
- {{command:--name=NAME}} Theme name. Any string.
32
- HELP
33
- info: {
34
- created: "{{green:%s}} was created for {{underline:%s}} in {{green:%s}}",
35
- },
36
- },
37
- deploy: {
38
- abort: "Theme wasn't deployed",
39
- confirmation: "This will change your live theme. Do you wish to proceed?",
6
+ help: <<~HELP,
7
+ Suite of commands for developing Shopify themes. See {{command:%1$s theme <command> --help}} for usage of each command.
8
+ Usage: {{command:%1$s theme [ %2$s ]}}
9
+ HELP
10
+
11
+ publish: {
12
+ confirmation: "This will change your live theme. Do you want to continue?",
40
13
  deploying: "Deploying theme",
41
14
  error: "Theme couldn't be deployed",
42
15
  help: <<~HELP,
43
- {{command:%s deploy}}: Uploads your local theme files to Shopify, then sets your theme as the live theme.
44
- Usage: {{command:%s deploy}}
16
+ {{command:%s theme publish}}: Set a remote theme as the live theme.
17
+ Usage: {{command:%s theme publish [ THEME_ID ]}}
18
+
19
+ Options:
20
+ {{command:-f, --force}} Skip confirmation.
21
+
22
+ Run without arguments to select theme from a list.
45
23
  HELP
46
- info: {
47
- deployed: "Theme was updated and set as the live theme",
48
- pushed: "All theme files were updated",
49
- },
50
- push_fail: "Theme files couldn't be updated",
24
+ done: "Your theme is now live at %s",
25
+ not_found: "Theme #%s does not exist",
26
+ select: "Select theme to push to",
27
+ confirm: "Are you sure you want to make %s the new live theme on %s?",
51
28
  },
52
29
  forms: {
53
30
  ask_password: "Password:",
54
31
  ask_store: "Store domain:",
55
- create: {
56
- ask_title: "Title:",
57
- private_app: <<~APP,
58
- To create a new theme, Shopify App CLI needs to connect with a private app installed on your store. Visit {{underline:%s/admin/apps/private}} to create a new API key and password, or retrieve an existing password.
59
- If you create a new private app, ensure that it has Read and Write Theme access.
60
- APP
61
- },
62
- connect: {
63
- private_app: <<~APP,
64
- To fetch your existing themes, Shopify App CLI needs to connect with your store. Visit {{underline:%s/admin/apps/private}} to create a new API key and password, or retrieve an existing password.
65
- If you create a new private app, ensure that it has Read and Write Theme access.
66
- APP
67
- },
68
32
  errors: "%s can't be blank",
69
33
  },
70
- generate: {
71
- env: {
72
- ask_password: "Password",
73
- ask_password_default: "Password (defaults to {{green:%s}})",
74
- ask_store: "Store",
75
- ask_store_default: "Store (defaults to {{green:%s}})",
76
- ask_theme: "Select theme",
77
- help: <<~HELP,
78
- Create or update configuration file in the current directory.
79
- Usage: {{command:%s generate env}}
80
- Options:
81
- {{command:--store=MYSHOPIFYDOMAIN}} Store URL. Must be an existing store with private apps enabled.
82
- {{command:--password=PASSWORD}} Private app password. App must have Read and Write Theme access.
83
- {{command:--themeid=THEMEID}} Theme ID. Must be an existing theme on your store.
84
- HELP
85
- no_themes: "Please create a new theme using %s create theme",
86
- },
87
- help: <<~HELP,
88
- Generate code in your Theme. Currently supports generating new envs.
89
- Usage: {{command:%s generate [ env ]}}
90
- HELP
91
- },
92
34
  push: {
93
35
  remove_abort: "Theme files weren't deleted",
94
- remove_confirm: "This will delete the local and remote copies of the theme files. Do you wish to proceed?",
36
+ remove_confirm:
37
+ "This will delete the local and remote copies of the theme files, which " \
38
+ "can't be undone. Do you want to continue?",
95
39
  error: {
96
40
  push_error: "Theme files couldn't be pushed to Shopify",
97
41
  remove_error: "Theme files couldn't be removed from Shopify",
98
42
  },
99
43
  help: <<~HELP,
100
- {{command:%s push}}: Uploads your local theme files to Shopify, overwriting the remote versions. If you specify filenames, separated by a space, only those files will be replaced. Otherwise, the whole theme will be replaced.
101
- Usage: {{command:%s push}}
44
+ {{command:%s theme push}}: Uploads your local theme files to the connected store, overwriting the remote version if specified.
45
+
46
+ Usage: {{command:%s theme push [ ROOT ]}}
47
+
102
48
  Options:
103
- {{command:--remove}} Deletes both the local and the remote copies of the specified files. At least one filename must be specified.
104
- {{command:--allow-live}} Allows Shopify App CLI to replace files on the store's live production theme.
105
- {{command:--nodelete}} Runs the push command without deleting remote files from Shopify.
49
+ {{command:-i, --themeid=THEMEID}} Theme ID. Must be an existing theme on your store.
50
+ {{command:-d, --development}} Push to your remote development theme, and create it if needed.
51
+ {{command:-u, --unpublished}} Create a new unpublished theme and push to it.
52
+ {{command:-n, --nodelete}} Runs the push command without deleting remote files from Shopify.
53
+ {{command:-j, --json}} Output JSON instead of a UI.
54
+ {{command:-a, --allow-live}} Allow push to a live theme.
55
+ {{command:-p, --publish}} Publish as the live theme after uploading.
56
+
57
+ Run without options to select theme from a list.
106
58
  HELP
107
59
  info: {
108
- push: "Theme files were pushed from {{green:%s}} to Shopify",
109
- remove: "Theme files were deleted from {{green:%s}} and Shopify",
60
+ pushing: "Pushing theme files to %s (#%s) on %s",
110
61
  },
111
62
  push: "Pushing theme files to Shopify",
112
- remove: "Deleting theme files",
63
+ select: "Select theme to push to",
64
+ live: "Are you sure you want to push to your live theme?",
65
+ theme_not_found: "Theme #%s doesn't exist",
66
+ done: <<~DONE,
67
+ {{green:Your theme was pushed successfully}}
68
+
69
+ {{info:View your theme:}}
70
+ {{underline:%s}}
71
+
72
+ {{info:Customize this theme in the Online Store Editor:}}
73
+ {{underline:%s}}
74
+ DONE
75
+ name: "Theme name",
113
76
  },
114
77
  serve: {
115
78
  help: <<~HELP,
116
- Sync your current changes, then view the active store in your default browser. Any theme edits will continue to update in real time. Also prints the active store's URL in your terminal.
117
- Usage: {{command:%s serve}}
79
+ Uploads the current theme as a development theme to the connected store, then prints theme editor and preview URLs to your terminal. While running, changes will push to the store in real time.
80
+ Usage: {{command:%s theme serve}}
118
81
  HELP
119
82
  serve: "Viewing theme...",
120
83
  open_fail: "Couldn't open the theme",
121
84
  },
122
- tasks: {
123
- ensure_themekit_installed: {
124
- auto_update: "Would you like to enable auto-updating?",
125
- downloading: "Downloading Theme Kit %s",
126
- errors: {
127
- digest_fail: "Unable to verify download",
128
- releases_fail: "Unable to fetch Theme Kit's list of releases",
129
- update_fail: "Unable to update Theme Kit",
130
- write_fail: "Unable to download Theme Kit",
131
- },
132
- installing_themekit: "Installing Theme Kit",
133
- successful: "Theme Kit installed successfully",
134
- updating_themekit: "Updating Theme Kit",
135
- verifying: "Verifying download...",
136
- },
85
+ check: {
86
+ help: <<~HELP,
87
+ Check your theme for errors, suggestions, and best practices.
88
+ Usage: {{command:%s check}}
89
+ HELP
137
90
  },
138
- themekit: {
139
- query_themes: {
140
- bad_password: "Bad password",
141
- not_connect: "Couldn't connect to given shop",
91
+ delete: {
92
+ help: <<~HELP,
93
+ {{command:%s theme delete}}: Delete remote themes from the connected store. This command can't be undone.
94
+
95
+ Usage: {{command:%s theme delete [ THEME_ID [ ... ] ]}}
96
+
97
+ Options:
98
+ {{command:-d, --development}} Delete your development theme.
99
+ {{command:-a, --show-all}} Include others development themes in theme list.
100
+ {{command:-f, --force}} Skip confirmation.
101
+
102
+ Run without options to select the theme to delete from a list.
103
+ HELP
104
+ select: "Select theme to delete",
105
+ done: "%s theme(s) deleted",
106
+ not_found: "{{x}} Theme #%s does not exist",
107
+ live: "{{x}} Theme #%s is your live theme. You can't delete it.",
108
+ confirm: "Are you sure you want to delete %s on %s?",
109
+ },
110
+ package: {
111
+ help: <<~HELP,
112
+ {{command:%s theme package}}: Package your theme into a .zip file, ready to upload to the Online Store.
113
+
114
+ Usage: {{command:%s theme package [ ROOT ]}}
115
+ HELP
116
+ error: {
117
+ prereq_command_required: "%1$s is required for packaging a theme. Please install %1$s "\
118
+ "using the appropriate package manager for your system.",
119
+ missing_config: "Provide a config/settings_schema.json to package your theme",
120
+ missing_theme_name: "Provide a theme_info.theme_name configuration in config/settings_schema.json",
142
121
  },
122
+ done: "Theme packaged in %s",
123
+ },
124
+ language_server: {
125
+ help: <<~HELP,
126
+ {{command:%s theme language-server}}: Start a Language Server Protocol server.
127
+
128
+ Usage: {{command:%s theme language-server}}
129
+ HELP
130
+ },
131
+ pull: {
132
+ help: <<~HELP,
133
+ {{command:%s theme pull}}: Downloads your remote theme files locally.
134
+
135
+ Usage: {{command:%s theme pull [ ROOT ]}}
136
+
137
+ Options:
138
+ {{command:-i, --themeid=THEMEID}} The Theme ID. Must be an existing theme on your store.
139
+ {{command:-n, --nodelete}} Runs the pull command without deleting local files.
140
+
141
+ Run without options to select theme from a list.
142
+ HELP
143
+ select: "Select a theme to pull from",
144
+ pulling: "Pulling theme files from %s (#%s) on %s",
145
+ done: "Theme pulled successfully",
146
+ not_found: "{{x}} Theme #%s doesn't exist",
143
147
  },
144
148
  },
145
149
  }.freeze