Skip to content

Commit

Permalink
v2.0.2 - error reporting now uses fullStack property if it exists
Browse files Browse the repository at this point in the history
  • Loading branch information
balupton committed Jul 22, 2018
1 parent dcac5c9 commit e8feb45
Show file tree
Hide file tree
Showing 37 changed files with 8,690 additions and 2,200 deletions.
19 changes: 11 additions & 8 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,23 +1,26 @@
# 2016 March 8
# 2018 January 24
# https://github.com/bevry/base

root = true

[*]
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = false
trim_trailing_whitespace = true
insert_final_newline = false
indent_style = tab

[*.json]
indent_style = space
indent_size = 2
[{*.mk,*.py}]
indent_style = tab
indent_size = 4

[*.yml]
[*.md]
indent_style = space
indent_size = 2
indent_size = 4

[*.md]
[{*.json,*.yml,*.bowerrc,*.babelrc}]
indent_style = space
indent_size = 2

[*.json]
insert_final_newline = true
57 changes: 30 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// 2016 November 1
// 2018 January 26
// https://github.com/bevry/base
// http://eslint.org
// This code must be able to run on Node 0.10
/* eslint no-warning-comments: 0 */
'use strict'

Expand All @@ -10,7 +9,7 @@ const IGNORE = 0, WARN = 1, ERROR = 2, MAX_PARAMS = 4
const config = {
extends: ['eslint:recommended'],
plugins: [],
parserOptions: {ecmaFeatures: {}},
parserOptions: { ecmaFeatures: {} },
env: {},
rules: {
// ----------------------------
Expand Down Expand Up @@ -559,7 +558,7 @@ const config = {
'max-params': [WARN, MAX_PARAMS],

// Let's give this a go and see what is appropriate for our usage
'max-statements-per-line': [WARN, {max: 1}],
'max-statements-per-line': [WARN, { max: 1 }],

// We should be able to use whatever feels right
'max-statements': IGNORE,
Expand Down Expand Up @@ -641,7 +640,7 @@ const config = {

// Object indentation should be consistent within the object
// Ignore until https://github.com/eslint/eslint/issues/7434 is done
'object-curly-newline': [IGNORE, {multiline: true}],
'object-curly-newline': [IGNORE, { multiline: true }],

// Desirable, but too many edge cases it turns out where it is actually preferred
'object-curly-spacing': IGNORE,
Expand Down Expand Up @@ -815,7 +814,6 @@ const config = {
// Plugins

// Not sure why, but okay
'babel/no-await-in-loop': WARN,
'flow-vars/define-flow-type': WARN,
'flow-vars/use-flow-type': WARN
}
Expand All @@ -831,67 +829,72 @@ try {
data = require('./package.json') || {}
devDeps = Object.keys(data.devDependencies || {})
}
catch ( err ) {}
catch (err) { }

// Set the parser options depending on our editions
if ( data.editions ) {
if (data.editions) {
const sourceEdition = data.editions[0]
for ( let syntaxIndex = 0; syntaxIndex < sourceEdition.syntaxes.length; ++syntaxIndex ) {
for (let syntaxIndex = 0; syntaxIndex < sourceEdition.syntaxes.length; ++syntaxIndex) {
const syntax = sourceEdition.syntaxes[syntaxIndex]
if ( syntax === 'esnext' ) {
if (syntax === 'esnext') {
config.parserOptions.ecmaVersion = 8
break
}
else if ( syntax.indexOf('es') === 0 ) {
else if (syntax.indexOf('es') === 0) {
config.parserOptions.ecmaVersion = Number(syntax.substr(2))
break
}
}
config.parserOptions.ecmaFeatures.sourceType = sourceEdition.syntaxes.indexOf('import') !== -1 ? 'module' : 'script'
config.parserOptions.sourceType = sourceEdition.syntaxes.indexOf('import') !== -1 ? 'module' : 'script'
config.parserOptions.ecmaFeatures.jsx = sourceEdition.syntaxes.indexOf('jsx') !== -1
}

// If editions failed to dtermine the ecmaVersion, try determining it from node, otherwise default to v5
if (!config.parserOptions.ecmaVersion) {
const node = data.engines && data.engines.node && data.engines.node.replace('>=', '').replace(/ /g, '').replace(/\..+$/, '')
config.parserOptions.ecmaVersion = node >= 6 ? 6 : 5
}

// Set the environments depending on whether we need them or not
config.env.es6 = Boolean(config.parserOptions.ecmaVersion && config.parserOptions.ecmaVersion >= 6)
config.env.node = Boolean(data.engines && data.engines.node)
config.env.browser = Boolean(data.browser)
if ( config.env.browser ) {
if (config.env.browser) {
config.env.commonjs = true
if ( config.env.node ) {
if (config.env.node) {
config.env['shared-node-browser'] = true
}
}

// If not on legacy javascript, disable esnext rules
if ( config.parserOptions.ecmaVersion && config.parserOptions.ecmaVersion <= 5 ) {
if (config.parserOptions.ecmaVersion && config.parserOptions.ecmaVersion <= 5) {
config.rules['no-var'] = IGNORE
config.rules['object-shorthand'] = [ERROR, 'never']
config.rules['prefer-rest-params'] = IGNORE
config.rules['prefer-spread'] = IGNORE
config.rules['prefer-const'] = IGNORE
}

// Add babel parsing if installed
if ( devDeps.indexOf('babel-eslint') !== -1 ) {
if (devDeps.indexOf('babel-eslint') !== -1) {
config.parser = 'babel-eslint'
}

// Add react linting if installed
if ( devDeps.indexOf('eslint-plugin-react') !== -1 ) {
if (devDeps.indexOf('eslint-plugin-react') !== -1) {
config.extends.push('plugin:react/recommended')
config.plugins.push('react')
}

if ( devDeps.indexOf('eslint-plugin-babel') !== -1 ) {
if (devDeps.indexOf('eslint-plugin-babel') !== -1) {
// Remove rules that babel rules replace
config.plugins.push('babel')
const replacements = [
'array-bracket-spacing',
'new-cap',
'object-curly-spacing',
'arrow-parens',
'generator-star-spacing',
'object-shorthand'
'object-curly-spacing'
]
replacements.forEach(function (key) {
if ( rules.indexOf(key) !== -1 ) {
if (rules.indexOf(key) !== -1) {
config.rules['babel/' + key] = config.rules[key]
config.rules[key] = IGNORE
}
Expand All @@ -900,20 +903,20 @@ if ( devDeps.indexOf('eslint-plugin-babel') !== -1 ) {
else {
// Remove babel rules if not using babel
rules.forEach(function (key) {
if ( key.indexOf('babel/') === 0 ) {
if (key.indexOf('babel/') === 0) {
delete config.rules[key]
}
})
}

if ( devDeps.indexOf('eslint-plugin-flow-vars') !== -1 ) {
if (devDeps.indexOf('eslint-plugin-flow-vars') !== -1) {
// Add flow plugin if installed
config.plugins.push('flow-vars')
}
else {
// Remove flow rules if plugin not installed
rules.forEach(function (key) {
if ( key.indexOf('flow-vars/') === 0 ) {
if (key.indexOf('flow-vars/') === 0) {
delete config.rules[key]
}
})
Expand Down
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# 2016 October 17
# 2017 April 12
# https://github.com/bevry/base

# System Files
**/.DS_Store

# Temp Files
yarn.lock
**/.docpad.db
Expand All @@ -21,9 +24,11 @@ coffee/
es5/
es2015/
esnext/
docs/

# Editor Caches
.c9/
.vscode/

# Private Files
.env
Expand Down
9 changes: 7 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 2016 October 17
# 2017 April 3
# https://github.com/bevry/base

# Temp Files
Expand All @@ -9,6 +9,10 @@ yarn.lock
**/*.cpuprofile
**/*.heapsnapshot

# Editor Files
.c9/
.vscode/

# Build Files
build/
components/
Expand All @@ -28,6 +32,7 @@ HISTORY.md
# Development Files
web/
**/example*
**/test*
.editorconfig
.eslintrc*
.jshintrc
Expand All @@ -46,4 +51,4 @@ bower.json
# =====================================
# CUSTOM MODIFICATIONS

# Testing rule has been removed as we want to publish test files for use of the testing ecosystem
# None
74 changes: 20 additions & 54 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,66 +1,32 @@
# 2016 November 5
# https://github.com/bevry/base

# Use the latest travis infrastructure
sudo: false

# https://github.com/nodejs/LTS
language: node_js
node_js:
- "0.8" # end of life
- "0.10" # end of life
- "0.12" # maintenance
- "4" # lts
- "6" # lts
- "7" # stable
- '0.8'
- '0.10'
- '0.12'
- '4'
- '6'
- '8'
- '10'
matrix:
fast_finish: true
allow_failures:
- node_js: "0.8"
- node_js: "0.10"
- node_js: '0.8'
- node_js: '0.10'
cache:
directories:
- node_modules

# Ensure npm is up to date
# Ensure dependencies install with a LTS node version
install: |
export CURRENT_NPM_VERSION="$(npm --version)"
export LATEST_NPM_VERSION="$(npm view npm version)"
if test "$CURRENT_NPM_VERSION" != "$LATEST_NPM_VERSION"; then
echo "running an old npm version, upgrading"
npm instal npm --global --cache-min=Infinity
fi
export CURRENT_NODE_VERSION="$(node --version)"
export LTS_NODE_VERSIONS="$(nvm ls-remote --lts)"
if echo "$LTS_NODE_VERSIONS" | grep "$CURRENT_NODE_VERSION"; then
echo "running on a LTS node version, completing setup"
npm run our:setup
else
echo "running on a non-LTS node version, completing setup on a LTS node version"
nvm install --lts
export LTS_NODE_VERSION="$(node --version)"
npm run our:setup
nvm use "$TRAVIS_NODE_VERSION"
fi
# Ensure compilation and linting occur on an LTS node version
before_script: |
if test "$LTS_NODE_VERSION"; then
echo "running on a non-LTS node version, compiling with LTS, skipping linting"
nvm use "$LTS_NODE_VERSION"
npm run our:compile
nvm use "$TRAVIS_NODE_VERSION"
else
echo "running on a LTS node version, compiling and linting"
npm run our:compile && npm run our:verify
fi
# Custom notifications
- "$HOME/.npm"
- "$HOME/.yarn-cache"
install:
- eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/1ec050bc004d0e2161cb5286c247850d24aecc02/scripts/node-install.bash)"
before_script:
- eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/1ec050bc004d0e2161cb5286c247850d24aecc02/scripts/node-verify.bash)"
after_success:
- eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/1ec050bc004d0e2161cb5286c247850d24aecc02/scripts/surge.bash)"
- eval "$(curl -fsSL https://raw.githubusercontent.com/bevry/awesome-travis/1ec050bc004d0e2161cb5286c247850d24aecc02/scripts/node-publish.bash)"
notifications:
slack:
secure: HjWovLqeen80YP30cH0RUas4w+xqLSqBh/KvM09u6ssi4To53VRSqIV2GKxmjDW9699cfpgtDJCuskeelH3zjbMlYUM2rz2nHP19ekwX4zWPD0w0p521v/xIxp1BcFcLZDAZqkOUulmaJrq6YYbKHyKMfkZxyC4aSr/wqKKfED8=
secure: APH0+C3fwf1ls+vHaWO5vqHbNccP5P2XOl8VOYprTGj9h+PONFqRHfu8Lye/NaIctKHy6htsledIF4ncySZuUaRM3msqkZXemZaPA8qFOvaMMYTX2L6f3ZeYsY44X82KTn+URuXRetIsl1JjJqfEZURWErLd13neUYqQxFY2HMM=
email:
recipients:
secure: HUNHmy+reXJEGd4R9GWvERH6PTXqsdqxDeIGvlG2aYI6TxT5gI3qJngQcNQSj750j0VHw+aToE14F6ohsshFUmghRuz3zfhhTPSr4L65p5oP7iJlWIwy0Vdtehba2+C50WK1Dit8Mlb1cQa0TjDOUd/ipdBdiLQkpkQL6YQ+dqA=
secure: K6EQ2kjMpAPQmIQ39PMf8WBQtnhmsuI8Bni4aOM2zXljLFOprwgfG742myMFKTuDoMNfNWaUFmchmIXTkD5/p08OxO7tGqD/pdC2pu70BGrXYxyz+6mvtExMbDf3x1f9A7qgiQkBrIptqw8YJcNRqhBeZ6+vYCgY18TmR87dBz0=
Loading

0 comments on commit e8feb45

Please sign in to comment.