Skip to content
This repository was archived by the owner on Jun 27, 2019. It is now read-only.

Commit 15292de

Browse files
upgrade by cli (WIP)
1 parent e132823 commit 15292de

Some content is hidden

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

53 files changed

+343
-320
lines changed

package.json

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@
5252
"concurrently": "concurrently --kill-others --success first"
5353
},
5454
"dependencies": {
55+
"@feathersjs/authentication": "^2.1.7",
56+
"@feathersjs/authentication-jwt": "^2.0.1",
57+
"@feathersjs/authentication-local": "^1.2.1",
58+
"@feathersjs/configuration": "^1.0.2",
59+
"@feathersjs/errors": "^3.3.0",
60+
"@feathersjs/express": "^1.2.3",
61+
"@feathersjs/feathers": "^3.1.7",
62+
"@feathersjs/socketio": "^3.2.2",
5563
"body-parser": "~1.18.3",
5664
"cheerio": "^1.0.0-rc.2",
5765
"compression": "~1.7.2",
@@ -60,16 +68,9 @@
6068
"crypto-js": "^3.1.9-1",
6169
"dauria": "~2.0.0",
6270
"email-templates": "2.6.0",
63-
"feathers": "~2.2.4",
64-
"feathers-authentication": "~1.3.1",
6571
"feathers-authentication-hooks": "~0.1.6",
66-
"feathers-authentication-jwt": "~0.3.2",
67-
"feathers-authentication-local": "~0.4.4",
6872
"feathers-authentication-management": "~1.0.3",
6973
"feathers-blob": "~1.3.1",
70-
"feathers-configuration": "~0.4.2",
71-
"feathers-errors": "~2.9.2",
72-
"feathers-hooks": "~2.1.2",
7374
"feathers-hooks-common": "~3.10.0",
7475
"feathers-logger": "0.2.3",
7576
"feathers-mailer": "~2.0.0",
@@ -78,9 +79,7 @@
7879
"feathers-mongodb-fuzzy-search": "~1.1.1",
7980
"feathers-mongoose": "~5.1.2",
8081
"feathers-profiler": "^0.1.5",
81-
"feathers-rest": "~1.8.1",
8282
"feathers-seeder": "~1.0.10",
83-
"feathers-socketio": "~2.0.1",
8483
"fs-blob-store": "~5.2.1",
8584
"fs-extra": "~4.0.2",
8685
"handlebars": "~4.0.11",

server/app.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ const cors = require('cors');
55
// const helmet = require('helmet');
66
const bodyParser = require('body-parser');
77

8-
const feathers = require('feathers');
9-
const configuration = require('feathers-configuration');
10-
const hooks = require('feathers-hooks');
11-
const rest = require('feathers-rest');
12-
const socketio = require('feathers-socketio');
8+
const feathers = require('@feathersjs/feathers');
9+
const express = require('@feathersjs/express');
10+
const configuration = require('@feathersjs/configuration');
11+
const rest = require('@feathersjs/express/rest');
12+
const socketio = require('@feathersjs/socketio');
1313
const seeder = require('./seeder');
1414

1515
const middleware = require('./middleware');
@@ -21,7 +21,7 @@ const Raven = require('raven');
2121
const logger = require('./logger');
2222
const { profiler } = require('feathers-profiler');
2323

24-
const app = feathers();
24+
const app = express(feathers());
2525

2626
app.configure(require('feathers-logger')(logger));
2727

@@ -49,10 +49,8 @@ app.use(bodyParser.json());
4949
app.use(bodyParser.urlencoded({ extended: true }));
5050
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
5151
// Host the public folder
52-
app.use('/', feathers.static(app.get('public')));
52+
app.use('/', express.static(app.get('public')));
5353

54-
// Set up Plugins and providers
55-
app.configure(hooks());
5654
app.configure(mongoose);
5755
app.configure(rest());
5856

server/authentication.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
const authentication = require('feathers-authentication');
2-
const jwt = require('feathers-authentication-jwt');
3-
const local = require('feathers-authentication-local');
1+
const authentication = require('@feathersjs/authentication');
2+
const jwt = require('@feathersjs/authentication-jwt');
3+
const local = require('@feathersjs/authentication-local');
44
const { lowerCase } = require('feathers-hooks-common');
55

66
module.exports = function () {

server/hooks/exclude-disabled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Exclude items with isEnabled = false
2-
const errors = require('feathers-errors');
2+
const errors = require('@feathersjs/errors');
33

44
module.exports = function excludeDisabled() {
55
return function (hook) {

server/hooks/is-admin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Check if user is admin
2-
const errors = require('feathers-errors');
2+
const errors = require('@feathersjs/errors');
33

44
module.exports = () => hook => {
55
if(!hook.params || !hook.params.user || hook.params.user.role !== 'admin') {

server/hooks/is-enabled.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// For more information on hooks see: http://docs.feathersjs.com/api/hooks.html
33

44
const _ = require('lodash');
5-
const errors = require('feathers-errors');
5+
const errors = require('@feathersjs/errors');
66

77
module.exports = function isEnabled(options = {}) { // eslint-disable-line no-unused-vars
88
return function (hook) {

server/hooks/is-moderator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Check if user is moderator
2-
const errors = require('feathers-errors');
2+
const errors = require('@feathersjs/errors');
33

44
module.exports = () => hook => {
55
if(!hook.params || !hook.params.user || !['admin','moderator'].includes(hook.params.user.role)) {

server/hooks/restrictToOwnerOrModerator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const { getByDot } = require('feathers-hooks-common');
2-
const errors = require('feathers-errors');
2+
const errors = require('@feathersjs/errors');
33

44
module.exports = function restrictToOwnerOrModerator (query = {}) { // eslint-disable-line no-unused-vars
55
return function (hook) {

server/middleware/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const handler = require('feathers-errors/handler');
1+
const handler = require('@feathersjs/express/errors');
22
const notFound = require('feathers-errors/not-found');
33

44
module.exports = function () {

server/services/admin/admin.hooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
const { authenticate } = require('feathers-authentication').hooks;
1+
const { authenticate } = require('@feathersjs/authentication').hooks;
22
const { when, isProvider } = require('feathers-hooks-common');
33
const isAdmin = require('../../hooks/is-admin');
44

0 commit comments

Comments
 (0)