Skip to content

chore: Re-export config types - #32

Merged
timfish merged 3 commits into
mainfrom
types/re-export-types
Jul 15, 2026
Merged

chore: Re-export config types#32
timfish merged 3 commits into
mainfrom
types/re-export-types

Conversation

@timfish

@timfish timfish commented Jul 14, 2026

Copy link
Copy Markdown
Member

This gives easy access to the types without needing @apm-js-collab/code-transformer as a dependency.

Because we now export ./core, this fixes another issue where consumers can't access CodeTransformerPluginOptions.

@timfish
timfish requested a review from isaacs July 14, 2026 19:09

@isaacs isaacs left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Comment thread src/core.ts

const moduleDetailsFromPath: (filepath: string) => ModuleDetails =
(moduleDetailsFromPathImport as any).default ||
(moduleDetailsFromPathImport as any);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This seems like a worthwhile cleanup, but I'm curious why it was like that in the first place. Did it used to not have a default export or something?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I fixed a similar issue here but with a different Rollup setting.

This time chaging the Rollup exports setting to auto fixes the ESM interop issue:
https://github.com/apm-js-collab/code-transformer-bundler-plugins/pull/32/changes#diff-6a3b01ba97829c9566ef2d8dc466ffcffb4bdac08706d3d6319e42e0aa6890dd

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Ah, esm interop. Makes sense.

@timfish
timfish merged commit 4d0acc2 into main Jul 15, 2026
1 check passed
@timfish
timfish deleted the types/re-export-types branch July 15, 2026 01:53
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