chore(deps): replace picomatch with path - #2559
Conversation
✅ Deploy Preview for creative-fairy-df92c4 ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| const name = getEntrypointName(wxt.config.entrypointsDir, inputPath); | ||
| const matchingGlob = pathGlobs.find((glob) => | ||
| picomatch(glob)(relativePath), | ||
| path.matchesGlob(relativePath, glob), |
There was a problem hiding this comment.
Looks like this was introduced in v22.5.0... WXT's engine is set to >=22, so this is technically incompatible...
https://nodejs.org/api/path.html#pathmatchesglobpath-pattern
What about using regex instead? The mapping is very simple, maybe we change the PATH_GLOB_TO_TYPE_MAP to an array of tuples?
const PATH_GLOB_TO_TYPE_MAP: Array<[pattern: string | RegExp, type: Entrypoint['type']]> = {
['sandbox.html', 'sandbox'],
['sandbox/index.html', 'sandbox'],
[/.*\.sandbox\.html/, 'sandbox'],
// ...
}Or do we just yolo it and assume no one is using node 22.0-22.4?
There was a problem hiding this comment.
We can go yolo ;) considering that the LTS version of Node V22 is v22.23.2. Regex approach seems doable
@wxt-dev/analytics
@wxt-dev/auto-icons
@wxt-dev/browser
@wxt-dev/i18n
@wxt-dev/is-background
@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 Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #2559 +/- ##
==========================================
+ Coverage 79.31% 79.34% +0.02%
==========================================
Files 134 134
Lines 3994 3994
Branches 921 921
==========================================
+ Hits 3168 3169 +1
Misses 731 731
+ Partials 95 94 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Yeah, makes sense |

Overview
Replace
picomatch(93KB) with Node'spath.matchesGlob.Manual Testing
bun run --filter wxt test -- run src/core/utils/building/__tests__/find-entrypoints.test.tsRelated Issue
#2523