shopify-cli 1.10.0 → 1.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.github/PULL_REQUEST_TEMPLATE.md +1 -0
  3. data/.github/workflows/release.yml +2 -4
  4. data/CHANGELOG.md +31 -1
  5. data/Gemfile.lock +1 -1
  6. data/lib/project_types/extension/cli.rb +6 -2
  7. data/lib/project_types/extension/commands/serve.rb +69 -1
  8. data/lib/project_types/extension/commands/tunnel.rb +3 -1
  9. data/lib/project_types/extension/extension_project.rb +1 -0
  10. data/lib/project_types/extension/features/argo.rb +15 -24
  11. data/lib/project_types/extension/features/argo_runtime.rb +91 -0
  12. data/lib/project_types/extension/features/argo_serve.rb +35 -27
  13. data/lib/project_types/extension/features/argo_serve_options.rb +42 -0
  14. data/lib/project_types/extension/messages/messages.rb +3 -0
  15. data/lib/project_types/extension/models/npm_package.rb +14 -0
  16. data/lib/project_types/extension/models/specification.rb +1 -0
  17. data/lib/project_types/extension/models/specification_handlers/checkout_argo_extension.rb +18 -0
  18. data/lib/project_types/extension/models/specification_handlers/default.rb +33 -3
  19. data/lib/project_types/extension/tasks/choose_next_available_port.rb +36 -0
  20. data/lib/project_types/extension/tasks/configure_features.rb +2 -0
  21. data/lib/project_types/extension/tasks/find_npm_packages.rb +106 -0
  22. data/lib/project_types/script/cli.rb +14 -13
  23. data/lib/project_types/script/commands/push.rb +8 -3
  24. data/lib/project_types/script/config/extension_points.yml +0 -3
  25. data/lib/project_types/script/graphql/app_script_update_or_create.graphql +9 -3
  26. data/lib/project_types/script/layers/application/create_script.rb +6 -5
  27. data/lib/project_types/script/layers/application/push_script.rb +2 -1
  28. data/lib/project_types/script/layers/domain/errors.rb +6 -13
  29. data/lib/project_types/script/layers/domain/push_package.rb +4 -8
  30. data/lib/project_types/script/layers/domain/script_json.rb +32 -0
  31. data/lib/project_types/script/layers/domain/script_project.rb +1 -1
  32. data/lib/project_types/script/layers/infrastructure/command_runner.rb +19 -0
  33. data/lib/project_types/script/layers/infrastructure/errors.rb +25 -20
  34. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb +105 -0
  35. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_task_runner.rb +103 -0
  36. data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +26 -0
  37. data/lib/project_types/script/layers/infrastructure/languages/rust_project_creator.rb +73 -0
  38. data/lib/project_types/script/layers/infrastructure/languages/rust_task_runner.rb +60 -0
  39. data/lib/project_types/script/layers/infrastructure/languages/task_runner.rb +21 -0
  40. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +6 -8
  41. data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +44 -59
  42. data/lib/project_types/script/layers/infrastructure/script_service.rb +21 -15
  43. data/lib/project_types/script/messages/messages.rb +28 -22
  44. data/lib/project_types/script/tasks/ensure_env.rb +32 -3
  45. data/lib/project_types/script/ui/error_handler.rb +37 -36
  46. data/lib/shopify-cli/admin_api.rb +7 -4
  47. data/lib/shopify-cli/context.rb +13 -0
  48. data/lib/shopify-cli/messages/messages.rb +48 -43
  49. data/lib/shopify-cli/method_object.rb +4 -4
  50. data/lib/shopify-cli/oauth.rb +7 -1
  51. data/lib/shopify-cli/partners_api.rb +7 -4
  52. data/lib/shopify-cli/partners_api/organizations.rb +3 -3
  53. data/lib/shopify-cli/resources/env_file.rb +1 -1
  54. data/lib/shopify-cli/shopifolk.rb +1 -1
  55. data/lib/shopify-cli/tasks/select_org_and_shop.rb +6 -4
  56. data/lib/shopify-cli/tunnel.rb +22 -1
  57. data/lib/shopify-cli/version.rb +1 -1
  58. metadata +17 -11
  59. data/lib/project_types/extension/features/argo_renderer_package.rb +0 -47
  60. data/lib/project_types/script/layers/domain/config_ui.rb +0 -16
  61. data/lib/project_types/script/layers/infrastructure/assemblyscript_project_creator.rb +0 -100
  62. data/lib/project_types/script/layers/infrastructure/assemblyscript_task_runner.rb +0 -95
  63. data/lib/project_types/script/layers/infrastructure/project_creator.rb +0 -24
  64. data/lib/project_types/script/layers/infrastructure/rust_project_creator.rb +0 -72
  65. data/lib/project_types/script/layers/infrastructure/rust_task_runner.rb +0 -59
  66. data/lib/project_types/script/layers/infrastructure/task_runner.rb +0 -19
