Skip to content

feat(zip)!: add includeSources and rename ignoredSources to excludeSources#378

Merged
aklinker1 merged 5 commits intowxt-dev:mainfrom
nonwip:main
Jan 29, 2024
Merged

feat(zip)!: add includeSources and rename ignoredSources to excludeSources#378
aklinker1 merged 5 commits intowxt-dev:mainfrom
nonwip:main

Conversation

@nonwip
Copy link
Copy Markdown
Contributor

@nonwip nonwip commented Jan 27, 2024

This PR resolves #377

I am not sure is there a way to contact you somehow? Maybe Discord?
Cause I'd like to learn if there's an easy way to test the source changes locally?

For this PR I did pnpm run build and then I linked from my test project the wxt source using pnpm link ../wxt

@netlify
Copy link
Copy Markdown

netlify bot commented Jan 27, 2024

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 065435d
🔍 Latest deploy log https://app.netlify.com/sites/creative-fairy-df92c4/deploys/65b7dacc66a5e70008c2d7db
😎 Deploy Preview https://deploy-preview-378--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
Copy Markdown
Member

aklinker1 commented Jan 28, 2024

I don't want to include .env files in the ZIP... They usually contain secrets that shouldn't be shared.

Instead, we should include a new option, zip.include, where people can setup files they want to include in the zip in addition to the default files.

Alternatively, we could ignore .env files while running pnpm zip. This solution doesn't sit well with me, since sometimes .env files are used to configure the actual build.

This is less of a problem when building in CI, where .env files are generally not present, but could still potentially be a problem there too.

@aklinker1
Copy link
Copy Markdown
Member

I am not sure is there a way to contact you somehow? Maybe Discord?

Hmm, I have a discord, but I don't have notifications on, and I haven't opened it for 2 years. I don't like being overran by notifications. I'd prefer just starting a discussion on github, but maybe I should make a discord channel for WXT, it's pretty common for libraries to do that...

@aklinker1
Copy link
Copy Markdown
Member

I'd like to learn if there's an easy way to test the source changes locally?

The easiest way to test the app is by recreating the issue in the demo/ folder, and testing there. Once it's working there, to test in a real project, I run pnpm pack to get a tarball, then I copy it into the project, and install the tarball.

@nonwip
Copy link
Copy Markdown
Contributor Author

nonwip commented Jan 28, 2024

Hmmm, is there part of WXT that can be used for server-side parts? If not, I do not see a problem of an .env being zipped for review team, since it all ends up bundled in the code anyways.

Even if there was a scenario that someone would commit the .env file to the repo, if it's all client-side code, it's not considered a secret.

@aklinker1
Copy link
Copy Markdown
Member

Even if there was a scenario that someone would commit the .env file to the repo, if it's all client-side code, it's not considered a secret.

@dvlden I use .env files to store default login credentials for development, like a GitHub personal access token:

https://github.com/aklinker1/github-better-line-counts/blob/552a0db045fbf0159bb13e068938c65dc9feff74/src/utils/storage.ts#L22-L24

@nonwip
Copy link
Copy Markdown
Contributor Author

nonwip commented Jan 29, 2024

Ouch, I see... In that case, your idea to have includes as an option sounds good to me.

Let me know if this is something that you'd let me try to implement? Cause it's similar to excludes, just opposite.

@aklinker1
Copy link
Copy Markdown
Member

Yeah, if you want to give it a go, that'd be great!

Nenad Novakovic added 2 commits January 29, 2024 16:34
…o to exclude-sources

Also rename ignoredSources to excludedSources for easier mind mapping.
@nonwip
Copy link
Copy Markdown
Contributor Author

nonwip commented Jan 29, 2024

I did not come across any tests for this? I thought it may break, since I renamed ignoredSources, but no failing tests.

Where do I update documentation? Is that inferred from DocBlock?
EDIT: Nvm just read the CONTRIBUTING.md

What do you think about it? I tested in demo dir and my project and it seems to work.

@nonwip nonwip changed the title fix: include .env* files in source zip feat(zip)!: add includedSources and rename ignoredSources to excludedSources Jan 29, 2024
Copy link
Copy Markdown
Member

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

Looks good, could of small changes.

I did not come across any tests for this? I thought it may break, since I renamed ignoredSources, but no failing tests.

No, there are no tests for this right now

Where do I update documentation? Is that inferred from DocBlock?
EDIT: Nvm just read the CONTRIBUTING.md

Yup, any JSDoc is automatically updated on the website. I'll add an explicit note to the CONTRIBUTING.md file

Co-authored-by: Aaron <aaronklinker1@gmail.com>
@nonwip nonwip changed the title feat(zip)!: add includedSources and rename ignoredSources to excludedSources feat(zip)!: add includeSources and rename ignoredSources to excludeSources Jan 29, 2024
Copy link
Copy Markdown
Member

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

Nice, thanks 👍 I'll get this released soon.

@codecov
Copy link
Copy Markdown

codecov bot commented Jan 29, 2024

Codecov Report

Attention: 10 lines in your changes are missing coverage. Please review.

Comparison is base (62ecb6f) 80.41% compared to head (065435d) 80.34%.
Report is 4 commits behind head on main.

Files Patch % Lines
src/core/zip.ts 0.00% 8 Missing ⚠️
src/types/internal.ts 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #378      +/-   ##
==========================================
- Coverage   80.41%   80.34%   -0.08%     
==========================================
  Files         104      104              
  Lines        7528     7552      +24     
  Branches      681      682       +1     
==========================================
+ Hits         6054     6068      +14     
- Misses       1458     1468      +10     
  Partials       16       16              

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

@aklinker1 aklinker1 merged commit 2dcdae9 into wxt-dev:main Jan 29, 2024
@nonwip
Copy link
Copy Markdown
Contributor Author

nonwip commented Jan 29, 2024

Nice, thanks 👍 I'll get this released soon.

Glad to be of any help. Looking forward to more contributions. If you get something that you think I could resolve in this large project's codebase, feel free to assign me.

Really need this to get through Firefox approvals.

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.

Chunk hashes change when building from sources ZIP for Firefox Review

2 participants