shopify-cli 2.15.6 → 2.17.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/CODEOWNERS +4 -4
- data/.github/workflows/shopify.yml +0 -33
- data/CHANGELOG.md +35 -1
- data/Gemfile.lock +4 -4
- data/Tests.dockerfile +1 -1
- data/ext/shopify-extensions/version +1 -1
- data/lib/graphql/find_organization_with_apps.graphql +20 -0
- data/lib/project_types/extension/cli.rb +3 -0
- data/lib/project_types/extension/commands/build.rb +0 -2
- data/lib/project_types/extension/commands/create.rb +6 -0
- data/lib/project_types/extension/commands/serve.rb +8 -3
- data/lib/project_types/extension/features/argo.rb +0 -31
- data/lib/project_types/extension/features/argo_config.rb +0 -1
- data/lib/project_types/extension/features/argo_serve.rb +1 -1
- data/lib/project_types/extension/messages/messages.rb +23 -0
- data/lib/project_types/extension/models/development_server.rb +2 -1
- data/lib/project_types/extension/models/development_server_requirements.rb +24 -4
- data/lib/project_types/extension/models/npm_package.rb +15 -3
- data/lib/project_types/extension/models/server_config/capabilities.rb +11 -0
- data/lib/project_types/extension/models/server_config/development_renderer.rb +6 -1
- data/lib/project_types/extension/models/server_config/extension.rb +10 -3
- data/lib/project_types/extension/models/server_config/root.rb +0 -2
- data/lib/project_types/extension/models/specification_handlers/checkout_ui_extension.rb +1 -1
- data/lib/project_types/extension/tasks/configure_features.rb +4 -0
- data/lib/project_types/extension/tasks/convert_server_config.rb +8 -4
- data/lib/project_types/extension/tasks/execute_commands/base.rb +2 -0
- data/lib/project_types/extension/tasks/execute_commands/build.rb +2 -1
- data/lib/project_types/extension/tasks/execute_commands/create.rb +0 -3
- data/lib/project_types/extension/tasks/execute_commands/outdated_extension_detection.rb +53 -0
- data/lib/project_types/extension/tasks/execute_commands/serve.rb +2 -1
- data/lib/project_types/extension/tasks/get_apps.rb +6 -9
- data/lib/project_types/extension/tasks/get_extensions.rb +12 -11
- data/lib/project_types/extension/tasks/merge_server_config.rb +4 -3
- data/lib/project_types/script/cli.rb +1 -0
- data/lib/project_types/script/config/extension_points.yml +17 -3
- data/lib/project_types/script/graphql/app_script_set.graphql +2 -0
- data/lib/project_types/script/layers/application/connect_app.rb +1 -1
- data/lib/project_types/script/layers/application/push_script.rb +1 -0
- data/lib/project_types/script/layers/domain/app_bridge.rb +16 -0
- data/lib/project_types/script/layers/domain/script_project.rb +1 -0
- data/lib/project_types/script/layers/infrastructure/errors.rb +0 -3
- data/lib/project_types/script/layers/infrastructure/languages/project_creator.rb +3 -2
- data/lib/project_types/script/layers/infrastructure/languages/task_runner.rb +2 -2
- data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +12 -0
- data/lib/project_types/script/layers/infrastructure/script_service.rb +5 -0
- data/lib/project_types/theme/commands/serve.rb +27 -0
- data/lib/project_types/theme/messages/messages.rb +13 -0
- data/lib/shopify_cli/admin_api.rb +5 -2
- data/lib/shopify_cli/commands/login.rb +2 -2
- data/lib/shopify_cli/commands/logout.rb +1 -1
- data/lib/shopify_cli/constants.rb +2 -0
- data/lib/shopify_cli/context.rb +14 -9
- data/lib/shopify_cli/environment.rb +8 -0
- data/lib/shopify_cli/partners_api/app_extensions.rb +6 -6
- data/lib/shopify_cli/partners_api/organizations.rb +12 -4
- data/lib/shopify_cli/services/app/create/rails_service.rb +1 -1
- data/lib/shopify_cli/tasks/ensure_env.rb +1 -1
- data/lib/shopify_cli/theme/dev_server/hot_reload/sections_index.rb +5 -6
- data/lib/shopify_cli/theme/dev_server/local_assets.rb +1 -1
- data/lib/shopify_cli/theme/dev_server/watcher.rb +2 -1
- data/lib/shopify_cli/theme/dev_server.rb +1 -1
- data/lib/shopify_cli/theme/development_theme.rb +11 -1
- data/lib/shopify_cli/theme/file.rb +9 -0
- data/lib/shopify_cli/theme/theme.rb +4 -0
- data/lib/shopify_cli/theme/theme_admin_api.rb +3 -1
- data/lib/shopify_cli/version.rb +1 -1
- data/{shipit.yml → shipit.rubygems.yml} +0 -0
- data/shopify-cli.gemspec +1 -1
- metadata +9 -5
@@ -14,13 +14,12 @@ module ShopifyCLI
|
|
14
14
|
|
15
15
|
files.each do |file|
|
16
16
|
section_hash(file).each do |key, value|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
next if !name || !type
|
17
|
+
next unless key
|
18
|
+
next unless value.is_a?(Hash)
|
19
|
+
next unless (type = value&.dig("type"))
|
21
20
|
|
22
21
|
index[type] = [] unless index[type]
|
23
|
-
index[type] <<
|
22
|
+
index[type] << key
|
24
23
|
end
|
25
24
|
end
|
26
25
|
|
@@ -42,7 +41,7 @@ module ShopifyCLI
|
|
42
41
|
end
|
43
42
|
|
44
43
|
def files
|
45
|
-
@theme.json_files
|
44
|
+
@theme.json_files.filter(&:template?)
|
46
45
|
end
|
47
46
|
end
|
48
47
|
end
|
@@ -14,7 +14,8 @@ module ShopifyCLI
|
|
14
14
|
@theme = theme
|
15
15
|
@syncer = syncer
|
16
16
|
@ignore_filter = ignore_filter
|
17
|
-
@listener = Listen.to(@theme.root, force_polling: poll
|
17
|
+
@listener = Listen.to(@theme.root, force_polling: poll,
|
18
|
+
ignore: @ignore_filter&.regexes) do |modified, added, removed|
|
18
19
|
changed
|
19
20
|
notify_observers(modified, added, removed)
|
20
21
|
end
|
@@ -32,7 +32,7 @@ module ShopifyCLI
|
|
32
32
|
theme = DevelopmentTheme.find_or_create!(ctx, root: root)
|
33
33
|
ignore_filter = IgnoreFilter.from_path(root)
|
34
34
|
@syncer = Syncer.new(ctx, theme: theme, ignore_filter: ignore_filter, overwrite_json: !editor_sync)
|
35
|
-
watcher = Watcher.new(ctx, theme: theme, syncer: @syncer, poll: poll)
|
35
|
+
watcher = Watcher.new(ctx, theme: theme, ignore_filter: ignore_filter, syncer: @syncer, poll: poll)
|
36
36
|
remote_watcher = RemoteWatcher.to(theme: theme, syncer: @syncer)
|
37
37
|
|
38
38
|
# Setup the middleware stack. Mimics Rack::Builder / config.ru, but in reverse order
|
@@ -79,13 +79,23 @@ module ShopifyCLI
|
|
79
79
|
|
80
80
|
theme_name = "Development ()"
|
81
81
|
hostname_character_limit = API_NAME_LIMIT - theme_name.length - hash.length - 1
|
82
|
-
identifier = "#{hash}-#{hostname[0, hostname_character_limit]}"
|
82
|
+
identifier = encode_identifier("#{hash}-#{hostname[0, hostname_character_limit]}")
|
83
83
|
theme_name = "Development (#{identifier})"
|
84
84
|
|
85
85
|
ShopifyCLI::DB.set(development_theme_name: theme_name)
|
86
86
|
|
87
87
|
theme_name
|
88
88
|
end
|
89
|
+
|
90
|
+
##
|
91
|
+
# In some cases, the identifier string encoding may be obfuscated by the hostname,
|
92
|
+
# which may be an ASCII string.
|
93
|
+
#
|
94
|
+
# This method ensures the result identifier is a UTF-8 valid string.
|
95
|
+
#
|
96
|
+
def encode_identifier(identifier)
|
97
|
+
identifier.encode(Encoding::UTF_8, invalid: :replace, undef: :replace, replace: "-")
|
98
|
+
end
|
89
99
|
end
|
90
100
|
end
|
91
101
|
end
|
@@ -30,6 +30,15 @@ module ShopifyCLI
|
|
30
30
|
else
|
31
31
|
path.write(content, 0, mode: "wb")
|
32
32
|
end
|
33
|
+
rescue Encoding::UndefinedConversionError
|
34
|
+
##
|
35
|
+
# The CLI tries to write the file and normalize EOL characters to avoid
|
36
|
+
# errors on Windows when files are shared across different operational systems.
|
37
|
+
#
|
38
|
+
# The CLI fallbacks any error during the conversion by writing the file
|
39
|
+
# in binary mode when the normalization fails (e.g., ASCII files), so no data is lost.
|
40
|
+
#
|
41
|
+
path.write(content, 0, mode: "wb")
|
33
42
|
end
|
34
43
|
|
35
44
|
def delete
|
@@ -53,8 +53,10 @@ module ShopifyCLI
|
|
53
53
|
# * when an asset operation cannot be performed:
|
54
54
|
# - <APIRequestForbiddenError: 403 {"message":"templates/gift_card.liquid could not be deleted"}>
|
55
55
|
#
|
56
|
-
if empty_response?(error)
|
56
|
+
if empty_response?(error)
|
57
57
|
return permission_error
|
58
|
+
elsif unauthorized_response?(error)
|
59
|
+
raise ShopifyCLI::Abort, @ctx.message("theme.unauthorized_error", @shop)
|
58
60
|
end
|
59
61
|
|
60
62
|
raise error
|
data/lib/shopify_cli/version.rb
CHANGED
File without changes
|
data/shopify-cli.gemspec
CHANGED
@@ -35,7 +35,7 @@ Gem::Specification.new do |spec|
|
|
35
35
|
spec.require_paths = ["lib", "vendor"]
|
36
36
|
spec.executables << "shopify"
|
37
37
|
|
38
|
-
spec.add_development_dependency("bundler", "~> 2.3.
|
38
|
+
spec.add_development_dependency("bundler", "~> 2.3.11")
|
39
39
|
spec.add_development_dependency("rake", "~> 12.3", ">= 12.3.3")
|
40
40
|
spec.add_development_dependency("minitest", "~> 5.0")
|
41
41
|
|
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.
|
4
|
+
version: 2.17.0
|
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-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.3.
|
19
|
+
version: 2.3.11
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.3.
|
26
|
+
version: 2.3.11
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -192,6 +192,7 @@ files:
|
|
192
192
|
- lib/graphql/extension_update_draft.graphql
|
193
193
|
- lib/graphql/fetch_specifications.graphql
|
194
194
|
- lib/graphql/find_organization.graphql
|
195
|
+
- lib/graphql/find_organization_with_apps.graphql
|
195
196
|
- lib/graphql/get_app_by_api_key.graphql
|
196
197
|
- lib/graphql/get_app_urls.graphql
|
197
198
|
- lib/graphql/get_extension_registrations.graphql
|
@@ -243,6 +244,7 @@ files:
|
|
243
244
|
- lib/project_types/extension/models/registration.rb
|
244
245
|
- lib/project_types/extension/models/server_config/app.rb
|
245
246
|
- lib/project_types/extension/models/server_config/base.rb
|
247
|
+
- lib/project_types/extension/models/server_config/capabilities.rb
|
246
248
|
- lib/project_types/extension/models/server_config/development.rb
|
247
249
|
- lib/project_types/extension/models/server_config/development_entries.rb
|
248
250
|
- lib/project_types/extension/models/server_config/development_renderer.rb
|
@@ -275,6 +277,7 @@ files:
|
|
275
277
|
- lib/project_types/extension/tasks/execute_commands/base.rb
|
276
278
|
- lib/project_types/extension/tasks/execute_commands/build.rb
|
277
279
|
- lib/project_types/extension/tasks/execute_commands/create.rb
|
280
|
+
- lib/project_types/extension/tasks/execute_commands/outdated_extension_detection.rb
|
278
281
|
- lib/project_types/extension/tasks/execute_commands/serve.rb
|
279
282
|
- lib/project_types/extension/tasks/fetch_specifications.rb
|
280
283
|
- lib/project_types/extension/tasks/find_npm_packages.rb
|
@@ -318,6 +321,7 @@ files:
|
|
318
321
|
- lib/project_types/script/layers/application/extension_points.rb
|
319
322
|
- lib/project_types/script/layers/application/project_dependencies.rb
|
320
323
|
- lib/project_types/script/layers/application/push_script.rb
|
324
|
+
- lib/project_types/script/layers/domain/app_bridge.rb
|
321
325
|
- lib/project_types/script/layers/domain/errors.rb
|
322
326
|
- lib/project_types/script/layers/domain/extension_point.rb
|
323
327
|
- lib/project_types/script/layers/domain/metadata.rb
|
@@ -538,7 +542,7 @@ files:
|
|
538
542
|
- lib/shopify_cli/tunnel.rb
|
539
543
|
- lib/shopify_cli/utilities.rb
|
540
544
|
- lib/shopify_cli/version.rb
|
541
|
-
- shipit.yml
|
545
|
+
- shipit.rubygems.yml
|
542
546
|
- shopify-cli.gemspec
|
543
547
|
- shopify-dev
|
544
548
|
- utilities/constants.rb
|