Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aspect-build/rules_swc
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.20.0
Choose a base ref
...
head repository: aspect-build/rules_swc
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: main
Choose a head ref
Loading
Showing with 4,081 additions and 1,599 deletions.
  1. +1 −0 .aspect/bazelrc/.gitignore
  2. +15 −0 .aspect/bazelrc/BUILD.bazel
  3. +1 −0 .aspect/bazelrc/bazel7.bazelrc
  4. +66 −0 .aspect/bazelrc/ci.bazelrc
  5. +28 −0 .aspect/bazelrc/convenience.bazelrc
  6. +75 −0 .aspect/bazelrc/correctness.bazelrc
  7. +19 −0 .aspect/bazelrc/debug.bazelrc
  8. +11 −0 .aspect/bazelrc/javascript.bazelrc
  9. +20 −0 .aspect/bazelrc/performance.bazelrc
  10. +4 −1 .bazelignore
  11. +0 −2 .bazeliskrc
  12. +18 −15 .bazelrc
  13. +1 −7 .bazelversion
  14. +3 −0 .bcr/config.yml
  15. +18 −0 .bcr/metadata.template.json
  16. +12 −0 .bcr/presubmit.yml
  17. +5 −0 .bcr/source.template.json
  18. +2 −1 .gitattributes
  19. +9 −0 .github/workflows/BUILD.bazel
  20. +27 −0 .github/workflows/bazel6.bazelrc
  21. +11 −0 .github/workflows/bazel7.bazelrc
  22. +20 −0 .github/workflows/buildifier.yaml
  23. +6 −10 .github/workflows/ci.bazelrc
  24. +90 −39 .github/workflows/ci.yaml
  25. +21 −0 .github/workflows/mirror.yml
  26. +31 −0 .github/workflows/new_issue.yaml
  27. +5 −27 .github/workflows/release.yml
  28. +38 −0 .github/workflows/release_prep.sh
  29. +0 −25 .github/workflows/workspace_snippet.sh
  30. +16 −0 .gitignore
  31. +4 −0 .npmrc
  32. +3 −3 .pre-commit-config.yaml
  33. +3 −2 .prettierignore
  34. +15 −8 BUILD.bazel
  35. +1 −1 CONTRIBUTING.md
  36. +27 −0 MODULE.bazel
  37. +13 −22 README.md
  38. +41 −16 WORKSPACE
  39. +9 −1 docs/BUILD.bazel
  40. +83 −0 docs/repositories.md
  41. +66 −42 docs/swc.md
  42. +60 −0 docs/tsconfig.md
  43. +15 −0 e2e/smoke/.bazelrc
  44. +1 −0 e2e/smoke/.bazelversion
  45. +1 −0 e2e/smoke/.swcrc
  46. +6 −3 e2e/{workspace/BUILD → smoke/BUILD.bazel}
  47. +14 −0 e2e/smoke/MODULE.bazel
  48. +4 −0 e2e/smoke/README.md
  49. +8 −12 e2e/{workspace/WORKSPACE → smoke/WORKSPACE.bazel}
  50. +1 −0 e2e/smoke/WORKSPACE.bzlmod
  51. +3 −0 e2e/smoke/foo.ts
  52. 0 e2e/workspace/.bazelrc
  53. +5 −0 examples/BUILD.bazel
  54. +65 −0 examples/allow_js/BUILD.bazel
  55. +1 −0 examples/allow_js/expected.cjs
  56. +1 −0 examples/allow_js/expected.js
  57. +1 −0 examples/allow_js/expected.jsx
  58. +1 −0 examples/allow_js/expected.mjs
  59. +1 −0 examples/allow_js/expected.ts
  60. +1 −0 examples/allow_js/in.cjs
  61. +1 −0 examples/allow_js/in.d.ts
  62. +1 −0 examples/allow_js/in.js
  63. +1 −0 examples/allow_js/in.jsx
  64. +1 −0 examples/allow_js/in.mjs
  65. +1 −0 examples/allow_js/in_ts.ts
  66. +31 −5 examples/custom_outs/BUILD.bazel
  67. +1 −0 examples/custom_outs/b.mts
  68. +6 −5 examples/custom_outs/expected.cjs
  69. +0 −3 examples/custom_outs/expected.js
  70. +19 −0 examples/directory/BUILD.bazel
  71. +6 −5 examples/directory/test.sh
  72. +96 −0 examples/emit_types/BUILD.bazel
  73. +8 −0 examples/emit_types/expected.a.d.ts
  74. +5 −0 examples/emit_types/expected.b.d.ts
  75. +13 −0 examples/emit_types/src/a.ts
  76. +10 −0 examples/emit_types/src/b.ts
  77. +8 −0 examples/filegroup/.swcrc
  78. +8 −5 examples/filegroup/BUILD.bazel
  79. +9 −1 examples/filegroup/check_outputs.sh
  80. +1 −0 examples/filegroup/sub/c.ts
  81. +33 −0 examples/generate_swcrc/BUILD.bazel
  82. +6 −0 examples/generate_swcrc/package.json
  83. +1 −0 examples/generate_swcrc/some.ts
  84. +6 −0 examples/generate_swcrc/tsconfig.json
  85. +8 −0 examples/genrule/.swcrc
  86. +99 −0 examples/genrule/BUILD.bazel
  87. +24 −0 examples/genrule/check_outputs.sh
  88. +3 −1 examples/macro/BUILD.bazel
  89. +0 −3 examples/macro/expected.js
  90. +24 −25 examples/macro/ts_project.bzl
  91. +4 −4 examples/opaque_src/BUILD.bazel
  92. +0 −3 examples/opaque_src/expected.js
  93. +28 −16 examples/out_dir/BUILD.bazel
  94. +3 −0 examples/out_dir/expected/a.js
  95. +5 −0 examples/out_dir/expected/a.js.map.golden
  96. +3 −0 examples/out_dir/expected/b.js
  97. +5 −0 examples/out_dir/expected/b.js.map.golden
  98. +3 −0 examples/out_dir/expected/sub/c.js
  99. +5 −0 examples/out_dir/expected/sub/c.js.map.golden
  100. +1 −0 examples/out_dir/sub/c.ts
  101. +9 −0 examples/package.json
  102. +6 −3 examples/paths/.swcrc
  103. +36 −6 examples/paths/BUILD.bazel
  104. +5 −5 examples/paths/expected.js
  105. +4 −0 examples/paths/expected_tsc/index.js
  106. +9 −0 examples/paths/expected_tsc/modules/moduleA/index.js
  107. +5 −0 examples/paths/expected_tsc/modules/moduleB/index.js
  108. +0 −5 examples/paths/src/index.ts
  109. +0 −5 examples/paths/src/modules/moduleA/index.ts
  110. +9 −0 examples/paths/tsconfig.json
  111. +105 −0 examples/plugins/BUILD.bazel
  112. +1 −0 examples/plugins/expected_rc.js_
  113. +5 −0 examples/plugins/expected_rcdict.js_
  114. +5 −0 examples/plugins/expected_simple.js_
  115. +6 −0 examples/plugins/in.ts
  116. +3 −0 examples/plugins/minify.swcrc
  117. +6 −0 examples/plugins/package.json
  118. +85 −0 examples/pnpm-lock.yaml
  119. +3 −0 examples/pnpm-workspace.yaml
  120. +1 −7 examples/rc/BUILD.bazel
  121. +5 −5 examples/rc/src/BUILD.bazel
  122. +6 −3 examples/rc/src/expected.js
  123. +1 −1 examples/rc/src/expected.js.map
  124. +34 −0 examples/rcdict/BUILD.bazel
  125. +1 −0 examples/rcdict/expected_es2015.js
  126. +1 −0 examples/rcdict/expected_es5.js
  127. +1 −0 examples/rcdict/in.ts
  128. +41 −0 examples/resolve_json_module/BUILD.bazel
  129. +5 −0 examples/resolve_json_module/data.json
  130. +2 −0 examples/resolve_json_module/index.ts
  131. +39 −0 examples/root_dir/BUILD.bazel
  132. +3 −0 examples/root_dir/expected/a.js
  133. +5 −0 examples/root_dir/expected/a.js.map.golden
  134. +3 −0 examples/root_dir/expected/b.js
  135. +5 −0 examples/root_dir/expected/b.js.map.golden
  136. +3 −0 examples/root_dir/expected/sub/c.js
  137. +5 −0 examples/root_dir/expected/sub/c.js.map.golden
  138. +1 −0 examples/root_dir/src/a.ts
  139. +1 −0 examples/root_dir/src/b.ts
  140. +1 −0 examples/root_dir/src/sub/c.ts
  141. +7 −5 examples/simple/BUILD.bazel
  142. +0 −3 examples/simple/expected.js
  143. +19 −0 examples/source_map_support/BUILD.bazel
  144. +38 −0 examples/source_map_support/defs.bzl
  145. +42 −0 examples/source_map_support/stack-trace-support.js
  146. +36 −0 examples/source_map_support/test/BUILD.bazel
  147. +17 −0 examples/source_map_support/test/a.ts
  148. +3 −0 examples/source_map_support/test/b.ts
  149. +54 −0 examples/source_root/BUILD.bazel
  150. +3 −0 examples/source_root/expected.js
  151. +6 −0 examples/source_root/expected.js.map.golden
  152. +3 −0 examples/source_root/expected_subdir.js
  153. +6 −0 examples/source_root/expected_subdir.js.map.golden
  154. +1 −0 examples/source_root/in.ts
  155. +1 −0 examples/source_root/src/subdir.ts
  156. +5 −0 examples/transitive/.swcrc
  157. +3 −1 examples/transitive/BUILD.bazel
  158. +2 −5 examples/transitive/app/BUILD.bazel
  159. +1 −4 examples/transitive/lib_b/BUILD.bazel
  160. +1 −4 examples/transitive/lib_c/BUILD.bazel
  161. +12 −24 internal_deps.bzl
  162. +13 −2 renovate.json
  163. +5 −3 scripts/filter.jq
  164. +39 −28 scripts/mirror_releases.sh
  165. +33 −33 swc/BUILD.bazel
  166. +0 −468 swc/cli_repositories.bzl
  167. +118 −34 swc/defs.bzl
  168. +20 −12 swc/dependencies.bzl
  169. +12 −1 swc/extensions.bzl
  170. +0 −6 swc/package.json
  171. +0 −222 swc/pnpm-lock.yaml
  172. +22 −9 swc/private/BUILD.bazel
  173. +0 −7 swc/private/maybe.bzl
  174. +26 −0 swc/private/resolved_toolchain.bzl
  175. +349 −116 swc/private/swc.bzl
  176. +33 −0 swc/private/swc_plugin.bzl
  177. +8 −42 swc/private/toolchains_repo.bzl
  178. +1,021 −143 swc/private/versions.bzl
  179. +9 −0 swc/providers.bzl
  180. +122 −42 swc/repositories.bzl
  181. +0 −3 swc/tests/BUILD.bazel
  182. +0 −18 swc/tests/versions_test.bzl
  183. +11 −11 swc/toolchain.bzl
1 change: 1 addition & 0 deletions .aspect/bazelrc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
user.bazelrc
15 changes: 15 additions & 0 deletions .aspect/bazelrc/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
"Aspect bazelrc presets; see https://docs.aspect.build/guides/bazelrc"

load("@aspect_bazel_lib//lib:bazelrc_presets.bzl", "write_aspect_bazelrc_presets")

write_aspect_bazelrc_presets(
name = "update_aspect_bazelrc_presets",
presets = [
"ci",
"convenience",
"correctness",
"debug",
"javascript",
"performance",
],
)
1 change: 1 addition & 0 deletions .aspect/bazelrc/bazel7.bazelrc
66 changes: 66 additions & 0 deletions .aspect/bazelrc/ci.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Set this flag to enable re-tries of failed tests on CI.
# When any test target fails, try one or more times. This applies regardless of whether the "flaky"
# tag appears on the target definition.
# This is a tradeoff: legitimately failing tests will take longer to report,
# but we can paper over flaky tests that pass most of the time.
# The alternative is to mark every flaky test with the `flaky = True` attribute, but this requires
# the buildcop to make frequent code edits.
# Not recommended for local builds so that the flakiness is observed during development and thus
# is more likely to get fixed.
# Note that when passing after the first attempt, Bazel will give a special "FLAKY" status.
# Docs: https://bazel.build/docs/user-manual#flaky-test-attempts
test --flaky_test_attempts=2

