Skip to content

Commit 8743af2

Browse files
committed
Unifying SKIP_DIRS and HIDE_FILES
1 parent aa154a7 commit 8743af2

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

packages/update/src/update.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,8 @@ export const FRESH_VERSION = "2.2.0";
1111
export const PREACT_VERSION = "10.27.2";
1212
export const PREACT_SIGNALS_VERSION = "2.5.0";
1313

14-
// Function to filter out node_modules and vendor directories from logs
15-
const HIDE_FILES = /[\\/]+(node_modules|vendor)[\\/]+/;
16-
// Directories we should completely skip when walking the tree. This keeps us
17-
// from loading vendored dependencies (often thousands of files) into ts-morph.
14+
// Paths we never want to process or surface in logs. Used both for walking the
15+
// tree (skip) and for hiding vendor-ish paths from user-facing summaries.
1816
const SKIP_DIRS =
1917
/(?:[\\/]\.[^\\/]+(?:[\\/]|$)|[\\/](node_modules|vendor|docs|\.git|\.next|\.turbo|_fresh|dist|build|target|\.cache)(?:[\\/]|$))/;
2018
export interface DenoJson {
@@ -189,7 +187,7 @@ export async function updateProject(dir: string) {
189187
})
190188
) {
191189
filesToProcess.push(entry.path);
192-
if (!HIDE_FILES.test(entry.path)) userFileCount++;
190+
if (!SKIP_DIRS.test(entry.path)) userFileCount++;
193191
}
194192
const totalFiles = filesToProcess.length;
195193

@@ -245,7 +243,7 @@ export async function updateProject(dir: string) {
245243

246244
// Filter modified files to show only user files
247245
const modifiedFilesToShow = modifiedFilesList.filter((filePath) =>
248-
!HIDE_FILES.test(filePath)
246+
!SKIP_DIRS.test(filePath)
249247
);
250248
const unmodifiedCount = Math.max(
251249
userFileCount - modifiedFilesToShow.length,

0 commit comments

Comments
 (0)