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

support jest 26 cjs loading of packages #286

Merged
merged 7 commits into from
Sep 25, 2023
Merged

support jest 26 cjs loading of packages #286

merged 7 commits into from
Sep 25, 2023

Conversation

edwardfoyle
Copy link
Contributor

Issue #, if available:

Description of changes:
The graphql construct package uses jest 26 which does not support loading es6 modules. Because these tests need to load the backend-output-schemas and backend-output-storage packages, we need to expose a "main" field on the package.json so that the jest cjs loader can find the package entry point.

Tested by running the gql construct test suite locally with this change

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@changeset-bot
Copy link

changeset-bot bot commented Sep 23, 2023

🦋 Changeset detected

Latest commit: ba74158

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

This PR includes changesets to release 9 packages
Name Type
@aws-amplify/backend-output-schemas Patch
@aws-amplify/backend-output-storage Patch
@aws-amplify/auth-construct-alpha Patch
@aws-amplify/backend-auth Patch
@aws-amplify/backend-function Patch
@aws-amplify/backend-graphql Patch
@aws-amplify/backend-storage Patch
@aws-amplify/backend Patch
@aws-amplify/storage-construct-alpha 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

sobolk
sobolk previously approved these changes Sep 23, 2023
Copy link
Member

@sobolk sobolk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add some dummy CJS package to our repo or generate one in integration tests and add dependency on packages that have to support CJS ?

@edwardfoyle
Copy link
Contributor Author

@sobolk yeah we might want something like that. Created a tracking issue here: #287

The lint thing catching missing dependencies is also giving me some concern. Seems like it should have caught that before this PR...

sobolk
sobolk previously approved these changes Sep 25, 2023
0618
0618 previously approved these changes Sep 25, 2023
@edwardfoyle edwardfoyle dismissed stale reviews from 0618 and sobolk via ba74158 September 25, 2023 20:28
@edwardfoyle edwardfoyle merged commit ac3df08 into main Sep 25, 2023
18 checks passed
@edwardfoyle edwardfoyle deleted the cjs-loading branch September 25, 2023 20:48
@edwardfoyle edwardfoyle mentioned this pull request Sep 25, 2023
abhi7cr pushed a commit that referenced this pull request Sep 27, 2023
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.

3 participants