| load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm") |
| load("//packages/typescript:index.bzl", "ts_project") |
| load("@bazel_skylib//rules:write_file.bzl", "write_file") |
| |
| write_file( |
| name = "produces_files", |
| out = "a_dep", |
| content = ["a_dep content"], |
| ) |
| |
| ts_project( |
| name = "ts_project", |
| srcs = ["foo.ts"], |
| data = ["data.json"], |
| tsconfig = {}, |
| ) |
| |
| pkg_npm( |
| name = "dependent_pkg", |
| srcs = ["dependent_file"], |
| ) |
| |
| pkg_npm( |
| name = "test_pkg", |
| package_name = "test-pkg", |
| srcs = [ |
| "package.json", |
| "some_file", |
| ], |
| nested_packages = [":dependent_pkg"], |
| stamp = "@rules_nodejs//nodejs/stamp:always", |
| substitutions = { |
| "0.0.0-PLACEHOLDER": "{BUILD_SCM_VERSION}", |
| "replace_me": "replaced", |
| }, |
| deps = [ |
| ":produces_files", |
| ":ts_project", |
| "//internal/pkg_npm/test/transition:test_lib", |
| ], |
| ) |
| |
| pkg_npm( |
| name = "test_noop_pkg", |
| ) |
| |
| pkg_npm( |
| name = "test_noop2_pkg", |
| ) |
| |
| sh_test( |
| name = "test_pkg_pack", |
| srcs = ["diff_pack_dir.sh"], |
| args = [ |
| "$(rootpath :test_pkg.pack)", |
| "$(rootpath :test_pkg)", |
| ], |
| data = [ |
| ":test_pkg", |
| ":test_pkg.pack", |
| "//third_party/github.com/bazelbuild/bazel/tools/bash/runfiles", |
| ], |
| tags = ["no-rbe"], |
| ) |
| |
| genrule( |
| name = "bundle", |
| outs = ["bundle.min.js"], |
| cmd = "echo -n 'bundle content' > $@", |
| ) |