Skip to content

Improve typing of manifest config #521

Closed

Description

@aklinker1

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

Activity

  1. added this to the v1.0 milestone on Mar 3, 2024
  2. pavitra-infocusp commented on Mar 5, 2024

    @pavitra-infocusp

    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
    
  3. trinhcanhphuc commented on Mar 8, 2024

    @trinhcanhphuc

    any solution for this issue ? :(

  4. aklinker1 commented on Mar 8, 2024

    @aklinker1
    MemberAuthor

    Writing 1000 lines of types takes time. Its a WIP

    Just use // @ts-expect-error

  5. aklinker1 commented on Aug 16, 2024

    @aklinker1
    MemberAuthor

    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.

  6. aklinker1 commented on Sep 6, 2024

    @aklinker1
    MemberAuthor

    Released in v0.19.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions