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 Nov 8, 2022
1 parent 1d8658d commit c027c72
Show file tree
Hide file tree
Showing 8 changed files with 133 additions and 28 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ jobs:

- run: go install github.com/bazelbuild/buildtools/buildozer@latest
if: ${{ hashFiles(format('{0}/test.sh', matrix.folder)) != '' }}

- uses: pnpm/action-setup@v2
with:
version: '7.14.2'

- name: run ./test.sh
working-directory: ${{ matrix.folder }}
Expand Down
3 changes: 2 additions & 1 deletion e2e/worker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"@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"
}
}
100 changes: 75 additions & 25 deletions e2e/worker/pnpm-lock.yaml

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

19 changes: 19 additions & 0 deletions e2e/worker/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,25 @@ message "# Case 12: .tsbuildinfo file should be written when analysis cache is d
bazel build //composite || exit_with_message "Case 12: expected worker to build without errors."
bazel build //composite --action_env=ANALYSIS_CACHE_BUST=1 || exit_with_message "Case 12: expected worker to build without errors. (subsequent)"


message "# Case 13: should not ignore new transitive deps"

message="error TS2307: Cannot find module '@open-wc/dedupe-mixin' or its corresponding type declarations."
bazel build //transitive_closure --noexperimental_allow_unresolved_symlinks 2>&1 | grep "$message" || exit_with_message "Case 13: expected worker to report \"$message\""

lockfile_backup=$(mktemp)
cat pnpm-lock.yaml > $lockfile_backup
add_trap "cat $lockfile_backup > pnpm-lock.yaml"


tmp=$(mktemp -d)
jq '.pnpm.packageExtensions["@open-wc/testing-helpers"].dependencies["@open-wc/dedupe-mixin"] = "1.3.1"' package.json > "$tmp/package.json"
pnpm install --lockfile-only --dir "$tmp" --store-dir $(mktemp -d) --virtual-store-dir $(mktemp -d)
cat "$tmp/pnpm-lock.yaml" > pnpm-lock.yaml

bazel build //transitive_closure --noexperimental_allow_unresolved_symlinks 2>&1 | grep "$message" && exit_with_message "Case 13: expected worker to not report \"$message\""


message "# Case X: Should dump traces"
bazel build //trace

Expand Down
11 changes: 11 additions & 0 deletions e2e/worker/transitive_closure/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
load("@aspect_rules_ts//ts:defs.bzl", "ts_project")

ts_project(
name = "transitive_closure",
srcs = ["index.ts"],
deps = [
"//:node_modules/@open-wc/testing-helpers",
],
tsconfig = "//:tsconfig",
tags = ["manual"]
)
7 changes: 7 additions & 0 deletions e2e/worker/transitive_closure/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { fixture } from '@open-wc/testing-helpers';

const a = async () => {
await fixture('<my-el foo="bar"></my-el>');
}

a();
6 changes: 5 additions & 1 deletion e2e/worker/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"compilerOptions": {
"module": "ES2020",
"moduleResolution": "node"
"moduleResolution": "node",
"lib": [
"ES2015",
"DOM"
]
}
}
11 changes: 10 additions & 1 deletion ts/private/ts_project_worker.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
const fs = require('fs');
const path = require('path');
const v8 = require('v8');
const util = require("util")
const ts = require('typescript');
const worker = require('@bazel/worker');


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


/** Constants */
const MNEMONIC = 'TsProject';

Expand Down Expand Up @@ -610,6 +616,9 @@ function getOrCreateWorker(args, inputs) {

/** Build */
function emit(args, inputs) {
if (isNearOomZone()) {
sweepLeastRecentlyUsedWorkers();
}
const _worker = getOrCreateWorker(args, inputs);

const host = _worker.host;
Expand Down

0 comments on commit c027c72

Please sign in to comment.