Skip to content

Commit

Permalink
fix: remove node_modules/. from ignored paths
Browse files Browse the repository at this point in the history
  • Loading branch information
thesayyn committed Oct 29, 2022
1 parent 53b1ee1 commit a24b2be
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
12 changes: 11 additions & 1 deletion e2e/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@
"@nestjs/common": "^9.0.8",
"rxjs": "^7.5.6",
"reflect-metadata": "^0.1.13",
"@types/node": "^18.6.3"
"@types/node": "^18.6.3",
"@open-wc/testing-helpers": "2.1.3"
},
"pnpm": {
"packageExtensions": {
"@open-wc/testing-helpers": {
"dependencies": {
"@open-wc/dedupe-mixin": "1.3.1"
}
}
}
}
}
12 changes: 11 additions & 1 deletion ts/private/ts_project_worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@ const ts = require('typescript');
const path = require('path');
const worker = require('@bazel/worker');
const v8 = require('v8');

const MNEMONIC = 'TsProject';

// Workaround for https://github.com/microsoft/TypeScript/pull/42095
if (Array.isArray(ts.ignoredPaths)) {
ts.ignoredPaths = ts.ignoredPaths.filter(ignoredPath => ignoredPath != "/node_modules/.")
}

function noop() {}

/** Timing */
Expand Down Expand Up @@ -155,11 +161,13 @@ function createFilesystemTree(root, inputs) {

function fileExists(p) {
const node = getNode(p);
worker.log("directoryExists", p, typeof node == "object" && node[Type] == TYPE.FILE)
return typeof node == "object" && node[Type] == TYPE.FILE;
}

function directoryExists(p) {
const node = getNode(p);
worker.log("directoryExists", p, typeof node == "object" && node[Type] == TYPE.DIR)
return typeof node == "object" && node[Type] == TYPE.DIR;
}

Expand All @@ -168,6 +176,7 @@ function createFilesystemTree(root, inputs) {
if (!node || node[Type] != TYPE.DIR) {
return []
}
worker.log("readDirectory", p, Object.keys(node))
return Object.keys(node);
}

Expand All @@ -189,6 +198,7 @@ function createFilesystemTree(root, inputs) {
dirs.push(part);
}
}
worker.log("getDirectories", p, dirs)
return dirs
}

Expand Down Expand Up @@ -500,7 +510,7 @@ function createProgram(args, initialInputs) {

function invalidate(filePath, kind, digest) {
if (filePath.endsWith('.params')) return;
debuglog(`invalidate ${filePath} : ${ts.FileWatcherEventKind[kind]}`);
worker.log(`invalidate ${filePath} : ${ts.FileWatcherEventKind[kind]}`);

if (kind === ts.FileWatcherEventKind.Created) {
filesystemTree.add(filePath, digest);
Expand Down

0 comments on commit a24b2be

Please sign in to comment.