shopify-cli 2.11.2 → 2.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. checksums.yaml +4 -4
  2. data/.github/CODEOWNERS +5 -0
  3. data/.github/PULL_REQUEST_TEMPLATE.md +1 -1
  4. data/.github/workflows/shopify.yml +2 -1
  5. data/.rubocop.yml +1 -1
  6. data/.ruby-version +1 -1
  7. data/CHANGELOG.md +44 -1
  8. data/Gemfile.lock +18 -18
  9. data/Rakefile +16 -0
  10. data/bin/shopify +12 -8
  11. data/dev.yml +1 -1
  12. data/docs/users/installation.md +1 -44
  13. data/ext/javy/hashes/javy-arm-macos-v0.2.0.gz.sha256 +1 -0
  14. data/ext/javy/hashes/javy-arm-macos-v0.2.1.gz.sha256 +1 -0
  15. data/ext/javy/hashes/javy-x86_64-linux-v0.2.0.gz.sha256 +1 -0
  16. data/ext/javy/hashes/javy-x86_64-linux-v0.2.1.gz.sha256 +1 -0
  17. data/ext/javy/hashes/javy-x86_64-macos-v0.2.0.gz.sha256 +1 -0
  18. data/ext/javy/hashes/javy-x86_64-macos-v0.2.1.gz.sha256 +1 -0
  19. data/ext/javy/hashes/javy-x86_64-windows-v0.2.0.gz.sha256 +1 -0
  20. data/ext/javy/hashes/javy-x86_64-windows-v0.2.1.gz.sha256 +1 -0
  21. data/ext/javy/version +1 -1
  22. data/lib/project_types/extension/features/argo_setup_steps.rb +4 -6
  23. data/lib/project_types/extension/models/npm_package.rb +19 -1
  24. data/lib/project_types/extension/models/server_config/development_renderer.rb +4 -3
  25. data/lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb +114 -0
  26. data/lib/project_types/extension/tasks/configure_features.rb +15 -2
  27. data/lib/project_types/extension/tasks/convert_server_config.rb +2 -1
  28. data/lib/project_types/script/cli.rb +2 -4
  29. data/lib/project_types/script/commands/create.rb +5 -5
  30. data/lib/project_types/script/commands/push.rb +4 -6
  31. data/lib/project_types/script/config/extension_points.yml +0 -10
  32. data/lib/project_types/script/errors.rb +1 -1
  33. data/lib/project_types/script/forms/create.rb +7 -20
  34. data/lib/project_types/script/layers/application/build_script.rb +9 -26
  35. data/lib/project_types/script/layers/application/connect_app.rb +3 -2
  36. data/lib/project_types/script/layers/application/create_script.rb +9 -10
  37. data/lib/project_types/script/layers/application/project_dependencies.rb +12 -14
  38. data/lib/project_types/script/layers/application/push_script.rb +14 -10
  39. data/lib/project_types/script/layers/domain/errors.rb +3 -3
  40. data/lib/project_types/script/layers/domain/push_package.rb +6 -0
  41. data/lib/project_types/script/layers/domain/script_config.rb +2 -4
  42. data/lib/project_types/script/layers/domain/script_project.rb +3 -2
  43. data/lib/project_types/script/layers/infrastructure/errors.rb +11 -0
  44. data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +0 -16
  45. data/lib/project_types/script/layers/infrastructure/languages/task_runner.rb +0 -1
  46. data/lib/project_types/script/layers/infrastructure/languages/tool_version_checker.rb +26 -0
  47. data/lib/project_types/script/layers/infrastructure/languages/typescript_project_creator.rb +22 -10
  48. data/lib/project_types/script/layers/infrastructure/languages/typescript_task_runner.rb +32 -29
  49. data/lib/project_types/script/layers/infrastructure/languages/wasm_project_creator.rb +0 -3
  50. data/lib/project_types/script/layers/infrastructure/languages/wasm_task_runner.rb +1 -1
  51. data/lib/project_types/script/layers/infrastructure/push_package_repository.rb +3 -21
  52. data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +14 -26
  53. data/lib/project_types/script/layers/infrastructure/script_service.rb +4 -2
  54. data/lib/project_types/script/loaders/project.rb +8 -7
  55. data/lib/project_types/script/messages/messages.rb +22 -21
  56. data/lib/project_types/script/ui/error_handler.rb +17 -4
  57. data/lib/project_types/script/ui/strict_spinner.rb +4 -6
  58. data/lib/project_types/theme/cli.rb +2 -0
  59. data/lib/project_types/theme/commands/common/root_helper.rb +71 -0
  60. data/lib/project_types/theme/commands/init.rb +2 -0
  61. data/lib/project_types/theme/commands/list.rb +34 -0
  62. data/lib/project_types/theme/commands/open.rb +65 -0
  63. data/lib/project_types/theme/commands/package.rb +1 -0
  64. data/lib/project_types/theme/commands/pull.rb +18 -10
  65. data/lib/project_types/theme/commands/push.rb +17 -9
  66. data/lib/project_types/theme/commands/serve.rb +6 -2
  67. data/lib/project_types/theme/conversions/base_glob.rb +50 -0
  68. data/lib/project_types/theme/conversions/ignore_glob.rb +15 -0
  69. data/lib/project_types/theme/conversions/include_glob.rb +15 -0
  70. data/lib/project_types/theme/forms/select.rb +11 -39
  71. data/lib/project_types/theme/messages/messages.rb +38 -7
  72. data/lib/project_types/theme/presenters/theme_presenter.rb +48 -0
  73. data/lib/project_types/theme/presenters/themes_presenter.rb +32 -0
  74. data/lib/shopify_cli/api.rb +1 -1
  75. data/lib/shopify_cli/commands/app/create/node.rb +1 -0
  76. data/lib/shopify_cli/commands/app/create/php.rb +1 -0
  77. data/lib/shopify_cli/commands/app/create/rails.rb +1 -0
  78. data/lib/shopify_cli/commands/app/deploy.rb +1 -1
  79. data/lib/shopify_cli/constants.rb +2 -2
  80. data/lib/shopify_cli/context.rb +13 -15
  81. data/lib/shopify_cli/core/entry_point.rb +1 -1
  82. data/lib/shopify_cli/core/monorail.rb +14 -6
  83. data/lib/shopify_cli/environment.rb +6 -0
  84. data/lib/shopify_cli/exception_reporter.rb +2 -0
  85. data/lib/shopify_cli/git.rb +9 -1
  86. data/lib/shopify_cli/messages/messages.rb +21 -1
  87. data/lib/shopify_cli/packager.rb +1 -1
  88. data/lib/shopify_cli/result.rb +14 -0
  89. data/lib/shopify_cli/services/app/create/rails_service.rb +1 -1
  90. data/lib/shopify_cli/tasks/ensure_git_dependency.rb +14 -0
  91. data/lib/shopify_cli/tasks.rb +1 -0
  92. data/lib/shopify_cli/theme/dev_server/hot_reload/remote_file_reloader.rb +5 -5
  93. data/lib/shopify_cli/theme/dev_server/proxy.rb +14 -2
  94. data/lib/shopify_cli/theme/dev_server/watcher.rb +10 -2
  95. data/lib/shopify_cli/theme/development_theme.rb +2 -5
  96. data/lib/shopify_cli/theme/include_filter.rb +4 -2
  97. data/lib/shopify_cli/theme/syncer.rb +40 -36
  98. data/lib/shopify_cli/theme/theme.rb +16 -27
  99. data/lib/shopify_cli/theme/theme_admin_api.rb +71 -0
  100. data/lib/shopify_cli/transform_data_structure.rb +3 -2
  101. data/lib/shopify_cli/version.rb +1 -1
  102. data/shipit.yml +3 -0
  103. data/shopify-cli.gemspec +9 -2
  104. data/shopify-dev +9 -11
  105. metadata +26 -8
  106. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_project_creator.rb +0 -25
  107. data/lib/project_types/script/layers/infrastructure/languages/assemblyscript_task_runner.rb +0 -98
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a98682c26b1f02a7a24648c23bb987ceab5a70939e031957e80785c1068d849
4
- data.tar.gz: bfddf7b2f92004d654a66fa8746619d724789c65da7b236e413857fd8705c65f
3
+ metadata.gz: be8f00a6bb6d3e7059a63e77ff74327d9e11474cc34b156ec54da33080119e11
4
+ data.tar.gz: ed986614e2b2c0b9b9ca70a175c2133a3130643f3678bbf17148556be4f39f86
5
5
  SHA512:
