Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
public async parse(argv: string[], minimalOutput = false): Promise {
const datamodelPath = await getSchemaPath()
if (!datamodelPath) {
throw new Error(`Can't find schema.prisma`) // TODO: Add this into a central place in getSchemaPath() as an arg
}
const generators = await getGenerators({
schemaPath: datamodelPath,
providerAliases: this.aliases,
printDownloadProgress: true,
version: pkg.prisma.version,
})
if (generators.length === 0) {
console.log(missingGeneratorMessage)
}
// CONTINUE HERE
for (const generator of generators) {
const toStr = generator.options!.generator.output! ? chalk.dim(` to ${generator.options!.generator.output}`) : ''
const name = generator.manifest ? generator.manifest.prettyName : generator.options!.generator.provider
console.log(`Generating ${chalk.bold(name!)}${toStr}`)
public async watch(options: WatchOptions = { preview: false, clear: true, providerAliases: {} }): Promise {
if (!options.clear) {
options.clear = true
}
const datamodel = await this.getDatamodel()
const generators = await getGenerators({
schemaPath: getDatamodelPath(this.projectDir),
printDownloadProgress: false,
version: packageJson.prisma.version,
cliVersion: packageJson.version,
})
this.studioPort = await getPort({ port: getPort.makeRange(5555, 5600) })
const datamodelPath = getDatamodelPath(this.projectDir)
const relativeDatamodelPath = path.relative(process.cwd(), datamodelPath)
// From here on, we render the dev ui
const renderer = new DevComponentRenderer({
port: this.studioPort,
initialState: {
studioPort: this.studioPort,