Skip to content

Commit

Permalink
chore: add MODULE.bazel file
Browse files Browse the repository at this point in the history
rules_swc 0.3.0 is published on bazel-central-registry, but we haven't kept it current.

Part of #134
  • Loading branch information
alexeagle committed Jan 7, 2023
1 parent 4a9af79 commit 031ccde
Show file tree
Hide file tree
Showing 9 changed files with 50 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ jobs:
bazelversion: ${{ fromJSON(needs.matrix-prep-bazelversion.outputs.bazelversions) }}
folder:
- "."
- "e2e/bzlmod"
- "e2e/workspace"
exclude:
# Don't test bzlmod with Bazel 5 (not supported)
- bazelversion: 5.3.2
folder: e2e/bzlmod

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
Expand Down
19 changes: 19 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"aspect-build/rules_swc"

module(
name = "aspect_rules_swc",
compatibility_level = 1,
version = "0.0.0",
)

bazel_dep(name = "aspect_bazel_lib", version = "1.19.0")
# Note: only used for provider symbols, we don't spawn nodejs actions
bazel_dep(name = "aspect_rules_js", version = "1.13.0")
bazel_dep(name = "bazel_skylib", version = "1.3.0")
bazel_dep(name = "platforms", version = "0.0.4")

swc = use_extension("@aspect_rules_swc//swc:extensions.bzl", "swc")
swc.toolchain(name = "swc", swc_version = "v1.3.25")
use_repo(swc, "swc_toolchains")

register_toolchains("@swc_toolchains//:all")
1 change: 1 addition & 0 deletions e2e/bzlmod/.bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
common --enable_bzlmod
1 change: 1 addition & 0 deletions e2e/bzlmod/.bazelversion
1 change: 1 addition & 0 deletions e2e/bzlmod/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
9 changes: 9 additions & 0 deletions e2e/bzlmod/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
load("@bazel_skylib//rules:build_test.bzl", "build_test")
load("@aspect_rules_swc//swc:defs.bzl", "swc")

swc(name = "compile")

build_test(
name = "test",
targets = [":compile"],
)
10 changes: 10 additions & 0 deletions e2e/bzlmod/MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
"Bazel dependencies"
module(name = "e2e_bzlmod")

bazel_dep(name = "aspect_rules_swc", dev_dependency = True, version = "0.0.0")
bazel_dep(name = "bazel_skylib", dev_dependency = True, version = "1.3.0")

local_path_override(
module_name = "aspect_rules_swc",
path = "../..",
)
1 change: 1 addition & 0 deletions e2e/bzlmod/WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Empty marker that this folder is the root of a Bazel workspace
3 changes: 3 additions & 0 deletions e2e/bzlmod/foo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const hello = () => {
console.log("hello world");
};

0 comments on commit 031ccde

Please sign in to comment.