shopify-cli 2.21.0 → 2.22.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8971e6497feaa24c2fd34b00c29208f44ffb4cd6405b1b1ec08324b41ade05ad
4
- data.tar.gz: 111bbf0f53d8d57812916ee930773887e07163008bd04a1796312378148d70ea
3
+ metadata.gz: 4fdf2b1a1c6ff2b21a3adb26654fda425436a5660d27b487dd1473fc2530b02c
4
+ data.tar.gz: 572fa0ba305ec75391c3aac020f1bb72c0874a8d138c7b05da8aaf0fdba68719
5
5
  SHA512:
6
- metadata.gz: f83037ed5100015bb76f76864af37bff6a735c61d43f1d7870f67441f45d565530e2ebe43537f1f0891a6eda67a2631604916359b678ab8a7d262576a576171d
7
- data.tar.gz: 7dd3af12ba1f384d7232c48c5a6f2724a99917eeb598d61d9a01cb86be4d2f114142daf226dc4f58f8083b4f0f8937cbd7f55d9b9283272be4e5c8c6e257ae04
6
+ metadata.gz: bb78577fab62082d1fb27eacb1865a690c04a8985fea4af5684399e84a942d025e79b36792c1c382704231f8e73c67e71edd9cd055898de0aa48099b2d5dfb2e
7
+ data.tar.gz: 7e19eb12d7e1cfc5d22002bde244451f21277547180a13617f3211de1b657099e12b85efa46ce8f5649954336cd24c672c98e9ac807af00212f7ea921e57f37f
@@ -22,7 +22,6 @@ jobs:
22
22
  - 2.6.6
23
23
  - 2.7.5
24
24
  os:
25
- - macos-10.15
26
25
  - macos-11
27
26
  - ubuntu-20.04
28
27
  - ubuntu-18.04
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- shopify-cli (2.21.0)
4
+ shopify-cli (2.22.0)
5
5
  bugsnag (~> 6.22)
6
6
  listen (~> 3.7.0)
7
7
  theme-check (~> 1.10.3)
@@ -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
- @ctx.done(@ctx.message("theme.pull.done"))
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
- raise ShopifyCLI::AbortSilent if syncer.has_any_error?
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:--port=PORT}} Local port to serve theme preview from.
116
- {{command:--poll}} Force polling to detect file changes.
117
- {{command:--host=HOST}} Set which network interface the web server listens on. The default value is 127.0.0.1.
118
- {{command:--theme-editor-sync}} Synchronize Theme Editor updates in the local theme files.
119
- {{command:--live-reload=MODE}} The live reload mode switches the server behavior when a file is modified:
120
- - {{command:hot-reload}} Hot reloads local changes to CSS and sections (default)
121
- - {{command:full-page}} Always refreshes the entire page
122
- - {{command:off}} Deactivate live reload
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]
@@ -1,3 +1,3 @@
1
1
  module ShopifyCLI
2
- VERSION = "2.21.0"
2
+ VERSION = "2.22.0"
3
3
  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.21.0
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-03 00:00:00.000000000 Z
11
+ date: 2022-08-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler