Skip to content

Fix types & typings fields - #562

Open
Andarist wants to merge 1 commit into
preconstruct:mainfrom
Andarist:fix-types-fields
Open

Andarist wants to merge 1 commit into
preconstruct:mainfrom
Andarist:fix-types-fields

Conversation

@Andarist

Copy link
Copy Markdown
Member

closes #259

@changeset-bot

changeset-bot Bot commented May 29, 2023

Copy link
Copy Markdown

🦋 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

codecov Bot commented May 29, 2023

Copy link
Copy Markdown

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.

@emmatown emmatown left a comment •

Copy link
Copy Markdown
Member

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

Andarist commented Jun 3, 2023

Copy link
Copy Markdown
Member Author

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

@emmatown

emmatown commented Jun 3, 2023

Copy link
Copy Markdown
Member

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

Andarist commented Jun 5, 2023

Copy link
Copy Markdown
Member Author

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

This branch has not been deployed

No deployments
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