Skip to content

Commit

Permalink
chore: upgrade chokidar
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Sep 23, 2024
1 parent 0c3f30e commit 77d6ded
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/giant-pots-bathe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/check": patch
---

Upgrades chokidar to v4
2 changes: 1 addition & 1 deletion packages/astro-check/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
},
"dependencies": {
"@astrojs/language-server": "^2.14.1",
"chokidar": "^3.5.3",
"chokidar": "^4.0.1",
"kleur": "^4.1.5",
"yargs": "^17.7.2"
},
Expand Down
8 changes: 6 additions & 2 deletions packages/astro-check/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ export async function check(flags: Partial<Flags>): Promise<boolean | void> {

if (flags.watch) {
function createWatcher(rootPath: string, extensions: string[]) {
return watch(`${rootPath}/**/*{${extensions.join(',')}}`, {
ignored: (ignoredPath) => ignoredPath.includes('node_modules'),
return watch(rootPath, {
ignored(pathStr, stats) {
if (pathStr.includes('node_modules') || pathStr.includes('.git')) return true;
if (stats?.isFile() && !extensions.includes(path.extname(pathStr))) return true;
return false;
},
ignoreInitial: true,
});
}
Expand Down
23 changes: 21 additions & 2 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 77d6ded

Please sign in to comment.