@vzhdi/ox-create-app v1.2.0
@vzhdi/ox-create-app
create app using specific npm package or git repository
Install
Using npm:
npm install --global @vzhdi/ox-create-appor using yarn:
yarn global add @vzhdi/ox-creat-appUsage
usage
cd user-working-dir
ox-create-app -p template-package-nameoptions
-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-packagetemplate package must has a
templatedir, or has aon-createdir withresolve-template.jsto 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-namehelp
ox-create-app -hbuiltIn template package alias
- plugin: @vzhdi/ox-template-plugin
- webpack: @vzhdi/ox-template-webpack
- react: @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 }) => {};