grunt-p4b
v1.0.20
Published
Grunt task for incrementing version in package.json
Downloads
13
Readme
grunt-p4b
Tasks
env
Inject env variables from .env file to some .js file
grunt.initConfig({
env: {
main: {
env_file: ".env", // path to .env file
injection_file: "./out/main/index.js", // path to .js file where should inject vars
},
},
});increment
Increment version in package.json file
- patch
1.0.0 => 1.0.1 - build
1.0.0+5 => 1.0.0+6 - beta
1.0.0-rc.5 => 1.0.0-rc.6 - alpha
1.0.0-5 => 1.0.0-6
No need any options
package
Copy package.json file to another location also clean it from dev information:
- prettier
- scripts (can keep some by
scriptsoption) - devDependencies (can keep some by
depsoption) - packageManager
- browserslist
grunt.initConfig({
package: {
main: {
dest: './dist' // destination for package.json copy
scripts: ['postinstall'] // keep postinstal script when clean
deps: ['node-gyp'] // keep node-gyp package when clean
}
}
})upload
Upload provided file to provided url, also can delete file after publising
- file - path to file for publishing
- url - url for publishind
- download - link for file download that printed to terminal after publishing (optional)
- clean - delete file after publishing (optional)
grunt.initConfig({
publish: {
main: {
file: `./dist/${app.version}.tgz`,
url: `https://example.com/v3/upload/${app.name}/${app.version}.tgz`,
download: `https://example.com/v3/download/${app.name}/${app.version}.tgz`,
clean: true,
},
},
});