cf-workers-native 0.1.2-beta.local.sha2f5e4e6956f4 → 0.1.2-beta.pr65.shae5092d3abc51
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.
|
@@ -4,13 +4,13 @@ import { createRequire, builtinModules } from "node:module";
|
|
|
4
4
|
import { build } from "esbuild";
|
|
5
5
|
import { compileServerWorker, } from "../server.js";
|
|
6
6
|
import { permitsPath } from "../route-permissions.js";
|
|
7
|
-
import { readVoidPlan, voidSelector, usesServerProcess } from "./plan.js";
|
|
7
|
+
import { readVoidPlan, voidSelector, usesServerProcess, voidRoutingStart, } from "./plan.js";
|
|
8
8
|
/** Generated Void Pages builds only. Unknown generators keep the Worker boundary. */
|
|
9
9
|
export async function compileVoid(entry, permissions, bindings) {
|
|
10
10
|
if (basename(entry) !== "index.js" || basename(dirname(entry)) !== "ssr")
|
|
11
11
|
return;
|
|
12
12
|
const source = await readFile(entry, "utf8");
|
|
13
|
-
if (
|
|
13
|
+
if (voidRoutingStart(source) < 0)
|
|
14
14
|
return;
|
|
15
15
|
const remote = await compileServerWorker(entry, bindings, {
|
|
16
16
|
execution: "network",
|
|
@@ -7,6 +7,8 @@ export interface VoidRoute {
|
|
|
7
7
|
component?: string;
|
|
8
8
|
renderMode?: "server" | "client";
|
|
9
9
|
}
|
|
10
|
+
/** Vite 8.3.5 emits plain module comments instead of region comments. */
|
|
11
|
+
export declare function voidRoutingStart(source: string): number;
|
|
10
12
|
/** Read only the pinned generator's literal registrations, never application source. */
|
|
11
13
|
export declare function readVoidPlan(source: string): {
|
|
12
14
|
routes: VoidRoute[];
|
|
@@ -61,11 +61,15 @@ export function usesServerProcess(source) {
|
|
|
61
61
|
});
|
|
62
62
|
return unsafe;
|
|
63
63
|
}
|
|
64
|
+
/** Vite 8.3.5 emits plain module comments instead of region comments. */
|
|
65
|
+
export function voidRoutingStart(source) {
|
|
66
|
+
return source.search(/^\/\/(?:#region)? virtual:void-routes\r?$/m);
|
|
67
|
+
}
|
|
64
68
|
/** Read only the pinned generator's literal registrations, never application source. */
|
|
65
69
|
export function readVoidPlan(source) {
|
|
66
|
-
const start = source
|
|
67
|
-
const end = source.
|
|
68
|
-
if (start < 0 || end
|
|
70
|
+
const start = voidRoutingStart(source);
|
|
71
|
+
const end = source.search(/^\/\/(?:#region)? \.void\/entry\.ts\r?$/m);
|
|
72
|
+
if (start < 0 || end <= start)
|
|
69
73
|
throw new Error("Unknown Void generated routing entry");
|
|
70
74
|
const program = parseAst(source);
|
|
71
75
|
const declarations = new Map();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cf-workers-native",
|
|
3
|
-
"version": "0.1.2-beta.
|
|
3
|
+
"version": "0.1.2-beta.pr65.shae5092d3abc51",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Bring Cloudflare Workers apps to iOS and Android.",
|
|
6
6
|
"repository": {
|
|
@@ -23,8 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public",
|
|
26
|
-
"tag": "beta"
|
|
27
|
-
"registry": "https://registry.npmjs.org"
|
|
26
|
+
"tag": "beta"
|
|
28
27
|
},
|
|
29
28
|
"type": "module",
|
|
30
29
|
"files": [
|
|
@@ -151,6 +150,5 @@
|
|
|
151
150
|
"android": {
|
|
152
151
|
"src": "native/android"
|
|
153
152
|
}
|
|
154
|
-
}
|
|
155
|
-
"gitHead": "2f5e4e6956f41b2904f8a6b9c81cccf35c908b9a"
|
|
153
|
+
}
|
|
156
154
|
}
|