-
-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: transitive js_library npm package deps
- Loading branch information
Showing
31 changed files
with
285 additions
and
17 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
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,26 @@ | ||
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_test") | ||
load("@npm//:defs.bzl", "npm_link_all_packages") | ||
|
||
npm_link_all_packages(name = "node_modules") | ||
|
||
js_binary( | ||
name = "main", | ||
args = ["foo"], | ||
data = [ | ||
":node_modules/@aspect-test", | ||
":node_modules/@lib/d", | ||
"//:node_modules/@aspect-test", | ||
], | ||
entry_point = "main.js", | ||
) | ||
|
||
js_test( | ||
name = "test", | ||
args = ["foo"], | ||
data = [ | ||
":node_modules", | ||
"//:node_modules/@aspect-test", | ||
], | ||
entry_point = "main.js", | ||
log_level = "info", | ||
) |
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,7 @@ | ||
console.log(process.argv) | ||
console.log('--@aspect-test/a--', require('@aspect-test/a').id()) | ||
console.log('--@aspect-test/b--', require('@aspect-test/b').id()) | ||
console.log('--@aspect-test/c--', require('@aspect-test/c').id()) | ||
console.log('--@aspect-test/g--', require('@aspect-test/g').id()) | ||
console.log('--@lib/d--', require('@lib/d').id()) | ||
console.log('--@lib/d--', require('@lib/d').test()) |
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,8 @@ | ||
{ | ||
"name": "@app/c", | ||
"private": true, | ||
"dependencies": { | ||
"@aspect-test/g": "1.0.0", | ||
"@lib/d": "workspace:*" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
const packageJson = require('./package.json') | ||
const a2 = require('alias-2/package.json') | ||
module.exports = { | ||
id: () => | ||
`${packageJson.name}@${ | ||
packageJson.version ? packageJson.version : '0.0.0' | ||
}`, | ||
test: () => [a2.name].join('\n'), | ||
test: () => | ||
[ | ||
require('@aspect-test/d').version, | ||
require('alias-2/package.json').name, | ||
].join('\n'), | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,26 @@ | ||
load("@aspect_rules_js//js:defs.bzl", "js_binary", "js_test") | ||
load("@npm//:defs.bzl", "npm_link_all_packages") | ||
|
||
npm_link_all_packages(name = "node_modules") | ||
|
||
js_binary( | ||
name = "main", | ||
args = ["foo"], | ||
data = [ | ||
":node_modules/@aspect-test", | ||
":node_modules/@lib/d", | ||
"//:node_modules/@aspect-test", | ||
], | ||
entry_point = "main.js", | ||
) | ||
|
||
js_test( | ||
name = "test", | ||
args = ["foo"], | ||
data = [ | ||
":node_modules", | ||
"//:node_modules/@aspect-test", | ||
], | ||
entry_point = "main.js", | ||
log_level = "info", | ||
) |
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,7 @@ | ||
console.log(process.argv) | ||
console.log('--@aspect-test/a--', require('@aspect-test/a').id()) | ||
console.log('--@aspect-test/b--', require('@aspect-test/b').id()) | ||
console.log('--@aspect-test/c--', require('@aspect-test/c').id()) | ||
console.log('--@aspect-test/g--', require('@aspect-test/g').id()) | ||
console.log('--@lib/d--', require('@lib/d').id()) | ||
console.log('--@lib/d--', require('@lib/d').test()) |
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,8 @@ | ||
{ | ||
"name": "@app/c", | ||
"private": true, | ||
"dependencies": { | ||
"@aspect-test/g": "1.0.0", | ||
"@lib/d": "workspace:*" | ||
} | ||
} |
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 |
---|---|---|
@@ -1,9 +1,12 @@ | ||
const packageJson = require('./package.json') | ||
const a2 = require('alias-2/package.json') | ||
module.exports = { | ||
id: () => | ||
`${packageJson.name}@${ | ||
packageJson.version ? packageJson.version : '0.0.0' | ||
}`, | ||
test: () => [a2.name].join('\n'), | ||
test: () => | ||
[ | ||
require('@aspect-test/d').version, | ||
require('alias-2/package.json').name, | ||
].join('\n'), | ||
} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,19 @@ | ||
load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
load("@npm//:defs.bzl", "npm_link_all_packages") | ||
|
||
npm_link_all_packages(name = "node_modules") | ||
|
||
js_library( | ||
name = "pkg", | ||
srcs = [ | ||
"index.js", | ||
"package.json", | ||
], | ||
visibility = ["//visibility:public"], | ||
# because we're linking this js_library, we must explictly add our npm dependendies to `deps` so | ||
# they are picked up my the linker. npm dependendies in `data` are not propogated through the | ||
# linker when linking a js_libary. | ||
deps = [ | ||
":node_modules", | ||
], | ||
) |
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-d package | ||
|
||
'@mycorp/pkg-d' is an example of a first party package that is linked as a js_library with | ||
transitive dependencies on other first party 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,6 @@ | ||
/** | ||
* @fileoverview minimal test program that requires a another workspace project | ||
* that defines its package using js_library. | ||
*/ | ||
|
||
module.exports = require('@mycorp/pkg-d') |
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,7 @@ | ||
{ | ||
"name": "@mycorp/pkg-e", | ||
"private": true, | ||
"dependencies": { | ||
"@mycorp/pkg-d": "workspace:*" | ||
} | ||
} |
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
Oops, something went wrong.