shopify-cli 2.21.0 → 2.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/shopify.yml +0 -1
- data/CHANGELOG.md +6 -0
- data/Gemfile.lock +1 -1
- data/lib/project_types/theme/commands/pull.rb +5 -1
- data/lib/project_types/theme/commands/push.rb +18 -9
- data/lib/project_types/theme/messages/messages.rb +21 -9
- data/lib/shopify_cli/resources/env_file.rb +1 -1
- data/lib/shopify_cli/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fdf2b1a1c6ff2b21a3adb26654fda425436a5660d27b487dd1473fc2530b02c
|
4
|
+
data.tar.gz: 572fa0ba305ec75391c3aac020f1bb72c0874a8d138c7b05da8aaf0fdba68719
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bb78577fab62082d1fb27eacb1865a690c04a8985fea4af5684399e84a942d025e79b36792c1c382704231f8e73c67e71edd9cd055898de0aa48099b2d5dfb2e
|
7
|
+
data.tar.gz: 7e19eb12d7e1cfc5d22002bde244451f21277547180a13617f3211de1b657099e12b85efa46ce8f5649954336cd24c672c98e9ac807af00212f7ea921e57f37f
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,12 @@ 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.22.0 - 2022-08-08
|
6
|
+
|
7
|
+
### Fixed
|
8
|
+
* [#2512](https://github.com/Shopify/shopify-cli/pull/2512): Add the `-t/--theme` parameter to the `shopify theme serve -h` message
|
9
|
+
* [#2505](https://github.com/Shopify/shopify-cli/pull/2505): Show warning messages when `shopify theme push/pull` has errors
|
10
|
+
|
5
11
|
## Version 2.21.0 - 2022-08-03
|
6
12
|
|
7
13
|
### Fixed
|
data/Gemfile.lock
CHANGED
@@ -52,7 +52,11 @@ module Theme
|
|
52
52
|
CLI::UI::Frame.open(@ctx.message("theme.pull.pulling", theme.name, theme.id, theme.shop)) do
|
53
53
|
UI::SyncProgressBar.new(syncer).progress(:download_theme!, delete: delete)
|
54
54
|
end
|
55
|
-
|
55
|
+
if syncer.has_any_error?
|
56
|
+
@ctx.warn(@ctx.message("theme.pull.done_with_errors"))
|
57
|
+
else
|
58
|
+
@ctx.done(@ctx.message("theme.pull.done"))
|
59
|
+
end
|
56
60
|
rescue ShopifyCLI::API::APIRequestNotFoundError
|
57
61
|
@ctx.abort(@ctx.message("theme.pull.theme_not_found", "##{theme.id}"))
|
58
62
|
ensure
|
@@ -63,20 +63,12 @@ module Theme
|
|
63
63
|
syncer.start_threads
|
64
64
|
if options.flags[:json]
|
65
65
|
syncer.upload_theme!(delete: delete)
|
66
|
-
puts(JSON.generate(theme: theme.to_h))
|
67
66
|
else
|
68
67
|
CLI::UI::Frame.open(@ctx.message("theme.push.info.pushing", theme.name, theme.id, theme.shop)) do
|
69
68
|
UI::SyncProgressBar.new(syncer).progress(:upload_theme!, delete: delete)
|
70
69
|
end
|
71
|
-
|
72
|
-
if options.flags[:publish]
|
73
|
-
theme.publish
|
74
|
-
@ctx.done(@ctx.message("theme.publish.done", theme.preview_url))
|
75
|
-
else
|
76
|
-
@ctx.done(@ctx.message("theme.push.done", theme.preview_url, theme.editor_url))
|
77
|
-
end
|
78
70
|
end
|
79
|
-
|
71
|
+
push_completion_handler(theme, syncer.has_any_error?)
|
80
72
|
ensure
|
81
73
|
syncer.shutdown
|
82
74
|
end
|
@@ -90,6 +82,23 @@ module Theme
|
|
90
82
|
|
91
83
|
private
|
92
84
|
|
85
|
+
def push_completion_handler(theme, has_errors)
|
86
|
+
if options.flags[:json]
|
87
|
+
output = { theme: theme.to_h }
|
88
|
+
output[:warning] = "Theme pushed with errors." if has_errors
|
89
|
+
|
90
|
+
puts(JSON.generate(output))
|
91
|
+
elsif options.flags[:publish]
|
92
|
+
theme.publish
|
93
|
+
return @ctx.done(@ctx.message("theme.publish.done", theme.preview_url)) unless has_errors
|
94
|
+
@ctx.warn(@ctx.message("theme.publish.done_with_errors", theme.preview_url))
|
95
|
+
else
|
96
|
+
return @ctx.done(@ctx.message("theme.push.done", theme.preview_url, theme.editor_url)) unless has_errors
|
97
|
+
@ctx.warn(@ctx.message("theme.push.done_with_errors", theme.preview_url, theme.editor_url))
|
98
|
+
end
|
99
|
+
raise ShopifyCLI::AbortSilent if has_errors
|
100
|
+
end
|
101
|
+
|
93
102
|
def find_theme(root, theme_id: nil, theme: nil, live: nil, development: nil, unpublished: nil, **_args)
|
94
103
|
if theme_id
|
95
104
|
@ctx.warn(@ctx.message("theme.push.deprecated_themeid"))
|
@@ -43,6 +43,7 @@ module Theme
|
|
43
43
|
Run without arguments to select theme from a list.
|
44
44
|
HELP
|
45
45
|
done: "Your theme is now live at %s",
|
46
|
+
done_with_errors: "{{warning:Your theme was published with errors and is now live at %s.}}",
|
46
47
|
not_found: "Theme #%s does not exist",
|
47
48
|
no_themes_error: "You don't have any theme to be published.",
|
48
49
|
no_themes_resolution: "Try to create an unpublished theme with {{command:theme push -u -t <theme_name>}}.",
|
@@ -102,6 +103,15 @@ module Theme
|
|
102
103
|
{{info:Customize this theme in the Theme Editor:}}
|
103
104
|
{{underline:%s}}
|
104
105
|
DONE
|
106
|
+
done_with_errors: <<~WARN,
|
107
|
+
{{yellow:Your theme was pushed with errors.}}
|
108
|
+
|
109
|
+
{{info:View your theme:}}
|
110
|
+
{{underline:%s}}
|
111
|
+
|
112
|
+
{{info:Customize this theme in the Theme Editor:}}
|
113
|
+
{{underline:%s}}
|
114
|
+
WARN
|
105
115
|
name: "Theme name",
|
106
116
|
},
|
107
117
|
serve: {
|
@@ -112,14 +122,15 @@ module Theme
|
|
112
122
|
Usage: {{command:%s theme serve [ ROOT ]}}
|
113
123
|
|
114
124
|
Options:
|
115
|
-
{{command
|
116
|
-
{{command:--
|
117
|
-
{{command:--
|
118
|
-
{{command:--
|
119
|
-
{{command:--
|
120
|
-
|
121
|
-
|
122
|
-
|
125
|
+
{{command:-t, --theme=NAME_OR_ID}} Theme ID or name of the remote theme.
|
126
|
+
{{command:--port=PORT}} Local port to serve theme preview from.
|
127
|
+
{{command:--poll}} Force polling to detect file changes.
|
128
|
+
{{command:--host=HOST}} Set which network interface the web server listens on. The default value is 127.0.0.1.
|
129
|
+
{{command:--theme-editor-sync}} Synchronize Theme Editor updates in the local theme files.
|
130
|
+
{{command:--live-reload=MODE}} The live reload mode switches the server behavior when a file is modified:
|
131
|
+
- {{command:hot-reload}} Hot reloads local changes to CSS and sections (default)
|
132
|
+
- {{command:full-page}} Always refreshes the entire page
|
133
|
+
- {{command:off}} Deactivate live reload
|
123
134
|
HELP
|
124
135
|
reload_mode_is_not_valid: "The live reload mode `%s` is not valid.",
|
125
136
|
try_a_valid_reload_mode: "Try a valid live reload mode: %s.",
|
@@ -318,7 +329,8 @@ module Theme
|
|
318
329
|
HELP
|
319
330
|
select: "Select a theme to pull from",
|
320
331
|
pulling: "Pulling theme files from %s (#%s) on %s",
|
321
|
-
done: "Theme pulled successfully",
|
332
|
+
done: "Theme pulled successfully.",
|
333
|
+
done_with_errors: "{{warning:Your theme was pulled with errors.}}",
|
322
334
|
deprecated_themeid: <<~WARN,
|
323
335
|
{{warning:The {{command:-i, --themeid}} flag is deprecated. Use {{command:-t, --theme}} instead.}}
|
324
336
|
WARN
|
@@ -30,7 +30,7 @@ module ShopifyCLI
|
|
30
30
|
def parse(directory)
|
31
31
|
File.read(path(directory))
|
32
32
|
.gsub("\r\n", "\n").split("\n").each_with_object({}) do |line, output|
|
33
|
-
match = /\A([A-Za-z_0-9]+)\s*=\s*(.*)\z/.match(line)
|
33
|
+
match = /\A(#*\s*[A-Za-z_0-9]+)\s*=\s*(.*)\z/.match(line)
|
34
34
|
if match
|
35
35
|
key = match[1]
|
36
36
|
output[key] = case match[2]
|
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.22.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-08-
|
11
|
+
date: 2022-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|