Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Node 4 support #744 #839

Merged
merged 3 commits into from
Mar 29, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 4 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
language: node_js
node_js:
- 4
- 6
- 8
- 9
matrix:
allow_failures:
- node_js: 4
cache:
directories:
- node_modules
Expand All @@ -18,15 +14,11 @@ script:
- npm run lint
# Run tests and Danger.js
- |
if [[ "$TRAVIS_NODE_VERSION" == "4" ]]; then
NODE_ENV=test node --harmony-proxies $(npm bin)/jest --runInBand
if [[ "$TRAVIS_NODE_VERSION" == "9" ]]; then
npm run danger
npm run test:coverage -- --runInBand
else
if [[ "$TRAVIS_NODE_VERSION" == "9" ]]; then
npm run danger
npm run test:coverage -- --runInBand
else
npm run test:jest -- --runInBand
fi
npm run test:jest -- --runInBand
fi
# Compile code
- npm run compile
Expand Down
3 changes: 1 addition & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@

**Isolated React component development environment with a living style guide**

[![Build Status](https://travis-ci.org/styleguidist/react-styleguidist.svg)](https://travis-ci.org/styleguidist/react-styleguidist) [![npm](https://img.shields.io/npm/v/react-styleguidist.svg)](https://www.npmjs.com/package/react-styleguidist) [![Join the chat at https://gitter.im/styleguidist/styleguidist](https://badges.gitter.im/styleguidist/styleguidist.svg)](https://gitter.im/styleguidist/styleguidist?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/styleguidist) [![Codecov](https://codecov.io/gh/styleguidist/react-styleguidist/branch/master/graph/badge.svg)](https://codecov.io/gh/styleguidist/react-styleguidist)
[![Open Source Helpers](https://www.codetriage.com/styleguidist/react-styleguidist/badges/users.svg)](https://www.codetriage.com/styleguidist/react-styleguidist)
[![Build Status](https://travis-ci.org/styleguidist/react-styleguidist.svg)](https://travis-ci.org/styleguidist/react-styleguidist) [![npm](https://img.shields.io/npm/v/react-styleguidist.svg)](https://www.npmjs.com/package/react-styleguidist) [![Join the chat at https://gitter.im/styleguidist/styleguidist](https://badges.gitter.im/styleguidist/styleguidist.svg)](https://gitter.im/styleguidist/styleguidist?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/styleguidist) [![Codecov](https://codecov.io/gh/styleguidist/react-styleguidist/branch/master/graph/badge.svg)](https://codecov.io/gh/styleguidist/react-styleguidist) [![Open Source Helpers](https://www.codetriage.com/styleguidist/react-styleguidist/badges/users.svg)](https://www.codetriage.com/styleguidist/react-styleguidist)

</div>

Expand Down
1 change: 0 additions & 1 deletion bin/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"sourceType": "script"
},
"rules": {
"strict": [2, "global"],
"es5/no-default-parameters": 2,
"es5/no-destructuring": 2,
"es5/no-spread": 2
Expand Down
2 changes: 0 additions & 2 deletions bin/__tests__/styleguidist.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const fs = require('fs');
const vm = require('vm');
const path = require('path');
Expand Down
1 change: 0 additions & 1 deletion bin/styleguidist.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/usr/bin/env node
'use strict';
/* eslint-disable no-console */

const minimist = require('minimist');
Expand Down
1 change: 0 additions & 1 deletion docs/Cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,6 @@ const iconElements = Object.keys(icons).map(iconName => {
</span>
)
})

;<div>{iconElements}</div>
```

Expand Down
1 change: 0 additions & 1 deletion loaders/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
},
"rules": {
"no-invalid-this": 0,
"strict": [2, "global"],
"es5/no-default-parameters": 2,
"es5/no-destructuring": 2,
"es5/no-spread": 2
Expand Down
2 changes: 0 additions & 2 deletions loaders/css-loader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/*
We’re not using Webpack loader resolver because its behavior can be changed by user‘s Webpack config (Create React App
does that for example). This way we can bypass Webpack resolver and just use Node resolver. Should be used like this:
Expand Down
2 changes: 0 additions & 2 deletions loaders/examples-loader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const path = require('path');
const filter = require('lodash/filter');
const map = require('lodash/map');
Expand Down
2 changes: 0 additions & 2 deletions loaders/props-loader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const path = require('path');
const isArray = require('lodash/isArray');
const reactDocs = require('react-docgen');
Expand Down
2 changes: 0 additions & 2 deletions loaders/style-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,4 @@ does that for example). This way we can bypass Webpack resolver and just use Nod
require('!!../../../loaders/style-loader!../../../loaders/css-loader!codemirror/lib/codemirror.css');
*/

'use strict';

module.exports = require('style-loader');
2 changes: 0 additions & 2 deletions loaders/styleguide-loader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const pick = require('lodash/pick');
const commonDir = require('common-dir');
const generate = require('escodegen').generate;
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/chunkify.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const remark = require('remark');
const visit = require('unist-util-visit');
const highlightCode = require('./highlightCode');
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/client/evalInContext.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// WARNING: This function’s source is returned by a loader without transpilation.
// Do not use any unsupported by IE11+ features.

Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/client/requireInRuntime.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// WARNING: This function’s source is returned by a loader without transpilation.
// Do not use any unsupported by IE11+ features.

Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/expandDefaultComponent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const COMPONENT_PLACEHOLDER = '__COMPONENT__';
const COMPONENT_PLACEHOLDER_REGEXP = new RegExp(COMPONENT_PLACEHOLDER, 'g');

Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/filterComponentsWithExample.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Filter out components without an example file.
*
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/getAllContentPages.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Get all section content pages.
*
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/getComponentFiles.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const path = require('path');
const glob = require('glob');
const isFunction = require('lodash/isFunction');
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/getComponentFilesFromSections.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const getComponentFiles = require('./getComponentFiles');

/**
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/getComponentPatternsFromSections.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Return all glob patterns from all sections.
*
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/getComponents.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const processComponent = require('./processComponent');

/**
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/getExamples.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const fs = require('fs');
const path = require('path');
const requireIt = require('./requireIt');
Expand Down
1 change: 0 additions & 1 deletion loaders/utils/getNameFromFilePath.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
const path = require('path');
const _ = require('lodash');

Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/getProps.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const path = require('path');
const fs = require('fs');
const reactDocs = require('react-docgen');
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/getRequires.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// Need to supply the regex test as a string for reuse in unit tests
// Currently, trying to change flags throws a TypeError
// Slated for change in ES6, but not possible now:
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/getSections.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// This two functions should be in the same file because of cyclic imports

const fs = require('fs');
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/highlightCode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const hljs = require('highlight.js');

/**
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/highlightCodeInMarkdown.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const remark = require('remark');
const visit = require('unist-util-visit');
const highlightCode = require('./highlightCode');
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/parseExample.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const consts = require('../../scripts/consts');
const lowercaseKeys = require('lowercase-keys');

Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/processComponent.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const fs = require('fs');
const path = require('path');
const getNameFromFilePath = require('./getNameFromFilePath');
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/removeDoclets.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// Doclet regexp from react-docgen
const DOCLET_REGEXP = /^@(\w+)(?:$|\s((?:[^](?!^@\w))*))/gim;

Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/requireIt.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const b = require('ast-types').builders;

/**
Expand Down
2 changes: 0 additions & 2 deletions loaders/utils/slugger.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const GithubSlugger = require('github-slugger');

// Export the singleton instance of GithubSlugger
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"scripts"
],
"engines": {
"node": ">=4",
"node": ">=6",
"npm": ">=3"
},
"dependencies": {
Expand Down
1 change: 0 additions & 1 deletion scripts/.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"sourceType": "script"
},
"rules": {
"strict": [2, "global"],
"es5/no-default-parameters": 2,
"es5/no-destructuring": 2,
"es5/no-spread": 2
Expand Down
2 changes: 0 additions & 2 deletions scripts/__mocks__/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

module.exports = function server(config, callback) {
callback(null, { stats: true });
return {};
Expand Down
2 changes: 0 additions & 2 deletions scripts/__mocks__/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

module.exports = function server(config, callback) {
callback(null);
return {};
Expand Down
2 changes: 0 additions & 2 deletions scripts/build.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const webpack = require('webpack');
const makeWebpackConfig = require('./make-webpack-config');

Expand Down
2 changes: 0 additions & 2 deletions scripts/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const fs = require('fs');
const path = require('path');
const findup = require('findup');
Expand Down
2 changes: 0 additions & 2 deletions scripts/consts.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

module.exports = {
HOMEPAGE: 'https://react-styleguidist.js.org/',
BUGS: 'https://github.com/styleguidist/react-styleguidist/issues',
Expand Down
2 changes: 0 additions & 2 deletions scripts/create-server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const webpack = require('webpack');
const WebpackDevServer = require('webpack-dev-server');
const merge = require('webpack-merge');
Expand Down
2 changes: 0 additions & 2 deletions scripts/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// Make sure user has webpack installed
require('./utils/ensureWebpack');

Expand Down
1 change: 0 additions & 1 deletion scripts/logger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
'use strict';
/* eslint-disable no-console */

const _ = require('lodash/fp');
Expand Down
2 changes: 0 additions & 2 deletions scripts/make-webpack-config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const path = require('path');
const webpack = require('webpack');
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');
Expand Down
2 changes: 0 additions & 2 deletions scripts/schemas/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// If you want to access any of these options in React, don’t forget to update CLIENT_CONFIG_OPTIONS array
// in loaders/styleguide-loader.js

Expand Down
2 changes: 0 additions & 2 deletions scripts/server.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const createServer = require('./create-server');

module.exports = function server(config, callback) {
Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/StyleguidistOptionsPlugin.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

// Webpack plugin that makes Styleguidist config available for Styleguidist webpack loaders.
// It will be available as `this._styleguidist`.
//
Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/ensureWebpack.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

/**
* Check webpack availability and version at run time instead of using peerDependencies to allow
* usage of build tools that contains webpack as their own dependency, like Create React App.
Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/error.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

class StyleguidistError extends Error {
constructor(message, extra) {
super(message);
Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/findFileCaseInsensitive.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const fs = require('fs');
const path = require('path');
const memoize = require('lodash/memoize');
Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/findUserWebpackConfig.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const fs = require('fs');
const path = require('path');

Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/getUserPackageJson.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const path = require('path');

/**
Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/getWebpackVersion.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const semverUtils = require('semver-utils');

/**
Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/mergeWebpackConfig.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const isFunction = require('lodash/isFunction');
const omit = require('lodash/omit');
const mergeBase = require('webpack-merge');
Expand Down
2 changes: 0 additions & 2 deletions scripts/utils/sanitizeConfig.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
'use strict';

const fs = require('fs');
const path = require('path');
const isDirectory = require('is-directory');
Expand Down