Skip to content

Commit 35141d9

Browse files
authored
Dependencies updats (#797)
* chore(package): update dependencies * docs(readme): add Greenkeeper badge * Adjustments for modernization * remove unused deps, bumps travis min versions * Adds script that tests publishing * Updates webpack build scripts * Better beforeScript * fixup! Better beforeScript * Adds progress to webpack publish so travis dont hang * Proper plugins for tests preprocessor * Set proper proptype for the test
1 parent 49bf7e3 commit 35141d9

16 files changed

+75
-82
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: node_js
22
node_js:
3-
- '4.4'
4-
- '5.7'
5-
- '6.1'
3+
- '6.11'
4+
- '8.8'
5+
before_script: ./scripts/before_script.sh
66
cache:
77
directories:
88
- node_modules

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Parse Dashboard
22

3+
[![Greenkeeper badge](https://badges.greenkeeper.io/parse-community/parse-dashboard.svg)](https://greenkeeper.io/)
4+
35
[![Build Status](https://img.shields.io/travis/parse-community/parse-dashboard/master.svg?style=flat)](https://travis-ci.org/parse-community/parse-dashboard)
46
[![npm version](https://img.shields.io/npm/v/parse-dashboard.svg?style=flat)](https://www.npmjs.com/package/parse-dashboard)
57

package.json

Lines changed: 31 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -41,44 +41,49 @@
4141
"csurf": "^1.9.0",
4242
"express": "^4.13.4",
4343
"json-file-plus": "^3.2.0",
44-
"package-json": "^2.3.1",
44+
"package-json": "^4.0.1",
4545
"passport": "^0.3.2",
4646
"passport-local": "^1.0.0"
4747
},
4848
"devDependencies": {
49-
"babel-core": "~5.8.12",
49+
"babel-core": "~6.24.1",
5050
"babel-eslint": "^7.2.3",
51-
"babel-loader": "~5.3.0",
52-
"babel-plugin-remove-proptypes": "~1.0.0",
53-
"babel-polyfill": "^6.7.2",
54-
"babel-runtime": "~5.8.25",
55-
"css-loader": "~0.18.0",
51+
"babel-loader": "~7.0.0",
52+
"babel-plugin-transform-decorators-legacy": "^1.3.4",
53+
"babel-plugin-transform-object-rest-spread": "^6.26.0",
54+
"babel-plugin-transform-regenerator": "^6.26.0",
55+
"babel-plugin-transform-runtime": "^6.23.0",
56+
"babel-polyfill": "^6.23.0",
57+
"babel-preset-env": "^1.6.1",
58+
"babel-preset-react": "^6.24.1",
59+
"babel-runtime": "~6.23.0",
60+
"css-loader": "~0.28.2",
5661
"eslint": "^3.8.1",
5762
"eslint-plugin-jest": "^20.0.3",
58-
"eslint-plugin-react": "^6.4.1",
59-
"file-loader": "^0.8.5",
63+
"eslint-plugin-react": "^7.0.1",
64+
"file-loader": "^0.11.1",
6065
"history": "^2.1.2",
61-
"http-server": "~0.8.5",
62-
"immutable": "~3.7.5",
66+
"http-server": "~0.10.0",
67+
"immutable": "~3.8.1",
6368
"immutable-devtools": "~0.0.4",
64-
"jest-cli": "^12.0.2",
65-
"js-beautify": "~1.5.0",
69+
"jest-cli": "^20.0.3",
70+
"js-beautify": "~1.6.14",
6671
"marked": "^0.3.5",
67-
"node-sass": "^3.7.0",
68-
"parse": "1.9.1",
69-
"prismjs": "~1.2.0",
72+
"node-sass": "^4.5.3",
73+
"parse": "1.9.2",
74+
"prismjs": "~1.6.0",
7075
"react": "^15.0.1",
7176
"react-addons-test-utils": "^15.0.1",
72-
"react-dnd": "~2.1.4",
73-
"react-dnd-html5-backend": "~2.0.0",
77+
"react-dnd": "~2.4.0",
78+
"react-dnd-html5-backend": "~2.4.1",
7479
"react-dom": "^15.0.1",
7580
"react-router": "^2.6.0",
7681
"request-promise": "^4.1.1",
77-
"sass-loader": "~3.1.2",
78-
"style-loader": "~0.12.3",
82+
"sass-loader": "~6.0.5",
83+
"style-loader": "~0.18.0",
7984
"svg-prep": "~1.0.0",
8085
"transform-jest-deps": "^2.1.0",
81-
"webpack": "~1.12.0"
86+
"webpack": "~2.5.1"
8287
},
8388
"scripts": {
8489
"dev": "node ./Parse-Dashboard/index.js & webpack --config webpack/build.config.js --devtool eval-source-map --progress --watch",
@@ -89,7 +94,7 @@
8994
"lint": "eslint . --ignore-path .gitignore --cache",
9095
"pretest": "npm run lint",
9196
"generate": "node scripts/generate.js",
92-
"prepublish": "webpack --config webpack/publish.config.js",
97+
"prepublish": "webpack --config webpack/publish.config.js --progress",
9398
"start": "node ./Parse-Dashboard/index.js"
9499
},
95100
"bin": {
@@ -100,14 +105,12 @@
100105
},
101106
"main": "Parse-Dashboard/app.js",
102107
"jest": {
103-
"testPathDirs": [
108+
"roots": [
104109
"src/lib"
105110
],
106-
"scriptPreprocessor": "<rootDir>/testing/preprocessor.js",
107-
"testDirectoryName": "tests",
108-
"testFileExtensions": [
109-
"test.js"
110-
],
111+
"transform": {
112+
".*": "<rootDir>/testing/preprocessor.js"
113+
},
111114
"unmockedModulePathPatterns": [
112115
"react",
113116
"react-dom",

scripts/before_script.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/bin/sh
2+
set -e
3+
set -x
4+
5+
test -f Parse-Dashboard/public/bundles/dashboard.bundle.js
6+
test -f Parse-Dashboard/public/bundles/login.bundle.js
7+
test -f Parse-Dashboard/public/bundles/sprites.svg
8+
test -d Parse-Dashboard/public/bundles/img

src/components/PlatformCard/PlatformCard.react.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export default PlatformCard;
3232

3333
PlatformCard.propTypes = {
3434
platform: PropTypes.oneOf([
35-
'ios', 'android', 'xamarin', 'unity', 'php', 'windows', 'dotnet', 'arduino', 'rpi', 'rtos'
35+
'apple', 'android', 'xamarin', 'unity', 'php', 'windows', 'dotnet', 'arduino', 'rpi', 'rtos'
3636
]).isRequired.describe(
3737
'The platform name. This will determine the icon.'
3838
),

src/lib/tests/Button.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jest.dontMock('../../components/Button/Button.react');
1010
import React from 'react';
1111
import TestUtils from 'react-addons-test-utils';
1212

13-
const Button = require('../../components/Button/Button.react');
13+
const Button = require('../../components/Button/Button.react').default;
1414

1515
describe('Button', () => {
1616
it('has a default state', () => {

src/lib/tests/Tooltip.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@
88
jest.dontMock('../../components/Tooltip/Tooltip.react');
99

1010
describe('Tooltip', () => {
11-
// test suite goes here
11+
it('does nothing', () => {});
1212
});

src/lib/tests/passwordStrength.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* the root directory of this source tree.
77
*/
88
jest.dontMock('../passwordStrength');
9-
const passwordStrength = require('../passwordStrength');
9+
const passwordStrength = require('../passwordStrength').default;
1010

1111
describe('passwordStrength', () => {
1212
it('returns 0 for passwords that are too short', () => {

src/lib/tests/prettyNumber.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* the root directory of this source tree.
77
*/
88
jest.dontMock('../prettyNumber');
9-
const prettyNumber = require('../prettyNumber');
9+
const prettyNumber = require('../prettyNumber').default;
1010

1111
describe('prettyNumber', () => {
1212
it('does not change small numbers', () => {

testing/preprocessor.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,15 @@ module.exports = {
2222

2323
// Ignore all files within node_modules
2424
// babel files can be .js, .es, .jsx or .es6
25-
if (filename.indexOf('node_modules') < 0 && babel.canCompile(filename)) {
25+
if (filename.indexOf('node_modules') < 0) {
2626
return babel.transform(src, {
2727
filename: filename,
28-
stage: 0,
2928
retainLines: true,
29+
plugins: ['transform-decorators-legacy', 'transform-object-rest-spread', 'transform-regenerator', 'transform-runtime'],
30+
presets: ['react', 'env']
3031
// Remove propTypes for tests so we don't have to keep unmocking lib/PropTypes
3132
// Also it's more representative of the production environment
32-
plugins: [ 'babel-plugin-remove-proptypes' ]
33+
//plugins: [ 'babel-plugin-remove-proptypes' ]
3334
}).code;
3435
}
3536

webpack/PIG.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
var configuration = require('./base.config.js');
99

1010
configuration.entry = {PIG: './parse-interface-guide/index.js'};
11-
configuration.output.path = './PIG/bundles';
11+
configuration.output.path = require('path').resolve('./PIG/bundles');
1212

1313
module.exports = configuration;

webpack/base.config.js

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,33 +23,36 @@ module.exports = {
2323
publicPath: 'bundles/'
2424
},
2525
resolve: {
26-
root: [__dirname,path.join(__dirname, '../src'), path.join(__dirname, 'node_modules')]
26+
modules: [__dirname,path.join(__dirname, '../src'), path.join(__dirname, '../node_modules')]
2727
},
2828
resolveLoader: {
29-
root: path.join(__dirname, '../node_modules')
29+
modules: [path.join(__dirname, '../node_modules')]
3030
},
3131
module: {
32-
loaders: [
32+
rules: [
3333
{
3434
test: /\.js$/,
3535
exclude: /node_modules/,
36-
loader: 'babel-loader',
37-
query: {
38-
optional: ['runtime', 'es7.decorators']
39-
}
36+
use: {
37+
loader: 'babel-loader',
38+
query: {
39+
plugins: ['transform-decorators-legacy', 'transform-object-rest-spread', 'transform-regenerator', 'transform-runtime'],
40+
presets: ['react', 'env']
41+
}
42+
},
4043
}, {
4144
test: /\.scss$/,
42-
loader: "style-loader!css-loader?modules&localIdentName=[local]__[hash:base64:5]!sass-loader?includePaths[]=" +
43-
encodeURIComponent(path.resolve(__dirname, '../src'))
45+
use: [ "style-loader", "css-loader?modules&localIdentName=[local]__[hash:base64:5]!sass-loader?includePaths[]=" +
46+
encodeURIComponent(path.resolve(__dirname, '../src')) ]
4447
}, {
4548
test: /\.css$/,
46-
loader: 'style-loader!css-loader'
49+
use: [ 'style-loader', 'css-loader' ]
4750
}, {
4851
test: /\.png$/,
49-
loader: 'file-loader?name=img/[hash].[ext]',
52+
use: { loader: 'file-loader?name=img/[hash].[ext]' }
5053
}, {
5154
test: /\.jpg$/,
52-
loader: 'file-loader?name=img/[hash].[ext]',
55+
use: { loader: 'file-loader?name=img/[hash].[ext]' }
5356
}
5457
]
5558
},

webpack/build.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ configuration.entry = {
1111
dashboard: './dashboard/index.js',
1212
login: './login/index.js'
1313
};
14-
configuration.output.path = './Parse-Dashboard/public/bundles';
14+
configuration.output.path = require('path').resolve('./Parse-Dashboard/public/bundles');
1515

1616
module.exports = configuration;

webpack/production.config.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,10 @@ configuration.entry = {
1313
PIG: './parse-interface-guide/index.js',
1414
quickstart: './quickstart/index.js',
1515
};
16-
configuration.output.path = './production/bundles';
16+
configuration.output.path = require('path').resolve('./production/bundles');
1717

1818
var webpack = require('webpack');
1919

20-
// Add propType removal to Babel
21-
var loaders = configuration.module.loaders;
22-
for (var i = 0; i < loaders.length; i++) {
23-
if (loaders[i].loader === 'babel-loader') {
24-
if (!loaders[i].query.plugins) {
25-
loaders[i].query.plugins = [];
26-
}
27-
loaders[i].query.plugins.push('babel-plugin-remove-proptypes');
28-
break;
29-
}
30-
}
31-
3220
// Enable minification
3321
configuration.plugins.push(
3422
new webpack.DefinePlugin({
@@ -41,7 +29,7 @@ configuration.plugins.push(
4129
warnings: false
4230
}
4331
}),
44-
new webpack.optimize.OccurenceOrderPlugin(),
32+
new webpack.optimize.OccurrenceOrderPlugin(),
4533
function() {
4634
this.plugin('done', function(stats) {
4735
if (stats.compilation.errors && stats.compilation.errors.length) {

webpack/publish.config.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,10 @@ configuration.entry = {
1111
dashboard: './dashboard/index.js',
1212
login: './login/index.js'
1313
};
14-
configuration.output.path = './Parse-Dashboard/public/bundles';
14+
configuration.output.path = require('path').resolve('./Parse-Dashboard/public/bundles');
1515

1616
var webpack = require('webpack');
1717

18-
// Add propType removal to Babel
19-
var loaders = configuration.module.loaders;
20-
for (var i = 0; i < loaders.length; i++) {
21-
if (loaders[i].loader === 'babel-loader') {
22-
if (!loaders[i].query.plugins) {
23-
loaders[i].query.plugins = [];
24-
}
25-
loaders[i].query.plugins.push('babel-plugin-remove-proptypes');
26-
break;
27-
}
28-
}
29-
3018
// Enable minification
3119
configuration.plugins.push(
3220
new webpack.DefinePlugin({
@@ -39,7 +27,7 @@ configuration.plugins.push(
3927
warnings: false
4028
}
4129
}),
42-
new webpack.optimize.OccurenceOrderPlugin(),
30+
new webpack.optimize.OccurrenceOrderPlugin(),
4331
function() {
4432
this.plugin('done', function(stats) {
4533
if (stats.compilation.errors && stats.compilation.errors.length) {

webpack/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ configuration.entry = {
1414
PIG: './parse-interface-guide/index.js',
1515
quickstart: './quickstart/index.js',
1616
};
17-
configuration.output.path = './bundles';
17+
configuration.output.path = require('path').resolve('./bundles');
1818

1919
module.exports = configuration;

0 commit comments

Comments
 (0)