zid-theme
Version:
A CLI to process zid theme folder
152 lines (109 loc) ⢠3.48 kB
Markdown
# š¦ zid-theme
#### NPM package to validate and zip the theme folder to match zid custom themes' standards
<br />
<br />
<p align="center">
<a href="https://npmjs.org/package/zid-theme">
<img src="https://img.shields.io/npm/v/zid-theme">
</a>
</p>
<br />
<br />
<p align="center">
<a href="#" style="cursor: default;">
<img width="80%" src="https://camo.githubusercontent.com/15ad718c0d974a97796d5151dd654487f8dfdea5ff88f9f1805bc06144c894f5/68747470733a2f2f7765622e7a69642e73612f696d616765732f7a69645f66756c6c5f6c6f676f2e706e67">
</a>
</p>
<br />
<br />
# š Prerequisites:
- Node.js
- NPM (Node Package Manager)
<br />
<br />
# āļø Installation
This is a [Node.js](https://nodejs.org/en/) module available through the
[npm registry](https://www.npmjs.com/).
Before installing, [download and install Node.js](https://nodejs.org/en/download/).
Node.js is required.
If this is a brand new project, make sure to create a `package.json` first with
the [`npm init` command](https://docs.npmjs.com/creating-a-package-json-file).
or if yarn is used, with [`yarn init` command](https://yarnpkg.com/cli/init).
Installation is done using the
[`npm install` command](https://docs.npmjs.com/getting-started/installing-npm-packages-locally):
```bash
$ npm i -g zid-theme
```
Installation is done using the
[`yarn add` command](https://yarnpkg.com/cli/add):
```bash
$ yarn add global zid-theme
```
<br />
<br />
# š» Usage
The following structure is the valid theme SDK structure that has to be followed, othewise an error will be thrown. All the mentioned files and folders are required, and folders can be empty (Such as modules, locals, assets)
[See here for accepted assets extension](#assets-accepted-extensions)
<br />
```bash
$ root
.
ā
āāāā query.json
āāāā layout.twig
āāāā header.twig
āāāā footer.twig
ā
āāāā templates (accepted extensions: [ '.twig' ] )
ā āāāā 404.twig
ā āāāā home.twig
ā āāāā search.twig
ā āāāā products.twig
ā āāāā product.twig
ā āāāā categories.twig
ā āāāā category.twig
ā āāāā blogs.twig
ā āāāā blog.twig
ā āāāā faqs.twig
ā āāāā cart.twig
ā āāāā shipping-and-payments.twig
ā āāāā account-addresses.twig
ā āāāā account-orders.twig
ā āāāā account-profile.twig
ā
āāāā modules (accepted extensions: ['.twig'] )
ā
āāāā common (accepted extensions: ['.twig'] )
ā
āāāā locals (accepted extensions: ['.json'] )
ā
āāāā assets
```
### assets accepted extensions
```bash
['.js','.ts','.css','.scss','.map','.png','.jpg','.jpeg','.gif','.svg','.woff','.woff2','.otf','.ttf','.eot']
```
<br />
<br />
### ā”ļø build command
Running the build command only without arguments, will assume the current path is where the theme exist, and the theme zip will be named after the root directory name
```bash
$ zid-theme build
```
The following command takes two arguments `--path` and `--name`
### To set the path of the theme (default .):
```bash
$ zid-theme build --path ./theme_path
```
### To set the name of the theme (root folder name):
```bash
$ zid-theme build --name best-theme-ever
```
### Full command:
```bash
$ zid-theme build --name best-theme-ever --path .
```
<br />
<br />
# License
[MIT](LICENSE)