Skip to content

chore(deps): replace picomatch with path - #2559

Closed
suveshmoza wants to merge 1 commit into
wxt-dev:mainfrom
suveshmoza:node-path
Closed

chore(deps): replace picomatch with path#2559
suveshmoza wants to merge 1 commit into
wxt-dev:mainfrom
suveshmoza:node-path

Conversation

@suveshmoza

Copy link
Copy Markdown
Contributor

Overview

Replace picomatch(93KB) with Node's path.matchesGlob.

Manual Testing

bun run --filter wxt test -- run src/core/utils/building/__tests__/find-entrypoints.test.ts

Related Issue

#2523

@suveshmoza
suveshmoza requested a review from aklinker1 as a code owner August 1, 2026 21:39
@netlify

netlify Bot commented Aug 1, 2026

Copy link
Copy Markdown

Deploy Preview for creative-fairy-df92c4 ready!

Name Link
🔨 Latest commit 3ac66e9
🔍 Latest deploy log https://app.netlify.com/projects/creative-fairy-df92c4/deploys/6a6ed7c58eef7d0009a01054
😎 Deploy Preview https://deploy-preview-2559--creative-fairy-df92c4.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions github-actions Bot added the pkg/wxt Includes changes to the `packages/wxt` directory label Aug 1, 2026
const name = getEntrypointName(wxt.config.entrypointsDir, inputPath);
const matchingGlob = pathGlobs.find((glob) =>
picomatch(glob)(relativePath),
path.matchesGlob(relativePath, glob),

@aklinker1 aklinker1 Aug 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

@suveshmoza suveshmoza Aug 2, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can go yolo ;) considering that the LTS version of Node V22 is v22.23.2. Regex approach seems doable

@pkg-pr-new

pkg-pr-new Bot commented Aug 8, 2026

Copy link
Copy Markdown

Open in StackBlitz

@wxt-dev/analytics

npm i https://pkg.pr.new/@wxt-dev/analytics@2559

@wxt-dev/auto-icons

npm i https://pkg.pr.new/@wxt-dev/auto-icons@2559

@wxt-dev/browser

npm i https://pkg.pr.new/@wxt-dev/browser@2559

@wxt-dev/i18n

npm i https://pkg.pr.new/@wxt-dev/i18n@2559

@wxt-dev/is-background

npm i https://pkg.pr.new/@wxt-dev/is-background@2559

@wxt-dev/module-react

npm i https://pkg.pr.new/@wxt-dev/module-react@2559

@wxt-dev/module-solid

npm i https://pkg.pr.new/@wxt-dev/module-solid@2559

@wxt-dev/module-svelte

npm i https://pkg.pr.new/@wxt-dev/module-svelte@2559

@wxt-dev/module-vue

npm i https://pkg.pr.new/@wxt-dev/module-vue@2559

@wxt-dev/runner

npm i https://pkg.pr.new/@wxt-dev/runner@2559

@wxt-dev/storage

npm i https://pkg.pr.new/@wxt-dev/storage@2559

@wxt-dev/unocss

npm i https://pkg.pr.new/@wxt-dev/unocss@2559

@wxt-dev/webextension-polyfill

npm i https://pkg.pr.new/@wxt-dev/webextension-polyfill@2559

wxt

npm i https://pkg.pr.new/wxt@2559

commit: 3ac66e9

@codecov

codecov Bot commented Aug 8, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 79.34%. Comparing base (d7bcf6c) to head (3ac66e9).
⚠️ Report is 3 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@aklinker1

aklinker1 commented Aug 8, 2026

Copy link
Copy Markdown
Member

Hmm, let's hold off on this one for now - I don't want to yolo it when there are 5 other packages using it. So it's still going to be installed until we get rid of the other dependencies. So this one can wait.

Screenshot 2026-08-08 at 11 43 47 AM

Engines:

@1natsu/wait-element                       4.1.2        -
@aklinker1/rollup-plugin-visualizer        5.12.0       >=14
@aklinker1/zero-zip                        1.0.1        -
@topcli/prompts                            4.0.0        >=22.0.0
@webext-core/fake-browser                  2.0.1        *
@webext-core/isolated-element              3.0.0        *
@webext-core/match-patterns                2.0.0        *
@wxt-dev/browser                           0.2.5        -
@wxt-dev/storage                           1.2.9        -
c12                                        3.3.4        -
cac                                        7.0.0        >=20.19.0
chokidar                                   5.0.0        >= 20.19.0
consola                                    3.4.2        ^14.18.0 || >=16.10.0
defu                                       6.1.7        -
dotenv-expand                              13.0.0       >=12
filesize                                   11.0.17      >= 10.8.0
get-port-please                            3.2.0        -
giget                                      3.2.0        -
hookable                                   6.1.0        -
json5                                      2.2.3        >=6
linkedom                                   0.18.12      >=16
magicast                                   0.5.2        -
nanospinner                                1.2.2        -
nypm                                       0.6.5        >=18
picomatch                                  4.0.5        >=12
publish-browser-extension                  5.1.0        >=18.0.0
superlock                                  1.3.2        >= 14
tiny-open                                  1.3.0        -
tinyexec                                   1.2.4        >=18
tinyglobby                                 0.2.17       >=12.0.0
unimport                                   5.6.0        >=18.12.0

@suveshmoza

Copy link
Copy Markdown
Contributor Author

Yeah, makes sense

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg/wxt Includes changes to the `packages/wxt` directory

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants