-
-
Notifications
You must be signed in to change notification settings - Fork 755
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create a generator for a feathers app #80
Comments
+1 I have been thinking about this, too. Include common plugins, such as feathers-errors and feathers-mongoose, etc. |
Yep agreed. We're going to bring feathers-errors into core. See issue #79. I'm working on this right now actually. |
I think that would be great. The question is... what are we going to support in the generator for client side stuff? I'm inclined to just make it a kickass generator for the server with everything you might need and then provide separate client side generators (although it would be nice to generate a service and it does everything both on the server and client for you). |
The issue is that the client will depend on the service's query and return structure. For instance, let's say we use feathers-mongooose, it has different queries supported than feathers-orm-service and the results returned could be different, so our client will have to support that. |
I think that the query mechanism could be normalized with hooks but querying things might also not matter for just scaffolding an application since the basic communication (REST API calls or socket events) will be the same in every case (and methods of pre-implemented services should return the same data structures, too). |
Ya I'm inclined to agree with @daffl. I think that all the query stuff should probably be done with hooks. We should provide examples in the service adapters but shouldn't be built in to the service itself. For scaffolding I would say let's start with a server side generator. We can iterate as we go and improve things as we come across issues. We may or may not need client side generators... but I can't really tell right now they might fit just yet. |
I think the server is a great start and will get us a long way. Maybe others will contribute and build client generators in the future. With regards to the querying: I am not overly familiar with feathers-hooks and even less so how it would be applicable in the case I am thinking of. Could you two example how feathers-hooks could help in this case? Or maybe we are talking about different cases. |
What I mean is that you could add your own querying abstraction on top of your services that implement a common querying pattern so that you can easily swap them out. For example the following hook converts service parameters like userService.before({
find: function(hook, next) {
var query = hook.params.query;
var where = 'WHERE ';
_.each(query, function(value, name) {
where += name + "= '" + sqlEscape(value) + "'";
});
hook.params.query = where;
next();
}
}); We were discussing a generalized querying format for service implementations before but it would be a lot of work to implement (and test against). As for client side adapters wouldn't we just need something like |
As long as the returned data is standardized then all we would need is a {
"total_available": 100,
"start": 10,
"end": 20,
"results": [ { /* data 1 */ },... ]
} Or flatter and without meta data (raw results): [
{ /* data */ },
...
] After that, the
I had a feeling that is what you guys meant. If you guys determine a standard, I will update I'm getting very excited to see this |
Sounds great. I think it would be best to finish up the 1.0 release and the other plugins and the server app generator first and then we'll put a spec for querying service on the roadmap together with client side framework connectors. Makes sense? |
We can now keep track for this in https://github.com/feathersjs/generator-feathers |
This fixes importing with the following syntax: import * as errorHandler from 'feathers-errors/handler'; Which previously were failing with the following error message: [ts] Module '"[...]/node_modules/feathers-errors/handler"' resolves to a non-module entity and cannot be imported using this construct.
This fixes importing with the following syntax: import * as errorHandler from 'feathers-errors/handler'; Which previously were failing with the following error message: [ts] Module '"[...]/node_modules/feathers-errors/handler"' resolves to a non-module entity and cannot be imported using this construct.
* chore(package): update uberproto to version 2.0.0 * Update package-log.json * Fix dependency
* chore(package): update uberproto to version 2.0.0 * Update package-log.json * Fix dependency
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue with a link to this issue for related bugs. |
Possibly a yeoman generator? Or maybe just a CLI like express does. It should initially scaffold out an app structure and a
package.json
file that has all the dependencies that a normal express app needs, especially now that they are separate from express now.I'm thinking an app structure could look like this:
The text was updated successfully, but these errors were encountered: