zid-theme
v1.1.6
Published
A CLI to process zid theme folder
Downloads
24
Readme
📦 zid-theme
NPM package to validate and zip the theme folder to match zid custom themes' standards
🔐 Prerequisites:
- Node.js
- NPM (Node Package Manager)
⚙️ Installation
This is a Node.js module available through the npm registry.
Before installing, download and install Node.js. Node.js is required.
If this is a brand new project, make sure to create a package.json
first with
the npm init
command.
or if yarn is used, with yarn init
command.
Installation is done using the
npm install
command:
$ npm i -g zid-theme
Installation is done using the
yarn add
command:
$ yarn add global zid-theme
💻 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
$ 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
['.js','.ts','.css','.scss','.map','.png','.jpg','.jpeg','.gif','.svg','.woff','.woff2','.otf','.ttf','.eot']
⚡️ 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
$ zid-theme build
The following command takes two arguments --path
and --name
To set the path of the theme (default .):
$ zid-theme build --path ./theme_path
To set the name of the theme (root folder name):
$ zid-theme build --name best-theme-ever
Full command:
$ zid-theme build --name best-theme-ever --path .