shopify-cli 2.10.2 → 2.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.github/ISSUE_TEMPLATE/bug_report.yaml +117 -0
  3. data/.github/ISSUE_TEMPLATE/enhancement.yaml +38 -0
  4. data/.github/ISSUE_TEMPLATE/feature.yaml +47 -0
  5. data/CHANGELOG.md +20 -3
  6. data/Gemfile.lock +1 -1
  7. data/dev.yml +3 -0
  8. data/lib/project_types/extension/commands/build.rb +3 -0
  9. data/lib/project_types/extension/commands/check.rb +3 -0
  10. data/lib/project_types/extension/commands/create.rb +3 -0
  11. data/lib/project_types/extension/commands/push.rb +3 -0
  12. data/lib/project_types/extension/commands/serve.rb +3 -0
  13. data/lib/project_types/extension/models/specification_handlers/default.rb +1 -1
  14. data/lib/project_types/extension/tasks/convert_server_config.rb +3 -1
  15. data/lib/project_types/script/commands/connect.rb +3 -1
  16. data/lib/project_types/script/commands/create.rb +2 -0
  17. data/lib/project_types/script/commands/push.rb +6 -0
  18. data/lib/project_types/script/layers/infrastructure/errors.rb +4 -3
  19. data/lib/project_types/script/layers/infrastructure/script_service.rb +2 -2
  20. data/lib/project_types/script/loaders/project.rb +2 -1
  21. data/lib/project_types/script/messages/messages.rb +87 -86
  22. data/lib/project_types/script/ui/error_handler.rb +34 -14
  23. data/lib/project_types/theme/commands/check.rb +3 -0
  24. data/lib/project_types/theme/commands/delete.rb +3 -0
  25. data/lib/project_types/theme/commands/init.rb +3 -0
  26. data/lib/project_types/theme/commands/language_server.rb +3 -0
  27. data/lib/project_types/theme/commands/package.rb +3 -0
  28. data/lib/project_types/theme/commands/publish.rb +3 -0
  29. data/lib/project_types/theme/commands/pull.rb +7 -1
  30. data/lib/project_types/theme/commands/push.rb +7 -1
  31. data/lib/project_types/theme/commands/serve.rb +3 -0
  32. data/lib/shopify_cli/command/sub_command.rb +2 -0
  33. data/lib/shopify_cli/command.rb +66 -0
  34. data/lib/shopify_cli/commands/app/create/node.rb +3 -0
  35. data/lib/shopify_cli/commands/app/create/rails.rb +3 -0
  36. data/lib/shopify_cli/commands/app/create.rb +3 -0
  37. data/lib/shopify_cli/commands/app/deploy.rb +3 -0
  38. data/lib/shopify_cli/commands/app/serve.rb +3 -0
  39. data/lib/shopify_cli/constants.rb +12 -0
  40. data/lib/shopify_cli/environment.rb +27 -1
  41. data/lib/shopify_cli/exception_reporter.rb +9 -0
  42. data/lib/shopify_cli/github/issue_url_generator.rb +19 -8
  43. data/lib/shopify_cli/identity_auth/env_auth_token.rb +34 -0
  44. data/lib/shopify_cli/identity_auth.rb +33 -15
  45. data/lib/shopify_cli/messages/messages.rb +1 -1
  46. data/lib/shopify_cli/partners_api.rb +7 -2
  47. data/lib/shopify_cli/services/app/create/rails_service.rb +37 -13
  48. data/lib/shopify_cli/theme/include_filter.rb +39 -17
  49. data/lib/shopify_cli/utilities.rb +7 -0
  50. data/lib/shopify_cli/version.rb +1 -1
  51. data/lib/shopify_cli.rb +1 -0
  52. data/vendor/deps/cli-kit/lib/cli/kit/system.rb +1 -1
  53. data/vendor/deps/cli-kit/lib/cli/kit/util.rb +5 -1
  54. data/vendor/lib/semantic/version.rb +0 -1
  55. metadata +7 -3
  56. data/lib/project_types/rails/commands/create.rb +0 -210
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0cd807b7755484c50b506a5b4af90072b08ac0f9fc2aaff6c684f0fe5e6b63cc
4
- data.tar.gz: 76aaf43ba5f6af3a6c9ed5f2f73b0d79cb03261d544602996b9563cd45f4b572
3
+ metadata.gz: 9944385de970a522f54fcf4e8feffa5bcab8ad61498095a1794c5abcf5918063
4
+ data.tar.gz: 62b23eb1ab82cf0783ccab14d77b55c3e71595d87581795fff19227c4bcada57
5
5
  SHA512:
