Skip to content

Commit

Permalink
fix: don't update the package.json version before npm stage (#25)
Browse files Browse the repository at this point in the history
* fix: don't update the package.json version before npm stage

* chore: only update package version if we really want to

* chore: override npm publish config instead of coupling plugins
  • Loading branch information
amcgee authored Mar 25, 2019
1 parent d2c155e commit 5909f78
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/d2-app/src/commands/scripts/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const handler = async ({ publish }) => {
GIT_AUTHOR_EMAIL: 'ci@dhis2.org',
GIT_COMMITTER_NAME: '@dhis2-bot',
GIT_COMMITTER_EMAIL: 'ci@dhis2.org',
NPM_CONFIG_ALLOW_SAME_VERSION: 'true', // Ensure we still publish even though we've already updated the pacakge versions
},
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const prepare = (config, context) => {
if (!context.packages) {
verifyConditions({ ...config, silent: true }, context)
}
const { silent, exact } = config
const { silent, exact, updatePackageVersion = true } = config
const { nextRelease, logger, packages } = context

const targetVersion = exact
Expand All @@ -60,13 +60,15 @@ const prepare = (config, context) => {
const pkgJson = package.json
const relativePath = path.relative(context.cwd, package.path)

pkgJson.version = nextRelease.version
if (!silent) {
logger.log(
`Updated version to ${nextRelease.version} for package ${
package.label
} at ${relativePath}`
)
if (updatePackageVersion) {
pkgJson.version = nextRelease.version
if (!silent) {
logger.log(
`Updated version to ${nextRelease.version} for package ${
package.label
} at ${relativePath}`
)
}
}

replaceDependencies(
Expand Down

0 comments on commit 5909f78

Please sign in to comment.