shopify-cli 2.18.0 → 2.20.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.yaml +2 -1
- data/.github/ISSUE_TEMPLATE/config.yml +9 -0
- data/CHANGELOG.md +16 -2
- data/Gemfile.lock +4 -4
- data/README.md +7 -6
- data/dev.yml +0 -1
- data/docs/users/installation.md +1 -1
- data/lib/project_types/extension/forms/questions/ask_template.rb +3 -3
- data/lib/project_types/extension/messages/messages.rb +17 -1
- data/lib/project_types/extension/models/development_server_requirements.rb +2 -7
- data/lib/project_types/extension/models/server_config/development.rb +9 -0
- data/lib/project_types/extension/models/server_config/development_renderer.rb +1 -1
- data/lib/project_types/extension/models/specification_handlers/{beacon_extension.rb → web_pixel_extension.rb} +11 -10
- data/lib/project_types/extension/models/specification_handlers/{beacon_extension_utils → web_pixel_extension_utils}/script_config.rb +1 -1
- data/lib/project_types/extension/models/specification_handlers/{beacon_extension_utils → web_pixel_extension_utils}/script_config_repository.rb +2 -2
- data/lib/project_types/extension/tasks/configure_options.rb +1 -1
- data/lib/project_types/extension/tasks/execute_commands/outdated_extension_detection.rb +5 -1
- data/lib/project_types/extension/tasks/fetch_specifications.rb +4 -1
- data/lib/project_types/script/commands/create.rb +1 -1
- data/lib/project_types/script/config/extension_points.yml +15 -15
- data/lib/project_types/script/forms/ask_app.rb +0 -5
- data/lib/project_types/script/layers/domain/metadata.rb +3 -5
- data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +5 -3
- data/lib/project_types/script/layers/infrastructure/script_service.rb +1 -1
- data/lib/project_types/script/messages/messages.rb +1 -1
- data/lib/project_types/theme/commands/push.rb +3 -1
- data/lib/project_types/theme/commands/serve.rb +1 -0
- data/lib/project_types/theme/messages/messages.rb +38 -1
- data/lib/shopify_cli/assets/post_auth_page/index.html.erb +34 -0
- data/lib/shopify_cli/assets/post_auth_page/style.css +58 -0
- data/lib/shopify_cli/git.rb +7 -2
- data/lib/shopify_cli/identity_auth/servlet.rb +4 -20
- data/lib/shopify_cli/messages/messages.rb +7 -9
- data/lib/shopify_cli/services/app/create/node_service.rb +1 -1
- data/lib/shopify_cli/services/app/create/php_service.rb +1 -1
- data/lib/shopify_cli/theme/dev_server/hot-reload-no-script.html +27 -0
- data/lib/shopify_cli/theme/dev_server/hot-reload.js +16 -4
- data/lib/shopify_cli/theme/dev_server/hot_reload.rb +2 -0
- data/lib/shopify_cli/theme/dev_server.rb +3 -2
- data/lib/shopify_cli/theme/file.rb +5 -0
- data/lib/shopify_cli/theme/syncer/json_update_handler.rb +16 -6
- data/lib/shopify_cli/theme/syncer/operation.rb +7 -6
- data/lib/shopify_cli/theme/syncer/unsupported_script_warning.rb +90 -0
- data/lib/shopify_cli/theme/syncer.rb +73 -29
- data/lib/shopify_cli/theme/theme_admin_api.rb +16 -11
- data/lib/shopify_cli/theme/theme_admin_api_throttler/bulk.rb +102 -0
- data/lib/shopify_cli/theme/theme_admin_api_throttler/bulk_job.rb +75 -0
- data/lib/shopify_cli/theme/theme_admin_api_throttler/errors.rb +7 -0
- data/lib/shopify_cli/theme/theme_admin_api_throttler/put_request.rb +52 -0
- data/lib/shopify_cli/theme/theme_admin_api_throttler/request_parser.rb +39 -0
- data/lib/shopify_cli/theme/theme_admin_api_throttler/response_parser.rb +21 -0
- data/lib/shopify_cli/theme/theme_admin_api_throttler.rb +62 -0
- data/lib/shopify_cli/version.rb +1 -1
- data/shopify-cli.gemspec +1 -1
- metadata +20 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fb2bcf8db165a28ff5753227eb1aae9d2d83e65e8a2cee8a8a2ed4e7f8d7d4b
|
4
|
+
data.tar.gz: 5ab1e805308119941d84932997959926011281ea4a2b48d5517ca43c3794661c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6c2ba75cadbc318cae8615890386c1c3aa8100405d12e070627470448d367daf96a65390e6afad6b6d70ae8bdbc7e27f8d7dbdccf5b69e4fde12f6bca681b94
|
7
|
+
data.tar.gz: 66699ed47aa46b23f3dfe4dba39a9e15c23e135db254a22db2e4800d0865be49b23bca70eb9733a497bd2a87a2e8aa6db00e887da53a4f83881f719983eda906
|
@@ -13,8 +13,9 @@ body:
|
|
13
13
|
id: preflight_checks
|
14
14
|
attributes:
|
15
15
|
label: |-
|
16
|
-
Please confirm that you
|
16
|
+
Please confirm that you:
|
17
17
|
options:
|
18
|
+
- label: Are working with Shopify CLI 2.0, not 3.0. (You can [open a 3.0 issue here](https://github.com/Shopify/cli/issues/new/choose).)
|
18
19
|
- 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
20
|
required: true
|
20
21
|
- label: Reproduced the issue in [the latest CLI version](https://github.com/Shopify/shopify-cli/releases).
|
@@ -0,0 +1,9 @@
|
|
1
|
+
blank_issues_enabled: true
|
2
|
+
contact_links:
|
3
|
+
- name: Shopify Partners Community 🙌
|
4
|
+
url: https://www.shopify.com/partners/community#conversation
|
5
|
+
about: Connect with Shopify and other Shopify Partners through our online communities!
|
6
|
+
- name: Shopify CLI 3.0 issues 📝
|
7
|
+
url: https://www.github.com/Shopify/cli/issues/new/choose
|
8
|
+
about: |-
|
9
|
+
You're about to open an issue about Shopify CLI 2.0. Are you actually using our new CLI? If so, please create an issue there instead.
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,19 @@ 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.20.0 - 2022-07-11
|
6
|
+
|
7
|
+
### Added
|
8
|
+
* [#2368](https://github.com/Shopify/shopify-cli/pull/2368): Add performance enhancements to the `theme serve` and `theme push` commands
|
9
|
+
* [#2437](https://github.com/Shopify/shopify-cli/pull/2437): Add support to the `warnings` field in the assets API
|
10
|
+
* [#2446](https://github.com/Shopify/shopify-cli/pull/2446): Show a friendly message when developers use a browser without SSE support
|
11
|
+
|
12
|
+
### Fixed
|
13
|
+
* [#2418](https://github.com/Shopify/shopify-cli/pull/2418): Improve the help message of the `theme open -e/--editor` flag
|
14
|
+
|
15
|
+
### Changed
|
16
|
+
* [#2444](https://github.com/Shopify/shopify-cli/pull/2444): Expose the `-s` option in the help text of `login`, `switch` etc.
|
17
|
+
|
5
18
|
## Version 2.18.0 - 2022-05-30
|
6
19
|
|
7
20
|
### Added
|
@@ -12,6 +25,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
|
|
12
25
|
### Fixed
|
13
26
|
* [#2352](https://github.com/Shopify/shopify-cli/pull/2352): Provide better DX when dealing with empty theme selection
|
14
27
|
* [#2347](https://github.com/Shopify/shopify-cli/pull/2347): Fix #2346 Heroku CLI installation for Apple silicon
|
28
|
+
* [#2422](https://github.com/Shopify/shopify-cli/pull/2422): Add Shopify branding and styling to post-authentication browser page
|
15
29
|
|
16
30
|
## Version 2.17.0 - 2022-05-12
|
17
31
|
|
@@ -42,7 +56,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
|
|
42
56
|
|
43
57
|
### Added
|
44
58
|
* [#2189](https://github.com/Shopify/shopify-cli/pull/2189): Retrieve latest CLI version in the background
|
45
|
-
* [#2263](https://github.com/Shopify/shopify-cli/pull/2263): Add `POS UI Extension` to support third party developers to extend POS smart grid functionality using native retail components.
|
59
|
+
* [#2263](https://github.com/Shopify/shopify-cli/pull/2263): Add `POS UI Extension` to support third party developers to extend POS smart grid functionality using native retail components.
|
46
60
|
|
47
61
|
### Changed
|
48
62
|
* [#2272](https://github.com/Shopify/shopify-cli/pull/2272): Changed interactive apps list scope for extension create|register|connect commands
|
@@ -50,7 +64,7 @@ From version 2.6.0, the sections in this file adhere to the [keep a changelog](h
|
|
50
64
|
## Version 2.15.6 - 2022-04-12
|
51
65
|
|
52
66
|
### Fixed
|
53
|
-
* [#2246](https://github.com/Shopify/shopify-cli/pull/2246): Fix callback urls for app serve
|
67
|
+
* [#2246](https://github.com/Shopify/shopify-cli/pull/2246): Fix callback urls for app serve
|
54
68
|
|
55
69
|
## Version 2.15.5 - 2022-04-08
|
56
70
|
|
data/Gemfile.lock
CHANGED
@@ -1,10 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
shopify-cli (2.
|
4
|
+
shopify-cli (2.20.0)
|
5
5
|
bugsnag (~> 6.22)
|
6
6
|
listen (~> 3.7.0)
|
7
|
-
theme-check (~> 1.10.
|
7
|
+
theme-check (~> 1.10.3)
|
8
8
|
|
9
9
|
GEM
|
10
10
|
remote: https://rubygems.org/
|
@@ -108,7 +108,7 @@ GEM
|
|
108
108
|
faraday (>= 0.9)
|
109
109
|
sawyer (~> 0.8.0, >= 0.5.3)
|
110
110
|
parallel (1.21.0)
|
111
|
-
parser (3.1.
|
111
|
+
parser (3.1.2.0)
|
112
112
|
ast (~> 2.4.1)
|
113
113
|
pry (0.13.1)
|
114
114
|
coderay (~> 1.1)
|
@@ -150,7 +150,7 @@ GEM
|
|
150
150
|
faraday (> 0.8, < 2.0)
|
151
151
|
sys-uname (1.2.2)
|
152
152
|
ffi (~> 1.1)
|
153
|
-
theme-check (1.10.
|
153
|
+
theme-check (1.10.3)
|
154
154
|
liquid (>= 5.1.0)
|
155
155
|
nokogiri (>= 1.12)
|
156
156
|
parser (~> 3)
|
data/README.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<h1>Shopify CLI</h1>
|
1
|
+
# Shopify CLI 2.0
|
2
|
+
|
4
3
|
<a href=""><img src="https://github.com/shopify/shopify-cli/workflows/CI/badge.svg" alt="Shopify"></a>
|
5
4
|
<img src="https://img.shields.io/github/v/release/shopify/shopify-cli?include_prereleases&style=flat-square" alt="Latest Version">
|
6
5
|
<img src="https://img.shields.io/github/forks/shopify/shopify-cli?style=flat-square" alt="GitHub forks">
|
@@ -11,12 +10,14 @@
|
|
11
10
|
<a href="http://twitter.com/ShopifyDevs"><img src="https://img.shields.io/twitter/follow/ShopifyDevs?style=flat-square" alt="Twitter Followers"></a>
|
12
11
|
<img src="https://img.shields.io/badge/License-MIT-green.svg" alt="License">
|
13
12
|
<img src="https://img.shields.io/badge/Powered%20by-Ruby-red" alt="Powered by Ruby">
|
14
|
-
</div>
|
15
13
|
|
16
14
|
|
17
|
-
Shopify CLI
|
15
|
+
Shopify CLI 2.0 is a command line to help you build on Shopify. It's available as a Ruby gem and can be run and installed on Mac, Linux, and Windows systems.
|
16
|
+
|
17
|
+
## Note on Shopify CLI 2.0 versus Shopify CLI 3.0 ##
|
18
|
+
|
19
|
+
Use 2.0 for developing themes. For developing apps and custom storefronts, we recommend using [Shopify CLI 3.0](https://github.com/Shopify/cli).
|
18
20
|
|
19
|
-
Shopify CLI is available as a gem and can be run and installed on Mac, Linux and Windows systems.
|
20
21
|
|
21
22
|
## Installation
|
22
23
|
|
data/dev.yml
CHANGED
data/docs/users/installation.md
CHANGED
@@ -12,7 +12,7 @@ module Extension
|
|
12
12
|
|
13
13
|
def call(project_details)
|
14
14
|
if template_required?(project_details)
|
15
|
-
project_details.template = template || choose_interactively
|
15
|
+
project_details.template = template || choose_interactively(project_details)
|
16
16
|
end
|
17
17
|
project_details
|
18
18
|
end
|
@@ -24,9 +24,9 @@ module Extension
|
|
24
24
|
Models::DevelopmentServerRequirements.supported?(type)
|
25
25
|
end
|
26
26
|
|
27
|
-
def choose_interactively
|
27
|
+
def choose_interactively(project_details)
|
28
28
|
prompt.call(ctx.message("create.ask_template")) do |handler|
|
29
|
-
Models::ServerConfig::Development
|
29
|
+
Models::ServerConfig::Development.find(project_details&.type&.identifier).each do |template|
|
30
30
|
handler.option(template) { template }
|
31
31
|
end
|
32
32
|
end
|
@@ -183,7 +183,7 @@ module Extension
|
|
183
183
|
},
|
184
184
|
errors: {
|
185
185
|
unknown_type: "Unknown extension type %s. Valid extension types include: CHECKOUT_POST_PURCHASE, " \
|
186
|
-
"
|
186
|
+
"THEME_APP_EXTENSION, and PRODUCT_SUBSCRIPTION.",
|
187
187
|
package_not_found: "`%s` package not found.",
|
188
188
|
missing_push_options_ci: "The following are missing: %s. ",
|
189
189
|
missing_push_options_ci_solution: "To add them to a CI environment:\n\t1. Run a connect command " \
|
@@ -216,6 +216,22 @@ module Extension
|
|
216
216
|
* Add a develop script: shopify-cli-extensions develop
|
217
217
|
* Change the build script to: shopify-cli-extensions build
|
218
218
|
TEXT
|
219
|
+
product_subscription: <<~TEXT.strip,
|
220
|
+
Please update your package.json as follows:
|
221
|
+
* Replace the development dependency @shopify/admin-ui-extensions-run
|
222
|
+
with @shopify/shopify-cli-extensions
|
223
|
+
* Remove the start and server script
|
224
|
+
* Add a develop script: shopify-cli-extensions develop
|
225
|
+
* Change the build script to: shopify-cli-extensions build
|
226
|
+
TEXT
|
227
|
+
checkout_post_purchase: <<~TEXT.strip,
|
228
|
+
Please update your package.json as follows:
|
229
|
+
* Replace the development dependency @shopify/checkout-ui-extensions-run
|
230
|
+
with @shopify/shopify-cli-extensions
|
231
|
+
* Remove the start and server script
|
232
|
+
* Add a develop script: shopify-cli-extensions develop
|
233
|
+
* Change the build script to: shopify-cli-extensions build
|
234
|
+
TEXT
|
219
235
|
},
|
220
236
|
},
|
221
237
|
warnings: {
|
@@ -9,13 +9,13 @@ module Extension
|
|
9
9
|
"checkout_ui_extension",
|
10
10
|
"checkout_post_purchase",
|
11
11
|
"product_subscription",
|
12
|
-
"
|
12
|
+
"web_pixel_extension",
|
13
13
|
"pos_ui_extension",
|
14
14
|
]
|
15
15
|
|
16
16
|
class << self
|
17
17
|
def supported?(type)
|
18
|
-
if type_supported?(type) &&
|
18
|
+
if type_supported?(type) && beta_enabled?
|
19
19
|
return true if binary_installed?
|
20
20
|
warn_about_missing_binary
|
21
21
|
end
|
@@ -31,11 +31,6 @@ module Extension
|
|
31
31
|
SUPPORTED_EXTENSION_TYPES.include?(type.downcase)
|
32
32
|
end
|
33
33
|
|
34
|
-
# Some types are enabled unconditionally; others require beta_enabled
|
35
|
-
def type_enabled?(type)
|
36
|
-
beta_enabled? || "checkout_ui_extension" == type.downcase
|
37
|
-
end
|
38
|
-
|
39
34
|
private
|
40
35
|
|
41
36
|
def binary_installed?
|
@@ -18,6 +18,15 @@ module Extension
|
|
18
18
|
property :renderer, accepts: ServerConfig::DevelopmentRenderer
|
19
19
|
property :entries, accepts: ServerConfig::DevelopmentEntries
|
20
20
|
property :resource, accepts: ServerConfig::DevelopmentResource
|
21
|
+
|
22
|
+
def self.find(type)
|
23
|
+
case type.downcase
|
24
|
+
when "web_pixel_extension"
|
25
|
+
["javascript"]
|
26
|
+
else
|
27
|
+
VALID_TEMPLATES
|
28
|
+
end
|
29
|
+
end
|
21
30
|
end
|
22
31
|
end
|
23
32
|
end
|
@@ -26,7 +26,7 @@ module Extension
|
|
26
26
|
new(name: "@shopify/post-purchase-ui-extensions", version: "^0.13.2")
|
27
27
|
when "pos_ui_extension"
|
28
28
|
new(name: "@shopify/retail-ui-extensions", version: "^0.1.0")
|
29
|
-
when "
|
29
|
+
when "web_pixel_extension"
|
30
30
|
nil
|
31
31
|
else
|
32
32
|
raise ArgumentError, "Unknown extension type: #{type}"
|
@@ -2,45 +2,46 @@
|
|
2
2
|
require "base64"
|
3
3
|
require "fileutils"
|
4
4
|
require "json"
|
5
|
-
require_relative "
|
6
|
-
require_relative "
|
5
|
+
require_relative "web_pixel_extension_utils/script_config"
|
6
|
+
require_relative "web_pixel_extension_utils/script_config_repository"
|
7
7
|
|
8
8
|
module Extension
|
9
9
|
module Models
|
10
10
|
module SpecificationHandlers
|
11
|
-
class
|
11
|
+
class WebPixelExtension < Default
|
12
12
|
SCRIPT_FILE = "build/main.js"
|
13
13
|
|
14
14
|
def name
|
15
|
-
"
|
15
|
+
"Web Pixel Extension"
|
16
16
|
end
|
17
17
|
|
18
18
|
def read_configuration
|
19
19
|
end
|
20
20
|
|
21
21
|
def access_config_property(context, ext_config, key, &process_value)
|
22
|
-
context.abort(context.message("core.extension.push.
|
22
|
+
context.abort(context.message("core.extension.push.web_pixel_extension.error.missing_config_key_error",
|
23
23
|
key)) unless ext_config.key?(key)
|
24
24
|
|
25
25
|
begin
|
26
26
|
process_value.nil? ? ext_config[key] : process_value.call(ext_config[key])
|
27
27
|
rescue StandardError
|
28
|
-
context.abort(context.message("core.extension.push.
|
28
|
+
context.abort(context.message("core.extension.push.web_pixel_extension.error.invalid_config_value_error",
|
29
|
+
key))
|
29
30
|
end
|
30
31
|
end
|
31
32
|
|
32
33
|
def config(context)
|
33
34
|
begin
|
34
|
-
ext_config =
|
35
|
+
ext_config = WebPixelExtensionUtils::ScriptConfigYmlRepository.new(ctx: context).get!.content
|
35
36
|
rescue StandardError
|
36
|
-
context.abort(context.message("core.extension.push.
|
37
|
-
|
37
|
+
context.abort(context.message("core.extension.push.web_pixel_extension.error.file_read_error",
|
38
|
+
WebPixelExtensionUtils::ScriptConfigYmlRepository.filename))
|
38
39
|
end
|
39
40
|
|
40
41
|
begin
|
41
42
|
script_contents = File.read(File.join(context.root, SCRIPT_FILE)).chomp
|
42
43
|
rescue
|
43
|
-
context.abort(context.message("core.extension.push.
|
44
|
+
context.abort(context.message("core.extension.push.web_pixel_extension.error.file_read_error", SCRIPT_FILE))
|
44
45
|
end
|
45
46
|
{
|
46
47
|
runtime_context: access_config_property(context, ext_config, "runtime_context"),
|
@@ -2,7 +2,7 @@ require_relative "script_config"
|
|
2
2
|
module Extension
|
3
3
|
module Models
|
4
4
|
module SpecificationHandlers
|
5
|
-
module
|
5
|
+
module WebPixelExtensionUtils
|
6
6
|
class ScriptConfigRepository
|
7
7
|
include SmartProperties
|
8
8
|
property! :ctx, accepts: ShopifyCLI::Context
|
@@ -27,7 +27,7 @@ module Extension
|
|
27
27
|
private
|
28
28
|
|
29
29
|
def from_h(hash)
|
30
|
-
Extension::Models::SpecificationHandlers::
|
30
|
+
Extension::Models::SpecificationHandlers::WebPixelExtensionUtils::ScriptConfig.new(content: hash,
|
31
31
|
filename: filename)
|
32
32
|
end
|
33
33
|
|
@@ -14,7 +14,7 @@ module Extension
|
|
14
14
|
|
15
15
|
def configure_skip_build(attributes)
|
16
16
|
attributes[:options].merge!(skip_build: attributes[:identifier] == "theme_app_extension" ||
|
17
|
-
attributes[:identifier] == "
|
17
|
+
attributes[:identifier] == "web_pixel_extension")
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
@@ -20,6 +20,10 @@ module Extension
|
|
20
20
|
case type
|
21
21
|
when "checkout_ui_extension"
|
22
22
|
context.message("errors.outdated_extensions.checkout_ui_extension")
|
23
|
+
when "product_subscription"
|
24
|
+
context.message("errors.outdated_extensions.product_subscription")
|
25
|
+
when "checkout_post_purchase"
|
26
|
+
context.message("errors.outdated_extensions.checkout_post_purchase")
|
23
27
|
else
|
24
28
|
context.message("errors.outdated_extensions.unknown")
|
25
29
|
end
|
@@ -33,7 +37,7 @@ module Extension
|
|
33
37
|
|
34
38
|
def valid?(package)
|
35
39
|
case type
|
36
|
-
when "checkout_ui_extension"
|
40
|
+
when "checkout_ui_extension", "product_subscription", "checkout_post_purchase"
|
37
41
|
package.dev_dependency?("@shopify/shopify-cli-extensions") &&
|
38
42
|
package.script?("build") &&
|
39
43
|
package.script?("develop")
|
@@ -11,7 +11,10 @@ module Extension
|
|
11
11
|
.query(context, "fetch_specifications", api_key: api_key)
|
12
12
|
.dig("data", "extensionSpecifications")
|
13
13
|
context.abort(context.message("tasks.errors.parse_error")) if response.nil?
|
14
|
-
|
14
|
+
|
15
|
+
response.reject do |line|
|
16
|
+
::Extension::Features::Runtimes::CheckoutUiExtension::IDENTIFIERS.include?(line["identifier"].upcase)
|
17
|
+
end
|
15
18
|
end
|
16
19
|
end
|
17
20
|
end
|
@@ -25,7 +25,7 @@ module Script
|
|
25
25
|
project = Layers::Application::CreateScript.call(
|
26
26
|
ctx: @ctx,
|
27
27
|
language: options.flags[:language]&.downcase || "wasm",
|
28
|
-
sparse_checkout_branch: options.flags[:branch] || "
|
28
|
+
sparse_checkout_branch: options.flags[:branch] || "main",
|
29
29
|
title: form.title,
|
30
30
|
extension_point_type: form.extension_point,
|
31
31
|
)
|
@@ -4,57 +4,57 @@ payment_methods:
|
|
4
4
|
typescript:
|
5
5
|
beta: true
|
6
6
|
package: "@shopify/scripts-checkout-apis"
|
7
|
-
repo: "https://github.com/Shopify/
|
7
|
+
repo: "https://github.com/Shopify/function-examples"
|
8
8
|
wasm:
|
9
|
-
repo: "https://github.com/Shopify/
|
9
|
+
repo: "https://github.com/Shopify/function-examples"
|
10
10
|
rust:
|
11
|
-
repo: "https://github.com/Shopify/
|
11
|
+
repo: "https://github.com/Shopify/function-examples"
|
12
12
|
payment_customization:
|
13
13
|
beta: true
|
14
14
|
domain: 'checkout'
|
15
15
|
libraries:
|
16
16
|
wasm:
|
17
|
-
repo: "https://github.com/Shopify/
|
17
|
+
repo: "https://github.com/Shopify/function-examples"
|
18
18
|
rust:
|
19
|
-
repo: "https://github.com/Shopify/
|
19
|
+
repo: "https://github.com/Shopify/function-examples"
|
20
20
|
shipping_methods:
|
21
21
|
domain: 'checkout'
|
22
22
|
libraries:
|
23
23
|
typescript:
|
24
24
|
beta: true
|
25
25
|
package: "@shopify/scripts-checkout-apis"
|
26
|
-
repo: "https://github.com/Shopify/
|
26
|
+
repo: "https://github.com/Shopify/function-examples"
|
27
27
|
wasm:
|
28
|
-
repo: "https://github.com/Shopify/
|
28
|
+
repo: "https://github.com/Shopify/function-examples"
|
29
29
|
rust:
|
30
|
-
repo: "https://github.com/Shopify/
|
30
|
+
repo: "https://github.com/Shopify/function-examples"
|
31
31
|
product_discounts:
|
32
32
|
beta: true
|
33
33
|
domain: 'discounts'
|
34
34
|
libraries:
|
35
35
|
wasm:
|
36
|
-
repo: "https://github.com/Shopify/
|
36
|
+
repo: "https://github.com/Shopify/function-examples"
|
37
37
|
rust:
|
38
|
-
repo: "https://github.com/Shopify/
|
38
|
+
repo: "https://github.com/Shopify/function-examples"
|
39
39
|
order_discounts:
|
40
40
|
beta: true
|
41
41
|
domain: 'discounts'
|
42
42
|
libraries:
|
43
43
|
wasm:
|
44
|
-
repo: "https://github.com/Shopify/
|
44
|
+
repo: "https://github.com/Shopify/function-examples"
|
45
45
|
rust:
|
46
|
-
repo: "https://github.com/Shopify/
|
46
|
+
repo: "https://github.com/Shopify/function-examples"
|
47
47
|
shipping_discounts:
|
48
48
|
beta: true
|
49
49
|
domain: 'discounts'
|
50
50
|
libraries:
|
51
51
|
wasm:
|
52
|
-
repo: "https://github.com/Shopify/
|
52
|
+
repo: "https://github.com/Shopify/function-examples"
|
53
53
|
rust:
|
54
|
-
repo: "https://github.com/Shopify/
|
54
|
+
repo: "https://github.com/Shopify/function-examples"
|
55
55
|
shipping_rates_consolidation:
|
56
56
|
beta: true
|
57
57
|
domain: 'checkout'
|
58
58
|
libraries:
|
59
59
|
wasm:
|
60
|
-
repo: "https://github.com/Shopify/
|
60
|
+
repo: "https://github.com/Shopify/function-examples"
|
@@ -4,12 +4,11 @@ module Script
|
|
4
4
|
module Layers
|
5
5
|
module Domain
|
6
6
|
class Metadata
|
7
|
-
attr_reader :schema_major_version, :schema_minor_version
|
7
|
+
attr_reader :schema_major_version, :schema_minor_version
|
8
8
|
|
9
|
-
def initialize(schema_major_version, schema_minor_version
|
9
|
+
def initialize(schema_major_version, schema_minor_version)
|
10
10
|
@schema_major_version = schema_major_version
|
11
11
|
@schema_minor_version = schema_minor_version
|
12
|
-
@use_msgpack = use_msgpack
|
13
12
|
end
|
14
13
|
|
15
14
|
class << self
|
@@ -17,7 +16,6 @@ module Script
|
|
17
16
|
err_tag = nil
|
18
17
|
metadata_hash = JSON.parse(metadata_json)
|
19
18
|
|
20
|
-
use_msgpack = !!metadata_hash.dig("flags", "use_msgpack")
|
21
19
|
schema_versions = metadata_hash["schemaVersions"] || {}
|
22
20
|
|
23
21
|
version = schema_versions.values.first || {}
|
@@ -35,7 +33,7 @@ module Script
|
|
35
33
|
err_tag = "script.error.metadata_schema_versions_missing_minor"
|
36
34
|
end
|
37
35
|
|
38
|
-
Metadata.new(schema_major_version, schema_minor_version
|
36
|
+
Metadata.new(schema_major_version, schema_minor_version)
|
39
37
|
rescue JSON::ParserError
|
40
38
|
err_tag = "script.error.metadata_validation_cause"
|
41
39
|
ensure
|
@@ -37,7 +37,9 @@ module Script
|
|
37
37
|
extension_point_type: extension_point_type,
|
38
38
|
title: title,
|
39
39
|
description: nil,
|
40
|
-
language: language
|
40
|
+
language: language,
|
41
|
+
app_bridge_create_path: "/",
|
42
|
+
app_bridge_details_path: "/",
|
41
43
|
)
|
42
44
|
|
43
45
|
build_script_project(script_config: nil)
|
@@ -124,8 +126,8 @@ module Script
|
|
124
126
|
end
|
125
127
|
|
126
128
|
def app_bridge
|
127
|
-
create_path = project_config_value("app_bridge_create_path")
|
128
|
-
details_path = project_config_value("app_bridge_details_path")
|
129
|
+
create_path = project_config_value!("app_bridge_create_path")
|
130
|
+
details_path = project_config_value!("app_bridge_details_path")
|
129
131
|
|
130
132
|
Domain::AppBridge.new(
|
131
133
|
create_path: create_path,
|
@@ -90,7 +90,7 @@ module Script
|
|
90
90
|
)
|
91
91
|
elsif (errors = user_errors.filter { |err| err["tag"] == "input_query_validation_error" }).any?
|
92
92
|
raise Errors::InvalidInputQueryErrors, errors.map { |err| err["message"] }
|
93
|
-
elsif user_errors.find { |err| %w(
|
93
|
+
elsif user_errors.find { |err| %w(schema_version_argument_error).include?(err["tag"]) }
|
94
94
|
raise Domain::Errors::MetadataValidationError
|
95
95
|
elsif user_errors.find { |err| err["tag"] == "invalid_app_bridge_create_path" }
|
96
96
|
raise Errors::InvalidAppBridgePathError, "create"
|
@@ -24,7 +24,7 @@ module Script
|
|
24
24
|
oauth_help: "Wait a few minutes and try again.",
|
25
25
|
|
26
26
|
invalid_context_cause: "Your .shopify-cli.yml is formatted incorrectly. It's missing values for "\
|
27
|
-
"extension_point_type or
|
27
|
+
"extension_point_type, title, app_bridge_create_path or app_bridge_details_path.",
|
28
28
|
invalid_context_help: "Add these values.",
|
29
29
|
|
30
30
|
invalid_script_title_cause: "Script title contains unsupported characters.",
|
@@ -28,6 +28,7 @@ module Theme
|
|
28
28
|
parser.on("-j", "--json") { flags[:json] = true }
|
29
29
|
parser.on("-a", "--allow-live") { flags[:allow_live] = true }
|
30
30
|
parser.on("-p", "--publish") { flags[:publish] = true }
|
31
|
+
parser.on("-s", "--stable") { flags[:stable] = true }
|
31
32
|
parser.on("-o", "--only=PATTERN", Conversions::IncludeGlob) do |pattern|
|
32
33
|
flags[:includes] ||= []
|
33
34
|
flags[:includes] |= pattern
|
@@ -56,7 +57,8 @@ module Theme
|
|
56
57
|
|
57
58
|
syncer = ShopifyCLI::Theme::Syncer.new(@ctx, theme: theme,
|
58
59
|
include_filter: include_filter,
|
59
|
-
ignore_filter: ignore_filter
|
60
|
+
ignore_filter: ignore_filter,
|
61
|
+
stable: options.flags[:stable])
|
60
62
|
begin
|
61
63
|
syncer.start_threads
|
62
64
|
if options.flags[:json]
|
@@ -17,6 +17,7 @@ module Theme
|
|
17
17
|
parser.on("--poll") { flags[:poll] = true }
|
18
18
|
parser.on("--live-reload=MODE") { |mode| flags[:mode] = as_reload_mode(mode) }
|
19
19
|
parser.on("--theme-editor-sync") { flags[:editor_sync] = true }
|
20
|
+
parser.on("--stable") { flags[:stable] = true }
|
20
21
|
parser.on("-t", "--theme=NAME_OR_ID") { |theme| flags[:theme] = theme }
|
21
22
|
end
|
22
23
|
|