MCPcopy Create free account
hub / github.com/ProNextJS/declarative-routing / addPackages

Function addPackages

src/shared/utils.ts:56–72  ·  view source on GitHub ↗
(packages: string[], dev = false)

Source from the content-addressed store, hash-verified

54}
55
56export async function addPackages(packages: string[], dev = false) {
57 if (!packages?.length) {
58 return;
59 }
60
61 const pkgMgr = await getPackageManager();
62
63 if (dev) {
64 await execa(pkgMgr, [
65 pkgMgr === "npm" ? "install" : "add",
66 "-D",
67 ...packages
68 ]);
69 } else {
70 await execa(pkgMgr, [pkgMgr === "npm" ? "install" : "add", ...packages]);
71 }
72}
73
74export function getDiffContent(input: string, output: string): string | null {
75 let changes: string[] = [];

Callers 3

setupFunction · 0.90
setupFunction · 0.90
setupFunction · 0.90

Calls 1

getPackageManagerFunction · 0.85

Tested by

no test coverage detected