# Announce all announces command options read from the bazelrc file(s) when starting up at the
# beginning of each Bazel invocation. This is very useful on CI to be able to inspect what Bazel rc
# settings are being applied on each run.
# Docs: https://bazel.build/docs/user-manual#announce-rc
build --announce_rc

# Add a timestamp to each message generated by Bazel specifying the time at which the message was
# displayed.
# Docs: https://bazel.build/docs/user-manual#show-timestamps
build --show_timestamps

# Only show progress every 60 seconds on CI.
# We want to find a compromise between printing often enough to show that the build isn't stuck,
# but not so often that we produce a long log file that requires a lot of scrolling.
# https://bazel.build/reference/command-line-reference#flag--show_progress_rate_limit
build --show_progress_rate_limit=60

# Use cursor controls in screen output.
# Docs: https://bazel.build/docs/user-manual#curses
build --curses=yes

# Use colors to highlight output on the screen. Set to `no` if your CI does not display colors.
# Docs: https://bazel.build/docs/user-manual#color
build --color=yes

# The terminal width in columns. Configure this to override the default value based on what your CI system renders.
# Docs: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/runtime/UiOptions.java#L151
build --terminal_columns=143

######################################
# Generic remote cache configuration #
######################################

# Only download remote outputs of top level targets to the local machine.
# Docs: https://bazel.build/reference/command-line-reference#flag--remote_download_toplevel
build --remote_download_toplevel

# The maximum amount of time to wait for remote execution and cache calls.
# https://bazel.build/reference/command-line-reference#flag--remote_timeout
build --remote_timeout=3600

# Upload locally executed action results to the remote cache.
# Docs: https://bazel.build/reference/command-line-reference#flag--remote_upload_local_results
build --remote_upload_local_results

# Fall back to standalone local execution strategy if remote execution fails. If the grpc remote
# cache connection fails, it will fail the build, add this so it falls back to the local cache.
# Docs: https://bazel.build/reference/command-line-reference#flag--remote_local_fallback
build --remote_local_fallback

# Fixes builds hanging on CI that get the TCP connection closed without sending RST packets.
# Docs: https://bazel.build/reference/command-line-reference#flag--grpc_keepalive_time
build --grpc_keepalive_time=30s
28 changes: 28 additions & 0 deletions .aspect/bazelrc/convenience.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Attempt to build & test every target whose prerequisites were successfully built.
# Docs: https://bazel.build/docs/user-manual#keep-going
build --keep_going

# Output test errors to stderr so users don't have to `cat` or open test failure log files when test
# fail. This makes the log noiser in exchange for reducing the time-to-feedback on test failures for
# users.
# Docs: https://bazel.build/docs/user-manual#test-output
test --test_output=errors

# Show the output files created by builds that requested more than one target. This helps users
# locate the build outputs in more cases
# Docs: https://bazel.build/docs/user-manual#show-result
build --show_result=20

# Bazel picks up host-OS-specific config lines from bazelrc files. For example, if the host OS is
# Linux and you run bazel build, Bazel picks up lines starting with build:linux. Supported OS
# identifiers are `linux`, `macos`, `windows`, `freebsd`, and `openbsd`. Enabling this flag is
# equivalent to using `--config=linux` on Linux, `--config=windows` on Windows, etc.
# Docs: https://bazel.build/reference/command-line-reference#flag--enable_platform_specific_config
common --enable_platform_specific_config

# Output a heap dump if an OOM is thrown during a Bazel invocation
# (including OOMs due to `--experimental_oom_more_eagerly_threshold`).
# The dump will be written to `<output_base>/<invocation_id>.heapdump.hprof`.
# You may need to configure CI to capture this artifact and upload for later use.
# Docs: https://bazel.build/reference/command-line-reference#flag--heap_dump_on_oom
common --heap_dump_on_oom
75 changes: 75 additions & 0 deletions .aspect/bazelrc/correctness.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# Do not upload locally executed action results to the remote cache.
# This should be the default for local builds so local builds cannot poison the remote cache.
# It should be flipped to `--remote_upload_local_results` on CI
# by using `--bazelrc=.aspect/bazelrc/ci.bazelrc`.
# Docs: https://bazel.build/reference/command-line-reference#flag--remote_upload_local_results
build --noremote_upload_local_results

# Don't allow network access for build actions in the sandbox.
# Ensures that you don't accidentally make non-hermetic actions/tests which depend on remote
# services.
# Developers should tag targets with `tags=["requires-network"]` to opt-out of the enforcement.
# Docs: https://bazel.build/reference/command-line-reference#flag--sandbox_default_allow_network
build --sandbox_default_allow_network=false

# Warn if a test's timeout is significantly longer than the test's actual execution time.
# Bazel's default for test_timeout is medium (5 min), but most tests should instead be short (1 min).
# While a test's timeout should be set such that it is not flaky, a test that has a highly
# over-generous timeout can hide real problems that crop up unexpectedly.
# For instance, a test that normally executes in a minute or two should not have a timeout of
# ETERNAL or LONG as these are much, much too generous.
# Docs: https://bazel.build/docs/user-manual#test-verbose-timeout-warnings
test --test_verbose_timeout_warnings

# Allow the Bazel server to check directory sources for changes. Ensures that the Bazel server
# notices when a directory changes, if you have a directory listed in the srcs of some target.
# Recommended when using
# [copy_directory](https://github.com/aspect-build/bazel-lib/blob/main/docs/copy_directory.md) and
# [rules_js](https://github.com/aspect-build/rules_js) since npm package are source directories
# inputs to copy_directory actions.
# Docs: https://bazel.build/reference/command-line-reference#flag--host_jvm_args
startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1

# Allow exclusive tests to run in the sandbox. Fixes a bug where Bazel doesn't enable sandboxing for
# tests with `tags=["exclusive"]`.
# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_exclusive_test_sandboxed
test --incompatible_exclusive_test_sandboxed

# Use a static value for `PATH` and does not inherit `LD_LIBRARY_PATH`. Doesn't let environment
# variables like `PATH` sneak into the build, which can cause massive cache misses when they change.
# Use `--action_env=ENV_VARIABLE` if you want to inherit specific environment variables from the
# client, but note that doing so can prevent cross-user caching if a shared cache is used.
# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_strict_action_env
build --incompatible_strict_action_env

# Propagate tags from a target declaration to the actions' execution requirements.
# Ensures that tags applied in your BUILD file, like `tags=["no-remote"]`
# get propagated to actions created by the rule.
# Without this option, you rely on rules authors to manually check the tags you passed
# and apply relevant ones to the actions they create.
# See https://github.com/bazelbuild/bazel/issues/8830 for details.
# Docs: https://bazel.build/reference/command-line-reference#flag--experimental_allow_tags_propagation
build --experimental_allow_tags_propagation
fetch --experimental_allow_tags_propagation
query --experimental_allow_tags_propagation

# Do not automatically create `__init__.py` files in the runfiles of Python targets. Fixes the wrong
# default that comes from Google's internal monorepo by using `__init__.py` to delimit a Python
# package. Precisely, when a `py_binary` or `py_test` target has `legacy_create_init` set to `auto (the
# default), it is treated as false if and only if this flag is set. See
# https://github.com/bazelbuild/bazel/issues/10076.
# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_default_to_explicit_init_py
build --incompatible_default_to_explicit_init_py

# Set default value of `allow_empty` to `False` in `glob()`. This prevents a common mistake when
# attempting to use `glob()` to match files in a subdirectory that is opaque to the current package
# because it contains a BUILD file. See https://github.com/bazelbuild/bazel/issues/8195.
# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_disallow_empty_glob
common --incompatible_disallow_empty_glob

# Always download coverage files for tests from the remote cache. By default, coverage files are not
# downloaded on test result cahce hits when --remote_download_minimal is enabled, making it impossible
# to generate a full coverage report.
# Docs: https://bazel.build/reference/command-line-reference#flag--experimental_fetch_all_coverage_outputs
# detching remote cache results
test --experimental_fetch_all_coverage_outputs
19 changes: 19 additions & 0 deletions .aspect/bazelrc/debug.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
############################################################
# Use `bazel test --config=debug` to enable these settings #
############################################################

# Stream stdout/stderr output from each test in real-time.
# Docs: https://bazel.build/docs/user-manual#test-output
test:debug --test_output=streamed

# Run one test at a time.
# Docs: https://bazel.build/reference/command-line-reference#flag--test_strategy
test:debug --test_strategy=exclusive

# Prevent long running tests from timing out.
# Docs: https://bazel.build/docs/user-manual#test-timeout
test:debug --test_timeout=9999

# Always run tests even if they have cached results.
# Docs: https://bazel.build/docs/user-manual#cache-test-results
test:debug --nocache_test_results
11 changes: 11 additions & 0 deletions .aspect/bazelrc/javascript.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Aspect recommended Bazel flags when using Aspect's JavaScript rules: https://github.com/aspect-build/rules_js
# Docs for Node.js flags: https://nodejs.org/en/docs/guides/debugging-getting-started/#command-line-options

# Support for debugging Node.js tests. Use bazel run with `--config=debug` to turn on the NodeJS
# inspector agent. The node process will break before user code starts and wait for the debugger to
# connect. Pass the --inspect-brk option to all tests which enables the node inspector agent. See
# https://nodejs.org/de/docs/guides/debugging-getting-started/#command-line-options for more
# details.
# Docs: https://nodejs.org/en/docs/guides/debugging-getting-started/#command-line-options
run:debug -- --node_options=--inspect-brk
test:debug --test_env=NODE_OPTIONS=--inspect-brk
20 changes: 20 additions & 0 deletions .aspect/bazelrc/performance.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Don't apply `--noremote_upload_local_results` and `--noremote_accept_cached` to the disk cache.
# If you have both `--noremote_upload_local_results` and `--disk_cache`, then this fixes a bug where
# Bazel doesn't write to the local disk cache as it treats as a remote cache.
# Docs: https://bazel.build/reference/command-line-reference#flag--incompatible_remote_results_ignore_disk
build --incompatible_remote_results_ignore_disk

# Directories used by sandboxed non-worker execution may be reused to avoid unnecessary setup costs.
# Save time on Sandbox creation and deletion when many of the same kind of action run during the
# build.
# No longer experimental in Bazel 6: https://github.com/bazelbuild/bazel/commit/c1a95501a5611878e5cc43a3cc531f2b9e47835b
# Docs: https://bazel.build/reference/command-line-reference#flag--reuse_sandbox_directories
build --experimental_reuse_sandbox_directories

# Do not build runfiles symlink forests for external repositories under
# `.runfiles/wsname/external/repo` (in addition to `.runfiles/repo`). This reduces runfiles &
# sandbox creation times & prevents accidentally depending on this feature which may flip to off by
# default in the future. Note, some rules may fail under this flag, please file issues with the rule
# author.
# Docs: https://bazel.build/reference/command-line-reference#flag--legacy_external_runfiles
build --nolegacy_external_runfiles
5 changes: 4 additions & 1 deletion .bazelignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
e2e/
e2e/
examples/node_modules
examples/generate_swcrc/node_modules
examples/plugins/node_modules
2 changes: 0 additions & 2 deletions .bazeliskrc

This file was deleted.

33 changes: 18 additions & 15 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
# Bazel settings that apply to this repository.
# Take care to document any settings that you expect users to apply.
# Settings that apply only to CI are in .github/workflows/ci.bazelrc
# Import Aspect bazelrc presets
try-import %workspace%/.aspect/bazelrc/bazel7.bazelrc
import %workspace%/.aspect/bazelrc/convenience.bazelrc
import %workspace%/.aspect/bazelrc/correctness.bazelrc
import %workspace%/.aspect/bazelrc/debug.bazelrc
import %workspace%/.aspect/bazelrc/javascript.bazelrc
import %workspace%/.aspect/bazelrc/performance.bazelrc

build --enable_runfiles
# Workaround for https://github.com/swc-project/swc/issues/4057
# Turn off sandboxing so SWC doesn't observe symlinked inputs.
build --modify_execution_info=SWCTranspile=+no-sandbox
### YOUR PROJECT SPECIFIC OPTIONS GO HERE ###

# Load any settings specific to the current user.
# .bazelrc.user should appear in .gitignore so that settings are not shared with team members
# This needs to be last statement in this
# config, as the user configuration should be able to overwrite flags from this file.
# See https://docs.bazel.build/versions/master/best-practices.html#bazelrc
# (Note that we use .bazelrc.user so the file appears next to .bazelrc in directory listing,
# rather than user.bazelrc as suggested in the Bazel docs)
try-import %workspace%/.bazelrc.user
# Don’t want to push a rules author to update their deps if not needed.
# https://bazel.build/reference/command-line-reference#flag--check_direct_dependencies
# https://bazelbuild.slack.com/archives/C014RARENH0/p1691158021917459?thread_ts=1691156601.420349&cid=C014RARENH0
common --check_direct_dependencies=off

# Load any settings & overrides specific to the current user from `.aspect/bazelrc/user.bazelrc`.
# This file should appear in `.gitignore` so that settings are not shared with team members. This
# should be last statement in this config so the user configuration is able to overwrite flags from
# this file. See https://bazel.build/configure/best-practices#bazelrc-file.
try-import %workspace%/.aspect/bazelrc/user.bazelrc
8 changes: 1 addition & 7 deletions .bazelversion
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
6.0.0rc2
# The first line of this file is used by Bazelisk and Bazel to be sure
# the right version of Bazel is used to build and test this repo.
# This also defines which version is used on CI.
#
# Note that you should also run integration_tests against other Bazel
# versions you support.
7.1.1
3 changes: 3 additions & 0 deletions .bcr/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fixedReleaser:
login: alexeagle
email: alex@aspect.build
18 changes: 18 additions & 0 deletions .bcr/metadata.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"homepage": "https://docs.aspect.build/rules/aspect_rules_swc",
"maintainers": [
{
"email": "alex@aspect.build",
"github": "alexeagle",
"name": "Alex Eagle"
},
{
"email": "jason@aspect.build",
"github": "jbedard",
"name": "Jason Bedard"
}
],
"repository": ["github:aspect-build/rules_swc"],
"versions": [],
"yanked_versions": {}
}
12 changes: 12 additions & 0 deletions .bcr/presubmit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
bcr_test_module:
module_path: "e2e/smoke"
matrix:
bazel: ["7.x", "6.x"]
platform: ["debian10", "macos", "ubuntu2004", "windows"]
tasks:
run_tests:
name: "Run test module"
bazel: ${{ bazel }}
platform: ${{ platform }}
test_targets:
- "//..."
5 changes: 5 additions & 0 deletions .bcr/source.template.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"integrity": "**leave this alone**",
"strip_prefix": "{REPO}-{VERSION}",
"url": "https://github.com/{OWNER}/{REPO}/releases/download/{TAG}/rules_swc-{TAG}.tar.gz"
}
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
docs/*.md linguist-generated=true
docs/repositories.md linguist-generated=true
docs/swc.md linguist-generated=true
9 changes: 9 additions & 0 deletions .github/workflows/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@aspect_bazel_lib//lib:bazelrc_presets.bzl", "write_aspect_bazelrc_presets")

write_aspect_bazelrc_presets(
name = "update_aspect_bazelrc_presets",
presets = [
"bazel6",
"bazel7",
],
)
27 changes: 27 additions & 0 deletions .github/workflows/bazel6.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Speed up all builds by not checking if external repository files have been modified.
# Docs: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/bazel/repository/RepositoryOptions.java#L244
build --noexperimental_check_external_repository_files
fetch --noexperimental_check_external_repository_files
query --noexperimental_check_external_repository_files

# Directories used by sandboxed non-worker execution may be reused to avoid unnecessary setup costs.
# Save time on Sandbox creation and deletion when many of the same kind of action run during the
# build.
# Docs: https://bazel.build/reference/command-line-reference#flag--reuse_sandbox_directories
build --reuse_sandbox_directories

# Avoid this flag being enabled by remote_download_minimal or remote_download_toplevel
# See https://meroton.com/blog/bazel-6-errors-build-without-the-bytes/
build --noexperimental_action_cache_store_output_metadata

# Speed up all builds by not checking if output files have been modified. Lets you make changes to
# the output tree without triggering a build for local debugging. For example, you can modify
# [rules_js](https://github.com/aspect-build/rules_js) 3rd party npm packages in the output tree
# when local debugging.
# Docs: https://github.com/bazelbuild/bazel/blob/1af61b21df99edc2fc66939cdf14449c2661f873/src/main/java/com/google/devtools/build/lib/pkgcache/PackageOptions.java#L185
# NB: This flag is in bazel6.bazelrc as when used in Bazel 7 is has been observed to break
# "build without the bytes" --remote_download_outputs=toplevel. See https://github.com/aspect-build/bazel-lib/pull/711
# for more info.
build --noexperimental_check_output_files
fetch --noexperimental_check_output_files
query --noexperimental_check_output_files
Loading