theme-check 1.10.2 → 1.10.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c21a0e8261a92b4eff6c415ca4205bb9e5f0b91c48cd9f2e4f6fb6a14adfe69c
4
- data.tar.gz: 8dd16b772e87d56a174b9053c2fc4791457d79774b30e4b8813178224e8e7db2
3
+ metadata.gz: c2774c1d3e2e9b8fa7dab0fdd4174dbfd3e625c608af349c30f526f00a6b9123
4
+ data.tar.gz: 69bdb078be8aa938b2dec75a62206840586ae1a015620ec3c9ce727e49fc2e07
5
5
  SHA512:
6
- metadata.gz: 03ac611f090d34741494bad1c9dd199ae90716c7bf10c2a99c0ae6e28aa5456d53c342ac3888bf683d4cfecb37605595586d720393f220f695379b6c1d5e3186
7
- data.tar.gz: bc21703838ffa3606830505bfdc7d76b0fd675f402b7c062fe3ddd893ff62bb451fe57d44e77de8c6f99886546c0a261de9146d02833c81a10ec1c0c9e5ffc4e
6
+ metadata.gz: aa83efd1994e95fd12defc06b13567fac6e80fd830fb870f7a50b650424b8ed339848271ac35c608b6bc40a3e884665a3136c1f75e150be937be8b78e74df9fc
7
+ data.tar.gz: 848e2752ecc6e6bb4b0954663dac298f869a191d0b4b146fd488b8a9a442a5573a1c716c84658b2654431f96db1572309c70991a2e29e37c1bf82bd337c79edd
data/CHANGELOG.md CHANGED
@@ -1,4 +1,15 @@
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
+
2
13
  v1.10.2 / 2022-03-07
3
14
  ====================
4
15
 
data/config/default.yml CHANGED
@@ -101,6 +101,7 @@ UndefinedObject:
101
101
  enabled: true
102
102
  ignore: []
103
103
  exclude_snippets: true
104
+ config_type: :default
104
105
 
105
106
  RequiredDirectories:
106
107
  enabled: true
@@ -89,6 +89,7 @@ UndefinedObject:
89
89
  enabled: true
90
90
  ignore: []
91
91
  exclude_snippets: true
92
+ config_type: :theme_app_extension
92
93
 
93
94
  RequiredDirectories:
94
95
  enabled: false
@@ -0,0 +1,2 @@
1
+ ---
2
+ - app
data/docs/api/check.md CHANGED
@@ -12,4 +12,4 @@ There are three types of checks currently supported:
12
12
 
13
13
  - [`LiquidCheck`](/docs/api/liquid_check.md)
14
14
  - [`HtmlCheck`](/docs/api/html_check.md)
15
- - [`JsonCheck`](/docs/api/html_check.md)
15
+ - [`JsonCheck`](/docs/api/json_check.md)
@@ -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.developers/themes/tools/theme-check/configuration#check-severity) of the check. |
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.developers/themes/tools/theme-check/configuration#check-severity) of the check. |
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
 
@@ -48,6 +48,7 @@ module ThemeCheck
48
48
 
49
49
  def key_exists?(key, pointer)
50
50
  key.split(".").each do |token|
51
+ return false unless pointer.is_a?(Hash)
51
52
  return false unless pointer.key?(token)
52
53
  pointer = pointer[token]
53
54
  end
@@ -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
@@ -209,7 +209,8 @@ module ThemeCheck
209
209
 
210
210
  def resolve_requires
211
211
  self["require"]&.each do |path|
212
- require(File.join(@root, path))
212
+ file_to_require = @root.join(path).realpath
213
+ require(file_to_require.to_s)
213
214
  end
214
215
  end
215
216
  end
@@ -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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module ThemeCheck
3
- VERSION = "1.10.2"
3
+ VERSION = "1.10.3"
4
4
  end
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.2
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-03-07 00:00:00.000000000 Z
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.2.20
304
+ rubygems_version: 3.3.3
304
305
  signing_key:
305
306
  specification_version: 4
306
307
  summary: A Shopify Theme Linter