standard-version
Advanced tools
Comparing version 4.2.0 to 4.3.0-candidate.0
@@ -68,3 +68,3 @@ var defaults = require('./defaults') | ||
describe: 'Map of steps in the release process that should be skipped', | ||
default: defaults.scripts | ||
default: defaults.skip | ||
}) | ||
@@ -71,0 +71,0 @@ .option('dry-run', { |
const util = require('util') | ||
module.exports = function (msg, newVersion) { | ||
return String(msg).indexOf('%s') !== -1 ? util.format(msg, newVersion) : msg | ||
module.exports = function (rawMsg, newVersion) { | ||
const message = String(rawMsg) | ||
const matchCount = (message.match(/%s/g) || []).length | ||
const args = Array(1 + matchCount) | ||
args[0] = message | ||
args.fill(newVersion, 1, args.length) | ||
return util.format.apply(util, args) | ||
} |
@@ -6,2 +6,3 @@ const chalk = require('chalk') | ||
const fs = require('fs') | ||
const Gitignore = require('../gitignore') | ||
const path = require('path') | ||
@@ -144,2 +145,3 @@ const runLifecycleScript = require('../run-lifecycle-script') | ||
try { | ||
if (Gitignore(configPath)) return | ||
var stat = fs.lstatSync(configPath) | ||
@@ -146,0 +148,0 @@ if (stat.isFile()) { |
@@ -31,2 +31,3 @@ const chalk = require('chalk') | ||
if (pkgPrivate !== true) message += '; npm publish' | ||
if (args.prerelease !== undefined) message += ' --tag prerelease' | ||
@@ -33,0 +34,0 @@ checkpoint(args, 'Run `%s` to publish', [message], chalk.blue(figures.info)) |
{ | ||
"name": "standard-version", | ||
"version": "4.2.0", | ||
"version": "4.3.0-candidate.0", | ||
"description": "replacement for `npm version` with automatic CHANGELOG generation", | ||
@@ -41,2 +41,3 @@ "bin": "bin/cli.js", | ||
"dependencies": { | ||
"@bcoe/dotignore": "^0.1.1", | ||
"chalk": "^1.1.3", | ||
@@ -43,0 +44,0 @@ "conventional-changelog": "^1.1.0", |
# Standard Version | ||
[![Join the chat at https://gitter.im/conventional-changelog/standard-version](https://badges.gitter.im/conventional-changelog/standard-version.svg)](https://gitter.im/conventional-changelog/standard-version?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) | ||
[![Build Status](https://travis-ci.org/conventional-changelog/standard-version.svg?branch=master)](https://travis-ci.org/conventional-changelog/standard-version) | ||
@@ -9,3 +7,6 @@ [![NPM version](https://img.shields.io/npm/v/standard-version.svg)](https://www.npmjs.com/package/standard-version) | ||
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg)](https://conventionalcommits.org) | ||
[![community slack](http://devtoolscommunity.herokuapp.com/badge.svg)](http://devtoolscommunity.herokuapp.com) | ||
_Having problems? want to contribute? join our [community slack](http://devtoolscommunity.herokuapp.com)_. | ||
> stop using `npm version`, use `standard-version` it rocks! | ||
@@ -12,0 +13,0 @@ |
41
test.js
@@ -12,2 +12,3 @@ /* global describe it beforeEach afterEach */ | ||
var semver = require('semver') | ||
var formatCommitMessage = require('./lib/format-commit-message') | ||
var cli = require('./command') | ||
@@ -105,2 +106,14 @@ var standardVersion = require('./index') | ||
describe('format-commit-message', function () { | ||
it('works for no %s', function () { | ||
formatCommitMessage('chore(release): 1.0.0', '1.0.0').should.equal('chore(release): 1.0.0') | ||
}) | ||
it('works for one %s', function () { | ||
formatCommitMessage('chore(release): %s', '1.0.0').should.equal('chore(release): 1.0.0') | ||
}) | ||
it('works for two %s', function () { | ||
formatCommitMessage('chore(release): %s \n\n* CHANGELOG: https://github.com/conventional-changelog/standard-version/blob/v%s/CHANGELOG.md', '1.0.0').should.equal('chore(release): 1.0.0 \n\n* CHANGELOG: https://github.com/conventional-changelog/standard-version/blob/v1.0.0/CHANGELOG.md') | ||
}) | ||
}) | ||
describe('cli', function () { | ||
@@ -365,2 +378,10 @@ beforeEach(initInTempFolder) | ||
}) | ||
it('advises use of --tag prerelease for publishing to npm', function () { | ||
writePackageJson('1.0.0') | ||
fs.writeFileSync('CHANGELOG.md', 'legacy header format<a name="1.0.0">\n', 'utf-8') | ||
commit('feat: first commit') | ||
execCli('--prerelease').stdout.should.include('--tag prerelease') | ||
}) | ||
}) | ||
@@ -750,2 +771,22 @@ | ||
}) | ||
describe('.gitignore', () => { | ||
beforeEach(function () { | ||
writeBowerJson('1.0.0') | ||
}) | ||
it('does not update files present in .gitignore', (done) => { | ||
fs.writeFileSync('.gitignore', 'bower.json', 'utf-8') | ||
commit('feat: first commit') | ||
shell.exec('git tag -a v1.0.0 -m "my awesome first release"') | ||
commit('feat: new feature!') | ||
require('./index')({silent: true}) | ||
.then(() => { | ||
JSON.parse(fs.readFileSync('bower.json', 'utf-8')).version.should.equal('1.0.0') | ||
getPackageVersion().should.equal('1.1.0') | ||
return done() | ||
}) | ||
}) | ||
}) | ||
}) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67745
1173
314
8
1
9
+ Added@bcoe/dotignore@^0.1.1
+ Added@bcoe/dotignore@0.1.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedminimatch@3.1.2(transitive)