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
Publish CommonJS typescript Types. #7614
Conversation
👷 Deploy request for apollo-server-docs pending review.Visit the deploys page to approve it
|
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 ac07ed2:
|
I forked the Apollo Server Typescript code sandbox to use commonjs instead to show that typings now work with this change |
In comparison with latest version of |
I wanted to add a smoke-test and then realized I missed a few spots 😅 |
Excellent, thanks for doing this! If you didn't add one I would've asked you to - and voila...glad it turned up some issues. I'll take a look at this today and try it out. Based on the reactions already it looks like you'll make some people happy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good! I haven't actually tried installing the sandbox builds yet, will do after changes are addressed.
Removed remaining comments about deleting cjs typings Reverted "main" in gateway-interface/package.json
Co-authored-by: David Glasser <glasser@apollographql.com>
…e details in the changeset file\nAdd node16 smoke-test
Tested builds locally with the problematic configurations using existing packages vs. the codesandbox builds from this PR and this does resolve the issues it claims to. Additionally, I found that it resolves the deep import autocomplete issue mentioned here. I'll add it to the PR description. Thanks for your work on this, this is a great improvement! |
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/cache-control-types@1.0.3 ### Patch Changes - [#7614](#7614) [`4fadf3ddc`](4fadf3d) Thanks [@Cellule](https://github.com/Cellule)! - Publish TypeScript typings for CommonJS modules output. This allows TypeScript projects that use CommonJS modules with `moduleResolution: "node16"` or `moduleResolution: "nodeNext"` to correctly resolves the typings of apollo's packages as CommonJS instead of ESM. ## @apollo/server-gateway-interface@1.1.1 ### Patch Changes - [#7614](#7614) [`4fadf3ddc`](4fadf3d) Thanks [@Cellule](https://github.com/Cellule)! - Publish TypeScript typings for CommonJS modules output. This allows TypeScript projects that use CommonJS modules with `moduleResolution: "node16"` or `moduleResolution: "nodeNext"` to correctly resolves the typings of apollo's packages as CommonJS instead of ESM. - Updated dependencies \[[`4fadf3ddc`](4fadf3d)]: - @apollo/usage-reporting-protobuf@4.1.1 ## @apollo/server-integration-testsuite@4.7.5 ### Patch Changes - Updated dependencies \[[`4fadf3ddc`](4fadf3d)]: - @apollo/cache-control-types@1.0.3 - @apollo/server@4.7.5 - @apollo/usage-reporting-protobuf@4.1.1 ## @apollo/server-plugin-response-cache@4.1.3 ### Patch Changes - [#7614](#7614) [`4fadf3ddc`](4fadf3d) Thanks [@Cellule](https://github.com/Cellule)! - Publish TypeScript typings for CommonJS modules output. This allows TypeScript projects that use CommonJS modules with `moduleResolution: "node16"` or `moduleResolution: "nodeNext"` to correctly resolves the typings of apollo's packages as CommonJS instead of ESM. ## @apollo/server@4.7.5 ### Patch Changes - [#7614](#7614) [`4fadf3ddc`](4fadf3d) Thanks [@Cellule](https://github.com/Cellule)! - Publish TypeScript typings for CommonJS modules output. This allows TypeScript projects that use CommonJS modules with `moduleResolution: "node16"` or `moduleResolution: "nodeNext"` to correctly resolves the typings of apollo's packages as CommonJS instead of ESM. - Updated dependencies \[[`4fadf3ddc`](4fadf3d)]: - @apollo/cache-control-types@1.0.3 - @apollo/server-gateway-interface@1.1.1 - @apollo/usage-reporting-protobuf@4.1.1 ## @apollo/usage-reporting-protobuf@4.1.1 ### Patch Changes - [#7614](#7614) [`4fadf3ddc`](4fadf3d) Thanks [@Cellule](https://github.com/Cellule)! - Publish TypeScript typings for CommonJS modules output. This allows TypeScript projects that use CommonJS modules with `moduleResolution: "node16"` or `moduleResolution: "nodeNext"` to correctly resolves the typings of apollo's packages as CommonJS instead of ESM. Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
This is released in the latest versions of Apollo Server packages. Thanks again! |
Fixes #7222
Incidentally, this also fixes #6899
Stop removing CommonJS Types and fix
exports
to properly direct to the right types.I've been successful with this approach in other projects.
I tested real quick on my project using "CommonJS"
"module": "Node16"
and"moduleResolution": "node16"