Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: conventional-changelog/standard-version
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.0.0
Choose a base ref
...
head repository: conventional-changelog/standard-version
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.0.1
Choose a head ref
  • 16 commits
  • 12 files changed
  • 4 contributors

Commits on Jul 31, 2019

  1. Verified

    This commit was signed with the committer’s verified signature.
    spencerschrock Spencer Schrock
    Copy the full SHA
    f34e39b View commit details

Commits on Aug 19, 2019

  1. Verified

    This commit was signed with the committer’s verified signature.
    spencerschrock Spencer Schrock
    Copy the full SHA
    a307562 View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    spencerschrock Spencer Schrock
    Copy the full SHA
    751af20 View commit details

Commits on Aug 20, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    fe37e73 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    36f85c6 View commit details

Commits on Aug 24, 2019

  1. feat(configuration): .versionrc.js files are now supported (#378)

    * feat(configuration): .versionrc.js files are now supported
    
    - Updates the configuration retrieval to support Javascript (`.js`) configurations.
    - Javascript configurations MUST export a configuration object _or_ a function (returning a configuration object) as the default export.
    
    closes #371
    
    * docs: Updates README to include details for the new '.versionrc.js' support
    
    * fix: updates error message to be a bit more descriptive and helpful.
    jbottigliero authored Aug 24, 2019

    Partially verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    We cannot verify signatures from co-authors, and some of the co-authors attributed to this commit require their commits to be signed.
    Copy the full SHA
    ddc5c00 View commit details

Commits on Sep 17, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a2c5747 View commit details

Commits on Sep 30, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    e06a835 View commit details

Commits on Oct 9, 2019

  1. Copy the full SHA
    f04161a View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    84bb581 View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    abf48bb View commit details

Commits on Oct 13, 2019

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    fb21851 View commit details
  2. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
    Copy the full SHA
    2b322d1 View commit details
  3. Copy the full SHA
    2b5619b View commit details
  4. chore(deps): update dependency eslint-config-standard to v14 and esli…

    …nt to v6.2.2 (#438)
    
    * chore(deps): update dependency eslint-config-standard to v14
    * chore: Adds compatible eslint version and runs 'eslint --fix' to meet new standard config.
    renovate[bot] authored and jbottigliero committed Oct 13, 2019
    Copy the full SHA
    106d039 View commit details

Commits on Nov 7, 2019

  1. chore(release): 7.0.1

    tommywo committed Nov 7, 2019
    Copy the full SHA
    62d886c View commit details
Showing with 232 additions and 114 deletions.
  1. +12 −0 CHANGELOG.md
  2. +4 −2 README.md
  3. +4 −8 command.js
  4. +4 −4 index.js
  5. +39 −0 lib/configuration.js
  6. +9 −9 lib/lifecycles/bump.js
  7. +2 −2 lib/lifecycles/changelog.js
  8. +1 −1 lib/lifecycles/commit.js
  9. +1 −1 lib/run-lifecycle-hook.js
  10. +1 −1 lib/run-lifecycle-script.js
  11. +11 −11 package.json
  12. +144 −75 test.js
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,18 @@

All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.

### [7.0.1](https://github.com/conventional-changelog/standard-version/compare/v7.0.0...v7.0.1) (2019-11-07)


### Bug Fixes

* **deps:** update dependency conventional-changelog to v3.1.12 ([#463](https://github.com/conventional-changelog/standard-version/issues/463)) ([f04161a](https://github.com/conventional-changelog/standard-version/commit/f04161ae624705e68f9018d563e9f3c09ccf6f30))
* **deps:** update dependency conventional-changelog-config-spec to v2.1.0 ([#442](https://github.com/conventional-changelog/standard-version/issues/442)) ([a2c5747](https://github.com/conventional-changelog/standard-version/commit/a2c574735ac5a165a190661b7735ea284bdc7dda))
* **deps:** update dependency conventional-recommended-bump to v6.0.2 ([#462](https://github.com/conventional-changelog/standard-version/issues/462)) ([84bb581](https://github.com/conventional-changelog/standard-version/commit/84bb581209b50357761cbec45bb8253f6a182801))
* **deps:** update dependency stringify-package to v1.0.1 ([#459](https://github.com/conventional-changelog/standard-version/issues/459)) ([e06a835](https://github.com/conventional-changelog/standard-version/commit/e06a835c8296a92f4fa7c07f98057d765c1a91e5))
* **deps:** update dependency yargs to v14 ([#440](https://github.com/conventional-changelog/standard-version/issues/440)) ([fe37e73](https://github.com/conventional-changelog/standard-version/commit/fe37e7390760d8d16d1b94ca58d8123e292c46a8))
* **deps:** update dependency yargs to v14.2.0 ([#461](https://github.com/conventional-changelog/standard-version/issues/461)) ([fb21851](https://github.com/conventional-changelog/standard-version/commit/fb2185107a90ba4b9dc7c9c1d873ed1283706ac1))

## [7.0.0](https://github.com/conventional-changelog/standard-version/compare/v6.0.1...v7.0.0) (2019-07-30)


6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -71,11 +71,13 @@ You can configure `standard-version` either by:

1. Placing a `standard-version` stanza in your `package.json` (assuming
your project is JavaScript).
1. Creating a `.versionrc` or `.versionrc.json`.
2. Creating a `.versionrc`, `.versionrc.json` or `.versionrc.js`.
- If you are using a `.versionrc.js` your default export must be a configuration object, or a function returning a configuration object.

Any of the command line paramters accepted by `standard-version` can instead
Any of the command line parameters accepted by `standard-version` can instead
be provided via configuration. Please refer to the [conventional-changelog-config-spec](https://github.com/conventional-changelog/conventional-changelog-config-spec/) for details on available configuration options.


### Customizing CHANGELOG Generation

By default, `standard-version` uses the [conventionalcommits preset](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits).
12 changes: 4 additions & 8 deletions command.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
const findUp = require('find-up')
const defaults = require('./defaults')
const { readFileSync } = require('fs')

const configPath = findUp.sync(['.versionrc', '.versionrc.json'])
const config = configPath ? JSON.parse(readFileSync(configPath)) : {}
const spec = require('conventional-changelog-config-spec')
const { getConfiguration } = require('./lib/configuration')
const defaults = require('./defaults')
const { START_OF_LAST_RELEASE_PATTERN } = require('./lib/lifecycles/changelog')

const yargs = require('yargs')
@@ -81,7 +77,7 @@ const yargs = require('yargs')
.option('git-tag-fallback', {
type: 'boolean',
default: defaults.gitTagFallback,
describe: `fallback to git tags for version, if no meta-information file is found (e.g., package.json)`
describe: 'fallback to git tags for version, if no meta-information file is found (e.g., package.json)'
})
.option('path', {
type: 'string',
@@ -110,7 +106,7 @@ const yargs = require('yargs')
.example('$0', 'Update changelog and tag release')
.example('$0 -m "%s: see changelog for details"', 'Update changelog and tag release with custom commit message')
.pkgConf('standard-version')
.config(config)
.config(getConfiguration())
.wrap(97)
.check((args) => {
if (args.changelogHeader && args.changelogHeader.search(START_OF_LAST_RELEASE_PATTERN) !== -1) {
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
@@ -27,15 +27,15 @@ module.exports = function standardVersion (argv) {
let pkg
bump.pkgFiles.forEach((filename) => {
if (pkg) return
let pkgPath = path.resolve(process.cwd(), filename)
const pkgPath = path.resolve(process.cwd(), filename)
try {
let data = fs.readFileSync(pkgPath, 'utf8')
const data = fs.readFileSync(pkgPath, 'utf8')
pkg = JSON.parse(data)
} catch (err) {}
})
let newVersion
let defaults = require('./defaults')
let args = Object.assign({}, defaults, argv)
const defaults = require('./defaults')
const args = Object.assign({}, defaults, argv)

return Promise.resolve()
.then(() => {
39 changes: 39 additions & 0 deletions lib/configuration.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
const path = require('path')
const findUp = require('find-up')
const { readFileSync } = require('fs')

const CONFIGURATION_FILES = [
'.versionrc',
'.versionrc.json',
'.versionrc.js'
]

module.exports.getConfiguration = function () {
let config = {}
const configPath = findUp.sync(CONFIGURATION_FILES)
if (!configPath) {
return config
}
if (path.extname(configPath) === '.js') {
const jsConfiguration = require(configPath)
if (typeof jsConfiguration === 'function') {
config = jsConfiguration()
} else {
config = jsConfiguration
}
} else {
config = JSON.parse(readFileSync(configPath))
}

/**
* @todo we could eventually have deeper validation of the configuration (using `ajv`) and
* provide a more helpful error.
*/
if (typeof config !== 'object') {
throw Error(
`[standard-version] Invalid configuration in ${configPath} provided. Expected an object but found ${typeof config}.`
)
}

return config
}
18 changes: 9 additions & 9 deletions lib/lifecycles/bump.js
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ function Bump (args, version) {
})
.then((release) => {
if (!args.firstRelease) {
let releaseType = getReleaseType(args.prerelease, release.releaseType, version)
const releaseType = getReleaseType(args.prerelease, release.releaseType, version)
newVersion = semver.valid(releaseType) || semver.inc(version, releaseType, args.prerelease)
updateConfigs(args, newVersion)
} else {
@@ -101,7 +101,7 @@ function isInPrerelease (version) {
return Array.isArray(semver.prerelease(version))
}

let TypeList = ['major', 'minor', 'patch'].reverse()
const TypeList = ['major', 'minor', 'patch'].reverse()

/**
* extract the in-pre-release type in target version
@@ -110,7 +110,7 @@ let TypeList = ['major', 'minor', 'patch'].reverse()
* @return {string}
*/
function getCurrentActiveType (version) {
let typelist = TypeList
const typelist = TypeList
for (let i = 0; i < typelist.length; i++) {
if (semver[typelist[i]](version)) {
return typelist[i]
@@ -164,15 +164,15 @@ function bumpVersion (releaseAs, currentVersion, args) {
function updateConfigs (args, newVersion) {
const dotgit = DotGitignore()
Bump.pkgFiles.concat(Bump.lockFiles).forEach(function (filename) {
let configPath = path.resolve(process.cwd(), filename)
const configPath = path.resolve(process.cwd(), filename)
try {
if (dotgit.ignore(configPath)) return
let stat = fs.lstatSync(configPath)
const stat = fs.lstatSync(configPath)
if (stat.isFile()) {
let data = fs.readFileSync(configPath, 'utf8')
let indent = detectIndent(data).indent
let newline = detectNewline(data)
let config = JSON.parse(data)
const data = fs.readFileSync(configPath, 'utf8')
const indent = detectIndent(data).indent
const newline = detectNewline(data)
const config = JSON.parse(data)
checkpoint(args, 'bumping version in ' + filename + ' from %s to %s', [config.version, newVersion])
config.version = newVersion
writeFile(args, configPath, stringifyPackage(config, indent, newline))
4 changes: 2 additions & 2 deletions lib/lifecycles/changelog.js
Original file line number Diff line number Diff line change
@@ -29,14 +29,14 @@ function outputChangelog (args, newVersion) {
const header = args.changelogHeader || '# Changelog\n\nAll notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n'

let oldContent = args.dryRun ? '' : fs.readFileSync(args.infile, 'utf-8')
let oldContentStart = oldContent.search(START_OF_LAST_RELEASE_PATTERN)
const oldContentStart = oldContent.search(START_OF_LAST_RELEASE_PATTERN)
// find the position of the last release and remove header:
if (oldContentStart !== -1) {
oldContent = oldContent.substring(oldContentStart)
}
let content = ''
const context = { version: newVersion }
let changelogStream = conventionalChangelog({
const changelogStream = conventionalChangelog({
debug: args.verbose && console.info.bind(console, 'conventional-changelog'),
preset: presetLoader(args),
tagPrefix: args.tagPrefix
2 changes: 1 addition & 1 deletion lib/lifecycles/commit.js
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ module.exports = function (args, newVersion) {
function execCommit (args, newVersion) {
let msg = 'committing %s'
let paths = []
let verify = args.verify === false || args.n ? '--no-verify ' : ''
const verify = args.verify === false || args.n ? '--no-verify ' : ''
let toAdd = ''

// only start with a pre-populated paths list when CHANGELOG processing is not skipped
2 changes: 1 addition & 1 deletion lib/run-lifecycle-hook.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ const runExec = require('./run-exec')

module.exports = function (args, hookName, newVersion, hooks, cb) {
if (!hooks[hookName]) return Promise.resolve()
let command = hooks[hookName] + ' --new-version="' + newVersion + '"'
const command = hooks[hookName] + ' --new-version="' + newVersion + '"'
checkpoint(args, 'Running lifecycle hook "%s"', [hookName])
checkpoint(args, '- hook command: "%s"', [command], chalk.blue(figures.info))
return runExec(args, command)
2 changes: 1 addition & 1 deletion lib/run-lifecycle-script.js
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ const runExec = require('./run-exec')
module.exports = function (args, hookName) {
const scripts = args.scripts
if (!scripts || !scripts[hookName]) return Promise.resolve()
let command = scripts[hookName]
const command = scripts[hookName]
checkpoint(args, 'Running lifecycle script "%s"', [hookName])
checkpoint(args, '- execute command: "%s"', [command], chalk.blue(figures.info))
return runExec(args, command)
22 changes: 11 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "standard-version",
"version": "7.0.0",
"version": "7.0.1",
"description": "replacement for `npm version` with automatic CHANGELOG generation",
"bin": "bin/cli.js",
"scripts": {
@@ -39,9 +39,9 @@
"homepage": "https://github.com/conventional-changelog/standard-version#readme",
"dependencies": {
"chalk": "2.4.2",
"conventional-changelog": "3.1.9",
"conventional-changelog-config-spec": "2.0.0",
"conventional-recommended-bump": "6.0.0",
"conventional-changelog": "3.1.12",
"conventional-changelog-config-spec": "2.1.0",
"conventional-recommended-bump": "6.0.2",
"detect-indent": "6.0.0",
"detect-newline": "3.0.0",
"dotgitignore": "2.1.0",
@@ -50,18 +50,18 @@
"fs-access": "1.0.1",
"git-semver-tags": "3.0.0",
"semver": "6.3.0",
"stringify-package": "1.0.0",
"yargs": "13.3.0"
"stringify-package": "1.0.1",
"yargs": "14.2.0"
},
"devDependencies": {
"chai": "4.2.0",
"coveralls": "3.0.5",
"eslint": "6.1.0",
"eslint-config-standard": "12.0.0",
"coveralls": "3.0.7",
"eslint": "6.2.2",
"eslint-config-standard": "14.1.0",
"eslint-plugin-import": "2.18.2",
"eslint-plugin-node": "9.1.0",
"eslint-plugin-node": "9.2.0",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-standard": "4.0.0",
"eslint-plugin-standard": "4.0.1",
"mocha": "6.2.0",
"mock-git": "2.0.0",
"mockery": "2.1.0",
Loading