MCPcopy
hub / github.com/triggerdotdev/trigger.dev / typecheckProject

Function typecheckProject

packages/cli-v3/src/commands/deploy.ts:1632–1681  ·  view source on GitHub ↗
(config: ResolvedConfig, options: DeployCommandOptions)

Source from the content-addressed store, hash-verified

1630}
1631
1632async function typecheckProject(config: ResolvedConfig, options: DeployCommandOptions) {
1633 return await tracer.startActiveSpan("typecheckProject", async (span) => {
1634 try {
1635 const typecheckSpinner = spinner();
1636 typecheckSpinner.start("Typechecking project");
1637
1638 const tscTypecheck = execa("npm", ["exec", "tsc", "--", "--noEmit"], {
1639 cwd: config.projectDir,
1640 });
1641
1642 const stdouts: string[] = [];
1643 const stderrs: string[] = [];
1644
1645 tscTypecheck.stdout?.on("data", (chunk) => stdouts.push(chunk.toString()));
1646 tscTypecheck.stderr?.on("data", (chunk) => stderrs.push(chunk.toString()));
1647
1648 try {
1649 await new Promise((resolve, reject) => {
1650 tscTypecheck.addListener("exit", (code) => (code === 0 ? resolve(code) : reject(code)));
1651 });
1652 } catch (error) {
1653 typecheckSpinner.stop(
1654 `Typechecking failed, check the logs below to view the issues. To skip typechecking, pass the --skip-typecheck flag`
1655 );
1656
1657 logger.log("");
1658
1659 for (const stdout of stdouts) {
1660 logger.log(stdout);
1661 }
1662
1663 span.recordException(new Error(stdouts.join("\n")));
1664 span.end();
1665
1666 return false;
1667 }
1668
1669 typecheckSpinner.stop(`Typechecking passed with 0 errors`);
1670
1671 span.end();
1672 return true;
1673 } catch (e) {
1674 recordSpanException(span, e);
1675
1676 span.end();
1677
1678 return false;
1679 }
1680 });
1681}
1682
1683// Returns the dependencies that are required by the output that are found in output and the CLI package dependencies
1684// Returns the dependency names and the version to use (taken from the CLI deps package.json)

Callers 1

compileProjectFunction · 0.85

Calls 8

spinnerFunction · 0.90
recordSpanExceptionFunction · 0.85
startActiveSpanMethod · 0.80
toStringMethod · 0.80
onMethod · 0.65
logMethod · 0.65
startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…