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

Function devCommand

packages/cli-v3/src/commands/dev.tsx:96–128  ·  view source on GitHub ↗
(dir: string, options: DevCommandOptions)

Source from the content-addressed store, hash-verified

94const MINIMUM_NODE_MINOR = 16;
95
96export async function devCommand(dir: string, options: DevCommandOptions) {
97 try {
98 runtimeCheck(MINIMUM_NODE_MAJOR, MINIMUM_NODE_MINOR);
99 } catch (e) {
100 logger.log(`${chalkError("X Error:")} ${e}`);
101 process.exitCode = 1;
102 return;
103 }
104
105 const authorization = await isLoggedIn(options.profile);
106
107 if (!authorization.ok) {
108 if (authorization.error === "fetch failed") {
109 logger.log(
110 `${chalkError(
111 "X Error:"
112 )} Connecting to the server failed. Please check your internet connection or contact eric@trigger.dev for help.`
113 );
114 } else {
115 logger.log(
116 `${chalkError("X Error:")} You must login first. Use the \`login\` CLI command.\n\n${
117 authorization.error
118 }`
119 );
120 }
121 process.exitCode = 1;
122 return;
123 }
124
125 const devInstance = await startDev(dir, options, authorization.auth, authorization.dashboardUrl);
126 const { waitUntilExit } = devInstance.devReactElement;
127 await waitUntilExit();
128}
129
130async function startDev(
131 dir: string,

Callers 1

configureDevCommandFunction · 0.70

Calls 5

runtimeCheckFunction · 0.90
chalkErrorFunction · 0.90
isLoggedInFunction · 0.85
startDevFunction · 0.85
logMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…