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

Added missing member used in UserManifest to define the manifest name. #1336

Closed
wants to merge 1 commit into from

Conversation

Permik
Copy link

@Permik Permik commented Jan 6, 2025

Hiya!

I was doing cursed things, like setting this project to run via Deno (successfully mind you!) and I came across a smol oversight in the typings, so I patched it up :)

Added the missing manifest name member when defining the manifest name via the wxt.config.ts manifest option.

Happy to take input if you have any!

Br
Permik

Added the missing manifest name member when defining the manifest name via the wxt.config.ts manifest option.
Copy link

netlify bot commented Jan 6, 2025

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit f9a814a
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/677b800b4f9d0500083ec47a
😎 Deploy Preview https://deploy-preview-1336--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.

@aklinker1
Copy link
Collaborator

Thanks for the PR, but the name property already has types... Are you not seeing a type for it?

@Permik
Copy link
Author

Permik commented Jan 8, 2025

Yeah, the member is not defined/suggested for the UserManifest type that the defineConfig consumes in wxt.config.ts. To note, it is a available indirectly as a member of the Function prototype path, but at least with Deno's LSP, the name member of the Function Object is not actively suggested as a valid member for the object.
This might just be a a Deno LSP shortcoming fwiw.

export default defineConfig({
  manifest: {
    ///
  },
});

@aklinker1
Copy link
Collaborator

I think this is related to Deno. I'll track under #1307. Could you share a reproduction?

@aklinker1 aklinker1 mentioned this pull request Jan 8, 2025
@Permik
Copy link
Author

Permik commented Jan 8, 2025

I'll look into this later today that how could I formulate a reproduction of this issue :D
More of a UX/DX thing, so defining a programmatic repro can be a bit challenging, but I'll see what I can do!

@aklinker1
Copy link
Collaborator

aklinker1 commented Jan 8, 2025

Ahh, so I actually have the same problem in my deno example from that issue. If I navigate to the definition of UserManifest, we see the problem:

Screenshot 2025-01-08 at 12 23 53 AM

If I run deno install @types/chrome and add a import "@types/chrome"; to the top of my wxt.config.ts file, it works:

import { defineConfig } from "wxt";
import denoJson from "./deno.json" with { type: "json" };
import "@types/chrome";

export default defineConfig({
  manifest: {
    name: "Deno Example",
    version: denoJson.version,
  },
});
Screenshot 2025-01-08 at 12 28 05 AM

This likely effects more than just the manifest types. It will effect all extension APIs in the upcoming v0.20 release... Hmm will need to consider a fix for this.

Thankfully, it appears adding that single import effectively adds the chrome global and it's types to all files in the project, so we don't have to add it individually.

@aklinker1
Copy link
Collaborator

aklinker1 commented Jan 8, 2025

So I'm gonna close this PR, it's definitely a deno-only thing, and this PR doesn't address the root problem.

@aklinker1 aklinker1 closed this Jan 8, 2025
@aklinker1
Copy link
Collaborator

I guess the fix is to simply configure the deno template correctly when the time comes. I don't think there will be anything specific to change in WXT's code.

@Permik Permik deleted the patch-1 branch January 8, 2025 06:40
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