generator-plugin-hello v1.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 i -g git+https://gitlab.foxitsoftware.com/foxit/phantom/pluginsdk/generator-plugin.gitThen 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 plugin 在根目录执行,初始化Project yo plugin:h 显示帮助 yo plugin:lang 设置脚手架语言 yo plugin:tc 克隆远端模板配置文件到脚手架 yo plugin:sc 设置远端模板配置文件下载路径 Tool documentation: https://gitlab.foxitsoftware.com/foxit/phantom/pluginsdk/generator-plugin author by @biao_liu biao_liu@foxitsoftware.com
注意!!!
如果在使用这些命令:
yo plugin:langyo plugin:tcyo 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 ? ️🌈 请选择您想设置的语言! (Use arrow keys) > 默认(中文) en zh-CN
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!