shopify-cli 2.7.3 → 2.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/CHANGELOG.md +44 -0
- data/Gemfile.lock +1 -1
- data/RELEASING.md +4 -3
- data/dev.yml +2 -2
- data/ext/javy/javy.rb +8 -9
- data/lib/graphql/get_extension_registrations.graphql +27 -0
- data/lib/project_types/extension/cli.rb +27 -2
- data/lib/project_types/extension/commands/build.rb +10 -10
- data/lib/project_types/extension/commands/create.rb +2 -3
- data/lib/project_types/extension/commands/push.rb +36 -8
- data/lib/project_types/extension/extension_project.rb +1 -1
- data/lib/project_types/extension/features/argo_serve.rb +6 -5
- data/lib/project_types/extension/forms/questions/ask_registration.rb +6 -2
- data/lib/project_types/extension/loaders/project.rb +29 -0
- data/lib/project_types/extension/loaders/specification_handler.rb +22 -0
- data/lib/project_types/extension/messages/messages.rb +4 -0
- data/lib/project_types/extension/models/app.rb +1 -1
- data/lib/project_types/extension/models/development_server.rb +2 -4
- data/lib/project_types/extension/models/specification_handlers/default.rb +4 -0
- data/lib/project_types/extension/tasks/convert_server_config.rb +3 -1
- data/lib/project_types/extension/tasks/execute_commands/base.rb +13 -0
- data/lib/project_types/extension/tasks/execute_commands/build.rb +29 -0
- data/lib/project_types/extension/tasks/execute_commands/create.rb +33 -0
- data/lib/project_types/extension/tasks/execute_commands/serve.rb +35 -0
- data/lib/project_types/extension/tasks/merge_server_config.rb +33 -22
- data/lib/project_types/rails/gem.rb +1 -2
- data/lib/project_types/script/cli.rb +7 -0
- data/lib/project_types/script/commands/connect.rb +19 -0
- data/lib/project_types/script/commands/create.rb +8 -2
- data/lib/project_types/script/commands/push.rb +35 -12
- data/lib/project_types/script/layers/application/connect_app.rb +15 -3
- data/lib/project_types/script/layers/application/create_script.rb +16 -16
- data/lib/project_types/script/layers/application/extension_points.rb +50 -26
- data/lib/project_types/script/layers/application/push_script.rb +5 -2
- data/lib/project_types/script/layers/domain/errors.rb +3 -2
- data/lib/project_types/script/layers/domain/extension_point.rb +14 -0
- data/lib/project_types/script/layers/domain/script_config.rb +6 -4
- data/lib/project_types/script/layers/infrastructure/errors.rb +38 -23
- data/lib/project_types/script/layers/infrastructure/script_project_repository.rb +49 -28
- data/lib/project_types/script/layers/infrastructure/script_service.rb +22 -5
- data/lib/project_types/script/loaders/project.rb +44 -0
- data/lib/project_types/script/loaders/specification_handler.rb +22 -0
- data/lib/project_types/script/messages/messages.rb +39 -16
- data/lib/project_types/script/ui/error_handler.rb +46 -29
- data/lib/project_types/theme/commands/pull.rb +45 -17
- data/lib/project_types/theme/commands/push.rb +65 -28
- data/lib/project_types/theme/commands/serve.rb +5 -0
- data/lib/project_types/theme/messages/messages.rb +34 -18
- data/lib/shopify_cli/command.rb +6 -0
- data/lib/shopify_cli/commands/login.rb +1 -1
- data/lib/shopify_cli/commands/switch.rb +1 -1
- data/lib/shopify_cli/constants.rb +11 -2
- data/lib/shopify_cli/context.rb +66 -12
- data/lib/shopify_cli/core/executor.rb +4 -4
- data/lib/shopify_cli/environment.rb +50 -20
- data/lib/shopify_cli/form.rb +2 -0
- data/lib/shopify_cli/identity_auth.rb +4 -3
- data/lib/shopify_cli/messages/messages.rb +9 -1
- data/lib/shopify_cli/method_object.rb +21 -9
- data/lib/shopify_cli/partners_api/app_extensions/job.rb +36 -0
- data/lib/shopify_cli/partners_api/app_extensions.rb +46 -0
- data/lib/shopify_cli/partners_api/organizations.rb +2 -5
- data/lib/shopify_cli/partners_api.rb +1 -0
- data/lib/shopify_cli/project.rb +8 -7
- data/lib/shopify_cli/resources/env_file.rb +18 -6
- data/lib/shopify_cli/result.rb +61 -59
- data/lib/shopify_cli/task.rb +5 -3
- data/lib/shopify_cli/theme/dev_server/cdn/cdn_helper.rb +49 -0
- data/lib/shopify_cli/theme/dev_server/cdn_assets.rb +69 -0
- data/lib/shopify_cli/theme/dev_server/cdn_fonts.rb +8 -28
- data/lib/shopify_cli/theme/dev_server/hot-reload.js +34 -3
- data/lib/shopify_cli/theme/dev_server/hot_reload.rb +18 -2
- data/lib/shopify_cli/theme/dev_server/local_assets.rb +4 -0
- data/lib/shopify_cli/theme/dev_server/proxy/template_param_builder.rb +84 -0
- data/lib/shopify_cli/theme/dev_server/proxy.rb +10 -15
- data/lib/shopify_cli/theme/dev_server/reload_mode.rb +34 -0
- data/lib/shopify_cli/theme/dev_server.rb +8 -21
- data/lib/shopify_cli/theme/file.rb +2 -2
- data/lib/shopify_cli/theme/filter/path_matcher.rb +38 -0
- data/lib/shopify_cli/theme/ignore_filter.rb +14 -18
- data/lib/shopify_cli/theme/include_filter.rb +43 -0
- data/lib/shopify_cli/theme/syncer.rb +17 -2
- data/lib/shopify_cli/theme/theme.rb +26 -4
- data/lib/shopify_cli/thread_pool/job.rb +27 -0
- data/lib/shopify_cli/thread_pool.rb +37 -0
- data/lib/shopify_cli/version.rb +1 -1
- data/lib/shopify_cli.rb +6 -1
- data/vendor/deps/cli-kit/lib/cli/kit/error_handler.rb +3 -1
- data/vendor/deps/ruby2_keywords/LICENSE +22 -0
- data/vendor/deps/ruby2_keywords/README.md +67 -0
- data/vendor/deps/ruby2_keywords/Rakefile +54 -0
- data/vendor/deps/ruby2_keywords/lib/ruby2_keywords.rb +57 -0
- data/vendor/deps/ruby2_keywords/ruby2_keywords.gemspec +18 -0
- data/vendor/deps/ruby2_keywords/test/test_keyword.rb +41 -0
- metadata +28 -4
- data/lib/graphql/all_orgs_with_extensions.graphql +0 -37
- data/lib/project_types/extension/tasks/run_extension_command.rb +0 -82
@@ -0,0 +1,54 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rake/testtask"
|
3
|
+
|
4
|
+
helper = Bundler::GemHelper.instance
|
5
|
+
|
6
|
+
Rake::TestTask.new(:test) do |t|
|
7
|
+
t.test_files = FileList["test/**/test_*.rb"]
|
8
|
+
end
|
9
|
+
|
10
|
+
task :default => :test
|
11
|
+
|
12
|
+
task "build" => "date_epoch"
|
13
|
+
|
14
|
+
task "date_epoch" do
|
15
|
+
ENV["SOURCE_DATE_EPOCH"] = IO.popen(%W[git -C #{__dir__} log -1 --format=%ct], &:read).chomp
|
16
|
+
end
|
17
|
+
|
18
|
+
def helper.update_gemspec
|
19
|
+
path = "#{__dir__}/#{gemspec.name}.gemspec"
|
20
|
+
File.open(path, "r+b") do |f|
|
21
|
+
if (d = f.read).sub!(/^(version\s*=\s*)".*"/) {$1 + gemspec.version.to_s.dump}
|
22
|
+
f.rewind
|
23
|
+
f.truncate(0)
|
24
|
+
f.print(d)
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def helper.commit_bump
|
30
|
+
sh(%W[git -C #{__dir__} commit -m bump\ up\ to\ #{gemspec.version}
|
31
|
+
#{gemspec.name}.gemspec])
|
32
|
+
end
|
33
|
+
|
34
|
+
def helper.version=(v)
|
35
|
+
gemspec.version = v
|
36
|
+
update_gemspec
|
37
|
+
commit_bump
|
38
|
+
tag_version
|
39
|
+
end
|
40
|
+
major, minor, teeny = helper.gemspec.version.segments
|
41
|
+
|
42
|
+
task "bump:teeny" do
|
43
|
+
helper.version = Gem::Version.new("#{major}.#{minor}.#{teeny+1}")
|
44
|
+
end
|
45
|
+
|
46
|
+
task "bump:minor" do
|
47
|
+
raise "can't bump up minor"
|
48
|
+
end
|
49
|
+
|
50
|
+
task "bump:major" do
|
51
|
+
raise "can't bump up major"
|
52
|
+
end
|
53
|
+
|
54
|
+
task "bump" => "bump:teeny"
|
@@ -0,0 +1,57 @@
|
|
1
|
+
class Module
|
2
|
+
unless private_method_defined?(:ruby2_keywords)
|
3
|
+
private
|
4
|
+
# call-seq:
|
5
|
+
# ruby2_keywords(method_name, ...)
|
6
|
+
#
|
7
|
+
# Does nothing.
|
8
|
+
def ruby2_keywords(name, *)
|
9
|
+
# nil
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
main = TOPLEVEL_BINDING.receiver
|
15
|
+
unless main.respond_to?(:ruby2_keywords, true)
|
16
|
+
# call-seq:
|
17
|
+
# ruby2_keywords(method_name, ...)
|
18
|
+
#
|
19
|
+
# Does nothing.
|
20
|
+
def main.ruby2_keywords(name, *)
|
21
|
+
# nil
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
class Proc
|
26
|
+
unless method_defined?(:ruby2_keywords)
|
27
|
+
# call-seq:
|
28
|
+
# proc.ruby2_keywords -> proc
|
29
|
+
#
|
30
|
+
# Does nothing and just returns the receiver.
|
31
|
+
def ruby2_keywords
|
32
|
+
self
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
class << Hash
|
38
|
+
unless method_defined?(:ruby2_keywords_hash?)
|
39
|
+
# call-seq:
|
40
|
+
# Hash.ruby2_keywords_hash?(hash) -> false
|
41
|
+
#
|
42
|
+
# Returns false.
|
43
|
+
def ruby2_keywords_hash?(hash)
|
44
|
+
false
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
unless method_defined?(:ruby2_keywords_hash)
|
49
|
+
# call-seq:
|
50
|
+
# Hash.ruby2_keywords_hash(hash) -> new_hash
|
51
|
+
#
|
52
|
+
# Duplicates a given hash and returns the new hash.
|
53
|
+
def ruby2_keywords_hash(hash)
|
54
|
+
hash.dup
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
version = "0.0.4"
|
2
|
+
abort "Version must not reach 1" if version[/\d+/].to_i >= 1
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = "ruby2_keywords"
|
6
|
+
s.version = version
|
7
|
+
s.summary = "Shim library for Module#ruby2_keywords"
|
8
|
+
s.homepage = "https://github.com/ruby/ruby2_keywords"
|
9
|
+
s.licenses = ["Ruby", "BSD-2-Clause"]
|
10
|
+
s.authors = ["Nobuyoshi Nakada"]
|
11
|
+
s.require_paths = ["lib"]
|
12
|
+
s.rdoc_options = ["--main", "README.md"]
|
13
|
+
s.files = [
|
14
|
+
"LICENSE",
|
15
|
+
"README.md",
|
16
|
+
"lib/ruby2_keywords.rb",
|
17
|
+
]
|
18
|
+
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
LOADING_RUBY2_KEYWORDS = (RUBY_VERSION.scan(/\d+/).map(&:to_i) <=> [2, 7]) < 0
|
3
|
+
if LOADING_RUBY2_KEYWORDS
|
4
|
+
require 'ruby2_keywords'
|
5
|
+
end
|
6
|
+
|
7
|
+
class TestKeywordArguments < Test::Unit::TestCase
|
8
|
+
def test_loaded_features
|
9
|
+
list = $LOADED_FEATURES.grep(%r[/ruby2_keywords\.rb\z])
|
10
|
+
if LOADING_RUBY2_KEYWORDS
|
11
|
+
assert_not_empty(list)
|
12
|
+
assert_not_include($LOADED_FEATURES, "ruby2_keywords.rb")
|
13
|
+
else
|
14
|
+
assert_empty(list)
|
15
|
+
assert_include($LOADED_FEATURES, "ruby2_keywords.rb")
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def test_module_ruby2_keywords
|
20
|
+
assert_send([Module, :private_method_defined?, :ruby2_keywords])
|
21
|
+
assert_operator(Module.instance_method(:ruby2_keywords).arity, :<, 0)
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_toplevel_ruby2_keywords
|
25
|
+
main = TOPLEVEL_BINDING.receiver
|
26
|
+
assert_send([main, :respond_to?, :ruby2_keywords, true])
|
27
|
+
assert_operator(main.method(:ruby2_keywords).arity, :<, 0)
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_proc_ruby2_keywords
|
31
|
+
assert_respond_to(Proc.new {}, :ruby2_keywords)
|
32
|
+
end
|
33
|
+
|
34
|
+
def test_hash_ruby2_keywords_hash?
|
35
|
+
assert_false(Hash.ruby2_keywords_hash?({}))
|
36
|
+
end
|
37
|
+
|
38
|
+
def test_hash_ruby2_keywords_hash
|
39
|
+
assert_equal({}, Hash.ruby2_keywords_hash({}.freeze))
|
40
|
+
end
|
41
|
+
end
|
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.10.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shopify
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -165,7 +165,6 @@ files:
|
|
165
165
|
- lib/graphql/admin_introspection.graphql
|
166
166
|
- lib/graphql/all_organizations.graphql
|
167
167
|
- lib/graphql/all_orgs_with_apps.graphql
|
168
|
-
- lib/graphql/all_orgs_with_extensions.graphql
|
169
168
|
- lib/graphql/api_versions.graphql
|
170
169
|
- lib/graphql/convert_dev_to_test_store.graphql
|
171
170
|
- lib/graphql/create_app.graphql
|
@@ -178,6 +177,7 @@ files:
|
|
178
177
|
- lib/graphql/find_organization.graphql
|
179
178
|
- lib/graphql/get_app_by_api_key.graphql
|
180
179
|
- lib/graphql/get_app_urls.graphql
|
180
|
+
- lib/graphql/get_extension_registrations.graphql
|
181
181
|
- lib/graphql/get_variant_id.graphql
|
182
182
|
- lib/graphql/update_dashboard_urls.graphql
|
183
183
|
- lib/project_types/extension/cli.rb
|
@@ -213,6 +213,8 @@ files:
|
|
213
213
|
- lib/project_types/extension/forms/questions/ask_registration.rb
|
214
214
|
- lib/project_types/extension/forms/questions/ask_template.rb
|
215
215
|
- lib/project_types/extension/forms/questions/ask_type.rb
|
216
|
+
- lib/project_types/extension/loaders/project.rb
|
217
|
+
- lib/project_types/extension/loaders/specification_handler.rb
|
216
218
|
- lib/project_types/extension/messages/message_loading.rb
|
217
219
|
- lib/project_types/extension/messages/messages.rb
|
218
220
|
- lib/project_types/extension/models/app.rb
|
@@ -250,6 +252,10 @@ files:
|
|
250
252
|
- lib/project_types/extension/tasks/converters/version_converter.rb
|
251
253
|
- lib/project_types/extension/tasks/create_extension.rb
|
252
254
|
- lib/project_types/extension/tasks/ensure_resource_url.rb
|
255
|
+
- lib/project_types/extension/tasks/execute_commands/base.rb
|
256
|
+
- lib/project_types/extension/tasks/execute_commands/build.rb
|
257
|
+
- lib/project_types/extension/tasks/execute_commands/create.rb
|
258
|
+
- lib/project_types/extension/tasks/execute_commands/serve.rb
|
253
259
|
- lib/project_types/extension/tasks/fetch_specifications.rb
|
254
260
|
- lib/project_types/extension/tasks/find_npm_packages.rb
|
255
261
|
- lib/project_types/extension/tasks/find_package_from_json.rb
|
@@ -258,7 +264,6 @@ files:
|
|
258
264
|
- lib/project_types/extension/tasks/get_extensions.rb
|
259
265
|
- lib/project_types/extension/tasks/get_product.rb
|
260
266
|
- lib/project_types/extension/tasks/merge_server_config.rb
|
261
|
-
- lib/project_types/extension/tasks/run_extension_command.rb
|
262
267
|
- lib/project_types/extension/tasks/update_draft.rb
|
263
268
|
- lib/project_types/extension/tasks/user_errors.rb
|
264
269
|
- lib/project_types/node/cli.rb
|
@@ -274,6 +279,7 @@ files:
|
|
274
279
|
- lib/project_types/rails/messages/messages.rb
|
275
280
|
- lib/project_types/rails/ruby.rb
|
276
281
|
- lib/project_types/script/cli.rb
|
282
|
+
- lib/project_types/script/commands/connect.rb
|
277
283
|
- lib/project_types/script/commands/create.rb
|
278
284
|
- lib/project_types/script/commands/javy.rb
|
279
285
|
- lib/project_types/script/commands/push.rb
|
@@ -316,6 +322,8 @@ files:
|
|
316
322
|
- lib/project_types/script/layers/infrastructure/script_service.rb
|
317
323
|
- lib/project_types/script/layers/infrastructure/script_uploader.rb
|
318
324
|
- lib/project_types/script/layers/infrastructure/service_locator.rb
|
325
|
+
- lib/project_types/script/loaders/project.rb
|
326
|
+
- lib/project_types/script/loaders/specification_handler.rb
|
319
327
|
- lib/project_types/script/messages/messages.rb
|
320
328
|
- lib/project_types/script/ui/error_handler.rb
|
321
329
|
- lib/project_types/script/ui/printing_spinner.rb
|
@@ -407,6 +415,8 @@ files:
|
|
407
415
|
- lib/shopify_cli/options.rb
|
408
416
|
- lib/shopify_cli/packager.rb
|
409
417
|
- lib/shopify_cli/partners_api.rb
|
418
|
+
- lib/shopify_cli/partners_api/app_extensions.rb
|
419
|
+
- lib/shopify_cli/partners_api/app_extensions/job.rb
|
410
420
|
- lib/shopify_cli/partners_api/organizations.rb
|
411
421
|
- lib/shopify_cli/php_deps.rb
|
412
422
|
- lib/shopify_cli/process_supervision.rb
|
@@ -448,6 +458,8 @@ files:
|
|
448
458
|
- lib/shopify_cli/tasks/select_org_and_shop.rb
|
449
459
|
- lib/shopify_cli/tasks/update_dashboard_urls.rb
|
450
460
|
- lib/shopify_cli/theme/dev_server.rb
|
461
|
+
- lib/shopify_cli/theme/dev_server/cdn/cdn_helper.rb
|
462
|
+
- lib/shopify_cli/theme/dev_server/cdn_assets.rb
|
451
463
|
- lib/shopify_cli/theme/dev_server/cdn_fonts.rb
|
452
464
|
- lib/shopify_cli/theme/dev_server/certificate_manager.rb
|
453
465
|
- lib/shopify_cli/theme/dev_server/header_hash.rb
|
@@ -455,18 +467,24 @@ files:
|
|
455
467
|
- lib/shopify_cli/theme/dev_server/hot_reload.rb
|
456
468
|
- lib/shopify_cli/theme/dev_server/local_assets.rb
|
457
469
|
- lib/shopify_cli/theme/dev_server/proxy.rb
|
470
|
+
- lib/shopify_cli/theme/dev_server/proxy/template_param_builder.rb
|
471
|
+
- lib/shopify_cli/theme/dev_server/reload_mode.rb
|
458
472
|
- lib/shopify_cli/theme/dev_server/sse.rb
|
459
473
|
- lib/shopify_cli/theme/dev_server/watcher.rb
|
460
474
|
- lib/shopify_cli/theme/dev_server/web_server.rb
|
461
475
|
- lib/shopify_cli/theme/development_theme.rb
|
462
476
|
- lib/shopify_cli/theme/file.rb
|
477
|
+
- lib/shopify_cli/theme/filter/path_matcher.rb
|
463
478
|
- lib/shopify_cli/theme/ignore_filter.rb
|
479
|
+
- lib/shopify_cli/theme/include_filter.rb
|
464
480
|
- lib/shopify_cli/theme/mime_type.rb
|
465
481
|
- lib/shopify_cli/theme/syncer.rb
|
466
482
|
- lib/shopify_cli/theme/syncer/error_reporter.rb
|
467
483
|
- lib/shopify_cli/theme/syncer/operation.rb
|
468
484
|
- lib/shopify_cli/theme/syncer/standard_reporter.rb
|
469
485
|
- lib/shopify_cli/theme/theme.rb
|
486
|
+
- lib/shopify_cli/thread_pool.rb
|
487
|
+
- lib/shopify_cli/thread_pool/job.rb
|
470
488
|
- lib/shopify_cli/transform_data_structure.rb
|
471
489
|
- lib/shopify_cli/tunnel.rb
|
472
490
|
- lib/shopify_cli/version.rb
|
@@ -522,6 +540,12 @@ files:
|
|
522
540
|
- vendor/deps/cli-ui/lib/cli/ui/widgets/base.rb
|
523
541
|
- vendor/deps/cli-ui/lib/cli/ui/widgets/status.rb
|
524
542
|
- vendor/deps/cli-ui/lib/cli/ui/wrap.rb
|
543
|
+
- vendor/deps/ruby2_keywords/LICENSE
|
544
|
+
- vendor/deps/ruby2_keywords/README.md
|
545
|
+
- vendor/deps/ruby2_keywords/Rakefile
|
546
|
+
- vendor/deps/ruby2_keywords/lib/ruby2_keywords.rb
|
547
|
+
- vendor/deps/ruby2_keywords/ruby2_keywords.gemspec
|
548
|
+
- vendor/deps/ruby2_keywords/test/test_keyword.rb
|
525
549
|
- vendor/deps/smart_properties/REVISION
|
526
550
|
- vendor/deps/smart_properties/lib/smart_properties.rb
|
527
551
|
- vendor/deps/smart_properties/lib/smart_properties/errors.rb
|
@@ -1,37 +0,0 @@
|
|
1
|
-
query AllOrgs ($type: String) {
|
2
|
-
organizations {
|
3
|
-
nodes {
|
4
|
-
id
|
5
|
-
businessName
|
6
|
-
website
|
7
|
-
apps(first: 500) {
|
8
|
-
nodes {
|
9
|
-
id
|
10
|
-
title
|
11
|
-
apiKey
|
12
|
-
apiSecretKeys{
|
13
|
-
secret
|
14
|
-
}
|
15
|
-
appType
|
16
|
-
extensionRegistrations(specificationIdentifier: $type) {
|
17
|
-
id
|
18
|
-
type
|
19
|
-
uuid
|
20
|
-
title
|
21
|
-
draftVersion {
|
22
|
-
registrationId
|
23
|
-
context
|
24
|
-
lastUserInteractionAt
|
25
|
-
location
|
26
|
-
validationErrors { field message }
|
27
|
-
|
28
|
-
id
|
29
|
-
uuid
|
30
|
-
versionTag
|
31
|
-
}
|
32
|
-
}
|
33
|
-
}
|
34
|
-
}
|
35
|
-
}
|
36
|
-
}
|
37
|
-
}
|
@@ -1,82 +0,0 @@
|
|
1
|
-
|
2
|
-
# frozen_string_literal: true
|
3
|
-
require "shopify_cli"
|
4
|
-
|
5
|
-
module Extension
|
6
|
-
module Tasks
|
7
|
-
class RunExtensionCommand < ShopifyCLI::Task
|
8
|
-
include SmartProperties
|
9
|
-
|
10
|
-
SUPPORTED_COMMANDS = [
|
11
|
-
"create",
|
12
|
-
"build",
|
13
|
-
"serve",
|
14
|
-
]
|
15
|
-
|
16
|
-
property! :command, accepts: SUPPORTED_COMMANDS
|
17
|
-
property! :type, accepts: Models::DevelopmentServerRequirements::SUPPORTED_EXTENSION_TYPES
|
18
|
-
property! :context, accepts: ShopifyCLI::Context
|
19
|
-
property :config_file_name, accepts: String
|
20
|
-
property :port, accepts: Integer, default: 39351
|
21
|
-
property :resource_url, accepts: String
|
22
|
-
property :root_dir, accepts: String
|
23
|
-
property :template, accepts: Models::ServerConfig::Development::VALID_TEMPLATES
|
24
|
-
property :tunnel_url, accepts: String
|
25
|
-
|
26
|
-
def call
|
27
|
-
ShopifyCLI::Result.success(config_file_exists?)
|
28
|
-
.then(&method(:load_or_build_server_config))
|
29
|
-
.then(&method(:run_command))
|
30
|
-
.unwrap do |error|
|
31
|
-
raise error unless error.nil?
|
32
|
-
end
|
33
|
-
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
def config_file_exists?
|
38
|
-
return false if config_file_name.nil?
|
39
|
-
project = ExtensionProject.current
|
40
|
-
File.exist?(File.join(project.directory, config_file_name))
|
41
|
-
end
|
42
|
-
|
43
|
-
def load_or_build_server_config(config_file_exists)
|
44
|
-
return merge_server_config if config_file_exists
|
45
|
-
build_server_config
|
46
|
-
end
|
47
|
-
|
48
|
-
def merge_server_config
|
49
|
-
Tasks::MergeServerConfig.call(
|
50
|
-
context: context,
|
51
|
-
file_name: config_file_name,
|
52
|
-
resource_url: resource_url,
|
53
|
-
tunnel_url: tunnel_url,
|
54
|
-
type: type
|
55
|
-
)
|
56
|
-
end
|
57
|
-
|
58
|
-
def build_server_config
|
59
|
-
extension = Models::ServerConfig::Extension.build(
|
60
|
-
template: template,
|
61
|
-
type: type,
|
62
|
-
root_dir: root_dir,
|
63
|
-
)
|
64
|
-
|
65
|
-
Models::ServerConfig::Root.new(port: port, extensions: [extension])
|
66
|
-
end
|
67
|
-
|
68
|
-
def run_command(server_config)
|
69
|
-
case command
|
70
|
-
when "create"
|
71
|
-
Models::DevelopmentServer.new.create(server_config)
|
72
|
-
when "build"
|
73
|
-
Models::DevelopmentServer.new.build(server_config)
|
74
|
-
when "serve"
|
75
|
-
Models::DevelopmentServer.new.serve(context, server_config)
|
76
|
-
else
|
77
|
-
raise NotImplementedError
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|