MCPcopy
hub / github.com/prisma/prisma / getGenerationDirs

Function getGenerationDirs

packages/client-generator-ts/src/generateClient.ts:340–352  ·  view source on GitHub ↗

* Get all the directories involved in the generation process.

({ runtimeBase, outputDir }: GenerateClientOptions)

Source from the content-addressed store, hash-verified

338 * Get all the directories involved in the generation process.
339 */
340async function getGenerationDirs({ runtimeBase, outputDir }: GenerateClientOptions) {
341 const normalizedOutputDir = path.normalize(outputDir)
342 const normalizedRuntimeBase = pathToPosix(runtimeBase)
343
344 const userPackageRoot = await packageUp({ cwd: path.dirname(normalizedOutputDir) })
345 const userProjectRoot = userPackageRoot ? path.dirname(userPackageRoot) : process.cwd()
346
347 return {
348 runtimeBase: normalizedRuntimeBase,
349 outputDir: normalizedOutputDir,
350 projectRoot: userProjectRoot,
351 }
352}
353
354function getRuntimeNameForTarget(target: RuntimeTargetInternal): RuntimeName {
355 switch (target) {

Callers 1

generateClientFunction · 0.70

Calls 1

pathToPosixFunction · 0.90

Tested by

no test coverage detected