@vesk/adapter 0.1.1 → 0.1.14
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/platform-deploy.js
CHANGED
|
@@ -265,7 +265,8 @@ function shellFor(platform) {
|
|
|
265
265
|
staticServe: 'disk-deno',
|
|
266
266
|
bootstrap: [
|
|
267
267
|
'if (typeof Deno !== "undefined" && typeof Deno.serve === "function") {',
|
|
268
|
-
' Deno.
|
|
268
|
+
' const __veskPort = Number(Deno.env.get("PORT") || 8000);',
|
|
269
|
+
' Deno.serve({ port: __veskPort }, async (request) => {',
|
|
269
270
|
' const staticResponse = await serveEmbeddedStatic(request);',
|
|
270
271
|
' if (staticResponse) return staticResponse;',
|
|
271
272
|
' return handleRequest(request);',
|
|
@@ -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;CACxB;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;AAQD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CA4HjF;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,
|
|
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;CACxB;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;AAQD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,oBAAoB,GAAG,MAAM,CA4HjF;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,CAiFzF;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;CACxB"}
|
package/dist/platform-handler.js
CHANGED
|
@@ -154,12 +154,28 @@ export async function bundlePlatformHandler(options) {
|
|
|
154
154
|
plugins.push({
|
|
155
155
|
name: 'empty-node-builtins',
|
|
156
156
|
setup(build) {
|
|
157
|
-
const builtins = /^(
|
|
158
|
-
build.onResolve({ filter: builtins }, () => {
|
|
159
|
-
return { path:
|
|
157
|
+
const builtins = /^(node:)?(fs|path|child_process|os|crypto|net|stream|buffer|events|util|url|querystring|http|https|zlib|tty|async_hooks)$/;
|
|
158
|
+
build.onResolve({ filter: builtins }, (args) => {
|
|
159
|
+
return { path: args.path, namespace: 'empty-node' };
|
|
160
160
|
});
|
|
161
|
-
build.onLoad({ filter: /.*/, namespace: 'empty-node' }, () =>
|
|
162
|
-
|
|
161
|
+
build.onLoad({ filter: /.*/, namespace: 'empty-node' }, (args) => {
|
|
162
|
+
// async_hooks needs a usable AsyncLocalStorage shape (constructor +
|
|
163
|
+
// run/getStore), not a callable-Proxy stub — the runtime's
|
|
164
|
+
// per-request SSR data isolation instantiates it.
|
|
165
|
+
if (/async_hooks$/.test(args.path)) {
|
|
166
|
+
return {
|
|
167
|
+
contents: `
|
|
168
|
+
export class AsyncLocalStorage {
|
|
169
|
+
run(_store, fn) { return fn(); }
|
|
170
|
+
getStore() { return null; }
|
|
171
|
+
enterWith() {}
|
|
172
|
+
exit(fn) { return fn(); }
|
|
173
|
+
}
|
|
174
|
+
`,
|
|
175
|
+
loader: 'js',
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
const contents = `
|
|
163
179
|
const __m = typeof Proxy !== 'undefined' ? new Proxy({}, {
|
|
164
180
|
get(_, key) { return typeof key === 'string' ? () => {} : undefined; },
|
|
165
181
|
has() { return true; },
|
|
@@ -187,9 +203,12 @@ export const spawnSync = () => ({ status: 0 });
|
|
|
187
203
|
export const execSync = () => '';
|
|
188
204
|
export const randomBytes = () => ({});
|
|
189
205
|
export const createHash = () => ({ update: () => {}, digest: () => '' });
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
206
|
+
`;
|
|
207
|
+
return {
|
|
208
|
+
contents,
|
|
209
|
+
loader: 'js',
|
|
210
|
+
};
|
|
211
|
+
});
|
|
193
212
|
},
|
|
194
213
|
});
|
|
195
214
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vesk/adapter",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
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,8 +23,8 @@
|
|
|
23
23
|
"sharp": "^0.35.3"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@vesk/compiler": "^0.1.
|
|
27
|
-
"@vesk/runtime": "^0.1.
|
|
26
|
+
"@vesk/compiler": "^0.1.14",
|
|
27
|
+
"@vesk/runtime": "^0.1.14"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"@types/ws": "^8.18.1",
|
package/dist/package.json
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@vesk/adapter",
|
|
3
|
-
"version": "0.1.9",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"main": "./index.js",
|
|
6
|
-
"types": "./index.d.ts",
|
|
7
|
-
"exports": {
|
|
8
|
-
".": {
|
|
9
|
-
"types": "./index.d.ts",
|
|
10
|
-
"default": "./index.js"
|
|
11
|
-
},
|
|
12
|
-
"./src/*": "./*.js",
|
|
13
|
-
"./package.json": "./package.json"
|
|
14
|
-
}
|
|
15
|
-
}
|