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: fix config manifest type #973

Merged
merged 2 commits into from
Sep 10, 2024
Merged

Conversation

hikiko4ern
Copy link
Contributor

This PR fixes types from #969

Because Chrome's manifest types have an index signature [key: string]: any, Omit<chrome.runtime.ManifestV3, ...> becomes

{
  [x: string]: any;
  [x: number]: any;
}

and only the added properties remain in UserManifest

Copy link

netlify bot commented Sep 6, 2024

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 691699a
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/66db9b2f374478000820bfcf
😎 Deploy Preview https://deploy-preview-973--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@hikiko4ern
Copy link
Contributor Author

hikiko4ern commented Sep 7, 2024

Hmm, some test types are not compatible with the new Chrome types, with some of the types being stricter. For example, permissions allows to pass only permissions
https://github.com/DefinitelyTyped/DefinitelyTyped/blob/d27d2e402326d17b9ca12a7030ff2f709ec57162/types/chrome/index.d.ts#L7377-L7451
while not allowing hosts like *://google.com/*

Copy link
Collaborator

@aklinker1 aklinker1 left a comment

Choose a reason for hiding this comment

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

Haha interesting that that works but omit doesnt

Copy link

codecov bot commented Sep 7, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.70%. Comparing base (fbe502f) to head (691699a).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #973      +/-   ##
==========================================
- Coverage   82.25%   81.70%   -0.55%     
==========================================
  Files         125      125              
  Lines        6604     6604              
  Branches     1104     1098       -6     
==========================================
- Hits         5432     5396      -36     
- Misses       1158     1194      +36     
  Partials       14       14              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@hikiko4ern
Copy link
Contributor Author

that works but omit doesnt

fwiw: this is because Omit works by removing keys from keyof T (and keyof T becomes too wide string | number when index signatures are present; here's a short example of how this unfolds), but mapped types, roughly speaking, handle each key separately (in the example it's first a, then b, then the index signature), so keys are not widened

@aklinker1
Copy link
Collaborator

Interesting, thanks for sharing! Learn something new every day lol

@aklinker1 aklinker1 merged commit c94168e into wxt-dev:main Sep 10, 2024
16 checks passed
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.

2 participants