Skip to content
This repository was archived by the owner on Sep 16, 2021. It is now read-only.

Commit 3f1d24b

Browse files
committed
Update docs for release
1 parent 10ff84f commit 3f1d24b

File tree

8 files changed

+114
-24
lines changed

8 files changed

+114
-24
lines changed

docs/api/build_defs.html

Lines changed: 78 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</ul>
6969
</li>
7070
<li>
71-
<a href="/api/karma/ts_web_test.html">Unit testing in with Karma</a>
71+
<a href="/api/karma/ts_web_test.html">Unit testing with Karma</a>
7272
<ul>
7373
<li>
7474
<a href="/api/karma/ts_web_test.html#ts_web_test">
@@ -196,7 +196,7 @@ <h3 id="ts_library_macro_args">Attributes</h3>
196196

197197
<h2 id="ts_library">ts_library</h2>
198198

199-
<pre>ts_library(<a href="#ts_library.name">name</a>, <a href="#ts_library.srcs">srcs</a>, <a href="#ts_library.compiler">compiler</a>, <a href="#ts_library.internal_testing_type_check_dependencies">internal_testing_type_check_dependencies</a>, <a href="#ts_library.node_modules">node_modules</a>, <a href="#ts_library.supports_workers">supports_workers</a>, <a href="#ts_library.tsconfig">tsconfig</a>, <a href="#ts_library.tsickle_typed">tsickle_typed</a>)</pre>
199+
<pre>ts_library(<a href="#ts_library.name">name</a>, <a href="#ts_library.deps">deps</a>, <a href="#ts_library.srcs">srcs</a>, <a href="#ts_library.compiler">compiler</a>, <a href="#ts_library.internal_testing_type_check_dependencies">internal_testing_type_check_dependencies</a>, <a href="#ts_library.node_modules">node_modules</a>, <a href="#ts_library.supports_workers">supports_workers</a>, <a href="#ts_library.tsconfig">tsconfig</a>, <a href="#ts_library.tsickle_typed">tsickle_typed</a>)</pre>
200200

