question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Feature request] Generate class with suffix

See original GitHub issue

I’m submitting a…


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

command

nest g cl User.Entity

file

user.entity.ts

code

export class User.Entity {}

Expected behavior

command

nest g cl User --suffix entity or nest g cl User -s entity

file

user.entity.ts

code

export class User {}

additional

User.Entity is not a legal class name. If command like nest g cl User.Entity shall generate export class UserEntity {} without illegal characters. But in filename shall keep the dot because it legal and consider as a suffix.

Minimal reproduction of the problem with instructions

What is the motivation / use case for changing the behavior?

The file pattern of nest.js is like angular that each file has a suffix to represent its role in the project. So we shall add suffix to every file, but class generator is playing not well.

Environment


 _   _             _      ___  _____  _____  _     _____
| \ | |           | |    |_  |/  ___|/  __ \| |   |_   _|
|  \| |  ___  ___ | |_     | |\ `--. | /  \/| |     | |
| . ` | / _ \/ __|| __|    | | `--. \| |    | |     | |
| |\  ||  __/\__ \| |_ /\__/ //\__/ /| \__/\| |_____| |_
\_| \_/ \___||___/ \__|\____/ \____/  \____/\_____/\___/


[System Information]
OS Version     : macOS
NodeJS Version : v10.14.2
NPM Version    : 6.5.0
[Nest Information]
common version : 5.5.0
core version   : 5.5.0
cqrs version   : 5.1.1

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
cristianmartinezcommented, Jan 18, 2019

Hey @kamilmysliwiec , can I take this one?

0reactions
kamilmysliwieccommented, Nov 28, 2019

PR merged

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Feature Request]Suffix appending behind of all class name · Issue ...
When using inner classes will generate a inner class and a field named Mater . data class Blubber( val Master: Master? ) {...
Read more >
Base Class Suffix on Model Generator - Feature Requests
I've implemented a patch to allow for generated models to have a suffix. This allows for easy regeneration of models.
Read more >
Feature Request - Additional suffix to repeated methods - Unity Forum
Feature Request Additional suffix to repeated methods ... In API and Manual we can make some warning, like: "Avoid using loops and loops...
Read more >
Name prefix/suffix functionality – IDEs Support (IntelliJ Platform)
functionality I can determine is that when generating accessor methods for class members with prefixes and suffixes, those accessor methods
Read more >
Using Class Suffixes - Joomla! Documentation
The Class Suffix and Menu Tag ID parameters allow you to fine-tune the CSS styling of your web site. By using a leading...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found