@vite-hub/runtime 0.5.0 → 0.6.0
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/dist/{core-DpLK9dQt.js → core-Crv8CV_r.js} +5 -7
- package/dist/{core-BfUEli_0.d.ts → core-auTkK4iZ.d.ts} +0 -6
- package/dist/detect-host-Du9saPsM.js +57 -0
- package/dist/detect-host-uTgoQ9i4.d.ts +17 -0
- package/dist/durability.d.ts +1 -3
- package/dist/durability.js +1 -2
- package/dist/{error-diagnostics-BM9W4pBg.js → error-diagnostics-Dj98U7ch.js} +1 -2
- package/dist/{error-diagnostics-0sYgKTT8.d.ts → error-diagnostics-DuusexaK.d.ts} +0 -2
- package/dist/{errors-BQ0ofIL4.js → errors-D2ixvqv3.js} +2 -3
- package/dist/{execution-budget-BPXbISEt.d.ts → execution-budget-Bv7h0-5V.d.ts} +0 -2
- package/dist/{hosted-console-ZfMo5MW4.d.ts → hosted-console-DInG3Xl9.d.ts} +3 -6
- package/dist/hosted-console-nLc1pL9J.js +71 -0
- package/dist/{index-DsisbCNa.d.ts → index-fSQ1ELEy.d.ts} +3 -38
- package/dist/index.d.ts +7 -6
- package/dist/index.js +7 -5
- package/dist/internal/console.d.ts +10 -5
- package/dist/internal/console.js +3 -2
- package/dist/internal/context.d.ts +1 -1
- package/dist/internal/context.js +1 -2
- package/dist/internal/detect-host.d.ts +2 -0
- package/dist/internal/detect-host.js +1 -0
- package/dist/internal/drain.d.ts +1 -3
- package/dist/internal/drain.js +3 -5
- package/dist/internal/error-diagnostics.d.ts +1 -1
- package/dist/internal/error-diagnostics.js +1 -2
- package/dist/internal/execution-budget.d.ts +1 -3
- package/dist/internal/execution-budget.js +3 -5
- package/dist/internal/grant.d.ts +1 -2
- package/dist/internal/grant.js +3 -4
- package/dist/internal/h3.d.ts +2 -4
- package/dist/internal/h3.js +4 -6
- package/dist/internal/node.d.ts +2 -3
- package/dist/internal/node.js +2 -3
- package/dist/internal/public-url.d.ts +1 -1
- package/dist/internal/public-url.js +1 -2
- package/dist/internal/response.d.ts +1 -1
- package/dist/internal/response.js +1 -2
- package/dist/internal/run-failed.d.ts +1 -3
- package/dist/internal/run-failed.js +1 -2
- package/dist/internal/run-scope.d.ts +1 -3
- package/dist/internal/run-scope.js +1 -2
- package/dist/internal/runtime-type.d.ts +1 -3
- package/dist/internal/runtime-type.js +2 -2
- package/dist/internal/shutdown.d.ts +1 -3
- package/dist/internal/shutdown.js +1 -2
- package/dist/internal/test-mode-setup.d.ts +1 -3
- package/dist/internal/test-mode-setup.js +1 -2
- package/dist/internal/test-mode.d.ts +1 -3
- package/dist/internal/test-mode.js +1 -2
- package/dist/internal/trace.d.ts +2 -4
- package/dist/internal/trace.js +1 -2
- package/dist/operations.d.ts +0 -3
- package/dist/operations.js +9 -10
- package/dist/{public-url-BCFhTiTM.d.ts → public-url-CaVJ4vFF.d.ts} +1 -2
- package/dist/{public-url-DizC8CFs.js → public-url-TlEVxNNh.js} +10 -72
- package/dist/{request-context-Dmsliqan.js → request-context-Dcf59Qh4.js} +11 -73
- package/dist/{response-iONbTI0E.d.ts → response-ClQ9ZSS_.d.ts} +0 -2
- package/dist/{response-Be5M4WIn.js → response-DEyMvEBF.js} +5 -7
- package/dist/{runtime-type-CHYQYwDx.js → runtime-type-EgaBGoVU.js} +2 -4
- package/package.json +9 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { r as isRuntimeObject } from "./runtime-type-EgaBGoVU.js";
|
|
2
|
+
import { n as getViteHubErrorShape } from "./errors-D2ixvqv3.js";
|
|
3
|
+
import { t as runtimeErrorDiagnostics } from "./error-diagnostics-Dj98U7ch.js";
|
|
4
4
|
import { Diagnostic, formatDiagnostic } from "nostics";
|
|
5
|
-
|
|
5
|
+
// src/diagnostics.ts
|
|
6
6
|
/** Recognizes an `Error` from any realm, without reading its properties. */
|
|
7
7
|
function isNativeError(value) {
|
|
8
8
|
if (!isRuntimeObject(value)) return false;
|
|
@@ -186,8 +186,7 @@ function normalizeRuntimeDiagnosticError(error, options = {}) {
|
|
|
186
186
|
remainingStringLength: maxStringLength * (maxErrors + 1)
|
|
187
187
|
}, 0);
|
|
188
188
|
}
|
|
189
|
-
|
|
190
|
-
//#region src/response.ts
|
|
189
|
+
// src/response.ts
|
|
191
190
|
function prototypeGetter(constructor, key) {
|
|
192
191
|
return Object.getOwnPropertyDescriptor(constructor.prototype, key)?.get;
|
|
193
192
|
}
|
|
@@ -428,5 +427,4 @@ function createStatusZeroResponse(type, url = "") {
|
|
|
428
427
|
});
|
|
429
428
|
return response;
|
|
430
429
|
}
|
|
431
|
-
//#endregion
|
|
432
430
|
export { toResponse as a, normalizeRuntimeDiagnosticError as c, serializeResponse as i, isResponse as n, formatRuntimeDiagnosticError as o, isSerializedResponse as r, isRuntimeDiagnostic as s, deserializeResponse as t };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineDiagnostics } from "nostics";
|
|
2
|
-
|
|
2
|
+
// ../internal/dist/invariant.js
|
|
3
3
|
const invariantDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
4
4
|
docsBase: "https://vitehub.dev/docs/development/diagnostics",
|
|
5
5
|
codes: { INTERNAL_INVARIANT_FAILED: {
|
|
@@ -14,8 +14,7 @@ const invariantDiagnostics = /*#__PURE__*/ defineDiagnostics({
|
|
|
14
14
|
function invariantError(what) {
|
|
15
15
|
return invariantDiagnostics.INTERNAL_INVARIANT_FAILED({ what });
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
//#region src/internal/runtime-type.ts
|
|
17
|
+
// src/internal/runtime-type.ts
|
|
19
18
|
/** Narrows opaque inputs without reading their properties. Kept for `@vite-hub/presets`; other packages use `typeof`. */
|
|
20
19
|
function hasRuntimeType(value, expected) {
|
|
21
20
|
switch (expected) {
|
|
@@ -77,5 +76,4 @@ function isRuntimeResponse(value) {
|
|
|
77
76
|
}
|
|
78
77
|
return false;
|
|
79
78
|
}
|
|
80
|
-
//#endregion
|
|
81
79
|
export { isRuntimeResponse as i, hasRuntimeType as n, isRuntimeObject as r, asUnknownBoundary as t };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vite-hub/runtime",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Shared runtime context, capability, policy, approval, and tracing primitives for ViteHub.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"approvals",
|
|
@@ -47,6 +47,11 @@
|
|
|
47
47
|
"import": "./dist/internal/context.js",
|
|
48
48
|
"default": "./dist/internal/context.js"
|
|
49
49
|
},
|
|
50
|
+
"./internal/detect-host": {
|
|
51
|
+
"types": "./dist/internal/detect-host.d.ts",
|
|
52
|
+
"import": "./dist/internal/detect-host.js",
|
|
53
|
+
"default": "./dist/internal/detect-host.js"
|
|
54
|
+
},
|
|
50
55
|
"./internal/drain": {
|
|
51
56
|
"types": "./dist/internal/drain.d.ts",
|
|
52
57
|
"import": "./dist/internal/drain.js",
|
|
@@ -139,13 +144,13 @@
|
|
|
139
144
|
},
|
|
140
145
|
"devDependencies": {
|
|
141
146
|
"@libsql/client": "^0.18.0",
|
|
142
|
-
"@types/node": "^24.19.
|
|
147
|
+
"@types/node": "^24.19.2",
|
|
143
148
|
"@vite-hub/internal": "0.0.1",
|
|
144
149
|
"postgres": "^3.4.9",
|
|
145
150
|
"publint": "^0.3.25",
|
|
146
151
|
"typescript": "^6.0.3",
|
|
147
|
-
"vite-plus": "^
|
|
148
|
-
"vitest": "
|
|
152
|
+
"vite-plus": "^1.7.0",
|
|
153
|
+
"vitest": "5.1.0"
|
|
149
154
|
},
|
|
150
155
|
"engines": {
|
|
151
156
|
"node": ">=24.15.0"
|