@vercel/hono 0.0.5 → 0.0.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.js +11 -14
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -31,21 +31,13 @@ module.exports = __toCommonJS(src_exports);
|
|
|
31
31
|
|
|
32
32
|
// src/build.ts
|
|
33
33
|
var import_node = require("@vercel/node");
|
|
34
|
-
var build = async ({
|
|
35
|
-
files
|
|
36
|
-
workPath,
|
|
37
|
-
config,
|
|
38
|
-
meta = {}
|
|
39
|
-
}) => {
|
|
40
|
-
const entrypoint = findEntrypoint(files);
|
|
34
|
+
var build = async (args) => {
|
|
35
|
+
const entrypoint = findEntrypoint(args.files);
|
|
41
36
|
return (0, import_node.build)({
|
|
37
|
+
...args,
|
|
42
38
|
entrypoint,
|
|
43
|
-
files,
|
|
44
|
-
shim,
|
|
45
|
-
workPath,
|
|
46
39
|
useWebApi: true,
|
|
47
|
-
|
|
48
|
-
meta
|
|
40
|
+
shim
|
|
49
41
|
});
|
|
50
42
|
};
|
|
51
43
|
var shim = (handler, relativePathToHandler = ".") => `
|
|
@@ -66,6 +58,8 @@ export const OPTIONS = handle;
|
|
|
66
58
|
export const HEAD = handle;`;
|
|
67
59
|
var findEntrypoint = (files) => {
|
|
68
60
|
const validEntrypoints = [
|
|
61
|
+
"server.ts",
|
|
62
|
+
"server.js",
|
|
69
63
|
"index.ts",
|
|
70
64
|
"index.js",
|
|
71
65
|
"index.mjs",
|
|
@@ -99,8 +93,11 @@ var startDevServer = async (opts) => {
|
|
|
99
93
|
const entrypointExtension = entrypoint.split(".").pop();
|
|
100
94
|
const shimString = shim(entrypoint, "../..");
|
|
101
95
|
const shimEntrypoint = `.vercel/dev/shim.${entrypointExtension}`;
|
|
102
|
-
|
|
103
|
-
|
|
96
|
+
const shimEntrypointPath = (0, import_path.join)(opts.workPath, shimEntrypoint);
|
|
97
|
+
const shimEntrypointDir = (0, import_path.dirname)(shimEntrypointPath);
|
|
98
|
+
await (0, import_promises.rm)(shimEntrypointDir, { force: true, recursive: true });
|
|
99
|
+
await (0, import_promises.mkdir)(shimEntrypointDir, { recursive: true });
|
|
100
|
+
await (0, import_promises.writeFile)(shimEntrypointPath, shimString);
|
|
104
101
|
return (0, import_node2.startDevServer)({
|
|
105
102
|
...opts,
|
|
106
103
|
entrypoint: shimEntrypoint
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/hono",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.6",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"homepage": "https://vercel.com/docs",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
],
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@vercel/static-config": "3.1.1",
|
|
18
|
-
"@vercel/node": "5.3.
|
|
18
|
+
"@vercel/node": "5.3.8",
|
|
19
19
|
"ts-morph": "12.0.0"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|