sapper-iq 1.0.24 → 1.0.25
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 +1 -1
- package/sapper.mjs +19 -1
package/package.json
CHANGED
package/sapper.mjs
CHANGED
|
@@ -11,6 +11,14 @@ import { dirname, join } from 'path';
|
|
|
11
11
|
const __filename = fileURLToPath(import.meta.url);
|
|
12
12
|
const __dirname = dirname(__filename);
|
|
13
13
|
|
|
14
|
+
// Prevent process from exiting on unhandled errors
|
|
15
|
+
process.on('uncaughtException', (err) => {
|
|
16
|
+
console.error(chalk.red('\n❌ Uncaught exception:'), err.message);
|
|
17
|
+
});
|
|
18
|
+
process.on('unhandledRejection', (reason) => {
|
|
19
|
+
console.error(chalk.red('\n❌ Unhandled rejection:'), reason);
|
|
20
|
+
});
|
|
21
|
+
|
|
14
22
|
// Initialize versioning
|
|
15
23
|
let CURRENT_VERSION = "1.1.0";
|
|
16
24
|
try {
|
|
@@ -30,9 +38,19 @@ let rl = readline.createInterface({
|
|
|
30
38
|
});
|
|
31
39
|
|
|
32
40
|
async function safeQuestion(query) {
|
|
33
|
-
return new Promise((resolve) => {
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
34
42
|
process.stdout.write(query);
|
|
35
43
|
rl.once('line', (answer) => { resolve(answer.trim()); });
|
|
44
|
+
rl.once('close', () => {
|
|
45
|
+
// Readline was closed - recreate it and try again
|
|
46
|
+
recreateReadline();
|
|
47
|
+
resolve(''); // Return empty string to continue the loop
|
|
48
|
+
});
|
|
49
|
+
rl.once('error', (err) => {
|
|
50
|
+
console.error(chalk.red('Readline error:'), err.message);
|
|
51
|
+
recreateReadline();
|
|
52
|
+
resolve('');
|
|
53
|
+
});
|
|
36
54
|
});
|
|
37
55
|
}
|
|
38
56
|
|