-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add npm_package(root_paths) test (#496)
- Loading branch information
Showing
9 changed files
with
159 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
load("@aspect_rules_js//npm:defs.bzl", "npm_package") | ||
|
||
# The terminal npm_package target for this package. This target is linked | ||
# manually in the root of the pnpm workspace with `npm_link_package`. | ||
# This npm_package uses root_paths[] to pull some files into the root package | ||
# to test cases such as https://github.com/aspect-build/rules_js/issues/471. | ||
npm_package( | ||
name = "pkg_c1", | ||
srcs = [ | ||
"data1/package.json", | ||
"data1/pkg-c.json", | ||
"src/index.js", | ||
], | ||
package = "@mycorp/pkg-c1", | ||
root_paths = [ | ||
package_name(), | ||
package_name() + "/src", | ||
package_name() + "/data1", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
npm_package( | ||
name = "pkg_c2", | ||
srcs = [ | ||
"data2/package.json", | ||
"data2/pkg-c.json", | ||
"src/index.js", | ||
], | ||
package = "@mycorp/pkg-c2", | ||
root_paths = [ | ||
package_name(), | ||
package_name() + "/src", | ||
package_name() + "/data2", | ||
], | ||
visibility = ["//visibility:public"], | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# @mycorp/pkg-c* 1+2* packages | ||
|
||
'@mycorp/pkg-c1' and '@mycorp/pkg-c2' are an example of packages using different | ||
configurations of `npm_package(root_paths)` to produce different packages. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "@mycorp/pkg-c1", | ||
"private": true, | ||
"dependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "c1" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name": "@mycorp/pkg-c2", | ||
"private": true, | ||
"dependencies": {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "c2" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = require('./pkg-c.json') |