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

Dotfiles cannot be included in the sources for Firefox #604

Closed
hikiko4ern opened this issue Apr 6, 2024 · 4 comments · Fixed by #674
Closed

Dotfiles cannot be included in the sources for Firefox #604

hikiko4ern opened this issue Apr 6, 2024 · 4 comments · Fixed by #674
Assignees
Labels
bug Something isn't working

Comments

@hikiko4ern
Copy link
Contributor

Describe the bug

Dotfiles cannot be included in a sources.zip using includeSources (added in #378) after the changes made in #501: **/* passed to fast-glob doesn't match dotfiles without dot: true, so includeSources doesn't actually affect anything

await glob('**/*', {

To Reproduce

wxt-zip-env.zip

  1. Install dependencies: pnpm i
  2. Create sources zip: pnpm zip:firefox
  3. Check if .env file is included in .output/wxt-starter-0.0.0-sources.zip

If you downgrade wxt to 0.17.4, .env file will be included in sources.zip

Expected behavior

The dotfiles specified in includeSources must be included in sources.zip

Environment

System:
  OS: Linux 5.15 Debian GNU/Linux trixie/sid
  CPU: (32) x64 AMD Ryzen 9 7950X3D 16-Core Processor
  Memory: 56.33 GB / 64.76 GB
  Container: Yes
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 20.12.1 - /mnt/wslg/runtime-dir/fnm_multishells/32306_1712432100305/bin/node
  Yarn: 4.1.1 - /mnt/wslg/runtime-dir/fnm_multishells/32306_1712432100305/bin/yarn
  npm: 10.5.0 - /mnt/wslg/runtime-dir/fnm_multishells/32306_1712432100305/bin/npm
  pnpm: 8.15.6 - /mnt/wslg/runtime-dir/fnm_multishells/32306_1712432100305/bin/pnpm
  bun: 1.1.2 - ~/.bun/bin/bun
Browsers:
  Chrome: 123.0.6312.86
  Chromium: 122.0.6261.57
npmPackages:
  wxt: ^0.17.12 => 0.17.12

Additional context

Since includeSources are already globs, perhaps it is enough to just add them to the glob sources?

await glob(['**/*', ...(options?.include || [])], {

However, I'm not sure why options.include is passed to zipDir

wxt/src/core/zip.ts

Lines 63 to 65 in 6b72f88

await zipDir(wxt.config.zip.sourcesRoot, sourcesZipPath, {
include: wxt.config.zip.includeSources,
exclude: wxt.config.zip.excludeSources,

but actually wxt.config.zip.includeSources is used instead

wxt/src/core/zip.ts

Lines 110 to 113 in 6b72f88

wxt.config.zip.includeSources.some((pattern) =>
minimatch(relativePath, pattern),
) ||
!wxt.config.zip.excludeSources.some((pattern) =>

@hikiko4ern hikiko4ern added the pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug label Apr 6, 2024
@aklinker1
Copy link
Collaborator

However, I'm not sure why options.include is passed to zipDir. but actually wxt.config.zip.includeSources is used instead

This is probably a bug... I'll fix that at the same time.

@aklinker1 aklinker1 added bug Something isn't working and removed pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug labels May 25, 2024
@aklinker1 aklinker1 self-assigned this May 25, 2024
@aklinker1
Copy link
Collaborator

Released in v0.18.4

@aklinker1
Copy link
Collaborator

Reverted in v0.18.7, causing issues with directories.

@aklinker1 aklinker1 reopened this Jun 17, 2024
hikiko4ern added a commit to hikiko4ern/wxt that referenced this issue Aug 4, 2024
@aklinker1
Copy link
Collaborator

Implemented correctly in #902

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants