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

refactor: started to move to typescript #21

Closed
wants to merge 2 commits into from

Conversation

tylersayshi
Copy link

I have only just started to refactor this. There is a lot of changing filenames and typing things out that needs to happen still. Figured I'd start this draft MR and see if anyone would be kind enough to help with the move to Typescript.

Relates to #19

@josdejong
Copy link
Owner

Thanks a lot Tyler! This is a nice start.

To me, the most important thing to get right first is the configuration of build scripts and dev environment. After that, we can gradually migrate all code to TypeScript. Right now, when I try out your PR it mostly doesn't work 😁

Concretely, the following scripts should keep working:

  1. npm run dev -> after that open the dev environment in your browser at http://localhost:3000
  2. npm test -> runs the unit tests
  3. npm run build -> generates the npm package and bundles in /package. Test by opening /tools/develop_vanilla.html in your browser

@tylersayshi
Copy link
Author

@josdejong I was able to fix npm run dev and npm run build as far as I could tell. It was hard to test the success of these though because the unit tests are still broken.

I followed the advice here: TypeStrong/ts-node#935 (comment), but was unable to get the tests working (I am not super familiar with working with esm). Figured I'd see if you have any thoughts on this bit before continuing to debug - thanks!

@josdejong
Copy link
Owner

That sounds promising!

I vaguely remember there where issues with the tests due to a TypeScript issues with missing file extensions: microsoft/TypeScript#40878 (comment). There seems to be a solution on the way for this.

@tylersayshi
Copy link
Author

It looks like that fix was merged: microsoft/TypeScript#44501 (comment)

I can try bumping typescript over the weekend to see if the issue is resolved, but as I followed that thread there seem to be some more lingering issues. I'll keep my fingers crossed 🤞

@tylersayshi
Copy link
Author

Updating this with a more recent thread of lingering TS issues: microsoft/TypeScript#46452

@josdejong
Copy link
Owner

👍

@josdejong
Copy link
Owner

I've now (finally) fixed the TypeScript setup, it's in the main branch already (many files still need to be converted to TS but there is a start). I'll close this PR now, thanks again Tyler.

@josdejong josdejong closed this May 21, 2022
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.

2 participants