diff --git a/e2e/workspace/BUILD b/e2e/workspace/BUILD index b5ddacd..786f099 100644 --- a/e2e/workspace/BUILD +++ b/e2e/workspace/BUILD @@ -1,9 +1,9 @@ load("@bazel_skylib//rules:build_test.bzl", "build_test") load("@aspect_rules_swc//swc:defs.bzl", "swc") -swc(name = "transpile") +swc(name = "compile") build_test( name = "test", - targets = [":transpile"], + targets = [":compile"], ) diff --git a/examples/custom_outs/BUILD.bazel b/examples/custom_outs/BUILD.bazel index 49479d4..36fba23 100644 --- a/examples/custom_outs/BUILD.bazel +++ b/examples/custom_outs/BUILD.bazel @@ -32,7 +32,7 @@ load("@bazel_skylib//rules:write_file.bzl", "write_file") [ swc_compile( - name = "transpile_" + format, + name = "compile_" + format, srcs = ["a.ts"], # The extension of the outputs can be modified using js_outs js_outs = [format + "/a." + ("cjs" if format == "commonjs" else "js")], diff --git a/examples/filegroup/BUILD.bazel b/examples/filegroup/BUILD.bazel index 982d5d0..679c2e2 100644 --- a/examples/filegroup/BUILD.bazel +++ b/examples/filegroup/BUILD.bazel @@ -9,7 +9,7 @@ filegroup( ) swc( - name = "transpile", + name = "compile", srcs = ["srcs"], source_maps = "true", swcrc = ".swcrc", @@ -17,10 +17,10 @@ swc( # Since the srcs were in a filegroup, the swc macro cannot pre-declare the outputs. # So there is no label ":a.js" that we can reference from the build file. -# However, a.js is still produced as one of the default outputs of the transpile rule. -# We can verify this in an action that depends on the ":transpile" rule and reads the files. +# However, a.js is still produced as one of the default outputs of the compile rule. +# We can verify this in an action that depends on the ":compile" rule and reads the files. sh_test( name = "check_outputs", srcs = ["check_outputs.sh"], - data = [":transpile"], + data = [":compile"], ) diff --git a/examples/opaque_src/BUILD.bazel b/examples/opaque_src/BUILD.bazel index 7fffc9b..f37cf7c 100644 --- a/examples/opaque_src/BUILD.bazel +++ b/examples/opaque_src/BUILD.bazel @@ -14,7 +14,7 @@ filegroup( # In this case we pass a target containing sources so the swc macro can't pre-declare the .js output targets swc( - name = "transpile", + name = "compile", srcs = [":opaque_src"], ) @@ -22,10 +22,10 @@ swc( output_files( name = "in.js", paths = ["%s/in.js" % package_name()], - target = ":transpile", + target = ":compile", ) -# Assert that the output of "transpile" rule matches the expected file. +# Assert that this predeclared output of "compile" rule matches the expected file. write_source_files( name = "test", files = {"expected.js": ":in.js"}, diff --git a/examples/out_dir/BUILD.bazel b/examples/out_dir/BUILD.bazel index 3aefa51..d706a04 100644 --- a/examples/out_dir/BUILD.bazel +++ b/examples/out_dir/BUILD.bazel @@ -2,7 +2,7 @@ load("@aspect_rules_swc//swc:defs.bzl", "swc") load("@aspect_bazel_lib//lib:testing.bzl", "assert_outputs") swc( - name = "transpile", + name = "compile", srcs = [ "a.ts", "b.ts", @@ -13,11 +13,11 @@ swc( # Since the srcs were in a filegroup, the swc macro cannot pre-declare the outputs. # So there is no label ":a.js" that we can reference from the build file. -# However, a.js is still produced as one of the default outputs of the transpile rule. -# We can verify this in an action that depends on the ":transpile" rule and reads the files. +# However, a.js is still produced as one of the default outputs of the compile rule. +# We can verify this in an action that depends on the ":compile" rule and reads the files. assert_outputs( name = "check_outputs", - actual = "transpile", + actual = "compile", expected = [ "examples/out_dir/out/a.js", "examples/out_dir/out/a.js.map", diff --git a/examples/paths/BUILD.bazel b/examples/paths/BUILD.bazel index 469ee5c..596ab65 100644 --- a/examples/paths/BUILD.bazel +++ b/examples/paths/BUILD.bazel @@ -7,7 +7,7 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") load("@aspect_rules_swc//swc:defs.bzl", "swc") swc( - name = "transpile", + name = "compile", swcrc = ".swcrc", ) diff --git a/examples/rc/src/BUILD.bazel b/examples/rc/src/BUILD.bazel index 5942dce..97274c6 100644 --- a/examples/rc/src/BUILD.bazel +++ b/examples/rc/src/BUILD.bazel @@ -2,11 +2,11 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") load("@aspect_rules_swc//swc:defs.bzl", "swc") # Runs `swc in.ts > ../../bazel-bin/examples/simple/in.js` -# You can run `bazel build --subcommands //examples/simple:transpile` +# You can run `bazel build --subcommands //examples/simple:compile` # to see the exact command line Bazel runs. # Note that by default, sources are found by glob(["**/*.ts"]) swc( - name = "transpile", + name = "compile", source_maps = True, swcrc = "//examples/rc:.swcrc", ) diff --git a/examples/root_dir/BUILD.bazel b/examples/root_dir/BUILD.bazel index 2ea3aca..b0d6843 100644 --- a/examples/root_dir/BUILD.bazel +++ b/examples/root_dir/BUILD.bazel @@ -2,7 +2,7 @@ load("@aspect_rules_swc//swc:defs.bzl", "swc") load("@aspect_bazel_lib//lib:testing.bzl", "assert_outputs") swc( - name = "transpile", + name = "compile", srcs = [ "src/a.ts", "src/b.ts", @@ -14,11 +14,11 @@ swc( # Since the srcs were in a filegroup, the swc macro cannot pre-declare the outputs. # So there is no label ":a.js" that we can reference from the build file. -# However, a.js is still produced as one of the default outputs of the transpile rule. -# We can verify this in an action that depends on the ":transpile" rule and reads the files. +# However, a.js is still produced as one of the default outputs of the compile rule. +# We can verify this in an action that depends on the ":compile" rule and reads the files. assert_outputs( name = "check_outputs", - actual = "transpile", + actual = "compile", expected = [ "examples/root_dir/out/a.js", "examples/root_dir/out/a.js.map", diff --git a/examples/simple/BUILD.bazel b/examples/simple/BUILD.bazel index f88d93a..2a66a0d 100644 --- a/examples/simple/BUILD.bazel +++ b/examples/simple/BUILD.bazel @@ -7,15 +7,15 @@ load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") load("@aspect_rules_swc//swc:defs.bzl", "swc") # Runs `swc in.ts > ../../bazel-bin/examples/simple/in.js` -# You can run `bazel build --subcommands //examples/simple:transpile` +# You can run `bazel build --subcommands //examples/simple:compile` # to see the exact command line Bazel runs. # Note that by default, sources are found by glob(["**/*.ts"]) -swc(name = "transpile") +swc(name = "compile") -# Assert that the output of "transpile" rule matches the expected file. +# Assert that the output of "compile" rule matches the expected file. write_source_files( name = "test", - # This is a pre-declared output of the "transpile" rule, so we can refer to it directly using a Bazel label + # This is a pre-declared output of the "compile" rule, so we can refer to it directly using a Bazel label # even though the file itself is generated by Bazel in ../../bazel-bin/examples/simple/in.js files = {"expected.js": ":in.js"}, ) diff --git a/examples/transitive/BUILD.bazel b/examples/transitive/BUILD.bazel index 8e929ec..4529d79 100644 --- a/examples/transitive/BUILD.bazel +++ b/examples/transitive/BUILD.bazel @@ -1,5 +1,5 @@ """Test transitive dependencies between typescript files -which are transpiled separately as "libraries" but which +which are compiled separately as "libraries" but which have runtime dependencies. """