Skip to content

Commit

Permalink
Adjust versionPackages to use cli command to get around stdio
Browse files Browse the repository at this point in the history
  • Loading branch information
dopenguin committed Nov 25, 2024
1 parent 83026ed commit 45da59a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
7 changes: 6 additions & 1 deletion nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@
},
"defaultBase": "main",
"release": {
"projectsRelationship": "independent"
"projectsRelationship": "independent",
"version": {
"generatorOptions": {
"updateDependents": true
}
}
}
}
15 changes: 7 additions & 8 deletions scripts/versionPackages.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
/* eslint-disable @typescript-eslint/no-var-requires */

const fs = require('fs')
const { releaseVersion } = require('nx/release')
const cp = require('child_process')
const packages = require('./packages')

const tags = []
Expand Down Expand Up @@ -34,13 +34,12 @@ for (const path of packages) {
const packageName = getPackageName(path)
tags.push(`${packageName}@${nextVersion}`)

releaseVersion({
specifier: nextVersion,
projects: [packageName],
generatorOptionsOverrides: { updateDependents: true },
gitCommitMessage: `Update package ${{ packageName }} to {version}.`,
verbose: true,
})
cp.execSync(
`npx nx release version --projects ${packageName} --specifier ${nextVersion} --git-commit-message "Update package ${{
packageName,
}} to {version}." --verbose false`,
{ stdio: ['pipe', 'ignore', 'pipe'] }
)
}
} catch (e) {
console.error(e)
Expand Down

0 comments on commit 45da59a

Please sign in to comment.