Skip to content

Commit e49642e

Browse files
authored
Merge branch 'master' into concurrently-prefix
2 parents 40a90f2 + a1f9ae5 commit e49642e

File tree

5 files changed

+16
-6
lines changed

5 files changed

+16
-6
lines changed

docs/cli/run.md

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ nav_order: 3
1010
**skuba** lets you interactively run your TypeScript source code during development.
1111
The following commands are powered by [`ts-node`] and [`ts-node-dev`].
1212

13+
These commands are only intended to serve local development and simple scripting scenarios,
14+
as a TypeScript process can present substantial overhead at runtime.
15+
In production, we recommend [`skuba build`]ing your project and executing under a regular Node.js runtime.
16+
1317
---
1418

1519
## skuba node
@@ -125,6 +129,7 @@ const app = express();
125129
export default Object.assign(app, { port });
126130
```
127131
132+
[`skuba build`]: ./build.md
128133
[`skuba-dive/register`]: https://github.com/seek-oss/skuba-dive#register
129134
[`ts-node-dev`]: https://github.com/whitecolor/ts-node-dev
130135
[`ts-node`]: https://github.com/typestrong/ts-node

src/cli/configure/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,8 @@ export const configure = async () => {
118118
log.plain(log.bold('yarn format'));
119119

120120
log.newline();
121-
process.exit(1);
121+
process.exitCode = 1;
122+
return;
122123
}
123124
try {
124125
await exec('npx', 'yarn-deduplicate', '--strategy=highest');

src/cli/init/index.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ export const init = async () => {
112112
log.ok('git push --set-upstream origin master');
113113

114114
log.newline();
115-
process.exit(1);
115+
process.exitCode = 1;
116+
return;
116117
}
117118

118119
log.newline();

src/skuba.ts

+3-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ const skuba = async () => {
3434

3535
if (!hasProp(commandModule, moduleName)) {
3636
log.err(log.bold(commandName), "couldn't run! Please submit an issue.");
37-
process.exit(1);
37+
process.exitCode = 1;
38+
return;
3839
}
3940

4041
const run = commandModule[moduleName] as () => Promise<unknown>;
@@ -46,7 +47,7 @@ const skuba = async () => {
4647
await showLogoAndVersionInfo();
4748
showHelp();
4849

49-
process.exit(1);
50+
process.exitCode = 1;
5051
};
5152

5253
skuba().catch(handleCliError);

src/utils/error.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ const isExecaError = (err: unknown): err is ExecaError =>
2424

2525
export const handleCliError = (err: unknown) => {
2626
if (isExecaError(err)) {
27-
process.exit(err.exitCode);
27+
process.exitCode = err.exitCode;
28+
return;
2829
}
2930

3031
log.err(err);
31-
process.exit(1);
32+
process.exitCode = 1;
33+
return;
3234
};
3335

3436
export const isErrorWithCode = <T>(

0 commit comments

Comments
 (0)