Build: streamlined npm publish
This commit is contained in:
parent
dfcd2814ae
commit
1724e2f030
4 changed files with 14 additions and 5 deletions
|
@ -36,10 +36,10 @@
|
||||||
"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": {
|
||||||
"@theatre/dataverse": "workspace:*"
|
"@theatre/dataverse": "workspace:*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
5
theatre/devEnv/ensurePublishing.js
Normal file
5
theatre/devEnv/ensurePublishing.js
Normal 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.`,
|
||||||
|
)
|
||||||
|
}
|
|
@ -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": {
|
||||||
|
|
|
@ -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": {
|
||||||
|
@ -45,4 +45,4 @@
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@theatre/core": "*"
|
"@theatre/core": "*"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue