theme-check 1.10.0 → 1.10.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +22 -0
- data/RELEASING.md +4 -4
- data/config/default.yml +1 -0
- data/config/theme_app_extension.yml +1 -0
- data/data/shopify_liquid/theme_app_extension_objects.yml +2 -0
- data/docs/api/check.md +1 -1
- data/docs/checks/TEMPLATE.md.erb +1 -1
- data/docs/checks/schema_json_format.md +1 -1
- data/lib/theme_check/checks/translation_key_exists.rb +1 -0
- data/lib/theme_check/checks/undefined_object.rb +9 -1
- data/lib/theme_check/config.rb +2 -1
- data/lib/theme_check/json_printer.rb +1 -1
- data/lib/theme_check/shopify_liquid/object.rb +4 -0
- data/lib/theme_check/tags.rb +17 -1
- data/lib/theme_check/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2774c1d3e2e9b8fa7dab0fdd4174dbfd3e625c608af349c30f526f00a6b9123
|
4
|
+
data.tar.gz: 69bdb078be8aa938b2dec75a62206840586ae1a015620ec3c9ce727e49fc2e07
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa83efd1994e95fd12defc06b13567fac6e80fd830fb870f7a50b650424b8ed339848271ac35c608b6bc40a3e884665a3136c1f75e150be937be8b78e74df9fc
|
7
|
+
data.tar.gz: 848e2752ecc6e6bb4b0954663dac298f869a191d0b4b146fd488b8a9a442a5573a1c716c84658b2654431f96db1572309c70991a2e29e37c1bf82bd337c79edd
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,26 @@
|
|
1
1
|
|
2
|
+
v1.10.3 / 2022-06-16
|
3
|
+
==================
|
4
|
+
|
5
|
+
* Support app drop in theme app extensions ([#566](https://github.com/shopify/theme-check/issues/566))
|
6
|
+
* Fix requiring custom check when root is specified ([#565](https://github.com/shopify/theme-check/issues/565))
|
7
|
+
* Fix TranslationKeyExists.on_end issue ([#587](https://github.com/shopify/theme-check/issues/587))
|
8
|
+
* Fix bad link on check documentation ([#575](https://github.com/shopify/theme-check/issues/575))
|
9
|
+
* Update TEMPLATE.md.erb to use shopify.dev URL
|
10
|
+
* Fixed broken URL ([#574](https://github.com/shopify/theme-check/issues/574))
|
11
|
+
* Fix unknown configuration issue for UndefinedObject checker ([#568](https://github.com/shopify/theme-check/issues/568))
|
12
|
+
|
13
|
+
v1.10.2 / 2022-03-07
|
14
|
+
====================
|
15
|
+
|
16
|
+
* Handle nil paths in json_printer's sort_by ([#561](https://github.com/shopify/theme-check/issues/561))
|
17
|
+
* Prevent bad render tags from passing theme-check ([#559](https://github.com/shopify/theme-check/issues/559))
|
18
|
+
|
19
|
+
v1.10.1 / 2022-02-24
|
20
|
+
====================
|
21
|
+
|
22
|
+
* Revert "Prevent bad render tags from passing theme-check ([#551](https://github.com/shopify/theme-check/issues/551))"
|
23
|
+
|
2
24
|
v1.10.0 / 2022-02-24
|
3
25
|
====================
|
4
26
|
|
data/RELEASING.md
CHANGED
@@ -73,11 +73,11 @@
|
|
73
73
|
|
74
74
|
1. Release `theme-check` on RubyGems by following the steps in the previous section.
|
75
75
|
|
76
|
-
2. Update the `theme-check` version in [`shopify-cli`](https://github.com/shopify/shopify-cli)'s `
|
76
|
+
2. Update the `theme-check` version in [`shopify-cli`](https://github.com/shopify/shopify-cli)'s `shopify-cli.gemspec` file.
|
77
77
|
|
78
|
-
|
78
|
+
3. Run `bundle update theme-check` and get an updated `Gemfile.lock`
|
79
79
|
|
80
|
-
|
80
|
+
4. Create a branch + a commit on the [`shopify-cli`](https://github.com/Shopify/shopify-cli) repository.
|
81
81
|
|
82
82
|
```bash
|
83
83
|
VERSION=X.X.X
|
@@ -87,7 +87,7 @@
|
|
87
87
|
git commit -m "Bump theme-check version to $VERSION"
|
88
88
|
```
|
89
89
|
|
90
|
-
|
90
|
+
5. Create a pull-request for those changes on the [`shopify-cli`](https://github.com/Shopify/shopify-cli) repository.
|
91
91
|
|
92
92
|
```bash
|
93
93
|
# shortcut if you have `hub` installed
|
data/config/default.yml
CHANGED
data/docs/api/check.md
CHANGED
data/docs/checks/TEMPLATE.md.erb
CHANGED
@@ -34,7 +34,7 @@ The following example contains the default configuration for this check:
|
|
34
34
|
| Parameter | Description |
|
35
35
|
| --- | --- |
|
36
36
|
| enabled | Whether the check is enabled. |
|
37
|
-
| severity | The [severity](https://shopify.
|
37
|
+
| severity | The [severity](https://shopify.dev/themes/tools/theme-check/configuration#check-severity) of the check. |
|
38
38
|
| other_option | A description of the option. |
|
39
39
|
|
40
40
|
## Disabling this check
|
@@ -59,7 +59,7 @@ SchemaJsonFormat:
|
|
59
59
|
| Parameter | Description |
|
60
60
|
| --- | --- |
|
61
61
|
| enabled | Whether the check is enabled. |
|
62
|
-
| severity | The [severity](https://shopify.
|
62
|
+
| severity | The [severity](https://shopify.dev/themes/tools/theme-check/configuration#check-severity) of the check. |
|
63
63
|
| start_level | The indentation level. If you prefer an indented schema, set this to 1. |
|
64
64
|
| indent | The character(s) used for indentation levels. |
|
65
65
|
|
@@ -55,7 +55,8 @@ module ThemeCheck
|
|
55
55
|
end
|
56
56
|
end
|
57
57
|
|
58
|
-
def initialize(exclude_snippets: true)
|
58
|
+
def initialize(config_type: :default, exclude_snippets: true)
|
59
|
+
@config_type = config_type
|
59
60
|
@exclude_snippets = exclude_snippets
|
60
61
|
@files = {}
|
61
62
|
end
|
@@ -111,6 +112,9 @@ module ThemeCheck
|
|
111
112
|
shopify_plus_objects = ThemeCheck::ShopifyLiquid::Object.plus_labels
|
112
113
|
shopify_plus_objects.freeze
|
113
114
|
|
115
|
+
theme_app_extension_objects = ThemeCheck::ShopifyLiquid::Object.theme_app_extension_labels
|
116
|
+
theme_app_extension_objects.freeze
|
117
|
+
|
114
118
|
each_template do |(name, info)|
|
115
119
|
if 'templates/customers/reset_password' == name
|
116
120
|
# NOTE: `email` is exceptionally exposed as a theme object in
|
@@ -121,6 +125,8 @@ module ThemeCheck
|
|
121
125
|
# the checkout template
|
122
126
|
# https://shopify.dev/docs/themes/theme-templates/checkout-liquid#optional-objects
|
123
127
|
check_object(info, all_global_objects + shopify_plus_objects)
|
128
|
+
elsif config_type == :theme_app_extension
|
129
|
+
check_object(info, all_global_objects + theme_app_extension_objects)
|
124
130
|
else
|
125
131
|
check_object(info, all_global_objects)
|
126
132
|
end
|
@@ -129,6 +135,8 @@ module ThemeCheck
|
|
129
135
|
|
130
136
|
private
|
131
137
|
|
138
|
+
attr_reader :config_type
|
139
|
+
|
132
140
|
def ignore?(node)
|
133
141
|
@exclude_snippets && node.theme_file.snippet?
|
134
142
|
end
|
data/lib/theme_check/config.rb
CHANGED
@@ -13,6 +13,10 @@ module ThemeCheck
|
|
13
13
|
def plus_labels
|
14
14
|
@plus_labels ||= YAML.load(File.read("#{__dir__}/../../../data/shopify_liquid/plus_objects.yml"))
|
15
15
|
end
|
16
|
+
|
17
|
+
def theme_app_extension_labels
|
18
|
+
@theme_app_extension_labels ||= YAML.load(File.read("#{__dir__}/../../../data/shopify_liquid/theme_app_extension_objects.yml"))
|
19
|
+
end
|
16
20
|
end
|
17
21
|
end
|
18
22
|
end
|
data/lib/theme_check/tags.rb
CHANGED
@@ -125,7 +125,23 @@ module ThemeCheck
|
|
125
125
|
end
|
126
126
|
|
127
127
|
class Render < Liquid::Tag
|
128
|
-
SYNTAX =
|
128
|
+
SYNTAX = %r{
|
129
|
+
(
|
130
|
+
## for {% render "snippet" %}
|
131
|
+
#{Liquid::QuotedString}+ |
|
132
|
+
## for {% render block %}
|
133
|
+
## We require the variable # segment to be at the beginning of the
|
134
|
+
## string (with \A). This is to prevent code like {% render !foo! %}
|
135
|
+
## from parsing
|
136
|
+
\A#{Liquid::VariableSegment}+
|
137
|
+
)
|
138
|
+
## for {% render "snippet" with product as p %}
|
139
|
+
## or {% render "snippet" for products p %}
|
140
|
+
(\s+(with|#{Liquid::Render::FOR})\s+(#{Liquid::QuotedFragment}+))?
|
141
|
+
(\s+(?:as)\s+(#{Liquid::VariableSegment}+))?
|
142
|
+
## variables passed into the tag (e.g. {% render "snippet", var1: value1, var2: value2 %}
|
143
|
+
## are not matched by this regex and are handled by Liquid::Render.initialize
|
144
|
+
}xo
|
129
145
|
|
130
146
|
disable_tags "include"
|
131
147
|
|
data/lib/theme_check/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: theme-check
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.10.
|
4
|
+
version: 1.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc-André Cournoyer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: liquid
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- data/shopify_liquid/objects.yml
|
85
85
|
- data/shopify_liquid/plus_objects.yml
|
86
86
|
- data/shopify_liquid/tags.yml
|
87
|
+
- data/shopify_liquid/theme_app_extension_objects.yml
|
87
88
|
- data/shopify_translation_keys.yml
|
88
89
|
- dev.yml
|
89
90
|
- docs/api/check.md
|
@@ -300,7 +301,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
301
|
- !ruby/object:Gem::Version
|
301
302
|
version: '0'
|
302
303
|
requirements: []
|
303
|
-
rubygems_version: 3.
|
304
|
+
rubygems_version: 3.3.3
|
304
305
|
signing_key:
|
305
306
|
specification_version: 4
|
306
307
|
summary: A Shopify Theme Linter
|