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

Combine exported types into one file #140

Merged
merged 13 commits into from
Apr 21, 2024
Merged

Combine exported types into one file #140

merged 13 commits into from
Apr 21, 2024

Conversation

meduzen
Copy link
Owner

@meduzen meduzen commented Apr 21, 2024

Closes #93.

  • test result of found types using Typedoc (before and after changes): it should get rid of unwanted types unneeded
  • try the project (link locally) (before/after) and compare DX

@meduzen meduzen added the documentation Improvements or additions to documentation label Apr 21, 2024
@meduzen meduzen self-assigned this Apr 21, 2024
Copy link

github-actions bot commented Apr 21, 2024

size-limit report 📦

Path Size
datetime 601 B (0%)
utc 605 B (0%)
datetimeTz 874 B (0%)
duration 244 B (0%)
tzOffset 313 B (0%)
setTimeSeparator 125 B (0%)
setTzConfig 181 B (0%)
setTzInRealWorldRange 196 B (0%)
setTzSeparator 194 B (0%)
daysBetween 68 B (0%)
weekNumber 144 B (0%)
DateTime 661 B (0%)
All modules (import *) 1.3 KB (0%)

@meduzen
Copy link
Owner Author

meduzen commented Apr 21, 2024

Testing in a TS project:

datetime-attribute 1.3.4

  • doesn’t export all types from its root, but from their sub-path: import type { Precision } from 'datetime-attribute/types/datetime'
  • exports a non-existing type from an internal function that is not exported: import type { round } from 'datetime-attribute/types/utils/math' (code)
  • properly exposes the exposed functions

datetime-attribute with this PR (using npm link) solves all previous problems and properly exposes the right stuff. It also exposes all the package source files because of npm link.

But in a JS project, the types import is not working anymore with this PR using /** @type {import('datetime-attribute').Precision} */. Following 148607b it works again.

Gonna do a pre-release later to test it from a package registry.

@meduzen meduzen marked this pull request as ready for review April 21, 2024 21:27
@meduzen
Copy link
Owner Author

meduzen commented Apr 21, 2024

Gonna do a pre-release later to test it from a package registry.

Seems to be the right shot according to test done with 1.4.0-rc.0.

@meduzen meduzen merged commit ebe4c52 into main Apr 21, 2024
5 checks passed
@meduzen meduzen deleted the combine-types branch April 21, 2024 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Combine types output
1 participant