diff --git a/docs/rules.md b/docs/rules.md index 2d9fa491..9e6f9b63 100644 --- a/docs/rules.md +++ b/docs/rules.md @@ -37,10 +37,10 @@ extended configuration file as well, to pass them both to the TypeScript compile
 ts_project_rule(name, deps, srcs, data, allow_js, args, assets, buildinfo_out, composite,
                 declaration, declaration_dir, declaration_map, emit_declaration_only, extends,
-                incremental, is_typescript_5_or_greater, js_outs, map_outs, out_dir, preserve_jsx,
-                resolve_json_module, root_dir, source_map, supports_workers, transpile,
-                ts_build_info_file, tsc, tsc_worker, tsconfig, typing_maps_outs, typings_outs,
-                validate, validator)
+                incremental, is_typescript_5_or_greater, isolated_declarations, js_outs, map_outs,
+                out_dir, preserve_jsx, resolve_json_module, root_dir, source_map, supports_workers,
+                transpile, ts_build_info_file, tsc, tsc_worker, tsconfig, typing_maps_outs,
+                typings_outs, validate, validator)
 
Implementation rule behind the ts_project macro. @@ -70,6 +70,7 @@ for srcs and tsconfig, and pre-declaring output files. | extends | https://www.typescriptlang.org/tsconfig#extends | Label | optional | `None` | | incremental | https://www.typescriptlang.org/tsconfig#incremental | Boolean | optional | `False` | | is_typescript_5_or_greater | Whether TypeScript version is >= 5.0.0 | Boolean | optional | `False` | +| isolated_declarations | https://www.typescriptlang.org/tsconfig/#isolatedDeclarations | Boolean | optional | `False` | | js_outs | Locations in bazel-out where tsc will write `.js` files | List of labels | optional | `[]` | | map_outs | Locations in bazel-out where tsc will write `.js.map` files | List of labels | optional | `[]` | | out_dir | https://www.typescriptlang.org/tsconfig#outDir | String | optional | `""` | @@ -114,10 +115,10 @@ along with any transitively referenced tsconfig.json files chained by the ## ts_project
-ts_project(name, tsconfig, srcs, args, data, deps, assets, extends, allow_js, declaration,
-           source_map, declaration_map, resolve_json_module, preserve_jsx, composite, incremental,
-           emit_declaration_only, transpiler, ts_build_info_file, tsc, tsc_worker, validate,
-           validator, declaration_dir, out_dir, root_dir, supports_workers, kwargs)
+ts_project(name, tsconfig, srcs, args, data, deps, assets, extends, allow_js, isolated_declarations,
+           declaration, source_map, declaration_map, resolve_json_module, preserve_jsx, composite,
+           incremental, emit_declaration_only, transpiler, ts_build_info_file, tsc, tsc_worker,
+           validate, validator, declaration_dir, out_dir, root_dir, supports_workers, kwargs)
 
Compiles one TypeScript project using `tsc --project`. @@ -156,6 +157,7 @@ If you have problems getting your `ts_project` to work correctly, read the dedic | assets | Files which are needed by a downstream build step such as a bundler.

These files are **not** included as inputs to any actions spawned by `ts_project`. They are not transpiled, and are not visible to the type-checker. Instead, these files appear among the *outputs* of this target.

A typical use is when your TypeScript code has an import that TS itself doesn't understand such as

`import './my.scss'`

and the type-checker allows this because you have an "ambient" global type declaration like

`declare module '*.scss' { ... }`

A bundler like webpack will expect to be able to resolve the `./my.scss` import to a file and doesn't care about the typing declaration. A bundler runs as a build step, so it does not see files included in the `data` attribute.

Note that `data` is used for files that are resolved by some binary, including a test target. Behind the scenes, `data` populates Bazel's Runfiles object in `DefaultInfo`, while this attribute populates the `transitive_sources` of the `JsInfo`. | `[]` | | extends | Label of the tsconfig file referenced in the `extends` section of tsconfig To support "chaining" of more than one extended config, this label could be a target that provdes `TsConfigInfo` such as `ts_config`. | `None` | | allow_js | Whether TypeScript will read .js and .jsx files. When used with `declaration`, TypeScript will generate `.d.ts` files from `.js` files. | `False` | +| isolated_declarations | TODO | `False` | | declaration | Whether the `declaration` bit is set in the tsconfig. Instructs Bazel to expect a `.d.ts` output for each `.ts` source. | `False` | | source_map | Whether the `sourceMap` bit is set in the tsconfig. Instructs Bazel to expect a `.js.map` output for each `.ts` source. | `False` | | declaration_map | Whether the `declarationMap` bit is set in the tsconfig. Instructs Bazel to expect a `.d.ts.map` output for each `.ts` source. | `False` |