201201
<p><code>ts_library</code> type-checks and compiles a set of TypeScript sources to JavaScript.</p>
202202
<p>It produces declarations files (<code>.d.ts</code>) which are used for compiling downstream
@@ -218,6 +218,13 @@ <h3 id="ts_library_args">Attributes</h3>
218218
<p>A unique name for this rule.</p>
219219
</td>
220220
</tr>
221+
<tr id="ts_library.deps">
222+
<td><code>deps</code></td>
223+
<td>
224+
<p><code>List of <a href="https://bazel.build/docs/build-ref.html#labels">labels</a>; Optional; Default is []</code></p>
225+
226+
</td>
227+
</tr>
221228
<tr id="ts_library.srcs">
222229
<td><code>srcs</code></td>
223230
<td>
@@ -228,11 +235,17 @@ <h3 id="ts_library_args">Attributes</h3>
228235
<tr id="ts_library.compiler">
229236
<td><code>compiler</code></td>
230237
<td>
231-
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional; Default is //internal:tsc_wrapped_bin</code></p>
232-
<p>Intended for internal use only.
233-
Sets a different TypeScript compiler binary to use for this library.
238+
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional; Default is @build_bazel_rules_typescript//:@bazel/typescript/tsc_wrapped</code></p>
239+
<p>Sets a different TypeScript compiler binary to use for this library.
234240
For example, we use the vanilla TypeScript tsc.js for bootstrapping,
235241
and Angular compilations can replace this with <code>ngc</code>.</p>
242+
<pre><code> The default ts_library compiler depends on the `@npm//:@bazel/typescript`
243+
target which is setup for projects that use bazel managed npm deps that
244+
fetch the @bazel/typescript npm package. It is recommended that you use
245+
the workspace name `@npm` for bazel managed deps so the default
246+
compiler works out of the box. Otherwise, you'll have to override
247+
the compiler attribute manually.
248+
</code></pre>
236249
</td>
237250
</tr>
238251
<tr id="ts_library.internal_testing_type_check_dependencies">
@@ -245,8 +258,66 @@ <h3 id="ts_library_args">Attributes</h3>
245258
<tr id="ts_library.node_modules">
246259
<td><code>node_modules</code></td>
247260
<td>
248-
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional; Default is @//:node_modules</code></p>
249-
261+
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional; Default is @npm//:typescript__typings</code></p>
262+
<p>The npm packages which should be available during the compile.</p>
263+
<pre><code> The default value is `@npm//:typescript__typings` is setup
264+
for projects that use bazel managed npm deps that. It is recommended
265+
that you use the workspace name `@npm` for bazel managed deps so the
266+
default node_modules works out of the box. Otherwise, you'll have to
267+
override the node_modules attribute manually. This default is in place
268+
since ts_library will always depend on at least the typescript
269+
default libs which are provided by `@npm//:typescript__typings`.
270+
271+
This attribute is DEPRECATED. As of version 0.18.0 the recommended
272+
approach to npm dependencies is to use fine grained npm dependencies
273+
which are setup with the `yarn_install` or `npm_install` rules.
274+
275+
For example, in targets that used a `//:node_modules` filegroup,
276+
277+
```
278+
ts_library(
279+
name = "my_lib",
280+
...
281+
node_modules = "//:node_modules",
282+
)
283+
```
284+
285+
which specifies all files within the `//:node_modules` filegroup
286+
to be inputs to the `my_lib`. Using fine grained npm dependencies,
287+
`my_lib` is defined with only the npm dependencies that are
288+
needed:
289+
290+
```
291+
ts_library(
292+
name = "my_lib",
293+
...
294+
deps = [
295+
"@npm//:@types/foo",
296+
"@npm//:@types/bar",
297+
"@npm//:foo",
298+
"@npm//:bar",
299+
...
300+
],
301+
)
302+
```
303+
304+
In this case, only the listed npm packages and their
305+
transitive deps are includes as inputs to the `my_lib` target
306+
which reduces the time required to setup the runfiles for this
307+
target (see https://github.com/bazelbuild/bazel/issues/5153).
308+
The default typescript libs are also available via the node_modules
309+
default in this case.
310+
311+
The @npm external repository and the fine grained npm package
312+
targets are setup using the `yarn_install` or `npm_install` rule
313+
in your WORKSPACE file:
314+
315+
yarn_install(
316+
name = "npm",
317+
package_json = "//:package.json",
318+
yarn_lock = "//:yarn.lock",
319+
)
320+
</code></pre>
250321
</td>
251322
</tr>
252323
<tr id="ts_library.supports_workers">

docs/api/devserver/ts_devserver.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</ul>
6969
</li>
7070
<li>
71-
<a href="/api/karma/ts_web_test.html">Unit testing in with Karma</a>
71+
<a href="/api/karma/ts_web_test.html">Unit testing with Karma</a>
7272
<ul>
7373
<li>
7474
<a href="/api/karma/ts_web_test.html#ts_web_test">

docs/api/index.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</ul>
6969
</li>
7070
<li>
71-
<a href="/api/karma/ts_web_test.html">Unit testing in with Karma</a>
71+
<a href="/api/karma/ts_web_test.html">Unit testing with Karma</a>
7272
<ul>
7373
<li>
7474
<a href="/api/karma/ts_web_test.html#ts_web_test">
@@ -104,7 +104,7 @@ <h2>Rule sets</h2>
104104
<li><a href="#ts_config">tsconfig.json files using extends</a></li>
105105
<li><a href="#ts_repositories">Install toolchain dependencies</a></li>
106106
<li><a href="#ts_devserver">Simple development server</a></li>
107-
<li><a href="#ts_web_test">Unit testing in with Karma</a></li>
107+
<li><a href="#ts_web_test">Unit testing with Karma</a></li>
108108
<li><a href="#ts_proto_library">Protocol Buffers</a></li>
109109
</ul>
110110
</nav>
@@ -248,7 +248,7 @@ <h3>Macros</h3>
248248
</tr>
249249
</tbody>
250250
</table>
251-
<h2><a href="/api/karma/ts_web_test.html" id="ts_web_test">Unit testing in with Karma</a></h2>
251+
<h2><a href="/api/karma/ts_web_test.html" id="ts_web_test">Unit testing with Karma</a></h2>
252252

253253
<h3>Rules</h3>
254254
<table class="overview-table">

docs/api/karma/ts_web_test.html

Lines changed: 28 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<meta name="viewport" content="width=device-width initial-scale=1" />
1111
<meta http-equiv="X-UA-Compatible" content="IE=edge">
1212

13-
<title>Unit testing in with Karma</title>
13+
<title>Unit testing with Karma</title>
1414

1515
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,600,700" type="text/css">
1616
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
@@ -23,7 +23,7 @@
2323
mdl-layout--fixed-header">
2424
<header class="mdl-layout__header">
2525
<div class="mdl-layout__header-row">
26-
<span class="mdl-layout-title">Unit testing in with Karma</span>
26+
<span class="mdl-layout-title">Unit testing with Karma</span>
2727
</div>
2828
</header>
2929
<div class="mdl-layout__drawer">
@@ -68,7 +68,7 @@
6868
</ul>
6969
</li>
7070
<li>
71-
<a href="/api/karma/ts_web_test.html">Unit testing in with Karma</a>
71+
<a href="/api/karma/ts_web_test.html">Unit testing with Karma</a>
7272
<ul>
7373
<li>
7474
<a href="/api/karma/ts_web_test.html#ts_web_test">
@@ -94,7 +94,7 @@
9494

9595
<main class="mdl-layout__content">
9696
<div class="page-content">
97-
<h1>Unit testing in with Karma</h1>
97+
<h1>Unit testing with Karma</h1>
9898

9999
<nav class="toc">
100100
<h2>Rules</h2>
@@ -111,7 +111,7 @@ <h2>Macros</h2>
111111

112112
<h2 id="ts_web_test_macro">ts_web_test_macro</h2>
113113

114-
<pre>ts_web_test_macro(<a href="#ts_web_test_macro.tags">tags</a>, <a href="#ts_web_test_macro.data">data</a>)</pre>
114+
<pre>ts_web_test_macro(<a href="#ts_web_test_macro.karma">karma</a>, <a href="#ts_web_test_macro.tags">tags</a>, <a href="#ts_web_test_macro.data">data</a>)</pre>
115115

116116
<p>ibazel wrapper for <code>ts_web_test</code></p>
117117
<p>This macro re-exposes the <code>ts_web_test</code> rule with some extra tags so that
@@ -128,6 +128,13 @@ <h3 id="ts_web_test_macro_args">Attributes</h3>
128128
<col class="col-description" />
129129
</colgroup>
130130
<tbody>
131+
<tr id="ts_web_test_macro.karma">
132+
<td><code>karma</code></td>
133+
<td>
134+
<p><code>Unknown; Optional</code></p>
135+
<p>karma binary label</p>
136+
</td>
137+
</tr>
131138
<tr id="ts_web_test_macro.tags">
132139
<td><code>tags</code></td>
133140
<td>
@@ -149,7 +156,7 @@ <h3 id="ts_web_test_macro_args">Attributes</h3>
149156

150157
<h2 id="ts_web_test_suite">ts_web_test_suite</h2>
151158

152-
<pre>ts_web_test_suite(<a href="#ts_web_test_suite.name">name</a>, <a href="#ts_web_test_suite.browsers">browsers</a>, <a href="#ts_web_test_suite.args">args</a>, <a href="#ts_web_test_suite.browser_overrides">browser_overrides</a>, <a href="#ts_web_test_suite.config">config</a>, <a href="#ts_web_test_suite.flaky">flaky</a>, <a href="#ts_web_test_suite.local">local</a>, <a href="#ts_web_test_suite.shard_count">shard_count</a>, <a href="#ts_web_test_suite.size">size</a>, <a href="#ts_web_test_suite.tags">tags</a>, <a href="#ts_web_test_suite.test_suite_tags">test_suite_tags</a>, <a href="#ts_web_test_suite.timeout">timeout</a>, <a href="#ts_web_test_suite.visibility">visibility</a>, <a href="#ts_web_test_suite.web_test_data">web_test_data</a>, <a href="#ts_web_test_suite.wrapped_test_tags">wrapped_test_tags</a>)</pre>
159+
<pre>ts_web_test_suite(<a href="#ts_web_test_suite.name">name</a>, <a href="#ts_web_test_suite.browsers">browsers</a>, <a href="#ts_web_test_suite.karma">karma</a>, <a href="#ts_web_test_suite.args">args</a>, <a href="#ts_web_test_suite.browser_overrides">browser_overrides</a>, <a href="#ts_web_test_suite.config">config</a>, <a href="#ts_web_test_suite.flaky">flaky</a>, <a href="#ts_web_test_suite.local">local</a>, <a href="#ts_web_test_suite.shard_count">shard_count</a>, <a href="#ts_web_test_suite.size">size</a>, <a href="#ts_web_test_suite.tags">tags</a>, <a href="#ts_web_test_suite.test_suite_tags">test_suite_tags</a>, <a href="#ts_web_test_suite.timeout">timeout</a>, <a href="#ts_web_test_suite.visibility">visibility</a>, <a href="#ts_web_test_suite.web_test_data">web_test_data</a>, <a href="#ts_web_test_suite.wrapped_test_tags">wrapped_test_tags</a>)</pre>
153160

154161
<p>Defines a test_suite of web_test targets that wrap a ts_web_test target.</p>
155162

@@ -176,6 +183,13 @@ <h3 id="ts_web_test_suite_args">Attributes</h3>
176183
<p>A sequence of labels specifying the browsers to use.</p>
177184
</td>
178185
</tr>
186+
<tr id="ts_web_test_suite.karma">
187+
<td><code>karma</code></td>
188+
<td>
189+
<p><code>Unknown; Optional</code></p>
190+
<p>karma binary label</p>
191+
</td>
192+
</tr>
179193
<tr id="ts_web_test_suite.args">
180194
<td><code>args</code></td>
181195
<td>
@@ -280,7 +294,7 @@ <h3 id="ts_web_test_suite_args">Attributes</h3>
280294

281295
<h2 id="ts_web_test">ts_web_test</h2>
282296

283-
<pre>ts_web_test(<a href="#ts_web_test.name">name</a>, <a href="#ts_web_test.deps">deps</a>, <a href="#ts_web_test.data">data</a>, <a href="#ts_web_test.srcs">srcs</a>, <a href="#ts_web_test.bootstrap">bootstrap</a>, <a href="#ts_web_test.static_files">static_files</a>)</pre>
297+
<pre>ts_web_test(<a href="#ts_web_test.name">name</a>, <a href="#ts_web_test.deps">deps</a>, <a href="#ts_web_test.data">data</a>, <a href="#ts_web_test.srcs">srcs</a>, <a href="#ts_web_test.bootstrap">bootstrap</a>, <a href="#ts_web_test.karma">karma</a>, <a href="#ts_web_test.static_files">static_files</a>)</pre>
284298

285299
<p>Runs unit tests in a browser.</p>
286300
<p>When executed under <code>bazel test</code>, this uses a headless browser for speed.
@@ -343,6 +357,13 @@ <h3 id="ts_web_test_args">Attributes</h3>
343357
or UMD bundles for third-party libraries.</p>
344358
</td>
345359
</tr>
360+
<tr id="ts_web_test.karma">
361+
<td><code>karma</code></td>
362+
<td>
363+
<p><code><a href="https://bazel.build/docs/build-ref.html#labels">Label</a>; Optional; Default is @build_bazel_rules_typescript//:karma/karma</code></p>
364+
365+
</td>
366+
</tr>
346367
<tr id="ts_web_test.static_files">
347368
<td><code>static_files</code></td>
348369
<td>

docs/api/main.css

Lines changed: 1 addition & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/protobufjs/ts_proto_library.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</ul>
6969
</li>
7070
<li>
71-
<a href="/api/karma/ts_web_test.html">Unit testing in with Karma</a>
71+
<a href="/api/karma/ts_web_test.html">Unit testing with Karma</a>
7272
<ul>
7373
<li>
7474
<a href="/api/karma/ts_web_test.html#ts_web_test">

docs/api/ts_config.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</ul>
6969
</li>
7070
<li>
71-
<a href="/api/karma/ts_web_test.html">Unit testing in with Karma</a>
71+
<a href="/api/karma/ts_web_test.html">Unit testing with Karma</a>
7272
<ul>
7373
<li>
7474
<a href="/api/karma/ts_web_test.html#ts_web_test">

docs/api/ts_repositories.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
</ul>
6969
</li>
7070
<li>
71-
<a href="/api/karma/ts_web_test.html">Unit testing in with Karma</a>
71+
<a href="/api/karma/ts_web_test.html">Unit testing with Karma</a>
7272
<ul>
7373
<li>
7474
<a href="/api/karma/ts_web_test.html#ts_web_test">

0 commit comments

Comments
 (0)