Skip to content

Commit

Permalink
Include README.md files in Bazel-generated npm packages (#5542)
Browse files Browse the repository at this point in the history
Add README.md to the srcs attribute of the pkg_npm rule in tfjs-core and tfjs-backend-cpu and update the Bazel migration docs with instructions to do this.
  • Loading branch information
mattsoulanille authored Aug 27, 2021
1 parent 68d18c9 commit 0b358cc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
9 changes: 7 additions & 2 deletions BAZEL_MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -314,14 +314,19 @@ load("@build_bazel_rules_nodejs//:index.bzl", "pkg_npm")

pkg_npm(
name = "tfjs-core_pkg",
srcs = ["package.json"],
srcs = [
# Add any static files the package should include here
"package.json",
"README.md",
],
tags = ["ci"],
deps = [
":copy_bundles",
":copy_miniprogram",
":copy_miniprogram_map",
":copy_src_to_dist",
":copy_test_snippets", # <- This is only in core, so I've omitted its definition.
":copy_test_snippets", # <- This is only in core, so I've omitted its
# definition in these docs.
],
)
```
Expand Down
5 changes: 4 additions & 1 deletion tfjs-backend-cpu/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,10 @@ copy_to_dist(

pkg_npm(
name = "tfjs-backend-cpu_pkg",
srcs = ["package.json"],
srcs = [
"README.md",
"package.json",
],
tags = ["ci"],
deps = [
":copy_bundles",
Expand Down
5 changes: 4 additions & 1 deletion tfjs-core/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ copy_file(

pkg_npm(
name = "tfjs-core_pkg",
srcs = ["package.json"],
srcs = [
"README.md",
"package.json",
],
tags = ["ci"],
deps = [
":copy_bundles",
Expand Down

0 comments on commit 0b358cc

Please sign in to comment.