Skip to content

Commit

Permalink
chore(sdk): remove unnecessary typescript version check
Browse files Browse the repository at this point in the history
  • Loading branch information
timsuchanek committed May 4, 2020
1 parent 41087c2 commit 9658096
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions src/packages/sdk/src/predefinedGeneratorResolvers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ export const predefinedGeneratorResolvers: PredefinedGeneratorResolvers = {
},
'prisma-client-js': async (baseDir, version) => {
let prismaClientDir = resolvePkg('@prisma/client', { cwd: baseDir })
checkTypeScriptVersion()
checkYarnVersion()

if (debugEnabled) {
Expand Down Expand Up @@ -199,32 +198,3 @@ function parseUserAgentString(str) {
}
return null
}

/**
* Warn, if TypeScript is older than 3.8
*/
function checkTypeScriptVersion() {
const typeScriptVersion =
process.env.npm_package_devDependencies_typescript ||
process.env.npm_package_dependencies_typescript
if (typeScriptVersion) {
const regex = /.*?(\d+)\.(\d+)\.(\d+)/
const match = regex.exec(typeScriptVersion)
if (match) {
const major = parseInt(match[1])
const minor = parseInt(match[2])
const patch = parseInt(match[3])
const currentTypeScriptVersion = `${major}.${minor}.${patch}`
const minTypeScriptVersion = '3.8.0'
if (semverLt(currentTypeScriptVersion, minTypeScriptVersion)) {
console.error(
`${chalk.yellow(
'warning',
)} You have installed typescript@${currentTypeScriptVersion}. Please update it to ${chalk.bold(
'typescript@3.8.0',
)} or higher to use @prisma/client.`,
)
}
}
}
}

0 comments on commit 9658096

Please sign in to comment.