The old run-dev script raced electron and tsc against each other in
parallel, which usually meant electron would run stale JS files. We
should overhaul the build process at some point, but whatever we do,
this script isn’t going to be part of it.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
And enable the import/unambiguous ESLint rule as a check on our
partition between scripts and modules. After this commit, if you add
a new file and get this error:
✖ 1:1 This module could be parsed as a valid script. import/unambiguous
* For a module, add an `import` or `export` declaration to make the
file unambiguously a module (the empty `export {};` declaration
suffices).
* For a script, add the file to the xo overrides section of
package.json that marks it "sourceType": "script", and add a 'use
strict' declaration.
Signed-off-by: Anders Kaseorg <anders@zulipchat.com>
This tool handles edge cases where all the typescript files might not
be compiled when the electron process starts this defer that; it runs
tsc compiler first.
Next, we want to only run the compiler if the files are not
compiled.