shopify-cli 2.19.0 → 2.20.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.
- 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 +1 -1
- data/README.md +7 -6
- data/docs/users/installation.md +1 -1
- data/lib/project_types/extension/messages/messages.rb +1 -1
- data/lib/project_types/extension/tasks/fetch_specifications.rb +4 -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/identity_auth/servlet.rb +4 -20
- data/lib/shopify_cli/messages/messages.rb +6 -8
- 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
- metadata +14 -2
@@ -0,0 +1,62 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "forwardable"
|
4
|
+
|
5
|
+
require_relative "theme_admin_api_throttler/bulk"
|
6
|
+
require_relative "theme_admin_api_throttler/put_request"
|
7
|
+
|
8
|
+
module ShopifyCLI
|
9
|
+
module Theme
|
10
|
+
class ThemeAdminAPIThrottler
|
11
|
+
extend Forwardable
|
12
|
+
|
13
|
+
attr_reader :bulk, :admin_api
|
14
|
+
|
15
|
+
def_delegators :@admin_api, :get, :post, :delete
|
16
|
+
|
17
|
+
def initialize(ctx, admin_api, active = true)
|
18
|
+
@ctx = ctx
|
19
|
+
@admin_api = admin_api
|
20
|
+
@active = active
|
21
|
+
@bulk = Bulk.new(ctx, admin_api)
|
22
|
+
end
|
23
|
+
|
24
|
+
def put(path:, **args, &block)
|
25
|
+
request = PutRequest.new(path, args[:body], &block)
|
26
|
+
if active?
|
27
|
+
bulk_request(request)
|
28
|
+
else
|
29
|
+
rest_request(request)
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
def activate_throttler!
|
34
|
+
@active = true
|
35
|
+
end
|
36
|
+
|
37
|
+
def deactivate_throttler!
|
38
|
+
@active = false
|
39
|
+
end
|
40
|
+
|
41
|
+
def active?
|
42
|
+
@active
|
43
|
+
end
|
44
|
+
|
45
|
+
def shutdown
|
46
|
+
bulk.shutdown
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def rest_request(request)
|
52
|
+
request.block.call(admin_api.rest_request(**request.to_h))
|
53
|
+
rescue StandardError => error
|
54
|
+
request.block.call(500, {}, error)
|
55
|
+
end
|
56
|
+
|
57
|
+
def bulk_request(request)
|
58
|
+
bulk.enqueue(request)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
end
|
62
|
+
end
|
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.
|
4
|
+
version: 2.20.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-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- ".github/DESIGN.md"
|
121
121
|
- ".github/ISSUE_TEMPLATE.md"
|
122
122
|
- ".github/ISSUE_TEMPLATE/bug_report.yaml"
|
123
|
+
- ".github/ISSUE_TEMPLATE/config.yml"
|
123
124
|
- ".github/ISSUE_TEMPLATE/enhancement.yaml"
|
124
125
|
- ".github/ISSUE_TEMPLATE/feature.yaml"
|
125
126
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
@@ -383,6 +384,8 @@ files:
|
|
383
384
|
- lib/shopify_cli/admin_api/schema.rb
|
384
385
|
- lib/shopify_cli/api.rb
|
385
386
|
- lib/shopify_cli/app_type_detector.rb
|
387
|
+
- lib/shopify_cli/assets/post_auth_page/index.html.erb
|
388
|
+
- lib/shopify_cli/assets/post_auth_page/style.css
|
386
389
|
- lib/shopify_cli/changelog.rb
|
387
390
|
- lib/shopify_cli/command.rb
|
388
391
|
- lib/shopify_cli/command/app_sub_command.rb
|
@@ -501,6 +504,7 @@ files:
|
|
501
504
|
- lib/shopify_cli/theme/dev_server/cdn_fonts.rb
|
502
505
|
- lib/shopify_cli/theme/dev_server/certificate_manager.rb
|
503
506
|
- lib/shopify_cli/theme/dev_server/header_hash.rb
|
507
|
+
- lib/shopify_cli/theme/dev_server/hot-reload-no-script.html
|
504
508
|
- lib/shopify_cli/theme/dev_server/hot-reload.js
|
505
509
|
- lib/shopify_cli/theme/dev_server/hot_reload.rb
|
506
510
|
- lib/shopify_cli/theme/dev_server/hot_reload/remote_file_reloader.rb
|
@@ -534,8 +538,16 @@ files:
|
|
534
538
|
- lib/shopify_cli/theme/syncer/merger.rb
|
535
539
|
- lib/shopify_cli/theme/syncer/operation.rb
|
536
540
|
- lib/shopify_cli/theme/syncer/standard_reporter.rb
|
541
|
+
- lib/shopify_cli/theme/syncer/unsupported_script_warning.rb
|
537
542
|
- lib/shopify_cli/theme/theme.rb
|
538
543
|
- lib/shopify_cli/theme/theme_admin_api.rb
|
544
|
+
- lib/shopify_cli/theme/theme_admin_api_throttler.rb
|
545
|
+
- lib/shopify_cli/theme/theme_admin_api_throttler/bulk.rb
|
546
|
+
- lib/shopify_cli/theme/theme_admin_api_throttler/bulk_job.rb
|
547
|
+
- lib/shopify_cli/theme/theme_admin_api_throttler/errors.rb
|
548
|
+
- lib/shopify_cli/theme/theme_admin_api_throttler/put_request.rb
|
549
|
+
- lib/shopify_cli/theme/theme_admin_api_throttler/request_parser.rb
|
550
|
+
- lib/shopify_cli/theme/theme_admin_api_throttler/response_parser.rb
|
539
551
|
- lib/shopify_cli/thread_pool.rb
|
540
552
|
- lib/shopify_cli/thread_pool/job.rb
|
541
553
|
- lib/shopify_cli/transform_data_structure.rb
|