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

Syntax check package.json for dual ESM+CJS support in @redwoodjs/auth #10941

Closed
1 task done
Tobbe opened this issue Jul 13, 2024 · 0 comments · Fixed by #10942
Closed
1 task done

Syntax check package.json for dual ESM+CJS support in @redwoodjs/auth #10941

Tobbe opened this issue Jul 13, 2024 · 0 comments · Fixed by #10942

Comments

@Tobbe
Copy link
Member

Tobbe commented Jul 13, 2024

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:
image

attw:
image

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:
image

attw:
image

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?

  • I'm interested in working on this
@Tobbe Tobbe added bug/needs-info More information is needed for reproduction topic/ops-&-contributing-dx and removed bug/needs-info More information is needed for reproduction labels Jul 13, 2024
@Tobbe Tobbe changed the title Syntax check package.jsons for our dual ESM+CJS packages Syntax check package.json for dual ESM+CJS support in @redwoodjs/auth Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant