Skip to content

Commit

Permalink
chore(sdk,engine-core): rename platforms to binaryTargets
Browse files Browse the repository at this point in the history
  • Loading branch information
Jolg42 committed Jun 4, 2020
1 parent 3e0cfbc commit 11b9c8b
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/packages/engine-core/src/NodeEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import fs from 'fs'
import chalk from 'chalk'
import { GeneratorConfig } from '@prisma/generator-helper'
import { printGeneratorConfig } from './printGeneratorConfig'
import { fixPlatforms, plusX } from './util'
import { fixBinaryTargets, plusX } from './util'
import { promisify } from 'util'
import EventEmitter from 'events'
import { convertLog, RustLog, RustError } from './log'
Expand Down Expand Up @@ -383,7 +383,7 @@ ${chalk.dim("In case we're mistaken, please report this to us 🙏.")}`)
private getFixedGenerator(): string {
const fixedGenerator = {
...this.generator,
binaryTargets: fixPlatforms(
binaryTargets: fixBinaryTargets(
this.generator.binaryTargets as Platform[],
this.platform,
),
Expand Down
2 changes: 1 addition & 1 deletion src/packages/engine-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export {
export { NodeEngine as Engine } from './NodeEngine'
export { getInternalDatamodelJson } from './getInternalDatamodelJson'
export { printGeneratorConfig } from './printGeneratorConfig'
export { fixPlatforms } from './util'
export { fixBinaryTargets } from './util'
2 changes: 1 addition & 1 deletion src/packages/engine-core/src/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export function plusX(file): void {
fs.chmodSync(file, base8)
}

export function fixPlatforms(
export function fixBinaryTargets(
platforms: Array<Platform | string>,
platform: Platform | string,
): string[] {
Expand Down
2 changes: 1 addition & 1 deletion src/packages/sdk/src/cli/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export type GeneratorConfig = {
name: string
provider: string
config: Dictionary<string>
platforms: string[]
binaryTargets: string[]
pinnedBinaryTargets?: string | null
}

Expand Down
7 changes: 5 additions & 2 deletions src/packages/sdk/src/getGenerators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
} from '@prisma/fetch-engine/dist/download'
import { download } from '@prisma/fetch-engine'
import { getPlatform, Platform } from '@prisma/get-platform'
import { printGeneratorConfig, fixPlatforms } from '@prisma/engine-core'
import { printGeneratorConfig, fixBinaryTargets } from '@prisma/engine-core'

import { getConfig, getDMMF } from './engineCommands'
import { unique } from './unique'
Expand Down Expand Up @@ -366,7 +366,10 @@ Possible binaryTargets: ${chalk.greenBright(knownBinaryTargets.join(', '))}`,
${chalk.greenBright(
printGeneratorConfig({
...generator,
binaryTargets: fixPlatforms(generator.binaryTargets as any[], platform),
binaryTargets: fixBinaryTargets(
generator.binaryTargets as any[],
platform,
),
}),
)}
${chalk.gray(
Expand Down

0 comments on commit 11b9c8b

Please sign in to comment.