@catladder/cli 0.0.0-main-4888e4df → 0.0.0-main-e965db8c

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -53,7 +53,7 @@
53
53
  }
54
54
  ],
55
55
  "license": "MIT",
56
- "version": "0.0.0-main-4888e4df",
56
+ "version": "0.0.0-main-e965db8c",
57
57
  "scripts": {
58
58
  "lint": "eslint \"src/**/*.ts\"",
59
59
  "lint:fix": "eslint \"src/**/*.ts\" --fix",
package/scripts/bundle CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/bin/bash
2
- ncc build dist/cli/src/catenv.js -o dist/bundles/catenv -e 'tsx/cjs/api' --source-map $( ((SHOULD_MINIFY == 1)) && printf %s '-m')
2
+ ncc build dist/cli/src/catenv.js -o dist/bundles/catenv -e 'tsx/cjs/api' $( ((SHOULD_MINIFY == 1)) && printf %s '-m')
3
3
 
4
- ncc build dist/cli/src/cli.js -o dist/bundles/cli -e 'tsx/cjs/api' --source-map $( ((SHOULD_MINIFY == 1)) && printf %s '-m')
4
+ ncc build dist/cli/src/cli.js -o dist/bundles/cli -e 'tsx/cjs/api' $( ((SHOULD_MINIFY == 1)) && printf %s '-m')
package/src/catenv.ts CHANGED
@@ -27,4 +27,18 @@ program
27
27
  },
28
28
  );
29
29
 
30
+ // Prevent Node.js from printing the (minified) source line on uncaught errors
31
+ process.on("uncaughtException", (err) => {
32
+ console.error(err.stack ?? `${err.name}: ${err.message}`);
33
+ process.exit(1);
34
+ });
35
+ process.on("unhandledRejection", (reason) => {
36
+ if (reason instanceof Error) {
37
+ console.error(reason.stack ?? `${reason.name}: ${reason.message}`);
38
+ } else {
39
+ console.error(reason);
40
+ }
41
+ process.exit(1);
42
+ });
43
+
30
44
  program.parse();
package/src/cli.ts CHANGED
@@ -227,4 +227,18 @@ process.on("exit", () => {
227
227
  stopAllPortForwards();
228
228
  });
229
229
 
230
+ // Prevent Node.js from printing the (minified) source line on uncaught errors
231
+ process.on("uncaughtException", (err) => {
232
+ console.error(err.stack ?? `${err.name}: ${err.message}`);
233
+ process.exit(1);
234
+ });
235
+ process.on("unhandledRejection", (reason) => {
236
+ if (reason instanceof Error) {
237
+ console.error(reason.stack ?? `${reason.name}: ${reason.message}`);
238
+ } else {
239
+ console.error(reason);
240
+ }
241
+ process.exit(1);
242
+ });
243
+
230
244
  registerAllCommands().then(() => program.parse());