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

@ -1,6 +1,6 @@
{ {
"name": "@theatre/core", "name": "@theatre/core",
"version": "0.4.0-dev.1", "version": "0.4.0-dev.2",
"license": "Apache-2.0", "license": "Apache-2.0",
"description": "Motion design editor for the web", "description": "Motion design editor for the web",
"repository": { "repository": {

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),
)
}
}

View file

@ -1,4 +1,6 @@
{ {
"private": true,
"version": "0.4.0-dev.2",
"workspaces": [ "workspaces": [
"./shared", "./shared",
"./core", "./core",
@ -11,7 +13,8 @@
"build:dts": "run-s typecheck build:dts:bundle", "build:dts": "run-s typecheck build:dts:bundle",
"build:dts:bundle": "rollup -c devEnv/declarations-bundler/rollup.config.js", "build:dts:bundle": "rollup -c devEnv/declarations-bundler/rollup.config.js",
"build": "run-p build:dts build:js", "build": "run-p build:dts build:js",
"prepare": "run-s build" "prepare": "run-s update-versions build",
"update-versions": "node -r esbuild-register devEnv/updateVersions.ts"
}, },
"devDependencies": { "devDependencies": {
"@babel/cli": "^7.14.3", "@babel/cli": "^7.14.3",

View file

@ -1,6 +1,6 @@
{ {
"name": "@theatre/studio", "name": "@theatre/studio",
"version": "0.4.0-dev.1", "version": "0.4.0-dev.2",
"license": "AGPL-3.0-only", "license": "AGPL-3.0-only",
"description": "Motion design editor for the web", "description": "Motion design editor for the web",
"repository": { "repository": {