shopify-cli 2.25.0 → 2.26.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +5 -0
  3. data/Gemfile.lock +1 -1
  4. data/dev.yml +0 -3
  5. data/lib/project_types/script/cli.rb +0 -79
  6. data/lib/project_types/script/commands/connect.rb +3 -8
  7. data/lib/project_types/script/commands/create.rb +4 -29
  8. data/lib/project_types/script/commands/javy.rb +3 -8
  9. data/lib/project_types/script/commands/push.rb +4 -41
  10. data/lib/project_types/script/messages/messages.rb +1 -258
  11. data/lib/project_types/theme/commands/common/shop_helper.rb +13 -0
  12. data/lib/project_types/theme/commands/delete.rb +4 -1
  13. data/lib/project_types/theme/commands/list.rb +3 -4
  14. data/lib/project_types/theme/commands/open.rb +4 -1
  15. data/lib/project_types/theme/commands/publish.rb +4 -1
  16. data/lib/project_types/theme/commands/pull.rb +3 -1
  17. data/lib/project_types/theme/commands/push.rb +3 -1
  18. data/lib/project_types/theme/messages/messages.rb +5 -5
  19. data/lib/shopify_cli/messages/messages.rb +1 -1
  20. data/lib/shopify_cli/packager.rb +12 -3
  21. data/lib/shopify_cli/release.rb +4 -2
  22. data/lib/shopify_cli/version.rb +1 -1
  23. data/vendor/deps/cli-ui/lib/cli/ui/prompt/interactive_options.rb +1 -1
  24. metadata +3 -48
  25. data/lib/project_types/script/config/extension_points.yml +0 -45
  26. data/lib/project_types/script/errors.rb +0 -10
  27. data/lib/project_types/script/forms/ask_app.rb +0 -27
  28. data/lib/project_types/script/forms/ask_org.rb +0 -30
  29. data/lib/project_types/script/forms/ask_script_uuid.rb +0 -22
  30. data/lib/project_types/script/forms/create.rb +0 -33
  31. data/lib/project_types/script/forms/run_against_shopify_org.rb +0 -14
  32. data/lib/project_types/script/graphql/app_script_set.graphql +0 -46
  33. data/lib/project_types/script/graphql/get_app_scripts.graphql +0 -6
  34. data/lib/project_types/script/graphql/module_upload_url_generate.graphql +0 -13
  35. data/lib/project_types/script/graphql/script_service_proxy.graphql +0 -7
  36. data/lib/project_types/script/layers/application/build_script.rb +0 -25
  37. data/lib/project_types/script/layers/application/connect_app.rb +0 -86
  38. data/lib/project_types/script/layers/application/create_script.rb +0 -90
  39. data/lib/project_types/script/layers/application/extension_points.rb +0 -66
  40. data/lib/project_types/script/layers/application/project_dependencies.rb +0 -26
  41. data/lib/project_types/script/layers/application/push_script.rb +0 -74
  42. data/lib/project_types/script/layers/domain/app_bridge.rb +0 -16
  43. data/lib/project_types/script/layers/domain/errors.rb +0 -47
  44. data/lib/project_types/script/layers/domain/extension_point.rb +0 -81
  45. data/lib/project_types/script/layers/domain/metadata.rb +0 -46
  46. data/lib/project_types/script/layers/domain/push_package.rb +0 -41
  47. data/lib/project_types/script/layers/domain/script_config.rb +0 -32
  48. data/lib/project_types/script/layers/domain/script_project.rb +0 -61
  49. data/lib/project_types/script/layers/infrastructure/api_clients/partners_proxy_api_client.rb +0 -53
  50. data/lib/project_types/script/layers/infrastructure/api_clients/script_service_api_client.rb +0 -35
  51. data/lib/project_types/script/layers/infrastructure/command_runner.rb +0 -19
  52. data/lib/project_types/script/layers/infrastructure/errors.rb +0 -211
  53. data/lib/project_types/script/layers/infrastructure/extension_point_repository.rb +0 -37
  54. data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +0 -62
  55. data/lib/project_types/script/layers/infrastructure/languages/task_runner.rb +0 -47
  56. data/lib/project_types/script/layers/infrastructure/languages/tool_version_checker.rb +0 -26
  57. data/lib/project_types/script/layers/infrastructure/languages/typescript_project_creator.rb +0 -45
  58. data/lib/project_types/script/layers/infrastructure/languages/typescript_task_runner.rb +0 -103
  59. data/lib/project_types/script/layers/infrastructure/languages/wasm_project_creator.rb +0 -12
  60. data/lib/project_types/script/layers/infrastructure/languages/wasm_task_runner.rb +0 -32
  61. data/lib/project_types/script/layers/infrastructure/metadata_repository.rb +0 -18
  62. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +0 -36
  63. data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +0 -273
  64. data/lib/project_types/script/layers/infrastructure/script_service.rb +0 -135
  65. data/lib/project_types/script/layers/infrastructure/script_uploader.rb +0 -40
  66. data/lib/project_types/script/layers/infrastructure/service_locator.rb +0 -20
  67. data/lib/project_types/script/layers/infrastructure/sparse_checkout_details.rb +0 -35
  68. data/lib/project_types/script/ui/error_handler.rb +0 -331
  69. data/lib/project_types/script/ui/printing_spinner.rb +0 -75
  70. data/lib/project_types/script/ui/strict_spinner.rb +0 -20
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dadea44d5b05c23d4e74988aac50cae2713ee0809ad3b92b0a32a2ae51915a35
4
- data.tar.gz: efaccb6aee8feb1bd714f4b6d2fa2ded67e522ac49eedaaa592fc3dbc066b04d
3
+ metadata.gz: 1947b9e99b60efb4eb548badb8f41ee520f17ed0025a2666ec58a62594964abc
4
+ data.tar.gz: b7b7714ce470469573282c561c335103cb8471319785fd327a7f7e8442eb71d2
5
5
  SHA512:
6
- metadata.gz: d283f76d8b288ad25487a50f86ff9482abef14f4d9ad7d95e006ea36a976f4cfb2410235e5a18cf12ea5c19d225117fd0516735b574c7c63551809422a102e19
7
- data.tar.gz: 63e45bf4543a6743859c02a766e8b61c682703145d6230410d5200f76d9ca207c7ae996a1dc89dd8e918dfbb21d17aa17dd834f694df274f96a9fab29a4af606
6
+ metadata.gz: 82a5eeb29ba45bf1e7eb407371c07922f14c3a7fe8ed0777b555ebbfa952a3dc35b303e0e477abe5c467bd01112e678ce31804051a52b92beb0bea2a323c5264
7
+ data.tar.gz: e24d863f0a3649d729242bd6104403d5642a6e04c44fc52adb6856d98c55e20c06ff4b13e4ca553ba01299b726ad89193ee97bcd322709deb060f681bbfeae6d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## Version 2.26.0 - 2022-10-03
6
+
7
+ ### Added
8
+ * [#2636](https://github.com/Shopify/shopify-cli/pull/2636): Show store when the CLI prompts users to select a theme
9
+
5
10
  ## Version 2.25.0 - 2022-09-14
6
11
 
7
12
  ### Added
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.25.0)
4
+ shopify-cli (2.26.0)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.11.0)
data/dev.yml CHANGED
@@ -27,6 +27,3 @@ test:
27
27
  commands:
28
28
  style:
29
29
  run: bundle exec rubocop .
30
- test:script:
31
- desc: "Run all script-related tests"
32
- run: TEST='test/project_types/script/**/*.rb' bundle exec rake test $@
@@ -18,85 +18,6 @@ module Script
18
18
  end
19
19
  ShopifyCLI::Commands.register("Script::Command", "script")
20
20
 
21
- # define/autoload project specific Forms
22
- module Forms
23
- autoload :AskOrg, Project.project_filepath("forms/ask_org")
24
- autoload :AskApp, Project.project_filepath("forms/ask_app")
25
- autoload :AskScriptUuid, Project.project_filepath("forms/ask_script_uuid")
26
- autoload :RunAgainstShopifyOrg, Project.project_filepath("forms/run_against_shopify_org")
27
- autoload :Create, Project.project_filepath("forms/create")
28
- autoload :Connect, Project.project_filepath("forms/connect")
29
- autoload :ScriptForm, Project.project_filepath("forms/script_form")
30
- end
31
-
32
- module Tasks
33
- autoload :EnsureEnv, Project.project_filepath("tasks/ensure_env")
34
- end
35
-
36
- module Layers
37
- module Application
38
- autoload :BuildScript, Project.project_filepath("layers/application/build_script")
39
- autoload :ConnectApp, Project.project_filepath("layers/application/connect_app")
40
- autoload :CreateScript, Project.project_filepath("layers/application/create_script")
41
- autoload :PushScript, Project.project_filepath("layers/application/push_script")
42
- autoload :ExtensionPoints, Project.project_filepath("layers/application/extension_points")
43
- autoload :ProjectDependencies, Project.project_filepath("layers/application/project_dependencies")
44
- end
45
-
46
- module Domain
47
- autoload :Errors, Project.project_filepath("layers/domain/errors")
48
- autoload :PushPackage, Project.project_filepath("layers/domain/push_package")
49
- autoload :Metadata, Project.project_filepath("layers/domain/metadata")
50
- autoload :ExtensionPoint, Project.project_filepath("layers/domain/extension_point")
51
- autoload :ScriptConfig, Project.project_filepath("layers/domain/script_config")
52
- autoload :ScriptProject, Project.project_filepath("layers/domain/script_project")
53
- autoload :AppBridge, Project.project_filepath("layers/domain/app_bridge")
54
- end
55
-
56
- module Infrastructure
57
- autoload :Errors, Project.project_filepath("layers/infrastructure/errors")
58
- autoload :CommandRunner, Project.project_filepath("layers/infrastructure/command_runner")
59
- autoload :PushPackageRepository, Project.project_filepath("layers/infrastructure/push_package_repository")
60
- autoload :ExtensionPointRepository, Project.project_filepath("layers/infrastructure/extension_point_repository")
61
- autoload :MetadataRepository, Project.project_filepath("layers/infrastructure/metadata_repository")
62
- autoload :ScriptProjectRepository, Project.project_filepath("layers/infrastructure/script_project_repository")
63
- autoload :ScriptService, Project.project_filepath("layers/infrastructure/script_service")
64
- autoload :ScriptUploader, Project.project_filepath("layers/infrastructure/script_uploader")
65
- autoload :ServiceLocator, Project.project_filepath("layers/infrastructure/service_locator")
66
- autoload :SparseCheckoutDetails, Project.project_filepath("layers/infrastructure/sparse_checkout_details")
67
-
68
- module Languages
69
- autoload :ProjectCreator, Project.project_filepath("layers/infrastructure/languages/project_creator")
70
- autoload :TaskRunner, Project.project_filepath("layers/infrastructure/languages/task_runner")
71
- autoload :TypeScriptProjectCreator,
72
- Project.project_filepath("layers/infrastructure/languages/typescript_project_creator.rb")
73
- autoload :TypeScriptTaskRunner,
74
- Project.project_filepath("layers/infrastructure/languages/typescript_task_runner.rb")
75
- autoload :WasmProjectCreator,
76
- Project.project_filepath("layers/infrastructure/languages/wasm_project_creator.rb")
77
- autoload :WasmTaskRunner,
78
- Project.project_filepath("layers/infrastructure/languages/wasm_task_runner.rb")
79
- autoload :ToolVersionChecker,
80
- Project.project_filepath("layers/infrastructure/languages/tool_version_checker.rb")
81
- end
82
-
83
- module ApiClients
84
- autoload :PartnersProxyApiClient,
85
- Project.project_filepath("layers/infrastructure/api_clients/partners_proxy_api_client")
86
- autoload :ScriptServiceApiClient,
87
- Project.project_filepath("layers/infrastructure/api_clients/script_service_api_client")
88
- end
89
- end
90
- end
91
-
92
- module UI
93
- autoload :ErrorHandler, Project.project_filepath("ui/error_handler")
94
- autoload :PrintingSpinner, Project.project_filepath("ui/printing_spinner")
95
- autoload :StrictSpinner, Project.project_filepath("ui/strict_spinner")
96
- end
97
-
98
- autoload :Errors, Project.project_filepath("errors")
99
-
100
21
  module Loaders
101
22
  autoload :Project, Script::Project.project_filepath("loaders/project")
102
23
  autoload :SpecificationHandler, Script::Project.project_filepath("loaders/specification_handler")
@@ -2,19 +2,14 @@
2
2
  module Script
3
3
  class Command
4
4
  class Connect < ShopifyCLI::Command::SubCommand
5
- prerequisite_task :ensure_authenticated
6
- prerequisite_task ensure_project_type: :script
7
-
8
- recommend_default_ruby_range
5
+ hidden_feature
9
6
 
10
7
  def call(_args, _)
11
- Layers::Application::ConnectApp.call(ctx: @ctx, force: true)
12
- rescue StandardError => e
13
- UI::ErrorHandler.pretty_print_and_raise(e, failed_op: @ctx.message("script.connect.error.operation_failed"))
8
+ @ctx.abort(@ctx.message("script.deprecated"))
14
9
  end
15
10
 
16
11
  def self.help
17
- ShopifyCLI::Context.new.message("script.connect.help", ShopifyCLI::TOOL_NAME, ShopifyCLI::TOOL_NAME)
12
+ ShopifyCLI::Context.new.message("script.deprecated")
18
13
  end
