Open hikiko4ern opened 2 months ago
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 https://github.com/wxt-dev/wxt/blob/6b72f883b6c9407804240efe5b10a8967f62c753/src/core/zip.ts#L102
sources.zip
includeSources
**/*
fast-glob
dot: true
wxt-zip-env.zip
pnpm i
pnpm zip:firefox
.env
.output/wxt-starter-0.0.0-sources.zip
If you downgrade wxt to 0.17.4, .env file will be included in sources.zip
wxt
0.17.4
The dotfiles specified in includeSources must be included in sources.zip
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
Since includeSources are already globs, perhaps it is enough to just add them to the glob sources?
glob
await glob(['**/*', ...(options?.include || [])], {
However, I'm not sure why options.include is passed to zipDir https://github.com/wxt-dev/wxt/blob/6b72f883b6c9407804240efe5b10a8967f62c753/src/core/zip.ts#L63-L65 but actually wxt.config.zip.includeSources is used instead https://github.com/wxt-dev/wxt/blob/6b72f883b6c9407804240efe5b10a8967f62c753/src/core/zip.ts#L110-L113
options.include
zipDir
wxt.config.zip.includeSources
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.
Released in v0.18.4
v0.18.4
Reverted in v0.18.7, causing issues with directories.
v0.18.7
Describe the bug
Dotfiles cannot be included in a
sources.zip
usingincludeSources
(added in #378) after the changes made in #501:**/*
passed tofast-glob
doesn't match dotfiles withoutdot: true
, soincludeSources
doesn't actually affect anything https://github.com/wxt-dev/wxt/blob/6b72f883b6c9407804240efe5b10a8967f62c753/src/core/zip.ts#L102To Reproduce
wxt-zip-env.zip
pnpm i
pnpm zip:firefox
.env
file is included in.output/wxt-starter-0.0.0-sources.zip
If you downgrade
wxt
to0.17.4
,.env
file will be included insources.zip
Expected behavior
The dotfiles specified in
includeSources
must be included insources.zip
Environment
Additional context
Since
includeSources
are already globs, perhaps it is enough to just add them to theglob
sources?However, I'm not sure why
options.include
is passed tozipDir
https://github.com/wxt-dev/wxt/blob/6b72f883b6c9407804240efe5b10a8967f62c753/src/core/zip.ts#L63-L65 but actuallywxt.config.zip.includeSources
is used instead https://github.com/wxt-dev/wxt/blob/6b72f883b6c9407804240efe5b10a8967f62c753/src/core/zip.ts#L110-L113