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

Enable rollup for types #16

Merged
merged 4 commits into from
Nov 7, 2023
Merged

Conversation

djfhe
Copy link
Member

@djfhe djfhe commented Nov 6, 2023

This should fix #15.

By enabling rollup for typescript types we ensure that the build declaration file is at dist/index.d.ts.

Otherwise the declaration files would be kept in the same structure as our source which could be problematic if the src structure changed, leading to a change in the resulting structure of our built files (in dist/) which could be different to the path definitions in our package.json.

I'm still unsure why the built behavior changed.

Could you also test this change @saibotk

By enabling rollup for typescript types we ensure that the build declaration file is at dist/index.d.ts.
Otherwise the declaration files would be kept in the same structure as our source which could be problematic if the src structure changed, leading to a change in the resulting structure of our built files (in dist/) which could be different to the path definitions in our package.json.
@Vanilagy
Copy link
Collaborator

Vanilagy commented Nov 6, 2023

Lol, rolling up types is crazy. I need to look into how this is done (don't think TypeScript can do this on its own).

@Vanilagy
Copy link
Collaborator

Vanilagy commented Nov 6, 2023

Have you verified this works by linking the package locally?

@djfhe
Copy link
Member Author

djfhe commented Nov 6, 2023

Yes, did exactly that. So it should work, but it would be nice if someone other than me can verify this.

@saibotk
Copy link
Member

saibotk commented Nov 6, 2023

While this does fix the issue, i would rather like to fix this by correcting the export path and addressing the change that was seemingly introduced in the vite plugin when upgrading those dependencies. Instead of just bundling all types into a single file which is not the default option, to stay aligned with sane defaults, as i do not see any benefit in the rollup option.

@saibotk
Copy link
Member

saibotk commented Nov 6, 2023

I would close this in favor of #17, which also addresses two other issues.

@djfhe
Copy link
Member Author

djfhe commented Nov 7, 2023

We should probably merge both PRs. Since bundling types is as far as i see the default for many libraries. (for example https://www.npmjs.com/package/@vue/runtime-core?activeTab=code). In our case it's not necessary to bundle our types, but may prevent further issues.

@saibotk
Copy link
Member

saibotk commented Nov 7, 2023

We can merge this too, but we should adjust the changelog to only include fixing the issue once and maybe just add this one without a changelog, because it does not change anything the user sees

@djfhe
Copy link
Member Author

djfhe commented Nov 7, 2023

You are right, updated it.

CHANGELOG.md Outdated Show resolved Hide resolved
@saibotk
Copy link
Member

saibotk commented Nov 7, 2023

Also please quickly resolve the conflicts

@djfhe
Copy link
Member Author

djfhe commented Nov 7, 2023

done @saibotk

@saibotk saibotk merged commit 8932c2f into main Nov 7, 2023
3 checks passed
@saibotk saibotk deleted the fix/type-declaration-file-location branch November 7, 2023 09:59
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.

Cannot find module '@clickbar/dot-diver' or its corresponding type declarations. ts(2307)
3 participants