19
14
  end
20
15
  end
@@ -3,9 +3,7 @@
3
3
  module Script
4
4
  class Command
5
5
  class Create < ShopifyCLI::Command::SubCommand
6
- prerequisite_task :ensure_authenticated
7
-
8
- recommend_default_ruby_range
6
+ hidden_feature
9
7
 
10
8
  options do |parser, flags|
11
9
  parser.on("--title=TITLE") { |title| flags[:title] = title }
@@ -14,35 +12,12 @@ module Script
14
12
  parser.on("--branch=BRANCH") { |branch| flags[:branch] = branch }
15
13
  end
16
14
 
17
- def call(args, _name)
18
- form = Forms::Create.ask(@ctx, args, options.flags)
19
- return @ctx.puts(self.class.help) if form.nil?
20
-
21
- unless !form.title.empty? && form.extension_point
22
- return @ctx.puts(self.class.help)
23
- end
24
-
25
- project = Layers::Application::CreateScript.call(
26
- ctx: @ctx,
27
- language: options.flags[:language]&.downcase || "wasm",
28
- sparse_checkout_branch: options.flags[:branch] || "main",
29
- title: form.title,
30
- extension_point_type: form.extension_point,
31
- )
32
- @ctx.puts(@ctx.message("script.create.change_directory_notice", project.title))
33
- rescue StandardError => e
34
- UI::ErrorHandler.pretty_print_and_raise(e, failed_op: @ctx.message("script.create.error.operation_failed"))
15
+ def call(_args, _)
16
+ @ctx.abort(@ctx.message("script.deprecated"))
35
17
  end
36
18
 
37
19
  def self.help
38
- allowed_apis = Layers::Application::ExtensionPoints.available_types.map { |type| "{{cyan:#{type}}}" }
39
- allowed_languages = Layers::Application::ExtensionPoints.all_languages.map { |lang| "{{cyan:#{lang}}}" }
40
- ShopifyCLI::Context.message(
41
- "script.create.help",
42
- ShopifyCLI::TOOL_NAME,
43
- allowed_apis.join(", "),
44
- allowed_languages.join(", ")
45
- )
20
+ ShopifyCLI::Context.new.message("script.deprecated")
46
21
  end
47
22
  end
48
23
  end
@@ -12,17 +12,12 @@ module Script
12
12
  parser.on("--out=OUT") { |out_file| flags[:out_file] = out_file }
13
13
  end
14
14
 
15
- def call(*)
16
- source = options.flags[:in_file]
17
- dest = options.flags[:out_file]
18
-
19
- @ctx.abort(@ctx.message("script.javy.errors.invalid_arguments", ShopifyCLI::TOOL_NAME)) unless source
20
-
21
- ::Javy.build(source: source, dest: dest).unwrap { |e| @ctx.abort(e.message) }
15
+ def call(_args, _)
16
+ @ctx.abort(@ctx.message("script.deprecated"))
22
17
  end
23
18
 
24
19
  def self.help
25
- ShopifyCLI::Context.message("script.javy.help", ShopifyCLI::TOOL_NAME)
20
+ ShopifyCLI::Context.new.message("script.deprecated")
26
21
  end
27
22
  end
28
23
  end
@@ -3,9 +3,7 @@
3
3
  module Script
4
4
  class Command
5
5
  class Push < ShopifyCLI::Command::SubCommand
6
- prerequisite_task ensure_project_type: :script
7
-
8
- recommend_default_ruby_range
6
+ hidden_feature
9
7
 
10
8
  options do |parser, flags|
11
9
  parser.on("--force") { |t| flags[:force] = t }
@@ -16,47 +14,12 @@ module Script
16
14
  end
17
15
  end
18
16
 
