Syntax check package.json
for dual ESM+CJS support in @redwoodjs/auth
#10941
Labels
package.json
for dual ESM+CJS support in @redwoodjs/auth
#10941
What's not working?
It's very difficult to get everything setup and configured correctly for dual mode ESM+CJS packages.
The community has created two tools to help check you've got everything right, https://github.com/arethetypeswrong/arethetypeswrong.github.io and https://github.com/bluwy/publint
With how
@redwoodjs/auth
currently looks locally for me, this is the output I get from the two tools:Publint:
attw:
So, in this scenario Publint thinks everything is ✅
But attw reports errors for node10 for "@redwoodjs/auth/AuthProviderState" and "@redwoodjs/auth/ServerAuthProvider" plus for all of the exports for node16 CJS ❌
With some changes I instead get this output:
Publint:
attw:
Now the results are flipped.
Publint complains ❌
But attw now says node16 CJS support is fixed for
@redwoodjs/auth/AuthProviderState
✅So (unfortunately?) it seems we need to run both tools to get the full picture.
I want to integrate those two tools in our CI once I've fixed
@redwoodjs/auth
so that we don't regress on our support.And then I want to also add it to all our other dual mode packages.
For Publint we can just run the command and check the exit code (0 === success)
For attw though, we can't do that. We're not going to make our packages compatible with node10, so we're going to fail the node10 check for at least some entry points. Ideally we could just ask attw to skip the node10 checks, but unfortunately that's currently not possible. See arethetypeswrong/arethetypeswrong.github.io#112
Are you interested in working on this?
The text was updated successfully, but these errors were encountered: