
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
English | 简体中文
CAZ (Create App Zen)
It's a a simple template-based Scaffolding tools for my personal productivity, inspired by Yeoman & Vue CLI 2 & etc.
For more introduction, please refer to the How it works.
I'll give you specific reasons later.
# install it globally
$ npm install -g caz
# or yarn
$ yarn global add caz
Create new project from a template.
$ caz <template> [project] [-f|--force] [-o|--offline]
# caz with an official template
$ caz <template> [project]
# caz with a github repo
$ caz <owner>/<repo> [project]
If you only use it occasionally, I recommend that you use npx
to run caz
directly.
$ npx caz <template> [project] [-f|--force] [-o|--offline]
-f, --force
: Overwrite if the target exists-o, --offline
: Try to use an offline template$ caz nm my-project
The above command pulls the template from caz-templates/nm, then prompts for some information according to the configuration of this template, and generate the project at ./my-project
.
$ caz nm#typescript my-project
By running this command, CAZ will pulls the template from typescript
branch of caz-templates/nm.
$ caz zce/nm my-project
The above command pulls the template from zce/nm. This means that you can also pull templates from your public GitHub repository.
Public repository is necessary.
Instead of a GitHub repo, you can also use a template on your local file system.
e.g.
$ caz ~/local/template my-project
The above command use the template from ~/local/template
.
Instead of a GitHub repo, you can also use a template with a zip file uri.
e.g.
$ caz https://cdn.zce.me/boilerplate.zip my-project
The above command will download & extract template from https://cdn.zce.me/boilerplate.zip
.
$ caz nm my-project --offline
By running this command, CAZ will try to find a cached version of nm
template or download from GitHub if it's not yet cached.
CAZ allows you to specify prompt response answers through cli parameters.
$ caz minima my-project --name my-proj
By running this command, you don't have to answer the next name
prompts.
$ caz nm my-project --debug
--debug
parameter will open the debug mode.
In debug mode, once an exception occurs, the exception details will be automatically output. This is very helpful in finding errors in the template.
Show all available templates:
$ caz list [owner] [-j|--json] [-s|--short]
[owner]
: GitHub orgs or user slug, default: 'caz-templates'
-j, --json
: Output with json format-s, --short
: Output with short formatCurrent available templates list:
Maybe more: https://github.com/caz-templates
You can also run
$ caz list
to see all available official templates in real time.
All templates are currently hosted on GitHub, Chinese users can use the mirror on coding.net.
CAZ will read the configuration file in ~/.cazrc
, default config:
; template download registry
; {owner} & {name} & {branch} will eventually be replaced by the corresponding value.
registry = https://github.com/{owner}/{name}/archive/{branch}.zip
; template offlicial organization name
official = caz-templates
; default template branch name
branch = master
This means that you can customize the configuration by modifying the configuration file.
For example, in your ~/.cazrc
:
registry = https://gitlab.com/{owner}/{name}/archive/{branch}.zip
official = faker
branch = main
Then run the following command:
$ caz nm my-project
The above command will download & extract template from https://gitlab.com/faker/nm/archive/main.zip
.
Due to network limitations, the template download may time out, you can consider using the mirror repository I configured on coding.net.
~/.cazrc
:
registry = https://zce.coding.net/p/{owner}/d/{name}/git/archive/{branch}
official = caz
CAZ supports socks proxy config.
~/.cazrc
:
proxy = socks5://127.0.0.1:1080
or environment variable:
$ ALL_PROXY=socks5://127.0.0.1:1080 caz nm my-project
$ caz template my-template
The above command will pulls the template from caz-templates/template, and help you create your own CAZ template.
To create and distribute your own template, please refer to the How to create template.
Maybe fork an official template is also a good decision.
# install it locally
$ npm install caz
# or yarn
$ yarn add caz
with ESM and async/await:
import caz from 'caz'
try {
const template = 'nm'
// project path (relative cwd or full path)
const project = 'my-project'
const options = { force: false, offline: false }
// scaffolding by caz...
await caz(template, project, options)
// success created my-project by nm template
} catch (e) {
// error handling
console.error(e)
}
or with CommonJS and Promise:
const { default: caz } = require('caz')
const template = 'nm'
// project path (relative cwd or full path)
const project = 'my-project'
const options = { force: false, offline: false }
// scaffolding by caz...
caz(template, project, options)
.then(() => {
// success created my-project by nm template
})
.catch(e => {
// error handling
console.error(e)
})
This means that you can develop your own scaffolding module based on it.
To create and distribute your own scaffolding tools, please refer to the How to create scaffolding tools based on CAZ.
Create new project from a template
string
string
'.'
object
{}
boolean
false
boolean
false
any
👉 🛠 ⚙
Joking: I want to make wheels ;P
The real reason is that I think I need a scaffolding tool that is more suitable for my personal productivity. The existing tools have more or less certain limitations because of their different starting points.
Nothing else.
P.S. The picture is from the Internet, but I have forgotten the specific source, sorry to the author.
The core code is based on the middleware mechanism provided by zce/mwa.
The following middleware will be executed sequentially.
require
.npm | yarn | pnpm install
command if necessary.git init && git add && git commit
command if necessary.The following are the features I want to achieve or are under development:
See the open issues for a list of proposed features (and known issues).
git checkout -b my-awesome-feature
git commit -am 'Add some feature'
git push -u origin my-awesome-feature
NOTE: Be sure to merge the latest from "upstream" before making a pull request!
Distributed under the MIT License. See LICENSE for more information. © 汪磊
FAQs
A simple yet powerful template-based Scaffolding tools.
The npm package caz receives a total of 152 weekly downloads. As such, caz popularity was classified as not popular.
We found that caz demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.