@vercel/cervel 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/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 = async (args) => {
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 Promise.resolve();
51
+ return null;
52
52
  }
53
53
  return doTypeCheck(args, tscPath);
54
54
  };
@@ -305,7 +305,8 @@ const build$1 = async (args) => {
305
305
  await writeFile(join(args.cwd, args.out, ".cervel.json"), JSON.stringify({ handler: rolldownResult.result.handler }, null, 2));
306
306
  console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Build complete`));
307
307
  const typecheckComplete = true;
308
- if (!await Promise.race([tsPromise.then(() => typecheckComplete), Promise.resolve(false)])) console.log(Colors.gray(`${Colors.bold(Colors.gray("*"))} Waiting for typecheck...`));
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...`));
309
310
  return {
310
311
  rolldownResult: rolldownResult.result,
311
312
  tsPromise
package/dist/index.d.mts CHANGED
@@ -19,7 +19,7 @@ declare const build: (args: {
19
19
  handler: never;
20
20
  outputDir: string;
21
21
  };
22
- tsPromise: Promise<void>;
22
+ tsPromise: Promise<void> | null | undefined;
23
23
  }>;
24
24
  declare const serve: (args: {
25
25
  cwd: string;
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 = async (args) => {
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 Promise.resolve();
50
+ return null;
51
51
  }
52
52
  return doTypeCheck(args, tscPath);
53
53
  };
@@ -308,7 +308,8 @@ const build = async (args) => {
308
308
  await writeFile(join(args.cwd, args.out, ".cervel.json"), JSON.stringify({ handler: rolldownResult.result.handler }, null, 2));
309
309
  console.log(Colors.gray(`${Colors.bold(Colors.cyan("✓"))} Build complete`));
310
310
  const typecheckComplete = true;
311
- if (!await Promise.race([tsPromise.then(() => typecheckComplete), Promise.resolve(false)])) console.log(Colors.gray(`${Colors.bold(Colors.gray("*"))} Waiting for typecheck...`));
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...`));
312
313
  return {
313
314
  rolldownResult: rolldownResult.result,
314
315
  tsPromise
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/cervel",
3
- "version": "0.0.5",
3
+ "version": "0.0.6",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://vercel.com/docs",
6
6
  "publishConfig": {