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

Fix types & typings fields #562

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Andarist
Copy link
Member

closes #259

@changeset-bot
Copy link

changeset-bot bot commented May 29, 2023

🦋 Changeset detected

Latest commit: 27ce8de

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@preconstruct/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@Andarist Andarist requested a review from emmatown May 29, 2023 09:46
@codecov
Copy link

codecov bot commented May 29, 2023

Codecov Report

Patch coverage: 100.00% and project coverage change: -0.02 ⚠️

Comparison is base (a58f021) 92.19% compared to head (333a948) 92.17%.

❗ Current head 333a948 differs from pull request most recent head 27ce8de. Consider uploading reports for the commit 27ce8de to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #562      +/-   ##
==========================================
- Coverage   92.19%   92.17%   -0.02%     
==========================================
  Files          40       40              
  Lines        1973     1981       +8     
  Branches      582      582              
==========================================
+ Hits         1819     1826       +7     
- Misses        144      145       +1     
  Partials       10       10              
Impacted Files Coverage Δ
packages/cli/src/entrypoint.ts 100.00% <ø> (ø)
packages/cli/src/messages.ts 83.33% <ø> (ø)
packages/cli/src/fix.ts 100.00% <100.00%> (ø)
packages/cli/src/package.ts 96.07% <100.00%> (ø)
packages/cli/src/utils.ts 98.65% <100.00%> (+0.01%) ⬆️
packages/cli/src/validate.ts 88.76% <100.00%> (+0.52%) ⬆️

... and 1 file with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@emmatown emmatown left a comment

Choose a reason for hiding this comment

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

I agree with the problem we're solving here but this would break for users who are say writing .d.ts files themselves not next to their .js sources and using the types field to point to it. I have some ideas on how to solve this problem (and some related ones) without causing more problems, I'll come back to this when I have a more concrete plan

@Andarist
Copy link
Member Author

Andarist commented Jun 3, 2023

Isn't the fix here to just do this when we have TS entrypoints?

@emmatown
Copy link
Member

emmatown commented Jun 3, 2023

yeah, that should work (and it should also be per-entrypoint unlike the other fields)

do you happen to know why both the typings and types fields exist? I assume some compatibility reason? I'm wondering which one was first? is there a difference in what they do? was there a difference before but there no longer is?

@Andarist
Copy link
Member Author

Andarist commented Jun 5, 2023

Unfortunately, I don't know why both of those exist. types is definitely way more popular.

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.

Validate that types field is on a TypeScript entrypoint (behind a flag)
2 participants