@@ -51,35 +51,38 @@ module Script
51
51
  invalid_config: "Can't change the configuration values because %1$s is missing or "\
52
52
  "it is not formatted properly.",
53
53
 
54
- invalid_config_ui_definition_cause: "The UI configuration file %s contains invalid YAML.",
55
- invalid_config_ui_definition_help: "Fix the errors and try again.",
54
+ missing_script_json_field_cause: "The script.json file is missing the required %s field.",
55
+ missing_script_json_field_help: "Add the field and try again.",
56
56
 
57
- missing_config_ui_definition_cause: "You are missing the UI configuration file %s.",
58
- missing_config_ui_definition_help: "Create this file and try again.",
57
+ invalid_script_json_definition_cause: "The script.json file contains invalid JSON.",
58
+ invalid_script_json_definition_help: "Fix the errors and try again.",
59
59
 
60
- config_ui_syntax_error_cause: "The UI configuration file %{filename} is not formatted properly.",
61
- config_ui_syntax_error_help: "Fix the errors and try again.",
60
+ no_script_json_file_cause: "You are missing the required script.json file.",
61
+ no_script_json_file_help: "Create this file and try again.",
62
62
 
63
- config_ui_missing_keys_error_cause: "The UI configuration file %{filename} is missing required keys: "\
63
+ configuration_syntax_error_cause: "The script.json configuration schema is not formatted properly.",
64
+ configuration_syntax_error_help: "Fix the errors and try again.",
65
+
66
+ configuration_missing_keys_error_cause: "The script.json configuration schema is missing required keys: "\
64
67
  "%{missing_keys}.",
65
- config_ui_missing_keys_error_help: "Add the keys and try again.",
68
+ configuration_missing_keys_error_help: "Add the keys and try again.",
66
69
 
67
- config_ui_invalid_input_mode_error_cause: "The UI configuration file %{filename} only accept "\
68
- "one of the following input mode(s): %{valid_input_modes}.",
69
- config_ui_invalid_input_mode_error_help: "Change the input modes and try again.",
70
+ configuration_invalid_value_error_cause: "The script.json configuration only accepts "\
71
+ "one of the following types(s): %{valid_input_modes}.",
72
+ configuration_invalid_value_error_help: "Change the type and try again.",
70
73
 
71
- config_ui_fields_missing_keys_error_cause: "A field entry in the UI configuration file %{filename} is "\
72
- "missing required keys: %{missing_keys}.",
73
- config_ui_fields_missing_keys_error_help: "Add the keys and try again.",
74
+ configuration_schema_field_missing_keys_error_cause: "A field entry in the script.json configuration "\
75
+ "schema is missing required keys: %{missing_keys}.",
76
+ configuration_definition_schema_field_missing_keys_error_help: "Add the keys and try again.",
74
77
 
75
- config_ui_fields_invalid_type_error_cause: "The UI configuration file %{filename} fields only accept "\
76
- "one of the following type(s): %{valid_types}.",
77
- config_ui_fields_invalid_type_error_help: "Change the types and try again.",
78
+ configuration_schema_field_invalid_value_error_cause: "The script.json configuration schema fields only "\
79
+ "accept one of the following type(s): %{valid_types}.",
80
+ configuration_schema_field_invalid_value_error_help: "Change the types and try again.",
78
81
 
79
82
  script_not_found_cause: "Couldn't find script %s for extension point %s",
80
83
 
81
- service_failure_cause: "Internal service error.",
82
- service_failure_help: "Ensure the 'shopify/scripts-toolchain-as' package is up to date.",
84
+ system_call_failure_cause: "An error was returned while running {{command:%{cmd}}}.",
85
+ system_call_failure_help: "Review the following error and try again.\n{{red:%{out}}}",
83
86
 
