@vercel/cervel 0.0.7 → 0.0.9
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/cli.mjs +16 -2
- package/dist/index.mjs +16 -2
- package/package.json +3 -3
package/dist/cli.mjs
CHANGED
|
@@ -47,6 +47,7 @@ const rolldown = async (args) => {
|
|
|
47
47
|
};
|
|
48
48
|
const extensionInfo = extensionMap[extension] || extensionMap[".js"];
|
|
49
49
|
let resolvedFormat = extensionInfo.format === "auto" ? void 0 : extensionInfo.format;
|
|
50
|
+
const resolvedExtension = extensionInfo.extension;
|
|
50
51
|
const packageJsonPath = join(args.workPath, "package.json");
|
|
51
52
|
const external = [];
|
|
52
53
|
let pkg = {};
|
|
@@ -76,6 +77,7 @@ const rolldown = async (args) => {
|
|
|
76
77
|
cleanDir: true,
|
|
77
78
|
dir: outputDir,
|
|
78
79
|
format: resolvedFormat,
|
|
80
|
+
entryFileNames: `[name].${resolvedExtension}`,
|
|
79
81
|
preserveModules: true,
|
|
80
82
|
sourcemap: false
|
|
81
83
|
}
|
|
@@ -228,7 +230,8 @@ const frameworks = [
|
|
|
228
230
|
const entrypointFilenames = [
|
|
229
231
|
"app",
|
|
230
232
|
"index",
|
|
231
|
-
"server"
|
|
233
|
+
"server",
|
|
234
|
+
"main"
|
|
232
235
|
];
|
|
233
236
|
const entrypointExtensions = [
|
|
234
237
|
"js",
|
|
@@ -249,7 +252,18 @@ const findEntrypoint = async (cwd, options) => {
|
|
|
249
252
|
const packageJson = await readFile(join(cwd, "package.json"), "utf-8");
|
|
250
253
|
const packageJsonObject = JSON.parse(packageJson);
|
|
251
254
|
const framework = frameworks.find((framework$1) => packageJsonObject.dependencies?.[framework$1]);
|
|
252
|
-
if (!framework)
|
|
255
|
+
if (!framework) {
|
|
256
|
+
for (const entrypoint of entrypoints) {
|
|
257
|
+
const entrypointPath = join(cwd, entrypoint);
|
|
258
|
+
try {
|
|
259
|
+
await readFile(entrypointPath, "utf-8");
|
|
260
|
+
return entrypoint;
|
|
261
|
+
} catch (e) {
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
throw new Error("No entrypoint or framework found");
|
|
266
|
+
}
|
|
253
267
|
const regex = createFrameworkRegex(framework);
|
|
254
268
|
for (const entrypoint of entrypoints) {
|
|
255
269
|
const entrypointPath = join(cwd, entrypoint);
|
package/dist/index.mjs
CHANGED
|
@@ -46,6 +46,7 @@ const rolldown = async (args) => {
|
|
|
46
46
|
};
|
|
47
47
|
const extensionInfo = extensionMap[extension] || extensionMap[".js"];
|
|
48
48
|
let resolvedFormat = extensionInfo.format === "auto" ? void 0 : extensionInfo.format;
|
|
49
|
+
const resolvedExtension = extensionInfo.extension;
|
|
49
50
|
const packageJsonPath = join(args.workPath, "package.json");
|
|
50
51
|
const external = [];
|
|
51
52
|
let pkg = {};
|
|
@@ -75,6 +76,7 @@ const rolldown = async (args) => {
|
|
|
75
76
|
cleanDir: true,
|
|
76
77
|
dir: outputDir,
|
|
77
78
|
format: resolvedFormat,
|
|
79
|
+
entryFileNames: `[name].${resolvedExtension}`,
|
|
78
80
|
preserveModules: true,
|
|
79
81
|
sourcemap: false
|
|
80
82
|
}
|
|
@@ -227,7 +229,8 @@ const frameworks = [
|
|
|
227
229
|
const entrypointFilenames = [
|
|
228
230
|
"app",
|
|
229
231
|
"index",
|
|
230
|
-
"server"
|
|
232
|
+
"server",
|
|
233
|
+
"main"
|
|
231
234
|
];
|
|
232
235
|
const entrypointExtensions = [
|
|
233
236
|
"js",
|
|
@@ -248,7 +251,18 @@ const findEntrypoint = async (cwd, options) => {
|
|
|
248
251
|
const packageJson = await readFile(join(cwd, "package.json"), "utf-8");
|
|
249
252
|
const packageJsonObject = JSON.parse(packageJson);
|
|
250
253
|
const framework = frameworks.find((framework$1) => packageJsonObject.dependencies?.[framework$1]);
|
|
251
|
-
if (!framework)
|
|
254
|
+
if (!framework) {
|
|
255
|
+
for (const entrypoint of entrypoints) {
|
|
256
|
+
const entrypointPath = join(cwd, entrypoint);
|
|
257
|
+
try {
|
|
258
|
+
await readFile(entrypointPath, "utf-8");
|
|
259
|
+
return entrypoint;
|
|
260
|
+
} catch (e) {
|
|
261
|
+
continue;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
throw new Error("No entrypoint or framework found");
|
|
265
|
+
}
|
|
252
266
|
const regex = createFrameworkRegex(framework);
|
|
253
267
|
for (const entrypoint of entrypoints) {
|
|
254
268
|
const entrypointPath = join(cwd, entrypoint);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/cervel",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"homepage": "https://vercel.com/docs",
|
|
6
6
|
"publishConfig": {
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"execa": "3.2.0",
|
|
32
|
-
"rolldown": "1.0.0-beta.
|
|
32
|
+
"rolldown": "1.0.0-beta.59",
|
|
33
33
|
"srvx": "0.8.9",
|
|
34
|
-
"tsx": "4.
|
|
34
|
+
"tsx": "4.21.0"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"typescript": "^4.0.0 || ^5.0.0"
|