Skip to content

Generate .d.ts file from the esm module (#2733) #2734

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

Merged
merged 1 commit into from
Jul 26, 2024

Conversation

Alexerson
Copy link
Contributor

@Alexerson Alexerson commented Jul 16, 2024

Description

Generating the htmx.d.ts file from src/htmx.js means the export statements are not included in the types file. Because typescript users will always want to import the esm file, it makes more sense to generate the types file from the module.

Corresponding issue: #2733

Testing

After generating the new type definition, I copied the content of dist/ to my local project node_modules and the error disappears and the project builds properly.

Checklist

  • I have read the contribution guidelines
  • I have targeted this PR against the correct branch (master for website changes, dev for
    source changes)
  • This is either a bugfix, a documentation update, or a new feature that has been explicitly
    approved via an issue
  • I ran the test suite locally (npm run test) and verified that it succeeded

@Telroshan Telroshan added bug Something isn't working 2.0 ready for review Issues that are ready to be considered for merging labels Jul 17, 2024
@alexpetros
Copy link
Collaborator

Cool, this works. Avoiding more config files is a priority of ours, and I appreciate your flexibility on finding a way forward.

@alexpetros alexpetros merged commit 6a800e8 into bigskysoftware:dev Jul 26, 2024
1 check passed
Copy link

Choose a reason for hiding this comment

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

I think files needs to be updated with the new name.

dist/htmx.d.ts -> dist/htmx.esm.d.ts

Alexerson pushed a commit to Alexerson/htmx that referenced this pull request Jul 29, 2024
alexpetros pushed a commit that referenced this pull request Jul 29, 2024
* Generate .d.ts file from the esm module (#2733)

* Fix types annotation filename in package.json (#2734)

---------

Co-authored-by: Alexandre Spaeth <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.0 bug Something isn't working ready for review Issues that are ready to be considered for merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants