generator-fx-jsplugin v0.0.1
generator-plugin 插件项目脚手架
Installation
First, install Yeoman and generator-plugin using npm (we assume you have pre-installed node.js).
[sudo] npm install -g yo
[sudo] npm install -g generator-fx-jsplugin
Then generate your new project:
yo plugin
目录生成成功后,请阅读:README.md
generator-plugin 支持功能
yo plugin:h
显示帮助.__ .__ ______ | | __ __ ____ |__| ____ \____ \| | | | \/ ___\| |/ \ | |_> > |_| | / /_/ > | | \ | __/|____/____/\___ /|__|___| / |__| /_____/ \/ 需要帮助? ===> yo plugin:h CMD: generator-plugin plugin@v1.1.0 node@v14.13.1 os@Windows_NT 10.0.18363 Yeoman 命令 yo fxplugin 在根目录执行,初始化Project yo fxplugin:h 显示帮助 yo fxplugin:lang 设置脚手架语言 yo fxplugin:tc 克隆远端模板配置文件到脚手架 yo fxplugin:sc 设置远端模板配置文件下载路径
注意!!!
如果在使用这些命令:
yo plugin:lang
yo plugin:tc
yo plugin:sc
出现权限问题,比如:
Error: EACCES: permission denied, open '/usr/local/lib/node_modules/generator-plugin/generators/tc/config.json'
请执行命令:
sudo chown -R $USER /usr/local/lib/node_modules/generator-plugin
其中: $USER 代表你当前电脑名. (此条只有mac会出现,Windows请使用管理员运行终端则不会出现)
yo plugin:lang
设置脚手架语言,执行此命令可以设置plugin的交互显示语言🌺 欢迎使用 Plugin 脚手架! .__ .__ ______ | | __ __ ____ |__| ____ \____ \| | | | \/ ___\| |/ \ | |_> > |_| | / /_/ > | | \ | __/|____/____/\___ /|__|___| / |__| /_____/ \/ 需要帮助? ===> yo plugin:h CMD: generator-plugin
yo plugin:tc
克隆远端模板配置文件到脚手架默认连接:
http://10.103.2.86:8081/common/templateConfig.js
(如果要维护远端模板配置文件请替换这个文件即可)
yo plugin:sc
设置远端模板配置文件下载路径? 请选择执行方式: (Use arrow keys) > 自定义路径 (例如: https://xxx.xxx.xxx/templateConfig.js) # 自定义远端模板配置文件下载路径 确认后会要求你输入一个正确的 templateConfig.js 下载路径 默认配置 # 使用默认,选择此选项可以恢复脚手架默认下载链接
templateConfig.js
示例:module.exports = [ { name: 'template-vue', // 名称,后续脚手架交互显示 url: 'https://gitlab.foxitsoftware.com/foxit/phantom/pluginsdk/generator-plugin.git#template-vue2' // 远端维护的模板,必须git [github | gitlab] } ];
yo plugin
开始使用plugin
初始化您的项目自制模板 如果有自定义模板请在package.json里加入以下字段,供用户在生成模板时输入内容以填充
{ "name": "<%= packageName %>", "version": "<%= version %>", "description": "又一个plugin脚手架 项目", "author": { "name": "<%= author %>", "email": "<%= email %>" }, "keywords": [ "generator-plugin", "plugin", "<%= packageName %>" ], "license": "<%= License %>", }
感谢这些开源项目
Getting To Know Yeoman
- Yeoman has a heart of gold.
- Yeoman is a person with feelings and opinions, but is very easy to work with.
- Yeoman can be too opinionated at times but is easily convinced not to be.
- Feel free to learn more about Yeoman.
License
MIT © biao_liu
Contributors ✨
Thanks goes to these wonderful people
This project follows the all-contributors specification. Contributions of any kind welcome!
4 months ago