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

Migration to typescript Step 1 #968

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Migration to typescript Step 1 #968

wants to merge 2 commits into from

Conversation

Janther
Copy link
Contributor

@Janther Janther commented Dec 30, 2023

Renaming all files from js to ts makes the review process quite difficult.
In order to make the migration to typescript as easy and as clean as possible, I split it in a few steps.

important changes in this step:

  • install typescript packages and add necessary configuration to build, load, and test.
  • add final types
  • migrated all files that git would recognise as a file renaming and not a delete x.js and create x.ts
  • in the remaining js files changed the minimal amount of logic for the whole package to still work.

All tests still passing

@Janther
Copy link
Contributor Author

Janther commented Dec 30, 2023

Closing because ts-node has issues with node 16 and mixing esm and cjs, which our tests need.

node 18 and node 20 do work

UPDATE:
With the following changes we can make the tests run in node 16

  • remove ts-node/esm from test:standalone
  • only test:standalone loads the cjs files
  • test:standalone only runs tests that use the built version and not the unit tests (we were already doing this in the CI for prettier V2 tests)
  • load prettier directly instead of using a cjs file for non test:standalone tests

@Janther Janther closed this Dec 30, 2023
@Janther Janther reopened this Dec 30, 2023
@Janther Janther force-pushed the ts-migration branch 6 times, most recently from d1b3622 to f5c4d0f Compare January 8, 2024 17:51
@Janther Janther force-pushed the ts-migration branch 2 times, most recently from 1b4c979 to 6d6e5a1 Compare January 10, 2024 20:19
@Janther Janther force-pushed the ts-migration branch 7 times, most recently from c4cfa92 to 444953f Compare January 19, 2024 02:42
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.

1 participant