2023-08-06 10:15:37 +02:00
|
|
|
import {$} from '@cspotcode/zx'
|
2021-10-06 12:49:04 +02:00
|
|
|
/**
|
|
|
|
* Builds all the packages for production
|
|
|
|
*/
|
|
|
|
|
|
|
|
const packagesToBuild = [
|
|
|
|
'theatre',
|
|
|
|
'@theatre/dataverse',
|
|
|
|
'@theatre/react',
|
|
|
|
'@theatre/browser-bundles',
|
|
|
|
'@theatre/r3f',
|
2023-01-22 18:51:55 +01:00
|
|
|
'theatric',
|
2021-10-06 12:49:04 +02:00
|
|
|
]
|
2023-08-06 10:15:37 +02:00
|
|
|
async function build() {
|
2021-10-06 12:49:04 +02:00
|
|
|
// better quote function from https://github.com/google/zx/pull/167
|
|
|
|
$.quote = function quote(arg) {
|
|
|
|
if (/^[a-z0-9/_.-]+$/i.test(arg)) {
|
|
|
|
return arg
|
|
|
|
}
|
|
|
|
return (
|
|
|
|
`$'` +
|
|
|
|
arg
|
|
|
|
.replace(/\\/g, '\\\\')
|
|
|
|
.replace(/'/g, "\\'")
|
|
|
|
.replace(/\f/g, '\\f')
|
|
|
|
.replace(/\n/g, '\\n')
|
|
|
|
.replace(/\r/g, '\\r')
|
|
|
|
.replace(/\t/g, '\\t')
|
|
|
|
.replace(/\v/g, '\\v')
|
|
|
|
.replace(/\0/g, '\\0') +
|
|
|
|
`'`
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
await Promise.all([
|
2022-01-10 11:52:22 +01:00
|
|
|
$`yarn run build:ts`,
|
2021-10-06 12:49:04 +02:00
|
|
|
...packagesToBuild.map(
|
|
|
|
(workspace) => $`yarn workspace ${workspace} run build`,
|
|
|
|
),
|
|
|
|
])
|
2023-08-06 10:15:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void build()
|