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

fix import from rds #76

Merged
merged 1 commit into from
Sep 12, 2024
Merged

fix import from rds #76

merged 1 commit into from
Sep 12, 2024

Conversation

fat23cat
Copy link
Contributor

I'm really sorry I made a mistake in the import in the #75 :(

@simonrw
Copy link
Collaborator

simonrw commented Sep 11, 2024

How did you find this out? The commit I pushed verified both behaviours against AWS and LocalStack and I found that this functionality worked just fine.

@fat23cat
Copy link
Contributor Author

fat23cat commented Sep 11, 2024

How did you find this out? The commit I pushed verified both behaviours against AWS and LocalStack and I found that this functionality worked just fine.

I'm using this package to run appsync resolvers unit tests using vitest.
I'm replacing @aws-appsync/utils with your package in the vitest config:

export default defineConfig({
  resolve: {
    alias: {
      "@aws-appsync/utils": path.resolve(
        __dirname,
        "node_modules/appsync-utils"
      ),
      "@aws-appsync/utils/rds": path.resolve(
        __dirname,
        "node_modules/appsync-utils/rds"
      ),
    },
  },
  test: {
    environment: "node",
    include: ["src/**/*.test.{js,ts}"],
    ...configDefaults,
  },
});

But tests are failing:

Error: Directory import '.../node_modules/appsync-utils/rds' is not supported resolving ES modules imported from /...node_modules/appsync-utils/index.js

@fat23cat
Copy link
Contributor Author

Copy link
Collaborator

@simonrw simonrw left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this. I have executed the LocalStack tests locally and confirm that it has not broken anything.

I am interested to understand more. I will be the first to admit that I don't understand the JS module system. I have had problems with this package and not being able to split it up, and to have weird import structures. I would appreciate someone who knows more about JavaScript to help me refactor this.

I will merge this as I trust that the change is correct. Thanks again!

@simonrw simonrw merged commit 4b1b207 into localstack:main Sep 12, 2024
3 of 4 checks passed
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