Build: streamlined npm publish

This commit is contained in:
Aria Minaei 2021-06-28 13:35:06 +02:00
parent dfcd2814ae
commit 1724e2f030
4 changed files with 14 additions and 5 deletions

View file

@ -36,7 +36,7 @@
"dist/index.d.ts" "dist/index.d.ts"
], ],
"scripts": { "scripts": {
"prepack": "cd .. && yarn run prepare" "prepublish": "cd .. && yarn run ensure-publishing"
}, },
"sideEffects": true, "sideEffects": true,
"dependencies": { "dependencies": {

View file

@ -0,0 +1,5 @@
if (process.env.THEATRE_IS_PUBLISHING !== 'true') {
throw Error(
`This script may run only when the "prepare" command in root/theatre is running.`,
)
}

View file

@ -13,7 +13,11 @@
"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 update-versions build", "deploy": "cross-env-shell THEATRE_IS_PUBLISHING=true \"yarn run _deploy:steps\"",
"_deploy:steps": "run-s ensure-publishing update-versions build _deploy:core _deploy:studio",
"_deploy:core": "yarn workspace @theatre/core npm publish --access public",
"_deploy:studio": "yarn workspace @theatre/studio npm publish --access public",
"ensure-publishing": "node ./devEnv/ensurePublishing.js",
"update-versions": "node -r esbuild-register devEnv/updateVersions.ts" "update-versions": "node -r esbuild-register devEnv/updateVersions.ts"
}, },
"devDependencies": { "devDependencies": {

View file

@ -36,7 +36,7 @@
"dist/index.d.ts" "dist/index.d.ts"
], ],
"scripts": { "scripts": {
"prepack": "cd .. && yarn run prepare" "prepublish": "cd .. && yarn run ensure-publishing"
}, },
"sideEffects": true, "sideEffects": true,
"dependencies": { "dependencies": {