Skip to content

Commit d66be96

Browse files
kohgpatsapegin
authored andcommitted
Feat: Drop Node 4 support (styleguidist#839)
BREAKING CHANGE: Node 6 is the lowest supported version.
1 parent 611469d commit d66be96

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6
-114
lines changed

.travis.yml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
language: node_js
22
node_js:
3-
- 4
43
- 6
54
- 8
65
- 9
7-
matrix:
8-
allow_failures:
9-
- node_js: 4
106
cache:
117
directories:
128
- node_modules
@@ -18,15 +14,11 @@ script:
1814
- npm run lint
1915
# Run tests and Danger.js
2016
- |
21-
if [[ "$TRAVIS_NODE_VERSION" == "4" ]]; then
22-
NODE_ENV=test node --harmony-proxies $(npm bin)/jest --runInBand
17+
if [[ "$TRAVIS_NODE_VERSION" == "9" ]]; then
18+
npx danger ci
19+
npm run test:coverage -- --runInBand
2320
else
24-
if [[ "$TRAVIS_NODE_VERSION" == "9" ]]; then
25-
npx danger ci
26-
npm run test:coverage -- --runInBand
27-
else
28-
npm run test:jest -- --runInBand
29-
fi
21+
npm run test:jest -- --runInBand
3022
fi
3123
# Compile code
3224
- npm run compile
@@ -35,7 +27,7 @@ script:
3527
- npm run build:customised
3628
- npm run build:sections
3729
- |
38-
if [[ "$TRAVIS_NODE_VERSION" == "8" ]]; then
30+
if [[ "$TRAVIS_NODE_VERSION" == "9" ]]; then
3931
# Check that examples really works: no JS errors on load
4032
npm run test:browser:pre
4133
npm run test:browser

bin/.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"sourceType": "script"
55
},
66
"rules": {
7-
"strict": [2, "global"],
87
"es5/no-default-parameters": 2,
98
"es5/no-destructuring": 2,
109
"es5/no-spread": 2

bin/__tests__/styleguidist.spec.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const fs = require('fs');
42
const vm = require('vm');
53
const path = require('path');

bin/styleguidist.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/usr/bin/env node
2-
'use strict';
32
/* eslint-disable no-console */
43

54
const minimist = require('minimist');

loaders/.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
},
66
"rules": {
77
"no-invalid-this": 0,
8-
"strict": [2, "global"],
98
"es5/no-default-parameters": 2,
109
"es5/no-destructuring": 2,
1110
"es5/no-spread": 2

loaders/css-loader.js

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

loaders/examples-loader.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const path = require('path');
42
const filter = require('lodash/filter');
53
const map = require('lodash/map');

loaders/props-loader.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const path = require('path');
42
const isArray = require('lodash/isArray');
53
const reactDocs = require('react-docgen');

loaders/style-loader.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@ does that for example). This way we can bypass Webpack resolver and just use Nod
44
require('!!../../../loaders/style-loader!../../../loaders/css-loader!codemirror/lib/codemirror.css');
55
*/
66

7-
'use strict';
8-
97
module.exports = require('style-loader');

loaders/styleguide-loader.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const pick = require('lodash/pick');
42
const commonDir = require('common-dir');
53
const generate = require('escodegen').generate;

loaders/utils/chunkify.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const remark = require('remark');
42
const visit = require('unist-util-visit');
53
const highlightCode = require('./highlightCode');

loaders/utils/client/evalInContext.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
// WARNING: This function’s source is returned by a loader without transpilation.
42
// Do not use any unsupported by IE11+ features.
53

loaders/utils/client/requireInRuntime.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
// WARNING: This function’s source is returned by a loader without transpilation.
42
// Do not use any unsupported by IE11+ features.
53

loaders/utils/expandDefaultComponent.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const COMPONENT_PLACEHOLDER = '__COMPONENT__';
42
const COMPONENT_PLACEHOLDER_REGEXP = new RegExp(COMPONENT_PLACEHOLDER, 'g');
53

loaders/utils/filterComponentsWithExample.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
/**
42
* Filter out components without an example file.
53
*

loaders/utils/getAllContentPages.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
/**
42
* Get all section content pages.
53
*

loaders/utils/getComponentFiles.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const path = require('path');
42
const glob = require('glob');
53
const isFunction = require('lodash/isFunction');

loaders/utils/getComponentFilesFromSections.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const getComponentFiles = require('./getComponentFiles');
42

53
/**

loaders/utils/getComponentPatternsFromSections.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
/**
42
* Return all glob patterns from all sections.
53
*

loaders/utils/getComponents.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const processComponent = require('./processComponent');
42

53
/**

loaders/utils/getExamples.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const fs = require('fs');
42
const path = require('path');
53
const requireIt = require('./requireIt');

loaders/utils/getNameFromFilePath.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
const path = require('path');
32
const _ = require('lodash');
43

loaders/utils/getProps.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const path = require('path');
42
const fs = require('fs');
53
const reactDocs = require('react-docgen');

loaders/utils/getRequires.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
// Need to supply the regex test as a string for reuse in unit tests
42
// Currently, trying to change flags throws a TypeError
53
// Slated for change in ES6, but not possible now:

loaders/utils/getSections.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
// This two functions should be in the same file because of cyclic imports
42

53
const fs = require('fs');

loaders/utils/highlightCode.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const hljs = require('highlight.js');
42

53
/**

loaders/utils/highlightCodeInMarkdown.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const remark = require('remark');
42
const visit = require('unist-util-visit');
53
const highlightCode = require('./highlightCode');

loaders/utils/parseExample.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const consts = require('../../scripts/consts');
42
const lowercaseKeys = require('lowercase-keys');
53

loaders/utils/processComponent.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const fs = require('fs');
42
const path = require('path');
53
const getNameFromFilePath = require('./getNameFromFilePath');

loaders/utils/removeDoclets.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
// Doclet regexp from react-docgen
42
const DOCLET_REGEXP = /^@(\w+)(?:$|\s((?:[^](?!^@\w))*))/gim;
53

loaders/utils/requireIt.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const b = require('ast-types').builders;
42

53
/**

loaders/utils/slugger.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const GithubSlugger = require('github-slugger');
42

53
// Export the singleton instance of GithubSlugger

loaders/utils/sortProps.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const sortBy = require('lodash/sortBy');
42

53
/**

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"scripts"
2727
],
2828
"engines": {
29-
"node": ">=4",
29+
"node": ">=6",
3030
"npm": ">=3"
3131
},
3232
"dependencies": {

scripts/.eslintrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"sourceType": "script"
55
},
66
"rules": {
7-
"strict": [2, "global"],
87
"es5/no-default-parameters": 2,
98
"es5/no-destructuring": 2,
109
"es5/no-spread": 2

scripts/__mocks__/build.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
module.exports = function server(config, callback) {
42
callback(null, { stats: true });
53
return {};

scripts/__mocks__/server.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
module.exports = function server(config, callback) {
42
callback(null);
53
return {};

scripts/build.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const webpack = require('webpack');
42
const makeWebpackConfig = require('./make-webpack-config');
53

scripts/config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const fs = require('fs');
42
const path = require('path');
53
const findup = require('findup');

scripts/consts.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
module.exports = {
42
HOMEPAGE: 'https://react-styleguidist.js.org/',
53
BUGS: 'https://github.com/styleguidist/react-styleguidist/issues',

scripts/create-server.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const webpack = require('webpack');
42
const WebpackDevServer = require('webpack-dev-server');
53
const merge = require('webpack-merge');

scripts/index.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
// Make sure user has webpack installed
42
require('./utils/ensureWebpack');
53

scripts/logger.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
'use strict';
21
/* eslint-disable no-console */
32

43
const _ = require('lodash/fp');

scripts/make-webpack-config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const path = require('path');
42
const webpack = require('webpack');
53
const UglifyJSPlugin = require('uglifyjs-webpack-plugin');

scripts/schemas/config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
// If you want to access any of these options in React, don’t forget to update CLIENT_CONFIG_OPTIONS array
42
// in loaders/styleguide-loader.js
53

scripts/server.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const createServer = require('./create-server');
42

53
module.exports = function server(config, callback) {

scripts/utils/StyleguidistOptionsPlugin.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
// Webpack plugin that makes Styleguidist config available for Styleguidist webpack loaders.
42
// It will be available as `this._styleguidist`.
53
//

scripts/utils/ensureWebpack.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
/**
42
* Check webpack availability and version at run time instead of using peerDependencies to allow
53
* usage of build tools that contains webpack as their own dependency, like Create React App.

scripts/utils/error.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
class StyleguidistError extends Error {
42
constructor(message, extra) {
53
super(message);

scripts/utils/findFileCaseInsensitive.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const fs = require('fs');
42
const path = require('path');
53
const memoize = require('lodash/memoize');

scripts/utils/findUserWebpackConfig.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const fs = require('fs');
42
const path = require('path');
53

scripts/utils/getUserPackageJson.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const path = require('path');
42

53
/**

scripts/utils/getWebpackVersion.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const semverUtils = require('semver-utils');
42

53
/**

scripts/utils/mergeWebpackConfig.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const isFunction = require('lodash/isFunction');
42
const omit = require('lodash/omit');
53
const mergeBase = require('webpack-merge');

scripts/utils/sanitizeConfig.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
'use strict';
2-
31
const fs = require('fs');
42
const path = require('path');
53
const isDirectory = require('is-directory');

0 commit comments

Comments
 (0)