Skip to content

fix: type should match cjs format#13

Merged
UlisesGascon merged 1 commit intoonebeyond:masterfrom
albertodeago:fix/types
Nov 5, 2025
Merged

fix: type should match cjs format#13
UlisesGascon merged 1 commit intoonebeyond:masterfrom
albertodeago:fix/types

Conversation

@albertodeago
Copy link
Contributor

@albertodeago albertodeago commented Nov 4, 2025

Types are not correct, they are not aligned with the code.
Similar to onebeyond/systemic#69

Related Issue

Didn't open an issue, should I do it?

Motivation and Context

This is an issue users encounter if they try to consume this module from an ESM service.

export default runner should be used if in the js file we were doing export default runner; -> the package is exported as a ES module.
When exporting a CJS module instead (like we're doing here with module.exports = ...) the type definition should be export = runner;

Typescript is probably clever enough to not raise any error when consuming this in a CJS service, but in an ESM environment it's raising an error, see screenshot
image

How Has This Been Tested?

This is a change only in the types, I've tried it changing the type definition directly in the node_modules both in a ESM service and in a CJS service

Working in CJS service
image

Working in ESM service
image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@UlisesGascon
Copy link
Collaborator

I will include this change in the next release @albertodeago! Thanks for the fix 👍

@UlisesGascon UlisesGascon self-assigned this Nov 5, 2025
@UlisesGascon UlisesGascon merged commit 74cb2c7 into onebeyond:master Nov 5, 2025
2 checks passed
@UlisesGascon UlisesGascon mentioned this pull request Nov 5, 2025
@albertodeago
Copy link
Contributor Author

Thank you guys for the quick work! 🚀

@UlisesGascon
Copy link
Collaborator

Hey @albertodeago should be ready in systemic-service-runner@3.0.0 the major is due a license change (ISC to MIT) that was pending to be released for a while... 😅

@albertodeago
Copy link
Contributor Author

Amazing, thanks @UlisesGascon 🙏

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