Skip to content

chore(cli): warn if unsupported/missing typescript version#6060

Merged
timsuchanek merged 3 commits intomasterfrom
chore/warn-typescript-version
Mar 15, 2021
Merged

chore(cli): warn if unsupported/missing typescript version#6060
timsuchanek merged 3 commits intomasterfrom
chore/warn-typescript-version

Conversation

@williamluke4
Copy link
Copy Markdown

@williamluke4 williamluke4 commented Mar 11, 2021

closes #5728

When tsc is not present
Clipboard_2021-03-11-17-22-50
When tsc is outdated
Clipboard_2021-03-11-17-25-13
I also added typescript:>=4.1 to the cli's peerDeps as this will warn on install.

@williamluke4 williamluke4 added this to the 2.19.0 milestone Mar 11, 2021
@Jolg42
Copy link
Copy Markdown
Contributor

Jolg42 commented Mar 11, 2021

We should not require typescript dependency or warn that it's not there in my opinion.

If you're a Node.js user and not using TypeScript you don't want warnings about it if you're happy with your .js code.

@pantharshit00
Copy link
Copy Markdown
Contributor

I agree. Warning when typescript is installed should be enough.

@Jolg42
Copy link
Copy Markdown
Contributor

Jolg42 commented Mar 11, 2021

Also I'm curious about how much time it takes to do tsc -v every time when prisma-client-js generator is called?
My local test with time tsc -v says 0.17 real 0.15 user 0.02 sys, curious about what this is on different machines (especially on less performant ones).

One alternative would be to look for the package.json typescript dependency and check the version there? (probably faster but only covers local install / not global)

Comment thread src/packages/sdk/src/predefinedGeneratorResolvers.ts Outdated
Comment thread src/packages/sdk/src/predefinedGeneratorResolvers.ts Outdated
@timsuchanek timsuchanek merged commit d8e823e into master Mar 15, 2021
@timsuchanek timsuchanek deleted the chore/warn-typescript-version branch March 15, 2021 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add TypeScript version check

4 participants