crxjs / chrome-extension-tools

Bundling Chrome Extensions can be pretty complex. It doesn't have to be.
https://crxjs.dev/vite-plugin
2.93k stars 190 forks source link

Manifest `author` Field Wrongly Typed #824

Closed Malix-Labs closed 4 months ago

Malix-Labs commented 1 year ago

Build tool

Vite

Describe the bug

https://github.com/crxjs/chrome-extension-tools/blob/20faa1590032ef90b4588dea06ca7610a4483248/packages/vite-plugin/src/node/manifest.ts#L43 typing doesn't match its documentation

Severity

annoyance

JoeyDoey commented 7 months ago

Big CRX fan! Came to post the same. Maybe CRX can inherit from @types/chrome and union/extend those types to include the Firefox and additional fields? That way types stay up to date/accurate.

Author field @types/chrome

https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/chrome/index.d.ts#L7398-L7400

 author?: {
            email: string;
        } | undefined;

Author field CRX

https://github.com/crxjs/chrome-extension-tools/blob/main/packages/vite-plugin/src/node/manifest.ts#L43

author?: string | undefined
hchangjae commented 4 months ago

Any updates yet?

Malix-Labs commented 4 months ago

Well I guess I will file a pull request today then

Malix-Labs commented 4 months ago

Update: This was valid in Manifest V2: https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/manifest.json/author

Malix-Labs commented 4 months ago

@JoeyDoey:

Maybe CRX can inherit from @types/chrome and union/extend those types to include the Firefox and additional fields? That way types stay up to date/accurate.

Yes, that would be the best thing to do

I have opened a feature request about it, see #903