Skip to content

Commit

Permalink
Dev infrastructure improvements
Browse files Browse the repository at this point in the history
- Converted build to npm scripts
- Converted to ESLint and fixed issues
- Updated dev dependencies to remove all security alerts
  • Loading branch information
eriwen committed Jan 5, 2020
1 parent f58b4f6 commit f5184d7
Show file tree
Hide file tree
Showing 15 changed files with 3,934 additions and 10,131 deletions.
31 changes: 31 additions & 0 deletions .eslintrc.yml
@@ -0,0 +1,31 @@
env:
browser: true
commonjs: true
node: true
extends: 'eslint:recommended'
globals:
beforeEach: false
define: false
describe: false
expect: false
it: false
jasmine: false
parserOptions:
ecmaVersion: 5
rules:
indent:
- error
- 4
linebreak-style:
- error
- unix
quotes:
- error
- single
semi:
- error
- always
no-console:
- error
- allow:
- error
28 changes: 0 additions & 28 deletions .jscsrc

This file was deleted.

41 changes: 0 additions & 41 deletions .jshintrc

This file was deleted.

5 changes: 2 additions & 3 deletions .travis.yml
@@ -1,8 +1,7 @@
language: node_js
sudo: required
dist: xenial
node_js:
- 8
node_js: 8
addons:
sauce_connect: true
firefox: latest
Expand All @@ -19,4 +18,4 @@ before_install:
before_script:
- npm install
script:
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then gulp ci; else gulp test-pr; fi
- if [ "${TRAVIS_PULL_REQUEST}" = "false" ]; then npm run lint && npm run test-ci; else npm run test-pr; fi
22 changes: 11 additions & 11 deletions dist/error-stack-parser.js
Expand Up @@ -13,9 +13,9 @@
}(this, function ErrorStackParser(StackFrame) {
'use strict';

var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+\:\d+/;
var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+\:\d+|\(native\))/m;
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code\])?$/;
var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;

return {
/**
Expand Down Expand Up @@ -43,8 +43,8 @@
return [urlLike];
}

var regExp = /(.+?)(?:\:(\d+))?(?:\:(\d+))?$/;
var parts = regExp.exec(urlLike.replace(/[\(\)]/g, ''));
var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
var parts = regExp.exec(urlLike.replace(/[()]/g, ''));
return [parts[1], parts[2] || undefined, parts[3] || undefined];
},

Expand All @@ -56,7 +56,7 @@
return filtered.map(function(line) {
if (line.indexOf('(eval ') > -1) {
// Throw away eval information until we implement stacktrace.js/stackframe#8
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^\()]*)|(\)\,.*$)/g, '');
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
}
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');

Expand Down Expand Up @@ -91,7 +91,7 @@
return filtered.map(function(line) {
// Throw away eval information until we implement stacktrace.js/stackframe#8
if (line.indexOf(' > eval') > -1) {
line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g, ':$1');
line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
}

if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {
Expand Down Expand Up @@ -179,11 +179,11 @@
var locationParts = this.extractLocation(tokens.pop());
var functionCall = (tokens.shift() || '');
var functionName = functionCall
.replace(/<anonymous function(: (\w+))?>/, '$2')
.replace(/\([^\)]*\)/g, '') || undefined;
.replace(/<anonymous function(: (\w+))?>/, '$2')
.replace(/\([^)]*\)/g, '') || undefined;
var argsRaw;
if (functionCall.match(/\(([^\)]*)\)/)) {
argsRaw = functionCall.replace(/^[^\(]+\(([^\)]*)\)$/, '$1');
if (functionCall.match(/\(([^)]*)\)/)) {
argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1');
}
var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?
undefined : argsRaw.split(',');
Expand Down
4 changes: 2 additions & 2 deletions dist/error-stack-parser.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/error-stack-parser.min.js.map

Large diffs are not rendered by default.

22 changes: 11 additions & 11 deletions error-stack-parser.js
Expand Up @@ -13,9 +13,9 @@
}(this, function ErrorStackParser(StackFrame) {
'use strict';

var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+\:\d+/;
var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+\:\d+|\(native\))/m;
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code\])?$/;
var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\S+:\d+/;
var CHROME_IE_STACK_REGEXP = /^\s*at .*(\S+:\d+|\(native\))/m;
var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\[native code])?$/;

return {
/**
Expand Down Expand Up @@ -43,8 +43,8 @@
return [urlLike];
}

var regExp = /(.+?)(?:\:(\d+))?(?:\:(\d+))?$/;
var parts = regExp.exec(urlLike.replace(/[\(\)]/g, ''));
var regExp = /(.+?)(?::(\d+))?(?::(\d+))?$/;
var parts = regExp.exec(urlLike.replace(/[()]/g, ''));
return [parts[1], parts[2] || undefined, parts[3] || undefined];
},

Expand All @@ -56,7 +56,7 @@
return filtered.map(function(line) {
if (line.indexOf('(eval ') > -1) {
// Throw away eval information until we implement stacktrace.js/stackframe#8
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^\()]*)|(\)\,.*$)/g, '');
line = line.replace(/eval code/g, 'eval').replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
}
var sanitizedLine = line.replace(/^\s+/, '').replace(/\(eval code/g, '(');

Expand Down Expand Up @@ -91,7 +91,7 @@
return filtered.map(function(line) {
// Throw away eval information until we implement stacktrace.js/stackframe#8
if (line.indexOf(' > eval') > -1) {
line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g, ':$1');
line = line.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g, ':$1');
}

if (line.indexOf('@') === -1 && line.indexOf(':') === -1) {
Expand Down Expand Up @@ -179,11 +179,11 @@
var locationParts = this.extractLocation(tokens.pop());
var functionCall = (tokens.shift() || '');
var functionName = functionCall
.replace(/<anonymous function(: (\w+))?>/, '$2')
.replace(/\([^\)]*\)/g, '') || undefined;
.replace(/<anonymous function(: (\w+))?>/, '$2')
.replace(/\([^)]*\)/g, '') || undefined;
var argsRaw;
if (functionCall.match(/\(([^\)]*)\)/)) {
argsRaw = functionCall.replace(/^[^\(]+\(([^\)]*)\)$/, '$1');
if (functionCall.match(/\(([^)]*)\)/)) {
argsRaw = functionCall.replace(/^[^(]+\(([^)]*)\)$/, '$1');
}
var args = (argsRaw === undefined || argsRaw === '[arguments not available]') ?
undefined : argsRaw.split(',');
Expand Down
68 changes: 0 additions & 68 deletions gulpfile.js

This file was deleted.

0 comments on commit f5184d7

Please sign in to comment.