MCPcopy Create free account
hub / github.com/agent-tower/core / findMonorepoRoot

Function findMonorepoRoot

packages/server/scripts/postinstall.js:18–32  ·  view source on GitHub ↗

* 向上查找 monorepo 根目录(包含 pnpm-workspace.yaml 或根 node_modules)

(startDir)

Source from the content-addressed store, hash-verified

16function generatePrismaClient() {
17 const packageRequire = createRequire(join(packageRoot, 'package.json'));
18 const prismaCliPath = packageRequire.resolve('prisma/build/index.js');
19 const schemaPath = join(packageRoot, 'prisma', 'schema.prisma');
20
21 console.log(`[postinstall] 在包目录中生成 Prisma Client: ${packageRoot}`);
22 execFileSync(
23 process.execPath,
24 [prismaCliPath, 'generate', '--schema', schemaPath],
25 {
26 cwd: packageRoot,
27 env: {
28 ...process.env,
29 INIT_CWD: packageRoot,
30 PWD: packageRoot,
31 },
32 stdio: 'inherit',
33 },
34 );
35}

Callers 1

collectSearchDirsFunction · 0.85

Calls 1

dirnameFunction · 0.50

Tested by

no test coverage detected