@vzhdi/ox-create-app
v1.2.0
Published
create app using specific npm package or git repository
Downloads
4
Readme
@vzhdi/ox-create-app
create app using specific npm package or git repository
Install
Using npm:
npm install --global @vzhdi/ox-create-app
or using yarn:
yarn global add @vzhdi/ox-creat-app
Usage
usage
cd user-working-dir
ox-create-app -p template-package-name
options
-p,--package
template package name,support npm package or git repository or local file.
ox-create-app -p plugin
ox-create-app -p git+https://github.com/vzhdi/ox-template-plugin.git
ox-create-app -p ../external/template-package
ox-create-app -p file:D:/package/external/template-package
template package must has a
template
dir, or has aon-create
dir withresolve-template.js
to return a specific template dir.view detail
-v,--version
template package version,if package is git repository version can be branch/commit/tag,if package is local file version is invalid
ox-create-app -p plugin -v 1.0.2
ox-create-app -p git+https://github.com/vzhdi/ox-template-plugin.git -v 1.0.2
-n,--name
your app name,default is user working dir's basename
ox-create-app -p plugin -n your-plugin-name
help
ox-create-app -h
builtIn template package alias
plugin
: @vzhdi/ox-template-pluginwebpack
: @vzhdi/ox-template-webpackreact
: @vzhdi/ox-template-react
Template Package Development
the package must return a valid template dir, it may be a static template
dir in the package's root, or returned by the on-create/resolve-template.js
on-create hooks
please put the next hook files into the on-create
dir in your package's root
resolve-template.js
accept the cwd and name option, and return an absolute template dir
/*
* cwd : user working dir
* name: user app name. default:user working dir's basename
* git?: git repository if cwd is version controlled by git
*/
module.exports = async ({ cwd, name, git }) => {
return 'absolute-template-dir';
};
on-created.js
called when files are copied from your template dir to user working dir (cwd
)
/*
* cwd : user working dir
*/
module.exports = async ({ cwd }) => {};