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

build: switch to using typescript #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

yharaskrik
Copy link

Initial implementation of TS, never really setup a TS repo other than an Nx workspace before. I have all the files switched to typescript and the tsc build setup but will still need to work on out it is being compiled so it is packageable by npm

@yharaskrik
Copy link
Author

This would make the building and packaging much easier if we wanted to go that way!

#2

import type {AggregatedResult, TestResult} from '@jest/test-result';

import {DefaultReporter} from "@jest/reporters";
import {LogEntry, LogType} from "@jest/console/build/types";
Copy link

Choose a reason for hiding this comment

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

reaching into build is not supported, if tsc supports package exports it'll actually fail from Jest 27.

I'd be happy to merge a PR in Jest that exports the types you need to build this reporter in TS

Copy link
Author

Choose a reason for hiding this comment

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

Oh that is good to know! I'll add it to my list of things to do today. Thanks!

Copy link
Author

Choose a reason for hiding this comment

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

@jevakallio
Copy link
Owner

jevakallio commented Jan 19, 2021

@yharaskrik thanks for this effort!

To make this easier to review, could you git rm dist/ and add dist/ to .gitignore?

Regarding development workflow, instead of Nx as discussed in #2, I'd favor tsdx. I've never used to to develop node libraries, but it does support CommonJS as output format: https://github.com/formium/tsdx

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@yharaskrik
Copy link
Author

Oh ya for sure! I did add dist to the git ignore but I must have added the folder to hit by accident prior.

I'll take a look at tsdx!

@yharaskrik
Copy link
Author

Hey @jevakallio just letting you know that the type exports were merged into Jest master by @SimenB. Just gotta wait for those to land so that I can update this PR and then I think that is the last thing that needs to be done to get the TS migration done to have initial TS support!

@SimenB
Copy link

SimenB commented Jan 23, 2021

That change will only be available in Jest@27, so not sure you need to wait for it? As long as build/ works and a migration plan is in place I think it's fine to move on in the meantime 👍

@yharaskrik
Copy link
Author

Oh sweet ok! Good to know, @jevakallio how do you feel about getting this in at some point then, we can roll with it for the time being and then I just need to update the type imports in a couple of places come jest 27.

@yharaskrik yharaskrik changed the title [WIP] build: switch to using typescript build: switch to using typescript Feb 1, 2021
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.

None yet

3 participants