Conversation
d441249 to
789f8cf
Compare
c5bb9a5 to
1161544
Compare
1161544 to
0675da9
Compare
parser function using 2 arguments
…removed from v3 so printComments no longer returns a concat doc
…ked by the coverage easily
f3adf96 to
b7cd74d
Compare
fvictorio
left a comment
There was a problem hiding this comment.
I don't understand all the changes here, but since we've already released v1.0.0, I'm fine with merging this!
|
Something I wonder though: can we have automated tests that make some smoke test with prettier v2 and v3, to check that everything works? cc @sosukesuzuki @fisker do you know if some plugin is doing something like that? |
So mainly V2 would still generate the other changes is that the clean function is more strict now and doesn't iterate over comments. so now we have to clean the comments as well. and for testing, prettier now returns promises so we have to wait for the resolution. I also added a utility function that tells us if the prettier version satisfies a range. that way we can use the same function to check if we are in V2 or V3 and also if we are at least V2.3.0 which is when we had to force our users to update their prettier version. also since there are branches that we would never reach because one thing if mocking Prettier version on tests and another is Mocking the behaviour of the prettier standalone plugins file names also changed in V3 so we had to adapt so our latest and finally the thing that started this rabbit hole. The parse function now receives 2 arguments and in V2 we used to get 3. So we had to adapt. |
in this PR there's a new task in our CI that installs V2 before running the tests in V2. I'm not too familiar with GitHub actions but I assume we could run all of the tests only if a particular small test fails. |
I missed that part, that is cool and I think it's good enough! And thanks for the explanation 😃 |
closes #747
Once the PR is merged, the plugin will run smoothly with V2 and V3.
We had to drop the coverage since there were a few cases where we would branch the execution depending on which version of prettier we'd be running.