Skip to content

Commit

Permalink
feat: run tsc with --noEmit, unless for -prod commands
Browse files Browse the repository at this point in the history
  • Loading branch information
kirillgroshkov committed Sep 17, 2022
1 parent 5937a54 commit 2b38d8d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/bin/bt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { tsc } from '../util/tsc.util'
runScript(async () => {
fs.emptyDirSync('./dist') // it doesn't delete the dir itself, to prevent IDE jumping
// fs.rmSync('./dist', { recursive: true, force: true })
await tsc()
await tsc(true)
await tscScriptsCommand()
await runJest()
})
2 changes: 1 addition & 1 deletion src/bin/btl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ runScript(async () => {
await lintAllCommand()
fs.emptyDirSync('./dist') // it doesn't delete the dir itself, to prevent IDE jumping
// fs.rmSync('./dist', { recursive: true, force: true })
await tsc()
await tsc(true)
await tscScriptsCommand()
await runJest()
})
2 changes: 1 addition & 1 deletion src/bin/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ import { tsc } from '../util/tsc.util'
runScript(async () => {
fs.emptyDirSync('./dist') // it doesn't delete the dir itself, to prevent IDE jumping
// fs.rmSync('./dist', { recursive: true, force: true })
await tsc()
await tsc(true)
await tscScriptsCommand()
})
5 changes: 3 additions & 2 deletions src/util/tsc.util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import { execCommand } from '@naturalcycles/nodejs-lib/dist/exec'
import { kpySync } from '@naturalcycles/nodejs-lib/dist/fs'
import { cfgDir } from '../cnst/paths.cnst'

export async function tsc(): Promise<void> {
export async function tsc(noEmit = false): Promise<void> {
const started = Date.now()
await execCommand('tsc')
const cmd = ['tsc', noEmit && '--noEmit'].filter(Boolean).join(' ')
await execCommand(cmd)
console.log(`${boldGrey('tsc')} ${dimGrey(`took ` + _since(started))}`)
}

Expand Down

0 comments on commit 2b38d8d

Please sign in to comment.