async function transpile_typescript() {
  await execa('tsc', ['--build', 'tsconfig.json'], {preferLocal: true});

  const jsFiles = await globby(`packages/*/**/*.js`, {
    ignore: ['**/build/**', '**/src/**'],
  });

  for (const jsFile of jsFiles) {
    const {dir, name} = upath.parse(jsFile);
    const mjsFile = upath.join(dir, `${name}.mjs`);
    const mjsSource = `export * from './${name}.js';`;
    await fse.outputFile(mjsFile, mjsSource);
  }
}
Transpiles all packages listed in the root tsconfig.json's references section
into .js and .d.ts files. Creates stub .mjs files that re-export the contents
of the .js files.

Unlike other scripts, this does not take the --package= command line param
into account. Each project in packages/ theoretically could depend on any
other project, so kicking off a single, top-level compilation makes the
most sense (and is faster when all the packages need to be compiled).