From e32b9f3f572c4750a6f9431d1c21bbfc49b0e236 Mon Sep 17 00:00:00 2001 From: Eric Kryski Date: Thu, 3 Mar 2016 09:07:13 -0700 Subject: [PATCH 01/11] updating readme example and adding direct links to popular things --- readme.md | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/readme.md b/readme.md index 3266e703ee..9944a24d67 100644 --- a/readme.md +++ b/readme.md @@ -26,7 +26,7 @@ To learn more about Feathers visit the website at [feathersjs.com](http://feathe ## See it in action -Here is all the code you need to create a RESTful, real-time todo API that uses an in memory data store: +Here is all the code you need to create a RESTful, real-time message API that uses an in memory data store: ```js // app.js @@ -35,6 +35,7 @@ var rest = require('feathers-rest'); var socketio = require('feathers-socketio'); var memory = require('feathers-memory'); var bodyParser = require('body-parser'); +var handler = require('feathers-errors/handler'); // A Feathers app is the same as an Express app var app = feathers(); @@ -47,8 +48,10 @@ app.configure(socketio()); app.use(bodyParser.json()); // Parse URL-encoded params app.use(bodyParser.urlencoded({ extended: true })); -// Register our memory "todos" service -app.use('/todos', memory()); +// Register our memory "messages" service +app.use('/messages', memory()); +// Register a nicer error handler than the default Express one +app.use(handler()); // Start the server app.listen(3000); ``` @@ -56,11 +59,19 @@ app.listen(3000); Then run ``` -npm install feathers feathers-rest feathers-socketio feathers-memory body-parser +npm install feathers feathers-rest feathers-socketio feathers-errors feathers-memory body-parser node app ``` -and go to [http://localhost:3000/todos](http://localhost:3000/todos). That's it! There's a lot more you can do with Feathers including; using a real database, authentication, authorization, clustering and more! Head on over to [the Feathers docs](http://docs.feathersjs.com) to see just how easy it is to build scalable real-time apps. +and go to [http://localhost:3000/messages](http://localhost:3000/messages). That's it! There's a lot more you can do with Feathers including; using a real database, authentication, authorization, clustering and more! Head on over to [the Feathers docs](http://docs.feathersjs.com) to see just how easy it is to build scalable real-time apps. + +## Documentation + +The [Feathers docs](http://docs.feathersjs.com) are loaded with awesome stuff and tell you every thing you need to know about using and configuring Feathers. + +## Examples + +Each plugin has it's own minimal example in the repo. To see some more complex examples go to [feathersjs/feathers-demos](https://github.com/feathersjs/feathers-demos). ## License From 0e82496d6b4cfd8204518915ddb634f3bafd9529 Mon Sep 17 00:00:00 2001 From: Eric Kryski Date: Mon, 7 Mar 2016 16:40:51 -0700 Subject: [PATCH 02/11] fixing logo url --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 9944a24d67..127d7aa6e1 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -Feathers logo +Feathers logo ## A minimalist real-time framework for tomorrow's apps. From ad7298a88bb260670f999660bbacb77d21d1e0e1 Mon Sep 17 00:00:00 2001 From: Eric Kryski Date: Mon, 7 Mar 2016 16:41:23 -0700 Subject: [PATCH 03/11] fixing for realz --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 127d7aa6e1..c898e3a49c 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -Feathers logo +Feathers logo ## A minimalist real-time framework for tomorrow's apps. From 71e621fa29f026e3026832e6de673b15c3ef3ee2 Mon Sep 17 00:00:00 2001 From: greenkeeperio-bot Date: Mon, 14 Mar 2016 19:33:21 -0400 Subject: [PATCH 04/11] feathers-client is not necessary for those tests --- package.json | 1 - test/distributed.test.js | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index ec44e6364f..40ac5bf239 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "babel-plugin-add-module-exports": "^0.1.2", "babel-preset-es2015": "^6.3.13", "body-parser": "^1.13.2", - "feathers-client": "^0.5.1", "feathers-rest": "^1.1.0", "feathers-socketio": "^1.1.0", "istanbul": "^0.4.0", diff --git a/test/distributed.test.js b/test/distributed.test.js index ea9ebe08cd..cd5e557761 100644 --- a/test/distributed.test.js +++ b/test/distributed.test.js @@ -1,9 +1,10 @@ import assert from 'assert'; -import client from 'feathers-client'; import io from 'socket.io-client'; import socketio from 'feathers-socketio'; +import socketioClient from 'feathers-socketio/client'; import rest from 'feathers-rest'; import feathers from '../src/'; +import client from '../src/client'; describe('Distributed Feathers applications test', () => { before(done => { @@ -21,7 +22,7 @@ describe('Distributed Feathers applications test', () => { it('passes created event between servers', done => { const socket = io('http://localhost:8888'); - const remoteApp = client().configure(client.socketio(socket)); + const remoteApp = client().configure(socketioClient(socket)); const todo = { text: 'Created on alpha server', complete: false }; const beta = feathers() .configure(rest()) From f14fe93155a7ffe1ac81e2bd4517fa0cb3b19b71 Mon Sep 17 00:00:00 2001 From: David Luecke Date: Sat, 19 Mar 2016 10:55:22 -0700 Subject: [PATCH 05/11] Remove outdated changelog and link to the correct changelog in the documentation instead --- changelog.md | 88 +--------------------------------------------------- 1 file changed, 1 insertion(+), 87 deletions(-) diff --git a/changelog.md b/changelog.md index 31f1b912c1..572a7b7063 100644 --- a/changelog.md +++ b/changelog.md @@ -1,89 +1,3 @@ ## Changelog -__1.3.0__ - -- Add ability to create, update, patch and remove many ([#144](https://github.com/feathersjs/feathers/issues/144), [#179](https://github.com/feathersjs/feathers/pull/179)) -- Handle middleware passed after the service to app.use ([#176](https://github.com/feathersjs/feathers/issues/176), [#178](https://github.com/feathersjs/feathers/pull/178)) - -__1.2.0__ - -- Add hook object to service events parameters ([#148](https://github.com/feathersjs/feathers/pull/148)) -- Argument normalization runs before event mixin punched methods ([#150](https://github.com/feathersjs/feathers/issues/150)) - -__1.1.1__ - -- Fix 404 not being properly thrown by REST provider ([#146](https://github.com/feathersjs/feathers/pull/146)) - -__1.1.0__ - -- Service `setup` called before `app.io` instantiated ([#131](https://github.com/feathersjs/feathers/issues/131)) -- Allow to register services that already are event emitter ([#118](https://github.com/feathersjs/feathers/issues/118)) -- Clustering microservices ([#121](https://github.com/feathersjs/feathers/issues/121)) -- Add debug module and messages ([#114](https://github.com/feathersjs/feathers/issues/114)) -- Server hardening with socket message validation and normalization ([#113](https://github.com/feathersjs/feathers/issues/113)) -- Custom service events ([#111](https://github.com/feathersjs/feathers/issues/111)) -- Support for registering services dynamically ([#67](https://github.com/feathersjs/feathers/issues/67), [#96](https://github.com/feathersjs/feathers/issues/96), [#107](https://github.com/feathersjs/feathers/issues/107)) - -__1.0.2__ - -- Use Uberproto extended instance when creating services ([#105](https://github.com/feathersjs/feathers/pull/105)) -- Make sure that mixins are specific to each new app ([#104](https://github.com/feathersjs/feathers/pull/104)) - -__1.0.1__ - -- Rename Uberproto .create to avoid conflicts with service method ([#100](https://github.com/feathersjs/feathers/pull/100), [#99](https://github.com/feathersjs/feathers/issues/99)) - -__[1.0.0](https://github.com/feathersjs/feathers/issues?q=milestone%3A1.0.0)__ - -- Remove app.lookup and make the functionality available as app.service ([#94](https://github.com/feathersjs/feathers/pull/94)) -- Allow not passing parameters in websocket calls ([#92](https://github.com/feathersjs/feathers/pull/91)) -- Add _setup method ([#91](https://github.com/feathersjs/feathers/pull/91)) -- Throw an error when registering a service after application start ([#78](https://github.com/feathersjs/feathers/pull/78)) -- Send socket parameters as params.query ([#72](https://github.com/feathersjs/feathers/pull/72)) -- Send HTTP 201 and 204 status codes ([#71](https://github.com/feathersjs/feathers/pull/71)) -- Upgrade to SocketIO 1.0 ([#70](https://github.com/feathersjs/feathers/pull/70)) -- Upgrade to Express 4.0 ([#55](https://github.com/feathersjs/feathers/pull/55), [#54](https://github.com/feathersjs/feathers/issues/54)) -- Allow service methods to return a promise ([#59](https://github.com/feathersjs/feathers/pull/59)) -- Allow to register services with custom middleware ([#56](https://github.com/feathersjs/feathers/pull/56)) -- REST provider should not be added by default ([#53](https://github.com/feathersjs/feathers/issues/53)) - -__[0.4.0](https://github.com/feathersjs/feathers/issues?q=milestone%3A0.4.0)__ - -- Allow socket provider event filtering and params passthrough ([#49](https://github.com/feathersjs/feathers/pull/49), [#50](https://github.com/feathersjs/feathers/pull/50), [#51](https://github.com/feathersjs/feathers/pull/51)) -- Added `patch` support ([#47](https://github.com/feathersjs/feathers/pull/47)) -- Allow to configure REST handler manually ([#40](https://github.com/feathersjs/feathers/issues/40), [#52](https://github.com/feathersjs/feathers/pull/52)) - - -__0.3.2__ - -- Allows Feathers to use other Express apps ([#46](https://github.com/feathersjs/feathers/pull/46)) -- Updated dependencies and switched to Lodash ([#42](https://github.com/feathersjs/feathers/pull/42)) - -__0.3.1__ - -- REST provider refactoring ([#35](https://github.com/feathersjs/feathers/pull/35)) to make it easier to develop plugins -- HTTP requests now return 405 (Method not allowed) when trying to access unavailable service methods ([#35](https://github.com/feathersjs/feathers/pull/35)) - -__0.3.0__ - -- Added [Primus](https://github.com/primus/primus) provider ([#34](https://github.com/feathersjs/feathers/pull/34)) -- `app.setup(server)` to support HTTPS (and other functionality that requires a custom server) ([#33](https://github.com/feathersjs/feathers/pull/33)) -- Removed bad SocketIO configuration ([#19](https://github.com/feathersjs/feathers/issues/19)) -- Add .npmignore to not publish .idea folder ([#30](https://github.com/feathersjs/feathers/issues/30)) -- Remove middleware: connect.bodyParser() ([#27](https://github.com/feathersjs/feathers/pull/27)) - -__0.2.0__ - -- Pre-initialize `req.feathers` in REST provider to set service parameters -- Allowing to initialize services with or without slashes to be more express-compatible - -__0.1.0__ - -- First beta release -- Directly extends Express -- Removed built in services and moved to [Legs](https://github.com/feathersjs/legs) -- Created [example repository](https://github.com/feathersjs/examples) - -__0.0.x__ - -- Initial test alpha releases +Please refer to the full [changelog at docs.feathersjs.com](http://docs.feathersjs.com/changelog.html). From bfe336affcff1b8fc1c07b6ff6af1c1224fb059a Mon Sep 17 00:00:00 2001 From: Eric Kryski Date: Fri, 1 Apr 2016 10:36:19 -0600 Subject: [PATCH 06/11] updating build badge --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index c898e3a49c..6e047003cf 100644 --- a/readme.md +++ b/readme.md @@ -2,7 +2,7 @@ ## A minimalist real-time framework for tomorrow's apps. -[![NPM](https://nodei.co/npm/feathers.png?downloads=true&stars=true)](https://nodei.co/npm/feathers/) +[![NPM](https://nodei.co/npm/feathers.png?stars&downloads&downloadRank)](https://nodei.co/npm/feathers/) [![NPM](https://nodei.co/npm-dl/feathers.png?months=6&height=3)](https://nodei.co/npm/feathers/) [![Build Status](https://travis-ci.org/feathersjs/feathers.png?branch=master)](https://travis-ci.org/feathersjs/feathers) [![Code Climate](https://codeclimate.com/github/feathersjs/feathers.png)](https://codeclimate.com/github/feathersjs/feathers) From b834a9a5db314baef043fb7ba07ba7f97090b4aa Mon Sep 17 00:00:00 2001 From: Marshall Thompson Date: Thu, 14 Apr 2016 18:42:32 -0600 Subject: [PATCH 07/11] Update readme.md --- readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.md b/readme.md index 6e047003cf..519a0adf6a 100644 --- a/readme.md +++ b/readme.md @@ -26,7 +26,7 @@ To learn more about Feathers visit the website at [feathersjs.com](http://feathe ## See it in action -Here is all the code you need to create a RESTful, real-time message API that uses an in memory data store: +Here is all the code you need to create a RESTful, real-time message API that uses an in-memory data store: ```js // app.js From 7196c0361d071c7c25e367d1c82c8e33ced427c4 Mon Sep 17 00:00:00 2001 From: Marshall Thompson Date: Thu, 14 Apr 2016 21:53:57 -0600 Subject: [PATCH 08/11] Update readme.md (#302) * Update readme.md * Use ES6 in Readme --- readme.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/readme.md b/readme.md index 519a0adf6a..0629d7a66a 100644 --- a/readme.md +++ b/readme.md @@ -15,10 +15,10 @@ Feathers is a real-time, micro-service web framework for NodeJS that gives you c You can build your first real-time API in just 4 commands: ```bash -$ npm install -g yo generator-feathers +$ npm install -g feathers-cli $ mkdir my-new-app $ cd my-new-app/ -$ yo feathers +$ feathers generate $ npm start ``` @@ -30,15 +30,15 @@ Here is all the code you need to create a RESTful, real-time message API that us ```js // app.js -var feathers = require('feathers'); -var rest = require('feathers-rest'); -var socketio = require('feathers-socketio'); -var memory = require('feathers-memory'); -var bodyParser = require('body-parser'); -var handler = require('feathers-errors/handler'); +const feathers = require('feathers'); +const rest = require('feathers-rest'); +const socketio = require('feathers-socketio'); +const memory = require('feathers-memory'); +const bodyParser = require('body-parser'); +const handler = require('feathers-errors/handler'); // A Feathers app is the same as an Express app -var app = feathers(); +const app = feathers(); // Add REST API support app.configure(rest()); From 3756f99af7680b6e9e77b70d6e2f46efba1a6839 Mon Sep 17 00:00:00 2001 From: David Luecke Date: Sat, 23 Apr 2016 17:56:25 -0700 Subject: [PATCH 09/11] Test and fix for allowing services with only a setup method (#285) (#308) --- src/application.js | 8 +++++--- test/application.test.js | 14 ++++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/application.js b/src/application.js index e76785ca6f..35bcf7e8f0 100644 --- a/src/application.js +++ b/src/application.js @@ -46,7 +46,8 @@ export default { // Run the provider functions to register the service this.providers.forEach(provider => - provider.call(this, location, protoService, options)); + provider.call(this, location, protoService, options) + ); // If we ran setup already, set this service up explicitly if (this._isSetup && typeof protoService.setup === 'function') { @@ -75,10 +76,11 @@ export default { }); const hasMethod = methods => methods.some(name => - (service && typeof service[name] === 'function')); + (service && typeof service[name] === 'function') + ); // Check for service (any object with at least one service method) - if(hasMethod(['handle', 'set']) || !hasMethod(this.methods)) { + if(hasMethod(['handle', 'set']) || !hasMethod(this.methods.concat('setup'))) { return this._super.apply(this, arguments); } diff --git a/test/application.test.js b/test/application.test.js index a2ed781705..0048e867c7 100644 --- a/test/application.test.js +++ b/test/application.test.js @@ -326,6 +326,20 @@ describe('Feathers application', () => { assert.equal(otherApp.mixins.length, 4); }); + it('initializes a service with only a setup method (#285)', done => { + const app = feathers(); + + app.use('/setup-only', { + setup(_app, path) { + assert.equal(_app, app); + assert.equal(path, 'setup-only'); + done(); + } + }); + + app.setup(); + }); + it('Event punching happens after normalization (#150)', done => { const todoService = { create(data) { From 0072e3e4631c68e3525f0c3dcb6bb775582b1031 Mon Sep 17 00:00:00 2001 From: David Luecke Date: Sat, 23 Apr 2016 18:09:22 -0700 Subject: [PATCH 10/11] Remove JSON loading from the client version (#306) --- src/client/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/index.js b/src/client/index.js index b617b92bbb..7860ab7651 100644 --- a/src/client/index.js +++ b/src/client/index.js @@ -5,4 +5,4 @@ export default function createApplication(... args) { return feathers(express(... args)); } -createApplication.version = require('../../package.json').version; +createApplication.version = '2.0.1'; From 93f6a09c2a94ff1b77fb455f5fb101b5c52c6a63 Mon Sep 17 00:00:00 2001 From: David Luecke Date: Wed, 27 Apr 2016 18:39:17 -0700 Subject: [PATCH 11/11] 2.0.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 40ac5bf239..6934b6bc23 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "feathers", "description": "Build Better APIs, Faster than Ever.", - "version": "2.0.0", + "version": "2.0.1", "homepage": "http://feathersjs.com", "repository": { "type": "git",