2023-03-22 17:22:27 -04:00
|
|
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
|
|
|
// See LICENSE.txt for license information.
|
|
|
|
|
|
|
|
|
|
/* eslint-disable no-console */
|
|
|
|
|
|
2024-11-06 13:40:19 -05:00
|
|
|
import chalk from 'chalk';
|
|
|
|
|
import concurrently from 'concurrently';
|
2023-03-22 17:22:27 -04:00
|
|
|
|
2024-11-06 13:40:19 -05:00
|
|
|
import {getPlatformCommands} from './utils.mjs';
|
2023-03-22 17:22:27 -04:00
|
|
|
|
|
|
|
|
async function watchAllWithDevServer() {
|
|
|
|
|
console.log(chalk.inverse.bold('Watching web app and all subpackages...'));
|
|
|
|
|
|
|
|
|
|
const commands = [
|
2023-03-28 15:36:52 -04:00
|
|
|
{command: 'npm:dev-server --workspace=channels', name: 'webapp', prefixColor: 'cyan'},
|
2023-03-22 17:22:27 -04:00
|
|
|
];
|
|
|
|
|
|
2023-03-28 15:36:52 -04:00
|
|
|
commands.push(...getPlatformCommands('run'));
|
2023-03-22 17:22:27 -04:00
|
|
|
|
|
|
|
|
console.log('\n');
|
|
|
|
|
|
|
|
|
|
const {result} = concurrently(
|
|
|
|
|
commands,
|
|
|
|
|
{
|
|
|
|
|
killOthers: 'failure',
|
|
|
|
|
},
|
|
|
|
|
);
|
2023-10-10 11:17:24 -04:00
|
|
|
|
|
|
|
|
let exitCode = 0;
|
|
|
|
|
try {
|
|
|
|
|
await result;
|
|
|
|
|
} catch (closeEvents) {
|
|
|
|
|
exitCode = getExitCode(closeEvents, 0);
|
|
|
|
|
}
|
|
|
|
|
return exitCode;
|
2023-03-22 17:22:27 -04:00
|
|
|
}
|
|
|
|
|
|
2023-10-10 11:17:24 -04:00
|
|
|
watchAllWithDevServer().then((exitCode) => {
|
|
|
|
|
process.exit(exitCode);
|
|
|
|
|
});
|