Skip to content

Commit

Permalink
fix: @swc_cli repository is referenced at runtime, so users have to c…
Browse files Browse the repository at this point in the history
…reate it too (#29)
  • Loading branch information
alexeagle authored Apr 27, 2022
1 parent d0ed845 commit 8a3ed72
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/workspace_snippet.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,11 @@ 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,
)
\`\`\`
EOF
10 changes: 0 additions & 10 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,6 @@ nodejs_register_toolchains(
node_version = "16.9.0",
)

load("@aspect_rules_js//js:npm_import.bzl", "translate_pnpm_lock")

# This is used to generate code in this repo, but otherwise unused
# at runtime or by users directly.
translate_pnpm_lock(
name = "swc_cli",
node_repository = "node16",
pnpm_lock = "@aspect_rules_swc//swc:pnpm-lock.yaml",
)

load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")

bazel_skylib_workspace()
Expand Down
10 changes: 9 additions & 1 deletion swc/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ These are needed for local dev, and users must install them as well.
See https://docs.bazel.build/versions/main/skylark/deploying.html#dependencies
"""

load("@aspect_rules_js//js:npm_import.bzl", "npm_import")
load("@aspect_rules_js//js:npm_import.bzl", "npm_import", "translate_pnpm_lock")
load("//swc/private:toolchains_repo.bzl", "PLATFORMS", "toolchains_repo")
load("//swc/private:versions.bzl", "TOOL_VERSIONS")
load("//swc:cli_repositories.bzl", _cli_repositories = "npm_repositories")
Expand Down Expand Up @@ -95,4 +95,12 @@ def swc_register_toolchains(name, register = True, **kwargs):
version = "1.1.0",
)

translate_pnpm_lock(
name = "swc_cli",
node_repository = "node16",
pnpm_lock = "@aspect_rules_swc//swc:pnpm-lock.yaml",
)

# We ALSO re-declare the results of the previous translate_pnpm_lock
# so that users don't have to make an extra load/execution in their WORKSPACE
_cli_repositories()

0 comments on commit 8a3ed72

Please sign in to comment.