shopify-cli 2.10.1 → 2.11.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) 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/.github/ISSUE_TEMPLATE.md +18 -0
  6. data/CHANGELOG.md +38 -3
  7. data/Gemfile.lock +1 -1
  8. data/bin/shopify +9 -0
  9. data/dev.yml +3 -0
  10. data/lib/project_types/extension/commands/check.rb +2 -0
  11. data/lib/project_types/extension/commands/create.rb +2 -0
  12. data/lib/project_types/extension/commands/push.rb +15 -0
  13. data/lib/project_types/extension/commands/serve.rb +2 -0
  14. data/lib/project_types/extension/loaders/project.rb +28 -8
  15. data/lib/project_types/extension/messages/messages.rb +10 -2
  16. data/lib/project_types/extension/models/specification_handlers/default.rb +1 -1
  17. data/lib/project_types/extension/models/specification_handlers/theme_app_extension.rb +7 -1
  18. data/lib/project_types/extension/tasks/convert_server_config.rb +3 -1
  19. data/lib/project_types/script/cli.rb +5 -0
  20. data/lib/project_types/script/commands/connect.rb +3 -1
  21. data/lib/project_types/script/commands/create.rb +2 -0
  22. data/lib/project_types/script/commands/push.rb +6 -0
  23. data/lib/project_types/script/config/extension_points.yml +12 -0
  24. data/lib/project_types/script/graphql/module_upload_url_generate.graphql +5 -1
  25. data/lib/project_types/script/layers/application/build_script.rb +6 -2
  26. data/lib/project_types/script/layers/application/create_script.rb +1 -1
  27. data/lib/project_types/script/layers/application/project_dependencies.rb +1 -1
  28. data/lib/project_types/script/layers/application/push_script.rb +39 -31
  29. data/lib/project_types/script/layers/domain/errors.rb +7 -1
  30. data/lib/project_types/script/layers/domain/extension_point.rb +2 -2
  31. data/lib/project_types/script/layers/infrastructure/errors.rb +13 -3
  32. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_task_runner.rb +3 -16
  33. data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +1 -0
  34. data/lib/project_types/script/layers/infrastructure/languages/task_runner.rb +35 -8
  35. data/lib/project_types/script/layers/infrastructure/languages/typescript_task_runner.rb +3 -16
  36. data/lib/project_types/script/layers/infrastructure/languages/wasm_project_creator.rb +15 -0
  37. data/lib/project_types/script/layers/infrastructure/languages/wasm_task_runner.rb +32 -0
  38. data/lib/project_types/script/layers/infrastructure/metadata_repository.rb +18 -0
  39. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +1 -1
  40. data/lib/project_types/script/layers/infrastructure/script_service.rb +12 -8
  41. data/lib/project_types/script/layers/infrastructure/script_uploader.rb +22 -9
  42. data/lib/project_types/script/loaders/project.rb +2 -1
  43. data/lib/project_types/script/messages/messages.rb +92 -84
  44. data/lib/project_types/script/ui/error_handler.rb +39 -14
  45. data/lib/project_types/theme/commands/check.rb +2 -0
  46. data/lib/project_types/theme/commands/delete.rb +2 -0
  47. data/lib/project_types/theme/commands/init.rb +2 -0
  48. data/lib/project_types/theme/commands/language_server.rb +2 -0
  49. data/lib/project_types/theme/commands/package.rb +2 -0
  50. data/lib/project_types/theme/commands/publish.rb +2 -0
  51. data/lib/project_types/theme/commands/pull.rb +9 -2
  52. data/lib/project_types/theme/commands/push.rb +7 -4
  53. data/lib/project_types/theme/commands/serve.rb +2 -0
  54. data/lib/shopify_cli/command/sub_command.rb +2 -0
  55. data/lib/shopify_cli/command.rb +74 -0
  56. data/lib/shopify_cli/commands/app/create/node.rb +3 -0
  57. data/lib/shopify_cli/commands/app/create/rails.rb +3 -0
  58. data/lib/shopify_cli/commands/app/deploy.rb +2 -0
  59. data/lib/shopify_cli/commands/app/serve.rb +2 -0
  60. data/lib/shopify_cli/constants.rb +13 -1
  61. data/lib/shopify_cli/environment.rb +55 -35
  62. data/lib/shopify_cli/exception_reporter.rb +9 -0
  63. data/lib/shopify_cli/github/issue_url_generator.rb +19 -8
  64. data/lib/shopify_cli/identity_auth/env_auth_token.rb +34 -0
  65. data/lib/shopify_cli/identity_auth.rb +33 -15
  66. data/lib/shopify_cli/messages/messages.rb +3 -2
  67. data/lib/shopify_cli/partners_api.rb +7 -2
  68. data/lib/shopify_cli/services/app/create/rails_service.rb +37 -13
  69. data/lib/shopify_cli/theme/dev_server/hot_reload/remote_file_reloader.rb +63 -0
  70. data/lib/shopify_cli/theme/dev_server/hot_reload.rb +22 -6
  71. data/lib/shopify_cli/theme/dev_server/proxy.rb +4 -5
  72. data/lib/shopify_cli/theme/dev_server.rb +1 -3
  73. data/lib/shopify_cli/theme/development_theme.rb +11 -0
  74. data/lib/shopify_cli/theme/file.rb +4 -0
  75. data/lib/shopify_cli/theme/include_filter.rb +39 -17
  76. data/lib/shopify_cli/theme/theme.rb +0 -4
  77. data/lib/shopify_cli/utilities.rb +7 -0
  78. data/lib/shopify_cli/version.rb +1 -1
  79. data/lib/shopify_cli.rb +1 -0
  80. data/vendor/deps/cli-kit/lib/cli/kit/system.rb +11 -6
  81. data/vendor/deps/cli-kit/lib/cli/kit/util.rb +5 -1
  82. data/vendor/deps/cli-ui/lib/cli/ui/os.rb +6 -4
  83. data/vendor/lib/semantic/version.rb +0 -1
  84. metadata +11 -3
  85. 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: 39a23d6414281b45d36b3508a09f88b629300733e5a3177ce9923905ce26e0ee
