@idlebox/node 1.4.12 → 1.4.13

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.
Files changed (45) hide show
  1. package/lib/asyncLoad.d.ts +1 -0
  2. package/lib/asyncLoad.d.ts.map +1 -1
  3. package/lib/asyncLoad.js +3 -2
  4. package/lib/asyncLoad.js.map +1 -1
  5. package/lib/autoindex.d.ts +2 -14
  6. package/lib/autoindex.d.ts.map +1 -1
  7. package/lib/autoindex.js +4 -18
  8. package/lib/autoindex.js.map +1 -1
  9. package/lib/child_process/respawn.d.ts +2 -0
  10. package/lib/child_process/respawn.d.ts.map +1 -1
  11. package/lib/child_process/respawn.js +2 -0
  12. package/lib/child_process/respawn.js.map +1 -1
  13. package/lib/fs/exists.js +1 -1
  14. package/lib/fs/exists.js.map +1 -1
  15. package/lib/lifecycle/register.d.ts +6 -2
  16. package/lib/lifecycle/register.d.ts.map +1 -1
  17. package/lib/lifecycle/register.js +94 -56
  18. package/lib/lifecycle/register.js.map +1 -1
  19. package/lib/lifecycle/workingDirectory.d.ts +11 -0
  20. package/lib/lifecycle/workingDirectory.d.ts.map +1 -0
  21. package/lib/lifecycle/workingDirectory.js +40 -0
  22. package/lib/lifecycle/workingDirectory.js.map +1 -0
  23. package/lib/tsconfig.tsbuildinfo +1 -1
  24. package/package.json +5 -6
  25. package/src/asyncLoad.ts +3 -2
  26. package/src/autoindex.ts +4 -21
  27. package/src/child_process/respawn.ts +2 -0
  28. package/src/fs/exists.ts +1 -1
  29. package/src/lifecycle/register.ts +91 -58
  30. package/src/lifecycle/workingDirectory.ts +45 -0
  31. package/lib/error/linux.d.ts +0 -125
  32. package/lib/error/linux.d.ts.map +0 -1
  33. package/lib/error/linux.js +0 -126
  34. package/lib/error/linux.js.map +0 -1
  35. package/lib/error/types.d.ts +0 -24
  36. package/lib/error/types.d.ts.map +0 -1
  37. package/lib/error/types.js +0 -25
  38. package/lib/error/types.js.map +0 -1
  39. package/lib/lifecycle/internal-errors.d.ts +0 -23
  40. package/lib/lifecycle/internal-errors.d.ts.map +0 -1
  41. package/lib/lifecycle/internal-errors.js +0 -60
  42. package/lib/lifecycle/internal-errors.js.map +0 -1
  43. package/src/error/linux.ts +0 -124
  44. package/src/error/types.ts +0 -39
  45. package/src/lifecycle/internal-errors.ts +0 -66
@@ -1,23 +1,15 @@
1
1
  /** biome-ignore-all lint/suspicious/noDebugger: debug file */
2
2
 
3
- import { AppExit, ensureDisposeGlobal, ensureGlobalObject, prettyPrintError, type MyCallback } from '@idlebox/common';
3
+ import { ensureDisposeGlobal, ensureGlobalObject, functionName, isProductionMode, prettyPrintError, type MyCallback } from '@idlebox/common';
4
+ import { ErrorWithCode, Exit, ExitCode, InterruptError, UncaughtException, UnhandledRejection } from '@idlebox/errors';
4
5
  import assert from 'node:assert';
5
- import { createRequire, syncBuiltinESMExports } from 'node:module';
6
+ import { syncBuiltinESMExports } from 'node:module';
6
7
  import { basename } from 'node:path';
7
8
  import process from 'node:process';
8
- import { Exit, InterruptError, UncaughtException, UnhandledRejection } from './internal-errors.js';
9
+ import { inspect } from 'node:util';
9
10
 
10
11
  const originalExit: (code?: number) => never = process.exit;
11
12
  const prefix = process.stderr.isTTY ? '' : `<${title()} ${process.pid}> `;
12
- const hasInspect = process.argv.some((arg) => arg.startsWith('--inspect=') || arg.startsWith('--inspect-brk=') || arg === '--inspect' || arg === '--inspect-brk');
13
-
14
- let abnormalExitCode = 1;
15
- export function setAbnormalExitCode(code: number) {
16
- if (code < 1) {
17
- throw new TypeError(`abnormal exit code must be greater than 0, got ${code}`);
18
- }
19
- abnormalExitCode = code;
20
- }
21
13
 
