From 7015473757bbe7fe5755aba8a2ef1e9c234042cf Mon Sep 17 00:00:00 2001 From: David Luecke Date: Wed, 25 Oct 2017 11:08:35 -0700 Subject: [PATCH 1/2] Update to Feathers v3 --- package-lock.json | 243 ++++++++++++++------------------------- package.json | 11 +- test/index.test.js | 13 ++- test/integration.test.js | 11 +- test/verifier.test.js | 7 +- 5 files changed, 105 insertions(+), 180 deletions(-) diff --git a/package-lock.json b/package-lock.json index e5853b1..68c2588 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,19 +4,87 @@ "lockfileVersion": 1, "requires": true, "dependencies": { - "@types/node": { - "version": "8.0.47", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.47.tgz", - "integrity": "sha512-kOwL746WVvt/9Phf6/JgX/bsGQvbrK5iUgzyfwZNcKVFcjAUVSpF9HxevLTld2SG9aywYHOILj38arDdY1r/iQ==", + "@feathersjs/authentication": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@feathersjs/authentication/-/authentication-1.4.0.tgz", + "integrity": "sha512-xbakj697RupG8+bMCzWaHOtkPcggCuxLeDf1k16OaiJUhA1Pl0qNfigrTmWlkEYW4nTvfjNFFf59OBfw/CXywA==", + "dev": true, + "requires": { + "@feathersjs/commons": "1.1.0", + "@feathersjs/errors": "3.0.0-pre.1", + "@feathersjs/socket-commons": "3.0.0-pre.7", + "debug": "3.1.0", + "jsonwebtoken": "8.1.0", + "lodash.clone": "4.5.0", + "lodash.merge": "4.6.0", + "lodash.omit": "4.5.0", + "lodash.pick": "4.4.0", + "long-timeout": "0.1.1", + "ms": "2.0.0", + "passport": "0.4.0", + "uuid": "3.1.0" + } + }, + "@feathersjs/commons": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@feathersjs/commons/-/commons-1.1.0.tgz", + "integrity": "sha512-ZYLjzXtW4l0T2i96a9Qsk/3za4Q6H6fpIiOx8IurkehsPx0KuWyNZdhRjsPdRqRejhoSC9RULpY+GlqI8VUMCA==", "dev": true }, - "@types/socket.io": { - "version": "1.4.31", - "resolved": "https://registry.npmjs.org/@types/socket.io/-/socket.io-1.4.31.tgz", - "integrity": "sha512-HnO78rKiAx+tCEKYFurJvKLNAluN9B0V+yLnkJEY9BVwmCXHA7oKeLCymqP/uAgx0t+un/JM+GJOTwNQJ+ODvQ==", + "@feathersjs/errors": { + "version": "3.0.0-pre.1", + "resolved": "https://registry.npmjs.org/@feathersjs/errors/-/errors-3.0.0-pre.1.tgz", + "integrity": "sha512-kePJDUO9u+MJPnd9AUtGcpJfqR+l7+3asYRq4+r2IeObv3zMTKh7q31WvGUTF/FxCcCsy8oMmQ0aQ4f4IdI6HA==", + "requires": { + "debug": "3.1.0" + } + }, + "@feathersjs/express": { + "version": "1.0.0-pre.4", + "resolved": "https://registry.npmjs.org/@feathersjs/express/-/express-1.0.0-pre.4.tgz", + "integrity": "sha512-+Z1WhVQ3Qa3+TBVX/7H/TgwBeVSH0AdBzAnOoqquRAOcOGyIxqcYSBteUk5cChoJqp1Tro2Dhm2gmQdd1dviyw==", + "dev": true, + "requires": { + "@feathersjs/commons": "1.1.0", + "@feathersjs/errors": "3.0.0-pre.1", + "debug": "3.1.0", + "express": "4.16.2", + "uberproto": "1.2.0" + } + }, + "@feathersjs/feathers": { + "version": "3.0.0-pre.3", + "resolved": "https://registry.npmjs.org/@feathersjs/feathers/-/feathers-3.0.0-pre.3.tgz", + "integrity": "sha512-NpEs6IRLC5+y6XaVllOMZU/jS0GElLPa0YkFLNDyLUvP3cX++TJhZuXmy9RPju/1cp2zSyDcFzO9hPFvhPWjGg==", + "dev": true, + "requires": { + "@feathersjs/commons": "1.1.0", + "debug": "3.1.0", + "events": "1.1.1", + "uberproto": "1.2.0" + } + }, + "@feathersjs/socket-commons": { + "version": "3.0.0-pre.7", + "resolved": "https://registry.npmjs.org/@feathersjs/socket-commons/-/socket-commons-3.0.0-pre.7.tgz", + "integrity": "sha512-4CjtcH3hRtbi5uL0D1SgZLpt60mLS8P+vadarVtKTAVOoQKli3sm/Yzo8tZhAfyZX2TNaeGDuffO+tY+wvmaCg==", + "dev": true, + "requires": { + "@feathersjs/errors": "3.0.0-pre.1", + "debug": "3.1.0", + "lodash": "4.17.4", + "url-pattern": "1.0.3" + } + }, + "@feathersjs/socketio": { + "version": "3.0.0-pre.4", + "resolved": "https://registry.npmjs.org/@feathersjs/socketio/-/socketio-3.0.0-pre.4.tgz", + "integrity": "sha512-C0s4fqAlO6rklOcIZd1Ynp8p+jWFpXj6O4yAEa4sQKITu09g8A8RyfEu0ciZJ+oL/nL6wkhpgEgqZKpkiwYllQ==", "dev": true, "requires": { - "@types/node": "8.0.47" + "@feathersjs/socket-commons": "3.0.0-pre.7", + "debug": "3.1.0", + "socket.io": "2.0.4" } }, "abbrev": { @@ -1368,65 +1436,6 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, - "feathers": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/feathers/-/feathers-2.2.3.tgz", - "integrity": "sha512-p2dgIbhD5IBZRN2At2hahg0KHnyRLIL0sQE+5Ci+GlAHPEQtAVUSgfWqTAOMiNFelHUqlFZSREnXH0VsuV3NOw==", - "dev": true, - "requires": { - "babel-runtime": "6.26.0", - "debug": "3.1.0", - "events": "1.1.1", - "express": "4.16.2", - "feathers-commons": "0.8.7", - "rubberduck": "1.1.1", - "uberproto": "1.2.0" - } - }, - "feathers-authentication": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/feathers-authentication/-/feathers-authentication-1.3.0.tgz", - "integrity": "sha512-CYvYFDkPP5+vveITAv/AmtVsJeafUX1cYnlCZ+agRLuvwGCXX7BKLM99xgwNnYfpwut5y67wlJM0Ud0Fis8Tqw==", - "dev": true, - "requires": { - "debug": "3.1.0", - "feathers-authentication-client": "0.3.3", - "feathers-commons": "0.8.7", - "feathers-errors": "2.9.2", - "feathers-socket-commons": "2.4.0", - "jsonwebtoken": "8.1.0", - "lodash.clone": "4.5.0", - "lodash.merge": "4.6.0", - "lodash.omit": "4.5.0", - "lodash.pick": "4.4.0", - "long-timeout": "0.1.1", - "ms": "2.0.0", - "passport": "0.4.0", - "uuid": "3.1.0" - } - }, - "feathers-authentication-client": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/feathers-authentication-client/-/feathers-authentication-client-0.3.3.tgz", - "integrity": "sha512-JWixbDrGnfAkc4i90HDDANms9AeDybckhOyYse9hTuN34JPMF+dXX4p0M6mXgRkYwa4N8GUxO1E3OuaiwcyF9w==", - "dev": true, - "requires": { - "debug": "2.6.9", - "feathers-errors": "2.9.2", - "jwt-decode": "2.2.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, "feathers-commons": { "version": "0.8.7", "resolved": "https://registry.npmjs.org/feathers-commons/-/feathers-commons-0.8.7.tgz", @@ -1437,18 +1446,9 @@ "version": "2.9.2", "resolved": "https://registry.npmjs.org/feathers-errors/-/feathers-errors-2.9.2.tgz", "integrity": "sha512-qwIX97bNW7+1tWVG073+omUA0rCYKJtTtwuzTrrvfrtdr8J8Dk1Fy4iaV9Fa6/YBD5AZu0lsplPE0iu4u/d4GQ==", - "requires": { - "debug": "3.1.0" - } - }, - "feathers-hooks": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/feathers-hooks/-/feathers-hooks-2.1.1.tgz", - "integrity": "sha512-JCR2Z6QMWBx7mcUApa4KOoAvqUEvWIxIqYJSCm5nuxKVVAyFYpYgq0bKRrluWn07Jd85vHG7UkYH6NhyONXebw==", "dev": true, "requires": { - "feathers-commons": "0.8.7", - "uberproto": "1.2.0" + "debug": "3.1.0" } }, "feathers-memory": { @@ -1474,75 +1474,6 @@ "feathers-commons": "0.8.7" } }, - "feathers-rest": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/feathers-rest/-/feathers-rest-1.8.0.tgz", - "integrity": "sha512-HLkmwJO4YqEpp7LRE7PbDjVmB03CS8KXqGslxsiQgyQ+bD3g2tGIhc0O9r2yQt4HD/QFNpi9jtWe05dS1PnAVA==", - "dev": true, - "requires": { - "debug": "2.6.9", - "feathers-commons": "0.8.7", - "feathers-errors": "2.9.2", - "qs": "6.5.1" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "feathers-socket-commons": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/feathers-socket-commons/-/feathers-socket-commons-2.4.0.tgz", - "integrity": "sha1-Bi79V/mocWZEFFuZOl9ycJlp8eE=", - "dev": true, - "requires": { - "debug": "2.6.9", - "feathers-commons": "0.8.7", - "feathers-errors": "2.9.2" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, - "feathers-socketio": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/feathers-socketio/-/feathers-socketio-2.0.0.tgz", - "integrity": "sha1-zmLjNifeqtUyeeT5tnzawPLPSd4=", - "dev": true, - "requires": { - "@types/socket.io": "1.4.31", - "debug": "2.6.9", - "feathers-socket-commons": "2.4.0", - "socket.io": "2.0.4", - "uberproto": "1.2.0" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - } - } - }, "figures": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/figures/-/figures-1.7.0.tgz", @@ -2305,12 +2236,6 @@ "safe-buffer": "5.1.1" } }, - "jwt-decode": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/jwt-decode/-/jwt-decode-2.2.0.tgz", - "integrity": "sha1-fYa9VmefWM5qhHBKZX3TkruoGnk=", - "dev": true - }, "kind-of": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", @@ -3143,12 +3068,6 @@ "glob": "7.1.2" } }, - "rubberduck": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/rubberduck/-/rubberduck-1.1.1.tgz", - "integrity": "sha1-zSzaS4ZxeBNer8mVpxOE9fdD2wI=", - "dev": true - }, "run-async": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-0.1.0.tgz", @@ -3677,6 +3596,12 @@ "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", "dev": true }, + "url-pattern": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/url-pattern/-/url-pattern-1.0.3.tgz", + "integrity": "sha1-BAkpJHGyTyPFDWWkeTF5PStaz8E=", + "dev": true + }, "user-home": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/user-home/-/user-home-2.0.0.tgz", diff --git a/package.json b/package.json index 98d5bd5..3c87e39 100644 --- a/package.json +++ b/package.json @@ -47,22 +47,21 @@ "lib": "lib" }, "dependencies": { + "@feathersjs/errors": "^3.0.0-pre.1", "debug": "^3.0.0", - "feathers-errors": "^2.5.0", "lodash.merge": "^4.6.0", "lodash.omit": "^4.5.0", "lodash.pick": "^4.4.0", "passport-jwt": "^3.0.0" }, "devDependencies": { + "@feathersjs/authentication": "^1.4.0", + "@feathersjs/express": "^1.0.0-pre.4", + "@feathersjs/feathers": "^3.0.0-pre.3", + "@feathersjs/socketio": "^3.0.0-pre.4", "body-parser": "^1.15.2", "chai": "^4.1.0", - "feathers": "^2.0.2", - "feathers-authentication": "^1.0.0", - "feathers-hooks": "^2.0.0", "feathers-memory": "^1.1.0", - "feathers-rest": "^1.5.2", - "feathers-socketio": "^2.0.0", "istanbul": "^1.1.0-alpha.1", "jsonwebtoken": "^8.0.0", "mocha": "^4.0.0", diff --git a/test/index.test.js b/test/index.test.js index 001ef04..51a0a36 100644 --- a/test/index.test.js +++ b/test/index.test.js @@ -1,13 +1,14 @@ /* eslint-disable no-unused-expressions */ const JWT = require('jsonwebtoken'); -const feathers = require('feathers'); +const feathers = require('@feathersjs/feathers'); +const expressify = require('@feathersjs/express'); +const authentication = require('@feathersjs/authentication'); const memory = require('feathers-memory'); -const authentication = require('feathers-authentication'); -const jwt = require('../lib'); const chai = require('chai'); const sinon = require('sinon'); const sinonChai = require('sinon-chai'); const passportJWT = require('passport-jwt'); +const jwt = require('../lib'); const { Verifier, ExtractJwt } = jwt; const { expect } = chai; @@ -44,7 +45,7 @@ describe('@feathersjs/authentication-jwt', () => { let Payload = { userId: 1 }; beforeEach(done => { - app = feathers(); + app = expressify(feathers()); app.use('/users', memory()); app.configure(authentication({ secret: 'supersecret' })); @@ -57,7 +58,7 @@ describe('@feathersjs/authentication-jwt', () => { it('throws an error if passport has not been registered', () => { expect(() => { - feathers().configure(jwt()); + expressify(feathers()).configure(jwt()); }).to.throw(); }); @@ -70,7 +71,7 @@ describe('@feathersjs/authentication-jwt', () => { it('throws an error if secret is not provided', () => { expect(() => { - app = feathers(); + app = expressify(feathers()); app.configure(authentication({})); app.setup(); }).to.throw(); diff --git a/test/integration.test.js b/test/integration.test.js index 213d6e3..e294af6 100644 --- a/test/integration.test.js +++ b/test/integration.test.js @@ -1,8 +1,8 @@ /* eslint-disable no-unused-expressions */ -const feathers = require('feathers'); -const authentication = require('feathers-authentication'); +const feathers = require('@feathersjs/feathers'); +const expressify = require('@feathersjs/express'); +const authentication = require('@feathersjs/authentication'); const memory = require('feathers-memory'); -const hooks = require('feathers-hooks'); const { expect } = require('chai'); const jwt = require('../lib'); @@ -31,10 +31,9 @@ describe('integration', () => { }; }; - const app = feathers(); + const app = expressify(feathers()); - app.configure(hooks()) - .use('/users', memory()) + app.use('/users', memory()) .configure(authentication({ secret: 'secret' })) .configure(jwt()); diff --git a/test/verifier.test.js b/test/verifier.test.js index 934ec89..77e288e 100644 --- a/test/verifier.test.js +++ b/test/verifier.test.js @@ -1,6 +1,7 @@ /* eslint-disable no-unused-expressions */ -const feathers = require('feathers'); -const authentication = require('feathers-authentication'); +const feathers = require('@feathersjs/feathers'); +const expressify = require('@feathersjs/express'); +const authentication = require('@feathersjs/authentication'); const { Verifier } = require('../lib'); @@ -20,7 +21,7 @@ describe('Verifier', () => { let user; beforeEach(() => { - app = feathers(); + app = expressify(feathers()); user = { email: 'admin@feathersjs.com' }; service = { id: 'id', From 3d881f570bf8825979cdb4f8fdcbc80fb5b396de Mon Sep 17 00:00:00 2001 From: David Luecke Date: Wed, 25 Oct 2017 11:09:40 -0700 Subject: [PATCH 2/2] Update debug dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3c87e39..d0c87dc 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,7 @@ }, "dependencies": { "@feathersjs/errors": "^3.0.0-pre.1", - "debug": "^3.0.0", + "debug": "^3.1.0", "lodash.merge": "^4.6.0", "lodash.omit": "^4.5.0", "lodash.pick": "^4.4.0",