Add dev script
This commit is contained in:
parent
b34bb417b9
commit
cf8b02421f
2 changed files with 22 additions and 0 deletions
21
dev.js
Normal file
21
dev.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
const { exec } = require('child_process')
|
||||
const path = require('path');
|
||||
const toRun = process.argv.slice(2).join(" ").split('---');
|
||||
|
||||
const waitForProcess = async (proc) => {
|
||||
return new Promise((resolve, reject) => {
|
||||
proc.stdout?.on('data', console.log);
|
||||
proc.stderr?.on('data', console.error);
|
||||
proc.on('close', resolve);
|
||||
proc.on('error', reject);
|
||||
});
|
||||
};
|
||||
|
||||
(async () => {
|
||||
await waitForProcess(exec('npm run tsc test false'));
|
||||
for (let command of toRun) {
|
||||
await waitForProcess(exec(`node index.js ${command}`, {
|
||||
cwd: path.join(__dirname, 'lib')
|
||||
}))
|
||||
}
|
||||
})();
|
||||
1
tsc.ts
1
tsc.ts
|
|
@ -38,6 +38,7 @@ const ignore = [
|
|||
'*/*\\.tsx?$',
|
||||
'./fonts*',
|
||||
'./gui/react*',
|
||||
'./dev.js$'
|
||||
].map(a => a.replace(/\*/g, '[^]*').replace(/\.\//g, escapeRegExp(__dirname) + '/').replace(/\//g, path.sep === '\\' ? '\\\\' : '/')).map(a => new RegExp(a, 'i'));
|
||||
|
||||
export { ignore };
|
||||
|
|
|
|||
Loading…
Reference in a new issue