19
- def call(_args, _name)
20
- connect_to_app
21
- project = load_project
22
- push(project: project)
23
- rescue StandardError => e
24
- UI::ErrorHandler.pretty_print_and_raise(e,
25
- failed_op: @ctx.message("script.push.error.operation_failed"))
26
- end
27
-
28
- def push(project:)
29
- force = options.flags.key?(:force)
30
- api_key = project.env[:api_key]
31
- uuid = project.env[:extra]["UUID"]
32
-
33
- if ShopifyCLI::Environment.interactive? || (uuid && !uuid.empty?)
34
- Layers::Application::PushScript.call(ctx: @ctx, force: force, project: project)
35
- @ctx.puts(@ctx.message("script.push.script_pushed", api_key: api_key))
36
- else
37
- message = @ctx.message("script.error.missing_push_options_ci", "--uuid")
38
- message += @ctx.message("script.error.missing_push_options_ci_solution", ShopifyCLI::TOOL_NAME)
39
- raise ShopifyCLI::Abort, message
40
- end
41
- end
42
-
43
- def load_project
44
- Script::Loaders::Project.load(
45
- directory: Dir.pwd,
46
- api_key: options.flags[:api_key],
47
- api_secret: options.flags[:api_secret],
48
- uuid: options.flags[:uuid]
49
- )
50
- end
51
-
52
- def connect_to_app
53
- if ShopifyCLI::Environment.interactive?
54
- Layers::Application::ConnectApp.call(ctx: @ctx)
55
- end
17
+ def call(_args, _)
18
+ @ctx.abort(@ctx.message("script.deprecated"))
56
19
  end
57
20
 
58
21
  def self.help
59
- ShopifyCLI::Context.message("script.push.help", ShopifyCLI::TOOL_NAME)
22
+ ShopifyCLI::Context.new.message("script.deprecated")
60
23
  end
61
24
  end
62
25
  end
@@ -4,264 +4,7 @@ module Script
4
4
  module Messages
5
5
  MESSAGES = {
6
6
  script: {
7
- help: <<~HELP,
8
- Suite of commands for developing script applications. Run {{command:%1$s script <command> --help}} for usage of each command.
9
- Usage: {{command:%1$s script [ %2$s ]}}
10
- HELP
11
-
12
- error: {
13
- deprecated_ep: "This script won't run in a store because "\
14
- "it uses a deprecated Script API (%s).",
15
- deprecated_ep_cause: "Recreate this script using a supported Script API.",
16
- generic: "{{red:{{x}} Error}}",
17
- eacces_cause: "You don't have permission to write to this directory.",
18
- eacces_help: "Get permission for this directory or choose a different one.",
19
-
20
- enospc_cause: "You don't have enough disk space to do this action.",
21
- enospc_help: "Free up more space.",
22
-
23
- oauth_cause: "Something went wrong while authenticating your account with the Partner Dashboard.",
24
- oauth_help: "Wait a few minutes and try again.",
25
-
26
- invalid_context_cause: "Your .shopify-cli.yml is formatted incorrectly. It's missing values for "\
27
- "extension_point_type, title, app_bridge_create_path or app_bridge_details_path.",
28
- invalid_context_help: "Add these values.",
29
-
30
- invalid_script_title_cause: "Script title contains unsupported characters.",
31
- invalid_script_title_help: "Use only numbers, letters, hyphens, or underscores.",
32
-
33
- no_existing_apps_cause: "Your script can't be pushed to an app because your Partner account "\
34
- "doesn't have any apps.",
35
- no_existing_apps_help: "Create an app.",
36
-
37
- no_existing_orgs_cause: "Your account doesn't belong to a Partner Organization.",
38
- no_existing_orgs_help: "Visit https://partners.shopify.com/ to create an account.",
39
-
40
- project_exists_cause: "A directory with this same title already exists.",
41
- project_exists_help: "Choose a different title for your script.",
42
-
43
- invalid_extension_cause: "The name of the Script API is incorrect: %s.",
44
- invalid_extension_help: "Choose a supported API: %s.",
45
-
46
- invalid_language_cause: "The language is not supported: %s.",
47
- invalid_language_help: "Choose a supported language: %s.",
48
-
49
- missing_script_config_field_cause: "The %{filename} file is missing the required %{field} field.",
50
- missing_script_config_field_help: "Add the field.",
51
-
52
- script_config_parse_error_cause: "The %{filename} file contains incorrect %{serialization_format}.",
53
- script_config_parse_error_help: "Correct the errors.",
54
-
55
- no_script_config_file_cause: "The %{filename} file is missing.",
56
- no_script_config_file_help: "Create this file.",
57
-
58
- app_not_connected_cause: "The script is not connected to an app.",
59
- app_not_connected_help: "Run {{command:%{tool_name} script connect}}.",
60
-
61
- configuration_definition_error_cause: "In %{filename} there is a problem with the "\
62
- "configuration. %{message}",
63
- configuration_definition_error_help: "Fix the error.",
64
-
65
- configuration_definition_errors_cause: "In %{filename}, there are %{error_count} problems with "\
66
- "the configuration:\n%{concatenated_messages}\n",
67
- configuration_definition_errors_help: "Correct the errors.",
68
-
69
- configuration_syntax_error_cause: "The %{filename} is not formatted correctly.",
70
- configuration_syntax_error_help: "Fix the errors.",
71
-
72
- configuration_missing_keys_error_cause: "The %{filename} is missing required keys: "\
73
- "%{missing_keys}.",
74
- configuration_missing_keys_error_help: "Add the keys.",
75
-
76
- configuration_invalid_value_error_cause: "The %{filename} configuration accepts "\
77
- "one of the following types(s): %{valid_input_modes}.",
78
- configuration_invalid_value_error_help: "Change the value of the type.",
79
-
80
- configuration_schema_field_missing_keys_error_cause: "A configuration entry in the %{filename} file "\
81
- "is missing required keys: %{missing_keys}.",
82
- configuration_definition_schema_field_missing_keys_error_help: "Add the keys.",
83
-
84
- configuration_schema_field_invalid_value_error_cause: "The configuration entries in the "\
85
- "%{filename} file accept one of the following "\
86
- "type(s): %{valid_types}.",
87
- configuration_schema_field_invalid_value_error_help: "Change the value of the type.",
88
-
89
- input_query_error_cause: "Input query is invalid:\n%{messages}\n\n",
90
- input_query_error_help: "Fix the query in the `%{input_query_path}` file.",
91
-
92
- script_not_found_cause: "Can't find script %s for Script API %s",
93
-
94
- system_call_failure_cause: "Something went wrong while running: {{command:%{cmd}}}.",
95
- system_call_failure_help: "Correct the error.\n{{red:%{out}}}",
96
-
97
- metadata_validation_cause: "The Script API metadata is incorrect.",
98
- metadata_validation_help: "The 'schemaVersions.major' field contains an unsupported version.",
99
-
100
- metadata_schema_versions_missing: "Invalid Script metadata:" \
101
- " 'schemaVersions' field is missing",
102
- metadata_schema_versions_single_key: "Invalid Script API metadata:" \
103
- " 'schemaVersions' can have only one Script API name.",
104
- metadata_schema_versions_missing_major: "Invalid Script API metadata:" \
105
- " 'schemaVersions' is missing the 'major' field",
106
- metadata_schema_versions_missing_minor: "Invalid Script API metadata:" \
107
- " 'schemaVersions' is missing the 'minor' field",
108
-
109
- metadata_not_found_cause: "Can't find the script version file (%{filename}).",
110
- metadata_not_found_help: "Make sure your project is up-to-date and a script metadata file " \
111
- "is accessible at %{filename}.",
112
-
113
- build_error_cause: "Something went wrong while building the script.",
114
- build_error_help: "Correct the errors.",
115
-
116
- dependency_install_cause: "Something went wrong while installing the needed dependencies.",
117
- dependency_install_help: "Correct the errors.",
118
-
119
- invalid_environment_cause: "Your environment %{tool} version, %{env_version}, "\
120
- "is too low. It must be at least %{minimum_version}.",
121
- invalid_environment_help: "Update %{tool}.",
122
-
123
- failed_api_request_cause: "Something went wrong while communicating with Shopify.",
124
- failed_api_request_help: "Try again.",
125
-
126
- forbidden_error_cause: "You don't have permission to do this action.",
127
-
128
- graphql_error_cause: "An error was returned: %s.",
129
- graphql_error_help: "\nCorrect the error.",
130
-
131
- script_repush_cause: "Can’t push the script because a version of this script already exists on the app.",
132
- script_repush_help: "Use {{cyan:--force}} to replace the existing script.",
133
-
134
- build_script_not_found: "The root package.json is missing the build command that " \
135
- "is needed to compile your script to Wasm.",
136
- # rubocop:disable Layout/LineLength
137
- build_script_suggestion: "\n\nFor example, your package.json needs the following command:" \
138
- "\nbuild: npx shopify-scripts-toolchain-as build --src src/shopify_main.ts --binary build/<script_name>.wasm --metadata build/metadata.json -- --lib node_modules --optimize --use Date=",
139
-
140
- web_assembly_binary_not_found: "Wasm binary not found.",
141
- web_assembly_binary_not_found_suggestion: "Check that a valid Wasm binary is present. " \
142
- "The Wasm binary's filepath must be 'build/index.wasm'.",
143
-
144
- project_config_not_found: "Internal error - Script can't be created because the project's config file is missing from the repository.",
145
-
146
- invalid_project_config: "Internal error - Script can't be created because the project's config file is invalid in the repository.",
147
-
148
- script_upload_cause: "Something went wrong and your script couldn't be pushed.",
149
- script_upload_help: "Try again.",
150
-
151
- script_too_large_cause: "The size of your Wasm binary file is too large.",
152
- script_too_large_help: "It must be less than %{max_size}.",
153
-
154
- api_library_not_found_cause: "Script can't be created because API library %{library_name} is missing from the dependencies",
155
- api_library_not_found_help: "This can occur because the API library was removed from your system or there is a problem with dependencies in the repository.",
156
-
157
- language_library_for_api_not_found_cause: "Script can’t be pushed because the %{language} library for API %{api} is missing.",
158
- language_library_for_api_not_found_help: "Make sure extension_point.yml contains the correct API library.",
159
- no_scripts_found_in_app: "The selected apps have no scripts. Please, create them first on the partners' dashboard.",
160
- missing_push_options_ci: "The following are missing: %s. ",
161
- missing_push_options_ci_solution: "To add them to a CI environment:\n\t1. Run a connect command " \
162
- "({{command:%1$s script connect}})\n\t2. Navigate to the .env file at the root of your project\n\t" \
163
- "3. Copy the missing values and pass them through as arguments in {{command:%1$s script push}}",
164
- missing_env_file_variables: "The following are missing in the .env file: %s. ",
165
- missing_env_file_variables_solution: "To add it, connect your script with " \
166
- "{{command:%1$s script connect}} ",
167
-
168
- invalid_app_bridge_path_cause: "The script couldn't be pushed because the App Bridge path is incorrect in .shopify-cli.yml.",
169
- invalid_app_bridge_path_help: "The %{path_key} needs to be set to a path that starts with {{command:/}}.",
170
- },
171
-
172
- create: {
173
- help: <<~HELP,
174
- {{command:%1$s script create}}: Creates a script project.
175
- Usage: {{command:%1$s script create}}
176
- Options:
177
- {{command:--title=TITLE}} Script project title.
178
- {{command:--api=TYPE}} Script API name. Supported values: %2$s.
179
- {{command:--language=LANGUAGE}} Programming language. Defaults to wasm. Supported values: %3$s.
180
- HELP
181
-
182
- error: {
183
- operation_failed: "Something went wrong and the script wasn't created.",
184
- },
185
-
186
- change_directory_notice: "{{*}} Change directories to {{green:%s}} to run script commands.",
187
- creating: "Creating script.",
188
- created: "Created script.",
189
- preparing_project: "Preparing script project structure.",
190
- creating_wasm: "Creating configuration files.",
191
- created_wasm: "Configuration files created.",
192
- },
193
-
194
- push: {
195
- help: <<~HELP,
196
- Build the script, upload it to Shopify, and register it to an app.
197
- Usage: {{command:%s script push}}
198
- Options:
199
- {{command:[--force]}} Replace the existing script with this version.
200
- {{command:[--api-key=API_KEY]}} The API key used to register an app with the script. This can be found on the app page on Partners Dashboard. Overrides the value in the .env file, if present.
201
- {{command:[--api-secret=API_SECRET]}} The API secret of the app the script is registered with. Overrides the value in the .env file, if present.
202
- {{command:[--uuid=UUID]}} The uuid of the script. Overrides the value in the .env file, if present.
203
- HELP
204
-
205
- error: {
206
- operation_failed: "Couldn't push script to app.",
207
- },
208
-
209
- script_pushed: "{{v}} Script pushed to app (API key: %{api_key}).",
210
- },
211
- connect: {
212
- connected: "Connected! Your project is now connected to {{green:%s}}",
213
- help: <<~HELP,
214
- {{command:%s script connect}}: Connects an existing script to an app.
215
- Usage: {{command:%s script connect}}
216
- HELP
217
- error: {
218
- operation_failed: "Couldn't connect script to app.",
219
- },
220
- },
221
- javy: {
222
- help: <<~HELP,
223
- Compile the JavaScript code into Wasm.
224
- Usage: {{command:%s script javy}}
225
- Options:
226
- {{command:--in}} The name of the JavaScript file that will be compiled.
227
- {{command:--out}} The name of the file that the Wasm should be written to.
228
- HELP
229
- errors: {
230
- invalid_arguments: "Javy was run with invalid arguments. Run {{command: %s script javy --help}}.",
231
- },
232
- },
233
-
234
- project_deps: {
235
- none_required: "{{v}} Dependencies are up to date.",
236
- checking: "Checking dependencies.",
237
- installing: "Installing dependencies.",
238
- installed: "Installed missing dependencies.",
239
- },
240
-
241
- forms: {
242
- create: {
243
- select_extension_point: "Which Script API do you want to use?",
244
- script_title: "What do you want to title your script?",
245
- },
246
- },
247
-
248
- application: {
249
- building: "Building",
250
- building_script: "Building script",
251
- built: "Built",
252
- pushing: "Pushing",
253
- pushing_script: "Pushing script",
254
- pushed: "Pushed",
255
- ensure_env: {
256
- organization: "Partner organization {{green:%s (%s)}}.",
257
- organization_select: "Which partner organization do you want to use?",
258
- app: "Push script to app {{green:%s}}.",
259
- app_select: "Which app do you want to push this script to?",
260
- ask_connect_to_existing_script: "This app contains scripts. Do you want to replace an "\
261
- "existing script on the app with this script?",
262
- ask_which_script_to_connect_to: "Which script do you want to replace?",
263
- },
264
- },
7
+ deprecated: "Script projects are no longer supported in CLI 2.0. Please upgrade to CLI 3.0.",
265
8
  },
266
9
  }.freeze
