standard-scripts.js 649 B

123456789101112131415161718192021222324
  1. #!/usr/bin/env node
  2. import { join as joinPaths } from 'path'
  3. import { fileURLToPath } from 'url'
  4. const thisPkgDir = joinPaths(fileURLToPath(import.meta.url), '../..')
  5. // temporary (for compiling ts)
  6. import { promisify } from 'util'
  7. import { execFile } from 'child_process'
  8. import { copyFile } from 'fs/promises'
  9. await copyFile(
  10. joinPaths(thisPkgDir, 'tsconfig.safe.json'),
  11. joinPaths(thisPkgDir, 'tsconfig.json'),
  12. )
  13. const execFileP = promisify(execFile)
  14. await execFileP(
  15. './node_modules/.bin/tsc',
  16. ['-b'],
  17. { cwd: thisPkgDir, stdio: 'inherit' },
  18. )
  19. const stuff = await import('../dist/utils/script-runner.js')
  20. stuff.runScript(thisPkgDir)