6
- metadata.gz: 407ad8f61eebbfcfbf4c6099eef78a41544ed95002cf7f91fbd9cd56aa473cc1ab6ea323812032c3f21d09760bdcd824908ce9ba1f069ed492997b0cdf3d5853
7
- data.tar.gz: 91ae64882ee0e7969bf93697dda900fb812009df58eeff176833e3e609e51f37fa67f418c1b80be670f852a6594308fc0e89e43a477105b316943827f80ad780
6
+ metadata.gz: 72ec8ee4a02bb2b7cd6f9d58c094625bba0e1971a1d2e81d86920e8b326ff8fb52bac73b2a7afec43f7e67991b239bd7ac11c43a2df70790ecd82cf6c4614db2
7
+ data.tar.gz: e456bb338bfa6102cf8643455b983a147a0fdef6fb820a5ee46dd210e6cbde788de6053727c48ab44057a7ad920a8b765651bfd09a26735b4db8525dc6f247b1
@@ -0,0 +1,117 @@
1
+ name: Bug Report
2
+ description: File a bug report
3
+ title: "[Bug]: <YOUR ISSUE TITLE>"
4
+ labels: ["type:bug"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |-
9
+ Hi! 👋 Thanks for taking the time to open an issue.
10
+
11
+ ## Before you begin
12
+ - type: checkboxes
13
+ id: preflight_checks
14
+ attributes:
15
+ label: |-
16
+ Please confirm that you have:
17
+ options:
18
+ - label: Searched [existing issues](https://github.com/Shopify/shopify-cli/issues) to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
19
+ required: true
20
+ - label: Reproduced the issue in [the latest CLI version](https://github.com/Shopify/shopify-cli/releases).
21
+ required: true
22
+ validations:
23
+ required: true
24
+ - type: markdown
25
+ attributes:
26
+ value: '## General Questions'
27
+ - type: dropdown
28
+ id: app_type
29
+ attributes:
30
+ label: What type of project are you working on?
31
+ options:
32
+ - app
33
+ - extension
34
+ - script
35
+ - theme
36
+ - other
37
+ validations:
38
+ required: true
39
+ - type: textarea
40
+ id: expected_behavior
41
+ attributes:
42
+ label: Expected behavior
43
+ description: What do you think should have happened?
44
+ placeholder: It should have worked
45
+ validations:
46
+ required: true
47
+ - type: textarea
48
+ id: actual_behavior
49
+ attributes:
50
+ label: Actual behavior
51
+ description: What actually happened?
52
+ placeholder: It didn't work
53
+ validations:
54
+ required: true
55
+ - type: textarea
56
+ id: stack_trace
57
+ attributes:
58
+ label: Stack trace
59
+ description: Paste in a stack trace if you've got one!
60
+ render: shell
61
+ validations:
62
+ required: false
63
+ - type: textarea
64
+ id: repro_steps
65
+ attributes:
66
+ label: Reproduction steps
67
+ description: Let us know the exact steps required to reproduce the error. The more detail, the better!
68
+ value: |-
69
+ 1.
70
+ 2.
71
+ 3.
72
+ validations:
73
+ required: true
74
+ - type: markdown
75
+ attributes:
76
+ value: |
77
+ ## Environment Details
78
+
79
+ Just a few more technical questions, to help us understand if your bug is linked to a particular runtime enviroment.
80
+ - type: input
81
+ id: os
82
+ attributes:
83
+ label: Operating System
84
+ placeholder: Windows 11, Mac OS Monterey, Ubuntu 20.04...
85
+ validations:
86
+ required: true
87
+ - type: input
88
+ id: cli_version
89
+ attributes:
90
+ label: CLI version (run `shopify version` if you're not sure)
91
+ placeholder: 2.10.0
92
+ validations:
93
+ required: true
94
+ - type: input
95
+ id: shell
96
+ attributes:
97
+ label: Shell
98
+ placeholder: Cygwin, Git Bash, iTerm2, bash, zsh...
99
+ - type: input
100
+ id: ruby_version
101
+ attributes:
102
+ label: Ruby version (run `ruby -v` if you're not sure)
103
+ placeholder: 3.0.2p107
104
+ - type: input
105
+ id: other_versions
106
+ attributes:
107
+ label: What language and version are you using in your application?
108
+ placeholder: Ruby 3.0.3, Node 17.1, PHP 7.4...
109
+ - type: markdown
110
+ attributes:
111
+ value: |-
112
+
113
+ ## What to Expect
114
+
115
+ When you submit this issue, it will go to a Shopify developer experience team. We may not be able to reply right away, but we usually respond within a week.
116
+
117
+ We always value your feedback. Thanks again for taking the time to help improve the CLI for everyone!
@@ -0,0 +1,38 @@
1
+ name: Enhancement
2
+ description: Enhancement to our codebase that isn't a adding or changing a feature
3
+ title: "[Enhancement]: <YOUR ENHANCEMENT>"
4
+ labels: ["type:enhancement"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |-
9
+ Hi! 👋 Thanks for taking the time to open an issue.
10
+
11
+ While we can't promise we'll implement your request, we'll certainly look it over and take your needs into consideration.
12
+ - type: dropdown
13
+ id: app_type
14
+ attributes:
15
+ label: What type of project(s) will this request affect?
16
+ options:
17
+ - app
18
+ - extension
19
+ - script
20
+ - theme
21
+ - other
22
+ multiple: true
23
+ validations:
24
+ required: true
25
+ - type: textarea
26
+ id: overview
27
+ attributes:
28
+ label: Overview
29
+ description: Describe in your own words the change you'd like to be made to the CLI.
30
+ validations:
31
+ required: true
32
+ - type: textarea
33
+ id: motivation
34
+ attributes:
35
+ label: Motivation
36
+ description: What inspired this request? What problems were you facing?
37
+ validations:
38
+ required: true
@@ -0,0 +1,47 @@
1
+ name: Feature Request
2
+ description: Suggest a new feature, or changes to an existing one
3
+ title: "[Feature]: <YOUR FEATURE>"
4
+ labels: ["type:feature"]
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |-
9
+ Hi! 👋 Thanks for taking the time to open an issue.
10
+
11
+ While we can't promise we'll implement your request, we'll certainly look it over and take your needs into consideration.
12
+ - type: dropdown
13
+ id: app_type
14
+ attributes:
15
+ label: What type of project(s) will this request affect?
16
+ options:
17
+ - app
18
+ - extension
19
+ - script
20
+ - theme
21
+ - other
22
+ multiple: true
23
+ validations:
24
+ required: true
25
+ - type: dropdown
26
+ id: type
27
+ attributes:
28
+ label: What type of change do you want to see?
29
+ options:
30
+ - New feature
31
+ - Substantial change to existing feature
32
+ validations:
33
+ required: true
34
+ - type: textarea
35
+ id: overview
36
+ attributes:
37
+ label: Overview
38
+ description: Describe in your own words the feature you'd like to be added to the CLI.
39
+ validations:
40
+ required: true
41
+ - type: textarea
42
+ id: motivation
43
+ attributes:
44
+ label: Motivation
45
+ description: What inspired this feature request? What problems were you facing?
46
+ validations:
47
+ required: true
data/CHANGELOG.md CHANGED
@@ -2,10 +2,27 @@ 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.11.0
6
+
7
+ ### Fixed
8
+ * [#2005](https://github.com/Shopify/shopify-cli/pull/2005): Fix PHP app serve on Windows environments
9
+
10
+ ### Added
11
+ * [#1998](https://github.com/Shopify/shopify-cli/pull/1998): Add support for Rails 7
12
+ * [#1945](https://github.com/Shopify/shopify-cli/pull/1945): Check Node and Ruby versions and warn the user if their environment's version might be incompatible with the version the command expects.
13
+ * [#2011](https://github.com/Shopify/shopify-cli/pull/2011): Adds support for the Spin rewrite
14
+
15
+ ### Changed
16
+ * [#2001](https://github.com/Shopify/shopify-cli/pull/2001): Improve Bug Issue Template. Includes autofill of CLI/Ruby/environment information.
17
+ * [#2004](https://github.com/Shopify/shopify-cli/pull/2004): Template improvements II. Includes autofill of Shell if $SHELL is set.
18
+ * [#2002](https://github.com/Shopify/shopify-cli/pull/2002): Update `-o`/`--only` parameter to allow multiple patterns on `theme push`/`theme pull` commands
19
+ * [#2022](https://github.com/Shopify/shopify-cli/pull/2022): Don't warn the user if the Ruby version is in the range 3.0.x.
20
+
5
21
  ## Version 2.10.2
6
22
  ### Fixed
7
23
  * [#1983](https://github.com/Shopify/shopify-cli/pull/1983): Improve Windows compatibility
8
24
  * [#1928](https://github.com/Shopify/shopify-cli/pull/1928): Ensure script Wasm file sizes don't exceed the limit
25
+ * [#2006](https://github.com/Shopify/shopify-cli/pull/2006): Fix: More defensive URL generation
9
26
 
10
27
  ## Version 2.10.1
11
28
  ### Fixed
@@ -73,7 +90,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
73
90
  * [#1769](https://github.com/Shopify/shopify-cli/pull/1769): Fix `theme push --development --json` to output the proper exit code
74
91
  * [#1766](https://github.com/Shopify/shopify-cli/pull/1766): Fix `theme serve` failing with the `--host` property
75
92
  * [#1771](https://github.com/Shopify/shopify-cli/pull/1771): Fix `theme push --development --json` to output errors in the STDERR
76
- * [#1778](https://github.com/Shopify/shopify-cli/pull/1778): Fix ngrok installation check on Windows
93
+ * [#1778](https://github.com/Shopify/shopify-cli/pull/1778): Fix ngrok installation check on Windows
77
94
  * [#1798](https://github.com/Shopify/shopify-cli/pull/1798): Add `--live` option to the `theme pull` and the `theme push` commands
78
95
  * [#1788](https://github.com/Shopify/shopify-cli/pull/1788): Improve `theme serve` errors and add logs for successful operations
79
96
  * [#1794](https://github.com/Shopify/shopify-cli/pull/1794): Fix bug where hidden subcommands appear in the help menu.
@@ -82,7 +99,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
82
99
  ### Fixed
83
100
  * [#1722](https://github.com/Shopify/shopify-cli/pull/1722): Fix `theme serve` failing when the port is already being used
84
101
  * [#1751](https://github.com/Shopify/shopify-cli/pull/1751): A bug in the app creation flow that caused the CLI to abort when the form validation failed.
85
- * [#1750](https://github.com/Shopify/shopify-cli/pull/1750): Runtime errors in Windows' environments when the `PATHEXT` environment variable is not defined.
102
+ * [#1750](https://github.com/Shopify/shopify-cli/pull/1750): Runtime errors in Windows' environments when the `PATHEXT` environment variable is not defined.
86
103
  * [#1758](https://github.com/Shopify/shopify-cli/pull/1758): Fix tunnel creation for expired anonymous tunnels
87
104
 
88
105
  ## Version 2.7.0
@@ -100,7 +117,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
100
117
  ### Fixed
101
118
  * [#1678](https://github.com/Shopify/shopify-cli/pull/1678): Fix migrator's incompatibility with Ruby 2.5.
102
119
  * [#1690](https://github.com/Shopify/shopify-cli/pull/1690): Fix `extension push` command for `PRODUCT_SUBSCRIPTION` extensions
103
-
120
+
104
121
  ### Changed
105
122
  * [#1678](https://github.com/Shopify/shopify-cli/pull/1678): Change the `@shopify/scripts-checkout-apis-temp` package name to `@shopify/scripts-discount-apis`.
106
123
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.10.2)
4
+ shopify-cli (2.11.0)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.9.0)
data/dev.yml CHANGED
@@ -28,3 +28,6 @@ test:
28
28
  commands:
29
29
  style:
30
30
  run: bundle exec rubocop .
31
+ test:script:
32
+ desc: "Run all script-related tests"
33
+ run: TEST='test/project_types/script/**/*.rb' bundle exec rake test $@
@@ -8,6 +8,9 @@ module Extension
8
8
 
9
9
  prerequisite_task ensure_project_type: :extension
10
10
 
11
+ recommend_default_node_range
12
+ recommend_default_ruby_range
13
+
11
14
  YARN_BUILD_COMMAND = %w(build)
12
15
  NPM_BUILD_COMMAND = %w(run-script build)
13
16
 
@@ -4,6 +4,9 @@ require "theme_check"
4
4
  module Extension
5
5
  class Command
6
6
  class Check < ExtensionCommand
7
+ recommend_default_node_range
8
+ recommend_default_ruby_range
9
+
7
10
  class CheckOptions < ShopifyCLI::Options
8
11
  def initialize(ctx, theme_check)
9
12
  super()
@@ -5,6 +5,9 @@ module Extension
5
5
  class Create < ShopifyCLI::Command::SubCommand
6
6
  prerequisite_task :ensure_authenticated
7
7
 
8
+ recommend_default_node_range
9
+ recommend_default_ruby_range
10
+
8
11
  options do |parser, flags|
9
12
  parser.on("--name=NAME") { |name| flags[:name] = name }
10
13
  parser.on("--template=TEMPLATE") { |template| flags[:template] = template }
@@ -6,6 +6,9 @@ module Extension
6
6
  class Push < ShopifyCLI::Command::SubCommand
7
7
  prerequisite_task ensure_project_type: :extension
8
8
 
9
+ recommend_default_node_range
10
+ recommend_default_ruby_range
11
+
9
12
  options do |parser, flags|
10
13
  parser.on("--api-key=API_KEY") { |api_key| flags[:api_key] = api_key.gsub('"', "") }
11
14
  parser.on("--api-secret=API_SECRET") { |api_secret| flags[:api_secret] = api_secret.gsub('"', "") }
@@ -5,6 +5,9 @@ module Extension
5
5
  class Serve < ExtensionCommand
6
6
  prerequisite_task ensure_project_type: :extension
7
7
 
8
+ recommend_default_node_range
9
+ recommend_default_ruby_range
10
+
8
11
  DEFAULT_PORT = 39351
9
12
 
10
13
  options do |parser, flags|
@@ -108,7 +108,7 @@ module Extension
108
108
  end
109
109
 
110
110
  def server_config_file
111
- "shopifile.yml"
111
+ "extension.config.yml"
112
112
  end
113
113
 
114
114
  protected
@@ -17,6 +17,8 @@ module Extension
17
17
  property :tunnel_url, accepts: String
18
18
  property! :type, accepts: String
19
19
 
20
+ DEFAULT_BUILD_DIR = "build"
21
+
20
22
  def self.call(*args)
21
23
  new(*args).call
22
24
  end
@@ -31,7 +33,7 @@ module Extension
31
33
  type: type.upcase,
32
34
  user: Models::ServerConfig::User.new,
33
35
  development: Models::ServerConfig::Development.new(
34
- build_dir: hash.dig("development", "build_dir"),
36
+ build_dir: hash.dig("development", "build_dir") || DEFAULT_BUILD_DIR,
35
37
  renderer: renderer,
36
38
  entries: Models::ServerConfig::DevelopmentEntries.new(
37
39
  main: hash.dig("development", "entries", "main")
@@ -5,6 +5,8 @@ module Script
5
5
  prerequisite_task :ensure_authenticated
6
6
  prerequisite_task ensure_project_type: :script
7
7
 
8
+ recommend_default_ruby_range
9
+
8
10
  def call(_args, _)
9
11
  Layers::Application::ConnectApp.call(ctx: @ctx, force: true)
10
12
  rescue StandardError => e
@@ -12,7 +14,7 @@ module Script
12
14
  end
13
15
 
14
16
  def self.help
15
- ShopifyCLI::Context.new.message("connect.help", ShopifyCLI::TOOL_NAME, ShopifyCLI::TOOL_NAME)
17
+ ShopifyCLI::Context.new.message("script.connect.help", ShopifyCLI::TOOL_NAME, ShopifyCLI::TOOL_NAME)
16
18
  end
17
19
  end
18
20
  end
@@ -5,6 +5,8 @@ module Script
5
5
  class Create < ShopifyCLI::Command::SubCommand
6
6
  prerequisite_task :ensure_authenticated
7
7
 
8
+ recommend_default_ruby_range
9
+
8
10
  options do |parser, flags|
9
11
  parser.on("--name=NAME") { |name| flags[:name] = name }
10
12
  parser.on("--api=API_NAME") { |ep_name| flags[:extension_point] = ep_name }
@@ -5,6 +5,12 @@ module Script
5
5
  class Push < ShopifyCLI::Command::SubCommand
6
6
  prerequisite_task ensure_project_type: :script
7
7
 
8
+ recommend_node(
9
+ from: ::Script::Layers::Infrastructure::Languages::TypeScriptProjectCreator::MIN_NODE_VERSION,
10
+ to: ShopifyCLI::Constants::SupportedVersions::Node::TO
11
+ )
12
+ recommend_default_ruby_range
13
+
8
14
  options do |parser, flags|
9
15
  parser.on("--force") { |t| flags[:force] = t }
10
16
  parser.on("--api-key=API_KEY") { |api_key| flags[:api_key] = api_key.gsub('"', "") }
@@ -7,10 +7,11 @@ module Script
7
7
  class BuildError < ScriptProjectError; end
8
8
 
9
9
  class ScriptConfigurationDefinitionError < ScriptProjectError
10
- attr_reader :filename
11
- def initialize(message:, filename:)
10
+ attr_reader :filename, :messages
11
+ def initialize(messages:, filename:)
12
+ super()
13
+ @messages = messages
12
14
  @filename = filename
13
- super(message)
14
15
  end
15
16
  end
16
17
 
@@ -50,9 +50,9 @@ module Script
50
50
 
51
51
  if user_errors.any? { |e| e["tag"] == "already_exists_error" }
52
52
  raise Errors::ScriptRepushError, uuid
53
- elsif (e = user_errors.find { |err| err["tag"] == "configuration_definition_error" })
53
+ elsif (errors = user_errors.select { |err| err["tag"] == "configuration_definition_error" }).any?
54
54
  raise Errors::ScriptConfigurationDefinitionError.new(
55
- message: e["message"],
55
+ messages: errors.map { |e| e["message"] },
56
56
  filename: script_config.filename,
57
57
  )
58
58
  elsif (e = user_errors.any? { |err| err["tag"] == "configuration_definition_syntax_error" })
@@ -32,7 +32,8 @@ module Script
32
32
  else
33
33
  properties_hash = { api_key: "--api-key", secret: "--api-secret" }
34
34
  missing_options = error.properties.map { |p| properties_hash[p.name] }.compact.join(", ")
35
- raise ShopifyCLI::Abort, context.message("script.error.missing_push_options", missing_options)
35
+ raise ShopifyCLI::Abort, context.message("script.error.missing_push_options", missing_options,
36
+ ShopifyCli::TOOL_NAME)
36
37
  end
37
38
  end
38
39