From 48732fa68f0cfe3d10605aa329e9dca599a53747 Mon Sep 17 00:00:00 2001 From: Nevada Perry Date: Fri, 7 Mar 2025 00:42:53 +0000 Subject: [PATCH 1/4] Include .ts files with source maps --- ts-proto/rules.bzl | 3 +++ typescript/rules.bzl | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ts-proto/rules.bzl b/ts-proto/rules.bzl index 97ee9a2..b28c824 100644 --- a/ts-proto/rules.bzl +++ b/ts-proto/rules.bzl @@ -188,6 +188,9 @@ def _ts_proto_libraries_impl(ctx): map = actions.declare_file(map_path(js_path(path))) js.append(map) js_outputs.append(map) + # Include .ts file with source map. Used by VSCode debugger as well + # as Istanbul's code coverage reports (interactive HTML). + js_outputs.append(ts_) path = file.path[len(lib.path + "/"):] if declaration_prefix: diff --git a/typescript/rules.bzl b/typescript/rules.bzl index 9952f31..1cf3fbb 100644 --- a/typescript/rules.bzl +++ b/typescript/rules.bzl @@ -245,6 +245,9 @@ def _ts_library_impl(ctx): map = actions.declare_file(map_path(js_path(js_path_, jsx))) js.append(map) js_outputs.append(map) + # Include .ts file with source map. Used by VSCode debugger as + # well as Istanbul's code coverage reports (interactive HTML). + js_outputs.append(ts_) declaration = actions.declare_file(declaration_path(declaration_path_)) declarations.append(declaration) outputs.append(declaration) From 2ea417e6eec58d3b55f5cdd33211b077108b5af1 Mon Sep 17 00:00:00 2001 From: Nevada Perry Date: Fri, 7 Mar 2025 00:53:47 +0000 Subject: [PATCH 2/4] Try appending to `js` array rather than `js_outputs` --- ts-proto/rules.bzl | 6 +++--- typescript/rules.bzl | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ts-proto/rules.bzl b/ts-proto/rules.bzl index b28c824..c170312 100644 --- a/ts-proto/rules.bzl +++ b/ts-proto/rules.bzl @@ -188,9 +188,9 @@ def _ts_proto_libraries_impl(ctx): map = actions.declare_file(map_path(js_path(path))) js.append(map) js_outputs.append(map) - # Include .ts file with source map. Used by VSCode debugger as well - # as Istanbul's code coverage reports (interactive HTML). - js_outputs.append(ts_) + # Include .ts file with source map. Used by VSCode debugger as + # well as Istanbul's code coverage reports (interactive HTML). + js.append(ts_) path = file.path[len(lib.path + "/"):] if declaration_prefix: diff --git a/typescript/rules.bzl b/typescript/rules.bzl index 1cf3fbb..480dfc9 100644 --- a/typescript/rules.bzl +++ b/typescript/rules.bzl @@ -245,9 +245,10 @@ def _ts_library_impl(ctx): map = actions.declare_file(map_path(js_path(js_path_, jsx))) js.append(map) js_outputs.append(map) - # Include .ts file with source map. Used by VSCode debugger as - # well as Istanbul's code coverage reports (interactive HTML). - js_outputs.append(ts_) + # Include .ts file with source map. Used by VSCode debugger + # as well as Istanbul's code coverage reports (interactive + # HTML). + js.append(ts_) declaration = actions.declare_file(declaration_path(declaration_path_)) declarations.append(declaration) outputs.append(declaration) From 8f94b0dfbc774f613bec0c4437bbbc6b7d1cbdd6 Mon Sep 17 00:00:00 2001 From: Nevada Perry Date: Fri, 7 Mar 2025 01:20:38 +0000 Subject: [PATCH 3/4] Try restricting Jest to .js and .json files --- test/src/jest-config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/test/src/jest-config.ts b/test/src/jest-config.ts index d99100a..9af9403 100644 --- a/test/src/jest-config.ts +++ b/test/src/jest-config.ts @@ -1,5 +1,6 @@ export function jestConfig() { return { + moduleFileExtensions: ["js", "json"], modulePathIgnorePatterns: [`${process.env.JEST_ROOT}/bazel/`], testPathIgnorePatterns: [`${process.env.JEST_ROOT}/bazel/`], testTimeout: 60 * 1000, From d96b7545180744a53f7ac79991def9192753f511 Mon Sep 17 00:00:00 2001 From: Nevada Perry Date: Fri, 7 Mar 2025 01:21:57 +0000 Subject: [PATCH 4/4] Fix lint --- ts-proto/rules.bzl | 1 + typescript/rules.bzl | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ts-proto/rules.bzl b/ts-proto/rules.bzl index c170312..be44b35 100644 --- a/ts-proto/rules.bzl +++ b/ts-proto/rules.bzl @@ -188,6 +188,7 @@ def _ts_proto_libraries_impl(ctx): map = actions.declare_file(map_path(js_path(path))) js.append(map) js_outputs.append(map) + # Include .ts file with source map. Used by VSCode debugger as # well as Istanbul's code coverage reports (interactive HTML). js.append(ts_) diff --git a/typescript/rules.bzl b/typescript/rules.bzl index 480dfc9..41d8c1a 100644 --- a/typescript/rules.bzl +++ b/typescript/rules.bzl @@ -245,10 +245,12 @@ def _ts_library_impl(ctx): map = actions.declare_file(map_path(js_path(js_path_, jsx))) js.append(map) js_outputs.append(map) + # Include .ts file with source map. Used by VSCode debugger # as well as Istanbul's code coverage reports (interactive # HTML). js.append(ts_) + declaration = actions.declare_file(declaration_path(declaration_path_)) declarations.append(declaration) outputs.append(declaration)