267
10
  end
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Theme
4
+ class Command
5
+ module Common
6
+ module ShopHelper
7
+ def shop
8
+ ShopifyCLI::AdminAPI.get_shop_or_abort(@ctx)
9
+ end
10
+ end
11
+ end
12
+ end
13
+ end
@@ -1,10 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
  require "shopify_cli/theme/theme"
3
3
  require "shopify_cli/theme/development_theme"
4
+ require "project_types/theme/commands/common/shop_helper"
4
5
 
5
6
  module Theme
6
7
  class Command
7
8
  class Delete < ShopifyCLI::Command::SubCommand
9
+ include Common::ShopHelper
10
+
8
11
  recommend_default_ruby_range
9
12
 
10
13
  options do |parser, flags|
@@ -22,7 +25,7 @@ module Theme
22
25
  form = Forms::Select.ask(
23
26
  @ctx,
24
27
  [],
25
- title: @ctx.message("theme.delete.select"),
28
+ title: @ctx.message("theme.delete.select", shop),
26
29
  exclude_roles: ["live"],
27
30
  include_foreign_developments: options.flags[:show_all],
28
31
  cmd: :delete
@@ -2,10 +2,13 @@
2
2
 
3
3
  require "shopify_cli/theme/theme"
4
4
  require "project_types/theme/presenters/themes_presenter"
5
+ require "project_types/theme/commands/common/shop_helper"
5
6
 
6
7
  module Theme
7
8
  class Command
8
9
  class List < ShopifyCLI::Command::SubCommand
10
+ include Common::ShopHelper
11
+
9
12
  recommend_default_ruby_range
10
13
 
11
14
  def call(_args, _name)
@@ -25,10 +28,6 @@ module Theme
25
28
  def themes_presenter
26
29
  Theme::Presenters::ThemesPresenter.new(@ctx, nil)
27
30
  end
28
-
29
- def shop
30
- ShopifyCLI::AdminAPI.get_shop_or_abort(@ctx)
31
- end
32
31
  end
33
32
  end
34
33
  end
@@ -2,10 +2,13 @@
2
2
 
3
3
  require "shopify_cli/theme/theme"
4
4
  require "shopify_cli/theme/development_theme"
5
+ require "project_types/theme/commands/common/shop_helper"
5
6
 
6
7
  module Theme
7
8
  class Command
8
9
  class Open < ShopifyCLI::Command::SubCommand
10
+ include Common::ShopHelper
11
+
9
12
  recommend_default_ruby_range
10
13
 
11
14
  options do |parser, flags|
@@ -60,7 +63,7 @@ module Theme
60
63
  form = Forms::Select.ask(
61
64
  @ctx,
62
65
  [],
63
- title: @ctx.message("theme.open.select"),
66
+ title: @ctx.message("theme.open.select", shop),
64
67
  root: nil
65
68
  )
66
69
  form&.theme
@@ -1,9 +1,12 @@
1
1
  # frozen_string_literal: true
2
2
  require "shopify_cli/theme/theme"
3
+ require "project_types/theme/commands/common/shop_helper"
3
4
 
4
5
  module Theme
5
6
  class Command
6
7
  class Publish < ShopifyCLI::Command::SubCommand
8
+ include Common::ShopHelper
9
+
7
10
  recommend_default_ruby_range
8
11
 
9
12
  options do |parser, flags|
@@ -17,7 +20,7 @@ module Theme
17
20
  form = Forms::Select.ask(
18
21
  @ctx,
19
22
  [],
20
- title: @ctx.message("theme.publish.select"),
23
+ title: @ctx.message("theme.publish.select", shop),
21
24
  exclude_roles: ["live", "development", "demo"],
22
25
  cmd: :publish
23
26
  )