Pluralization is broken
Open
@RomainLanz is already working on this.
Since Nov 26, 2024.
Priority: Low
Status: On Hold
Type: Enhancement
- Dominant language
- TypeScript
- Stars
- 19.1k
- Forks
- 672
- Avg merge
- 10d 23h
- Merged PRs (30d)
- 1
Description
Package version
6.2.2
Describe the bug
When I want to create new models or controllers (and probably other things), the name formatter behaves wrongly in some cases.
For example, try:
node ace make:model cookies
This creates cooky.ts!
This happens for many other words, including made-up words.
I investigated a bit, and seems like the problem comes from pluralize library which is used under the hood by poppinss/utils. Pluralize was last updated in 2019, and has many open pull requests.
So, 3 possible solutions come to my mind:
- replace pluralize or fork it to fix this bugs and avoid conversion of made-up words
- add a flag for all
make:*commands to prevent this auto fix. - instead of changing the word automatically, add an extra step in cli to ask users if they want their new controller/model/... name to be changed or not... something like:
Do you want to change "CookiesCOntroLLer" to "cooky"? (Y/n)
Reproduction repo
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.