Skip to content

Commit

Permalink
Remove release-major command
Browse files Browse the repository at this point in the history
  • Loading branch information
marijnh committed Jun 8, 2022
1 parent 1e74ffa commit a6c8b2f
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions bin/cm.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ function start() {
build,
devserver,
release,
"release-major": releaseMajor,
install,
clean,
commit,
Expand Down Expand Up @@ -203,16 +202,6 @@ function updateDependencyVersion(pkg, version) {
return changed
}

function updateAllDependencyVersions(version) {
for (let pkg of packages) {
let pkgFile = join(pkg.dir, "package.json"), text = fs.readFileSync(pkgFile, "utf8")
let updated = text.replace(/("@codemirror\/[^"]+": ")([^"]+)"/g, (_, m, old) => {
return m + (/buildhelper/.test(m) ? old : "^" + version) + '"'
})
fs.writeFileSync(pkgFile, updated)
}
}

function version(pkg) {
return require(join(pkg.dir, "package.json")).version
}
Expand Down Expand Up @@ -263,15 +252,6 @@ function doRelease(pkg, newVersion, {edit = false, defaultChanges = null}) {
return {changes, newVersion}
}

function releaseMajor() {
let versions = packages.map(version), prev = Math.max(...versions.map(v => +v.split(".")[1]))
let newVersion = `0.${prev + 1}.0`
updateAllDependencyVersions(newVersion)
for (let pkg of packages) doRelease(pkg, newVersion, {
defaultChanges: {fix: [], feature: [], breaking: ["Update dependencies to " + newVersion]}
})
}

function editReleaseNotes(notes) {
let noteFile = join(root, "notes.txt")
fs.writeFileSync(noteFile, notes.head + notes.body)
Expand Down

0 comments on commit a6c8b2f

Please sign in to comment.