Build: Implemented theatre.update-versions script

This commit is contained in:
Aria Minaei 2021-06-28 12:37:10 +02:00
parent 2342e83d49
commit dfcd2814ae
4 changed files with 27 additions and 5 deletions

View file

@ -0,0 +1,19 @@
import {writeFileSync} from 'fs'
import path from 'path'
const theatreDir = path.join(__dirname, '..')
const version = require('../package.json').version
for (const which of ['core', 'studio']) {
const original = require('../' + which + '/package.json')
if (original.version !== version) {
console.log(`Setting version of @theatre/${which} to ${version}`)
const newJson = {...original}
newJson.version = version
writeFileSync(
path.join(theatreDir, `./${which}/package.json`),
JSON.stringify(newJson, undefined, 2),
)
}
}