void 0.8.5 → 0.8.6
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/index.mjs +38 -2
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -2944,6 +2944,37 @@ window.__vite_plugin_react_preamble_installed__ = true;
|
|
|
2944
2944
|
lines.push(`const __migrations = ${JSON.stringify(options.migrations)};`);
|
|
2945
2945
|
lines.push(`const __migrationPlanBundle = ${JSON.stringify(options.migrationPlanBundle)};`);
|
|
2946
2946
|
lines.push(`const __migrationDialect = ${JSON.stringify(options.migrationDialect ?? "sqlite")};`);
|
|
2947
|
+
lines.push("function __voidCreateMigrationRequestHandler(request, includeAuthMigrations, includePlanBundle) {");
|
|
2948
|
+
lines.push(" return __createMigrationHandler(");
|
|
2949
|
+
lines.push(" __getRawEnv(),");
|
|
2950
|
+
lines.push(" __migrations,");
|
|
2951
|
+
lines.push(" __migrationDialect,");
|
|
2952
|
+
if (auth) lines.push(` includeAuthMigrations ? () => runVoidAuthMigrations(new Request(request.url), __getRawEnv(), __voidAuthOptions${auth.authSchemaPath ? ", __voidAuthMigrationSchema" : ""}) : undefined,`);
|
|
2953
|
+
else lines.push(" undefined,");
|
|
2954
|
+
lines.push(" includePlanBundle ? __migrationPlanBundle : undefined,");
|
|
2955
|
+
lines.push(" );");
|
|
2956
|
+
lines.push("}");
|
|
2957
|
+
lines.push("export async function __voidHandleInternalRoute(request) {");
|
|
2958
|
+
lines.push(" const url = new URL(request.url);");
|
|
2959
|
+
lines.push(" if (request.method === \"POST\" && url.pathname === \"/__void/migrate\") {");
|
|
2960
|
+
lines.push(` return __voidCreateMigrationRequestHandler(request, ${auth ? "true" : "false"}, false)(request);`);
|
|
2961
|
+
lines.push(" }");
|
|
2962
|
+
lines.push(" if (request.method === \"GET\" && url.pathname === \"/__void/migrate/capabilities\") {");
|
|
2963
|
+
lines.push(` return __voidCreateMigrationRequestHandler(request, ${auth ? "true" : "false"}, true)(request);`);
|
|
2964
|
+
lines.push(" }");
|
|
2965
|
+
lines.push(" if (request.method === \"POST\" && url.pathname === \"/__void/migrate/app\") {");
|
|
2966
|
+
lines.push(" return __voidCreateMigrationRequestHandler(request, false, true)(request);");
|
|
2967
|
+
lines.push(" }");
|
|
2968
|
+
lines.push(" if (request.method === \"GET\" && url.pathname.startsWith(\"/__void/migrate/app/attempt/\")) {");
|
|
2969
|
+
lines.push(" return __voidCreateMigrationRequestHandler(request, false, true)(request);");
|
|
2970
|
+
lines.push(" }");
|
|
2971
|
+
if (auth) {
|
|
2972
|
+
lines.push(" if (request.method === \"POST\" && url.pathname === \"/__void/migrate/auth\") {");
|
|
2973
|
+
lines.push(" return __voidCreateMigrationRequestHandler(request, true, true)(request);");
|
|
2974
|
+
lines.push(" }");
|
|
2975
|
+
}
|
|
2976
|
+
lines.push(" return null;");
|
|
2977
|
+
lines.push("}");
|
|
2947
2978
|
lines.push("app.post(\"/__void/migrate\", async (c) => {");
|
|
2948
2979
|
lines.push(" const __voidMigrationHandler = __createMigrationHandler(");
|
|
2949
2980
|
lines.push(" __getRawEnv(),");
|
|
@@ -2998,6 +3029,9 @@ window.__vite_plugin_react_preamble_installed__ = true;
|
|
|
2998
3029
|
lines.push("});");
|
|
2999
3030
|
}
|
|
3000
3031
|
lines.push("");
|
|
3032
|
+
} else {
|
|
3033
|
+
lines.push("export async function __voidHandleInternalRoute() { return null; }");
|
|
3034
|
+
lines.push("");
|
|
3001
3035
|
}
|
|
3002
3036
|
if (options.bindingHandlerPath) {
|
|
3003
3037
|
lines.push(`import { createBindingHandler as __createBindingHandler } from ${JSON.stringify(options.bindingHandlerPath)};`);
|
|
@@ -3554,6 +3588,8 @@ ${envValidateCall} const ws = await __voidHandleWebSocket(request, env);
|
|
|
3554
3588
|
if (request.method === "GET" && url.pathname === "/__void/ready") {
|
|
3555
3589
|
return Response.json({ ready: true });
|
|
3556
3590
|
}
|
|
3591
|
+
const routeInternal = await __voidHandleInternalRoute(request, env, ctx);
|
|
3592
|
+
if (routeInternal) return routeInternal;
|
|
3557
3593
|
if (request.method !== "POST" || url.pathname !== "/__void/prerender-paths") return null;
|
|
3558
3594
|
const __expected = env.__VOID_PROXY_TOKEN;
|
|
3559
3595
|
if (__expected) {
|
|
@@ -3573,7 +3609,7 @@ ${envValidateCall} if (env.__VOID_REMOTE === "1") env = createRemoteEnv(env);
|
|
|
3573
3609
|
${envValidateCall} const userEnv = __filterInternalBindings(env);
|
|
3574
3610
|
return withRuntimeEnv(env, () => scheduled(controller, userEnv, ctx));
|
|
3575
3611
|
}`;
|
|
3576
|
-
if (hasQueues) return `${sandboxImport}${liveRuntimeImport}import app, { scheduled, __voidCollectPrerenderPaths, __voidHandleWebSocket, __withRawEnv, __processQueue${webSocketClasses.length > 0 ? `, ${webSocketClasses.join(", ")}` : ""}${liveRouteImport} } from 'virtual:void-routes';
|
|
3612
|
+
if (hasQueues) return `${sandboxImport}${liveRuntimeImport}import app, { scheduled, __voidCollectPrerenderPaths, __voidHandleInternalRoute, __voidHandleWebSocket, __withRawEnv, __processQueue${webSocketClasses.length > 0 ? `, ${webSocketClasses.join(", ")}` : ""}${liveRouteImport} } from 'virtual:void-routes';
|
|
3577
3613
|
${runtimeEnvImport}${envSchemaImport}${remoteImport}${filterBindingsHelper}${assetHelper}
|
|
3578
3614
|
${internalRouteHelper}
|
|
3579
3615
|
${scheduledHandler}
|
|
@@ -3602,7 +3638,7 @@ ${webSocketClasses.map((name) => `export { ${name} };`).join("\n")}
|
|
|
3602
3638
|
${liveExport}
|
|
3603
3639
|
${sandboxExport}
|
|
3604
3640
|
export default { fetch: ${fetchHandler}, scheduled: handleScheduled, queue };`;
|
|
3605
|
-
return `${sandboxImport}${liveRuntimeImport}import app, { scheduled, __voidCollectPrerenderPaths, __voidHandleWebSocket, __withRawEnv${webSocketClasses.length > 0 ? `, ${webSocketClasses.join(", ")}` : ""}${liveRouteImport} } from 'virtual:void-routes';
|
|
3641
|
+
return `${sandboxImport}${liveRuntimeImport}import app, { scheduled, __voidCollectPrerenderPaths, __voidHandleInternalRoute, __voidHandleWebSocket, __withRawEnv${webSocketClasses.length > 0 ? `, ${webSocketClasses.join(", ")}` : ""}${liveRouteImport} } from 'virtual:void-routes';
|
|
3606
3642
|
${runtimeEnvImport}${envSchemaImport}${remoteImport}${filterBindingsHelper}${assetHelper}
|
|
3607
3643
|
${internalRouteHelper}
|
|
3608
3644
|
${scheduledHandler}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "void",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/voidzero-dev/void.git",
|
|
@@ -333,7 +333,7 @@
|
|
|
333
333
|
"valibot": ">=1.0.0-beta.7",
|
|
334
334
|
"vite": "^8.0.0",
|
|
335
335
|
"zod": "^3.25.0 || ^4.0.0",
|
|
336
|
-
"@void/md": "0.8.
|
|
336
|
+
"@void/md": "0.8.6"
|
|
337
337
|
},
|
|
338
338
|
"peerDependenciesMeta": {
|
|
339
339
|
"@void/md": {
|