@vesk/adapter 0.2.36 → 0.2.38
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client-bundle.d.ts","sourceRoot":"","sources":["../src/client-bundle.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,mBAAmB,EAAE,kBAAkB,EAAmF,MAAM,yBAAyB,CAAC;AAoCnL;;;;;;;;;;;;;GAaG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CA8BhE;AAED;;;;;GAKG;AACH,UAAU,YAAY;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;IAC7B,EAAE,CAAC,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACvB,YAAY,CAAC,EAAE,KAAK,CAAC;QAAE,EAAE,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAAC,IAAI,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,MAAM,CAAC,EAAE;gBAAE,IAAI,CAAC,EAAE,MAAM,CAAC;gBAAC,IAAI,CAAC,EAAE,MAAM,CAAA;aAAE,CAAA;SAAE,CAAA;KAAE,CAAC,CAAC;IACtH,WAAW,CAAC,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,MAAM,CAAC,EAAE;YAAE,IAAI,CAAC,EAAE,MAAM,CAAC;YAAC,IAAI,CAAC,EAAE,MAAM,CAAA;SAAE,CAAC;QAC1C,YAAY,CAAC,EAAE,KAAK,CAAC;YAAE,IAAI,CAAC,EAAE;gBAAE,IAAI,CAAC,EAAE,MAAM,CAAC;gBAAC,M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AY,GAAG,OAAO,CAKzD;AAkCD;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAyBlD;AA4MD;;;;;;;;GAQG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAmC5D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYxD;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,KAAK,OAAO,GAAG,MAAM,CAwBnG;AAED,wBAAsB,oBAAoB,CACxC,SAAS,EAAE,SAAS,EAAE,EACtB,MAAM,EAAE,MAAM,EACd,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAClC,OAAO,CAAC,EAAE,mBAAmB,GAC5B,OAAO,CAAC,kBAAkB,CAAC,CAma7B;AAMD,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CA+B3D;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,UAAU,EAAE,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,CAUlE;AAoCD;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAI/F"}
|
package/dist/client-bundle.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { readFileSync, existsSync, writeFileSync, unlinkSync, statSync, rmSync, mkdtempSync } from 'node:fs';
|
|
1
|
+
import { readFileSync, existsSync, writeFileSync, unlinkSync, statSync, rmSync, mkdtempSync, mkdirSync } from 'node:fs';
|
|
2
2
|
import { resolve, join, dirname, relative, sep } from 'node:path';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
|
+
import { tmpdir } from 'node:os';
|
|
4
5
|
import { build } from './esbuild-fallback.js';
|
|
5
6
|
import { stripCodeTypes } from '@vesk/compiler/src/strip-ts';
|
|
6
7
|
import { parse } from '@vesk/compiler/src/parser';
|
|
@@ -1035,6 +1036,27 @@ let runtimeEntryId = 0;
|
|
|
1035
1036
|
* every time).
|
|
1036
1037
|
*/
|
|
1037
1038
|
const RUNTIME_ENTRY = '.runtime-tree-entry.mjs';
|
|
1039
|
+
/**
|
|
1040
|
+
* esbuild resolves entry points and absolute import specifiers with forward
|
|
1041
|
+
* slashes; a native Windows path (`C:\...`) is not resolvable.
|
|
1042
|
+
*/
|
|
1043
|
+
function esbuildPath(p) {
|
|
1044
|
+
return sep === '/' ? p : p.split(sep).join('/');
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* The tree-shake entry is written outside the project tree on purpose. It used
|
|
1048
|
+
* to be written into `node_modules/@vesk/runtime/dist`, which (a) tripped the
|
|
1049
|
+
* dev watcher on every build — an endless rebuild loop on Windows, where
|
|
1050
|
+
* `fs.watch` reports backslash paths that slipped past the `node_modules/`
|
|
1051
|
+
* skip check — and (b) raced concurrent builds, so one build could delete the
|
|
1052
|
+
* entry while another was still resolving it (`Could not resolve …`). The
|
|
1053
|
+
* entry now lives in a temp dir and imports the runtime by absolute path.
|
|
1054
|
+
*/
|
|
1055
|
+
function runtimeTreeShakeEntry() {
|
|
1056
|
+
return join(tmpdir(), 'vesk-runtime-tree-shake', RUNTIME_ENTRY);
|
|
1057
|
+
}
|
|
1058
|
+
/** Serializes tree-shake builds so concurrent callers never share the entry file. */
|
|
1059
|
+
let treeShakeQueue = Promise.resolve();
|
|
1038
1060
|
/**
|
|
1039
1061
|
* Builds a single self-contained runtime module for the given used names.
|
|
1040
1062
|
*
|
|
@@ -1044,7 +1066,12 @@ const RUNTIME_ENTRY = '.runtime-tree-entry.mjs';
|
|
|
1044
1066
|
* const bindings. This replaces the old regex-based file concatenation, which
|
|
1045
1067
|
* leaked runtime module-scope names into the page scope.
|
|
1046
1068
|
*/
|
|
1047
|
-
export
|
|
1069
|
+
export function buildTreeShakenRuntime(runtimeDir, usedNames) {
|
|
1070
|
+
const run = treeShakeQueue.then(() => buildTreeShakenRuntimeNow(runtimeDir, usedNames));
|
|
1071
|
+
treeShakeQueue = run.catch(() => undefined);
|
|
1072
|
+
return run;
|
|
1073
|
+
}
|
|
1074
|
+
async function buildTreeShakenRuntimeNow(runtimeDir, usedNames) {
|
|
1048
1075
|
const unique = [...new Set(usedNames)];
|
|
1049
1076
|
const available = runtimeExportNames(runtimeDir);
|
|
1050
1077
|
const missing = unique.filter((n) => !available.has(n));
|
|
@@ -1052,15 +1079,20 @@ export async function buildTreeShakenRuntime(runtimeDir, usedNames) {
|
|
|
1052
1079
|
console.error(`vesk: runtime names not exported — ${missing.join(', ')}; falling back to full runtime`);
|
|
1053
1080
|
return buildRuntimeCode(runtimeDir);
|
|
1054
1081
|
}
|
|
1055
|
-
const entry =
|
|
1082
|
+
const entry = runtimeTreeShakeEntry();
|
|
1083
|
+
const indexClient = esbuildPath(join(runtimeDir, 'index-client.js'));
|
|
1056
1084
|
try {
|
|
1085
|
+
try {
|
|
1086
|
+
mkdirSync(dirname(entry), { recursive: true });
|
|
1087
|
+
}
|
|
1088
|
+
catch { /* exists */ }
|
|
1057
1089
|
try {
|
|
1058
1090
|
rmSync(entry);
|
|
1059
1091
|
}
|
|
1060
1092
|
catch { /* not present yet */ }
|
|
1061
|
-
writeFileSync(entry, `export { ${unique.join(', ')} } from
|
|
1093
|
+
writeFileSync(entry, `export { ${unique.join(', ')} } from ${JSON.stringify(indexClient)};\n`);
|
|
1062
1094
|
const result = await build({
|
|
1063
|
-
entryPoints: [entry],
|
|
1095
|
+
entryPoints: [esbuildPath(entry)],
|
|
1064
1096
|
bundle: true,
|
|
1065
1097
|
format: 'iife',
|
|
1066
1098
|
globalName: '__veskRuntime',
|
|
@@ -1135,6 +1167,12 @@ async function buildMainBundle(routeTree, runtimeDir, codeSplit, mono, hmr, impo
|
|
|
1135
1167
|
'\t\tconst p = nodes[0].parentNode;\n' +
|
|
1136
1168
|
'\t\tp.insertBefore(start, nodes[0]);\n' +
|
|
1137
1169
|
'\t\tp.insertBefore(end, nodes[nodes.length - 1].nextSibling);\n' +
|
|
1170
|
+
'\t\t// Client-surplus nodes (SSR rendered fewer items than the client data)\n' +
|
|
1171
|
+
'\t\t// are freshly claimed and still detached — move them into the region in\n' +
|
|
1172
|
+
'\t\t// client order before `end`, instead of stranding them off-parent.\n' +
|
|
1173
|
+
'\t\tfor (let i = 0; i < nodes.length; i++) {\n' +
|
|
1174
|
+
'\t\t\tif (nodes[i].parentNode === null) p.insertBefore(nodes[i], end);\n' +
|
|
1175
|
+
'\t\t}\n' +
|
|
1138
1176
|
'\t\treturn;\n' +
|
|
1139
1177
|
'\t}\n' +
|
|
1140
1178
|
'\tfallback.appendChild(start);\n' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform-handler.d.ts","sourceRoot":"","sources":["../src/platform-handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAIvE,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAMpD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtC;AAgBD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"platform-handler.d.ts","sourceRoot":"","sources":["../src/platform-handler.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAIvE,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,iFAAiF;IACjF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,SAAS,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,CAMpD;AAED,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAGrD;AAED,wBAAgB,IAAI,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAEtC;AAgBD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CAwLjF;AAED,MAAM,WAAW,qBAAqB;IACpC,kEAAkE;IAClE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAsB,qBAAqB,CAAC,OAAO,EAAE,qBAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAsFzF;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,EAAE,CAAC;IACvB,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,gBAAgB,EAAE,MAAM,EAAE,CAAC;IAC3B,aAAa,EAAE,OAAO,CAAC;IACvB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
|
package/dist/platform-handler.js
CHANGED
|
@@ -82,6 +82,30 @@ ${prerenderedList}
|
|
|
82
82
|
${isrCache}
|
|
83
83
|
const __routes = [${routeEntries.join(',\n')}];
|
|
84
84
|
|
|
85
|
+
async function __invokeRoute(route, request) {
|
|
86
|
+
try {
|
|
87
|
+
return await route.handler(request);
|
|
88
|
+
} catch (e) {
|
|
89
|
+
if (e && typeof e === 'object' && e.name === 'Redirect') {
|
|
90
|
+
return new Response(null, {
|
|
91
|
+
status: Number(e.status) || 302,
|
|
92
|
+
headers: { Location: String(e.url || '/') },
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
if (e && typeof e === 'object' && e.name === 'NotFoundError') {
|
|
96
|
+
return new Response('<!DOCTYPE html><html><body><h1>404</h1><p>Not Found</p></body></html>', {
|
|
97
|
+
status: 404,
|
|
98
|
+
headers: { 'Content-Type': 'text/html' },
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
throw e;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function __escapeScript(json) {
|
|
106
|
+
return json.split('<').join('\\u003c').split('\\u2028').join('\\u2028').split('\\u2029').join('\\u2029');
|
|
107
|
+
}
|
|
108
|
+
|
|
85
109
|
function __matchPath(pattern, pathname) {
|
|
86
110
|
const patternParts = pattern.split('/').filter(Boolean);
|
|
87
111
|
const pathParts = pathname.split('/').filter(Boolean);
|
|
@@ -112,6 +136,24 @@ ${serverStoreLine}
|
|
|
112
136
|
return new Response(null, { status: 308, headers: { Location: '/_vesk/static/public' + (pathname.endsWith('/') ? pathname + 'index.html' : pathname + '.html') } });
|
|
113
137
|
}
|
|
114
138
|
|
|
139
|
+
// Serve the SSR-data handoff the page references (script tag /ssr-data.js?t=...).
|
|
140
|
+
// The render stashed the payload in the shared global store — mirror the node
|
|
141
|
+
// prod/dev servers so edge/serverless hydration never re-fetches resources that
|
|
142
|
+
// SSR already resolved. Entry is consumed on read (bound store).
|
|
143
|
+
if (pathname === '/ssr-data.js') {
|
|
144
|
+
const dataToken = url.searchParams.get('t') || '';
|
|
145
|
+
const dataStore = (globalThis.__vsk_ssr_data_store || {});
|
|
146
|
+
const payload = dataStore[dataToken];
|
|
147
|
+
if (payload) delete dataStore[dataToken];
|
|
148
|
+
const dataLines = [];
|
|
149
|
+
if (payload && payload.props) dataLines.push('globalThis.__vesk_props = ' + __escapeScript(JSON.stringify(payload.props)) + ';');
|
|
150
|
+
if (payload && payload.ssrData) dataLines.push('globalThis.__vsk_ssr_data = ' + __escapeScript(JSON.stringify(payload.ssrData)) + ';');
|
|
151
|
+
return new Response(dataLines.join('\\n') || '// no ssr data', {
|
|
152
|
+
status: 200,
|
|
153
|
+
headers: { 'Content-Type': 'application/javascript', 'Cache-Control': 'no-store' },
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
|
|
115
157
|
${eventsStartLine}
|
|
116
158
|
let mwCtx = { params: {}, url, locals: ${localsSeed}, cookies: {}, request, resolveUrl(u) { return new URL(u, request.url).href; }, set() {}, get() { return undefined; } };
|
|
117
159
|
if (${hasMwLiteral}) {
|
|
@@ -141,7 +183,7 @@ ${eventsRequestLine}
|
|
|
141
183
|
if (!params) continue;
|
|
142
184
|
|
|
143
185
|
if (route.type === 'api') {
|
|
144
|
-
return await route
|
|
186
|
+
return await __invokeRoute(route, request);
|
|
145
187
|
}
|
|
146
188
|
|
|
147
189
|
if (route.revalidate && route.revalidate > 0 && !isDataRequest) {
|
|
@@ -154,7 +196,7 @@ ${eventsRequestLine}
|
|
|
154
196
|
}
|
|
155
197
|
}
|
|
156
198
|
|
|
157
|
-
const response = await route
|
|
199
|
+
const response = await __invokeRoute(route, request);
|
|
158
200
|
|
|
159
201
|
if (route.revalidate && route.revalidate > 0 && !isDataRequest) {
|
|
160
202
|
const html = await response.clone().text();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prod-server.d.ts","sourceRoot":"","sources":["../src/prod-server.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2D,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AA8CjG,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAIzE;AA+FD,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"prod-server.d.ts","sourceRoot":"","sources":["../src/prod-server.ts"],"names":[],"mappings":"AAEA,OAAO,EAA2D,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AA8CjG,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,KAAK,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAIzE;AA+FD,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA8bxI"}
|
package/dist/prod-server.js
CHANGED
|
@@ -486,6 +486,12 @@ export async function startProdServer(outDir, options) {
|
|
|
486
486
|
}
|
|
487
487
|
catch (e) {
|
|
488
488
|
const err = e instanceof Error ? e : new Error(String(e));
|
|
489
|
+
if (err.name === 'Redirect') {
|
|
490
|
+
const redirect = err;
|
|
491
|
+
res.writeHead(Number(redirect.status) || 302, { Location: typeof redirect.url === 'string' ? redirect.url : '/' });
|
|
492
|
+
res.end();
|
|
493
|
+
return;
|
|
494
|
+
}
|
|
489
495
|
if (err.name === 'NotFoundError') {
|
|
490
496
|
res.writeHead(404, { 'Content-Type': 'text/html' });
|
|
491
497
|
res.end(notFoundHtml || '<!DOCTYPE html><html><body><h1>404</h1><p>Not Found</p></body></html>');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesk/adapter",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.38",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Vesk adapter — builds deployable .vesk/ output for Deno and Node serverless",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"sharp": "^0.35.3"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@vesk/compiler": "^0.2.
|
|
27
|
-
"@vesk/runtime": "^0.2.
|
|
28
|
-
"@vesk/types": "^0.2.
|
|
26
|
+
"@vesk/compiler": "^0.2.38",
|
|
27
|
+
"@vesk/runtime": "^0.2.38",
|
|
28
|
+
"@vesk/types": "^0.2.38"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@types/ws": "^8.18.1",
|