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: exclude files in .zip except those with a bang ! #1517

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

nishu-murmu
Copy link
Contributor

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

Copy link

netlify bot commented Mar 16, 2025

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 628af36
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/67f807d8cc7d4e00081bb4ac
😎 Deploy Preview https://deploy-preview-1517--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.

@nishu-murmu nishu-murmu changed the title feat: exclude files in .zip except those with a bang ! fix: exclude files in .zip except those with a bang ! Mar 16, 2025
@nishu-murmu
Copy link
Contributor Author

Do I need to add some test cases for these fix?

Copy link
Collaborator

@aklinker1 aklinker1 left a 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

Comment on lines 19 to 22
exclude: [
'**/*.json', // Exclude all .json files
'!manifest.json', // Include manifest.json
],
Copy link
Collaborator

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

@nishu-murmu nishu-murmu Apr 10, 2025

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.
WindowsTerminal_lANMUO72n7

Copy link
Contributor Author

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.

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.

Exclude files in .zip except those with a bang !
3 participants