@platformos/platformos-check-docs-updater 0.0.7 → 0.0.9

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.
Files changed (37) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/data/manifest_platformos.json +5 -0
  3. package/data/platformos_system_translations.json +3 -0
  4. package/dist/index.d.ts +2 -2
  5. package/dist/index.js +8 -8
  6. package/dist/index.js.map +1 -1
  7. package/dist/platformOSLiquidDocsDownloader.d.ts +14 -0
  8. package/dist/platformOSLiquidDocsDownloader.js +100 -0
  9. package/dist/platformOSLiquidDocsDownloader.js.map +1 -0
  10. package/dist/platformOSLiquidDocsManager.d.ts +26 -0
  11. package/dist/platformOSLiquidDocsManager.js +139 -0
  12. package/dist/platformOSLiquidDocsManager.js.map +1 -0
  13. package/dist/themeLiquidDocsDownloader.js +2 -1
  14. package/dist/themeLiquidDocsDownloader.js.map +1 -1
  15. package/dist/tsconfig.tsbuildinfo +1 -1
  16. package/package.json +3 -3
  17. package/scripts/cli.js +2 -2
  18. package/src/index.ts +3 -3
  19. package/src/platformOSLiquidDocsDownloader.ts +118 -0
  20. package/src/{themeLiquidDocsManager.spec.ts → platformOSLiquidDocsManager.spec.ts} +11 -24
  21. package/src/{themeLiquidDocsManager.ts → platformOSLiquidDocsManager.ts} +11 -84
  22. package/data/app_block_entry.json +0 -13
  23. package/data/default_setting_values.json +0 -24
  24. package/data/local_block_entry.json +0 -25
  25. package/data/manifest_theme.json +0 -19
  26. package/data/manifest_theme_app_extension.json +0 -10
  27. package/data/preset.json +0 -72
  28. package/data/preset_blocks.json +0 -91
  29. package/data/section.json +0 -208
  30. package/data/setting.json +0 -1368
  31. package/data/settings.json +0 -10
  32. package/data/shopify_system_translations.json +0 -2461
  33. package/data/targetted_block_entry.json +0 -15
  34. package/data/theme_block.json +0 -91
  35. package/data/theme_block_entry.json +0 -14
  36. package/data/theme_settings.json +0 -83
  37. package/src/themeLiquidDocsDownloader.ts +0 -191
@@ -1,34 +1,25 @@
1
1
  import {
2
2
  FilterEntry,
3
3
  JsonValidationSet,
4
- Mode,
5
4
  ObjectEntry,
6
5
  SchemaDefinition,
7
6
  TagEntry,
8
- ThemeDocset,
9
- Translations,
7
+ PlatformOSDocset,
10
8
  } from '@platformos/platformos-check-common';
11
9
  import fs from 'node:fs/promises';
12
10
  import path from 'node:path';
13
11
  import {
14
- Manifests,
15
12
  Resource,
16
- ThemeCustomSchemas,
17
- ThemeLiquidDocsRoot,
18
- ThemeLiquidDocsRootFallback,
19
13
  downloadResource,
20
- downloadThemeLiquidDocs,
14
+ downloadPlatformOSLiquidDocs,
21
15
  exists,
22
16
  graphQLPath,
23
17
  resourcePath,
24
18
  root,
25
- schemaPath,
26
- } from './themeLiquidDocsDownloader';
27
- import { Logger, identity, memo, memoize, noop, tap } from './utils';
19
+ } from './platformOSLiquidDocsDownloader';
20
+ import { Logger, memo, noop, tap } from './utils';
28
21
 
29
- type JSONSchemaManifest = { schemas: { uri: string; fileMatch?: string[] }[] };
30
-
31
- export class ThemeLiquidDocsManager implements ThemeDocset, JsonValidationSet {
22
+ export class PlatformOSLiquidDocsManager implements PlatformOSDocset, JsonValidationSet {
32
23
  constructor(private log: Logger = noop) {}
33
24
 
34
25
  filters = memo(async (): Promise<FilterEntry[]> => {
@@ -48,54 +39,15 @@ export class ThemeLiquidDocsManager implements ThemeDocset, JsonValidationSet {
48
39
  });
49
40
 
50
41
  graphQL = memo(async (): Promise<string | null> => {
51
- return findSuitableResource(this.graphQLLoaders(), (x: string) => x, null, this.log);
42
+ return findSuitableResource(this.graphqlLoaders(), (x: string) => x, null, this.log);
52
43
  });
53
44
 
54
- systemTranslations = memo(async (): Promise<Translations> => {
55
- return findSuitableResource(
56
- this.loaders('shopify_system_translations'),
57
- JSON.parse,
58
- {},
59
- this.log,
60
- );
61
- });
62
-
63
- schemas = memoize(
64
- (mode: Mode) =>
65
- findSuitableResource<JSONSchemaManifest>(
66
- this.loaders(Manifests[mode]),
67
- JSON.parse,
68
- {
69
- schemas: [],
70
- },
71
- this.log,
72
- ).then((manifest) => {
73
- return Promise.all(
74
- manifest.schemas.map(async (schemaDefinition): Promise<SchemaDefinition> => {
75
- let schemaRoot = `${ThemeLiquidDocsRootFallback}/schemas`;
76
-
77
- if (ThemeCustomSchemas.includes(schemaDefinition.uri)) {
78
- schemaRoot = ThemeLiquidDocsRoot;
79
- }
80
- return {
81
- uri: `${schemaRoot}/${schemaDefinition.uri}`,
82
- fileMatch: schemaDefinition.fileMatch,
83
- schema: await findSuitableResource(
84
- this.schemaLoaders(schemaDefinition.uri),
85
- identity,
86
- '',
87
- this.log,
88
- ),
89
- };
90
- }),
91
- );
92
- }),
93
- identity<Mode>,
94
- );
45
+ // platformOS does not use JSON schemas for sections/blocks/settings.
46
+ schemas = memo(async (): Promise<SchemaDefinition[]> => []);
95
47
 
96
48
  /**
97
49
  * The setup method checks that the latest revision matches the one from
98
- * Shopify/theme-liquid-docs. If there's a diff in revision, it means
50
+ * the platformOS liquid docs. If there's a diff in revision, it means
99
51
  * that the documentations that you have locally are out of date.
100
52
  *
101
53
  * The setup method then downloads the other files.
@@ -110,7 +62,7 @@ export class ThemeLiquidDocsManager implements ThemeDocset, JsonValidationSet {
110
62
  await downloadResource('latest', root, this.log);
111
63
  const remote = await this.latestRevision();
112
64
  if (local !== remote) {
113
- await downloadThemeLiquidDocs(root, this.log);
65
+ await downloadPlatformOSLiquidDocs(root, this.log);
114
66
  }
115
67
  } catch (error) {
116
68
  if (error instanceof Error) {
@@ -141,12 +93,6 @@ export class ThemeLiquidDocsManager implements ThemeDocset, JsonValidationSet {
141
93
  return fs.readFile(resourcePath(name), 'utf8');
142
94
  }
143
95
 
144
- private async loadSchema(relativeUri: string) {
145
- return fs
146
- .readFile(schemaPath(relativeUri), 'utf8')
147
- .then(tap(() => this.log(`Loaded schema from ${schemaPath(relativeUri)}`)));
148
- }
149
-
150
96
  private async loadGraphQL() {
151
97
  return fs.readFile(graphQLPath(), 'utf8').then(tap(() => this.log(`Loaded graphQL`)));
152
98
  }
@@ -158,14 +104,7 @@ export class ThemeLiquidDocsManager implements ThemeDocset, JsonValidationSet {
158
104
  ];
159
105
  }
160
106
 
161
- private schemaLoaders(relativeUri: string): Loader<string>[] {
162
- return [
163
- loader(() => this.loadSchema(relativeUri), `loadSchema(${relativeUri})`),
164
- loader(() => fallbackSchema(relativeUri, this.log), `fallbackSchema(${relativeUri})`),
165
- ];
166
- }
167
-
168
- private graphQLLoaders(): Loader<string>[] {
107
+ private graphqlLoaders(): Loader<string>[] {
169
108
  return [
170
109
  loader(() => this.loadGraphQL(), `loadGraphQL()`),
171
110
  loader(() => fallbackGraphQL(this.log), `fallbackSchema()`),
@@ -235,18 +174,6 @@ async function fallbackResource(name: Resource, log: Logger): Promise<string> {
235
174
  .then(tap(() => log(`Loaded fallback resource\n\t${name} from\n\t${sourcePath}`)));
236
175
  }
237
176
 
238
- /** Returns the at-build-time path to the fallback schema file. */
239
- async function fallbackSchema(
240
- /** e.g. themes/section.json */
241
- relativeUri: string,
242
- log: Logger,
243
- ): Promise<string> {
244
- const sourcePath = path.resolve(dataRoot(), path.basename(relativeUri));
245
- return fs
246
- .readFile(sourcePath, 'utf8')
247
- .then(tap(() => log(`Loaded fallback schema\n\t${relativeUri} from\n\t${sourcePath}`)));
248
- }
249
-
250
177
  async function fallbackGraphQL(log: Logger): Promise<string> {
251
178
  const sourcePath = path.resolve(dataRoot(), `graphql.graphql`);
252
179
  return fs
@@ -1,13 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$comment": "An @app block entry",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "properties": {
7
- "type": {
8
- "const": "@app",
9
- "description": "The \"@app\" type is used to denote that this container accepts app blocks. App blocks enable app developers to create blocks for merchants to add app content to their theme without having to directly edit theme code.",
10
- "markdownDescription": "The `@app` type is used to denote that this container accepts app blocks. [App blocks](/docs/themes/architecture/sections/app-blocks) enable app developers to create blocks for merchants to add app content to their theme without having to directly edit theme code.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/blocks/app-blocks#supporting-app-blocks)"
11
- }
12
- }
13
- }
@@ -1,24 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "type": "object",
4
- "description": "A list of default values for any settings that you might want to populate. Each entry should include the setting name and the value.",
5
- "additionalProperties": {
6
- "anyOf": [
7
- {
8
- "type": "number"
9
- },
10
- {
11
- "type": "boolean"
12
- },
13
- {
14
- "type": "string"
15
- },
16
- {
17
- "type": "array",
18
- "items": {
19
- "type": "string"
20
- }
21
- }
22
- ]
23
- }
24
- }
@@ -1,25 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "$comment": "For block definitions that are local to the file.",
4
- "type": "object",
5
- "required": ["type", "name"],
6
- "additionalProperties": false,
7
- "properties": {
8
- "type": {
9
- "type": "string",
10
- "description": "The block type. This is a free-form string that you can use as an identifier.",
11
- "markdownDescription": "The block type. This is a free-form string that you can use as an identifier.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#blocks)"
12
- },
13
- "name": {
14
- "type": "string",
15
- "description": "The block name, which will show as the block title in the theme editor."
16
- },
17
- "limit": {
18
- "type": "integer",
19
- "description": "The number of blocks of this type that can be used."
20
- },
21
- "settings": {
22
- "$ref": "./settings.json"
23
- }
24
- }
25
- }
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "manifest_schema.json",
3
- "$comment": "Declares all the JSON schemas you need to validate themes",
4
- "schemas": [
5
- { "fileMatch": ["locales/*.json"], "uri": "theme/translations.json" },
6
- { "fileMatch": ["blocks/*.liquid"], "uri": "theme/theme_block.json" },
7
- { "fileMatch": ["config/settings_schema.json"], "uri": "theme/theme_settings.json" },
8
- { "fileMatch": ["sections/*.liquid"], "uri": "theme/section.json" },
9
- { "uri": "theme/settings.json" },
10
- { "uri": "theme/setting.json" },
11
- { "uri": "theme/default_setting_values.json" },
12
- { "uri": "theme/app_block_entry.json" },
13
- { "uri": "theme/theme_block_entry.json" },
14
- { "uri": "theme/targetted_block_entry.json" },
15
- { "uri": "theme/preset_blocks.json" },
16
- { "uri": "theme/preset.json" },
17
- { "uri": "theme/local_block_entry.json" }
18
- ]
19
- }
@@ -1,10 +0,0 @@
1
- {
2
- "$schema": "manifest_schema.json",
3
- "$comment": "Declares all the JSON schemas you need to validate themes",
4
- "schemas": [
5
- {
6
- "uri": "theme/translations.json",
7
- "fileMatch": ["locales/*.json"]
8
- }
9
- ]
10
- }
package/data/preset.json DELETED
@@ -1,72 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Shopify Liquid Section or Block Preset Schema",
4
- "oneOf": [
5
- {
6
- "$ref": "#/definitions/presetWithBlocksArray"
7
- },
8
- {
9
- "$ref": "#/definitions/presetWithBlocksHash"
10
- }
11
- ],
12
- "definitions": {
13
- "presetBase": {
14
- "type": "object",
15
- "required": ["name"],
16
- "properties": {
17
- "name": {
18
- "type": "string",
19
- "description": "The preset name, which will show in the 'Add section' or 'Add block' picker of the theme editor.",
20
- "markdownDescription": "The preset name, which will show in the 'Add section' or 'Add block' picker of the theme editor.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#presets)"
21
- },
22
- "category": {
23
- "type": "string",
24
- "description": "The category of the preset, which will show in the 'Add section' or 'Add block' picker of the theme editor.",
25
- "markdownDescription": "The category of the preset, which will show in the 'Add section' or 'Add block' picker of the theme editor.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#presets)"
26
- },
27
- "settings": {
28
- "$ref": "./default_setting_values.json"
29
- }
30
- }
31
- },
32
- "presetWithBlocksArray": {
33
- "type": "object",
34
- "allOf": [
35
- {
36
- "$ref": "#/definitions/presetBase"
37
- }
38
- ],
39
- "properties": {
40
- "name": true,
41
- "category": true,
42
- "settings": true,
43
- "blocks": {
44
- "$ref": "./preset_blocks.json#/definitions/blocksArray"
45
- }
46
- },
47
- "additionalProperties": false
48
- },
49
- "presetWithBlocksHash": {
50
- "type": "object",
51
- "allOf": [
52
- {
53
- "$ref": "#/definitions/presetBase"
54
- }
55
- ],
56
- "required": ["blocks"],
57
- "properties": {
58
- "name": true,
59
- "settings": true,
60
- "blocks": {
61
- "$ref": "./preset_blocks.json#/definitions/blocksHash"
62
- },
63
- "block_order": {
64
- "type": "array",
65
- "description": "The order of blocks in the preset.",
66
- "markdownDescription": "The order of blocks in the preset."
67
- },
68
- "additionalProperties": false
69
- }
70
- }
71
- }
72
- }
@@ -1,91 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Shopify Liquid Preset Blocks Schema",
4
- "definitions": {
5
- "blocksArray": {
6
- "type": "array",
7
- "description": "A list of child blocks that you might want to include.",
8
- "markdownDescription": "A list of child blocks that you might want to include.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#presets)",
9
- "items": {
10
- "type": "object",
11
- "allOf": [
12
- {
13
- "$ref": "#/definitions/commonBlockAttributes"
14
- }
15
- ],
16
- "properties": {
17
- "static": true,
18
- "type": true,
19
- "name": true,
20
- "settings": true,
21
- "blocks": {
22
- "$ref": "#/definitions/blocksArray"
23
- },
24
- "id": {
25
- "type": "string",
26
- "description": "A unique identifier for the block."
27
- }
28
- },
29
- "additionalProperties": false,
30
- "if": {
31
- "properties": {
32
- "static": {
33
- "const": true
34
- }
35
- },
36
- "required": ["static"]
37
- },
38
- "then": {
39
- "required": ["id"]
40
- }
41
- }
42
- },
43
- "blocksHash": {
44
- "type": "object",
45
- "description": "A list of child blocks that you might want to include.",
46
- "markdownDescription": "A list of child blocks that you might want to include.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#presets)",
47
- "additionalProperties": {
48
- "allOf": [
49
- {
50
- "$ref": "#/definitions/commonBlockAttributes"
51
- }
52
- ],
53
- "properties": {
54
- "static": true,
55
- "type": true,
56
- "name": true,
57
- "settings": true,
58
- "blocks": {
59
- "$ref": "#/definitions/blocksHash"
60
- },
61
- "block_order": {
62
- "type": "array",
63
- "description": "The order of the blocks in the section."
64
- }
65
- },
66
- "additionalProperties": false
67
- }
68
- },
69
- "commonBlockAttributes": {
70
- "type": "object",
71
- "required": ["type"],
72
- "properties": {
73
- "type": {
74
- "type": "string",
75
- "description": "The block type."
76
- },
77
- "name": {
78
- "type": "string",
79
- "description": "The block name."
80
- },
81
- "settings": {
82
- "$ref": "./default_setting_values.json"
83
- },
84
- "static": {
85
- "type": "boolean",
86
- "description": "If the block is rendered statically or not."
87
- }
88
- }
89
- }
90
- }
91
- }
package/data/section.json DELETED
@@ -1,208 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/draft-07/schema#",
3
- "title": "Shopify Liquid Theme Section Schema",
4
- "type": "object",
5
- "additionalProperties": false,
6
- "properties": {
7
- "name": {
8
- "type": "string",
9
- "description": "The name attribute determines the section title that is shown in the theme editor.",
10
- "markdownDescription": "The `name` attribute determines the section title that is shown in the theme editor.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#name)"
11
- },
12
-
13
- "tag": {
14
- "type": "string",
15
- "description": "The HTML element that is used to wrap the section.",
16
- "markdownDescription": "The HTML element that is used to wrap the section.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#tag)",
17
- "enum": ["article", "aside", "div", "footer", "header", "section"]
18
- },
19
-
20
- "class": {
21
- "type": "string",
22
- "description": "Additional CSS class for the section.",
23
- "markdownDescription": "Additional CSS class for the section.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#class)"
24
- },
25
-
26
- "limit": {
27
- "type": "integer",
28
- "description": "The number of times a section can be added to a template or section group.",
29
- "markdownDescription": "The number of times a section can be added to a template or section group.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#limit)",
30
- "minimum": 1,
31
- "maximum": 2
32
- },
33
-
34
- "settings": {
35
- "$ref": "./settings.json"
36
- },
37
-
38
- "max_blocks": {
39
- "type": "integer",
40
- "description": "There's a limit of 50 blocks per section. You can specify a lower limit with the max_blocks attribute",
41
- "markdownDescription": "There's a limit of 50 blocks per section. You can specify a lower limit with the `max_blocks` attribute.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#max_blocks)",
42
- "minimum": 1,
43
- "maximum": 50
44
- },
45
-
46
- "blocks": {
47
- "type": "array",
48
- "description": "Blocks are reusable modules of content that can be added, removed, and reordered within a section.",
49
- "markdownDescription": "Blocks are reusable modules of content that can be added, removed, and reordered within a section.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#blocks)",
50
- "properties": {
51
- "type": {
52
- "description": "The block type. Can be one of the following values: @theme, @app, or a custom block type.",
53
- "markdownDescription": "The block type. Can be one of the following values: @theme, @app, or a custom block type.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#blocks)"
54
- }
55
- },
56
- "items": {
57
- "type": "object",
58
- "required": ["type"],
59
- "properties": {
60
- "type": {
61
- "type": "string",
62
- "description": "The type of block that can be added to this block.",
63
- "markdownDescription": "The type of block that can be added to this block.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/blocks/theme-blocks/schema#blocks)"
64
- }
65
- },
66
- "$comment": "The allOf rule here exists because that's how we do discriminated unions in JSON schemas. If a rule matches, that rule will be used to document the type property. Otherwise we fallback to the docs above.",
67
- "allOf": [
68
- {
69
- "if": { "required": ["type"], "properties": { "type": { "const": "@theme" } } },
70
- "then": { "$ref": "./theme_block_entry.json" }
71
- },
72
- {
73
- "if": { "required": ["type"], "properties": { "type": { "const": "@app" } } },
74
- "then": { "$ref": "./app_block_entry.json" }
75
- },
76
- {
77
- "if": {
78
- "required": ["type"],
79
- "properties": {
80
- "type": {
81
- "type": "string",
82
- "not": { "enum": ["@app", "@theme"] }
83
- }
84
- }
85
- },
86
- "then": {
87
- "oneOf": [
88
- { "$ref": "./targetted_block_entry.json" },
89
- { "$ref": "./local_block_entry.json" }
90
- ]
91
- }
92
- }
93
- ]
94
- }
95
- },
96
-
97
- "presets": {
98
- "type": "array",
99
- "description": "Presets are default configurations of sections that enable users to easily add a section to a JSON template through the theme editor.",
100
- "markdownDescription": "Presets are default configurations of sections that enable users to easily add a section to a [JSON template](https://shopify.dev/docs/themes/architecture/templates/json-templates) through the theme editor.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#presets)",
101
- "items": {
102
- "$ref": "./preset.json"
103
- }
104
- },
105
-
106
- "default": {
107
- "type": "object",
108
- "description": "Default configuration for statically rendered sections.",
109
- "markdownDescription": "Default configuration for statically rendered sections.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#default)",
110
- "properties": {
111
- "settings": {
112
- "$ref": "./default_setting_values.json"
113
- },
114
- "blocks": {
115
- "type": "array",
116
- "description": "Default blocks configurations to ship with this default.",
117
- "markdownDescription": "Default blocks configurations to ship with this default.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#default)",
118
- "items": {
119
- "type": "object",
120
- "required": ["type"],
121
- "properties": {
122
- "type": {
123
- "type": "string",
124
- "description": "The block type."
125
- },
126
- "settings": {
127
- "$ref": "./default_setting_values.json"
128
- }
129
- }
130
- }
131
- }
132
- }
133
- },
134
-
135
- "locales": {
136
- "type": "object",
137
- "description": "Sections can provide their own set of translated strings through the locales object. This is separate from the locales directory of the theme, which makes it a useful feature for sections that are meant to be installed on multiple themes or shops.",
138
- "markdownDescription": "Sections can provide their own set of translated strings through the `locales` object. This is separate from the `locales` directory of the theme, which makes it a useful feature for sections that are meant to be installed on multiple themes or shops.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#locales)",
139
- "additionalProperties": {
140
- "type": "object",
141
- "additionalProperties": {
142
- "type": "string"
143
- }
144
- }
145
- },
146
-
147
- "enabled_on": {
148
- "description": "Restrict the section to certain template page types and section group types.",
149
- "markdownDescription": "Restrict the section to certain template page types and section group types.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#enabled_on)",
150
- "$ref": "#/definitions/sectionToggle"
151
- },
152
-
153
- "disabled_on": {
154
- "description": "Prevent the section from being used on certain template page types and section group types.",
155
- "markdownDescription": "Prevent the section from being used on certain template page types and section group types.\n\n---\n\n[Shopify reference](https://shopify.dev/docs/themes/architecture/sections/section-schema#disabled_on)",
156
- "$ref": "#/definitions/sectionToggle"
157
- }
158
- },
159
-
160
- "definitions": {
161
- "sectionToggle": {
162
- "type": "object",
163
- "description": "Restrict the section to certain template page types and section group types.",
164
- "additionalProperties": false,
165
- "properties": {
166
- "templates": {
167
- "type": "array",
168
- "items": {
169
- "type": "string",
170
- "enum": [
171
- "*",
172
- "404",
173
- "article",
174
- "blog",
175
- "captcha",
176
- "cart",
177
- "collection",
178
- "customers/account",
179
- "customers/activate_account",
180
- "customers/addresses",
181
- "customers/login",
182
- "customers/order",
183
- "customers/register",
184
- "customers/reset_password",
185
- "gift_card",
186
- "index",
187
- "list-collections",
188
- "metaobject",
189
- "page",
190
- "password",
191
- "policy",
192
- "product",
193
- "search"
194
- ]
195
- },
196
- "uniqueItems": true
197
- },
198
- "groups": {
199
- "type": "array",
200
- "items": {
201
- "type": "string"
202
- },
203
- "uniqueItems": true
204
- }
205
- }
206
- }
207
- }
208
- }