3d10325873
This implements some basic infra for testing Theatre.js with popular setups such as npm/yarn/pnpm, webpack/vite/parcel, js/ts, etc. So far, the only existing setup has been with create-react-app. Will add more in the future. Co-authored-by: Fülöp <fulopkovacs@users.noreply.github.com> Co-authored-by: Aria Minaei <aria.minaei@gmail.com>
34 lines
844 B
JavaScript
34 lines
844 B
JavaScript
/**
|
|
* Build the test setups
|
|
*/
|
|
|
|
import path from 'path'
|
|
import {colorize, getEcosystemTestSetups} from './utils.mjs'
|
|
|
|
const root = path.resolve(__dirname, '../..')
|
|
const absPathOfEcosystemTestSetups = getEcosystemTestSetups(root)
|
|
|
|
const setupsWithErros = []
|
|
|
|
// Try building the setups
|
|
;(async function () {
|
|
for (const setupDir of absPathOfEcosystemTestSetups) {
|
|
try {
|
|
cd(setupDir)
|
|
await $`yarn build`
|
|
} catch (err) {
|
|
console.error(err)
|
|
setupsWithErros.push(setupDir)
|
|
}
|
|
}
|
|
|
|
// Stop if there were any errors during the build process,
|
|
// and print all of them to the console.
|
|
if (setupsWithErros.length !== 0) {
|
|
throw new Error(
|
|
`The following setups had problems when their dependencies were being installed:\n${colorize.red(
|
|
setupsWithErros.join('\n'),
|
|
)}`,
|
|
)
|
|
}
|
|
})()
|