-
Notifications
You must be signed in to change notification settings - Fork 522
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(builtin): always install source-map-support (#2538)
We previously did this when patch_module_resolver was the default, because it had some extra (unrelated) logic at the end to install it. When we flipped the default in 3.0, we accidentally dropped the feature. This just reinstates it using the source-map-support/register feature. Similarly to our prior implementation, we just call our own vendored source-map-support so users don't have to think about it. Also fix missing docs for npm_package_bin attrs stdout,stderr,exit_code_out Fixes #2520
- Loading branch information
Showing
7 changed files
with
44 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,22 @@ | ||
load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary", "nodejs_test", "npm_package_bin") | ||
|
||
nodejs_binary( | ||
name = "bin", | ||
entry_point = "index.js", | ||
) | ||
|
||
npm_package_bin( | ||
name = "run", | ||
# throw away the exit code, so this action succeeds despite the program exiting 1 | ||
exit_code_out = "ignore_exit_code", | ||
# this is where the stack trace appears | ||
stderr = "actual", | ||
stdout = "ignore_stdout", | ||
tool = "bin", | ||
) | ||
|
||
nodejs_test( | ||
name = "test", | ||
data = ["actual"], | ||
entry_point = "test.js", | ||
) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const runfiles = require(process.env['BAZEL_NODE_RUNFILES_HELPER']); | ||
|
||
const actual = require('fs').readFileSync(runfiles.resolvePackageRelative('actual')); | ||
|
||
require('assert').ok(actual.includes('index.ts:1'), `source map support is not installed | ||
expected stack trace to point to line 1 of index.ts but instead got | ||
${actual} | ||
`); |
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 |
---|---|---|
|
@@ -8,6 +8,7 @@ exports_files(["LICENSE"]) | |
|
||
_CONTENT = [ | ||
"package.json", | ||
"register.js", | ||
"source-map-support.js", | ||
] | ||
|
||
|
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 @@ | ||
require('./').install({environment: 'node'}) |