chore(xo-server): julien-f-source-map-supportsource-map-support

`source-map-support` is correctly maintained and support modern Node versions.
This commit is contained in:
Julien Fontanet
2019-12-27 15:36:31 +01:00
parent 79ef01cb25
commit d6b4931001
4 changed files with 6 additions and 40 deletions

View File

@@ -1,30 +0,0 @@
Error.stackTraceLimit = 100
// Removes internal modules.
try {
const sep = require('path').sep
require('stack-chain').filter.attach(function(_, frames) {
const filtered = frames.filter(function(frame) {
const name = frame && frame.getFileName()
return (
// has a filename
name &&
// contains a separator (no internal modules)
name.indexOf(sep) !== -1 &&
// does not start with `internal`
name.lastIndexOf('internal', 0) !== -1
)
})
// depd (used amongst other by express requires at least 3 frames
// in the stack.
return filtered.length > 2 ? filtered : frames
})
} catch (_) {}
// Source maps.
try {
require('julien-f-source-map-support/register')
} catch (_) {}

View File

@@ -10,7 +10,11 @@ if (process.env.NODE_ENV === undefined) {
}
// Better stack traces if possible.
require('../better-stacks')
try {
require('source-map-support').install({
handleUncaughtExceptions: false
});
} catch (_) {}
// Use Bluebird for all promises as it provides better performance and
// less memory usage.

View File

@@ -81,7 +81,6 @@
"js-yaml": "^3.10.0",
"json-rpc-peer": "^0.15.3",
"json5": "^2.0.1",
"julien-f-source-map-support": "0.1.0",
"julien-f-unzip": "^0.2.1",
"kindof": "^2.0.0",
"level-party": "^4.0.0",
@@ -110,6 +109,7 @@
"schema-inspector": "^1.6.8",
"semver": "^6.0.0",
"serve-static": "^1.13.1",
"source-map-support": "^0.5.16",
"split-lines": "^2.0.0",
"stack-chain": "^2.0.0",
"stoppable": "^1.0.5",

View File

@@ -8616,14 +8616,6 @@ jsx-ast-utils@^2.2.3:
array-includes "^3.0.3"
object.assign "^4.1.0"
julien-f-source-map-support@0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/julien-f-source-map-support/-/julien-f-source-map-support-0.1.0.tgz#174152c8509538cf666d813eff77cb261711f0af"
integrity sha512-yLkXwMRQ8J2Hn9pkmRoexVPpRaeWBCJ6euf96KcYRqOR9Rek4tbebk6QwYJ42zyeFDHniweWV1Pgfrs8dDvv4A==
dependencies:
source-map "^0.6.1"
stack-chain "^2.0.0"
julien-f-unzip@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/julien-f-unzip/-/julien-f-unzip-0.2.1.tgz#62e6a85fa7fa4b875156442079adb4a8617c066a"