84
87
  metadata_validation_cause: "Invalid script extension metadata.",
85
88
  metadata_validation_help: "Ensure the 'shopify/scripts-toolchain-as' package is up to date.",
@@ -113,7 +116,7 @@ module Script
113
116
  graphql_error_cause: "An error was returned: %s.",
114
117
  graphql_error_help: "\nReview the error and try again.",
115
118
 
116
- script_repush_cause: "A script with the same extension point already exists on app (API key: %s).",
119
+ script_repush_cause: "A script with this UUID already exists (UUID: %s).",
117
120
  script_repush_help: "Use {{cyan:--force}} to replace the existing script.",
118
121
 
119
122
  shop_auth_cause: "Unable to authenticate with the store.",
@@ -161,7 +164,8 @@ module Script
161
164
  HELP
162
165
 
163
166
  error: {
164
- operation_failed: "Couldn't push script to app (API key: %{api_key}).",
167
+ operation_failed_with_api_key: "Couldn't push script to app (API key: %{api_key}).",
168
+ operation_failed_no_api_key: "Couldn't push script to app.",
165
169
  },
166
170
 
167
171
  script_pushed: "{{v}} Script pushed to app (API key: %{api_key}).",
@@ -193,9 +197,11 @@ module Script
193
197
  enabling: "Enabling",
194
198
  enabled: "Enabled",
195
199
  ensure_env: {
200
+ organization: "Partner organization {{green:%s (%s)}}.",
196
201
  organization_select: "Which partner organization do you want to use?",
202
+ app: "Script will be pushed to app {{green:%s}}.",
197
203
  app_select: "Which app do you want to push this script to?",
198
- ask_connect_to_existing_script: "This app has some scripts. Do you want to replace any of the "\
204
+ ask_connect_to_existing_script: "The selected app has some scripts. Do you want to replace any of the "\
199
205
  "existing scripts with the current script?",
200
206
  ask_which_script_to_connect_to: "Which script do you want to replace?",
201
207
  },
@@ -11,7 +11,7 @@ module Script
11
11
  script_project_repo = Layers::Infrastructure::ScriptProjectRepository.new(ctx: ctx)
12
12
  script_project = script_project_repo.get
13
13
 
14
- return if script_project.api_key && script_project.api_secret && script_project.uuid_defined?
14
+ return false if script_project.api_key && script_project.api_secret && script_project.uuid_defined?
15
15
 
16
16
  org = ask_org
17
17
  app = ask_app(org["apps"])
@@ -22,18 +22,24 @@ module Script
22
22
  secret: app["apiSecretKeys"].first["secret"],
23
23
  uuid: uuid
24
24
  )
25
+
26
+ true
25
27
  end
26
28
 
27
29
  private
28
30
 
29
31
  def ask_org
32
+ return stubbed_org if partner_proxy_bypass
33
+
30
34
  if ShopifyCli::Shopifolk.check && wants_to_run_against_shopify_org?
31
35
  ShopifyCli::Shopifolk.act_as_shopify_organization
32
36
  end
33
37
 
34
38
  orgs = ShopifyCli::PartnersAPI::Organizations.fetch_with_app(ctx)
35
39
  if orgs.count == 1
36
- orgs.first
40
+ default = orgs.first
41
+ ctx.puts(ctx.message("script.application.ensure_env.organization", default["businessName"], default["id"]))
42
+ default
37
43
  elsif orgs.count > 0
38
44
  CLI::UI::Prompt.ask(ctx.message("script.application.ensure_env.organization_select")) do |handler|
39
45
  orgs.each do |org|
@@ -45,9 +51,32 @@ module Script
45
51
  end
46
52
  end
47
53
 
54
+ def stubbed_org
55
+ {
56
+ "apps" => [
57
+ {
58
+ "appType" => "custom",
59
+ "apiKey" => "stubbed-api-key",
60
+ "apiSecretKeys" => [{ "secret" => "stubbed-api-secret" }],
61
+ "title" => "Fake App (Not connected to Partners)",
62
+ },
63
+ ],
64
+ }
65
+ end
66
+
67
+ def partner_proxy_bypass
68
+ !ENV["BYPASS_PARTNERS_PROXY"].nil?
69
+ end
70
+
48
71
  def ask_app(apps)
