elysia 2.0.0-beta.17 → 2.0.0-beta.18
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/package.js +1 -1
- package/dist/package.mjs +1 -1
- package/dist/plugin/aot/core.d.ts +1 -1
- package/dist/plugin/aot/hooks.js +1 -1
- package/dist/plugin/aot/hooks.mjs +1 -1
- package/dist/type/coerce.d.ts +1 -1
- package/dist/type/typebox-value-require.d.ts +9 -2
- package/dist/type/typebox-value-require.js +10 -1
- package/dist/type/typebox-value-require.mjs +10 -2
- package/dist/type/typebox-value.js +1 -12
- package/dist/type/typebox-value.mjs +2 -13
- package/dist/utils.d.ts +0 -1
- package/package.json +1 -1
package/dist/package.js
CHANGED
package/dist/package.mjs
CHANGED
|
@@ -95,7 +95,7 @@ interface ElysiaAotOptions {
|
|
|
95
95
|
}
|
|
96
96
|
declare const resolveEntry: (entry: string) => string;
|
|
97
97
|
/** @internal Resolve the package condition used to evaluate an AOT entry. */
|
|
98
|
-
declare const resolveEntryModuleKind: (entry: string) => "
|
|
98
|
+
declare const resolveEntryModuleKind: (entry: string) => "cjs" | "esm";
|
|
99
99
|
/** Runtime handler-JIT module a strip build can replace with a throwing stub. */
|
|
100
100
|
interface StubPlan {
|
|
101
101
|
/** Stub the internal handler codegen module. */
|
package/dist/plugin/aot/hooks.js
CHANGED
|
@@ -52,7 +52,7 @@ const createAotPluginHooks = (entry, options, moduleCondition = require_plugin_a
|
|
|
52
52
|
if (key === "staticClone" && (!isElysiaModule(cleanId) || !/^(dist|src)\/compile\/handler\/static-clone-resolver\.(m?js|ts)$/.test(toPosix(cleanId).slice(packageRoot.length + 1)))) continue;
|
|
53
53
|
for (const { filter, source: stubSource } of require_plugin_aot_core.STUB_SOURCES[key]) if (filter.test(cleanId)) return require_plugin_aot_core.alignStubExtensions(stubSource, cleanId);
|
|
54
54
|
}
|
|
55
|
-
if (require_plugin_aot_core.TYPEBOX_REQUIRE_FILTER.test(cleanId)) return `export const requireTypebox = () => undefined\n`;
|
|
55
|
+
if (require_plugin_aot_core.TYPEBOX_REQUIRE_FILTER.test(cleanId)) return `export const requireTypebox = () => undefined\nexport const importTypebox = () => undefined\n`;
|
|
56
56
|
if (require_plugin_aot_core.EXACT_MIRROR_REQUIRE_FILTER.test(cleanId)) return `export const requireExactMirror = () => undefined\n`;
|
|
57
57
|
if (require_plugin_aot_core.TYPEBOX_TYPE_FILTER.test(cleanId)) return require_plugin_aot_core.alignStubExtensions(`export * from './typebox-type-live'\n`, cleanId);
|
|
58
58
|
if (stub.adapter !== false && require_plugin_aot_core.ADAPTER_CONSTANTS_FILTER.test(cleanId)) return require_plugin_aot_core.alignStubExtensions(require_plugin_aot_core.adapterConstantsSource(stub.adapter), cleanId);
|
|
@@ -51,7 +51,7 @@ const createAotPluginHooks = (entry, options, moduleCondition = resolveEntryModu
|
|
|
51
51
|
if (key === "staticClone" && (!isElysiaModule(cleanId) || !/^(dist|src)\/compile\/handler\/static-clone-resolver\.(m?js|ts)$/.test(toPosix(cleanId).slice(packageRoot.length + 1)))) continue;
|
|
52
52
|
for (const { filter, source: stubSource } of STUB_SOURCES[key]) if (filter.test(cleanId)) return alignStubExtensions(stubSource, cleanId);
|
|
53
53
|
}
|
|
54
|
-
if (TYPEBOX_REQUIRE_FILTER.test(cleanId)) return `export const requireTypebox = () => undefined\n`;
|
|
54
|
+
if (TYPEBOX_REQUIRE_FILTER.test(cleanId)) return `export const requireTypebox = () => undefined\nexport const importTypebox = () => undefined\n`;
|
|
55
55
|
if (EXACT_MIRROR_REQUIRE_FILTER.test(cleanId)) return `export const requireExactMirror = () => undefined\n`;
|
|
56
56
|
if (TYPEBOX_TYPE_FILTER.test(cleanId)) return alignStubExtensions(`export * from './typebox-type-live'\n`, cleanId);
|
|
57
57
|
if (stub.adapter !== false && ADAPTER_CONSTANTS_FILTER.test(cleanId)) return alignStubExtensions(adapterConstantsSource(stub.adapter), cleanId);
|
package/dist/type/coerce.d.ts
CHANGED
|
@@ -30,7 +30,7 @@ declare const coerceQuery: () => CoerceOption[];
|
|
|
30
30
|
declare const coerceBody: () => CoerceOption[];
|
|
31
31
|
declare const coerceFormData: () => CoerceOption[];
|
|
32
32
|
declare const coerceStringToStructure: () => CoerceOption[];
|
|
33
|
-
declare function applyCoercions(schema: BaseSchema | TSchema, coerces: CoerceOption[] | undefined):
|
|
33
|
+
declare function applyCoercions(schema: BaseSchema | TSchema, coerces: CoerceOption[] | undefined): BaseSchema | TSchema;
|
|
34
34
|
declare function captureCoercePlan(original: any, coerced: any): CoerceNode | null;
|
|
35
35
|
/** Full rebuild: scalar leaves + ObjectString/ArrayString sites (wired path). */
|
|
36
36
|
declare const buildCoercedFromPlan: (original: any, plan: CoerceNode, seen?: Set<string>) => any;
|
|
@@ -1,12 +1,19 @@
|
|
|
1
1
|
import { TypeboxNamespaces } from "./typebox-value.js";
|
|
2
|
+
import * as _$typebox_type0 from "typebox/type";
|
|
3
|
+
import * as _$typebox_system0 from "typebox/system";
|
|
4
|
+
import * as _$typebox_value0 from "typebox/value";
|
|
5
|
+
import * as _$typebox_schema0 from "typebox/schema";
|
|
6
|
+
import * as _$typebox_compile0 from "typebox/compile";
|
|
2
7
|
|
|
3
8
|
//#region src/type/typebox-value-require.d.ts
|
|
4
9
|
/**
|
|
5
|
-
* Literal `require` so bundlers embed TypeBox (still evaluated
|
|
10
|
+
* Literal `require` / `import()` so bundlers embed TypeBox (still evaluated
|
|
11
|
+
* lazily) and both resolve to that one embedded copy
|
|
6
12
|
*
|
|
7
13
|
* The AOT build plugin always stubs this module to `() => undefined`: sealed
|
|
8
14
|
* builds must keep TypeBox out, other modes re-route `typebox-value` to `-live`
|
|
9
15
|
*/
|
|
10
16
|
declare const requireTypebox: () => TypeboxNamespaces | undefined;
|
|
17
|
+
declare const importTypebox: () => Promise<[typeof _$typebox_type0, typeof _$typebox_system0, typeof _$typebox_value0, typeof _$typebox_schema0, typeof _$typebox_compile0]>;
|
|
11
18
|
//#endregion
|
|
12
|
-
export { requireTypebox };
|
|
19
|
+
export { importTypebox, requireTypebox };
|
|
@@ -2,7 +2,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
2
2
|
|
|
3
3
|
//#region src/type/typebox-value-require.ts
|
|
4
4
|
/**
|
|
5
|
-
* Literal `require` so bundlers embed TypeBox (still evaluated
|
|
5
|
+
* Literal `require` / `import()` so bundlers embed TypeBox (still evaluated
|
|
6
|
+
* lazily) and both resolve to that one embedded copy
|
|
6
7
|
*
|
|
7
8
|
* The AOT build plugin always stubs this module to `() => undefined`: sealed
|
|
8
9
|
* builds must keep TypeBox out, other modes re-route `typebox-value` to `-live`
|
|
@@ -16,6 +17,14 @@ const requireTypebox = () => {
|
|
|
16
17
|
};
|
|
17
18
|
} catch {}
|
|
18
19
|
};
|
|
20
|
+
const importTypebox = () => Promise.all([
|
|
21
|
+
import("typebox/type"),
|
|
22
|
+
import("typebox/system"),
|
|
23
|
+
import("typebox/value"),
|
|
24
|
+
import("typebox/schema"),
|
|
25
|
+
import("typebox/compile")
|
|
26
|
+
]);
|
|
19
27
|
|
|
20
28
|
//#endregion
|
|
29
|
+
exports.importTypebox = importTypebox;
|
|
21
30
|
exports.requireTypebox = requireTypebox;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
//#region src/type/typebox-value-require.ts
|
|
2
2
|
/**
|
|
3
|
-
* Literal `require` so bundlers embed TypeBox (still evaluated
|
|
3
|
+
* Literal `require` / `import()` so bundlers embed TypeBox (still evaluated
|
|
4
|
+
* lazily) and both resolve to that one embedded copy
|
|
4
5
|
*
|
|
5
6
|
* The AOT build plugin always stubs this module to `() => undefined`: sealed
|
|
6
7
|
* builds must keep TypeBox out, other modes re-route `typebox-value` to `-live`
|
|
@@ -14,6 +15,13 @@ const requireTypebox = () => {
|
|
|
14
15
|
};
|
|
15
16
|
} catch {}
|
|
16
17
|
};
|
|
18
|
+
const importTypebox = () => Promise.all([
|
|
19
|
+
import("typebox/type"),
|
|
20
|
+
import("typebox/system"),
|
|
21
|
+
import("typebox/value"),
|
|
22
|
+
import("typebox/schema"),
|
|
23
|
+
import("typebox/compile")
|
|
24
|
+
]);
|
|
17
25
|
|
|
18
26
|
//#endregion
|
|
19
|
-
export { requireTypebox };
|
|
27
|
+
export { importTypebox, requireTypebox };
|
|
@@ -15,18 +15,7 @@ function load() {
|
|
|
15
15
|
}
|
|
16
16
|
function preloadTypebox() {
|
|
17
17
|
if (loaded || !require_type_typebox_type.isTypeUsed()) return;
|
|
18
|
-
|
|
19
|
-
/* webpackIgnore: true */
|
|
20
|
-
/* @vite-ignore */
|
|
21
|
-
"typebox/" + name
|
|
22
|
-
);
|
|
23
|
-
return Promise.all([
|
|
24
|
-
load("type"),
|
|
25
|
-
load("system"),
|
|
26
|
-
load("value"),
|
|
27
|
-
load("schema"),
|
|
28
|
-
load("compile")
|
|
29
|
-
]).then(([type, system, value, schema, compile]) => {
|
|
18
|
+
return require_type_typebox_value_require.importTypebox()?.then(([type, system, value, schema, compile]) => {
|
|
30
19
|
if (loaded) return;
|
|
31
20
|
if (!require_type_typebox_type.isTypeNamespaceLoaded()) require_type_typebox_type.injectTypeboxType({
|
|
32
21
|
type,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { syncRequire } from "./sync-require.mjs";
|
|
2
2
|
import { injectTypeboxType, isTypeNamespaceLoaded, isTypeUsed, loadTypeNamespace } from "./typebox-type.mjs";
|
|
3
|
-
import { requireTypebox } from "./typebox-value-require.mjs";
|
|
3
|
+
import { importTypebox, requireTypebox } from "./typebox-value-require.mjs";
|
|
4
4
|
|
|
5
5
|
//#region src/type/typebox-value.ts
|
|
6
6
|
let loaded = false;
|
|
@@ -14,18 +14,7 @@ function load() {
|
|
|
14
14
|
}
|
|
15
15
|
function preloadTypebox() {
|
|
16
16
|
if (loaded || !isTypeUsed()) return;
|
|
17
|
-
|
|
18
|
-
/* webpackIgnore: true */
|
|
19
|
-
/* @vite-ignore */
|
|
20
|
-
"typebox/" + name
|
|
21
|
-
);
|
|
22
|
-
return Promise.all([
|
|
23
|
-
load("type"),
|
|
24
|
-
load("system"),
|
|
25
|
-
load("value"),
|
|
26
|
-
load("schema"),
|
|
27
|
-
load("compile")
|
|
28
|
-
]).then(([type, system, value, schema, compile]) => {
|
|
17
|
+
return importTypebox()?.then(([type, system, value, schema, compile]) => {
|
|
29
18
|
if (loaded) return;
|
|
30
19
|
if (!isTypeNamespaceLoaded()) injectTypeboxType({
|
|
31
20
|
type,
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AnySchema, StandardSchemaV1Like } from "./type/types.js";
|
|
2
2
|
import { Context } from "./context.js";
|
|
3
3
|
import { AnyLocalHook, AppHook, BunHTMLBundlelike, ElysiaFormData, EventFn, EventScope, GuardSchemaType, InputSchema, Macro, MaybeArray, Prettify, SSEPayload } from "./types.js";
|
|
4
|
-
|
|
5
4
|
//#region src/utils.d.ts
|
|
6
5
|
type DeriveEntry = Function | readonly [Function, 'mapDerive'];
|
|
7
6
|
declare const nullObject: () => any;
|