elysia 2.0.0-beta.2 → 2.0.0-beta.4
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/adapter/bun/index.d.ts +1 -1
- package/dist/adapter/bun/index.js +320 -56
- package/dist/adapter/bun/index.mjs +321 -57
- package/dist/adapter/utils.js +51 -30
- package/dist/adapter/utils.mjs +52 -31
- package/dist/adapter/web-standard/handler.js +5 -2
- package/dist/adapter/web-standard/handler.mjs +5 -2
- package/dist/base.d.ts +18 -7
- package/dist/base.js +213 -101
- package/dist/base.mjs +215 -103
- package/dist/compile/aot-capture.js +1 -1
- package/dist/compile/aot-capture.mjs +1 -1
- package/dist/compile/aot.d.ts +5 -4
- package/dist/compile/aot.js +17 -9
- package/dist/compile/aot.mjs +18 -9
- package/dist/compile/handler/descriptor.js +1 -1
- package/dist/compile/handler/descriptor.mjs +1 -1
- package/dist/compile/handler/frozen-validator.d.ts +4 -1
- package/dist/compile/handler/frozen-validator.js +8 -3
- package/dist/compile/handler/frozen-validator.mjs +5 -3
- package/dist/compile/handler/index.d.ts +2 -2
- package/dist/compile/handler/index.js +8 -6
- package/dist/compile/handler/index.mjs +8 -6
- package/dist/compile/handler/reconstruct.d.ts +1 -1
- package/dist/compile/handler/reconstruct.js +4 -3
- package/dist/compile/handler/reconstruct.mjs +4 -3
- package/dist/compile/handler/utils.js +2 -2
- package/dist/compile/handler/utils.mjs +3 -3
- package/dist/compile/jit-probe.d.ts +2 -2
- package/dist/context.d.ts +1 -1
- package/dist/context.js +8 -5
- package/dist/context.mjs +8 -5
- package/dist/cookie/config.d.ts +1 -0
- package/dist/cookie/config.js +3 -2
- package/dist/cookie/config.mjs +3 -2
- package/dist/cookie/cookie.d.ts +1 -0
- package/dist/cookie/cookie.js +6 -5
- package/dist/cookie/cookie.mjs +6 -5
- package/dist/cookie/crypto.d.ts +8 -7
- package/dist/cookie/crypto.js +38 -31
- package/dist/cookie/crypto.mjs +38 -32
- package/dist/cookie/error.js +1 -2
- package/dist/cookie/error.mjs +1 -2
- package/dist/cookie/lib.js +5 -1
- package/dist/cookie/lib.mjs +5 -1
- package/dist/cookie/serialize.js +1 -1
- package/dist/cookie/serialize.mjs +1 -1
- package/dist/cookie/types.d.ts +10 -0
- package/dist/cookie/utils.js +28 -14
- package/dist/cookie/utils.mjs +29 -15
- package/dist/handler/error.d.ts +23 -12
- package/dist/handler/error.js +24 -21
- package/dist/handler/error.mjs +20 -21
- package/dist/handler/fetch.js +6 -7
- package/dist/handler/fetch.mjs +7 -8
- package/dist/handler/utils.js +4 -2
- package/dist/handler/utils.mjs +5 -3
- package/dist/index.js +1 -8
- package/dist/package.js +1 -1
- package/dist/package.mjs +1 -1
- package/dist/plugin/aot/core.d.ts +33 -6
- package/dist/plugin/aot/core.js +120 -40
- package/dist/plugin/aot/core.mjs +121 -43
- package/dist/plugin/aot/esbuild.js +8 -2
- package/dist/plugin/aot/esbuild.mjs +9 -3
- package/dist/plugin/aot/hooks.d.ts +2 -1
- package/dist/plugin/aot/hooks.js +3 -3
- package/dist/plugin/aot/hooks.mjs +4 -4
- package/dist/plugin/aot/source.d.ts +4 -1
- package/dist/plugin/aot/source.js +21 -14
- package/dist/plugin/aot/source.mjs +21 -14
- package/dist/plugin/aot/worker.js +2 -2
- package/dist/plugin/aot/worker.mjs +2 -2
- package/dist/route-table.d.ts +3 -0
- package/dist/route-table.js +16 -11
- package/dist/route-table.mjs +16 -11
- package/dist/schema-snapshot.js +17 -22
- package/dist/schema-snapshot.mjs +17 -22
- package/dist/type/bridge-live.d.ts +1 -1
- package/dist/type/bridge-live.js +2 -2
- package/dist/type/bridge-live.mjs +2 -2
- package/dist/type/bridge.d.ts +1 -1
- package/dist/type/coerce-plan.js +3 -4
- package/dist/type/coerce-plan.mjs +1 -1
- package/dist/type/coerce.d.ts +1 -1
- package/dist/type/compat.d.ts +3 -0
- package/dist/type/compat.js +32 -14
- package/dist/type/compat.mjs +27 -8
- package/dist/type/constants.d.ts +1 -1
- package/dist/type/elysia/array-buffer.js +2 -3
- package/dist/type/elysia/array-buffer.mjs +1 -1
- package/dist/type/elysia/array-string.js +7 -4
- package/dist/type/elysia/array-string.mjs +9 -5
- package/dist/type/elysia/boolean-string.js +2 -3
- package/dist/type/elysia/boolean-string.mjs +1 -1
- package/dist/type/elysia/boolean.js +4 -3
- package/dist/type/elysia/boolean.mjs +4 -2
- package/dist/type/elysia/cookie.js +2 -1
- package/dist/type/elysia/cookie.mjs +2 -1
- package/dist/type/elysia/date.js +7 -7
- package/dist/type/elysia/date.mjs +3 -2
- package/dist/type/elysia/file-type.d.ts +9 -2
- package/dist/type/elysia/file-type.js +16 -1
- package/dist/type/elysia/file-type.mjs +16 -2
- package/dist/type/elysia/file.js +8 -4
- package/dist/type/elysia/file.mjs +8 -3
- package/dist/type/elysia/files.js +6 -4
- package/dist/type/elysia/files.mjs +5 -2
- package/dist/type/elysia/form.js +2 -3
- package/dist/type/elysia/form.mjs +3 -3
- package/dist/type/elysia/integer-string.js +4 -5
- package/dist/type/elysia/integer-string.mjs +3 -3
- package/dist/type/elysia/integer.js +4 -3
- package/dist/type/elysia/integer.mjs +4 -2
- package/dist/type/elysia/maybe-empty.js +3 -4
- package/dist/type/elysia/maybe-empty.mjs +1 -1
- package/dist/type/elysia/nullable.js +2 -3
- package/dist/type/elysia/nullable.mjs +1 -1
- package/dist/type/elysia/number.js +4 -3
- package/dist/type/elysia/number.mjs +4 -2
- package/dist/type/elysia/numeric-enum.js +2 -3
- package/dist/type/elysia/numeric-enum.mjs +1 -1
- package/dist/type/elysia/numeric.js +5 -5
- package/dist/type/elysia/numeric.mjs +3 -2
- package/dist/type/elysia/object-string.js +7 -4
- package/dist/type/elysia/object-string.mjs +9 -5
- package/dist/type/elysia/string.js +4 -3
- package/dist/type/elysia/string.mjs +4 -2
- package/dist/type/elysia/uint8-array.js +2 -3
- package/dist/type/elysia/uint8-array.mjs +1 -1
- package/dist/type/elysia/union-enum.js +2 -3
- package/dist/type/elysia/union-enum.mjs +1 -1
- package/dist/type/elysia/utils.js +2 -3
- package/dist/type/elysia/utils.mjs +1 -1
- package/dist/type/exports.js +10 -1
- package/dist/type/exports.mjs +7 -0
- package/dist/type/index.d.ts +9 -1
- package/dist/type/index.js +41 -13
- package/dist/type/index.mjs +44 -9
- package/dist/type/typebox-type-live.d.ts +9 -0
- package/dist/type/typebox-type-live.js +31 -0
- package/dist/type/typebox-type-live.mjs +16 -0
- package/dist/type/typebox-type.d.ts +24 -0
- package/dist/type/typebox-type.js +130 -0
- package/dist/type/typebox-type.mjs +66 -0
- package/dist/type/typebox-value-live.d.ts +9 -0
- package/dist/type/typebox-value-live.js +27 -0
- package/dist/type/typebox-value-live.mjs +11 -0
- package/dist/type/typebox-value.d.ts +30 -0
- package/dist/type/typebox-value.js +147 -0
- package/dist/type/typebox-value.mjs +62 -0
- package/dist/type/validator/custom-error.js +4 -5
- package/dist/type/validator/custom-error.mjs +3 -3
- package/dist/type/validator/default-precompute.js +4 -5
- package/dist/type/validator/default-precompute.mjs +1 -1
- package/dist/type/validator/index.d.ts +1 -1
- package/dist/type/validator/index.js +51 -42
- package/dist/type/validator/index.mjs +33 -23
- package/dist/type/validator/validator-cache.d.ts +1 -1
- package/dist/type/validator/validator-cache.js +27 -14
- package/dist/type/validator/validator-cache.mjs +27 -13
- package/dist/universal/constants.d.ts +2 -1
- package/dist/universal/constants.js +3 -1
- package/dist/universal/constants.mjs +2 -1
- package/dist/utils.d.ts +19 -1
- package/dist/utils.js +25 -3
- package/dist/utils.mjs +19 -3
- package/dist/validator/index.js +2 -1
- package/dist/validator/index.mjs +2 -1
- package/dist/ws/context.d.ts +8 -1
- package/dist/ws/context.js +65 -29
- package/dist/ws/context.mjs +64 -29
- package/dist/ws/route.js +176 -28
- package/dist/ws/route.mjs +179 -31
- package/package.json +5 -3
package/dist/plugin/aot/hooks.js
CHANGED
|
@@ -6,7 +6,7 @@ const require_plugin_aot_treeshake = require('./treeshake.js');
|
|
|
6
6
|
const toPosix = (path) => path.replace(/\\/g, "/");
|
|
7
7
|
const VIRTUAL = "\0elysia/compiled";
|
|
8
8
|
const VIRTUAL_TYPE = "\0elysia/type";
|
|
9
|
-
const createAotPluginHooks = (entry, options) => {
|
|
9
|
+
const createAotPluginHooks = (entry, options, moduleCondition = require_plugin_aot_core.resolveEntryModuleKind(entry)) => {
|
|
10
10
|
const entryPath = require_plugin_aot_core.resolveEntry(entry);
|
|
11
11
|
const entryPosix = toPosix(entryPath);
|
|
12
12
|
const entryRealPosix = toPosix(require_plugin_aot_core.realPath(entryPath));
|
|
@@ -24,7 +24,7 @@ const createAotPluginHooks = (entry, options) => {
|
|
|
24
24
|
let isElysiaModule = (_path) => false;
|
|
25
25
|
return {
|
|
26
26
|
async buildStart() {
|
|
27
|
-
const generated = initial ? await require_plugin_aot_core.generateCompiledArtifacts(entry, options) : await require_plugin_aot_core.generateCompiledArtifactsIsolated(entry, options);
|
|
27
|
+
const generated = initial ? await require_plugin_aot_core.generateCompiledArtifacts(entry, options, moduleCondition) : await require_plugin_aot_core.generateCompiledArtifactsIsolated(entry, options, moduleCondition);
|
|
28
28
|
initial = false;
|
|
29
29
|
source = generated.source;
|
|
30
30
|
stub = generated.stub;
|
|
@@ -56,7 +56,7 @@ const createAotPluginHooks = (entry, options) => {
|
|
|
56
56
|
if (stub.isProduction && isElysiaModule(cleanId)) out = require_plugin_aot_core.rewriteIsProductionCalls(out);
|
|
57
57
|
if (isEntry(cleanId)) {
|
|
58
58
|
entryMatched = true;
|
|
59
|
-
out = `import 'elysia/compiled'\n
|
|
59
|
+
out = (moduleCondition === "cjs" ? `require('elysia/compiled')\n` : `import 'elysia/compiled'\n`) + out;
|
|
60
60
|
}
|
|
61
61
|
return out === code ? void 0 : out;
|
|
62
62
|
},
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ADAPTER_BUN_FILTER, ADAPTER_CONSTANTS_FILTER, ELYSIA_MODULE_FILTER, IS_PRODUCTION_FILTER, NO_STUB, SOURCE_REGEX, STUB_SOURCES, adapterConstantsSource, alignStubExtensions, bunAdapterStubSource, generateCompiledArtifacts, generateCompiledArtifactsIsolated, makeIsElysiaModule, realPath, resolveElysiaRoot, resolveEntry, rewriteIsProductionCalls } from "./core.mjs";
|
|
1
|
+
import { ADAPTER_BUN_FILTER, ADAPTER_CONSTANTS_FILTER, ELYSIA_MODULE_FILTER, IS_PRODUCTION_FILTER, NO_STUB, SOURCE_REGEX, STUB_SOURCES, adapterConstantsSource, alignStubExtensions, bunAdapterStubSource, generateCompiledArtifacts, generateCompiledArtifactsIsolated, makeIsElysiaModule, realPath, resolveElysiaRoot, resolveEntry, resolveEntryModuleKind, rewriteIsProductionCalls } from "./core.mjs";
|
|
2
2
|
import { rewriteTypeImport } from "./treeshake.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/plugin/aot/hooks.ts
|
|
5
5
|
const toPosix = (path) => path.replace(/\\/g, "/");
|
|
6
6
|
const VIRTUAL = "\0elysia/compiled";
|
|
7
7
|
const VIRTUAL_TYPE = "\0elysia/type";
|
|
8
|
-
const createAotPluginHooks = (entry, options) => {
|
|
8
|
+
const createAotPluginHooks = (entry, options, moduleCondition = resolveEntryModuleKind(entry)) => {
|
|
9
9
|
const entryPath = resolveEntry(entry);
|
|
10
10
|
const entryPosix = toPosix(entryPath);
|
|
11
11
|
const entryRealPosix = toPosix(realPath(entryPath));
|
|
@@ -23,7 +23,7 @@ const createAotPluginHooks = (entry, options) => {
|
|
|
23
23
|
let isElysiaModule = (_path) => false;
|
|
24
24
|
return {
|
|
25
25
|
async buildStart() {
|
|
26
|
-
const generated = initial ? await generateCompiledArtifacts(entry, options) : await generateCompiledArtifactsIsolated(entry, options);
|
|
26
|
+
const generated = initial ? await generateCompiledArtifacts(entry, options, moduleCondition) : await generateCompiledArtifactsIsolated(entry, options, moduleCondition);
|
|
27
27
|
initial = false;
|
|
28
28
|
source = generated.source;
|
|
29
29
|
stub = generated.stub;
|
|
@@ -55,7 +55,7 @@ const createAotPluginHooks = (entry, options) => {
|
|
|
55
55
|
if (stub.isProduction && isElysiaModule(cleanId)) out = rewriteIsProductionCalls(out);
|
|
56
56
|
if (isEntry(cleanId)) {
|
|
57
57
|
entryMatched = true;
|
|
58
|
-
out = `import 'elysia/compiled'\n
|
|
58
|
+
out = (moduleCondition === "cjs" ? `require('elysia/compiled')\n` : `import 'elysia/compiled'\n`) + out;
|
|
59
59
|
}
|
|
60
60
|
return out === code ? void 0 : out;
|
|
61
61
|
},
|
|
@@ -4,9 +4,12 @@ import { JITProbeResult } from "../../compile/jit-probe.js";
|
|
|
4
4
|
|
|
5
5
|
//#region src/plugin/aot/source.d.ts
|
|
6
6
|
type AotTarget = 'bun' | 'node' | 'workerd';
|
|
7
|
+
type AotModuleCondition = 'esm' | 'cjs';
|
|
7
8
|
interface CompileToSourceOptions {
|
|
8
9
|
/** Emit a self-registering fingerprinted program (`Compiled.register(...)`). */
|
|
9
10
|
register?: boolean;
|
|
11
|
+
/** @internal Package condition used by the entry that owns this manifest. */
|
|
12
|
+
moduleCondition?: AotModuleCondition;
|
|
10
13
|
/**
|
|
11
14
|
* Deploy target for build-time-baked codegen consts. Lets you build on one
|
|
12
15
|
* runtime and deploy to another e.g. build under Bun with
|
|
@@ -57,4 +60,4 @@ interface CapturedArtifacts {
|
|
|
57
60
|
declare function captureArtifacts(app: AnyElysia, options?: CompileToSourceOptions): Promise<CapturedArtifacts>;
|
|
58
61
|
declare function replayStubbability(app: AnyElysia, handlers: CapturedHandler[]): JITProbeResult;
|
|
59
62
|
//#endregion
|
|
60
|
-
export { AotTarget, CapturedArtifacts, CompileToSourceOptions, autoGroupSize, captureArtifacts, compileToSource, replayStubbability };
|
|
63
|
+
export { AotModuleCondition, AotTarget, CapturedArtifacts, CompileToSourceOptions, autoGroupSize, captureArtifacts, compileToSource, replayStubbability };
|
|
@@ -28,7 +28,7 @@ async function captureArtifacts(app, options) {
|
|
|
28
28
|
const handlers = require_compile_aot_capture.endHandlerCapture();
|
|
29
29
|
const fingerprint = app["~aotFingerprint"] ?? require_compile_aot.createAotFingerprint();
|
|
30
30
|
return {
|
|
31
|
-
source: emitModule(captured, handlers, fingerprint, options),
|
|
31
|
+
source: emitModule(captured, handlers, fingerprint, options, options?.moduleCondition ?? "esm"),
|
|
32
32
|
validators: captured,
|
|
33
33
|
handlers,
|
|
34
34
|
fingerprint
|
|
@@ -64,15 +64,21 @@ function replayStubbability(app, handlers) {
|
|
|
64
64
|
require_validator_index.Validator.clear();
|
|
65
65
|
const history = app["~routes"] ?? [];
|
|
66
66
|
require_compile_jit_probe.JITProbe.begin();
|
|
67
|
+
const exact = /* @__PURE__ */ new Map();
|
|
68
|
+
for (const route of history) {
|
|
69
|
+
const method = route[0];
|
|
70
|
+
if (method === "WS") continue;
|
|
71
|
+
let paths = exact.get(method);
|
|
72
|
+
if (!paths) exact.set(method, paths = /* @__PURE__ */ new Set());
|
|
73
|
+
if (paths.has(route[1])) require_compile_jit_probe.JITProbe.record("handler:indexed-duplicate");
|
|
74
|
+
else paths.add(route[1]);
|
|
75
|
+
}
|
|
67
76
|
for (const route of history) try {
|
|
68
77
|
if (route[0] === "WS") continue;
|
|
69
78
|
require_compile_handler_index.compileHandler(route, app);
|
|
70
79
|
} catch {
|
|
71
|
-
require_compile_jit_probe.JITProbe.
|
|
72
|
-
return
|
|
73
|
-
jit: false,
|
|
74
|
-
reasons: ["handler:new-function"]
|
|
75
|
-
};
|
|
80
|
+
require_compile_jit_probe.JITProbe.record("handler:new-function");
|
|
81
|
+
return require_compile_jit_probe.JITProbe.end();
|
|
76
82
|
}
|
|
77
83
|
return require_compile_jit_probe.JITProbe.end();
|
|
78
84
|
} finally {
|
|
@@ -198,7 +204,7 @@ function entryParts(c, enc) {
|
|
|
198
204
|
}
|
|
199
205
|
return parts;
|
|
200
206
|
}
|
|
201
|
-
function emitModule(captured, handlers, fingerprint, options) {
|
|
207
|
+
function emitModule(captured, handlers, fingerprint, options, moduleCondition) {
|
|
202
208
|
const enc = createEntryEncoder();
|
|
203
209
|
const treeToSource = (tree, slotRef, sink) => {
|
|
204
210
|
const methods = [];
|
|
@@ -394,15 +400,16 @@ function emitModule(captured, handlers, fingerprint, options) {
|
|
|
394
400
|
handlerExport += "}\n";
|
|
395
401
|
const fingerprintExport = options?.register ? `export const fingerprint = ${JSON.stringify(fingerprint)}\n` : "";
|
|
396
402
|
let body = "// Generated by Elysia build plugin. Do not edit.\n";
|
|
397
|
-
|
|
398
|
-
if (options?.register
|
|
399
|
-
if (options?.register &&
|
|
403
|
+
const importNamed = (name, specifier) => moduleCondition === "cjs" ? `const { ${name} } = require(${JSON.stringify(specifier)})\n` : `import { ${name} } from ${JSON.stringify(specifier)}\n`;
|
|
404
|
+
if (options?.register) body += importNamed("Compiled", options.registerFrom ?? "elysia");
|
|
405
|
+
if (options?.register && enc.hasCoercePlan) body += importNamed("buildCoercedFromPlan", "elysia/coerce-plan");
|
|
406
|
+
if (options?.register && captured.length) body += importNamed("Reconstruct", options.reconstructFrom ?? "elysia/reconstruct");
|
|
400
407
|
const generated = enc.branchDecls + enc.unionDecls + validatorDecls + handlerDecls;
|
|
401
408
|
const needs = (symbol) => new RegExp(`\\b${symbol}\\b`).test(generated);
|
|
402
|
-
if (needs("CheckContext")) body += "
|
|
403
|
-
if (needs("Guard")) body += "
|
|
404
|
-
if (needs("Format")) body += "
|
|
405
|
-
if (needs("Hashing")) body += "
|
|
409
|
+
if (needs("CheckContext")) body += importNamed("CheckContext", "typebox/schema");
|
|
410
|
+
if (needs("Guard")) body += importNamed("Guard", "typebox/guard");
|
|
411
|
+
if (needs("Format")) body += importNamed("Format", "typebox/format");
|
|
412
|
+
if (needs("Hashing")) body += importNamed("Hashing", "typebox/system");
|
|
406
413
|
if (options?.register) {
|
|
407
414
|
body += "\n";
|
|
408
415
|
if (captured.length) body += "Compiled.reconstruct = Reconstruct\n";
|
|
@@ -27,7 +27,7 @@ async function captureArtifacts(app, options) {
|
|
|
27
27
|
const handlers = endHandlerCapture();
|
|
28
28
|
const fingerprint = app["~aotFingerprint"] ?? createAotFingerprint();
|
|
29
29
|
return {
|
|
30
|
-
source: emitModule(captured, handlers, fingerprint, options),
|
|
30
|
+
source: emitModule(captured, handlers, fingerprint, options, options?.moduleCondition ?? "esm"),
|
|
31
31
|
validators: captured,
|
|
32
32
|
handlers,
|
|
33
33
|
fingerprint
|
|
@@ -63,15 +63,21 @@ function replayStubbability(app, handlers) {
|
|
|
63
63
|
Validator.clear();
|
|
64
64
|
const history = app["~routes"] ?? [];
|
|
65
65
|
JITProbe.begin();
|
|
66
|
+
const exact = /* @__PURE__ */ new Map();
|
|
67
|
+
for (const route of history) {
|
|
68
|
+
const method = route[0];
|
|
69
|
+
if (method === "WS") continue;
|
|
70
|
+
let paths = exact.get(method);
|
|
71
|
+
if (!paths) exact.set(method, paths = /* @__PURE__ */ new Set());
|
|
72
|
+
if (paths.has(route[1])) JITProbe.record("handler:indexed-duplicate");
|
|
73
|
+
else paths.add(route[1]);
|
|
74
|
+
}
|
|
66
75
|
for (const route of history) try {
|
|
67
76
|
if (route[0] === "WS") continue;
|
|
68
77
|
compileHandler(route, app);
|
|
69
78
|
} catch {
|
|
70
|
-
JITProbe.
|
|
71
|
-
return
|
|
72
|
-
jit: false,
|
|
73
|
-
reasons: ["handler:new-function"]
|
|
74
|
-
};
|
|
79
|
+
JITProbe.record("handler:new-function");
|
|
80
|
+
return JITProbe.end();
|
|
75
81
|
}
|
|
76
82
|
return JITProbe.end();
|
|
77
83
|
} finally {
|
|
@@ -197,7 +203,7 @@ function entryParts(c, enc) {
|
|
|
197
203
|
}
|
|
198
204
|
return parts;
|
|
199
205
|
}
|
|
200
|
-
function emitModule(captured, handlers, fingerprint, options) {
|
|
206
|
+
function emitModule(captured, handlers, fingerprint, options, moduleCondition) {
|
|
201
207
|
const enc = createEntryEncoder();
|
|
202
208
|
const treeToSource = (tree, slotRef, sink) => {
|
|
203
209
|
const methods = [];
|
|
@@ -393,15 +399,16 @@ function emitModule(captured, handlers, fingerprint, options) {
|
|
|
393
399
|
handlerExport += "}\n";
|
|
394
400
|
const fingerprintExport = options?.register ? `export const fingerprint = ${JSON.stringify(fingerprint)}\n` : "";
|
|
395
401
|
let body = "// Generated by Elysia build plugin. Do not edit.\n";
|
|
396
|
-
|
|
397
|
-
if (options?.register
|
|
398
|
-
if (options?.register &&
|
|
402
|
+
const importNamed = (name, specifier) => moduleCondition === "cjs" ? `const { ${name} } = require(${JSON.stringify(specifier)})\n` : `import { ${name} } from ${JSON.stringify(specifier)}\n`;
|
|
403
|
+
if (options?.register) body += importNamed("Compiled", options.registerFrom ?? "elysia");
|
|
404
|
+
if (options?.register && enc.hasCoercePlan) body += importNamed("buildCoercedFromPlan", "elysia/coerce-plan");
|
|
405
|
+
if (options?.register && captured.length) body += importNamed("Reconstruct", options.reconstructFrom ?? "elysia/reconstruct");
|
|
399
406
|
const generated = enc.branchDecls + enc.unionDecls + validatorDecls + handlerDecls;
|
|
400
407
|
const needs = (symbol) => new RegExp(`\\b${symbol}\\b`).test(generated);
|
|
401
|
-
if (needs("CheckContext")) body += "
|
|
402
|
-
if (needs("Guard")) body += "
|
|
403
|
-
if (needs("Format")) body += "
|
|
404
|
-
if (needs("Hashing")) body += "
|
|
408
|
+
if (needs("CheckContext")) body += importNamed("CheckContext", "typebox/schema");
|
|
409
|
+
if (needs("Guard")) body += importNamed("Guard", "typebox/guard");
|
|
410
|
+
if (needs("Format")) body += importNamed("Format", "typebox/format");
|
|
411
|
+
if (needs("Hashing")) body += importNamed("Hashing", "typebox/system");
|
|
405
412
|
if (options?.register) {
|
|
406
413
|
body += "\n";
|
|
407
414
|
if (captured.length) body += "Compiled.reconstruct = Reconstruct\n";
|
|
@@ -6,8 +6,8 @@ let node_worker_threads = require("node:worker_threads");
|
|
|
6
6
|
//#region src/plugin/aot/worker.ts
|
|
7
7
|
const port = node_worker_threads.parentPort;
|
|
8
8
|
if (!port) throw new Error("[elysia-aot] worker requires a parent port");
|
|
9
|
-
const { file, options } = node_worker_threads.workerData;
|
|
10
|
-
require_plugin_aot_core.generateCompiledArtifacts(file, options).then((artifacts) => port.postMessage({
|
|
9
|
+
const { file, options, moduleCondition } = node_worker_threads.workerData;
|
|
10
|
+
require_plugin_aot_core.generateCompiledArtifacts(file, options, moduleCondition).then((artifacts) => port.postMessage({
|
|
11
11
|
ok: true,
|
|
12
12
|
artifacts
|
|
13
13
|
}), (error) => {
|
|
@@ -4,8 +4,8 @@ import { parentPort, workerData } from "node:worker_threads";
|
|
|
4
4
|
//#region src/plugin/aot/worker.ts
|
|
5
5
|
const port = parentPort;
|
|
6
6
|
if (!port) throw new Error("[elysia-aot] worker requires a parent port");
|
|
7
|
-
const { file, options } = workerData;
|
|
8
|
-
generateCompiledArtifacts(file, options).then((artifacts) => port.postMessage({
|
|
7
|
+
const { file, options, moduleCondition } = workerData;
|
|
8
|
+
generateCompiledArtifacts(file, options, moduleCondition).then((artifacts) => port.postMessage({
|
|
9
9
|
ok: true,
|
|
10
10
|
artifacts
|
|
11
11
|
}), (error) => {
|
package/dist/route-table.d.ts
CHANGED
package/dist/route-table.js
CHANGED
|
@@ -5,7 +5,10 @@ const require_constants = require('./constants.js');
|
|
|
5
5
|
const RouteFlag = {
|
|
6
6
|
WS: 1,
|
|
7
7
|
Dynamic: 2,
|
|
8
|
-
Encode: 4
|
|
8
|
+
Encode: 4,
|
|
9
|
+
ExactDuplicate: 8,
|
|
10
|
+
JITCold: 16,
|
|
11
|
+
JITSatisfied: 32
|
|
9
12
|
};
|
|
10
13
|
function buildRouteTable(declaredRoutes) {
|
|
11
14
|
const length = declaredRoutes.length;
|
|
@@ -47,16 +50,18 @@ function buildRouteTable(declaredRoutes) {
|
|
|
47
50
|
macroScope
|
|
48
51
|
};
|
|
49
52
|
}
|
|
50
|
-
const routeRow = (table, id) =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
53
|
+
const routeRow = (table, id) => {
|
|
54
|
+
return [
|
|
55
|
+
table.method[id],
|
|
56
|
+
table.path[id],
|
|
57
|
+
table.handler[id],
|
|
58
|
+
table.owner[id],
|
|
59
|
+
table.localHook[id],
|
|
60
|
+
table.appHook[id],
|
|
61
|
+
table.inheritedChain[id],
|
|
62
|
+
table.macroScope?.get(id)
|
|
63
|
+
];
|
|
64
|
+
};
|
|
60
65
|
|
|
61
66
|
//#endregion
|
|
62
67
|
exports.RouteFlag = RouteFlag;
|
package/dist/route-table.mjs
CHANGED
|
@@ -4,7 +4,10 @@ import { needEncodeRegex } from "./constants.mjs";
|
|
|
4
4
|
const RouteFlag = {
|
|
5
5
|
WS: 1,
|
|
6
6
|
Dynamic: 2,
|
|
7
|
-
Encode: 4
|
|
7
|
+
Encode: 4,
|
|
8
|
+
ExactDuplicate: 8,
|
|
9
|
+
JITCold: 16,
|
|
10
|
+
JITSatisfied: 32
|
|
8
11
|
};
|
|
9
12
|
function buildRouteTable(declaredRoutes) {
|
|
10
13
|
const length = declaredRoutes.length;
|
|
@@ -46,16 +49,18 @@ function buildRouteTable(declaredRoutes) {
|
|
|
46
49
|
macroScope
|
|
47
50
|
};
|
|
48
51
|
}
|
|
49
|
-
const routeRow = (table, id) =>
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
52
|
+
const routeRow = (table, id) => {
|
|
53
|
+
return [
|
|
54
|
+
table.method[id],
|
|
55
|
+
table.path[id],
|
|
56
|
+
table.handler[id],
|
|
57
|
+
table.owner[id],
|
|
58
|
+
table.localHook[id],
|
|
59
|
+
table.appHook[id],
|
|
60
|
+
table.inheritedChain[id],
|
|
61
|
+
table.macroScope?.get(id)
|
|
62
|
+
];
|
|
63
|
+
};
|
|
59
64
|
|
|
60
65
|
//#endregion
|
|
61
66
|
export { RouteFlag, buildRouteTable, routeRow };
|
package/dist/schema-snapshot.js
CHANGED
|
@@ -52,8 +52,7 @@ function isImmutableNode(value) {
|
|
|
52
52
|
immutableNodes.set(value, immutable);
|
|
53
53
|
return immutable;
|
|
54
54
|
}
|
|
55
|
-
|
|
56
|
-
function deepCloneSchema(value, seen, canShare = true) {
|
|
55
|
+
function deepCloneSchema(value, freeze, seen, canShare = true) {
|
|
57
56
|
if (value === null || typeof value !== "object") return value;
|
|
58
57
|
const cached = seen?.get(value);
|
|
59
58
|
if (cached) return cached;
|
|
@@ -61,8 +60,8 @@ function deepCloneSchema(value, seen, canShare = true) {
|
|
|
61
60
|
const out = [];
|
|
62
61
|
seen ??= /* @__PURE__ */ new Map();
|
|
63
62
|
seen.set(value, out);
|
|
64
|
-
for (let i = 0; i < value.length; i++) out[i] = deepCloneSchema(value[i], seen);
|
|
65
|
-
return
|
|
63
|
+
for (let i = 0; i < value.length; i++) out[i] = deepCloneSchema(value[i], freeze, seen);
|
|
64
|
+
return freeze ? Object.freeze(out) : out;
|
|
66
65
|
}
|
|
67
66
|
if (canShare && isImmutableNode(value)) return value;
|
|
68
67
|
const proto = Object.getPrototypeOf(value);
|
|
@@ -84,7 +83,7 @@ function deepCloneSchema(value, seen, canShare = true) {
|
|
|
84
83
|
});
|
|
85
84
|
continue;
|
|
86
85
|
}
|
|
87
|
-
const cloned = deepCloneSchema(property, seen);
|
|
86
|
+
const cloned = deepCloneSchema(property, freeze, seen);
|
|
88
87
|
if (key === "__proto__") Object.defineProperty(out, key, {
|
|
89
88
|
value: cloned,
|
|
90
89
|
enumerable: true,
|
|
@@ -97,7 +96,7 @@ function deepCloneSchema(value, seen, canShare = true) {
|
|
|
97
96
|
for (let i = 0; i < symbols.length; i++) {
|
|
98
97
|
const key = symbols[i];
|
|
99
98
|
const property = value[key];
|
|
100
|
-
if (isEnumerable.call(value, key)) out[key] = deepCloneSchema(property, seen);
|
|
99
|
+
if (isEnumerable.call(value, key)) out[key] = deepCloneSchema(property, freeze, seen);
|
|
101
100
|
else Object.defineProperty(out, key, {
|
|
102
101
|
value: property,
|
|
103
102
|
enumerable: false,
|
|
@@ -105,7 +104,7 @@ function deepCloneSchema(value, seen, canShare = true) {
|
|
|
105
104
|
configurable: true
|
|
106
105
|
});
|
|
107
106
|
}
|
|
108
|
-
return
|
|
107
|
+
return freeze ? Object.freeze(out) : out;
|
|
109
108
|
}
|
|
110
109
|
const refIds = /* @__PURE__ */ new WeakMap();
|
|
111
110
|
let nextRefId = 0;
|
|
@@ -114,9 +113,8 @@ function refKey(value) {
|
|
|
114
113
|
if (id === void 0) refIds.set(value, id = ++nextRefId);
|
|
115
114
|
return "r" + id + ";";
|
|
116
115
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
function fingerprint(value, seen, canShare = true) {
|
|
116
|
+
const byRefKey = (value, state) => value !== null && (typeof value === "object" || typeof value === "function") ? refKey(value) : fingerprint(value, void 0, state);
|
|
117
|
+
function fingerprint(value, seen, state, canShare = true) {
|
|
120
118
|
if (value === null) return "z;";
|
|
121
119
|
const type = typeof value;
|
|
122
120
|
if (type !== "object") switch (type) {
|
|
@@ -127,7 +125,7 @@ function fingerprint(value, seen, canShare = true) {
|
|
|
127
125
|
case "undefined": return "u;";
|
|
128
126
|
case "bigint": return "g" + value + ";";
|
|
129
127
|
default:
|
|
130
|
-
|
|
128
|
+
state.bail = true;
|
|
131
129
|
return "y;";
|
|
132
130
|
}
|
|
133
131
|
const backReference = seen?.get(value);
|
|
@@ -136,7 +134,7 @@ function fingerprint(value, seen, canShare = true) {
|
|
|
136
134
|
seen ??= /* @__PURE__ */ new Map();
|
|
137
135
|
seen.set(value, seen.size);
|
|
138
136
|
let out = "[";
|
|
139
|
-
for (let i = 0; i < value.length; i++) out += fingerprint(value[i], seen);
|
|
137
|
+
for (let i = 0; i < value.length; i++) out += fingerprint(value[i], seen, state);
|
|
140
138
|
return out + "];";
|
|
141
139
|
}
|
|
142
140
|
if (canShare && isImmutableNode(value)) return refKey(value);
|
|
@@ -151,9 +149,9 @@ function fingerprint(value, seen, canShare = true) {
|
|
|
151
149
|
const key = keys[i];
|
|
152
150
|
const property = value[key];
|
|
153
151
|
out += "k" + key.length + ":" + key;
|
|
154
|
-
out += !allEnumerable && !isEnumerable.call(value, key) ? "!" + byRefKey(property) : "=" + fingerprint(property, seen);
|
|
152
|
+
out += !allEnumerable && !isEnumerable.call(value, key) ? "!" + byRefKey(property, state) : "=" + fingerprint(property, seen, state);
|
|
155
153
|
}
|
|
156
|
-
if (Object.getOwnPropertySymbols(value).length)
|
|
154
|
+
if (Object.getOwnPropertySymbols(value).length) state.bail = true;
|
|
157
155
|
return out + "};";
|
|
158
156
|
}
|
|
159
157
|
/**
|
|
@@ -169,7 +167,7 @@ function snapshotSchema(schema) {
|
|
|
169
167
|
if (existing) return existing;
|
|
170
168
|
let cloned;
|
|
171
169
|
try {
|
|
172
|
-
cloned = deepCloneSchema(object, void 0, false);
|
|
170
|
+
cloned = deepCloneSchema(object, false, void 0, false);
|
|
173
171
|
} catch (error) {
|
|
174
172
|
console.warn("[Elysia] schema snapshot failed; schema kept by reference:", error);
|
|
175
173
|
return schema;
|
|
@@ -193,11 +191,11 @@ function internSchema(schema, intern) {
|
|
|
193
191
|
if (existing) return existing;
|
|
194
192
|
let key;
|
|
195
193
|
if (intern) {
|
|
196
|
-
|
|
194
|
+
const state = { bail: false };
|
|
197
195
|
try {
|
|
198
|
-
key = fingerprint(object, void 0, false);
|
|
196
|
+
key = fingerprint(object, void 0, state, false);
|
|
199
197
|
} catch {}
|
|
200
|
-
if (
|
|
198
|
+
if (state.bail) key = void 0;
|
|
201
199
|
}
|
|
202
200
|
if (key !== void 0) {
|
|
203
201
|
const shared = interned.get(key);
|
|
@@ -211,14 +209,11 @@ function internSchema(schema, intern) {
|
|
|
211
209
|
}
|
|
212
210
|
}
|
|
213
211
|
let cloned;
|
|
214
|
-
freezeClones = true;
|
|
215
212
|
try {
|
|
216
|
-
cloned = deepCloneSchema(object, void 0, false);
|
|
213
|
+
cloned = deepCloneSchema(object, true, void 0, false);
|
|
217
214
|
} catch (error) {
|
|
218
215
|
console.warn("[Elysia] schema snapshot failed; schema kept by reference:", error);
|
|
219
216
|
return schema;
|
|
220
|
-
} finally {
|
|
221
|
-
freezeClones = false;
|
|
222
217
|
}
|
|
223
218
|
hookSnapshots.set(object, cloned);
|
|
224
219
|
produced.add(cloned);
|
package/dist/schema-snapshot.mjs
CHANGED
|
@@ -51,8 +51,7 @@ function isImmutableNode(value) {
|
|
|
51
51
|
immutableNodes.set(value, immutable);
|
|
52
52
|
return immutable;
|
|
53
53
|
}
|
|
54
|
-
|
|
55
|
-
function deepCloneSchema(value, seen, canShare = true) {
|
|
54
|
+
function deepCloneSchema(value, freeze, seen, canShare = true) {
|
|
56
55
|
if (value === null || typeof value !== "object") return value;
|
|
57
56
|
const cached = seen?.get(value);
|
|
58
57
|
if (cached) return cached;
|
|
@@ -60,8 +59,8 @@ function deepCloneSchema(value, seen, canShare = true) {
|
|
|
60
59
|
const out = [];
|
|
61
60
|
seen ??= /* @__PURE__ */ new Map();
|
|
62
61
|
seen.set(value, out);
|
|
63
|
-
for (let i = 0; i < value.length; i++) out[i] = deepCloneSchema(value[i], seen);
|
|
64
|
-
return
|
|
62
|
+
for (let i = 0; i < value.length; i++) out[i] = deepCloneSchema(value[i], freeze, seen);
|
|
63
|
+
return freeze ? Object.freeze(out) : out;
|
|
65
64
|
}
|
|
66
65
|
if (canShare && isImmutableNode(value)) return value;
|
|
67
66
|
const proto = Object.getPrototypeOf(value);
|
|
@@ -83,7 +82,7 @@ function deepCloneSchema(value, seen, canShare = true) {
|
|
|
83
82
|
});
|
|
84
83
|
continue;
|
|
85
84
|
}
|
|
86
|
-
const cloned = deepCloneSchema(property, seen);
|
|
85
|
+
const cloned = deepCloneSchema(property, freeze, seen);
|
|
87
86
|
if (key === "__proto__") Object.defineProperty(out, key, {
|
|
88
87
|
value: cloned,
|
|
89
88
|
enumerable: true,
|
|
@@ -96,7 +95,7 @@ function deepCloneSchema(value, seen, canShare = true) {
|
|
|
96
95
|
for (let i = 0; i < symbols.length; i++) {
|
|
97
96
|
const key = symbols[i];
|
|
98
97
|
const property = value[key];
|
|
99
|
-
if (isEnumerable.call(value, key)) out[key] = deepCloneSchema(property, seen);
|
|
98
|
+
if (isEnumerable.call(value, key)) out[key] = deepCloneSchema(property, freeze, seen);
|
|
100
99
|
else Object.defineProperty(out, key, {
|
|
101
100
|
value: property,
|
|
102
101
|
enumerable: false,
|
|
@@ -104,7 +103,7 @@ function deepCloneSchema(value, seen, canShare = true) {
|
|
|
104
103
|
configurable: true
|
|
105
104
|
});
|
|
106
105
|
}
|
|
107
|
-
return
|
|
106
|
+
return freeze ? Object.freeze(out) : out;
|
|
108
107
|
}
|
|
109
108
|
const refIds = /* @__PURE__ */ new WeakMap();
|
|
110
109
|
let nextRefId = 0;
|
|
@@ -113,9 +112,8 @@ function refKey(value) {
|
|
|
113
112
|
if (id === void 0) refIds.set(value, id = ++nextRefId);
|
|
114
113
|
return "r" + id + ";";
|
|
115
114
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
function fingerprint(value, seen, canShare = true) {
|
|
115
|
+
const byRefKey = (value, state) => value !== null && (typeof value === "object" || typeof value === "function") ? refKey(value) : fingerprint(value, void 0, state);
|
|
116
|
+
function fingerprint(value, seen, state, canShare = true) {
|
|
119
117
|
if (value === null) return "z;";
|
|
120
118
|
const type = typeof value;
|
|
121
119
|
if (type !== "object") switch (type) {
|
|
@@ -126,7 +124,7 @@ function fingerprint(value, seen, canShare = true) {
|
|
|
126
124
|
case "undefined": return "u;";
|
|
127
125
|
case "bigint": return "g" + value + ";";
|
|
128
126
|
default:
|
|
129
|
-
|
|
127
|
+
state.bail = true;
|
|
130
128
|
return "y;";
|
|
131
129
|
}
|
|
132
130
|
const backReference = seen?.get(value);
|
|
@@ -135,7 +133,7 @@ function fingerprint(value, seen, canShare = true) {
|
|
|
135
133
|
seen ??= /* @__PURE__ */ new Map();
|
|
136
134
|
seen.set(value, seen.size);
|
|
137
135
|
let out = "[";
|
|
138
|
-
for (let i = 0; i < value.length; i++) out += fingerprint(value[i], seen);
|
|
136
|
+
for (let i = 0; i < value.length; i++) out += fingerprint(value[i], seen, state);
|
|
139
137
|
return out + "];";
|
|
140
138
|
}
|
|
141
139
|
if (canShare && isImmutableNode(value)) return refKey(value);
|
|
@@ -150,9 +148,9 @@ function fingerprint(value, seen, canShare = true) {
|
|
|
150
148
|
const key = keys[i];
|
|
151
149
|
const property = value[key];
|
|
152
150
|
out += "k" + key.length + ":" + key;
|
|
153
|
-
out += !allEnumerable && !isEnumerable.call(value, key) ? "!" + byRefKey(property) : "=" + fingerprint(property, seen);
|
|
151
|
+
out += !allEnumerable && !isEnumerable.call(value, key) ? "!" + byRefKey(property, state) : "=" + fingerprint(property, seen, state);
|
|
154
152
|
}
|
|
155
|
-
if (Object.getOwnPropertySymbols(value).length)
|
|
153
|
+
if (Object.getOwnPropertySymbols(value).length) state.bail = true;
|
|
156
154
|
return out + "};";
|
|
157
155
|
}
|
|
158
156
|
/**
|
|
@@ -168,7 +166,7 @@ function snapshotSchema(schema) {
|
|
|
168
166
|
if (existing) return existing;
|
|
169
167
|
let cloned;
|
|
170
168
|
try {
|
|
171
|
-
cloned = deepCloneSchema(object, void 0, false);
|
|
169
|
+
cloned = deepCloneSchema(object, false, void 0, false);
|
|
172
170
|
} catch (error) {
|
|
173
171
|
console.warn("[Elysia] schema snapshot failed; schema kept by reference:", error);
|
|
174
172
|
return schema;
|
|
@@ -192,11 +190,11 @@ function internSchema(schema, intern) {
|
|
|
192
190
|
if (existing) return existing;
|
|
193
191
|
let key;
|
|
194
192
|
if (intern) {
|
|
195
|
-
|
|
193
|
+
const state = { bail: false };
|
|
196
194
|
try {
|
|
197
|
-
key = fingerprint(object, void 0, false);
|
|
195
|
+
key = fingerprint(object, void 0, state, false);
|
|
198
196
|
} catch {}
|
|
199
|
-
if (
|
|
197
|
+
if (state.bail) key = void 0;
|
|
200
198
|
}
|
|
201
199
|
if (key !== void 0) {
|
|
202
200
|
const shared = interned.get(key);
|
|
@@ -210,14 +208,11 @@ function internSchema(schema, intern) {
|
|
|
210
208
|
}
|
|
211
209
|
}
|
|
212
210
|
let cloned;
|
|
213
|
-
freezeClones = true;
|
|
214
211
|
try {
|
|
215
|
-
cloned = deepCloneSchema(object, void 0, false);
|
|
212
|
+
cloned = deepCloneSchema(object, true, void 0, false);
|
|
216
213
|
} catch (error) {
|
|
217
214
|
console.warn("[Elysia] schema snapshot failed; schema kept by reference:", error);
|
|
218
215
|
return schema;
|
|
219
|
-
} finally {
|
|
220
|
-
freezeClones = false;
|
|
221
216
|
}
|
|
222
217
|
hookSnapshots.set(object, cloned);
|
|
223
218
|
produced.add(cloned);
|
|
@@ -5,8 +5,8 @@ import { TypeBoxValidatorCache, mayHaveFileType } from "./validator/validator-ca
|
|
|
5
5
|
import { TypeBoxValidator } from "./validator/index.js";
|
|
6
6
|
import { applyCoercions, coerceBody, coerceFormData, coerceQuery, coerceRoot, coerceStringToStructure } from "./coerce.js";
|
|
7
7
|
import { Ref } from "typebox/type";
|
|
8
|
-
import { Compile } from "typebox/compile";
|
|
9
8
|
import { Check, Clone, Create, Decode, Default, HasCodec } from "typebox/value";
|
|
9
|
+
import { Compile } from "typebox/compile";
|
|
10
10
|
|
|
11
11
|
//#region src/type/bridge-live.d.ts
|
|
12
12
|
declare function useTypebox(_mod?: Parameters<typeof useTypebox$1>[0]): void;
|
package/dist/type/bridge-live.js
CHANGED
|
@@ -5,9 +5,9 @@ const require_type_coerce = require('./coerce.js');
|
|
|
5
5
|
const require_type_validator_validator_cache = require('./validator/validator-cache.js');
|
|
6
6
|
const require_type_validator_index = require('./validator/index.js');
|
|
7
7
|
const require_type_elysia_intersect = require('./elysia/intersect.js');
|
|
8
|
-
let typebox_type = require("typebox/type");
|
|
9
|
-
let typebox_compile = require("typebox/compile");
|
|
10
8
|
let typebox_value = require("typebox/value");
|
|
9
|
+
let typebox_compile = require("typebox/compile");
|
|
10
|
+
let typebox_type = require("typebox/type");
|
|
11
11
|
let typebox_system = require("typebox/system");
|
|
12
12
|
|
|
13
13
|
//#region src/type/bridge-live.ts
|
|
@@ -3,9 +3,9 @@ import { applyCoercions, coerceBody, coerceFormData, coerceQuery, coerceRoot, co
|
|
|
3
3
|
import { TypeBoxValidatorCache, mayHaveFileType } from "./validator/validator-cache.mjs";
|
|
4
4
|
import { TypeBoxValidator } from "./validator/index.mjs";
|
|
5
5
|
import { Intersect } from "./elysia/intersect.mjs";
|
|
6
|
-
import { Ref } from "typebox/type";
|
|
7
|
-
import { Compile } from "typebox/compile";
|
|
8
6
|
import { Check, Clone, Create, Decode, Default, HasCodec } from "typebox/value";
|
|
7
|
+
import { Compile } from "typebox/compile";
|
|
8
|
+
import { Ref } from "typebox/type";
|
|
9
9
|
import { Settings } from "typebox/system";
|
|
10
10
|
|
|
11
11
|
//#region src/type/bridge-live.ts
|
package/dist/type/bridge.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { TypeBoxValidatorCache as TypeBoxValidatorCache$1, mayHaveFileType as ma
|
|
|
4
4
|
import { TypeBoxValidator as TypeBoxValidator$1 } from "./validator/index.js";
|
|
5
5
|
import { applyCoercions as applyCoercions$1, coerceBody as coerceBody$1, coerceFormData as coerceFormData$1, coerceQuery as coerceQuery$1, coerceRoot as coerceRoot$1, coerceStringToStructure as coerceStringToStructure$1 } from "./coerce.js";
|
|
6
6
|
import { Ref as Ref$1, TAny, TSchema } from "typebox/type";
|
|
7
|
-
import { Compile as Compile$1 } from "typebox/compile";
|
|
8
7
|
import { Check as Check$1, Clone as Clone$1, Create as Create$1, Decode as Decode$2, Default as Default$1, HasCodec as HasCodec$1 } from "typebox/value";
|
|
8
|
+
import { Compile as Compile$1 } from "typebox/compile";
|
|
9
9
|
|
|
10
10
|
//#region src/type/bridge.d.ts
|
|
11
11
|
interface TypeboxModule {
|