@vercel/hono 0.0.14 → 0.0.16
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 +17 -23
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -37,35 +37,29 @@ var build = async (args) => {
|
|
|
37
37
|
return (0, import_node.build)({
|
|
38
38
|
...args,
|
|
39
39
|
entrypoint,
|
|
40
|
-
considerBuildCommand: true
|
|
40
|
+
considerBuildCommand: true,
|
|
41
|
+
entrypointCallback: (preparedFiles) => {
|
|
42
|
+
return findEntrypoint(preparedFiles);
|
|
43
|
+
}
|
|
41
44
|
});
|
|
42
45
|
};
|
|
43
46
|
var findEntrypoint = (files) => {
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
[
|
|
51
|
-
["server.js"],
|
|
52
|
-
["server.mjs"],
|
|
53
|
-
["server.mts"],
|
|
54
|
-
["server.ts"],
|
|
55
|
-
["src", "index.cjs"],
|
|
56
|
-
["src", "index.js"],
|
|
57
|
-
["src", "index.mjs"],
|
|
58
|
-
["src", "index.mts"],
|
|
59
|
-
["src", "index.ts"]
|
|
60
|
-
];
|
|
61
|
-
const entrypoint = validEntrypoints.find((entrypointParts) => {
|
|
62
|
-
const path = entrypointParts.join(import_path.sep);
|
|
63
|
-
return files[path] !== void 0;
|
|
47
|
+
const validFilenames = [["app"], ["index"], ["server"], ["src", "index"]];
|
|
48
|
+
const validExtensions = ["js", "cjs", "mjs", "ts", "mts"];
|
|
49
|
+
const validEntrypoints = validFilenames.flatMap(
|
|
50
|
+
(filename) => validExtensions.map((extension) => `${filename.join(import_path.sep)}.${extension}`)
|
|
51
|
+
);
|
|
52
|
+
const entrypoint = validEntrypoints.find((entrypoint2) => {
|
|
53
|
+
return files[entrypoint2] !== void 0;
|
|
64
54
|
});
|
|
65
55
|
if (!entrypoint) {
|
|
66
|
-
|
|
56
|
+
const entrypointsForMessage = validFilenames.map((filename) => `- ${filename.join(import_path.sep)}.{${validExtensions.join(",")}}`).join("\n");
|
|
57
|
+
throw new Error(
|
|
58
|
+
`No valid entrypoint found. Valid entrypoints are:
|
|
59
|
+
${entrypointsForMessage}`
|
|
60
|
+
);
|
|
67
61
|
}
|
|
68
|
-
return entrypoint
|
|
62
|
+
return entrypoint;
|
|
69
63
|
};
|
|
70
64
|
|
|
71
65
|
// src/index.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/hono",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.16",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"homepage": "https://vercel.com/docs",
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
20
|
"@vercel/static-config": "3.1.1",
|
|
21
|
-
"@vercel/node": "5.3.
|
|
21
|
+
"@vercel/node": "5.3.15",
|
|
22
22
|
"ts-morph": "12.0.0"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/jest": "27.5.1",
|
|
26
26
|
"@types/node": "14.18.33",
|
|
27
|
-
"@vercel/build-utils": "11.0.
|
|
27
|
+
"@vercel/build-utils": "11.0.2",
|
|
28
28
|
"execa": "3.2.0",
|
|
29
29
|
"fs-extra": "11.1.0",
|
|
30
30
|
"jest-junit": "16.0.0",
|