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"
|
||||
],
|
||||
"scripts": {
|
||||
"prepack": "cd .. && yarn run prepare"
|
||||
"prepublish": "cd .. && yarn run ensure-publishing"
|
||||
},
|
||||
"sideEffects": true,
|
||||
"dependencies": {
|
||||
"@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:bundle": "rollup -c devEnv/declarations-bundler/rollup.config.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"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
|
|
@ -36,7 +36,7 @@
|
|||
"dist/index.d.ts"
|
||||
],
|
||||
"scripts": {
|
||||
"prepack": "cd .. && yarn run prepare"
|
||||
"prepublish": "cd .. && yarn run ensure-publishing"
|
||||
},
|
||||
"sideEffects": true,
|
||||
"dependencies": {
|
||||
|
@ -45,4 +45,4 @@
|
|||
"peerDependencies": {
|
||||
"@theatre/core": "*"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue