Skip to content

Commit

Permalink
chore: formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeagle committed Dec 21, 2021
1 parent 67c05e5 commit 3b050db
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 14 deletions.
21 changes: 16 additions & 5 deletions docs/swc.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
<!-- Generated with Stardoc: http://skydoc.bazel.build -->

swc rule
API for running SWC under Bazel

Simplest usage:

```starlark
load("@aspect_rules_swc//swc:swc.bzl", "swc")

swc(name = "transpile")
```


<a id="#swc_rule"></a>

Expand All @@ -12,8 +21,10 @@ swc_rule(<a href="#swc_rule-name">name</a>, <a href="#swc_rule-args">args</a>, <

Underlying rule for the `swc` macro.

Use this if you need more control over how the rule is called,
for example to set your own output labels for `js_outs`.
Most users should just use [swc](#swc) instead.

Use this if you need more control over how the rule is called,
for example to set your own output labels for `js_outs`.

**ATTRIBUTES**

Expand All @@ -23,8 +34,8 @@ Underlying rule for the `swc` macro.
| <a id="swc_rule-name"></a>name | A unique name for this target. | <a href="https://bazel.build/docs/build-ref.html#name">Name</a> | required | |
| <a id="swc_rule-args"></a>args | additional arguments to pass to swc cli, see https://swc.rs/docs/usage/cli | List of strings | optional | [] |
| <a id="swc_rule-data"></a>data | runtime dependencies propagated to binaries that depend on this | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | optional | [] |
| <a id="swc_rule-js_outs"></a>js_outs | - | List of labels | optional | |
| <a id="swc_rule-map_outs"></a>map_outs | - | List of labels | optional | |
| <a id="swc_rule-js_outs"></a>js_outs | list of expected JavaScript output files | List of labels | optional | |
| <a id="swc_rule-map_outs"></a>map_outs | list of expected source map output files | List of labels | optional | |
| <a id="swc_rule-output_dir"></a>output_dir | whether to produce a directory output rather than individual files | Boolean | optional | False |
| <a id="swc_rule-srcs"></a>srcs | source files, typically .ts files in the source tree | <a href="https://bazel.build/docs/build-ref.html#labels">List of labels</a> | required | |
| <a id="swc_rule-swc_cli"></a>swc_cli | binary that executes the swc CLI | <a href="https://bazel.build/docs/build-ref.html#labels">Label</a> | optional | @aspect_rules_swc//swc:cli |
Expand Down
2 changes: 1 addition & 1 deletion examples/rc/src/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ diff_test(
name = "test_map",
file1 = "in.js.map",
file2 = "expected.js.map",
)
)
2 changes: 1 addition & 1 deletion examples/rc/src/expected.js

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

2 changes: 1 addition & 1 deletion examples/rc/src/expected.js.map

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

2 changes: 1 addition & 1 deletion examples/rc/src/in.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const a: string = 'foo'
export const a: string = "foo";
4 changes: 2 additions & 2 deletions swc/private/swc.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ _attrs = {
}

_outputs = {
"js_outs": attr.output_list(),
"map_outs": attr.output_list(),
"js_outs": attr.output_list(doc = "list of expected JavaScript output files"),
"map_outs": attr.output_list(doc = "list of expected source map output files"),
}

def _impl(ctx):
Expand Down
17 changes: 14 additions & 3 deletions swc/swc.bzl
Original file line number Diff line number Diff line change
@@ -1,13 +1,24 @@
"swc rule"
"""API for running SWC under Bazel
Simplest usage:
```starlark
load("@aspect_rules_swc//swc:swc.bzl", "swc")
swc(name = "transpile")
```
"""

load("//swc/private:swc.bzl", _swc_lib = "swc")
load("@bazel_skylib//lib:paths.bzl", "paths")

swc_rule = rule(
doc = """Underlying rule for the `swc` macro.
Use this if you need more control over how the rule is called,
for example to set your own output labels for `js_outs`.""",
Most users should just use [swc](#swc) instead.
Use this if you need more control over how the rule is called,
for example to set your own output labels for `js_outs`.""",
implementation = _swc_lib.implementation,
attrs = _swc_lib.attrs,
toolchains = _swc_lib.toolchains,
Expand Down

0 comments on commit 3b050db

Please sign in to comment.