Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
gsg-client
Advanced tools
此项目乃固守前端脚手架命令工具,脚手架地址
npm install gsg-client@latest -g
命令参数格式:
[xxx] // 可选参数
<xxx> // 必填参数
gsg -h // 查看帮助
gsg -v // 查看版本
gsg l
gsg i [脚手架名称,默认 gsg-scaffold]
gsg push <branch> [options] // git 快捷操作
branch: 分支名称 只支持 'test,release,master'
Options:
-m, --msg <msg> commit 信息 (default: "update")
-h, --help output usage information
例如:gsg push test -m 'xxx' // -m可选 提交当前分支然后合并到test,然后push
例如:gsg push release -m 'xxx' // -m可选 提交当前分支然后合并到release,然后push,注:如果release上有未发布正式的版本,则会提示
例如:gsg push master -m 'fixbug' // -m必填 以--squash的方式合并origin/release 到master,然后push
gsg d [env] [options]
env: 环境名称,详见配置文件说明,默认:default
Options:
-c, --config <config> 配置文件相对路径 (default: "./deploy.config.js")
-h, --help output usage information
例如:gsg d // 部署default环境
例如:gsg d test // 部署test环境
例如:gsg d -c './config/deploy.config.js' // 使用./config/deploy.config.js配置部署efault环境
// config 的属性 defalt,test,release,prod 作为 gsg d 命令的 env 参数,读取对应的配置
const path = require('path');
const config = {
test: {
host: '10.10.100.2', // 服务器地址
user: 'root', // 用户
password: 'G3Sde1d2', // 密码
remotePath: '/home/tomcat/node/demo-admin', // 服务器文件目录
pm2App: 'demo-admin', // pm2本项目的 app名字
},
release: {
host: '10.10.100.113',
user: 'tomcat',
password: '12354@qwsf',
remotePath: '/data/demo-admin',
pm2App: 'demo-admin',
},
prod: {}, //没有host配置则不传远端,仅本地构建打包
};
Object.keys(config).forEach((env) => {
const baseCofig = {
zipName: `${path.basename(process.cwd())}-${env}.zip`, // zip 压缩后的临时文件名
files: ['app', 'client', 'package.json'], // 需要压缩的文件夹和文件
pm2Cmd: '/usr/local/node/bin/pm2', // 服务器pm2命令位置
build: 'build', // 构建命令
};
config[env] = { ...baseCofig, ...config[env] };
});
config.default = config.test; // 默认发布到test环境
module.exports = config;
gsg mock [options]
Options:
-c, --config <config> :配置文件相对路径 (default: "./mock.config.js")
-h, --help output usage information
例如:gsg mock // 启动mock服务
module.exports = {
db: './mock', // mock数据位置 mock数据格式详见下面说明
port: 3000, // mock服务端口
prefix: '/api', // mock接口前缀,包含这个前缀的才会作为mock接口
};
// 创建路径建议配合 mk 命令: gsg mk mock/a/b/c.js // 以上 mock 配置接口访问 127.0.0.1:3000/api/a/b/c
例1:
module.exports = function fn() {
return {
"code": 1,
"message": null,
"data": [ ]
};
};
例2:
module.exports = function fn(req, res) {
// req 和 res 的其他用法参考node http模块
console.log('😈😈😈😈😈: fn -> req', req.query); // url 参数对象
console.log('😈😈😈😈😈: fn -> req', req.pathname); // url pathname
const data = {
"code": 1,
"message": null,
"data": [
{
"name": "北京市",
"id": "11",
}
]
}
res.end(JSON.stringify(data));
};
// 以上 mock 配置接口访问 127.0.0.1:3000/api/a/b/c
{
"code": 1,
"message": null,
"data": [
{
"upId": "123",
"name": "北京市",
"id": "11",
"kindId": "1"
}
]
}
gsg mk <name>
name: (必填)文件或者目录路径
例如:gsg mk a/b 在当前目录下创建a/b 目录
例如:gsg mk a/b/c.js 在当前目录下创建a/b/c.js 文件
gsg excel [options]
Options:
-c, --config <config> :配置文件相对路径 (default: "./excel.config.js")
-h, --help output usage information
例如:gsg excel // 解析excel
module.exports = {
entry: './测试.xlsx', // [必填] excel文件
output: './测试.json', // [可选] 默认为excel同名的json文件
transform: (data) => { // [可选] 读出来的数据进行转换
return data;
},
};
gsg publish <branch>
branch:(必填)git分支[环境]名称(test,release)
例如:gsg publish test // 发布测试
例如:gsg publish release // 发布预生产
FAQs
We found that gsg-client demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.