forked from bazel-contrib/rules_nodejs
-
Notifications
You must be signed in to change notification settings - Fork 1
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
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. Fixes bazel-contrib#2520
- Loading branch information
Alex Eagle
committed
Mar 17, 2021
1 parent
09be982
commit 8009917
Showing
8 changed files
with
47 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
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", | ||
) |
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 @@ | ||
'use strict'; | ||
throw new Error('here'); | ||
//# | ||
// sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBTSxJQUFJLEtBQUssQ0FBQyxNQUFNLENBQUMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbInRocm93IG5ldyBFcnJvcihcImhlcmVcIik7XG4iXX0= |
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'}) |