Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Commit

Permalink
Fix build command
Browse files Browse the repository at this point in the history
  • Loading branch information
Weakky committed Mar 11, 2019
1 parent ace42c5 commit c5cad75
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 26 deletions.
22 changes: 1 addition & 21 deletions packages/yoga/src/cli/commands/build/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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`.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/yoga/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion packages/yoga/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 1 addition & 3 deletions packages/yoga/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c5cad75

Please sign in to comment.