diff --git a/.editorconfig b/.editorconfig index 4423e0f..b4b90a3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# 2016 March 8 +# 2018 January 24 # https://github.com/bevry/base root = true @@ -6,18 +6,21 @@ 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 diff --git a/.eslintrc.js b/.eslintrc.js index a32763b..36f4e52 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -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' @@ -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: { // ---------------------------- @@ -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, @@ -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, @@ -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 } @@ -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 } @@ -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] } }) diff --git a/.gitignore b/.gitignore index 4a2e50a..74f7df3 100644 --- a/.gitignore +++ b/.gitignore @@ -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 @@ -21,9 +24,11 @@ coffee/ es5/ es2015/ esnext/ +docs/ # Editor Caches .c9/ +.vscode/ # Private Files .env diff --git a/.npmignore b/.npmignore index c5b389f..fd4f832 100644 --- a/.npmignore +++ b/.npmignore @@ -1,4 +1,4 @@ -# 2016 October 17 +# 2017 April 3 # https://github.com/bevry/base # Temp Files @@ -9,6 +9,10 @@ yarn.lock **/*.cpuprofile **/*.heapsnapshot +# Editor Files +.c9/ +.vscode/ + # Build Files build/ components/ @@ -28,6 +32,7 @@ HISTORY.md # Development Files web/ **/example* +**/test* .editorconfig .eslintrc* .jshintrc @@ -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 diff --git a/.travis.yml b/.travis.yml index ba48c2d..1608557 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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= diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index bfdd326..92c3d06 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,5 @@ @@ -12,7 +12,7 @@ We offer support through our [Official Support Channels](https://bevry.me/suppor ## Contribute -Our [Contributing Guide](https://learn.bevry.me/community/contribute) contains useful tips and suggestions for how to contribute to this project, it's worth the read. +Our [Contributing Guide](https://bevry.me/contribute) contains useful tips and suggestions for how to contribute to this project, it's worth the read. ## Development @@ -23,26 +23,26 @@ Our [Contributing Guide](https://learn.bevry.me/community/contribute) contains u 1. Fork the project and clone your fork - [guide](https://help.github.com/articles/fork-a-repo/) -1. Install local dependencies +1. Setup the project for development - ``` bash - npm install - ``` + ``` bash + npm run our:setup + ``` ### Developing 1. Compile changes - ``` bash - npm run our:compile - ``` + ``` bash + npm run our:compile + ``` 1. Run tests - ``` bash - npm test - ``` + ``` bash + npm test + ``` ### Publishing @@ -53,22 +53,22 @@ Follow these steps in order to implement your changes/improvements into your des #### Preparation 1. Make sure your changes are on their own branch that is branched off from master. - 1. You can do this by: `git checkout master; git checkout -b your-new-branch` - 1. And push the changes up by: `git push origin your-new-branch` + 1. You can do this by: `git checkout master; git checkout -b your-new-branch` + 1. And push the changes up by: `git push origin your-new-branch` 1. Ensure all tests pass: - ``` bash - npm test - ``` + ``` bash + npm test + ``` - > If possible, add tests for your change, if you don't know how, mention this in your pull request + > If possible, add tests for your change, if you don't know how, mention this in your pull request 1. Ensure the project is ready for publishing: - ``` - npm run our:release:prepare - ``` + ``` + npm run our:release:prepare + ``` #### Pull Request @@ -76,8 +76,8 @@ Follow these steps in order to implement your changes/improvements into your des To send your changes for the project owner to merge in: 1. Submit your pull request - 1. When submitting, if the original project has a `dev` or `integrate` branch, use that as the target branch for your pull request instead of the default `master` - 1. By submitting a pull request you agree for your changes to have the same license as the original plugin + 1. When submitting, if the original project has a `dev` or `integrate` branch, use that as the target branch for your pull request instead of the default `master` + 1. By submitting a pull request you agree for your changes to have the same license as the original plugin #### Publish @@ -86,26 +86,26 @@ To publish your changes as the project owner: 1. Switch to the master branch: - ``` bash - git checkout master - ``` + ``` bash + git checkout master + ``` 1. Merge in the changes of the feature branch (if applicable) 1. Increment the version number in the `package.json` file according to the [semantic versioning](http://semver.org) standard, that is: - 1. `x.0.0` MAJOR version when you make incompatible API changes (note: DocPad plugins must use v2 as the major version, as v2 corresponds to the current DocPad v6.x releases) - 1. `x.y.0` MINOR version when you add functionality in a backwards-compatible manner - 1. `x.y.z` PATCH version when you make backwards-compatible bug fixes + 1. `x.0.0` MAJOR version when you make incompatible API changes (note: DocPad plugins must use v2 as the major version, as v2 corresponds to the current DocPad v6.x releases) + 1. `x.y.0` MINOR version when you add functionality in a backwards-compatible manner + 1. `x.y.z` PATCH version when you make backwards-compatible bug fixes 1. Add an entry to the changelog following the format of the previous entries, an example of this is: - ``` markdown - ## v6.29.0 2013 April 1 - - Progress on [issue #474](https://github.com/bevry/docpad/issues/474) - - DocPad will now set permissions based on the process's ability - - Thanks to [Avi Deitcher](https://github.com/deitch), [Stephan Lough](https://github.com/stephanlough) for [issue #165](https://github.com/bevry/docpad/issues/165) - - Updated dependencies - ``` + ``` markdown + ## v6.29.0 2013 April 1 + - Progress on [issue #474](https://github.com/bevry/docpad/issues/474) + - DocPad will now set permissions based on the process's ability + - Thanks to [Avi Deitcher](https://github.com/deitch), [Stephan Lough](https://github.com/stephanlough) for [issue #165](https://github.com/bevry/docpad/issues/165) + - Updated dependencies + ``` 1. Commit the changes with the commit title set to something like `v6.29.0. Bugfix. Improvement.` and commit description set to the changelog entry @@ -113,14 +113,12 @@ To publish your changes as the project owner: 1. Ensure the project is ready for publishing: - ``` - npm run our:release:prepare - ``` + ``` + npm run our:release:prepare + ``` 1. Prepare the release and publish it to npm and git: - ``` bash - npm run our:release - ``` - - > A prompt will occur asking you for a git tag annotation, enter the changelog entry that we created earlier, save and exit the prompt. + ``` bash + npm run our:release + ``` diff --git a/HISTORY.md b/HISTORY.md index 2d6c1e5..ee3e051 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,9 @@ # History +## v2.0.2 2018 July 21 +- Added support for `fullStack` property on errors when reporting, which is used by [nerror](https://www.npmjs.com/package/nerror) +- Updated base files using [boundation](https://github.com/bevry/boundation) + ## v2.0.1 2016 November 4 - Fixed tests not being published to npm for use in the testing ecosystem diff --git a/README.md b/README.md index e18a214..3307a7c 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,20 @@ - +Travis CI Build Status +NPM version +NPM downloads +Dependency Status +Dev Dependency Status +
+Patreon donate button +Open Collective donate button +Flattr donate button +PayPal donate button +Bitcoin donate button +Wishlist browse button +
+Slack community badge @@ -30,7 +43,7 @@ Console Reporter for the Joe Testing Framework

Browserify

+
  • CDN URL: //wzrd.in/bundle/joe-reporter-console@2.0.2
  • Ender