Skip to content

Releases: aspect-build/rules_swc

v0.5.2

05 May 15:18
57d030f
Compare
Choose a tag to compare
v0.5.2 Pre-release
Pre-release

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_swc",
    sha256 = "8d991cc5f9373eccb172a3be388215519a460008b49d5034259ee9d10de3e632",
    strip_prefix = "rules_swc-0.5.2",
    url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.5.2.tar.gz",
)

###################
# rules_swc setup #
###################

# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")

rules_swc_dependencies()

# Fetches a pre-built Rust-node binding from
# https://github.com/swc-project/swc/releases.
# If you'd rather compile it from source, you can use rules_rust, fetch the project,
# then register the toolchain yourself. (Note, this is not yet documented)
load("@aspect_rules_swc//swc:repositories.bzl", "LATEST_VERSION", "swc_register_toolchains")

swc_register_toolchains(
    name = "swc",
    swc_version = LATEST_VERSION,
)

# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "DEFAULT_NODE_VERSION", "nodejs_register_toolchains")

nodejs_register_toolchains(
    name = "nodejs",
    node_version = DEFAULT_NODE_VERSION,
)

# yq is needed for converting pnpm-lock.yaml into json
# so that it can be parsed in starlark.
load("@aspect_bazel_lib//lib:repositories.bzl", "DEFAULT_YQ_VERSION", "register_yq_toolchains")

register_yq_toolchains(
    version = DEFAULT_YQ_VERSION,
)

What's Changed

  • ci: add e2e asserting that setup works for users by @alexeagle in #30

Full Changelog: v0.5.1...v0.5.2

v0.5.1

27 Apr 01:05
8a3ed72
Compare
Choose a tag to compare
v0.5.1 Pre-release
Pre-release

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_swc",
    sha256 = "422126a732de2a858eb29ee24df6da29964bdd93c8b141e2f83a5119adf36686",
    strip_prefix = "rules_swc-0.5.1",
    url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.5.1.tar.gz",
)

# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")
rules_swc_dependencies()

# Fetches a pre-built Rust-node binding from
# https://github.com/swc-project/swc/releases.
# If you'd rather compile it from source, you can use rules_rust, fetch the project,
# then register the toolchain yourself. (Note, this is not yet documented)
load("@aspect_rules_swc//swc:repositories.bzl", "swc_register_toolchains")
swc_register_toolchains(
    name = "swc",
    swc_version = "v1.2.168",
)

# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
    name = "node16",
    node_version = "16.9.0",
)
load("@aspect_bazel_lib//lib:repositories.bzl", "DEFAULT_YQ_VERSION", "register_yq_toolchains")

register_yq_toolchains(
    version = DEFAULT_YQ_VERSION,
)

What's Changed

  • fix: @swc_cli repository is referenced at runtime, so users have to c… by @alexeagle in #29

Full Changelog: v0.5.0...v0.5.1

v0.5.0

26 Apr 23:04
d0ed845
Compare
Choose a tag to compare
v0.5.0 Pre-release
Pre-release

BREAKING CHANGES:

  • The .swcrc file is now read from the bazel-out tree. If yours is not in the same Bazel package with the callsite to swc or swc_transpile then you'll need a copy_file rule to make a copy in the right spot.

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_swc",
    sha256 = "0f944b06d2cadde68b2b0487bbb06a2716e81e3c00ececf0f850c3c912ea9eaf",
    strip_prefix = "rules_swc-0.5.0",
    url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.5.0.tar.gz",
)

# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")
rules_swc_dependencies()

# Fetches a pre-built Rust-node binding from
# https://github.com/swc-project/swc/releases.
# If you'd rather compile it from source, you can use rules_rust, fetch the project,
# then register the toolchain yourself. (Note, this is not yet documented)
load("@aspect_rules_swc//swc:repositories.bzl", "swc_register_toolchains")
swc_register_toolchains(
    name = "swc",
    swc_version = "v1.2.168",
)

# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
    name = "node16",
    node_version = "16.9.0",
)

What's Changed

New Contributors

Full Changelog: v0.4.0...v0.5.0

v0.4.0

18 Feb 20:27
Compare
Choose a tag to compare
v0.4.0 Pre-release
Pre-release

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_swc",
    sha256 = "206a89aae3a04831123b43962a3864e8ab1652b703c4af58d84b04174360137d",
    strip_prefix = "rules_swc-0.4.0",
    url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.4.0.tar.gz",
)

# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")
rules_swc_dependencies()

# Fetches a pre-built Rust-node binding from
# https://github.com/swc-project/swc/releases.
# If you'd rather compile it from source, you can use rules_rust, fetch the project,
# then register the toolchain yourself. (Note, this is not yet documented)
load("@aspect_rules_swc//swc:repositories.bzl", "swc_register_toolchains")
swc_register_toolchains(
    name = "swc",
    swc_version = "v1.2.141",
)

# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
    name = "node16",
    node_version = "16.9.0",
)

What's Changed

New Contributors

Full Changelog: v0.3.1...v0.4.0

v0.3.1

23 Dec 19:00
Compare
Choose a tag to compare
v0.3.1 Pre-release
Pre-release

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_swc",
    sha256 = "b58c8f3681215af30842bc3eeec30c9d2047cdf63302bba7d2e86c55a5c77edf",
    strip_prefix = "rules_swc-0.3.1",
    url = "https://github.com/aspect-build/rules_swc/archive/refs/tags/v0.3.1.tar.gz",
)

# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")
rules_swc_dependencies()

# Fetches a pre-built Rust-node binding from
# https://github.com/swc-project/swc/releases.
# If you'd rather compile it from source, you can use rules_rust, fetch the project,
# then register the toolchain yourself. (Note, this is not yet documented)
load("@aspect_rules_swc//swc:repositories.bzl", "swc_register_toolchains")
swc_register_toolchains(
    name = "swc",
    swc_version = "v1.2.118",
)

# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
    name = "node16",
    node_version = "16.9.0",
)

What's Changed

  • fix: don't relativize paths to the swcrc location by @alexeagle in #12
  • expose the raw swc rule as public API by @alexeagle in #13
  • fix: allow user to choose non-.js extensions for outputs by @alexeagle in #14
  • fix: output directory should be declared as directory by @alexeagle in #15

Full Changelog: v0.3.0...v0.3.1

v0.3.0

20 Dec 19:27
Compare
Choose a tag to compare
v0.3.0 Pre-release
Pre-release

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_swc",
    sha256 = "69465080d769fcaf5088bb74c67739a08ead89c8cde7911053843c4c44f895be",
    strip_prefix = "rules_swc-0.3.0",
    url = "https://github.com/aspect-build/rules_swc/archive/v0.3.0.tar.gz",
)

# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")
rules_swc_dependencies()

# Fetches a pre-built Rust-node binding from
# https://github.com/swc-project/swc/releases.
# If you'd rather compile it from source, you can use rules_rust, fetch the project,
# then register the toolchain yourself. (Note, this is not yet documented)
load("@aspect_rules_swc//swc:repositories.bzl", "swc_register_toolchains")
swc_register_toolchains(
    name = "swc",
    swc_version = "v1.2.118",
)

# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
    name = "node16",
    node_version = "16.9.0",
)

What's Changed

Full Changelog: v0.2.1...v0.3.0

v0.2.1

18 Dec 00:08
e0d5c19
Compare
Choose a tag to compare
v0.2.1 Pre-release
Pre-release

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_swc",
    sha256 = "a1662c953c06e4440d253428f3a7e7ed3c4ca6bc108661ec851323c7fcde2212",
    strip_prefix = "rules_swc-0.2.1",
    url = "https://github.com/aspect-build/rules_swc/archive/v0.2.1.tar.gz",
)

# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")
rules_swc_dependencies()

# Fetches a pre-built Rust-node binding from
# https://github.com/swc-project/swc/releases.
# If you'd rather compile it from source, you can use rules_rust, fetch the project,
# then register the toolchain yourself. (Note, this is not yet documented)
load("@aspect_rules_swc//swc:repositories.bzl", "swc_register_toolchains")
swc_register_toolchains(
    name = "swc",
    swc_version = "v1.2.118",
)

# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
    name = "node16",
    node_version = "16.9.0",
)

# Fetches the npm packages needed to run @swc/cli
load("@swc_cli//:repositories.bzl", _swc_cli_deps = "npm_repositories")
_swc_cli_deps()

What's Changed

  • fix: don't try to declare swc toolchain for target platform by @alexeagle in #9

Full Changelog: v0.2.0...v0.2.1

v0.2.0

14 Dec 19:52
300e69c
Compare
Choose a tag to compare
v0.2.0 Pre-release
Pre-release

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_swc",
    sha256 = "2437cd6ca29748816dd50fac05e0f8fdeb44ede77df282fd4e65383da81a0ce0",
    strip_prefix = "rules_swc-0.2.0",
    url = "https://github.com/aspect-build/rules_swc/archive/v0.2.0.tar.gz",
)

# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")
rules_swc_dependencies()

# Fetches a pre-built Rust-node binding from
# https://github.com/swc-project/swc/releases.
# If you'd rather compile it from source, you can use rules_rust, fetch the project,
# then register the toolchain yourself. (Note, this is not yet documented)
load("@aspect_rules_swc//swc:repositories.bzl", "swc_register_toolchains")
swc_register_toolchains(
    name = "swc",
    swc_version = "v1.2.118",
)

# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
    name = "node16",
    node_version = "16.9.0",
)

# Fetches the npm packages needed to run @swc/cli
load("@swc_cli//:repositories.bzl", _swc_cli_deps = "npm_repositories")
_swc_cli_deps()

What's Changed

New Contributors

Full Changelog: https://github.com/aspect-build/rules_swc/commits/v0.2.0

v0.1.0

11 Dec 21:30
Compare
Choose a tag to compare
v0.1.0 Pre-release
Pre-release

WORKSPACE snippet:

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
    name = "aspect_rules_swc",
    sha256 = "67d6020374627f60c6c1e5d5e1690fcdc4fa39952de8a727d3aabe265ca843be",
    strip_prefix = "rules_swc-0.1.0",
    url = "https://github.com/aspect-build/rules_swc/archive/v0.1.0.tar.gz",
)

# Fetches the rules_swc dependencies.
# If you want to have a different version of some dependency,
# you should fetch it *before* calling this.
# Alternatively, you can skip calling this function, so long as you've
# already fetched all the dependencies.
load("@aspect_rules_swc//swc:dependencies.bzl", "rules_swc_dependencies")
rules_swc_dependencies()

# Fetches a pre-built Rust-node binding from
# https://github.com/swc-project/swc/releases.
# If you'd rather compile it from source, you can use rules_rust, fetch the project,
# then register the toolchain yourself. (Note, this is not yet documented)
load("@aspect_rules_swc//swc:repositories.bzl", "swc_register_toolchains")
swc_register_toolchains(
    name = "swc",
    swc_version = "v1.2.118",
)

# Fetches a NodeJS interpreter, needed to run the swc CLI.
# You can skip this if you already register a nodejs toolchain.
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
nodejs_register_toolchains(
    name = "node16",
    node_version = "16.9.0",
)

# Fetches the npm packages needed to run @swc/cli
load("@swc_cli//:repositories.bzl", _swc_cli_deps = "npm_repositories")
_swc_cli_deps()

What's Changed

  • feat: custom rule rather than a genrule by @alexeagle in #1
  • Change to match upstream swc change by @alexeagle in #2
  • fix(swc): suppress swc output by default by @mattem in #4

New Contributors

  • @mattem made their first contribution in #4

Full Changelog: https://github.com/aspect-build/rules_swc/commits/v0.1.0