6
- metadata.gz: 33830ff754743290463c4744cd6e76c37fcf72f6119bcc8d43c9d5a752c3acaab7e9f0e9365f0b0083bae8be2b930d1c1a35affc508210e72998abc11b483d3b
7
- data.tar.gz: e89c4a64ac97093c8973ccd482ca76b11f3852e29eb124904301c72f930cdce1774fabd1c1d1a3bdb775e065a7e27364a6bb7bbbdcf631c0587ee5e473f793b1
6
+ metadata.gz: cc1c384e33b5bc316e38ab1ab58b978ab56e811309c82746f9218fc8de2cd4d57b243414f324421baff1abdc69829d952840e2c2bd94049963858ca3700c5600
7
+ data.tar.gz: d065d5a10be15c0f79c800798fb0302e9b2519b7b22fea5879ae321297e8bd0859d8b21756b40ae8abe78387e1e3e62b600d0e796a5848545b1c8e5c37af4cd2
data/.github/CODEOWNERS CHANGED
@@ -3,3 +3,8 @@
3
3
 
4
4
  /lib/project_types/script/ @shopify/scripts-platform
5
5
  /test/project_types/script/ @shopify/scripts-platform
6
+
7
+ /lib/project_types/theme/ @shopify/theme-platform-dev-experience
8
+ /lib/shopify_cli/theme/ @shopify/theme-platform-dev-experience
9
+ /test/project_types/theme/ @shopify/theme-platform-dev-experience
10
+ /test/shopify-cli/theme/ @shopify/theme-platform-dev-experience
@@ -40,4 +40,4 @@ Fixes #0000 <!-- link to issue if one exists -->
40
40
  - [ ] I've added a CHANGELOG entry for this PR (if the change is public-facing)
41
41
  - [ ] I've considered possible cross-platform impacts (Mac, Linux, Windows).
42
42
  - [ ] I've left the version number as is (we'll handle incrementing this when releasing).
43
- - [ ] I've included any post-release steps in the section above.
43
+ - [ ] I've included any post-release steps in the section above (if needed).
@@ -17,6 +17,7 @@ jobs:
17
17
  strategy:
18
18
  matrix:
19
19
  version:
20
+ - 3.1.0
20
21
  - 3.0.2
21
22
  - 2.6.6
22
23
  - 2.7.5
@@ -82,7 +83,7 @@ jobs:
82
83
  strategy:
83
84
  matrix:
84
85
  version:
85
- - 3.0.2
86
+ - 3.1.0
86
87
  os:
87
88
  - macos-latest
88
89
  steps:
data/.rubocop.yml CHANGED
@@ -46,7 +46,7 @@ AllCops:
46
46
  - "vendor/**/*"
47
47
  - "docs/**/*"
48
48
  - "packaging/**/*"
49
- TargetRubyVersion: 2.4
49
+ TargetRubyVersion: 2.6
50
50
 
51
51
  Layout/EmptyLines:
52
52
  Exclude:
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 2.7.5
1
+ 3.1.0
data/CHANGELOG.md CHANGED
@@ -2,11 +2,55 @@ 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.14.0
6
+
7
+ ### Changed
8
+ * [#2126](https://github.com/Shopify/shopify-cli/pull/2126): Use javy version 0.2.1
9
+
10
+ ### Added
11
+ * [#2103](https://github.com/Shopify/shopify-cli/pull/2103): Improve `shopify theme package` to include the `release-notes.md` file
12
+
13
+ ### Fixed
14
+ * [#2112](https://github.com/Shopify/shopify-cli/pull/2112): Fix intermittent error ("can't add a new key into hash during iteration") in the `theme push` command
15
+ * [#2088](https://github.com/Shopify/shopify-cli/pull/2088): Update theme-check to 1.10.1
16
+ * [#2130](https://github.com/Shopify/shopify-cli/pull/2130): Fix Homebrew installation.
17
+ * [#2133](https://github.com/Shopify/shopify-cli/pull/2133): Fix ignore file handling in DevServer::Watcher.
18
+
19
+ ## Version 2.13.0
20
+
21
+ ### Added
22
+ * [#2087](https://github.com/Shopify/shopify-cli/pull/2087): Add new Theme CLI commands: `theme list` and `theme open`
23
+ * [#2035](https://github.com/Shopify/shopify-cli/pull/2035): Support Ruby 3.1
24
+
25
+ ### Fixed
26
+ * [#2092](https://github.com/Shopify/shopify-cli/pull/2092): Fix `RootHelper` parse logic to support options with an equal (e.g.: `option=value`)
27
+ * [#2089](https://github.com/Shopify/shopify-cli/pull/2089): Use javy version 0.2.0
28
+ * [#2114](https://github.com/Shopify/shopify-cli/pull/2114): Fix `theme` command error messaging with `ThemeAdminAPI` wrapper
29
+
30
+ ### Removed
31
+ * [#2102](https://github.com/Shopify/shopify-cli/pull/2102): Remove AssemblyScript as a supported script language.
32
+
33
+ ## Version 2.12.0
34
+ ### Added
35
+ * [#1866](https://github.com/Shopify/shopify-cli/pull/1866): Enforce git dependency
36
+ * [#2009](https://github.com/Shopify/shopify-cli/pull/2009): Add localization support for Checkout Extensions
37
+ * [#2060](https://github.com/Shopify/shopify-cli/pull/2060): Improve CLI error messages for token-based auth (scripts)
38
+ * [#2076](https://github.com/Shopify/shopify-cli/pull/2076): Release Wasm Script Projects
39
+ * [#2051](https://github.com/Shopify/shopify-cli/pull/2051): Update `theme serve` to accept `root` argument
40
+ * [#2025](https://github.com/Shopify/shopify-cli/pull/2025): Improve `theme pull`/`push` help messages to indicate multiple `--only`/`--ignore` flags are allowed.
41
+
42
+ ### Fixed
43
+ * [#2030](https://github.com/Shopify/shopify-cli/pull/2030): Fix Theme::Syncer handling of file deletions in `download_file!`
44
+ * [#2071](https://github.com/Shopify/shopify-cli/pull/2071): Fix `theme pull` error message when dev theme doesn't exist
45
+ * [#2066](https://github.com/Shopify/shopify-cli/pull/2066): Improve `--only`/`--ignore` parameters on Theme `pull`/`push` commands to work without quotes
46
+ * [#2078](https://github.com/Shopify/shopify-cli/pull/2078): Fix errors on section rendering caused by CORS issues
47
+
5
48
  ## Version 2.11.2
6
49
  ### Fixed
7
50
  * [#2047](https://github.com/Shopify/shopify-cli/pull/2047): Fix the Homebrew installation
8
51
  * [#2019](https://github.com/Shopify/shopify-cli/pull/2019): Provide helpful link when nokogiri fails to load
9
52
  * [#2055](https://github.com/Shopify/shopify-cli/pull/2055): Remove unneeded Node requirements
53
+ * [#2020](https://github.com/Shopify/shopify-cli/pull/2020): Fix `theme pull` so that correct dev theme is used with `-d` option
10
54
 
11
55
  ## Version 2.11.1
12
56
  ### Fixed
@@ -18,7 +62,6 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
18
62
  ## Version 2.11.0
19
63
  ### Fixed
20
64
  * [#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
65
 
23
66
  ### Added
24
67
  * [#1998](https://github.com/Shopify/shopify-cli/pull/1998): Add support for Rails 7
data/Gemfile.lock CHANGED
@@ -1,10 +1,10 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.11.2)
4
+ shopify-cli (2.14.0)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
- theme-check (~> 1.9.0)
7
+ theme-check (~> 1.10.1)
8
8
 
9
9
  GEM
10
10
  remote: https://rubygems.org/
@@ -66,7 +66,7 @@ GEM
66
66
  mime-types (3.3.1)
67
67
  mime-types-data (~> 3.2015)
68
68
  mime-types-data (3.2021.0901)
69
- mini_portile2 (2.6.1)
69
+ mini_portile2 (2.8.0)
70
70
  minitest (5.14.4)
71
71
  minitest-fail-fast (0.1.0)
72
72
  minitest (~> 5)
@@ -77,11 +77,11 @@ GEM
77
77
  ruby-progressbar
78
78
  mocha (1.13.0)
79
79
  multi_test (0.1.2)
80
- nokogiri (1.12.5)
81
- mini_portile2 (~> 2.6.1)
80
+ nokogiri (1.13.3)
81
+ mini_portile2 (~> 2.8.0)
82
82
  racc (~> 1.4)
83
83
  parallel (1.21.0)
84
- parser (3.0.3.1)
84
+ parser (3.1.1.0)
85
85
  ast (~> 2.4.1)
86
86
  pry (0.13.1)
87
87
  coderay (~> 1.1)
@@ -92,24 +92,24 @@ GEM
92
92
  public_suffix (4.0.6)
93
93
  racc (1.6.0)
94
94
  rack (2.2.3)
95
- rainbow (3.0.0)
95
+ rainbow (3.1.1)
96
96
  rake (13.0.6)
97
97
  rb-fsevent (0.11.0)
98
98
  rb-inotify (0.10.1)
99
99
  ffi (~> 1.0)
100
- regexp_parser (2.1.1)
100
+ regexp_parser (2.2.0)
101
101
  rexml (3.2.5)
102
- rubocop (1.12.1)
102
+ rubocop (1.25.1)
103
103
  parallel (~> 1.10)
104
- parser (>= 3.0.0.0)
104
+ parser (>= 3.1.0.0)
105
105
  rainbow (>= 2.2.2, < 4.0)
106
106
  regexp_parser (>= 1.8, < 3.0)
107
107
  rexml
108
- rubocop-ast (>= 1.2.0, < 2.0)
108
+ rubocop-ast (>= 1.15.1, < 2.0)
109
109
  ruby-progressbar (~> 1.7)
110
110
  unicode-display_width (>= 1.4.0, < 3.0)
111
- rubocop-ast (1.4.1)
112
- parser (>= 2.7.1.5)
111
+ rubocop-ast (1.15.1)
112
+ parser (>= 3.0.1.1)
113
113
  rubocop-minitest (0.10.1)
114
114
  rubocop (>= 0.87)
115
115
  rubocop-rake (0.5.1)
@@ -119,12 +119,12 @@ GEM
119
119
  ruby-progressbar (1.11.0)
120
120
  sys-uname (1.2.2)
121
121
  ffi (~> 1.1)
122
- theme-check (1.9.0)
122
+ theme-check (1.10.1)
123
123
  liquid (>= 5.1.0)
124
124
  nokogiri (>= 1.12)
125
125
  parser (~> 3)
126
- timecop (0.9.2)
127
- unicode-display_width (2.0.0)
126
+ timecop (0.9.4)
127
+ unicode-display_width (2.1.0)
128
128
  webmock (3.9.3)
129
129
  addressable (>= 2.3.6)
130
130
  crack (>= 0.3.2)
@@ -134,7 +134,7 @@ PLATFORMS
134
134
  ruby
135
135
 
136
136
  DEPENDENCIES
137
- bundler (~> 2.2.2)
137
+ bundler (~> 2.3.8)
138
138
  byebug
139
139
  colorize (~> 0.8.1)
140
140
  cucumber (~> 7.0)
@@ -155,4 +155,4 @@ DEPENDENCIES
155
155
  webmock
156
156
 
157
157
  BUNDLED WITH
158
- 2.2.29
158
+ 2.3.8
data/Rakefile CHANGED
@@ -2,6 +2,8 @@ ENV["SHOPIFY_CLI_TEST"] = "1"
2
2
 
3
3
  require_relative "bin/load_shopify"
4
4
  require_relative "utilities/utilities"
5
+ require_relative "lib/shopify_cli/constants"
6
+ require_relative "lib/shopify_cli/version"
5
7
  require "rake/testtask"
6
8
  require "rubocop/rake_task"
7
9
  require "bundler/gem_tasks"
@@ -33,6 +35,20 @@ task :console do
33
35
  exec("irb", "-r", "./bin/load_shopify.rb", "-r", "byebug")
34
36
  end
35
37
 
38
+ desc("Notifies a new version to Bugsnag")
39
+ task :notify_version_to_bugsnag do
40
+ # This task runs at deployment time to notify
41
+ # Bugsnag about new versions. Because the deployment
42
+ # environment has Node, we can run the Bugsnag CLI
43
+ # through npx.
44
+ system(
45
+ { "npm_config_yes" => "true" },
46
+ "npx", "-q", "bugsnag-build-reporter",
47
+ "-k", ShopifyCLI::Constants::Bugsnag::API_KEY,
48
+ "-v", ShopifyCLI::VERSION
49
+ ) || abort
50
+ end
51
+
36
52
  namespace :rdoc do
37
53
  repo = "https://github.com/Shopify/shopify-cli.wiki.git"
38
54
  intermediate = "markdown_intermediate"
data/bin/shopify CHANGED
@@ -16,10 +16,14 @@ module Kernel
16
16
  raise if name == "#{RUBY_VERSION.split(".")[0, 2].join(".")}/ffi_c"
17
17
  # Special case for nokogiri, which might install the wrong architecture
18
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"
19
+ STDERR.puts(<<~MESSAGE)
20
+ The Nokogiri gem is failing to load, due to an installation or architecture issue.
21
+
22
+ To fix this, reinstall Nokogiri.
23
+
24
+ • Installation guide: https://nokogiri.org/tutorials/installing_nokogiri.html
25
+
26
+ MESSAGE
23
27
  STDERR.puts e.full_message
24
28
  exit(1)
25
29
  end
@@ -40,8 +44,8 @@ end
40
44
 
41
45
  require_relative "./load_shopify"
42
46
 
43
- exit(proc do
44
- begin
47
+ exit(
48
+ proc do
45
49
  ShopifyCLI::ErrorHandler.call do
46
50
  ShopifyCLI::Core::EntryPoint.call(ARGV.dup)
47
51
  end
@@ -52,5 +56,5 @@ exit(proc do
52
56
  else
53
57
  1
54
58
  end
55
- end
56
- end.call)
59
+ end.call
60
+ )
data/dev.yml CHANGED
@@ -6,7 +6,7 @@ env:
6
6
  SHOPIFY_CLI_DEVELOPMENT: "1"
7
7
 
8
8
  up:
9
- - ruby: 2.7.5
9
+ - ruby: 3.1.0
10
10
  - homebrew:
11
11
  - dpkg:
12
12
  version: 1.21.1
@@ -1,46 +1,3 @@
1
1
  # Installation
2
2
 
3
- ## Installation through RubyGems
4
-
5
- The easiest method to install the Shopify CLI is through RubyGems:
6
-
7
- ```shell
8
- $ gem install shopify-cli
9
- ```
10
-
11
- ## Installation for macOS Users
12
-
13
- - Make sure you have [Homebrew](https://brew.sh/) installed
14
- - Open your terminal app
15
- - Run `brew tap shopify/shopify`
16
- - Run `brew install shopify-cli`
17
- - After the installation is completed, run `shopify version`, if this outputs a version number you've successfully installed the CLI.
18
-
19
- ### To upgrade Shopify CLI
20
-
21
- #### Homebrew (Mac OS)
22
-
23
- ```shell
24
- $ brew update
25
- $ brew upgrade shopify-cli
26
- ```
27
-
28
- ## Installation for Debian and Ubuntu users through `apt`
29
-
30
- 1.- Download the latest `.deb` binary for Shopify CLI from the releases page.
31
-
32
- 2.- Install the downloaded file and make sure to replace /path/to/download/shopify-cli-x.y.z.deb with the path to your file's location:
33
-
34
- ```shell
35
- $ sudo apt install /path/to/downloaded/shopify-cli-x.y.z.deb
36
- ```
37
-
38
- ## Installation for CentOS 8+, Fedora, Red Hat, and SUSE users through `yum`
39
-
40
- 1.- Download the latest .rpm file for Shopify App CLI from the releases page.
41
-
42
- 2.- Install the downloaded file and make sure to replace /path/to/downloaded/shopify-cli-x.y.x.rpm with the path to your file's location:
43
-
44
- ```shell
45
- $ sudo yum install /path/to/downloaded/shopify-cli-x.y.x.rpm
46
- ```
3
+ The installation guide can be found here: https://shopify.dev/apps/tools/cli/installation
@@ -0,0 +1 @@
1
+ 69ac26fd99a41aa1839cdf8fc8a734874370947ef79e88b90f661c2e58485ae0
@@ -0,0 +1 @@
1
+ 80576fe617d6e093a72bc826f041207ddc57605381f0db6451ba27310e57e830
@@ -0,0 +1 @@
1
+ 9d2686f5caccc34e30baff614ccfc487e90c5d1220e515ca4e47337a0b6a2daf
@@ -0,0 +1 @@
1
+ 6b7b6f6745594c2e8efcaf948c0ef367911446101d2b8a7c8138ce2aca868cbd
@@ -0,0 +1 @@
1
+ a68b5cbfce2b4b6c1a7e89e50d41dfc63f083e73f846547232897e06345e9ca3
@@ -0,0 +1 @@
1
+ 4010c2d154f1ef7ebf1f8c49621a0742ab75c60fd77746a5fa175878d07f16ef
@@ -0,0 +1 @@
1
+ 786e417716969fcac4e97d9c0c701966c54a49152f9f57fa164f916cf14ae5f3
@@ -0,0 +1 @@
1
+ c12418f7b3e4edead87ade1f44bd7280626a92d8d1238d7f8eb91b1122f20f20
data/ext/javy/version CHANGED
@@ -1 +1 @@
1
- v0.1.0
1
+ v0.2.1
@@ -17,12 +17,10 @@ module Extension
17
17
 
18
18
  def self.clone_template(git_template)
19
19
  ArgoSetupStep.default do |context, _identifier, directory_name, _js_system|
20
- begin
21
- ShopifyCLI::Git.clone(git_template, directory_name, ctx: context)
22
- context.root = File.join(context.root, directory_name)
23
- rescue StandardError
24
- context.puts("{{x}} Unable to clone the repository.")
25
- end
20
+ ShopifyCLI::Git.clone(git_template, directory_name, ctx: context)
21
+ context.root = File.join(context.root, directory_name)
22
+ rescue StandardError
23
+ context.puts("{{x}} Unable to clone the repository.")
26
24
  end
27
25
  end
28
26
 
@@ -2,9 +2,27 @@ require "semantic/semantic"
2
2
 
3
3
  module Extension
4
4
  module Models
5
- NpmPackage = Struct.new(:name, :version, keyword_init: true) do
5
+ class NpmPackage
6
+ include SmartProperties
6
7
  include Comparable
7
8
 
9
+ property :name
10
+ property :version
11
+ property :scripts, accepts: Hash
12
+ property :dependencies, accepts: Hash
13
+ property :dev_dependencies, accepts: Hash
14
+
15
+ def initialize(**config)
16
+ super(**config.select { |property_name, _| self.class.properties.key?(property_name) })
17
+ end
18
+
19
+ def self.parse(io)
20
+ ShopifyCLI::Result.call { JSON.parse(io.read) }
21
+ .then(&ShopifyCLI::TransformDataStructure.new(underscore_keys: true, symbolize_keys: true, shallow: true))
22
+ .then { |specification| new(**specification) }
23
+ .unwrap { |error| raise "Failed to parse NPM package specification: #{error}" }
24
+ end
25
+
8
26
  def <=>(other)
9
27
  return nil unless name == other.name
10
28
  Semantic::Version.new(version) <=> Semantic::Version.new(other.version)
@@ -13,15 +13,16 @@ module Extension
13
13
  ]
14
14
 
15
15
  property! :name, accepts: VALID_RENDERERS
16
+ property! :version, accepts: String, default: "latest"
16
17
 
17
18
  def self.find(type)
18
19
  case type.downcase
19
20
  when "product_subscription"
20
- new(name: "@shopify/admin-ui-extensions")
21
+ new(name: "@shopify/admin-ui-extensions", version: "^1.0.1")
21
22
  when "checkout_ui_extension"
22
- new(name: "@shopify/checkout-ui-extensions")
23
+ new(name: "@shopify/checkout-ui-extensions", version: "^0.14.0")
23
24
  when "checkout_post_purchase"
24
- new(name: "@shopify/post-purchase-ui-extensions")
25
+ new(name: "@shopify/post-purchase-ui-extensions", version: "^0.13.2")
25
26
  end
26
27
  end
27
28
  end
@@ -4,12 +4,24 @@ module Extension
4
4
  module Models
5
5
  module SpecificationHandlers
6
6
  class CheckoutUiExtension < Default
7
+ L10N_ERROR_PREFIX = "core.extension.push.checkout_ui_extension.localization.error"
8
+ L10N_FILE_SIZE_LIMIT = 16 * 1024 # 16kb
9
+ L10N_BUNDLE_SIZE_LIMIT = 256 * 1024 # 256kb
10
+ LOCALE_CODE_FORMAT = %r{
11
+ \A
12
+ (?<language>[a-zA-Z]{2,3}) # Language tag
13
+ (?:
14
+ -
15
+ (?<region>[a-zA-Z]{2}) # Optional region subtag
16
+ )?
17
+ \z}x
7
18
  PERMITTED_CONFIG_KEYS = [:extension_points, :metafields, :name]
8
19
 
9
20
  def config(context)
10
21
  {
11
22
  **Features::ArgoConfig.parse_yaml(context, PERMITTED_CONFIG_KEYS),
12
23
  **argo.config(context, include_renderer_version: false),
24
+ **localization(context),
13
25
  }
14
26
  end
15
27
 
@@ -22,6 +34,108 @@ module Extension
22
34
  return unless product
23
35
  format("/cart/%<variant_id>d:%<quantity>d", variant_id: product.variant_id, quantity: 1)
24
36
  end
37
+
38
+ private
39
+
40
+ def localization(context)
41
+ Dir.chdir(context.root) do
42
+ locale_filenames = Dir["locales/*"].select { |filename| valid_l10n_file?(filename) }
43
+ # Localization is optional
44
+ return {} if locale_filenames.empty?
45
+
46
+ validate_total_size(locale_filenames)
47
+ default_locale = single_default_locale(locale_filenames)
48
+
49
+ locale_filenames.map do |filename|
50
+ locale = basename_for_locale_filename(filename)
51
+ [locale.to_sym, Base64.strict_encode64(File.read(filename, mode: "rt", encoding: "UTF-8").strip)]
52
+ end
53
+ .yield_self do |encoded_files_by_locale|
54
+ {
55
+ localization: {
56
+ default_locale: default_locale,
57
+ translations: encoded_files_by_locale.to_h,
58
+ },
59
+ }
60
+ end
61
+ end
62
+ end
63
+
64
+ def validate_total_size(locale_filenames)
65
+ total_size = locale_filenames.sum { |filename| File.size(filename) }
66
+ if total_size > L10N_BUNDLE_SIZE_LIMIT
67
+ raise(
68
+ ShopifyCLI::Abort,
69
+ ShopifyCLI::Context.message(
70
+ "#{L10N_ERROR_PREFIX}.bundle_too_large",
71
+ CLI::Kit::Util.to_filesize(L10N_BUNDLE_SIZE_LIMIT)
72
+ )
73
+ )
74
+ end
75
+ end
76
+
77
+ def single_default_locale(locale_filenames)
78
+ default_locale_matches = locale_filenames.grep(/default/)
79
+ if default_locale_matches.size != 1
80
+ raise(ShopifyCLI::Abort, ShopifyCLI::Context.message("#{L10N_ERROR_PREFIX}.single_default_locale"))
81
+ end
82
+ basename_for_locale_filename(default_locale_matches.first)
83
+ end
84
+
85
+ def valid_l10n_file?(filename)
86
+ return false unless File.file?(filename)
87
+ return false unless File.dirname(filename) == "locales"
88
+
89
+ validate_file_extension(filename)
90
+ validate_file_locale_code(filename)
91
+ validate_file_size(filename)
92
+ validate_file_not_empty(filename)
93
+
94
+ true
95
+ end
96
+
97
+ def validate_file_extension(filename)
98
+ if File.extname(filename) != ".json"
99
+ raise(
100
+ ShopifyCLI::Abort, ShopifyCLI::Context.message("#{L10N_ERROR_PREFIX}.invalid_file_extension", filename)
101
+ )
102
+ end
103
+ end
104
+
105
+ def validate_file_locale_code(filename)
106
+ unless valid_locale_code?(basename_for_locale_filename(filename))
107
+ raise(
108
+ ShopifyCLI::Abort, ShopifyCLI::Context.message("#{L10N_ERROR_PREFIX}.invalid_locale_code", filename)
109
+ )
110
+ end
111
+ end
112
+
113
+ def validate_file_size(filename)
114
+ if File.size(filename) > L10N_FILE_SIZE_LIMIT
115
+ raise(
116
+ ShopifyCLI::Abort,
117
+ ShopifyCLI::Context.message(
118
+ "#{L10N_ERROR_PREFIX}.file_too_large",
119
+ filename,
120
+ CLI::Kit::Util.to_filesize(L10N_FILE_SIZE_LIMIT)
121
+ )
122
+ )
123
+ end
124
+ end
125
+
126
+ def validate_file_not_empty(filename)
127
+ if File.zero?(filename)
128
+ raise(ShopifyCLI::Abort, ShopifyCLI::Context.message("#{L10N_ERROR_PREFIX}.file_empty", filename))
129
+ end
130
+ end
131
+
132
+ def valid_locale_code?(locale_code)
133
+ LOCALE_CODE_FORMAT.match?(locale_code)
134
+ end
135
+
136
+ def basename_for_locale_filename(filename)
137
+ File.basename(File.basename(filename, ".json"), ".default")
138
+ end
25
139
  end
26
140
  end
27
141
  end
@@ -12,13 +12,21 @@ module Extension
12
12
  argo_configuration = extract_argo_configuration(attributes)
13
13
  next if argo_configuration.nil?
14
14
  surface_area = extract_surface_area(argo_configuration)
15
- surface_area_configuration = fetch_surface_area_configuration(surface_area)
16
- argo_configuration.merge!(surface_area_configuration)
15
+ if known_surface_area?(surface_area)
16
+ surface_area_configuration = fetch_surface_area_configuration(surface_area)
17
+ argo_configuration.merge!(surface_area_configuration)
18
+ else
19
+ clear_argo_configuration(attributes)
20
+ end
17
21
  end
18
22
  end
19
23
 
20
24
  private
21
25
 
26
+ def known_surface_area?(surface_area)
27
+ surface_area_configurations.keys.include?(surface_area.to_sym)
28
+ end
29
+
22
30
  def extract_argo_configuration(attributes)
23
31
  attributes.dig(:features, :argo)
24
32
  end
@@ -35,6 +43,11 @@ module Extension
35
43
  end
36
44
  end
37
45
 
46
+ def clear_argo_configuration(attributes)
47
+ attributes[:name] = "#{attributes[:name]} (Warning: surface area not configured properly)"
48
+ attributes[:features][:argo] = nil
49
+ end
50
+
38
51
  def surface_area_configurations
39
52
  {
40
53
  admin: {
@@ -18,6 +18,7 @@ module Extension
18
18
  property! :type, accepts: String
19
19
 
20
20
  DEFAULT_BUILD_DIR = "build"
21
+ DEFAULT_MAIN = Dir["src/*"].lazy.grep(/index.[jt]sx?/).first
21
22
 
22
23
  def self.call(*args)
23
24
  new(*args).call
@@ -36,7 +37,7 @@ module Extension
36
37
  build_dir: hash.dig("development", "build_dir") || DEFAULT_BUILD_DIR,
37
38
  renderer: renderer,
38
39
  entries: Models::ServerConfig::DevelopmentEntries.new(
39
- main: hash.dig("development", "entries", "main")
40
+ main: hash.dig("development", "entries", "main") || DEFAULT_MAIN
40
41
  )
41
42
  ),
42
43
  extension_points: hash.dig("extension_points"),
@@ -64,10 +64,6 @@ module Script
64
64
  autoload :ServiceLocator, Project.project_filepath("layers/infrastructure/service_locator")
65
65
 
66
66
  module Languages
67
- autoload :AssemblyScriptProjectCreator,
68
- Project.project_filepath("layers/infrastructure/languages/assemblyscript_project_creator")
69
- autoload :AssemblyScriptTaskRunner,
70
- Project.project_filepath("layers/infrastructure/languages/assemblyscript_task_runner")
71
67
  autoload :ProjectCreator, Project.project_filepath("layers/infrastructure/languages/project_creator")
72
68
  autoload :TaskRunner, Project.project_filepath("layers/infrastructure/languages/task_runner")
73
69
  autoload :TypeScriptProjectCreator,
@@ -78,6 +74,8 @@ module Script
78
74
  Project.project_filepath("layers/infrastructure/languages/wasm_project_creator.rb")
79
75
  autoload :WasmTaskRunner,
80
76
  Project.project_filepath("layers/infrastructure/languages/wasm_task_runner.rb")
77
+ autoload :ToolVersionChecker,
78
+ Project.project_filepath("layers/infrastructure/languages/tool_version_checker.rb")
81
79
  end
82
80
 
83
81
  module ApiClients