Comparing version 1.2.0 to 1.3.0
@@ -6,2 +6,3 @@ #!/usr/bin/env node | ||
import process from "node:process"; | ||
import { ArgError, CheckResultError } from "./util/error.js"; | ||
const options = [ | ||
@@ -96,4 +97,10 @@ { | ||
includeDts: parsed["include-d-ts"] | ||
}).catch((error) => { | ||
if (error instanceof CheckResultError || error instanceof ArgError) { | ||
process.exitCode = 1; | ||
return; | ||
} | ||
throw error; | ||
}); | ||
}; | ||
main(); |
export { tsr, Config } from './tsr.js'; | ||
export { Logger } from './util/Logger.js'; | ||
export * from './util/error.js'; |
import { tsr, Config } from "./tsr.js"; | ||
import { Logger } from "./util/Logger.js"; | ||
export * from "./util/error.js"; | ||
export { | ||
@@ -4,0 +5,0 @@ Config, |
@@ -9,2 +9,3 @@ import ts from "typescript"; | ||
import { CliOutput } from "./util/CliOutput.js"; | ||
import { ArgError, CheckResultError } from "./util/error.js"; | ||
const createNodeJsLogger = () => "isTTY" in stdout && stdout.isTTY ? { | ||
@@ -50,9 +51,7 @@ write: stdout.write.bind(stdout), | ||
); | ||
system.exit(1); | ||
return; | ||
throw new ArgError(); | ||
} | ||
if (entrypointFiles.length === 0) { | ||
logger.write(pc.red(pc.bold("No files matched the entrypoints pattern\n"))); | ||
system.exit(1); | ||
return; | ||
throw new ArgError(); | ||
} | ||
@@ -73,3 +72,3 @@ logger.write( | ||
); | ||
await edit({ | ||
edit({ | ||
fileService, | ||
@@ -96,3 +95,5 @@ entrypoints: entrypointFiles, | ||
const { code } = output.done(); | ||
system.exit(code); | ||
if (code !== 0) { | ||
throw new CheckResultError(); | ||
} | ||
}; | ||
@@ -99,0 +100,0 @@ export { |
@@ -13,2 +13,2 @@ import ts from 'typescript'; | ||
recursive: boolean; | ||
}) => Promise<void>; | ||
}) => void; |
@@ -462,3 +462,3 @@ import ts from "typescript"; | ||
}; | ||
const edit = async ({ | ||
const edit = ({ | ||
entrypoints, | ||
@@ -557,3 +557,2 @@ fileService, | ||
} | ||
return Promise.resolve(); | ||
}; | ||
@@ -560,0 +559,0 @@ export { |
@@ -45,3 +45,3 @@ { | ||
}, | ||
"version": "1.2.0" | ||
"version": "1.3.0" | ||
} |
@@ -119,2 +119,4 @@ # tsr | ||
mode: 'check', | ||
}).catch(() => { | ||
process.exitCode = 1; | ||
}); | ||
@@ -121,0 +123,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
79893
45
2055
338