Closed fratzinger closed 1 year ago
I've been trying to leave the naming to the end user. In this case if you pick message
as the name and messages
as the path then the naming would be the way you expect (see e.g. the generating service section in the guide).
Ok, I oversaw that 🤦♂️
But in services/index.ts
i would have expected the plural version:
export const services = (app: Application) => {
app.configure(messages)
app.configure(user)
// All services will be registered here
}
At least that was my understanding of feathers v4:
What do you think about that?
So in my head (and I remember it was the case in the old cli) the serviceName
is like the servicePath
with camelCase and stripped /v1/sub/...
.
Don't get me wrong, this is such a tiny detail which anyone can easily change. But I think it's worth to think about the convention.
What do you think about adding another question? For example:
What is the name of the model?
Next question: naming-convention for the services folder and containing files? It's users
by default. I would have expect it to match the 'name of the service'.
See the two typebox schemas generated by the cli. On the left, it's a 'custom'
messages
service that I created withfeathers g service
. On the right it's the defaultusers
service that got created byfeathers g app
:See the difference between the namings. In almost every variable name it's plural (left) vs. singular (right):
messagesSchema
vsuserSchema
$id: 'Messages'
(plural) vs.$id: 'User'
(singular)export type Messages
vs.export type User
messagesResolver
...We should make it singular by default, right? Popular solutions: