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

Improve typing of manifest config #521

Closed
aklinker1 opened this issue Mar 3, 2024 · 5 comments · Fixed by #969
Closed

Improve typing of manifest config #521

aklinker1 opened this issue Mar 3, 2024 · 5 comments · Fixed by #969
Labels
Milestone

Comments

@aklinker1
Copy link
Collaborator

Feature Request

Instead of using webextension-polyfill's Manifest.WebExtensionManifest type, implement our own that works for both Chrome and firefox, as well as MV2 and MV3.

Is your feature request related to a bug?

N/A

What are the alternatives?

TS ignoring things everywhere.

Additional context

Realized the types weren't good enough in #518

@aklinker1 aklinker1 added this to the v1.0 milestone Mar 3, 2024
@pavitra-infocusp
Copy link

Missing manifest.key property type on wxt.config.ts. It works though.

Object literal may only specify known properties, and 'key' does not exist in type 'Partial<Omit<WebExtensionManifest, "background" | "chrome_url_overrides" | "devtools_page" | "manifest_version" | "options_page" | "options_ui" | "sandbox">> | Promise<...> | UserManifestFn'.ts(2353)
index-l43sonfW.d.ts(227, 5): The expected type comes from property 'manifest' which is declared here on type 'UserConfig'
(property) key: string

@trinhcanhphuc
Copy link

any solution for this issue ? :(

@aklinker1
Copy link
Collaborator Author

aklinker1 commented Mar 8, 2024

Writing 1000 lines of types takes time. Its a WIP

Just use // @ts-expect-error

@aklinker1
Copy link
Collaborator Author

aklinker1 commented Aug 16, 2024

Update, after adding support for @types/chrome via extensionApi: "chrome" (see #868), I'm planning on migrating the manifest type to @types/chrome as well. Need to review it's types to see how well it supports Firefox-only fields.

@aklinker1
Copy link
Collaborator Author

Released in v0.19.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants