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

Function addDependencies

packages/cli/src/utils/addDependencies.ts:20–38  ·  view source on GitHub ↗
(projectDir: string, packages: Array<InstallPackage>)

Source from the content-addressed store, hash-verified

18};
19
20export async function addDependencies(projectDir: string, packages: Array<InstallPackage>) {
21 const pkgManager = await getUserPackageManager(projectDir);
22
23 const spinner = ora("Adding @trigger.dev dependencies to package.json...").start();
24
25 const installedPackages = await addDependenciesToPackageJson(projectDir, packages);
26
27 spinner.succeed(
28 chalk.green(
29 `Successfully added dependencies to package.json: ${installedPackages
30 .map((pkg) => `${pkg.name}@${pkg.version}`)
31 .join(", ")}`
32 )
33 );
34
35 const installSpinner = await runInstallCommand(pkgManager, projectDir);
36
37 (installSpinner || ora()).stop();
38}
39
40async function addDependenciesToPackageJson(
41 projectDir: string,

Callers 1

initCommandFunction · 0.90

Calls 5

getUserPackageManagerFunction · 0.90
runInstallCommandFunction · 0.70
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…