72
+ unless ShopifyCli::Shopifolk.acting_as_shopify_organization?
73
+ apps = apps.select { |app| app["appType"] == "custom" }
74
+ end
75
+
49
76
  if apps.count == 1
50
- apps.first
77
+ default = apps.first
78
+ ctx.puts(ctx.message("script.application.ensure_env.app", default["title"]))
79
+ default
51
80
  elsif apps.count > 0
52
81
  CLI::UI::Prompt.ask(ctx.message("script.application.ensure_env.app_select")) do |handler|
53
82
  apps.each do |app|
@@ -110,11 +110,6 @@ module Script
110
110
  e.extension_point_type
111
111
  ),
112
112
  }
113
- when Layers::Domain::Errors::ServiceFailureError
114
- {
115
- cause_of_error: ShopifyCli::Context.message("script.error.service_failure_cause"),
116
- help_suggestion: ShopifyCli::Context.message("script.error.service_failure_help"),
117
- }
118
113
  when Layers::Domain::Errors::MetadataValidationError
119
114
  {
120
115
  cause_of_error: ShopifyCli::Context.message("script.error.metadata_validation_cause"),
@@ -125,17 +120,20 @@ module Script
125
120
  cause_of_error: ShopifyCli::Context.message("script.error.metadata_not_found_cause"),
126
121
  help_suggestion: ShopifyCli::Context.message("script.error.metadata_not_found_help"),
127
122
  }
128
- when Layers::Domain::Errors::InvalidConfigUiDefinitionError
123
+ when Layers::Domain::Errors::MissingScriptJsonFieldError
129
124
  {
130
- cause_of_error: ShopifyCli::Context
131
- .message("script.error.invalid_config_ui_definition_cause", e.filename),
132
- help_suggestion: ShopifyCli::Context.message("script.error.invalid_config_ui_definition_help"),
125
+ cause_of_error: ShopifyCli::Context.message("script.error.missing_script_json_field_cause", e.field),
126
+ help_suggestion: ShopifyCli::Context.message("script.error.missing_script_json_field_help"),
133
127
  }
134
- when Layers::Domain::Errors::MissingSpecifiedConfigUiDefinitionError
128
+ when Layers::Domain::Errors::InvalidScriptJsonDefinitionError
135
129
  {
136
- cause_of_error: ShopifyCli::Context
137
- .message("script.error.missing_config_ui_definition_cause", e.filename),
138
- help_suggestion: ShopifyCli::Context.message("script.error.missing_config_ui_definition_help"),
130
+ cause_of_error: ShopifyCli::Context.message("script.error.invalid_script_json_definition_cause"),
131
+ help_suggestion: ShopifyCli::Context.message("script.error.invalid_script_json_definition_help"),
132
+ }
133
+ when Layers::Domain::Errors::NoScriptJsonFile
134
+ {
135
+ cause_of_error: ShopifyCli::Context.message("script.error.no_script_json_file_cause"),
136
+ help_suggestion: ShopifyCli::Context.message("script.error.no_script_json_file_help"),
139
137
  }
140
138
  when Layers::Infrastructure::Errors::AppNotInstalledError
141
139
  {
@@ -146,49 +144,46 @@ module Script
146
144
  cause_of_error: ShopifyCli::Context.message("script.error.build_error_cause"),
147
145
  help_suggestion: ShopifyCli::Context.message("script.error.build_error_help"),
148
146
  }
149
- when Layers::Infrastructure::Errors::ConfigUiSyntaxError
147
+ when Layers::Infrastructure::Errors::ScriptJsonSyntaxError
150
148
  {
151
- cause_of_error: ShopifyCli::Context.message(
152
- "script.error.config_ui_syntax_error_cause",
153
- filename: e.message
154
- ),
155
- help_suggestion: ShopifyCli::Context.message("script.error.config_ui_syntax_error_help"),
149
+ cause_of_error: ShopifyCli::Context.message("script.error.configuration_syntax_error_cause"),
150
+ help_suggestion: ShopifyCli::Context.message("script.error.configuration_syntax_error_help"),
156
151
  }
