@vercel/cervel 0.0.4 → 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/cli.mjs +12 -4
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +12 -4
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -38,7 +38,7 @@ const Colors = {
|
|
|
38
38
|
//#endregion
|
|
39
39
|
//#region src/typescript.ts
|
|
40
40
|
const require_ = createRequire(import.meta.url);
|
|
41
|
-
const typescript =
|
|
41
|
+
const typescript = (args) => {
|
|
42
42
|
const extension = extname(args.entrypoint);
|
|
43
43
|
if (![
|
|
44
44
|
".ts",
|
|
@@ -48,7 +48,7 @@ const typescript = async (args) => {
|
|
|
48
48
|
const tscPath = resolveTscPath(args);
|
|
49
49
|
if (!tscPath) {
|
|
50
50
|
console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Typecheck skipped ${Colors.gray("(TypeScript not found)")}`));
|
|
51
|
-
return
|
|
51
|
+
return null;
|
|
52
52
|
}
|
|
53
53
|
return doTypeCheck(args, tscPath);
|
|
54
54
|
};
|
|
@@ -230,7 +230,14 @@ const rolldown = async (args) => {
|
|
|
230
230
|
|
|
231
231
|
//#endregion
|
|
232
232
|
//#region src/find-entrypoint.ts
|
|
233
|
-
const frameworks = [
|
|
233
|
+
const frameworks = [
|
|
234
|
+
"express",
|
|
235
|
+
"hono",
|
|
236
|
+
"elysia",
|
|
237
|
+
"fastify",
|
|
238
|
+
"@nestjs/core",
|
|
239
|
+
"h3"
|
|
240
|
+
];
|
|
234
241
|
const entrypointFilenames = [
|
|
235
242
|
"app",
|
|
236
243
|
"index",
|
|
@@ -298,7 +305,8 @@ const build$1 = async (args) => {
|
|
|
298
305
|
await writeFile(join(args.cwd, args.out, ".cervel.json"), JSON.stringify({ handler: rolldownResult.result.handler }, null, 2));
|
|
299
306
|
console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Build complete`));
|
|
300
307
|
const typecheckComplete = true;
|
|
301
|
-
|
|
308
|
+
const result = tsPromise ? await Promise.race([tsPromise.then(() => typecheckComplete), Promise.resolve(false)]) : true;
|
|
309
|
+
if (tsPromise && !result) console.log(Colors.gray(`${Colors.bold(Colors.gray("*"))} Waiting for typecheck...`));
|
|
302
310
|
return {
|
|
303
311
|
rolldownResult: rolldownResult.result,
|
|
304
312
|
tsPromise
|
package/dist/index.d.mts
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -37,7 +37,7 @@ const Colors = {
|
|
|
37
37
|
//#endregion
|
|
38
38
|
//#region src/typescript.ts
|
|
39
39
|
const require_ = createRequire(import.meta.url);
|
|
40
|
-
const typescript =
|
|
40
|
+
const typescript = (args) => {
|
|
41
41
|
const extension = extname(args.entrypoint);
|
|
42
42
|
if (![
|
|
43
43
|
".ts",
|
|
@@ -47,7 +47,7 @@ const typescript = async (args) => {
|
|
|
47
47
|
const tscPath = resolveTscPath(args);
|
|
48
48
|
if (!tscPath) {
|
|
49
49
|
console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Typecheck skipped ${Colors.gray("(TypeScript not found)")}`));
|
|
50
|
-
return
|
|
50
|
+
return null;
|
|
51
51
|
}
|
|
52
52
|
return doTypeCheck(args, tscPath);
|
|
53
53
|
};
|
|
@@ -229,7 +229,14 @@ const rolldown = async (args) => {
|
|
|
229
229
|
|
|
230
230
|
//#endregion
|
|
231
231
|
//#region src/find-entrypoint.ts
|
|
232
|
-
const frameworks = [
|
|
232
|
+
const frameworks = [
|
|
233
|
+
"express",
|
|
234
|
+
"hono",
|
|
235
|
+
"elysia",
|
|
236
|
+
"fastify",
|
|
237
|
+
"@nestjs/core",
|
|
238
|
+
"h3"
|
|
239
|
+
];
|
|
233
240
|
const entrypointFilenames = [
|
|
234
241
|
"app",
|
|
235
242
|
"index",
|
|
@@ -301,7 +308,8 @@ const build = async (args) => {
|
|
|
301
308
|
await writeFile(join(args.cwd, args.out, ".cervel.json"), JSON.stringify({ handler: rolldownResult.result.handler }, null, 2));
|
|
302
309
|
console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Build complete`));
|
|
303
310
|
const typecheckComplete = true;
|
|
304
|
-
|
|
311
|
+
const result = tsPromise ? await Promise.race([tsPromise.then(() => typecheckComplete), Promise.resolve(false)]) : true;
|
|
312
|
+
if (tsPromise && !result) console.log(Colors.gray(`${Colors.bold(Colors.gray("*"))} Waiting for typecheck...`));
|
|
305
313
|
return {
|
|
306
314
|
rolldownResult: rolldownResult.result,
|
|
307
315
|
tsPromise
|