-
-
Notifications
You must be signed in to change notification settings - Fork 329
fix: Support negation patterns when including/excluding files from ZIP files #1517
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
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Do I need to add some test cases for these fix? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR! We need to add some tests around these changes:
https://github.com/wxt-dev/wxt/blob/main/packages/wxt/e2e/tests/zip.test.ts
…o fix/zip-exclude-bang
packages/wxt-demo/wxt.config.ts
Outdated
exclude: [ | ||
'**/*.json', // Exclude all .json files | ||
'!manifest.json', // Include manifest.json | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hold on, I'm looking at this code now, and based on the old logic:
options?.include?.some((pattern) => minimatch(relativePath, pattern)) || !options?.exclude?.some((pattern) => minimatch(relativePath, pattern))
Couldn't you have just added mainfest.json
to include
, since include
has priority over exclude
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, but original issue was to include this negate feature in exclude parameter. Maybe you can explain this to @skube.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps I'm not understanding something, but I don't see an include
option under the zip property.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, there isn't.
@aklinker1 that options.includes you're mentioning is taking includeSources
that is different option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a test case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, duh 👍
Sorry for the slowness, I got caught up in responding to new PRs and issues, so I lost track of this one. We'll get this merged and released now! Gonna merge with main, checks aren't running how they should be... |
@wxt-dev/analytics
@wxt-dev/auto-icons
@wxt-dev/browser
@wxt-dev/i18n
@wxt-dev/module-react
@wxt-dev/module-solid
@wxt-dev/module-svelte
@wxt-dev/module-vue
@wxt-dev/runner
@wxt-dev/storage
@wxt-dev/unocss
@wxt-dev/webextension-polyfill
wxt
commit: |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1517 +/- ##
==========================================
+ Coverage 80.98% 81.14% +0.15%
==========================================
Files 129 130 +1
Lines 6627 6649 +22
Branches 1080 1090 +10
==========================================
+ Hits 5367 5395 +28
+ Misses 1249 1243 -6
Partials 11 11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
One more change, I'm gonna extract this to a function and use it for both |
Thanks for helping make WXT better! |
Overview
This is issue reproduction repo: https://github.com/skube/min-repro-wxt
Here is the discussion about creating this PR and more context.
#1510 (comment)
This PR closes #1510
Edit from @aklinker1: You can now do things like this when zipping the extension and source code: