Comments (4)
@amdavie I am not going to try to answer for @NeVeSpl, but I will say that there are very valid use cases for generating the TS files and not having them inserted into the project.
My project generates approximately 700 TS files (enums, interfaces and service entry points). I used to use Typewriter for this, which always inserts the files into the project and it would take forever, introducing 10-20 second lockups.
When I migrated to NTypewriter, I changed things up so that these files get generated into the stand alone front end directory and not into a project directory. With this setup, NTypewriter is sub 1 second and everything works great.
I just wanted to point out that there are valid reasons for not adding the files to a project.
from ntypewriter.
As @gregveres already mentioned the main job of NTypewriter is to generate TypeScript files.
SourceGenerator is the youngest addition to NTypewriter family, offering the bare minimum functionality.
Detecting C# files through extensions *.cs
and adding them to compilation was planned from the beginning, but since generating C# is not a base scenario, it did not make it to the first release of SG. I would not mind if any PR appeared and added that functionality.
from ntypewriter.
@gregveres of course - I also generate some non-C# content
@NeVeSpl that is good to hear! I wanted to understand your vision for the SourceGenerator before I attempted my own tool, so I'm potentially interested in doing a PR. I'll need to take some time to familiarize myself with the repo, but it seems we'll need to make an assumption about which files get added to compilation without something explicit like an config option - so do you think if the template is outputting to a .cs file (e.g. Save output "MyClass.cs"
) then the generator would add it to source and not output the file or do we want something more explicit? Please share any thoughts on this feature as well.
from ntypewriter.
For now, I do not think that anything more explicit is necessary, just a simple check of generated file extension would be enough.
from ntypewriter.
Related Issues (20)
- How to convert .NET classes to TypeScript? HOT 4
- Attributes generate values that are region dependent HOT 3
- Dynamic property throws error
- How to get Class from Action.ReturnType or Action.Parameters HOT 3
- IEnumValue should implement ISymbolBase HOT 5
- Allow to use Regex (from System.Text.RegularExpressions) in .nt.cs files HOT 1
- Enum Attribute arguments are stored as Type Object HOT 5
- AttributeArgument with null value, TypedConstant ToString throws NullReferenceException HOT 1
- extracting argument from attribute now fails HOT 5
- Action.ReturnType has is broken with introduction of TypedConstant. HOT 6
- FR: please include the vsix package file in the list of assets for the release. HOT 2
- AttributeArgument.Value is not always ITypedConstant or ITypedConstant[] HOT 4
- AttributeArgument.Value.Tostring() causes exception: TypedConstant is an array. Use Values property
- Unable to build project with SourceGenerator: 'ITypedConstant' could not be found HOT 2
- Unable to debug SourceGenerator, no output and no log files created HOT 6
- Why does Type.ToTypeScriptType ignore nullable if [Required] attribute is present? HOT 4
- Template processing fails when reading arguments from an Attribute that has arguments with default values (Roslyn project) HOT 3
- Missing default value for DateTime
- Incremental Generator HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ntypewriter.