@vibes.diy/vibe-runtime 14.3.326 → 14.3.328
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/calm-errors.d.ts +2 -1
- package/calm-errors.js +14 -2
- package/package.json +4 -4
package/calm-errors.d.ts
CHANGED
|
@@ -29,9 +29,10 @@ export interface BootErrorParentMessage {
|
|
|
29
29
|
readonly message: string;
|
|
30
30
|
readonly runtimeId?: string;
|
|
31
31
|
readonly rootLost?: true;
|
|
32
|
+
readonly errorName?: string;
|
|
32
33
|
}
|
|
33
34
|
export declare function __setBootErrorParentPostMessageForTests(post: (message: BootErrorParentMessage) => void): () => void;
|
|
34
|
-
export declare function postBootErrorToParent(message: string): void;
|
|
35
|
+
export declare function postBootErrorToParent(message: string, errorName?: string): void;
|
|
35
36
|
export declare function postHotSwapOkToParent(id: string): void;
|
|
36
37
|
export declare function noteBuildActivity(attempt?: HotSwapAttempt): void;
|
|
37
38
|
export declare function noteHotSwapApplied(attempt: HotSwapAttempt): void;
|
package/calm-errors.js
CHANGED
|
@@ -73,7 +73,7 @@ export function __setBootErrorParentPostMessageForTests(post) {
|
|
|
73
73
|
}
|
|
74
74
|
let bootErrorReposting = false;
|
|
75
75
|
let bootErrorTimer;
|
|
76
|
-
export function postBootErrorToParent(message) {
|
|
76
|
+
export function postBootErrorToParent(message, errorName) {
|
|
77
77
|
noteRootLost();
|
|
78
78
|
if (bootErrorReposting)
|
|
79
79
|
return;
|
|
@@ -82,6 +82,7 @@ export function postBootErrorToParent(message) {
|
|
|
82
82
|
type: BOOT_ERROR_EVENT_TYPE,
|
|
83
83
|
message,
|
|
84
84
|
rootLost: true,
|
|
85
|
+
...(errorName !== undefined ? { errorName } : {}),
|
|
85
86
|
...(hotSwapRuntimeId !== undefined ? { runtimeId: hotSwapRuntimeId } : {}),
|
|
86
87
|
};
|
|
87
88
|
const post = () => {
|
|
@@ -157,6 +158,17 @@ function errorSummary(error) {
|
|
|
157
158
|
return error.message;
|
|
158
159
|
return String(error);
|
|
159
160
|
}
|
|
161
|
+
function thrownName(error) {
|
|
162
|
+
if (error === null)
|
|
163
|
+
return "null";
|
|
164
|
+
if (typeof error !== "object" && typeof error !== "function")
|
|
165
|
+
return typeof error;
|
|
166
|
+
const name = exception2Result(() => error.constructor?.name);
|
|
167
|
+
if (name.isErr())
|
|
168
|
+
return "Object";
|
|
169
|
+
const value = name.Ok();
|
|
170
|
+
return typeof value === "string" ? value : "Object";
|
|
171
|
+
}
|
|
160
172
|
export function noteBuildActivity(attempt) {
|
|
161
173
|
lastBuildActivityAt = Date.now();
|
|
162
174
|
buildSeq += 1;
|
|
@@ -331,7 +343,7 @@ export function onUncaughtVibeError(error, errorInfo, attempt) {
|
|
|
331
343
|
return;
|
|
332
344
|
}
|
|
333
345
|
report({ kind: "loud", error, ...(errorInfo?.componentStack ? { componentStack: errorInfo.componentStack } : {}) });
|
|
334
|
-
postBootErrorToParent(errorSummary(error));
|
|
346
|
+
postBootErrorToParent(errorSummary(error), thrownName(error));
|
|
335
347
|
}
|
|
336
348
|
export function reportHotSwapFailure(err) {
|
|
337
349
|
if (isBuildCalmActive() === true) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vibes.diy/vibe-runtime",
|
|
3
|
-
"version": "14.3.
|
|
3
|
+
"version": "14.3.328",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@adviser/cement": "~0.5.37",
|
|
39
|
-
"@vibes.diy/api-types": "14.3.
|
|
40
|
-
"@vibes.diy/base": "14.3.
|
|
41
|
-
"@vibes.diy/vibe-types": "14.3.
|
|
39
|
+
"@vibes.diy/api-types": "14.3.328",
|
|
40
|
+
"@vibes.diy/base": "14.3.328",
|
|
41
|
+
"@vibes.diy/vibe-types": "14.3.328",
|
|
42
42
|
"arktype": "~2.2.9",
|
|
43
43
|
"charwise": "~3.0.1",
|
|
44
44
|
"es-module-lexer": "~3.0.4",
|