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

Exports and export assignments are not permitted in module augmentations #25

Open
beastlyDartfordian opened this issue Jul 30, 2024 · 4 comments
Labels
breaking changes bug Something isn't working

Comments

@beastlyDartfordian
Copy link

Hello,

when running pnpm build on my project while using [email protected] I get the following error:

node_modules/.pnpm/[email protected]/node_modules/aws-ssl-profiles/lib/index.d.ts:6:5 - error TS2666: Exports and export assignments are not permitted in module augmentations.

6 export = profiles;

Found 1 error in node_modules/.pnpm/[email protected]/node_modules/aws-ssl-profiles/lib/index.d.ts:6

@wellwelwel
Copy link
Collaborator

wellwelwel commented Jul 30, 2024

Hi, @beastlyDartfordian. Thanks for reporting it.

I'm planning to update the project to version 2 to resolve this, but I haven't discussed it with the maintainers yet.


It's a conflict that I already imagined could happen when we need to export both “default” to “named”, but for the first version the idea was not to think about the name of the exported methods. See #5.


I also tried this simple approach to avoid a bc so soon: #23 (comment), but without success.

@wellwelwel wellwelwel added the bug Something isn't working label Jul 30, 2024
@wellwelwel
Copy link
Collaborator

wellwelwel commented Jul 30, 2024

@sidorares, @dougwilson

In parallel with resolving this issue, I thought about something that would be interesting for this project (in future) and would make it even lighter and more flexible for end users.

Currently we manually adapt the certificates into an array and use everything together, but we could use a simple builder to use the .pem files provided by AWS, creating an object for each region and the default collection (as it is currently).

  • The result for the end user wouldn't change and would still be an array of strings.
  • It would be possible to import regions individually or combined (as it is)

Note

The .pem files wouldn't be uploaded to npm, but would be used by a pre-builder.


Regarding the name, the end user could rename it both for CJS and ESM, for example:

const { awsCaBundle: ssl } = require('aws-ssl-profiles');
import { awsCaBundle as ssl } from 'aws-ssl-profiles';

What do you think? 🙋🏻‍♂️

@HappyZombies
Copy link
Contributor

As you work on version 2, can this still be fixed for version 1 in the meantime by doing what I recommended here? #23 (comment)

If not I can just spin up a PR this week to quickly patch this bug with a version 1.1.2 or something

@wellwelwel
Copy link
Collaborator

wellwelwel commented Aug 28, 2024

Hey @HappyZombies, thanks for the ping 🙋🏻‍♂️

As you work on version 2

  • For now, it's just an idea (and needs approval).

I can just spin up a PR this week to quickly patch this bug

  • We'd appreciate that 🤝

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking changes bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants