shopify-cli 2.18.0 → 2.18.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/project_types/extension/forms/questions/ask_template.rb +3 -3
- data/lib/project_types/extension/messages/messages.rb +16 -0
- data/lib/project_types/extension/models/development_server_requirements.rb +1 -1
- 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/script/layers/infrastructure/script_project_repository.rb +5 -3
- data/lib/project_types/script/messages/messages.rb +1 -1
- data/lib/shopify_cli/git.rb +7 -2
- data/lib/shopify_cli/messages/messages.rb +1 -1
- 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/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bad168cdd878e04ba4bc934a9caa6bfd19ffba653564734395d0e53a20957a81
|
4
|
+
data.tar.gz: 2f45edbce9f20fe63472a26221a71ef4733ad6e9f951abe86f3b213a869b0cc4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 14ced1d055b8aa918d0168aa0b91ba8e8a3093a99838868a630866b34af28f4547e55cf208dc6051ee4ef20426b5202badaa5b7ab2ac5c536a9e39030a4d1744
|
7
|
+
data.tar.gz: 37d84adeb8489f6596f2ed9bf1481ecc9060697a88fb10fcd5b59e8c20bf3e021c0502019c43b38fb0ec1e424b06ecd4f377ebb20a5517272a9e46cce2fcc1ff
|
data/Gemfile.lock
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
|
@@ -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: {
|
@@ -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")
|
@@ -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,
|
@@ -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.",
|
data/lib/shopify_cli/git.rb
CHANGED
@@ -67,9 +67,14 @@ module ShopifyCLI
|
|
67
67
|
if Dir.exist?(dest)
|
68
68
|
ctx.abort(ctx.message("core.git.error.directory_exists"))
|
69
69
|
else
|
70
|
+
repo, branch = repository.split("#")
|
70
71
|
success_message = ctx.message("core.git.cloned", dest)
|
71
|
-
CLI::UI::Frame.open(ctx.message("core.git.cloning",
|
72
|
-
|
72
|
+
CLI::UI::Frame.open(ctx.message("core.git.cloning", repo, dest), success_text: success_message) do
|
73
|
+
if branch
|
74
|
+
clone_progress("clone", "--single-branch", "--branch", branch, repo, dest, ctx: ctx)
|
75
|
+
else
|
76
|
+
clone_progress("clone", "--single-branch", repo, dest, ctx: ctx)
|
77
|
+
end
|
73
78
|
end
|
74
79
|
end
|
75
80
|
end
|
@@ -117,7 +117,7 @@ module ShopifyCLI
|
|
117
117
|
end
|
118
118
|
|
119
119
|
def build(name)
|
120
|
-
ShopifyCLI::Git.clone("https://github.com/Shopify/shopify-app-node.git", name)
|
120
|
+
ShopifyCLI::Git.clone("https://github.com/Shopify/shopify-app-template-node.git#cli_two", name)
|
121
121
|
|
122
122
|
context.root = File.join(context.root, name)
|
123
123
|
|
@@ -74,7 +74,7 @@ module ShopifyCLI
|
|
74
74
|
end
|
75
75
|
|
76
76
|
def build(form)
|
77
|
-
ShopifyCLI::Git.clone("https://github.com/Shopify/shopify-app-php.git", form.name)
|
77
|
+
ShopifyCLI::Git.clone("https://github.com/Shopify/shopify-app-template-php.git#cli_two", form.name)
|
78
78
|
|
79
79
|
context.root = File.join(context.root, form.name)
|
80
80
|
context.chdir(context.root)
|
data/lib/shopify_cli/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shopify-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.18.
|
4
|
+
version: 2.18.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -253,13 +253,13 @@ files:
|
|
253
253
|
- lib/project_types/extension/models/server_config/root.rb
|
254
254
|
- lib/project_types/extension/models/server_config/user.rb
|
255
255
|
- lib/project_types/extension/models/specification.rb
|
256
|
-
- lib/project_types/extension/models/specification_handlers/beacon_extension.rb
|
257
|
-
- lib/project_types/extension/models/specification_handlers/beacon_extension_utils/script_config.rb
|
258
|
-
- lib/project_types/extension/models/specification_handlers/beacon_extension_utils/script_config_repository.rb
|
259
256
|
- lib/project_types/extension/models/specification_handlers/checkout_post_purchase.rb
|
260
257
|
- lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb
|
261
258
|
- lib/project_types/extension/models/specification_handlers/default.rb
|
262
259
|
- lib/project_types/extension/models/specification_handlers/theme_app_extension.rb
|
260
|
+
- lib/project_types/extension/models/specification_handlers/web_pixel_extension.rb
|
261
|
+
- lib/project_types/extension/models/specification_handlers/web_pixel_extension_utils/script_config.rb
|
262
|
+
- lib/project_types/extension/models/specification_handlers/web_pixel_extension_utils/script_config_repository.rb
|
263
263
|
- lib/project_types/extension/models/specifications.rb
|
264
264
|
- lib/project_types/extension/models/validation_error.rb
|
265
265
|
- lib/project_types/extension/models/version.rb
|