157
- when Layers::Infrastructure::Errors::ConfigUiMissingKeysError
152
+ when Layers::Infrastructure::Errors::ScriptJsonMissingKeysError
158
153
  {
159
154
  cause_of_error: ShopifyCli::Context.message(
160
- "script.error.config_ui_missing_keys_error_cause",
161
- filename: e.filename,
155
+ "script.error.configuration_missing_keys_error_cause",
162
156
  missing_keys: e.missing_keys
163
157
  ),
164
- help_suggestion: ShopifyCli::Context.message("script.error.config_ui_missing_keys_error_help"),
158
+ help_suggestion: ShopifyCli::Context.message("script.error.configuration_missing_keys_error_help"),
165
159
  }
166
- when Layers::Infrastructure::Errors::ConfigUiInvalidInputModeError
160
+ when Layers::Infrastructure::Errors::ScriptJsonInvalidValueError
167
161
  {
168
162
  cause_of_error: ShopifyCli::Context.message(
169
- "script.error.config_ui_invalid_input_mode_error_cause",
170
- filename: e.filename,
163
+ "script.error.configuration_invalid_value_error_cause",
171
164
  valid_input_modes: e.valid_input_modes
172
165
  ),
173
- help_suggestion: ShopifyCli::Context.message("script.error.config_ui_invalid_input_mode_error_help"),
166
+ help_suggestion: ShopifyCli::Context.message("script.error.configuration_invalid_value_error_help"),
174
167
  }
175
- when Layers::Infrastructure::Errors::ConfigUiFieldsMissingKeysError
168
+ when Layers::Infrastructure::Errors::ScriptJsonFieldsMissingKeysError
176
169
  {
177
170
  cause_of_error: ShopifyCli::Context.message(
178
- "script.error.config_ui_fields_missing_keys_error_cause",
179
- filename: e.filename,
171
+ "script.error.configuration_schema_field_missing_keys_error_cause",
180
172
  missing_keys: e.missing_keys
181
173
  ),
182
- help_suggestion: ShopifyCli::Context.message("script.error.config_ui_fields_missing_keys_error_help"),
174
+ help_suggestion: ShopifyCli::Context.message(
175
+ "script.error.configuration_definition_schema_field_missing_keys_error_help"
176
+ ),
183
177
  }
184
- when Layers::Infrastructure::Errors::ConfigUiFieldsInvalidTypeError
178
+ when Layers::Infrastructure::Errors::ScriptJsonFieldsInvalidValueError
185
179
  {
186
180
  cause_of_error: ShopifyCli::Context.message(
187
- "script.error.config_ui_fields_invalid_type_error_cause",
188
- filename: e.filename,
181
+ "script.error.configuration_schema_field_invalid_value_error_cause",
189
182
  valid_types: e.valid_types
190
183
  ),
191
- help_suggestion: ShopifyCli::Context.message("script.error.config_ui_fields_invalid_type_error_help"),
184
+ help_suggestion: ShopifyCli::Context.message(
185
+ "script.error.configuration_schema_field_invalid_value_error_help"
186
+ ),
192
187
  }
193
188
  when Layers::Infrastructure::Errors::DependencyInstallError
194
189
  {
@@ -211,9 +206,15 @@ module Script
211
206
  ),
212
207
  help_suggestion: ShopifyCli::Context.message("script.error.graphql_error_help"),
213
208
  }
209
+ when Layers::Infrastructure::Errors::SystemCallFailureError
210
+ {
211
+ cause_of_error: ShopifyCli::Context
212
+ .message("script.error.system_call_failure_cause", cmd: e.cmd),
213
+ help_suggestion: ShopifyCli::Context.message("script.error.system_call_failure_help", out: e.out),
214
+ }
214
215
  when Layers::Infrastructure::Errors::ScriptRepushError
215
216
  {
216
- cause_of_error: ShopifyCli::Context.message("script.error.script_repush_cause", e.api_key),
217
+ cause_of_error: ShopifyCli::Context.message("script.error.script_repush_cause", e.uuid),
217
218
  help_suggestion: ShopifyCli::Context.message("script.error.script_repush_help"),
218
219
  }
219
220
  when Layers::Infrastructure::Errors::ShopAuthenticationError
@@ -85,11 +85,14 @@ module ShopifyCli
85
85
 
86
86
  private
87
87
 
