-
-
Notifications
You must be signed in to change notification settings - Fork 593
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
Refactor codebase to TypeScript #264
Refactor codebase to TypeScript #264
Conversation
BTW, tests are passing on my fork but are not running here https://github.com/taras/ink/actions/runs/58115570 |
I squashed the commits. I'll start working on replacing DOM with JSDOM in another branch as I wait for feedback on this PR. No rush. |
https://github.com/vadimdemedes/ink/blob/master/index.d.ts includes a lot of doc comments, can you ensure they're correct moved to the TS source? |
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
nice one Co-Authored-By: Sindre Sorhus <sindresorhus@gmail.com>
@vadimdemedes do you want to keep the prop types? IOW, can I remove them? |
@vadimdemedes I believe everything in this branch is done based on feedback. |
Fantastic work, @taras, thank you! There are some tiny styling places to fix up, but I'll do that myself after this PR is merged. Considering the tremendous amount of change here, I'm going to take this opportunity to create a major release, including some other changes I wanted to make for a long time. |
Btw, is there a reason to include |
|
No
Yes |
Cool, fixed both in master. |
Note: I created an integration package that plugin developers can use to test this new package before it's published. Please, test it by installing
@frontside/ink@next
and let me know how it goes. I'll deprecate this package after this branch is merged.Motivation
I refactored the codebase to TypeScript to make it easier to replace existing DOM with JSDOM and expose JSDOM for testing in more complex UI scenarios. This could also provide a path to #151.
Backstory
My team at Frontside and I are starting to work on the CLI for our new BigTest test runner. We wanted to use Ink but we wanted the CLI UI that could compete with Cypress' web UI.
To test that kind of Ink UI, we'll want to have the ability to assert on a DOM like tree. Ink has DOM like representation but it's not a real DOM so we can't use existing DOM traversal tools to select elements to assert on. I started looking at replacing Ink's DOM with JSDOM but I found it very difficult to navigate the code because it's not typed.
So, I wanted to add types before diving further.
Approach
I had to make quite a few changes.
Questions/TODO