@vercel/introspection 0.0.9 → 0.0.11

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
- export { };
1
+ import "@vercel/backends/introspection/loaders/esm";
@@ -1,27 +1,3 @@
1
- import { createRequire, register } from "node:module";
1
+ import "@vercel/backends/introspection/loaders/esm";
2
2
 
3
- //#region rolldown:runtime
4
- var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
-
6
- //#endregion
7
- //#region src/loaders/block-network.ts
8
- for (const mod of [
9
- "net",
10
- "dns",
11
- "http",
12
- "https",
13
- "tls",
14
- "dgram"
15
- ]) try {
16
- const m = __require(mod);
17
- for (const key of Object.keys(m)) m[key] = new Proxy(m[key], { apply() {
18
- throw new Error("Networking is disabled");
19
- } });
20
- } catch {}
21
-
22
- //#endregion
23
- //#region src/loaders/esm.ts
24
- register(new URL("./hooks.mjs", import.meta.url), import.meta.url);
25
-
26
- //#endregion
27
3
  export { };
@@ -1,5 +1 @@
1
- //#region src/loaders/hooks.d.ts
2
- declare function resolve(specifier: string, context: any, nextResolve: any): Promise<any>;
3
- declare function load(url: string, context: any, nextLoad: (url: string, context: any) => Promise<any>): Promise<any>;
4
- //#endregion
5
- export { load, resolve };
1
+ export * from "@vercel/backends/introspection/loaders/hooks";
@@ -1,50 +1,3 @@
1
- //#region src/loaders/hooks.ts
2
- let honoUrl = null;
3
- let expressUrl = null;
4
- async function resolve(specifier, context, nextResolve) {
5
- const result = await nextResolve(specifier, context);
6
- if (specifier === "hono") honoUrl = result.url;
7
- else if (specifier === "express") expressUrl = result.url;
8
- return result;
9
- }
10
- async function load(url, context, nextLoad) {
11
- const result = await nextLoad(url, context);
12
- if (expressUrl === url) {
13
- const pathToExpressExtract = new URL("../express.mjs", import.meta.url);
14
- return {
15
- format: "module",
16
- source: `
17
- import { handle} from ${JSON.stringify(pathToExpressExtract.toString())};
18
- import originalExpress from ${JSON.stringify(url + "?original")};
1
+ export * from "@vercel/backends/introspection/loaders/hooks"
19
2
 
20
- const extendedExpress = handle(originalExpress);
21
-
22
- export * from ${JSON.stringify(url + "?original")};
23
- export default extendedExpress;
24
- `,
25
- shortCircuit: true
26
- };
27
- }
28
- if (honoUrl === url) {
29
- const pathToHonoExtract = new URL("../hono.mjs", import.meta.url);
30
- return {
31
- format: "module",
32
- source: `
33
- import { handle } from ${JSON.stringify(pathToHonoExtract.toString())};
34
- import * as originalHono from ${JSON.stringify(url + "?original")};
35
-
36
- export * from ${JSON.stringify(url + "?original")};
37
- export const Hono = handle(originalHono);
38
- `,
39
- shortCircuit: true
40
- };
41
- }
42
- if (url.endsWith("?original")) {
43
- const originalUrl = url.replace("?original", "");
44
- if (originalUrl === honoUrl || originalUrl === expressUrl) return result;
45
- }
46
- return result;
47
- }
48
-
49
- //#endregion
50
- export { load, resolve };
3
+ export { };
@@ -0,0 +1 @@
1
+ import "@vercel/backends/introspection/loaders/rolldown-esm";
@@ -0,0 +1,3 @@
1
+ import "@vercel/backends/introspection/loaders/rolldown-esm";
2
+
3
+ export { };
@@ -0,0 +1 @@
1
+ export * from "@vercel/backends/introspection/loaders/rolldown-hooks";
@@ -0,0 +1,3 @@
1
+ export * from "@vercel/backends/introspection/loaders/rolldown-hooks"
2
+
3
+ export { };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/introspection",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://vercel.com/docs",
6
6
  "type": "module",
@@ -14,7 +14,9 @@
14
14
  },
15
15
  "./loaders/cjs": "./dist/loaders/cjs.js",
16
16
  "./loaders/esm": "./dist/loaders/esm.js",
17
- "./loaders/hooks": "./dist/loaders/hooks.js"
17
+ "./loaders/hooks": "./dist/loaders/hooks.js",
18
+ "./loaders/rolldown-esm": "./dist/loaders/rolldown-esm.js",
19
+ "./loaders/rolldown-hooks": "./dist/loaders/rolldown-hooks.js"
18
20
  },
19
21
  "repository": {
20
22
  "type": "git",
@@ -25,25 +27,12 @@
25
27
  "dist"
26
28
  ],
27
29
  "dependencies": {
28
- "path-to-regexp": "8.3.0",
29
- "zod": "3.22.4"
30
+ "@vercel/backends": "0.0.25"
30
31
  },
31
32
  "devDependencies": {
32
- "@types/express": "5.0.3",
33
- "@types/fs-extra": "11",
34
- "@types/jest": "27.5.1",
35
- "@vercel/nft": "1.1.1",
36
- "@types/node": "22",
37
- "fs-extra": "11.1.0",
38
- "execa": "3.2.0",
39
- "hono": "4.10.1",
40
- "jest-junit": "16.0.0",
33
+ "@types/node": "20.11.0",
41
34
  "tsdown": "0.16.3",
42
- "vite": "^5.1.6",
43
- "vitest": "^2.0.1",
44
- "@vercel/static-config": "3.1.2",
45
- "@vercel/cervel": "0.0.9",
46
- "@vercel/build-utils": "13.2.8"
35
+ "vitest": "^2.0.1"
47
36
  },
48
37
  "scripts": {
49
38
  "build": "tsdown",
@@ -1,4 +0,0 @@
1
- //#region src/express.d.ts
2
- declare const handle: (expressModule: any) => any;
3
- //#endregion
4
- export { handle };