Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ts-config): remove dependency on ts-jest and configure tsconfif w… #161

Closed
wants to merge 2 commits into from

Conversation

yohodopo
Copy link
Contributor

@yohodopo yohodopo commented Feb 14, 2019

…ith vue-jest

Remove dependency over ts-jest and let the user configure his tsconfig with vue-jest when specified.
When tsconfig/ts-jest is not configured then a will look for tsconfig at the root of the application.

Hey @eddyerburgh I've tried creating to use babel to compile typescript files here https://github.com/yohodopo/vuejest/blob/bcfa5bc337910f0ba86a93c42d660a5c2bfa74f7/lib/utils.js#L112-L131 but I'm not very confident if thats what we'd want to do that since users might want to use some of the features it does not offer yet with the list of plugins, It would also take away the most desired feature of typechecking.

@eddyerburgh
Copy link
Member

Thanks for this :)

The link you've posted is 404ing. Is it a private repo?

lib/utils.js Outdated
@@ -1,6 +1,8 @@
const loadPartialConfig = require('@babel/core').loadPartialConfig
const createTransformer = require('ts-jest').createTransformer
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will still error if users don't have TypeScript installed, can you move the require to inside the getTSConfig function

@@ -0,0 +1,54 @@
import { getTSConfig } from 'vue-jest/lib/utils'
Copy link
Member

@eddyerburgh eddyerburgh Feb 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This directory is intended for e2e tests

@eddyerburgh
Copy link
Member

Thanks for the work :)

I think it's fine to use Babel for TypeScript:

  1. It's what Jest does now for TypeScript files by default
  2. It removes tsconfig resolution logic from vue-jest
  3. The features it doesn't support are minimal
  4. The intention for vue-jest isn't to do type checking

I thought we could use babel in the beta version and get feedback from users.

FYI The reason we started to use ts-jest originally was to move the logic for resolving tsconfig options to another package. But I'm not sure the package is going to be maintained, so we should remove it as a dependency.

Can you open a new PR that uses babel for compiling TypeScript?

@yohodopo yohodopo force-pushed the fix/ts-config branch 2 times, most recently from 21e31cd to ea45492 Compare February 15, 2019 10:51
@lmiller1990
Copy link
Member

We fixed this in another PR.

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.

3 participants