-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Update usage-reporting-protobuf to have main field #7095
Conversation
@alex-statsig: Thank you for submitting a pull request! Before we can merge it, you'll need to sign the Apollo Contributor License Agreement here: https://contribute.apollographql.com/ |
✅ Deploy Preview for apollo-server-docs ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site settings. |
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 6d0d811:
|
Hi @alex-statsig — I'm sure you're right about this and I'm sure I'll merge this today. That said, this stuff is pretty complex — we have to put the same information in multiple places so that a bunch of different systems works. Can you let me know exactly what context the current setup failed for you? I'd like to extend the section at the end of DEVELOPMENT.md (as well as the tests in smoke-test) to catch your issue but I can't remember which particular build context uses these particular fields. (Note: the CI errors in "Smoke test built package" and the 17 canary right now are not your fault — combination of that test not quite pinning its dependencies well enough plus a bug in another package that I just made a PR for.) |
I'm using jest v26.6.3 (w/ [email protected] and babel-jest as 26.6.3), and just trying to run a jest test which starts the server. I have no build issues outside of jest, but I believe jest uses a version of resolver which doesn't support exports (see jestjs/jest#9771). The exact issue I get is that the module "@apollo/usage-reporting-protobuf" is not found. I've locally patched it by overriding the jest resolver logic to look at the "exports" field as well, but seems like no harm in just setting this field for simplicity / better support. Let me know if you need any more info about the repro |
OK, even though we use |
Overriding CI (test failures are due to ardatan/graphql-tools#4795 + our lack of package-lock.json in the smoke-test) |
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## @apollo/[email protected] ### Patch Changes - [#7095](#7095) [`72111f970`](72111f9) Thanks [@alex-statsig](https://github.com/alex-statsig)! - Include `main` and `module` fields in package.json for build tools that look for them instead of `exports`. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@apollo/usage-reporting-protobuf should define a main/module field in package.json, same as @apollo/server does. The "exports" field doesn't work everywhere yet still (ex. jest, or at least old versions of jest, don't respect it).