-
Notifications
You must be signed in to change notification settings - Fork 519
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(builtin): remove node_modules attribute from nodejs_binary, …
…nodejs_test & ts_library BREAKING CHANGE: We removed the node_modules attribute from `nodejs_binary`, `nodejs_test`, `jasmine_node_test` & `ts_library`. If you are using the `node_modules` attribute, you can simply add the target specified there to the `data` or `deps` attribute of the rule instead. For example, ``` nodejs_test( name = "test", data = [ "test.js", "@npm//:node_modules", ], entry_point = "test.js", ) ``` or ``` ts_library( name = "lib", srcs = glob(["*.ts"]), tsconfig = ":tsconfig.json", deps = ["@npm//:node_modules"], ) ``` We also dropped support for filegroup based node_modules target and removed `node_modules_filegroup` from `index.bzl`. If you are using this feature for user-managed deps, you must now a `js_library` target with `external_npm_package` set to `True` instead. For example, ``` js_library( name = "node_modules", srcs = glob( include = [ "node_modules/**/*.js", "node_modules/**/*.d.ts", "node_modules/**/*.json", "node_modules/.bin/*", ], exclude = [ # Files under test & docs may contain file names that # are not legal Bazel labels (e.g., # node_modules/ecstatic/test/public/中文/檔案.html) "node_modules/**/test/**", "node_modules/**/docs/**", # Files with spaces in the name are not legal Bazel labels "node_modules/**/* */**", "node_modules/**/* *", ], ), # Provide ExternalNpmPackageInfo which is used by downstream rules # that use these npm dependencies external_npm_package = True, ) nodejs_test( name = "test", data = [ "test.js", ":node_modules", ], entry_point = "test.js", ) ``` See `examples/user_managed_deps` for a working example of user-managed npm dependencies.
- Loading branch information
1 parent
afa095b
commit c2927af
Showing
56 changed files
with
333 additions
and
1,164 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
node_modules | ||
dist | ||
# NB: sematics here are not the same as .gitignore | ||
# see https://github.com/bazelbuild/bazel/issues/8106 | ||
.git | ||
bazel-out | ||
|
||
# **/symlinked_node_modules_yarn | ||
node_modules | ||
e2e/symlinked_node_modules_yarn/node_modules | ||
e2e/symlinked_node_modules_npm/node_modules/ | ||
e2e/symlinked_node_modules_npm/node_modules | ||
packages/angular/node_modules | ||
examples/angular/node_modules | ||
examples/user_managed_deps/node_modules | ||
|
||
# **/dist | ||
dist | ||
examples/user_managed_deps/dist |
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
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
const _ = require('lodash'); | ||
const {increment} = require('./index'); | ||
const {decrement} = require('./decrement'); | ||
|
||
describe('incrementing', () => { | ||
it('should do that', () => { | ||
expect(increment(1)).toBe(2); | ||
}); | ||
}); | ||
if (!_.eq(increment(1), 2)) { | ||
console.error('increment test failed'); | ||
process.exitCode = 1; | ||
} | ||
|
||
describe('decrementing', () => { | ||
it('should do that', () => { | ||
expect(decrement(1)).toBe(0); | ||
}); | ||
}); | ||
if (!_.eq(decrement(1), 0)) { | ||
console.error('decrement test failed'); | ||
process.exitCode = 1; | ||
} |
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.