https://github.com/bkeys818/shopify-template-schema
A tool for converting Shopify schemas into a JSON schemas.
https://github.com/bkeys818/shopify-template-schema
json-schema json-schema-generator shopify shopify-theme
Last synced: 2 months ago
JSON representation
A tool for converting Shopify schemas into a JSON schemas.
- Host: GitHub
- URL: https://github.com/bkeys818/shopify-template-schema
- Owner: bkeys818
- Created: 2022-04-04T15:05:34.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2023-12-19T18:43:23.000Z (over 2 years ago)
- Last Synced: 2025-01-04T18:44:23.575Z (over 1 year ago)
- Topics: json-schema, json-schema-generator, shopify, shopify-theme
- Language: TypeScript
- Homepage:
- Size: 149 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Shopify Template Schema
> A tool for converting Shopify schemas into a JSON schema for templates.
[![Version][version-image]][version-link]
[![Downloads Stats][npm-downloads]][npm-link]
[![Run test][test-status]][test-link]
## Installation
Yarn:
```sh
yarn add shopify-template-schema
```
## Usage
Shopify template schema will only create a schema for your templates. It won't valid them.
If your using [Visual Studio Code](https://code.visualstudio.com) we recommend using the [json schema setting](https://code.visualstudio.com/Docs/languages/json#_json-schemas-and-settings), like this:
```json
{
"json.schemas": [
{
"fileMatch": ["templates/*.json"],
"url": "./template.schema.json"
},
{
"fileMatch": ["config/settings_schema.json"],
"url": "./config/settings_schema.schema.json"
},
{
"fileMatch": ["config/settings_data.json"],
"url": "./config/settings_data.schema.json"
},
{
"fileMatch": ["locales/*.json"],
"url": "./locale.schema.json"
}
]
}
```
## Running from command line
You can run `shopify-template-schema` directly from the CLI with a variety of options.
Here's how you would run it if the current directory isn't the a shopify project.
```sh
shopify-template-schema path/to/shopify-project
```
To view all options run:
```sh
shopify-template-schema -h
```
[version-image]: https://img.shields.io/github/package-json/v/bkeys818/shopify-template-schema/v0.1.1?label=version
[version-link]: https://github.com/bkeys818/shopify-template-schema/releases/tag/v0.1.1
[npm-downloads]: https://img.shields.io/npm/dm/shopify-template-schema.svg
[npm-link]: https://www.npmjs.com/package/shopify-template-schema/v/0.1.1
[test-status]: https://github.com/bkeys818/shopify-template-schema/actions/workflows/run-tests.yaml/badge.svg?branch=main
[test-link]: https://github.com/bkeys818/shopify-template-schema/actions/workflows/run-tests.yaml