88
- def authenticated_req(ctx, shop)
89
- yield
88
+ def authenticated_req(ctx, shop, &block)
89
+ CLI::Kit::Util
90
+ .begin(&block)
91
+ .retry_after(API::APIRequestUnauthorizedError, retries: 1) do
92
+ authenticate(ctx, shop)
93
+ end
90
94
  rescue API::APIRequestUnauthorizedError
91
- authenticate(ctx, shop)
92
- retry
95
+ ctx.abort(ctx.message("core.api.error.failed_auth"))
93
96
  end
94
97
 
95
98
  def authenticate(ctx, shop)
@@ -144,6 +144,19 @@ module ShopifyCli
144
144
  File.write(ctx_path(fname), content)
145
145
  end
146
146
 
147
+ # will read a file relative to the context root unless the file path is absolute.
148
+ #
149
+ # #### Parameters
150
+ # * `fname` - filename of the file that you are reading, relative to root unless it is absolute.
151
+ #
152
+ # #### Example
153
+ #
154
+ # @ctx.read('file.txt')
155
+ #
156
+ def read(fname)
157
+ File.read(ctx_path(fname))
158
+ end
159
+
147
160
  # will read a binary file relative to the context root unless the file path is absolute.
148
161
  #
149
162
  # #### Parameters