4
- data.tar.gz: 38483662a8c42d1463f1b157262a2cec3cf8c4fda0cb5ccfa74a207a3687be33
3
+ metadata.gz: 4a98682c26b1f02a7a24648c23bb987ceab5a70939e031957e80785c1068d849
4
+ data.tar.gz: bfddf7b2f92004d654a66fa8746619d724789c65da7b236e413857fd8705c65f
5
5
  SHA512:
6
- metadata.gz: 58b6b7aa28665cf1107c83ffa6f553eb4cca1661ff8d66d3ef47c9a4d9a3edb46a73e8f38bb5f0f6976699a4a94b58d408e11c2622718be1a554575048c844c3
7
- data.tar.gz: e060cfe1fc4c2917f096b9c0c48f9562f441fb005b6669c1ad93ac8c0a6121ae8c2fac0759fd8f591f4700b0c717f993286b67911cfa133d5cab605a600d69c8
6
+ metadata.gz: 33830ff754743290463c4744cd6e76c37fcf72f6119bcc8d43c9d5a752c3acaab7e9f0e9365f0b0083bae8be2b930d1c1a35affc508210e72998abc11b483d3b
7
+ data.tar.gz: e89c4a64ac97093c8973ccd482ca76b11f3852e29eb124904301c72f930cdce1774fabd1c1d1a3bdb775e065a7e27364a6bb7bbbdcf631c0587ee5e473f793b1
@@ -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
@@ -1,3 +1,21 @@
1
+ <!--
2
+
3
+ Hi! 👋 Thanks for taking the time to open an issue.
4
+
5
+ BEFORE SUBMITTING YOUR ISSUE, please ensure that:
6
+
7
+ 1. You've searched the existing issues to see if someone else has already submitted the same thing. You can access the list at: https://github.com/Shopify/shopify-cli/issues (and feel free to add any additional information in a comment!)
8
+ 2. You've given as much detail as reasonably possible
9
+ 3. You're working with the latest CLI version (check the badge at https://github.com/Shopify/shopify-cli)
10
+
11
+ This is important because:
12
+
13
+ 1. We will notice and prioritize 1 popular issue more quickly than many small duplicates
14
+ 2. More details = faster, higher-quality response
15
+ 3. We might have fixed your issue already!
16
+
17
+ -->
18
+
1
19
  # Issue summary
2
20
 
3
21
  Write a short description of the issue here ↓
data/CHANGELOG.md CHANGED
@@ -2,6 +2,41 @@ 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.2
6
+ ### Fixed
7
+ * [#2047](https://github.com/Shopify/shopify-cli/pull/2047): Fix the Homebrew installation
8
+ * [#2019](https://github.com/Shopify/shopify-cli/pull/2019): Provide helpful link when nokogiri fails to load
9
+ * [#2055](https://github.com/Shopify/shopify-cli/pull/2055): Remove unneeded Node requirements
10
+
11
+ ## Version 2.11.1
12
+ ### Fixed
13
+ * [#1973](https://github.com/Shopify/shopify-cli/pull/1973): Fix `theme serve` to preview generated files (`*.css.liquid`)
14
+ * [#2034](https://github.com/Shopify/shopify-cli/pull/2034): Fix `theme serve` to accept parameters with multiple values
15
+ * [#2033](https://github.com/Shopify/shopify-cli/pull/2033): Pin Homebrew Ruby to 3.0
16
+ * [#2032](https://github.com/Shopify/shopify-cli/pull/2032): Runtime error checking the Node version if Node is not present in the environment.
17
+
18
+ ## Version 2.11.0
19
+ ### Fixed
20
+ * [#2005](https://github.com/Shopify/shopify-cli/pull/2005): Fix PHP app serve on Windows environments
21
+ * [#2020](https://github.com/Shopify/shopify-cli/pull/2020): Fix `theme pull` so that correct dev theme is used with `-d` option
22
+
23
+ ### Added
24
+ * [#1998](https://github.com/Shopify/shopify-cli/pull/1998): Add support for Rails 7
25
+ * [#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.
26
+ * [#2011](https://github.com/Shopify/shopify-cli/pull/2011): Adds support for the Spin rewrite
27
+
28
+ ### Changed
29
+ * [#2001](https://github.com/Shopify/shopify-cli/pull/2001): Improve Bug Issue Template. Includes autofill of CLI/Ruby/environment information.
30
+ * [#2004](https://github.com/Shopify/shopify-cli/pull/2004): Template improvements II. Includes autofill of Shell if $SHELL is set.
31
+ * [#2002](https://github.com/Shopify/shopify-cli/pull/2002): Update `-o`/`--only` parameter to allow multiple patterns on `theme push`/`theme pull` commands
32
+ * [#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.
33
+
34
+ ## Version 2.10.2
35
+ ### Fixed
36
+ * [#1983](https://github.com/Shopify/shopify-cli/pull/1983): Improve Windows compatibility
37
+ * [#1928](https://github.com/Shopify/shopify-cli/pull/1928): Ensure script Wasm file sizes don't exceed the limit
38
+ * [#2006](https://github.com/Shopify/shopify-cli/pull/2006): Fix: More defensive URL generation
39
+
5
40
  ## Version 2.10.1
6
41
  ### Fixed
7
42
  * [#1985](https://github.com/Shopify/shopify-cli/pull/1985): Revert "Fix CORS (Cross-origin resource sharing) errors (#1952)"
@@ -68,7 +103,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
68
103
  * [#1769](https://github.com/Shopify/shopify-cli/pull/1769): Fix `theme push --development --json` to output the proper exit code
69
104
  * [#1766](https://github.com/Shopify/shopify-cli/pull/1766): Fix `theme serve` failing with the `--host` property
70
105
  * [#1771](https://github.com/Shopify/shopify-cli/pull/1771): Fix `theme push --development --json` to output errors in the STDERR
71
- * [#1778](https://github.com/Shopify/shopify-cli/pull/1778): Fix ngrok installation check on Windows
106
+ * [#1778](https://github.com/Shopify/shopify-cli/pull/1778): Fix ngrok installation check on Windows
72
107
  * [#1798](https://github.com/Shopify/shopify-cli/pull/1798): Add `--live` option to the `theme pull` and the `theme push` commands
73
108
  * [#1788](https://github.com/Shopify/shopify-cli/pull/1788): Improve `theme serve` errors and add logs for successful operations
74
109
  * [#1794](https://github.com/Shopify/shopify-cli/pull/1794): Fix bug where hidden subcommands appear in the help menu.
@@ -77,7 +112,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
77
112
  ### Fixed
78
113
  * [#1722](https://github.com/Shopify/shopify-cli/pull/1722): Fix `theme serve` failing when the port is already being used
79
114
  * [#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.
80
- * [#1750](https://github.com/Shopify/shopify-cli/pull/1750): Runtime errors in Windows' environments when the `PATHEXT` environment variable is not defined.
115
+ * [#1750](https://github.com/Shopify/shopify-cli/pull/1750): Runtime errors in Windows' environments when the `PATHEXT` environment variable is not defined.
81
116
  * [#1758](https://github.com/Shopify/shopify-cli/pull/1758): Fix tunnel creation for expired anonymous tunnels
82
117
 
83
118
  ## Version 2.7.0
@@ -95,7 +130,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
95
130
  ### Fixed
96
131
  * [#1678](https://github.com/Shopify/shopify-cli/pull/1678): Fix migrator's incompatibility with Ruby 2.5.
97
132
  * [#1690](https://github.com/Shopify/shopify-cli/pull/1690): Fix `extension push` command for `PRODUCT_SUBSCRIPTION` extensions
98
-
133
+
99
134
  ### Changed
100
135
  * [#1678](https://github.com/Shopify/shopify-cli/pull/1678): Change the `@shopify/scripts-checkout-apis-temp` package name to `@shopify/scripts-discount-apis`.
101
136
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.10.1)
4
+ shopify-cli (2.11.2)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.9.0)
data/bin/shopify CHANGED
@@ -14,6 +14,15 @@ module Kernel
14
14
  raise if name == "#{RUBY_VERSION[/\d+\.\d+/]}/psych.so"
15
15
  # Special case for ffi, which rescues this itself
16
16
  raise if name == "#{RUBY_VERSION.split(".")[0, 2].join(".")}/ffi_c"
17
+ # Special case for nokogiri, which might install the wrong architecture
18
+ if name == "nokogiri/nokogiri"
19
+ STDERR.puts "[Note] Nokogiri is failing to load, which most likely means " \
20
+ "it is installed with the wrong architecture for your system. This link " \
21
+ "has instructions for how to install the correct version for your system: " \
22
+ "https://nokogiri.org/tutorials/installing_nokogiri.html"
23
+ STDERR.puts e.full_message
24
+ exit(1)
25
+ end
17
26
  STDERR.puts "[Note] You cannot use gems with Shopify CLI."
18
27
  STDERR.puts "[LoadError] #{e.message}"
19
28
  if ENV["DEBUG"]
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 $@
@@ -4,6 +4,8 @@ require "theme_check"
4
4
  module Extension
5
5
  class Command
6
6
  class Check < ExtensionCommand
7
+ recommend_default_ruby_range
8
+
7
9
  class CheckOptions < ShopifyCLI::Options
8
10
  def initialize(ctx, theme_check)
9
11
  super()
@@ -5,6 +5,8 @@ module Extension
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("--template=TEMPLATE") { |template| flags[:template] = template }
@@ -6,6 +6,8 @@ module Extension
6
6
  class Push < ShopifyCLI::Command::SubCommand
7
7
  prerequisite_task ensure_project_type: :extension
8
8
 
9
+ recommend_default_ruby_range
10
+
9
11
  options do |parser, flags|
10
12
  parser.on("--api-key=API_KEY") { |api_key| flags[:api_key] = api_key.gsub('"', "") }
11
13
  parser.on("--api-secret=API_SECRET") { |api_secret| flags[:api_secret] = api_secret.gsub('"', "") }
@@ -24,6 +26,10 @@ module Extension
24
26
  api_secret: options.flags[:api_secret],
25
27
  registration_id: options.flags[:registration_id]
26
28
  )
29
+ # on ci, registration id must be present
30
+ registration_id = options.flags[:registration_id]
31
+ check_registration(registration_id: registration_id, context: @ctx)
32
+
27
33
  specification_handler = Extension::Loaders::SpecificationHandler.load(project: project, context: @ctx)
28
34
  register_if_necessary(project: project, args: args, name: name)
29
35
 
@@ -40,6 +46,15 @@ module Extension
40
46
  end
41
47
  end
42
48
 
49
+ def check_registration(registration_id:, context:)
50
+ if !ShopifyCLI::Environment.interactive? && (!registration_id || registration_id.empty?)
51
+ message = context.message("errors.missing_push_options_ci", "--registration-id")
52
+ message += context.message("errors.missing_push_options_ci_solution", ShopifyCLI::TOOL_NAME)
53
+ raise ShopifyCLI::Abort,
54
+ message
55
+ end
56
+ end
57
+
43
58
  def self.help
44
59
  ShopifyCLI::Context.new.message("push.help", ShopifyCLI::TOOL_NAME)
45
60
  end
@@ -5,6 +5,8 @@ module Extension
5
5
  class Serve < ExtensionCommand
6
6
  prerequisite_task ensure_project_type: :extension
7
7
 
8
+ recommend_default_ruby_range
9
+
8
10
  DEFAULT_PORT = 39351
9
11
 
10
12
  options do |parser, flags|
@@ -9,20 +9,40 @@ module Extension
9
9
  "SHOPIFY_API_SECRET" => api_secret,
10
10
  "EXTENSION_ID" => registration_id,
11
11
  }.compact
12
- env =
13
- begin
14
- ShopifyCLI::Resources::EnvFile.read(directory, overrides: env_overrides)
15
- rescue Errno::ENOENT
16
- ShopifyCLI::Resources::EnvFile.from_hash(env_overrides)
17
- end
12
+ env_file_present = env_file_exists?(directory)
13
+ env = if env_file_present
14
+ ShopifyCLI::Resources::EnvFile.read(directory, overrides: env_overrides)
15
+ else
16
+ ShopifyCLI::Resources::EnvFile.from_hash(env_overrides)
17
+ end
18
18
  # This is a somewhat uncomfortable hack we use because `Project::at` is
19
19
  # a global cache and we can't rely on this class loading the project
20
20
  # first. Long-term we should move away from that global cache.
21
21
  project = ExtensionProject.at(directory)
22
22
  project.env = env
23
23
  project
24
- rescue SmartProperties::InitializationError, SmartProperties::MissingValueError
25
- context.abort(context.message("errors.missing_api_key"))
24
+ rescue SmartProperties::InitializationError, SmartProperties::MissingValueError => error
25
+ handle_error(error, context: context)
26
+ end
27
+
28
+ def self.handle_error(error, context:)
29
+ if ShopifyCLI::Environment.interactive?
30
+ properties_hash = { api_key: "SHOPIFY_API_KEY", secret: "SHOPIFY_API_SECRET" }
31
+ missing_env_variables = error.properties.map { |p| properties_hash[p.name] }.compact.join(", ")
32
+ message = context.message("errors.missing_env_file_variables", missing_env_variables)
33
+ message += context.message("errors.missing_env_file_variables_solution", ShopifyCLI::TOOL_NAME)
34
+ else
35
+ properties_hash = { api_key: "--api-key", secret: "--api-secret" }
36
+ missing_options = error.properties.map { |p| properties_hash[p.name] }.compact.join(", ")
37
+ message = context.message("errors.missing_push_options_ci", missing_options)
38
+ message += context.message("errors.missing_push_options_ci_solution", ShopifyCLI::TOOL_NAME)
39
+ end
40
+ raise ShopifyCLI::Abort,
41
+ message
42
+ end
43
+
44
+ def self.env_file_exists?(directory)
45
+ File.exist?(ShopifyCLI::Resources::EnvFile.path(directory))
26
46
  end
27
47
  end
28
48
  end
@@ -174,9 +174,17 @@ module Extension
174
174
  },
175
175
  },
176
176
  errors: {
177
- unknown_type: "Unknown extension type %s",
177
+ unknown_type: "Unknown extension type %s. Valid extension types include: CHECKOUT_POST_PURCHASE, " \
178
+ "CHECKOUT_UI_EXTENSION, THEME_APP_EXTENSION, and PRODUCT_SUBSCRIPTION.",
178
179
  package_not_found: "`%s` package not found.",
179
- missing_api_key: "Missing api_key.",
180
+ missing_push_options_ci: "The following are missing: %s. ",
181
+ missing_push_options_ci_solution: "To add them to a CI environment:\n\t1. Run a connect command " \
182
+ "({{command:%1$s extension connect}})\n\t2. Navigate to the .env file at the root of your project\n\t" \
183
+ "3. Copy the missing values and pass them through as arguments in {{command:%1$s extension push}}",
184
+ missing_env_file_variables: "The following are missing in the .env file: %s. ",
185
+ missing_env_file_variables_solution: "To add it, connect your extension with " \
186
+ "{{command:%1$s extension connect}} " \
187
+ "or run {{command:%1$s extension register}} to register a new extension.",
180
188
  module_not_found: "Unable to find module %s. Ensure your dependencies are up-to-date and try again.",
181
189
  },
182
190
  warnings: {
@@ -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
@@ -6,10 +6,11 @@ module Extension
6
6
  module Models
7
7
  module SpecificationHandlers
8
8
  class ThemeAppExtension < Default
9
- SUPPORTED_BUCKETS = %w(assets blocks snippets)
9
+ SUPPORTED_BUCKETS = %w(assets blocks snippets locales)
10
10
  BUNDLE_SIZE_LIMIT = 10 * 1024 * 1024 # 10MB
11
11
  LIQUID_SIZE_LIMIT = 100 * 1024 # 100kb
12
12
  SUPPORTED_ASSET_EXTS = %w(.jpg .js .css .png .svg)
13
+ SUPPORTED_LOCALE_EXTS = %w(.json)
13
14
 
14
15
  def create(directory_name, context, getting_started: false)
15
16
  context.root = File.join(context.root, directory_name)
@@ -89,6 +90,11 @@ module Extension
89
90
  raise Extension::Errors::InvalidFilenameError,
90
91
  "Invalid filename: #{filename}; #{ext} is not supported"
91
92
  end
93
+ elsif dirname == "locales"
94
+ unless SUPPORTED_LOCALE_EXTS.include?(ext)
95
+ raise Extension::Errors::InvalidFilenameError,
96
+ "Invalid filename: #{filename}; Only #{SUPPORTED_LOCALE_EXTS.join(", ")} allowed in #{dirname}"
97
+ end
92
98
  elsif ext != ".liquid"
93
99
  raise Extension::Errors::InvalidFilenameError,
94
100
  "Invalid filename: #{filename}; Only .liquid allowed in #{dirname}"
@@ -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")
@@ -57,6 +57,7 @@ module Script
57
57
  autoload :CommandRunner, Project.project_filepath("layers/infrastructure/command_runner")
58
58
  autoload :PushPackageRepository, Project.project_filepath("layers/infrastructure/push_package_repository")
59
59
  autoload :ExtensionPointRepository, Project.project_filepath("layers/infrastructure/extension_point_repository")
60
+ autoload :MetadataRepository, Project.project_filepath("layers/infrastructure/metadata_repository")
60
61
  autoload :ScriptProjectRepository, Project.project_filepath("layers/infrastructure/script_project_repository")
61
62
  autoload :ScriptService, Project.project_filepath("layers/infrastructure/script_service")
62
63
  autoload :ScriptUploader, Project.project_filepath("layers/infrastructure/script_uploader")
@@ -73,6 +74,10 @@ module Script
73
74
  Project.project_filepath("layers/infrastructure/languages/typescript_project_creator.rb")
74
75
  autoload :TypeScriptTaskRunner,
75
76
  Project.project_filepath("layers/infrastructure/languages/typescript_task_runner.rb")
77
+ autoload :WasmProjectCreator,
78
+ Project.project_filepath("layers/infrastructure/languages/wasm_project_creator.rb")
79
+ autoload :WasmTaskRunner,
80
+ Project.project_filepath("layers/infrastructure/languages/wasm_task_runner.rb")
76
81
  end
77
82
 
78
83
  module ApiClients
@@ -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('"', "") }
@@ -8,6 +8,9 @@ payment_methods:
8
8
  beta: true
9
9
  package: "@shopify/scripts-checkout-apis"
10
10
  repo: "https://github.com/Shopify/scripts-apis-examples"
11
+ wasm:
12
+ beta: true
13
+ repo: "https://github.com/Shopify/scripts-apis-examples"
11
14
  shipping_methods:
12
15
  domain: 'checkout'
13
16
  libraries:
@@ -18,6 +21,9 @@ shipping_methods:
18
21
  beta: true
19
22
  package: "@shopify/scripts-checkout-apis"
20
23
  repo: "https://github.com/Shopify/scripts-apis-examples"
24
+ wasm:
25
+ beta: true
26
+ repo: "https://github.com/Shopify/scripts-apis-examples"
21
27
  merchandise_discount_types:
22
28
  beta: true
23
29
  domain: 'discounts'
@@ -26,6 +32,9 @@ merchandise_discount_types:
26
32
  beta: true
27
33
  package: "@shopify/scripts-discounts-apis"
28
34
  repo: "https://github.com/Shopify/scripts-apis-examples"
35
+ wasm:
36
+ beta: true
37
+ repo: "https://github.com/Shopify/scripts-apis-examples"
29
38
  delivery_discount_types:
30
39
  beta: true
31
40
  domain: 'discounts'
@@ -34,3 +43,6 @@ delivery_discount_types:
34
43
  beta: true
35
44
  package: "@shopify/scripts-discounts-apis"
36
45
  repo: "https://github.com/Shopify/scripts-apis-examples"
46
+ wasm:
47
+ beta: true
48
+ repo: "https://github.com/Shopify/scripts-apis-examples"
@@ -1,6 +1,10 @@
1
1
  mutation moduleUploadUrlGenerate {
2
2
  moduleUploadUrlGenerate {
3
- url
3
+ details {
4
+ url
5
+ headers
6
+ humanizedMaxSize
7
+ }
4
8
  userErrors {
5
9
  field
6
10
  message