From 4c27551987151aafc8823c65d1201362df3d4c2e Mon Sep 17 00:00:00 2001 From: Flavian DESVERNE Date: Mon, 11 Mar 2019 17:32:13 +0100 Subject: [PATCH] Fix build command --- packages/yoga/src/cli/commands/build/index.ts | 22 +------------------ packages/yoga/src/config.ts | 2 +- packages/yoga/src/index.ts | 2 +- packages/yoga/src/server.ts | 4 +--- 4 files changed, 4 insertions(+), 26 deletions(-) diff --git a/packages/yoga/src/cli/commands/build/index.ts b/packages/yoga/src/cli/commands/build/index.ts index d34f310..99add13 100644 --- a/packages/yoga/src/cli/commands/build/index.ts +++ b/packages/yoga/src/cli/commands/build/index.ts @@ -35,9 +35,8 @@ export default () => { tsConfigPath, ) const config = fixConfig(inputConfig, info.projectDir) - const rootNames = getRootNames(info) - compile(rootNames, config.options) + compile(config.fileNames, config.options) if (!info.yogaConfig.ejectFilePath) { const ejectFilePath = path.join( @@ -69,25 +68,6 @@ function compile(rootNames: string[], options: ts.CompilerOptions) { } } -function getRootNames(info: ConfigWithInfo) { - const rootNames = findFileByExtension(info.yogaConfig.resolversPath, '.ts') - - if (info.yogaConfig.contextPath) { - rootNames.push(info.yogaConfig.contextPath) - } - - if (info.yogaConfig.ejectFilePath) { - rootNames.push(info.yogaConfig.ejectFilePath) - } - - if (info.yogaConfig.prisma) { - rootNames.push(...findFileByExtension(info.prismaClientDir!, '.ts')) - rootNames.push(...findFileByExtension(info.datamodelInfoDir!, '.ts')) - } - - return rootNames -} - /** * Do post-processing on config options to support `ts-node`. */ diff --git a/packages/yoga/src/config.ts b/packages/yoga/src/config.ts index 05bca82..5f40527 100644 --- a/packages/yoga/src/config.ts +++ b/packages/yoga/src/config.ts @@ -63,7 +63,7 @@ function getDatamodelInfoDir( } if (inputConfig.prisma && inputConfig.prisma.datamodelInfoPath) { - return inputConfig.prisma.datamodelInfoPath + return path.join(projectDir, inputConfig.prisma.datamodelInfoPath) } return path.join(projectDir, DEFAULT_META_SCHEMA_DIR) diff --git a/packages/yoga/src/index.ts b/packages/yoga/src/index.ts index 2fb6f7e..fe86b73 100644 --- a/packages/yoga/src/index.ts +++ b/packages/yoga/src/index.ts @@ -2,7 +2,7 @@ import * as ApolloServer from 'apollo-server-express' import { ExpressContext } from 'apollo-server-express/dist/ApolloServer' import express from 'express' import * as Http from 'http' -import { InputConfig as YogaConfig, Yoga, MaybePromise } from './types' +import { InputConfig as YogaConfig, MaybePromise, Yoga } from './types' export * from 'nexus' export * from 'nexus-prisma' diff --git a/packages/yoga/src/server.ts b/packages/yoga/src/server.ts index 36dfd50..1118be4 100644 --- a/packages/yoga/src/server.ts +++ b/packages/yoga/src/server.ts @@ -195,11 +195,9 @@ function getYogaServer(info: ConfigWithInfo): Yoga { config.contextPath, config.expressPath, ) - const allTypes: any[] = [types] - const makeSchemaOptions = makeSchemaDefaults( config, - allTypes, + types, info.prismaClientDir, ) const schema = config.prisma