Conversation
Hi! Thanks for the PR. Unfortunately, the tests are failing in the Github workflow. Can you take a look at those?
Sounds good to me. Thanks. |
Ok, I've made the change to use Another change I made for the tests is to move away from v12 node. The reason for this is it's going to reach EOL in about a month from now (2022-04-30). Making the tests run on v14 was easier than trying to change how the tests use I'm not sure if there's anything else that'll fail. I can pass the tests fine with node v14 on my machine, but using I'm running |
Turns out it'll be fine, we only run |
I tweaked the cache to use package-lock.json, since that should now be the source of truth for the state of the repo. What isn't so good is that it's looking like the test for |
Just wanted to give an update; I have been working on this on and off but I did get pretty busy recently. Yes, the error is real, no sadly The issue seems to be specifically when stripping out I do have a working but unmergable solution: use a horrifying regex to fix the imports before the flow types get removed: code = code.replace(
/import[^;\n]*type[^;\n]*from[^'"]*(["'][^'";]*["'])(;*)/g,
'import X from $1$2',
);
code = handleFlowType(code, config); More realistic solutions:
As an aside, we should probably be using |
Sorry I've been in the dark for a while. Thanks so much for all you're doing!
I'm not sure if that's enough, as I believe those annotations aren't required if a project uses flow for all the files. |
We really need some kind of lock for this (looks like we're aligning on npm anyway), since master is currently completely unable to be compiled due to lots of minor patches that have bitrotted the codebase. I'm now going to try and fix all the issues so this is a standard, compiling state to actually work from.
Using instanceof since we know what the thrown error should be.
While this is possibly controversial, v12 goes EOL in about a month, so might as well set v14 as the baseline, which makes our lives a little bit easier.
Since we have a package-lock.json, we can download the dependencies much faster with ci.
401bab9
to
29c10a3
Compare
68d9783
to
c087b08
Compare
The changes to package-lock.json and the GitHub actions, somehow made the CI fail. I suspect that it's just a cache issue, so I'll apply those changes later, separately. I'm going ahead and merge this. Thanks so much! |
I had to fix the build before I could even get started having a look at implementing a PR for #61.
This is based in part off the work done in #69, although I've taken a different approach to handling the errors. In Typescript you can solve the issue with Errors being
unknown
with instanceof narrowing. This has the benefit of matching what we're already doing in index.ts, and being typesafe to boot.I did have to make use of some dodgy casting in the
print.ts
tests, as far as I can tellconsole-testing-library
has a fix, but the latest released package doesn't have the change.I've also just gone ahead and made a
package-lock.json
for this project, while I know locks were purged in #17, the fact that locks were removed meant thatunimported
suffered bitrot due to packages updating and making breaking changes in their minor versions (I'm looking at youtypescript
).It might be worth also looking at updating the github workflow (the
cy.yml
) to usenpm ci
instead ofnpm i
when downloading dependencies since it should be faster & encourage the use of the lockfile, but I'm not going to make changes there unless requested.