UNPKG

zid-theme

Version:

A CLI to process zid theme folder

152 lines (109 loc) • 3.48 kB
# šŸ“¦ 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)