@@ -16,8 +16,8 @@ module ShopifyCli
16
16
  core: {
17
17
  connect: {
18
18
  help: <<~HELP,
19
- Connect (or re-connect) an existing project to a Shopify partner organization and/or a store. Creates or updates the {{green:.env}} file, and creates the {{green:.shopify-cli.yml}} file.
20
- Usage: {{command:%s connect}}
19
+ Connect (or re-connect) an existing project to a Shopify partner organization and/or a store. Creates or updates the {{green:.env}} file, and creates the {{green:.shopify-cli.yml}} file.
20
+ Usage: {{command:%s connect}}
21
21
  HELP
22
22
 
23
23
  already_connected_warning: "{{yellow:! This app appears to be already connected}}",
@@ -27,15 +27,15 @@ module ShopifyCli
27
27
 
28
28
  context: {
29
29
  open_url: <<~OPEN,
30
- Please open this URL in your browser:
31
- {{green:%s}}
30
+ Please open this URL in your browser:
31
+ {{green:%s}}
32
32
  OPEN
33
33
  },
34
34
 
35
35
  create: {
36
36
  help: <<~HELP,
37
- Create a new project.
38
- Usage: {{command:%s create [ %s ]}}
37
+ Create a new project.
38
+ Usage: {{command:%s create [ %s ]}}
39
39
  HELP
40
40
 
41
41
  error: {
@@ -53,13 +53,13 @@ module ShopifyCli
53
53
 
54
54
  config: {
55
55
  help: <<~HELP,
56
- Change configuration of how the CLI operates
57
- Usage: {{command:%s config [ feature | analytics ] }}
56
+ Change configuration of how the CLI operates
57
+ Usage: {{command:%s config [ feature | analytics ] }}
58
58
  HELP
59
59
  feature: {
60
60
  help: <<~HELP,
61
- Change configuration of various features
62
- Usage: {{command:%s config [ feature ] [ feature_name ] }}
61
+ Change configuration of various features
62
+ Usage: {{command:%s config [ feature ] [ feature_name ] }}
63
63
  HELP
64
64
  enabled: "{{v}} feature {{green:%s}} has been enabled",
65
65
  disabled: "{{v}} feature {{green:%s}} has been disabled",
@@ -68,8 +68,8 @@ module ShopifyCli
68
68
  },
69
69
  analytics: {
70
70
  help: <<~HELP,
71
- Opt in/out of anonymous usage reporting
72
- Usage: {{command:%s config [ analytics ] }}
71
+ Opt in/out of anonymous usage reporting
72
+ Usage: {{command:%s config [ analytics ] }}
73
73
  HELP
74
74
  enabled: "{{v}} analytics have been enabled",
75
75
  disabled: "{{v}} analytics have been disabled",
@@ -97,9 +97,9 @@ module ShopifyCli
97
97
  },
98
98
 
99
99
  preamble: <<~MESSAGE,
100
- Use {{command:%s help <command>}} to display detailed information about a specific command.
100
+ Use {{command:%s help <command>}} to display detailed information about a specific command.
101
101
 
102
- {{bold:Available core commands:}}
102
+ {{bold:Available core commands:}}
103
103
 
104
104
  MESSAGE
105
105
  },
@@ -131,8 +131,8 @@ module ShopifyCli
131
131
 
132
132
  logout: {
133
133
  help: <<~HELP,
134
- Log out of a currently authenticated partner organization and store, or clear invalid credentials
135
- Usage: {{command:%s logout}}
134
+ Log out of a currently authenticated partner organization and store, or clear invalid credentials
135
+ Usage: {{command:%s logout}}
136
136
  HELP
137
137
 
138
138
  success: "Logged out of partner organization and store",
@@ -154,6 +154,7 @@ module ShopifyCli
154
154
  location: {
155
155
  admin: "development store",
156
156
  partner: "Shopify Partners account",
157
+ shopifolk: "{{green:Shopify Employee account}}",
157
158
  },
158
159
  authentication_required:
159
160
  "{{i}} Authentication required. Login to the URL below with your %s credentials to continue.",
@@ -175,14 +176,15 @@ module ShopifyCli
175
176
  org_name_and_id: "%s (%s)",
176
177
  error: {
177
178
  account_not_found: <<~MESSAGE,
178
- {{x}} error: Your account was not found. Please sign up at https://partners.shopify.com/signup
179
- For authentication issues, run {{command:%s logout}} to clear invalid credentials
179
+ {{x}} error: Your account was not found. Please sign up at https://partners.shopify.com/signup
180
+ For authentication issues, run {{command:%s logout}} to clear invalid credentials
180
181
  MESSAGE
181
182
  },
182
183
  },
183
184
 
184
185
  api: {
185
186
  error: {
187
+ failed_auth: "Failed to authenticate with Shopify. Please try again later.",
186
188
  internal_server_error: "{{red:{{x}} An unexpected error occurred on Shopify.}}",
187
189
  internal_server_error_debug: "\n{{red:Response details:}}\n%s\n\n",
188
190
  invalid_url: "Invalid URL: %s",
@@ -196,16 +198,16 @@ module ShopifyCli
196
198
  },
197
199
  populating: "Populating %d %ss...",
198
200
  completion_message: <<~COMPLETION_MESSAGE,
199
- Successfully added %d %s to {{green:%s}}
200
- {{*}} View all %ss at {{underline:%s%ss}}
201
+ Successfully added %d %s to {{green:%s}}
202
+ {{*}} View all %ss at {{underline:%s%ss}}
201
203
  COMPLETION_MESSAGE
202
204
  },
203
205
 
204
206
  project: {
205
207
  error: {
206
208
  not_in_project: <<~MESSAGE,
207
- {{x}} You are not in a Shopify app project
208
- {{yellow:{{*}}}}{{reset: Run}}{{cyan: shopify create}}{{reset: to create your app}}
209
+ {{x}} You are not in a Shopify app project
210
+ {{yellow:{{*}}}}{{reset: Run}}{{cyan: shopify create}}{{reset: to create your app}}
209
211
  MESSAGE
210
212
  },
211
213
  },
@@ -226,10 +228,10 @@ module ShopifyCli
226
228
 
227
229
  system: {
228
230
  help: <<~HELP,
229
- Print details about the development system.
230
- Usage: {{command:%s system [all]}}
231
+ Print details about the development system.
232
+ Usage: {{command:%s system [all]}}
231
233
 
232
- {{cyan:all}}: displays more details about development system and environment
234
+ {{cyan:all}}: displays more details about development system and environment
233
235
 
234
236
  HELP
235
237
 
@@ -240,8 +242,8 @@ module ShopifyCli
240
242
  header: "{{bold:Shopify App CLI}}",
241
243
  const: "%17s = %s",
242
244
  ruby_header: <<~RUBY_MESSAGE,
243
- {{bold:Ruby (via RbConfig)}}
244
- %s
245
+ {{bold:Ruby (via RbConfig)}}
246
+ %s
245
247
  RUBY_MESSAGE
246
248
  rb_config: "%-25s - RbConfig[\"%s\"]",
247
249
  command_header: "{{bold:Commands}}",
@@ -268,8 +270,8 @@ module ShopifyCli
268
270
  ensure_env: {
269
271
  organization_select: "To which partner organization does this project belong?",
270
272
  no_development_stores: <<~MESSAGE,
271
- No development stores available.
272
- Visit {{underline:https://partners.shopify.com/%d/stores}} to create one
273
+ No development stores available.
274
+ Visit {{underline:https://partners.shopify.com/%d/stores}} to create one
273
275
  MESSAGE
274
276
  development_store_select: "Which development store would you like to use?",
275
277
  app_select: "To which app does this project belong?",
@@ -306,7 +308,10 @@ module ShopifyCli
306
308
  no_development_stores: "{{x}} No Development Stores available.",
307
309
  no_organizations: "No partner organizations available.",
308
310
  organization_not_found: "Cannot find a partner organization with that ID",
309
- partners_notice: "Please visit https://partners.shopify.com/ to create a partners account",
311
+ shopifolk_notice: <<~MESSAGE,
312
+ {{i}} As a {{green:Shopify}} employee, the authentication should take you to the Shopify Okta login,
313
+ NOT the Partner account login. Please run {{command:%s logout}} and try again.
314
+ MESSAGE
310
315
  },
311
316
  first_party: "Are you working on a 1P (1st Party) app?",
312
317
  identified_as_shopify: "We've identified you as a {{green:Shopify}} employee.",
@@ -327,9 +332,9 @@ module ShopifyCli
327
332
 
328
333
  not_running: "{{green:x}} ngrok tunnel not running",
329
334
  signup_suggestion: <<~MESSAGE,
330
- {{*}} To avoid tunnels that timeout, it is recommended to signup for a free ngrok
331
- account at {{underline:https://ngrok.com/signup}}. After you signup, install your
332
- personalized authorization token using {{command:%s tunnel auth <token>}}.
335
+ {{*}} To avoid tunnels that timeout, it is recommended to signup for a free ngrok
336
+ account at {{underline:https://ngrok.com/signup}}. After you signup, install your
337
+ personalized authorization token using {{command:%s tunnel auth <token>}}.
333
338
  MESSAGE
334
339
  start: "{{v}} ngrok tunnel running at {{underline:%s}}",
335
340
  start_with_account: "{{v}} ngrok tunnel running at {{underline:%s}}, with account %s",
@@ -341,31 +346,31 @@ module ShopifyCli
341
346
 
342
347
  version: {
343
348
  help: <<~HELP,
344
- Prints version number.
345
- Usage: {{command:%s version}}
349
+ Prints version number.
350
+ Usage: {{command:%s version}}
346
351
  HELP
347
352
  },
348
353
 
349
354
  warning: {
350
355
  development_version: <<~DEVELOPMENT,
351
- {{*}} {{yellow:You are running a development version of the CLI at:}}
352
- {{yellow:%s}}
356
+ {{*}} {{yellow:You are running a development version of the CLI at:}}
357
+ {{yellow:%s}}
353
358
 
354
359
  DEVELOPMENT
355
360
 
356
361
  shell_shim: <<~MESSAGE,
357
- {{x}} This version of Shopify App CLI is no longer supported. You’ll need to migrate to the new CLI version to continue.
362
+ {{x}} This version of Shopify App CLI is no longer supported. You’ll need to migrate to the new CLI version to continue.
358
363
 
359
- Please visit this page for complete instructions:
360
- {{underline:https://shopify.dev/tools/cli/troubleshooting#migrate-from-a-legacy-version}}
364
+ Please visit this page for complete instructions:
365
+ {{underline:https://shopify.dev/tools/cli/troubleshooting#migrate-from-a-legacy-version}}
361
366
 
362
367
  MESSAGE
363
368
 
364
369
  new_version: <<~MESSAGE,
365
- {{*}} {{yellow:A new version of Shopify App CLI is available! You have version %s and the latest version is %s.
370
+ {{*}} {{yellow:A new version of Shopify App CLI is available! You have version %s and the latest version is %s.
366
371
 
367
- To upgrade, follow the instructions for the package manager you’re using:
368
- {{underline:https://shopify.dev/tools/cli/troubleshooting#upgrade-shopify-app-cli}}}}
372
+ To upgrade, follow the instructions for the package manager you’re using:
373
+ {{underline:https://shopify.dev/tools/cli/troubleshooting#upgrade-shopify-app-cli}}}}
369
374
 
370
375
  MESSAGE
371
376
  },