22
14
  function title() {
23
15
  if (process.title && process.title !== 'node') {
@@ -30,22 +22,29 @@ function getCurrentCode() {
30
22
  return typeof process.exitCode === 'string' ? parseInt(process.exitCode) : process.exitCode || 0;
31
23
  }
32
24
 
33
- let shuttingDown = false;
34
- export function shutdown(exitCode: number): never {
35
- if (hasInspect) debugger;
36
-
37
- if (exitCode) {
25
+ export function setExitCodeIfNot(exitCode: number) {
26
+ if (exitCode || typeof process.exitCode !== 'number') {
38
27
  process.exitCode = exitCode;
28
+ globalThis.process.exitCode = exitCode;
39
29
  }
30
+ }
31
+
32
+ let shuttingDown = 0;
33
+ export function shutdown(exitCode: number): never {
34
+ _shutdown(exitCode);
35
+ throw new Exit(getCurrentCode());
36
+ }
37
+ function _shutdown(exitCode: number) {
38
+ setExitCodeIfNot(exitCode);
40
39
 
41
40
  if (!shuttingDown) {
42
- shuttingDown = true;
41
+ shuttingDown = 1;
43
42
  ensureDisposeGlobal().finally(() => {
44
43
  originalExit(getCurrentCode());
45
44
  });
45
+ } else {
46
+ shuttingDown++;
46
47
  }
47
-
48
- throw new Exit(getCurrentCode());
49
48
  }
50
49
 
51
50
  const typed_error_handlers = new WeakMap<ErrorConstructor, MyCallback<[Error]>>();
@@ -68,19 +67,30 @@ export function registerNodejsGlobalTypedErrorHandler(ErrorCls: ErrorConstructor
68
67
  typed_error_handlers.set(ErrorCls, fn);
69
68
  }
70
69
 
71
- function callErrorHandler(e: unknown) {
70
+ function uniqueErrorHandler(e: unknown, logger: IDebugOutput) {
71
+ if (!isProductionMode) logger.verbose?.(`uniqueErrorHandler:`);
72
72
  if (!(e instanceof Error)) {
73
73
  prettyPrintError(`${prefix}catch unexpect object`, new Error(`error object is ${typeof e} ${e ? (e as any).constructor?.name : 'unknown'}`));
74
- throw originalExit(abnormalExitCode);
74
+ throw originalExit(ExitCode.PROGRAM);
75
+ }
76
+
77
+ if (e instanceof Exit) {
78
+ if (!isProductionMode) logger.verbose?.(` - skip exit object`);
79
+ if (!shuttingDown) {
80
+ _shutdown(e.code);
81
+ }
82
+ throw e;
75
83
  }
76
84
 
77
85
  try {
78
86
  const catcher = typed_error_handlers.get(e.constructor as ErrorConstructor);
79
87
  if (catcher) {
88
+ if (!isProductionMode) logger.verbose?.(` - call catcher ${functionName(catcher)}`);
80
89
  catcher(e);
81
90
  return;
82
91
  }
83
92
  for (const [Cls, fn] of inherit_error_handlers) {
93
+ if (!isProductionMode) logger.verbose?.(` - call inherited catcher ${functionName(fn)}`);
84
94
  if (e instanceof Cls) {
85
95
  fn(e);
86
96
  return;
@@ -96,73 +106,93 @@ function callErrorHandler(e: unknown) {
96
106
  }
97
107
 
98
108
  if (e instanceof InterruptError) {
99
- if (shuttingDown) {
100
- console.error(`${prefix}Exiting immediately.`);
101
- originalExit(1);
109
+ if (!isProductionMode) logger.verbose?.(` - shuttingDown = ${shuttingDown}`);
110
+ if (shuttingDown > 5) {
111
+ logger.output(`${prefix}Exiting immediately.`);
112
+ originalExit(ExitCode.INTERRUPT);
102
113
  }
103
114
 
104
- shutdown(0);
105
- }
106
- if (e instanceof AppExit) {
107
- ensureDisposeGlobal().finally(() => {
108
- originalExit(getCurrentCode());
109
- });
115
+ shutdown(ExitCode.INTERRUPT);
110
116
  }
111
- if (e instanceof UncaughtException) {
117
+ if (e instanceof UnhandledRejection) {
118
+ if (!isProductionMode) logger.verbose?.(` - UnhandledRejection`);
112
119
  if (e.cause instanceof Error) {
113
120
  prettyPrintError(`${prefix}Unhandled Rejection`, e.cause);
114
121
  } else {
115
- console.error(`${prefix}Unhandled Rejection / error type unknown:`, e.cause);
122
+ logger.output(`${prefix}Unhandled Rejection / error type unknown: ${inspect(e.cause)}`);
116
123
  }
117
- shutdown(abnormalExitCode);
124
+ return;
118
125
  }
119
126
  if (e instanceof UncaughtException) {
127
+ if (!isProductionMode) logger.verbose?.(` - UncaughtException`);
120
128
  prettyPrintError(`${prefix}Uncaught Exception`, e.cause);
121
- shutdown(abnormalExitCode);
129
+ return;
122
130
  }
131
+
132
+ if (!isProductionMode) logger.verbose?.(` - common error`);
133
+ prettyPrintError(`${prefix}unhandled global exception`, e);
134
+ shutdown(ExitCode.PROGRAM);
135
+ }
136
+
137
+ interface IDebugOutput {
138
+ output(message: string): void;
139
+ verbose?(message: string): void;
123
140
  }
124
141
 
125
142
  /**
126
143
  * 注册nodejs退出处理器
127
144
  */
128
- export function registerNodejsExitHandler() {
129
- ensureGlobalObject('exithandler/register', _real_register);
145
+ export function registerNodejsExitHandler(logger: IDebugOutput = { output: console.error }) {
146
+ ensureGlobalObject('exithandler/register', () => _real_register(logger));
130
147
  }
131
- function _real_register() {
148
+ function _real_register(logger: IDebugOutput) {
149
+ logger.verbose?.(`register nodejs exit handler: production=${isProductionMode}`);
132
150
  process.on('SIGINT', () => {
133
- console.error(`\n${prefix}Received SIGINT. Exiting gracefully...`);
134
- callErrorHandler(new InterruptError('SIGINT'));
151
+ logger.output(`\n${prefix}Received SIGINT. Exiting gracefully...`);
152
+ uniqueErrorHandler(new InterruptError('SIGINT'), logger);
135
153
  });
136
154
 
137
155
  process.on('SIGTERM', () => {
138
- console.error(`${prefix}Received SIGTERM. Exiting gracefully...`);
139
- callErrorHandler(new InterruptError('SIGTERM'));
156
+ logger.output(`${prefix}Received SIGTERM. Exiting gracefully...`);
157
+ uniqueErrorHandler(new InterruptError('SIGTERM'), logger);
140
158
  });
141
159
 
142
160
  process.on('beforeExit', (code) => {
143
161
  // empty handler prevent real exit
144
- shutdown(code);
145
- });
146
-
147
- process.on('unhandledRejection', (reason, promise) => {
148
- if (reason instanceof AppExit) {
149
- return;
162
+ if (!isProductionMode) logger.verbose?.(`process: beforeExit: ${code}`);
163
+ if (process.exitCode === undefined || process.exitCode === '') {
164
+ code = ExitCode.EXECUTION;
165
+ logger.output(`${prefix}beforeExit called, but process.exitCode has not been set, switch to ${code}`);
150
166
  }
151
- if (hasInspect) debugger;
152
- callErrorHandler(new UnhandledRejection(reason, promise));
167
+ _shutdown(code);
153
168
  });
154
169
 
155
- const processMdl = createRequire(import.meta.url)('node:process');
156
- processMdl.exit = shutdown;
157
- syncBuiltinESMExports();
170
+ function finalThrow(e: UnhandledRejection | UncaughtException) {
171
+ try {
172
+ uniqueErrorHandler(e, logger);
158
173
 
159
- function uncaughtException(error: Error): void {
160
- if (error instanceof AppExit) {
161
- return;
174
+ if (e.cause instanceof ErrorWithCode) {
175
+ if (!isProductionMode) logger.verbose?.(`finalThrow: got code: ${e.cause.code}`);
176
+ _shutdown(e.cause.code);
177
+ } else {
178
+ if (!isProductionMode) logger.verbose?.(`finalThrow: not got code: ${e.cause} `);
179
+ _shutdown(ExitCode.PROGRAM);
180
+ }
181
+ } catch (e: any) {
182
+ if (e instanceof Exit) {
183
+ return;
184
+ }
185
+ prettyPrintError('Exception while handling error', e);
186
+ _shutdown(ExitCode.PROGRAM);
162
187
  }
163
- if (hasInspect) debugger;
188
+ }
189
+
190
+ process.on('unhandledRejection', (reason, promise) => {
191
+ finalThrow(new UnhandledRejection(reason, promise));
192
+ });
164
193
 
165
- callErrorHandler(new UncaughtException(error));
194
+ function uncaughtException(error: Error): void {
195
+ finalThrow(new UncaughtException(error));
166
196
  }
167
197
 
168
198
  if (process.hasUncaughtExceptionCaptureCallback()) {
@@ -171,6 +201,9 @@ function _real_register() {
171
201
  }
172
202
  process.setUncaughtExceptionCaptureCallback(uncaughtException);
173
203
 
204
+ process.exit = shutdown;
205
+ syncBuiltinESMExports();
206
+
174
207
  return true;
175
208
  }
176
209
 
@@ -0,0 +1,45 @@
1
+ import { noop, vscEscapeValue } from '@idlebox/common';
2
+ import { syncBuiltinESMExports } from 'node:module';
3
+ import process from 'node:process';
4
+
5
+ const originalChdir = process.chdir;
6
+ const originalCwd = process.cwd;
7
+
8
+ let currentEnvironmentChdir = originalChdir;
9
+ const currentEnvironmentCwd = originalCwd;
10
+ let patch = noop;
11
+
12
+ const wd = {
13
+ cwd() {
14
+ return currentEnvironmentCwd();
15
+ },
16
+ chdir(dir: string) {
17
+ currentEnvironmentChdir(dir);
18
+ },
19
+ patchGlobal() {
20
+ patch();
21
+ wd.cwd = currentEnvironmentCwd;
22
+ wd.chdir = currentEnvironmentChdir;
23
+ wd.patchGlobal = noop;
24
+ },
25
+ escapeVscodeCwd,
26
+ isVscodeShellIntegration: process.env.VSCODE_SHELL_INTEGRATION || process.env.VSCODE_SHELL_INTEGRATION_SHELL_SCRIPT,
27
+ };
28
+
29
+ export const workingDirectory: Readonly<typeof wd> = wd;
30
+
31
+ function escapeVscodeCwd(path: string) {
32
+ return `\x1B]633;P;Cwd=${vscEscapeValue(path)}\x07`;
33
+ }
34
+
35
+ if (wd.isVscodeShellIntegration) {
36
+ currentEnvironmentChdir = (newRoot: string) => {
37
+ process.stderr.write(escapeVscodeCwd(newRoot));
38
+ originalChdir(newRoot);
39
+ };
40
+ patch = () => {
41
+ process.chdir = currentEnvironmentChdir;
42
+ globalThis.process.chdir = currentEnvironmentChdir;
43
+ syncBuiltinESMExports();
44
+ };
45
+ }
@@ -1,125 +0,0 @@
1
- export declare enum LinuxError {
2
- EPERM = "EPERM",
3
- ENOENT = "ENOENT",
4
- ESRCH = "ESRCH",
5
- EINTR = "EINTR",
6
- EIO = "EIO",
7
- ENXIO = "ENXIO",
8
- E2BIG = "E2BIG",
9
- ENOEXEC = "ENOEXEC",
10
- EBADF = "EBADF",
11
- ECHILD = "ECHILD",
12
- EAGAIN = "EAGAIN",
13
- ENOMEM = "ENOMEM",
14
- EACCES = "EACCES",
15
- EFAULT = "EFAULT",
16
- ENOTBLK = "ENOTBLK",
17
- EBUSY = "EBUSY",
18
- EEXIST = "EEXIST",
19
- EXDEV = "EXDEV",
20
- ENODEV = "ENODEV",
21
- ENOTDIR = "ENOTDIR",
22
- EISDIR = "EISDIR",
23
- EINVAL = "EINVAL",
24
- ENFILE = "ENFILE",
25
- EMFILE = "EMFILE",
26
- ENOTTY = "ENOTTY",
27
- ETXTBSY = "ETXTBSY",
28
- EFBIG = "EFBIG",
29
- ENOSPC = "ENOSPC",
30
- ESPIPE = "ESPIPE",
31
- EROFS = "EROFS",
32
- EMLINK = "EMLINK",
33
- EPIPE = "EPIPE",
34
- EDOM = "EDOM",
35
- ERANGE = "ERANGE",
36
- ENOMSG = "ENOMSG",
37
- EIDRM = "EIDRM",
38
- ECHRNG = "ECHRNG",
39
- EL2NSYNC = "EL2NSYNC",
40
- EL3HLT = "EL3HLT",
41
- EL3RST = "EL3RST",
42
- ELNRNG = "ELNRNG",
43
- EUNATCH = "EUNATCH",
44
- ENOCSI = "ENOCSI",
45
- EL2HLT = "EL2HLT",
46
- EDEADLK = "EDEADLK",
47
- ENOLCK = "ENOLCK",
48
- EBADE = "EBADE",
49
- EBADR = "EBADR",
50
- EXFULL = "EXFULL",
51
- ENOANO = "ENOANO",
52
- EBADRQC = "EBADRQC",
53
- EBADSLT = "EBADSLT",
54
- EDEADLOCK = "EDEADLOCK",
55
- EBFONT = "EBFONT",
56
- ENOSTR = "ENOSTR",
57
- ENODATA = "ENODATA",
58
- ETIME = "ETIME",
59
- ENOSR = "ENOSR",
60
- ENONET = "ENONET",
61
- ENOPKG = "ENOPKG",
62
- EREMOTE = "EREMOTE",
63
- ENOLINK = "ENOLINK",
64
- EADV = "EADV",
65
- ESRMNT = "ESRMNT",
66
- ECOMM = "ECOMM",
67
- EPROTO = "EPROTO",
68
- EMULTIHOP = "EMULTIHOP",
69
- ELBIN = "ELBIN",
70
- EDOTDOT = "EDOTDOT",
71
- EBADMSG = "EBADMSG",
72
- EFTYPE = "EFTYPE",
73
- ENOTUNIQ = "ENOTUNIQ",
74
- EBADFD = "EBADFD",
75
- EREMCHG = "EREMCHG",
76
- ELIBACC = "ELIBACC",
77
- ELIBBAD = "ELIBBAD",
78
- ELIBSCN = "ELIBSCN",
79
- ELIBMAX = "ELIBMAX",
80
- ELIBEXEC = "ELIBEXEC",
81
- ENOSYS = "ENOSYS",
82
- ENMFILE = "ENMFILE",
83
- ENOTEMPTY = "ENOTEMPTY",
84
- ENAMETOOLONG = "ENAMETOOLONG",
85
- ELOOP = "ELOOP",
86
- EOPNOTSUPP = "EOPNOTSUPP",
87
- EPFNOSUPPORT = "EPFNOSUPPORT",
88
- ECONNRESET = "ECONNRESET",
89
- ENOBUFS = "ENOBUFS",
90
- EAFNOSUPPORT = "EAFNOSUPPORT",
91
- EPROTOTYPE = "EPROTOTYPE",
92
- ENOTSOCK = "ENOTSOCK",
93
- ENOPROTOOPT = "ENOPROTOOPT",
94
- ESHUTDOWN = "ESHUTDOWN",
95
- ECONNREFUSED = "ECONNREFUSED",
96
- EADDRINUSE = "EADDRINUSE",
97
- ECONNABORTED = "ECONNABORTED",
98
- ENETUNREACH = "ENETUNREACH",
99
- ENETDOWN = "ENETDOWN",
100
- ETIMEDOUT = "ETIMEDOUT",
101
- EHOSTDOWN = "EHOSTDOWN",
102
- EHOSTUNREACH = "EHOSTUNREACH",
103
- EINPROGRESS = "EINPROGRESS",
104
- EALREADY = "EALREADY",
105
- EDESTADDRREQ = "EDESTADDRREQ",
106
- EMSGSIZE = "EMSGSIZE",
107
- EPROTONOSUPPORT = "EPROTONOSUPPORT",
108
- ESOCKTNOSUPPORT = "ESOCKTNOSUPPORT",
109
- EADDRNOTAVAIL = "EADDRNOTAVAIL",
110
- ENETRESET = "ENETRESET",
111
- EISCONN = "EISCONN",
112
- ENOTCONN = "ENOTCONN",
113
- ETOOMANYREFS = "ETOOMANYREFS",
114
- EPROCLIM = "EPROCLIM",
115
- EUSERS = "EUSERS",
116
- EDQUOT = "EDQUOT",
117
- ESTALE = "ESTALE",
118
- ENOTSUP = "ENOTSUP",
119
- ENOMEDIUM = "ENOMEDIUM",
120
- ENOSHARE = "ENOSHARE",
121
- ECASECLASH = "ECASECLASH",
122
- EILSEQ = "EILSEQ",
123
- EOVERFLOW = "EOVERFLOW"
124
- }
125
- //# sourceMappingURL=linux.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"linux.d.ts","sourceRoot":"","sources":["../../src/error/linux.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACrB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,KAAK,UAAU;IACf,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,KAAK,UAAU;IACf,OAAO,YAAY;IACnB,KAAK,UAAU;IACf,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WA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AY;IACnB,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,KAAK,UAAU;IACf,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,QAAQ,aAAa;IACrB,WAAW,gBAAgB;IAC3B,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,UAAU,eAAe;IACzB,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,SAAS,cAAc;IACvB,YAAY,iBAAiB;IAC7B,WAAW,gBAAgB;IAC3B,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,eAAe,oBAAoB;IACnC,eAAe,oBAAoB;IACnC,aAAa,kBAAkB;IAC/B,SAAS,cAAc;IACvB,OAAO,YAAY;IACnB,QAAQ,aAAa;IACrB,YAAY,iBAAiB;IAC7B,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,MAAM,WAAW;IACjB,SAAS,cAAc;CACvB"}
@@ -1,126 +0,0 @@
1
- export var LinuxError;
2
- (function (LinuxError) {
3
- LinuxError["EPERM"] = "EPERM"; /* Not super-user */
4
- LinuxError["ENOENT"] = "ENOENT"; /* No such file or directory */
5
- LinuxError["ESRCH"] = "ESRCH"; /* No such process */
6
- LinuxError["EINTR"] = "EINTR"; /* Interrupted system call */
7
- LinuxError["EIO"] = "EIO"; /* I/O error */
8
- LinuxError["ENXIO"] = "ENXIO"; /* No such device or address */
9
- LinuxError["E2BIG"] = "E2BIG"; /* Arg list too long */
10
- LinuxError["ENOEXEC"] = "ENOEXEC"; /* Exec format error */
11
- LinuxError["EBADF"] = "EBADF"; /* Bad file number */
12
- LinuxError["ECHILD"] = "ECHILD"; /* No children */
13
- LinuxError["EAGAIN"] = "EAGAIN"; /* No more processes */
14
- LinuxError["ENOMEM"] = "ENOMEM"; /* Not enough core */
15
- LinuxError["EACCES"] = "EACCES"; /* Permission denied */
16
- LinuxError["EFAULT"] = "EFAULT"; /* Bad address */
17
- LinuxError["ENOTBLK"] = "ENOTBLK"; /* Block device required */
18
- LinuxError["EBUSY"] = "EBUSY"; /* Mount device busy */
19
- LinuxError["EEXIST"] = "EEXIST"; /* File exists */
20
- LinuxError["EXDEV"] = "EXDEV"; /* Cross-device link */
21
- LinuxError["ENODEV"] = "ENODEV"; /* No such device */
22
- LinuxError["ENOTDIR"] = "ENOTDIR"; /* Not a directory */
23
- LinuxError["EISDIR"] = "EISDIR"; /* Is a directory */
24
- LinuxError["EINVAL"] = "EINVAL"; /* Invalid argument */
25
- LinuxError["ENFILE"] = "ENFILE"; /* Too many open files in system */
26
- LinuxError["EMFILE"] = "EMFILE"; /* Too many open files */
27
- LinuxError["ENOTTY"] = "ENOTTY"; /* Not a typewriter */
28
- LinuxError["ETXTBSY"] = "ETXTBSY"; /* Text file busy */
29
- LinuxError["EFBIG"] = "EFBIG"; /* File too large */
30
- LinuxError["ENOSPC"] = "ENOSPC"; /* No space left on device */
31
- LinuxError["ESPIPE"] = "ESPIPE"; /* Illegal seek */
32
- LinuxError["EROFS"] = "EROFS"; /* Read only file system */
33
- LinuxError["EMLINK"] = "EMLINK"; /* Too many links */
34
- LinuxError["EPIPE"] = "EPIPE"; /* Broken pipe */
35
- LinuxError["EDOM"] = "EDOM"; /* Math arg out of domain of func */
36
- LinuxError["ERANGE"] = "ERANGE"; /* Math result not representable */
37
- LinuxError["ENOMSG"] = "ENOMSG"; /* No message of desired type */
38
- LinuxError["EIDRM"] = "EIDRM"; /* Identifier removed */
39
- LinuxError["ECHRNG"] = "ECHRNG"; /* Channel number out of range */
40
- LinuxError["EL2NSYNC"] = "EL2NSYNC"; /* Level 2 not synchronized */
41
- LinuxError["EL3HLT"] = "EL3HLT"; /* Level 3 halted */
42
- LinuxError["EL3RST"] = "EL3RST"; /* Level 3 reset */
43
- LinuxError["ELNRNG"] = "ELNRNG"; /* Link number out of range */
44
- LinuxError["EUNATCH"] = "EUNATCH"; /* Protocol driver not attached */
45
- LinuxError["ENOCSI"] = "ENOCSI"; /* No CSI structure available */
46
- LinuxError["EL2HLT"] = "EL2HLT"; /* Level 2 halted */
47
- LinuxError["EDEADLK"] = "EDEADLK"; /* Deadlock condition */
48
- LinuxError["ENOLCK"] = "ENOLCK"; /* No record locks available */
49
- LinuxError["EBADE"] = "EBADE"; /* Invalid exchange */
50
- LinuxError["EBADR"] = "EBADR"; /* Invalid request descriptor */
51
- LinuxError["EXFULL"] = "EXFULL"; /* Exchange full */
52
- LinuxError["ENOANO"] = "ENOANO"; /* No anode */
53
- LinuxError["EBADRQC"] = "EBADRQC"; /* Invalid request code */
54
- LinuxError["EBADSLT"] = "EBADSLT"; /* Invalid slot */
55
- LinuxError["EDEADLOCK"] = "EDEADLOCK"; /* File locking deadlock error */
56
- LinuxError["EBFONT"] = "EBFONT"; /* Bad font file fmt */
57
- LinuxError["ENOSTR"] = "ENOSTR"; /* Device not a stream */
58
- LinuxError["ENODATA"] = "ENODATA"; /* No data (for no delay io) */
59
- LinuxError["ETIME"] = "ETIME"; /* Timer expired */
60
- LinuxError["ENOSR"] = "ENOSR"; /* Out of streams resources */
61
- LinuxError["ENONET"] = "ENONET"; /* Machine is not on the network */
62
- LinuxError["ENOPKG"] = "ENOPKG"; /* Package not installed */
63
- LinuxError["EREMOTE"] = "EREMOTE"; /* The object is remote */
64
- LinuxError["ENOLINK"] = "ENOLINK"; /* The link has been severed */
65
- LinuxError["EADV"] = "EADV"; /* Advertise error */
66
- LinuxError["ESRMNT"] = "ESRMNT"; /* Srmount error */
67
- LinuxError["ECOMM"] = "ECOMM"; /* Communication error on send */
68
- LinuxError["EPROTO"] = "EPROTO"; /* Protocol error */
69
- LinuxError["EMULTIHOP"] = "EMULTIHOP"; /* Multihop attempted */
70
- LinuxError["ELBIN"] = "ELBIN"; /* Inode is remote (not really error) */
71
- LinuxError["EDOTDOT"] = "EDOTDOT"; /* Cross mount point (not really error) */
72
- LinuxError["EBADMSG"] = "EBADMSG"; /* Trying to read unreadable message */
73
- LinuxError["EFTYPE"] = "EFTYPE"; /* Inappropriate file type or format */
74
- LinuxError["ENOTUNIQ"] = "ENOTUNIQ"; /* Given log. name not unique */
75
- LinuxError["EBADFD"] = "EBADFD"; /* f.d. invalid for this operation */
76
- LinuxError["EREMCHG"] = "EREMCHG"; /* Remote address changed */
77
- LinuxError["ELIBACC"] = "ELIBACC"; /* Can't access a needed shared lib */
78
- LinuxError["ELIBBAD"] = "ELIBBAD"; /* Accessing a corrupted shared lib */
79
- LinuxError["ELIBSCN"] = "ELIBSCN"; /* .lib section in a.out corrupted */
80
- LinuxError["ELIBMAX"] = "ELIBMAX"; /* Attempting to link in too many libs */
81
- LinuxError["ELIBEXEC"] = "ELIBEXEC"; /* Attempting to exec a shared library */
82
- LinuxError["ENOSYS"] = "ENOSYS"; /* Function not implemented */
83
- LinuxError["ENMFILE"] = "ENMFILE"; /* No more files */
84
- LinuxError["ENOTEMPTY"] = "ENOTEMPTY"; /* Directory not empty */
85
- LinuxError["ENAMETOOLONG"] = "ENAMETOOLONG"; /* File or path name too long */
86
- LinuxError["ELOOP"] = "ELOOP"; /* Too many symbolic links */
87
- LinuxError["EOPNOTSUPP"] = "EOPNOTSUPP"; /* Operation not supported on transport endpoint */
88
- LinuxError["EPFNOSUPPORT"] = "EPFNOSUPPORT"; /* Protocol family not supported */
89
- LinuxError["ECONNRESET"] = "ECONNRESET"; /* Connection reset by peer */
90
- LinuxError["ENOBUFS"] = "ENOBUFS"; /* No buffer space available */
91
- LinuxError["EAFNOSUPPORT"] = "EAFNOSUPPORT"; /* Address family not supported by protocol family */
92
- LinuxError["EPROTOTYPE"] = "EPROTOTYPE"; /* Protocol wrong type for socket */
93
- LinuxError["ENOTSOCK"] = "ENOTSOCK"; /* Socket operation on non-socket */
94
- LinuxError["ENOPROTOOPT"] = "ENOPROTOOPT"; /* Protocol not available */
95
- LinuxError["ESHUTDOWN"] = "ESHUTDOWN"; /* Can't send after socket shutdown */
96
- LinuxError["ECONNREFUSED"] = "ECONNREFUSED"; /* Connection refused */
97
- LinuxError["EADDRINUSE"] = "EADDRINUSE"; /* Address already in use */
98
- LinuxError["ECONNABORTED"] = "ECONNABORTED"; /* Connection aborted */
99
- LinuxError["ENETUNREACH"] = "ENETUNREACH"; /* Network is unreachable */
100
- LinuxError["ENETDOWN"] = "ENETDOWN"; /* Network interface is not configured */
101
- LinuxError["ETIMEDOUT"] = "ETIMEDOUT"; /* Connection timed out */
102
- LinuxError["EHOSTDOWN"] = "EHOSTDOWN"; /* Host is down */
103
- LinuxError["EHOSTUNREACH"] = "EHOSTUNREACH"; /* Host is unreachable */
104
- LinuxError["EINPROGRESS"] = "EINPROGRESS"; /* Connection already in progress */
105
- LinuxError["EALREADY"] = "EALREADY"; /* Socket already connected */
106
- LinuxError["EDESTADDRREQ"] = "EDESTADDRREQ"; /* Destination address required */
107
- LinuxError["EMSGSIZE"] = "EMSGSIZE"; /* Message too long */
108
- LinuxError["EPROTONOSUPPORT"] = "EPROTONOSUPPORT"; /* Unknown protocol */
109
- LinuxError["ESOCKTNOSUPPORT"] = "ESOCKTNOSUPPORT"; /* Socket type not supported */
110
- LinuxError["EADDRNOTAVAIL"] = "EADDRNOTAVAIL"; /* Address not available */
111
- LinuxError["ENETRESET"] = "ENETRESET";
112
- LinuxError["EISCONN"] = "EISCONN"; /* Socket is already connected */
113
- LinuxError["ENOTCONN"] = "ENOTCONN"; /* Socket is not connected */
114
- LinuxError["ETOOMANYREFS"] = "ETOOMANYREFS";
115
- LinuxError["EPROCLIM"] = "EPROCLIM";
116
- LinuxError["EUSERS"] = "EUSERS";
117
- LinuxError["EDQUOT"] = "EDQUOT";
118
- LinuxError["ESTALE"] = "ESTALE";
119
- LinuxError["ENOTSUP"] = "ENOTSUP"; /* Not supported */
120
- LinuxError["ENOMEDIUM"] = "ENOMEDIUM"; /* No medium (in tape drive) */
121
- LinuxError["ENOSHARE"] = "ENOSHARE"; /* No such host or network path */
122
- LinuxError["ECASECLASH"] = "ECASECLASH"; /* Filename exists with different case */
123
- LinuxError["EILSEQ"] = "EILSEQ";
124
- LinuxError["EOVERFLOW"] = "EOVERFLOW"; /* Value too large for defined data type */
125
- })(LinuxError || (LinuxError = {}));
126
- //# sourceMappingURL=linux.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"linux.js","sourceRoot":"","sources":["../../src/error/linux.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,UA2HX;AA3HD,WAAY,UAAU;IACrB,6BAAe,CAAA,CAAC,oBAAoB;IACpC,+BAAiB,CAAA,CAAC,+BAA+B;IACjD,6BAAe,CAAA,CAAC,qBAAqB;IACrC,6BAAe,CAAA,CAAC,6BAA6B;IAC7C,yBAAW,CAAA,CAAC,eAAe;IAC3B,6BAAe,CAAA,CAAC,+BAA+B;IAC/C,6BAAe,CAAA,CAAC,uBAAuB;IACvC,iCAAmB,CAAA,CAAC,uBAAuB;IAC3C,6BAAe,CAAA,CAAC,qBAAqB;IACrC,+BAAiB,CAAA,CAAC,iBAAiB;IACnC,+BAAiB,CAAA,CAAC,uBAAuB;IACzC,+BAAiB,CAAA,CAAC,qBAAqB;IACvC,+BAAiB,CAAA,CAAC,uBAAuB;IACzC,+BAAiB,CAAA,CAAC,iBAAiB;IACnC,iCAAmB,CAAA,CAAC,2BAA2B;IAC/C,6BAAe,CAAA,CAAC,uBAAuB;IACvC,+BAAiB,CAAA,CAAC,iBAAiB;IACnC,6BAAe,CAAA,CAAC,uBAAuB;IACvC,+BAAiB,CAAA,CAAC,oBAAoB;IACtC,iCAAmB,CAAA,CAAC,qBAAqB;IACzC,+BAAiB,CAAA,CAAC,oBAAoB;IACtC,+BAAiB,CAAA,CAAC,sBAAsB;IACxC,+BAAiB,CA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C;IAC9D,2CAA6B,CAAA,CAAC,wBAAwB;IACtD,uCAAyB,CAAA,CAAC,4BAA4B;IACtD,2CAA6B,CAAA,CAAC,wBAAwB;IACtD,yCAA2B,CAAA,CAAC,4BAA4B;IACxD,mCAAqB,CAAA,CAAC,yCAAyC;IAC/D,qCAAuB,CAAA,CAAC,0BAA0B;IAClD,qCAAuB,CAAA,CAAC,kBAAkB;IAC1C,2CAA6B,CAAA,CAAC,yBAAyB;IACvD,yCAA2B,CAAA,CAAC,oCAAoC;IAChE,mCAAqB,CAAA,CAAC,8BAA8B;IACpD,2CAA6B,CAAA,CAAC,kCAAkC;IAChE,mCAAqB,CAAA,CAAC,sBAAsB;IAC5C,iDAAmC,CAAA,CAAC,sBAAsB;IAC1D,iDAAmC,CAAA,CAAC,+BAA+B;IACnE,6CAA+B,CAAA,CAAC,2BAA2B;IAC3D,qCAAuB,CAAA;IACvB,iCAAmB,CAAA,CAAC,iCAAiC;IACrD,mCAAqB,CAAA,CAAC,6BAA6B;IACnD,2CAA6B,CAAA;IAC7B,mCAAqB,CAAA;IACrB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,+BAAiB,CAAA;IACjB,iCAAmB,CAAA,CAAC,mBAAmB;IACvC,qCAAuB,CAAA,CAAC,+BAA+B;IACvD,mCAAqB,CAAA,CAAC,kCAAkC;IACxD,uCAAyB,CAAA,CAAC,yCAAyC;IACnE,+BAAiB,CAAA;IACjB,qCAAuB,CAAA,CAAC,2CAA2C;AACpE,CAAC,EA3HW,UAAU,KAAV,UAAU,QA2HrB"}
@@ -1,24 +0,0 @@
1
- import { NodeError } from '@idlebox/node-error-codes';
2
- import { LinuxError } from './linux.js';
3
- export * from '@idlebox/node-error-codes';
4
- type NodeException<T extends string = any> = NodeJS.ErrnoException & {
5
- code: T;
6
- };
7
- export interface OpenSSLException extends Error {
8
- opensslErrorStack?: string;
9
- function?: string;
10
- library?: string;
11
- reason?: string;
12
- }
13
- /**
14
- * MODULE_NOT_FOUND: require() not found
15
- * ERR_MODULE_NOT_FOUND: import() not found
16
- */
17
- export declare function isModuleResolutionError(ex: unknown): ex is NodeException<NodeError.MODULE_NOT_FOUND | NodeError.ERR_MODULE_NOT_FOUND>;
18
- export declare function isNotExistsError(e: unknown): e is NodeException<LinuxError.ENOENT>;
19
- export declare function isExistsError(e: unknown): e is NodeException<LinuxError.EEXIST>;
20
- /** @description use isFileTypeError */
21
- export declare const isTypeError: typeof isFileTypeError;
22
- export declare function isFileTypeError(e: unknown): e is NodeException<LinuxError.EISDIR | LinuxError.ENOTDIR>;
23
- export declare function isNodeError(e: unknown): e is NodeException;
24
- //# sourceMappingURL=types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/error/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAE1C,KAAK,aAAa,CAAC,CAAC,SAAS,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,cAAc,GAAG;IAAE,IAAI,EAAE,CAAC,CAAA;CAAE,CAAC;AAEjF,MAAM,WAAW,gBAAiB,SAAQ,KAAK;IAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,EAAE,OAAO,GAAG,EAAE,IAAI,aAAa,CAAC,SAAS,CAAC,gBAAgB,GAAG,SAAS,CAAC,oBAAoB,CAAC,CAErI;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAElF;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAAC,UAAU,CAAC,MAAM,CAAC,CAE/E;AAED,uCAAuC;AACvC,eAAO,MAAM,WAAW,wBAAkB,CAAC;AAE3C,wBAAgB,eAAe,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAAC,UAAU,CAAC,MAAM,GAAG,UAAU,CAAC,OAAO,CAAC,CAEtG;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,aAAa,CAE1D"}
@@ -1,25 +0,0 @@
1
- import { NodeError } from '@idlebox/node-error-codes';
2
- import { LinuxError } from './linux.js';
3
- export * from '@idlebox/node-error-codes';
4
- /**
5
- * MODULE_NOT_FOUND: require() not found
6
- * ERR_MODULE_NOT_FOUND: import() not found
7
- */
8
- export function isModuleResolutionError(ex) {
9
- return isNodeError(ex) && (ex.code === NodeError.MODULE_NOT_FOUND || ex.code === NodeError.ERR_MODULE_NOT_FOUND);
10
- }
11
- export function isNotExistsError(e) {
12
- return isNodeError(e) && e.code === LinuxError.ENOENT;
13
- }
14
- export function isExistsError(e) {
15
- return isNodeError(e) && e.code === LinuxError.EEXIST;
16
- }
17
- /** @description use isFileTypeError */
18
- export const isTypeError = isFileTypeError;
19
- export function isFileTypeError(e) {
20
- return isNodeError(e) && (e.code === LinuxError.EISDIR || e.code === LinuxError.ENOTDIR);
21
- }
22
- export function isNodeError(e) {
23
- return e instanceof Error && typeof e.code === 'string';
24
- }
25
- //# sourceMappingURL=types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/error/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AACxC,cAAc,2BAA2B,CAAC;AAW1C;;;GAGG;AACH,MAAM,UAAU,uBAAuB,CAAC,EAAW;IAClD,OAAO,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,gBAAgB,IAAI,EAAE,CAAC,IAAI,KAAK,SAAS,CAAC,oBAAoB,CAAC,CAAC;AAClH,CAAC;AAED,MAAM,UAAU,gBAAgB,CAAC,CAAU;IAC1C,OAAO,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,MAAM,CAAC;AACvD,CAAC;AAED,MAAM,UAAU,aAAa,CAAC,CAAU;IACvC,OAAO,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,MAAM,CAAC;AACvD,CAAC;AAED,uCAAuC;AACvC,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AAE3C,MAAM,UAAU,eAAe,CAAC,CAAU;IACzC,OAAO,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,MAAM,IAAI,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,OAAO,CAAC,CAAC;AAC1F,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,CAAU;IACrC,OAAO,CAAC,YAAY,KAAK,IAAI,OAAQ,CAAS,CAAC,IAAI,KAAK,QAAQ,CAAC;AAClE,CAAC"}
@@ -1,23 +0,0 @@
1
- import { AppExit } from '@idlebox/common';
2
- export declare class Exit extends AppExit {
3
- constructor(code: number);
4
- }
5
- export declare class InterruptError extends Error {
6
- readonly signal: NodeJS.Signals;
7
- constructor(signal: NodeJS.Signals);
8
- }
9
- declare class ProxiedError extends Error {
10
- cause: any;
11
- constructor(prefix: string, original: unknown);
12
- get stack(): string;
13
- }
14
- export declare class UnhandledRejection extends ProxiedError {
15
- readonly promise: Promise<unknown>;
16
- constructor(reason: any, promise: Promise<unknown>);
17
- }
18
- export declare class UncaughtException extends ProxiedError {
19
- readonly error: unknown;
20
- constructor(error: unknown);
21
- }
22
- export {};
23
- //# sourceMappingURL=internal-errors.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal-errors.d.ts","sourceRoot":"","sources":["../../src/lifecycle/internal-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,qBAAa,IAAK,SAAQ,OAAO;gBACpB,IAAI,EAAE,MAAM;CAGxB;AAED,qBAAa,cAAe,SAAQ,KAAK;aACZ,MAAM,EAAE,MAAM,CAAC,OAAO;gBAAtB,MAAM,EAAE,MAAM,CAAC,OAAO;CAGlD;AAED,cAAM,YAAa,SAAQ,KAAK;IACvB,KAAK,EAAE,GAAG,CAAC;gBAEP,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO;IAK7C,IAAa,KAAK,IAAI,MAAM,CAS3B;CACD;AAED,qBAAa,kBAAmB,SAAQ,YAAY;aAGlC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;gBADzC,MAAM,EAAE,GAAG,EACK,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC;CAI1C;AAED,qBAAa,iBAAkB,SAAQ,YAAY;aACtB,KAAK,EAAE,OAAO;gBAAd,KAAK,EAAE,OAAO;CAG1C"}