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: Properly overload import.meta.env with WXT's own environment globals #966

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

1natsu172
Copy link
Contributor

@1natsu172 1natsu172 commented Sep 3, 2024

fix #935

I copied vite's implement style https://github.com/vitejs/vite/blob/main/packages/vite/types/importMeta.d.ts. It seems that module augmentation is not allowed because import is a top-level scope.

TS docs:

You can’t declare new top-level declarations in the augmentation — just patches to existing declarations.

completion screenshot
image

Copy link

netlify bot commented Sep 3, 2024

Deploy Preview for creative-fairy-df92c4 ready!

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

Merged this PR with main to fix the checks as well.

Copy link

codecov bot commented Sep 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 81.90%. Comparing base (87fbb1f) to head (e51d2ac).
Report is 6 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #966      +/-   ##
==========================================
- Coverage   81.90%   81.90%   -0.01%     
==========================================
  Files         125      125              
  Lines        6605     6604       -1     
  Branches     1100     1100              
==========================================
- Hits         5410     5409       -1     
  Misses       1181     1181              
  Partials       14       14              

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

@1natsu172 1natsu172 force-pushed the fix-type-declaration branch from a00ce4a to 99bbb93 Compare September 3, 2024 17:34
@1natsu172 1natsu172 force-pushed the fix-type-declaration branch from 99bbb93 to e51d2ac Compare September 3, 2024 17:36
@1natsu172
Copy link
Contributor Author

Haha, I missed the local rebase but it's maybe ok now 😅

@1natsu172 1natsu172 requested a review from aklinker1 September 3, 2024 17:40
@aklinker1 aklinker1 changed the title fix: overload wxt's import.meta.env types fix: Properly overload import.meta.env with WXT's own environment globals Sep 3, 2024
@aklinker1 aklinker1 merged commit c143a99 into wxt-dev:main Sep 3, 2024
16 checks passed
@1natsu172 1natsu172 deleted the fix-type-declaration branch November 15, 2024 18:51
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.

WXT specific import.meta.env constants not showing up in editor
2 participants