greymind / webapitotypescript Goto Github PK
View Code? Open in Web Editor NEWA tool for code generating TypeScript endpoints for your ASP.NET Web API controllers
License: MIT License
A tool for code generating TypeScript endpoints for your ASP.NET Web API controllers
License: MIT License
Investigate and implement a solution which uses multiple threads for interface scanning. Perhaps extend to other scans as well.
Project has a few features that do not really fit into the backend-to-frontend WebApi to TypeScript pipeline. Such as views and resource file generation. Discuss and if deemed right, move those features to new project(s).
eg:
<data name="EntityAddToLibrary" xml:space="preserve">
<value>The {0} has been added to the {0} library.</value>
</data>
gets generated as:
static EntityAddToLibrary(slot0: string, slot0: string) {
return \`The ${slot0} has been added to the ${slot0} library\`;
}
Best guess is different assembly with mono cecil
Add support for .callCached() method in AngularEndpointsService.
If the same method was called before, this method would grab whatever was received last time.
In case this method is being called first time, it should automatically fetch data from .call() version.
Some of my controllers return camel case properties and others return pascal case. I need a way to handle it :)
Thank you @greymind <3
Generate endpoints service using angular 4 techniques and methods.
It is a fairly challenging problem to figure out the best scheme to detect and support return types for controller actions. Many different control flows could exist, and often times the signature of actions just reads IHttpActionResult!
Clean up code. Please use this thread to identify overall points of cleanup or spawn off into a new issue if it is focused and actionable.
It seems that all enums are always exported regardless of EnumMatches configuration.
Test application needs improvement to demonstrate all the features. Needs multiple angular directives and apps for starters.
Output of the typescript generator is not completely deterministic. It appears that, on different machines, it sometimes generates definitions in different order. This causes spurious file modifications and merge conflicts if generated files are kept in source control.
It is not clear in what exact circumstances this happens.
We have a tool that generates enums and one enum looks like this:
AccountType: {
"Basic": {
"Value": 1,
"ValueName": "Basic",
"Title": "Basic"
},
This gives us more flexibility if we need to generate some text from enum or similar.
It would be nice if this tool provided a way to fetch similar data.
Watts.exe fails when a base type is a generic one.
We have multiple base types with single generic argument and watts is working fine, however it fails with a generic base type that has 3 generic arguments (not sure about 2, did not check that out).
It fails inside InterfaceService in WriteInterfaces(TypeScriptBlock interfacesBlock, InterfaceNode interfaceNode) method on the foreach line. The exception we get is that the collection was modified.
Looking forward to this fix, because we had to utilize interfaces to go around this and that introduced some code duplication.
Thanks!
Now that the code logic is complete, investigate if we can move to Razor or T4 and make it more readable, elegant and maintainable!
Simple things such as ClassWrapper, etc.
Currently watts supports scanning of only one DLL for controllers.
Our use case requires scanning of multiple DLLs.
Could you please add the support for this requirement :)
Issue due to leftover artifact static $http
in the service.
Crazy how this wasn't diagnosed all this while!
Currently, two enums with same name, but under different namespaces collide and we generate a warning. Instead, we can "grow" the name by prefixing the minimum namespace parts required to make it identical.
For example:
namespace Something.Else.Here {
enum EnumType {
}
}
namespace Something.There.Here {
enum EnumType {
}
}
The generated names can be
ElseHereEnumType
ThereHereEnumType
Perhaps do this for other types as well
For now, at least PropertyName
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.