Skip to content

Commit 9d7827b

Browse files
noveyakalexeagle
authored andcommitted
fix(typescript): capture js files in outputs of ts_project if allow_js
1 parent 924fa41 commit 9d7827b

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

packages/typescript/internal/ts_project.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ def ts_project_macro(
669669
typing_maps_outs = []
670670

671671
if not emit_declaration_only:
672-
js_outs.extend(_out_paths(srcs, out_dir, root_dir, False, ".js"))
672+
js_outs.extend(_out_paths(srcs, out_dir, root_dir, allow_js, ".js"))
673673
if source_map and not emit_declaration_only:
674674
map_outs.extend(_out_paths(srcs, out_dir, root_dir, False, ".js.map"))
675675
if declaration or composite:

packages/typescript/test/ts_project/allow_js/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_test")
22
load("//packages/typescript:index.bzl", "ts_project")
33

4-
# Ensure that a.js produces outDir/a.js and outDir/a.d.ts
4+
# Ensure that a.js produces outDir/a.js, outDir/a.d.ts, and outDir/a.d.ts.map
55
SRCS = [
66
"a.js",
77
]
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const assert = require('assert');
22

33
const types_files = process.argv.slice(2, 4);
4-
const code_files = process.argv.slice(4, 6);
4+
const code_file = process.argv[4];
55
assert.ok(types_files.some(f => f.endsWith('out/a.d.ts')), 'Missing a.d.ts');
66
assert.ok(types_files.some(f => f.endsWith('out/a.d.ts.map')), 'Missing a.d.ts.map');
7+
assert.ok(code_file.endsWith('out/a.js'), 'Missing a.js');

0 commit comments

Comments
 (0)