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

in packages without exports, look for proxy directories instead #46

Merged
merged 3 commits into from
Jun 23, 2023

Conversation

phryneas
Copy link
Contributor

Right now, we're stuck without an exports field in @apollo/client v3 - we are aiming to add one with v4, but there is no immediate update around the corner.

I'd love to use attw for all our entry points though - so this would look for all package.json files within a project and use those as entry points.

look for proxy directories instead
@changeset-bot
Copy link

changeset-bot bot commented Jun 23, 2023

🦋 Changeset detected

Latest commit: 32c9b35

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@arethetypeswrong/core Minor
@arethetypeswrong/cli Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@andrewbranch
Copy link
Collaborator

Hey, thanks for the contribution! I think I’m ok with this if we add a check that the proxy directory package.json files contain a "main" field. I’m thinking about cases where someone drops a {} or { "type": "module" } package.json in a directory to change the module format of a particular directory. Those would turn up as a false positive here, although that pattern feels unlikely to occur without root level exports.

Have you seen #40? I was planning just to let people pass in a list. Maybe this is a good start though, especially for the web client.

@phryneas
Copy link
Contributor Author

@andrewbranch that sounds like a very good sanity check - I've added it.

I've just seen #40 a few minutes ago - it seems like a good additional way to take, but we want to add this in CI, so something like this that automatically detects new entry points would be much preferred - I'm afraid that at some point we forget to add a new entry point to a manually managed list, and miss errors introduced that way.

@andrewbranch
Copy link
Collaborator

I think this is good to go. Would you mind adding a changeset with a minor bump for the core package?

@phryneas
Copy link
Contributor Author

Sure, I just added one :)

@andrewbranch andrewbranch merged commit 7c3a377 into arethetypeswrong:main Jun 23, 2023
@andrewbranch
Copy link
Collaborator

Thanks! This will deploy to the web immediately. I’m hoping to get a couple other random fixes for stuff in today/tomorrow and do an npm release then.

@phryneas
Copy link
Contributor Author

Sounds great :) Thank you for looking at this so fast!

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.

2 participants