Skip to content

Commit 5fdd9c8

Browse files
authored
Merge pull request #465 from bertho-zero/deps
update dependencies
2 parents 2b1942c + 9130265 commit 5fdd9c8

50 files changed

Lines changed: 4929 additions & 3429 deletions

Some content is hidden

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

.babelrc

Lines changed: 37 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,57 @@
11
{
22
"presets": [
3-
"react",
3+
"@babel/preset-react",
44
[
5-
"env",
5+
"@babel/preset-env",
66
{
77
"targets": {
88
"browsers": ["last 2 versions", "IE >= 8"],
99
"node": "current"
1010
},
1111
"useBuiltIns": "entry"
1212
}
13-
],
14-
"stage-0"
13+
]
1514
],
1615
"plugins": [
17-
"transform-runtime",
18-
"transform-decorators-legacy",
16+
[
17+
"@babel/plugin-transform-runtime",
18+
{
19+
"corejs": 2
20+
}
21+
],
22+
[
23+
"@babel/plugin-proposal-decorators",
24+
{
25+
"legacy": true
26+
}
27+
],
1928
"react-loadable/babel",
20-
"react-hot-loader/babel"
29+
"react-hot-loader/babel",
30+
"@babel/plugin-syntax-dynamic-import",
31+
"@babel/plugin-syntax-import-meta",
32+
"@babel/plugin-proposal-class-properties",
33+
"@babel/plugin-proposal-json-strings",
34+
"@babel/plugin-proposal-function-sent",
35+
"@babel/plugin-proposal-export-namespace-from",
36+
"@babel/plugin-proposal-numeric-separator",
37+
"@babel/plugin-proposal-throw-expressions",
38+
"@babel/plugin-proposal-export-default-from",
39+
"@babel/plugin-proposal-logical-assignment-operators",
40+
"@babel/plugin-proposal-optional-chaining",
41+
[
42+
"@babel/plugin-proposal-pipeline-operator",
43+
{
44+
"proposal": "minimal"
45+
}
46+
],
47+
"@babel/plugin-proposal-nullish-coalescing-operator",
48+
"@babel/plugin-proposal-do-expressions",
49+
"@babel/plugin-proposal-function-bind"
2150
],
2251
"env": {
2352
"development": {
2453
"plugins": [
25-
"transform-react-jsx-source"
54+
"@babel/plugin-transform-react-jsx-source"
2655
]
2756
}
2857
}

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
webpack/*
1+
node_modules/
2+
static/dist/

.eslintrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"consistent-return": "off",
1313
"global-require": "off",
1414
"indent": ["error", 2, {"SwitchCase": 1}],
15-
"max-len": ["error", 120, {"ignorePattern": "[^\\n\\r]{115,120}\\{(?:'|\") (?:'|\")\\}"}],
15+
"max-len": ["warn", 120],
1616
"no-alert": "off",
1717
"no-confusing-arrow": "off",
1818
"no-console": "off",
@@ -24,6 +24,7 @@
2424
"react/jsx-closing-tag-location": "off",
2525
"react/jsx-filename-extension": "off",
2626
"react/jsx-no-target-blank": "warn",
27+
"react/jsx-one-expression-per-line": "off",
2728
"react/no-multi-comp": ["error", {"ignoreStateless": true}],
2829
"react/no-unescaped-entities": "off",
2930
"react/prefer-stateless-function": "warn",
@@ -66,7 +67,6 @@
6667
"__DISABLE_SSR__": true,
6768
"__DEVTOOLS__": true,
6869
"__DLLS__": true,
69-
"socket": true,
7070
"webpackIsomorphicTools": true
7171
}
7272
}

.travis.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ language: node_js
55
node_js:
66
- '10'
77
- '8'
8-
- '6'
98

109
addons:
1110
apt:

api/api.js

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,24 @@ import channels from './channels';
1212

1313
const pretty = new PrettyError();
1414

15-
process.on('unhandledRejection', (reason, p) =>
16-
console.error('Unhandled Rejection at: Promise ', p, pretty.render(reason)));
15+
process.on('unhandledRejection', (reason, p) => {
16+
console.error('Unhandled Rejection at: Promise ', p, pretty.render(reason));
17+
});
1718

1819
const app = express(feathers());
1920

2021
app
2122
.set('config', config)
2223
.use(morgan('dev'))
2324
.use(cookieParser())
24-
.use(session({
25-
secret: 'react and redux rule!!!!',
26-
resave: false,
27-
saveUninitialized: false,
28-
cookie: { maxAge: 60000 }
29-
}))
25+
.use(
26+
session({
27+
secret: 'react and redux rule!!!!',
28+
resave: false,
29+
saveUninitialized: false,
30+
cookie: { maxAge: 60000 }
31+
})
32+
)
3033
.use(bodyParser.urlencoded({ extended: true }))
3134
.use(bodyParser.json())
3235
// Core
@@ -36,15 +39,17 @@ app
3639
.configure(channels)
3740
// Final handlers
3841
.use(express.notFound())
39-
.use(express.errorHandler({
40-
logger: {
41-
error: error => {
42-
if (error && error.code !== 404) {
43-
console.error('API ERROR:', pretty.render(error));
42+
.use(
43+
express.errorHandler({
44+
logger: {
45+
error: error => {
46+
if (error && error.code !== 404) {
47+
console.error('API ERROR:', pretty.render(error));
48+
}
4449
}
4550
}
46-
}
47-
}));
51+
})
52+
);
4853

4954
if (process.env.APIPORT) {
5055
app.listen(process.env.APIPORT, err => {

api/config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const ONE_DAY = 60 * 60 * 24 * 1000;
22

3-
module.exports = {
3+
const config = {
44
auth: {
55
secret: 'super secret',
66
cookie: {
@@ -22,3 +22,5 @@ module.exports = {
2222
}
2323
}
2424
};
25+
26+
export default config;

api/services/authentication/index.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ import FacebookTokenStrategy from 'passport-facebook-token';
77

88
function populateUser() {
99
return context => {
10-
context.result.user = context.params.user;
10+
const { result, params } = context;
11+
12+
result.user = params.user;
1113
};
1214
}
1315

@@ -18,10 +20,12 @@ export default function authenticationService(app) {
1820
.configure(auth(config))
1921
.configure(jwt())
2022
.configure(local()) // .configure(oauth1()) // TODO twitter example
21-
.configure(oauth2({
22-
name: 'facebook', // if the name differs from your config key you need to pass your config options explicitly
23-
Strategy: FacebookTokenStrategy
24-
}));
23+
.configure(
24+
oauth2({
25+
name: 'facebook', // if the name differs from your config key you need to pass your config options explicitly
26+
Strategy: FacebookTokenStrategy
27+
})
28+
);
2529

2630
app.service('authentication').hooks({
2731
before: {

api/services/messages/hooks.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import auth from '@feathersjs/authentication';
22
import local from '@feathersjs/authentication-local';
33
import { restrictToOwner } from 'feathers-authentication-hooks';
4-
import { fastJoin, disallow, iff, isProvider, keep } from 'feathers-hooks-common';
4+
import {
5+
fastJoin, disallow, iff, isProvider, keep
6+
} from 'feathers-hooks-common';
57
import { required } from 'utils/validation';
68
import { validateHook as validate } from 'hooks';
79

@@ -39,9 +41,11 @@ const messagesHooks = {
3941
create: [
4042
validate(schemaValidator),
4143
context => {
44+
const { data, params } = context;
45+
4246
context.data = {
43-
text: context.data.text,
44-
sentBy: context.params.user ? context.params.user._id : null, // Set the id of current user
47+
text: data.text,
48+
sentBy: params.user ? params.user._id : null, // Set the id of current user
4549
createdAt: new Date()
4650
};
4751
}

api/services/users/hooks.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import errors from '@feathersjs/errors';
44
import { restrictToOwner } from 'feathers-authentication-hooks';
55
import { discard } from 'feathers-hooks-common';
66
import { validateHook } from 'hooks';
7-
import { required, email, match, unique } from 'utils/validation';
7+
import {
8+
required, email, match, unique
9+
} from 'utils/validation';
810

911
const schemaValidator = {
1012
email: [required, email, unique('email')],
@@ -14,9 +16,12 @@ const schemaValidator = {
1416

1517
function validate() {
1618
return context => {
17-
if (context.data.facebook && !context.data.email) {
18-
throw new errors.BadRequest('Incomplete oauth registration', context.data);
19+
const { data } = context;
20+
21+
if (data.facebook && !data.email) {
22+
throw new errors.BadRequest('Incomplete oauth registration', data);
1923
}
24+
2025
return validateHook(schemaValidator)(context);
2126
};
2227
}

bin/server.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ if (__DEVELOPMENT__) {
2525

2626
// https://github.com/halt-hammerzeit/webpack-isomorphic-tools
2727
const WebpackIsomorphicTools = require('webpack-isomorphic-tools');
28-
global.webpackIsomorphicTools = new WebpackIsomorphicTools(
29-
require('../webpack/webpack-isomorphic-tools')
30-
).server(rootDir, () => {
31-
require('../src/server');
32-
});
28+
global.webpackIsomorphicTools = new WebpackIsomorphicTools(require('../webpack/webpack-isomorphic-tools')).server(
29+
rootDir,
30+
() => {
31+
require('../src/server');
32+
}
33+
);

0 commit comments

Comments
 (0)