Skip to content
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

[Feature Request] Provide a way to change the boilerplate text #48

Closed
ryanbuening opened this issue Jan 15, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@ryanbuening
Copy link

commented Jan 15, 2019

It would be nice if there was a way to modify the boilerplate text that goes at the top of the generated TypeScript files. Either from the GenerationSpec or the dotnet typegen generate command.

My use case is that I want to provide a version number to all of my TypeScript files.

/**
 * This is a TypeGen auto-generated file.
 * Any changes made to this file can be lost when this file is regenerated.
 * **FooDTOs version 3**
 */

Great project by the way. Extremely useful.

jburzynski added a commit that referenced this issue Jan 15, 2019

@jburzynski

This comment has been minimized.

Copy link
Owner

commented Jan 15, 2019

Glad it's helpful!

I've added an option to version 2.1.3 (just published). You can add fileHeading to tgconfig.json and just type in the string that should be at the beginning of a TS file.

Also, by default it has no "new line" signs at the end, so if you need some spacing, you can add new line signs at the end of the string.

E.g. to get the content in your example, you can do this:

{
  "fileHeading": "/**\n * This is a TypeGen auto-generated file.\n * Any changes made to this file can be lost when this file is regenerated.\n * **FooDTOs version 3**\n */\n\n"
}
@ryanbuening

This comment has been minimized.

Copy link
Author

commented Jan 15, 2019

Awesome. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.