| load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files") |
| load("@bazel_skylib//rules:build_test.bzl", "build_test") |
| load("@npm//:defs.bzl", "npm_link_all_packages") |
| |
| npm_link_all_packages(name = "node_modules") |
| |
| build_test( |
| name = "test", |
| targets = [ |
| ":node_modules", |
| ], |
| ) |
| |
| # Strip the system-dependent 'system_tar' attribute from the generated repositories.bzl |
| genrule( |
| name = "npm_translate_lock_wksp-repositories", |
| srcs = ["@npm//:repositories.bzl"], |
| outs = ["wksp_repos_stripped.bzl"], |
| cmd = 'sed "s/system_tar = .*,/system_tar = \\"xxx\\",/" "$<" > "$@"', |
| target_compatible_with = select({ |
| "@aspect_bazel_lib//lib:bzlmod": ["@platforms//:incompatible"], |
| "//conditions:default": [], |
| }), |
| ) |
| |
| write_source_files( |
| name = "write_npm_translate_lock_wksp", |
| files = { |
| "snapshots/wksp/repositories.bzl": ":npm_translate_lock_wksp-repositories", |
| }, |
| target_compatible_with = select({ |
| "@aspect_bazel_lib//lib:bzlmod": ["@platforms//:incompatible"], |
| "//conditions:default": [], |
| }), |
| ) |