1.0.6 • Published 3 months ago

git-npm-auto-publish v1.0.6

Weekly downloads
-
License
ISC
Repository
-
Last release
3 months ago

git-npm-auto-publish

npm自动发布

配置

推送配置

在项目根目录(即package.json同级目录)创建名称为npm.auto.publish.js文件

module.exports = {
    git: 'git add .; git commit -m "${commit}"; git push origin master',
    publish: 'npm publish',
    
    /* npm相关配置建议在全局配置,如果配置在此处建议添加git忽略 */
    /* 全局配置参考 插件NPM全局配置 */
    username: '', // npm 用户名
    password: '', // npm 密码
    email: '' // npm Email
}

插件NPM全局配置

此全局配置为插件级别配置,与npm配置无关

命令名称
    git-npm-auto-publish

帮助
    git-npm-auto-publish --help

查看npm配置
    git-npm-auto-publish --config get
    配置结果:{
      username: 'pdjxeyg5428',
      password: '123456',
      email: '11111111@qq.com'
    }
    
设置npm配置
    git-npm-auto-publish --config set

删除npm配置
    git-npm-auto-publish --config remove

推送

配置完 npm,及推送命令后,即可推送代码到npm及git

推送到npm请更新版本号,版本号需要手动更新

推送到npm及git
    git-npm-auto-publish --publish 'git初始化提交' // git的commit可省略,默认为commit字符串

单独推送到git
    git-npm-auto-publish --git 'git初始化提交'

npm 默认命令为 npm publish,可以在npm.auto.publish.js重写 publish 字段

git 没有默认命令 需要在npm.auto.publish.js配置 git 字段,如果缺省,则不进行git提交

1.0.6

3 months ago

1.0.2

7 months ago

1.0.5

7 months ago

1.0.4

7 months ago

1.0.3

7 months ago

1.0.1

1 year ago

1.0.0

1 year ago