@augeo/smelt 1.2.2
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.
- package/.claude/settings.json +11 -0
- package/.github/workflows/verify.yml +64 -0
- package/.gitmodules +3 -0
- package/.prettierignore +25 -0
- package/.prettierrc.cjs +9 -0
- package/.zed/settings.json +21 -0
- package/AGENTS.md +232 -0
- package/LICENSE +21 -0
- package/README.md +266 -0
- package/biome.json +58 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +350 -0
- package/dist/schema.d.mts +265 -0
- package/dist/schema.mjs +21 -0
- package/docs/TESTING.md +293 -0
- package/docs/assets-plan.md +197 -0
- package/docs/build-spec.md +466 -0
- package/docs/library-conversion-plan.md +419 -0
- package/example/.gitattributes +7 -0
- package/example/.shopifyignore +28 -0
- package/example/.theme-check.yml +7 -0
- package/example/blocks/_built--sections--hero--blocks--feature.liquid +52 -0
- package/example/config/settings_schema.json +10 -0
- package/example/layout/theme.liquid +25 -0
- package/example/locales/en.default.json +1 -0
- package/example/package-lock.json +51 -0
- package/example/package.json +20 -0
- package/example/sections/built--sections--hero.liquid +83 -0
- package/example/snippets/built--components--button.liquid +38 -0
- package/example/snippets/built--components--card.liquid +33 -0
- package/example/src/components/button/button.css +13 -0
- package/example/src/components/card/card.css +16 -0
- package/example/src/components/card/card.liquid +9 -0
- package/example/src/sections/hero/blocks/feature/feature.css +11 -0
- package/example/src/sections/hero/blocks/feature/feature.liquid +9 -0
- package/example/src/sections/hero/blocks/feature/feature.schema.ts +14 -0
- package/example/src/sections/hero/hero.css +15 -0
- package/example/src/sections/hero/hero.liquid +16 -0
- package/example/src/sections/hero/hero.schema.ts +26 -0
- package/example/src/sections/hero/hero.test.ts +43 -0
- package/example/src/utilities/labels.ts +5 -0
- package/example/templates/index.liquid +1 -0
- package/example/tsconfig.json +10 -0
- package/example/vitest.config.ts +6 -0
- package/lib/build/build.test.ts +475 -0
- package/lib/build/build.ts +314 -0
- package/lib/build/command.ts +27 -0
- package/lib/build/index.ts +1 -0
- package/lib/cli.ts +17 -0
- package/lib/dev/command.ts +25 -0
- package/lib/dev/index.ts +1 -0
- package/lib/dev/watch.ts +52 -0
- package/lib/resolver.test.ts +275 -0
- package/lib/resolver.ts +156 -0
- package/lib/schema.ts +37 -0
- package/package.json +59 -0
- package/scripts/codegen-schema.ts +66 -0
- package/src/components/button/button.css +13 -0
- package/src/components/button/button.liquid +5 -0
- package/src/components/button/button.ts +5 -0
- package/src/tsconfig.json +10 -0
- package/tests/example.test.ts +101 -0
- package/tsconfig.json +20 -0
- package/tsdown.config.ts +14 -0
- package/vendor/theme-liquid-docs/.gitattributes +10 -0
- package/vendor/theme-liquid-docs/.github/CODEOWNERS +1 -0
- package/vendor/theme-liquid-docs/.github/CODE_OF_CONDUCT.md +73 -0
- package/vendor/theme-liquid-docs/.github/ISSUE_TEMPLATE/bug_report.md +17 -0
- package/vendor/theme-liquid-docs/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
- package/vendor/theme-liquid-docs/.github/dependabot.yaml +6 -0
- package/vendor/theme-liquid-docs/.github/workflows/ci.yml +33 -0
- package/vendor/theme-liquid-docs/.github/workflows/cla.yml +27 -0
- package/vendor/theme-liquid-docs/.github/workflows/shopify-dev-preview-automation.yml +86 -0
- package/vendor/theme-liquid-docs/.github/workflows/update-latest.yml +56 -0
- package/vendor/theme-liquid-docs/.prettierrc.json +16 -0
- package/vendor/theme-liquid-docs/.vscode/settings.json +28 -0
- package/vendor/theme-liquid-docs/LICENSE.md +7 -0
- package/vendor/theme-liquid-docs/README.md +48 -0
- package/vendor/theme-liquid-docs/ai/claude/CLAUDE.md +1485 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/assets.mdc +15 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/blocks.mdc +339 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/examples/block-example-group.mdc +103 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/examples/block-example-text.mdc +59 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/examples/section-example.mdc +61 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/examples/snippet-example.mdc +72 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/liquid.mdc +837 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/locales.mdc +100 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/localization.mdc +67 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/mcp.mdc +2 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/schemas.mdc +184 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/sections.mdc +84 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/settings-schema.mdc +51 -0
- package/vendor/theme-liquid-docs/ai/cursor/rules/snippets.mdc +119 -0
- package/vendor/theme-liquid-docs/ai/github/copilot-instructions.md +1485 -0
- package/vendor/theme-liquid-docs/ai/liquid.mdc +638 -0
- package/vendor/theme-liquid-docs/data/filters.json +6148 -0
- package/vendor/theme-liquid-docs/data/latest.json +2 -0
- package/vendor/theme-liquid-docs/data/objects.json +20594 -0
- package/vendor/theme-liquid-docs/data/shopify_system_translations.json +2586 -0
- package/vendor/theme-liquid-docs/data/tags.json +1276 -0
- package/vendor/theme-liquid-docs/package.json +20 -0
- package/vendor/theme-liquid-docs/schemas/manifest_schema.json +31 -0
- package/vendor/theme-liquid-docs/schemas/manifest_theme.json +19 -0
- package/vendor/theme-liquid-docs/schemas/manifest_theme_app_extension.json +10 -0
- package/vendor/theme-liquid-docs/schemas/theme/app_block_entry.json +13 -0
- package/vendor/theme-liquid-docs/schemas/theme/default_setting_values.json +24 -0
- package/vendor/theme-liquid-docs/schemas/theme/local_block_entry.json +25 -0
- package/vendor/theme-liquid-docs/schemas/theme/preset.json +72 -0
- package/vendor/theme-liquid-docs/schemas/theme/preset_blocks.json +91 -0
- package/vendor/theme-liquid-docs/schemas/theme/section.json +208 -0
- package/vendor/theme-liquid-docs/schemas/theme/setting.json +1413 -0
- package/vendor/theme-liquid-docs/schemas/theme/settings.json +10 -0
- package/vendor/theme-liquid-docs/schemas/theme/targetted_block_entry.json +15 -0
- package/vendor/theme-liquid-docs/schemas/theme/theme_block.json +91 -0
- package/vendor/theme-liquid-docs/schemas/theme/theme_block_entry.json +14 -0
- package/vendor/theme-liquid-docs/schemas/theme/theme_settings.json +83 -0
- package/vendor/theme-liquid-docs/schemas/theme/translations.json +63 -0
- package/vendor/theme-liquid-docs/schemas/update/update_extension_schema_v1.json +186 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-nested-blocks.json +18 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-schema-1.json +90 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-schema-2.json +201 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-schema-3.json +29 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-schema-4.json +315 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-schema-5.json +114 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-schema-6.json +63 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-schema-conditional-settings.json +145 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-schema-preset-blocks-as-hash.json +60 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-schema-static-block-preset.json +76 -0
- package/vendor/theme-liquid-docs/tests/fixtures/section-settings.json +34 -0
- package/vendor/theme-liquid-docs/tests/fixtures/theme-block-1.json +234 -0
- package/vendor/theme-liquid-docs/tests/fixtures/theme-block-2.json +253 -0
- package/vendor/theme-liquid-docs/tests/fixtures/theme-block-basics.json +48 -0
- package/vendor/theme-liquid-docs/tests/fixtures/theme-block-conditional-settings.json +202 -0
- package/vendor/theme-liquid-docs/tests/fixtures/theme-block-presets-as-hash.json +50 -0
- package/vendor/theme-liquid-docs/tests/fixtures/theme-block-settings.json +34 -0
- package/vendor/theme-liquid-docs/tests/fixtures/theme-settings-all-settings.json +313 -0
- package/vendor/theme-liquid-docs/tests/fixtures/theme-settings-dawn.json +1469 -0
- package/vendor/theme-liquid-docs/tests/fixtures/theme-settings-metadata.json +10 -0
- package/vendor/theme-liquid-docs/tests/fixtures/translations-1.json +14 -0
- package/vendor/theme-liquid-docs/tests/section.spec.ts +367 -0
- package/vendor/theme-liquid-docs/tests/test-constants.ts +58 -0
- package/vendor/theme-liquid-docs/tests/test-helpers.ts +104 -0
- package/vendor/theme-liquid-docs/tests/theme-settings/color_palette.spec.ts +184 -0
- package/vendor/theme-liquid-docs/tests/theme-settings/color_scheme_group.spec.ts +143 -0
- package/vendor/theme-liquid-docs/tests/theme-settings/general.spec.ts +192 -0
- package/vendor/theme-liquid-docs/tests/theme-settings/metaobject.spec.ts +94 -0
- package/vendor/theme-liquid-docs/tests/theme-settings/resource_list.spec.ts +58 -0
- package/vendor/theme-liquid-docs/tests/theme-settings/theme-metadata.spec.ts +59 -0
- package/vendor/theme-liquid-docs/tests/theme_block.spec.ts +266 -0
- package/vendor/theme-liquid-docs/tests/translations_schema.spec.ts +31 -0
- package/vendor/theme-liquid-docs/yarn.lock +543 -0
- package/vitest.config.ts +7 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@shopify/theme-liquid-docs",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"description": "Repository for sources of truth relating to Shopify theme liquid content.",
|
|
6
|
+
"repository": "https://github.com/Shopify/theme-liquid-docs",
|
|
7
|
+
"author": "Albert Chu <albert.chu@shopify.com>",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"format": "prettier --write \"schemas/theme/*.json\"",
|
|
11
|
+
"format:check": "prettier --check --ignore-unknown \"schemas/theme/*.json\"",
|
|
12
|
+
"test": "vitest"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"lodash.set": "^4.3.2",
|
|
16
|
+
"prettier": "^2.8.8",
|
|
17
|
+
"vitest": "^4.1.0",
|
|
18
|
+
"vscode-json-languageservice": "^5.3.10"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"schemas": {
|
|
6
|
+
"type": "array",
|
|
7
|
+
"items": {
|
|
8
|
+
"$ref": "#/definitions/SchemaDefinition"
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"definitions": {
|
|
13
|
+
"SchemaDefinition": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"properties": {
|
|
16
|
+
"uri": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"pattern": "^theme/"
|
|
19
|
+
},
|
|
20
|
+
"fileMatch": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
"required": ["uri"],
|
|
28
|
+
"additionalProperties": false
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
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
|
+
}
|