frhagn / Typewriter

Automatic TypeScript template generation from C# source files
http://frhagn.github.io/Typewriter
Apache License 2.0
536 stars 132 forks source link

Command line support #133

Open jmhdez opened 8 years ago

jmhdez commented 8 years ago

I'd like to use typewriter in an automated build without Visual Studio. Is it possible to run it as a command line tool?

dennisroche commented 8 years ago

@frhagn Is there anything preventing Typewriter being run outside of Visual Studio? I understand that you're using Rosyln. I'm happy to jump in and contribute a PR, just need a start point.

jmhdez commented 8 years ago

I took a look at the code and it looks tightly coupled to Visual Studio and DTE classes. I'm not sure it's going to be easy to add a CLI, but @frhagn, if you are going to try I'd be glad to help.

dennisroche commented 8 years ago

We probably could break the dependency on DTE and use Rosyln for the analysis of the source code. It is a significant change.

Of all the options to generate TypeScript from C# POCO, this is one of the better so happy to contribute.

frhagn commented 8 years ago

Hi guys, the main reason Typewriter is so tightly coupled to Visual Studio is that it needs a full Roslyn Workspace of the current solution to be able to get the rich type and reference info needed. Loading a Workspace is a costly operation that takes several seconds (or sometimes minutes) for a large solution.

I like the idea of being able to use it from the command line and using task runners like Gulp och Grunt. But since the current code base is designed to work within Visual Studio only it requires a major rewrite to break the coupling.

I've started work on a new, more modular, version of Typewriter where this kind of feature should be much simpler to implement, it's still pretty early in development so I haven't pushed it to GitHub yet.

eamodio commented 8 years ago

@frhagn it would be wonderful if the new version would run cross-platform as well. Currently TypeWriter is the only thing I need to spin up my Windows VM for ;)

maleet commented 8 years ago

With Command line support I would like to switch to Jetbrains Rider. Today I use Visual Studio only for TypeWriter and edmx.

edwardridge commented 8 years ago

This would be fantastic - it would also mean it could be run on CI, which is always a plus!

aluanhaddad commented 7 years ago

There are a number of other tools that use Roslyn, notably OmniSharp and Xamarin Studio. That said, Visual Studio support is all I need personally.

eByte23 commented 7 years ago

@frhagn is anyone doing anywork on this? If not wouldn't mind giving it a go. Because I'd like use this with .net core and have the possibility to have a vscode plugin

Apostolos-Daniel commented 6 years ago

Rendering a Typewriter template outside VS would be really useful - would allow for generating the TypeScript files as part of the build. Has anyone found a solution for this other than waiting for the new version of Typewriter?

@frhagn Is there an ETA for version 2? Good work - we have found Typewriter extremely useful!

trygvelo commented 6 years ago

This is a highly anticipated function. Hope someone will add this for CI builds. At the moment we add all the generated files til source control, but having them generated as part of the build would be better.

Macadoshis commented 6 years ago

Are there any news regarding this feature request ? I'm using JetBrains Rider, and not being able to run TypeWriter from a standalone msbuild command is the only reason I sometimes have to start my VS2017 just for running my .tst before commiting.

Awaiting https://rider-support.jetbrains.com/hc/en-us/community/posts/115000454490-Typewriter-support so bad.

wonea commented 6 years ago

@frhagn Is there any news regarding this? I would definitely use a command line interface to incorporate Typewriter with a build server. Is there preview repository available?

KeithHenry commented 6 years ago

Without command line support TypeWriter is increasingly technical debt - we're still using it, but more and more we have to regard it as something that needs to be replaced, as soon as we can get round to it.

It's now the only build tool we have left that must be ran in VS and then the output added to source control, which is increasingly an issue. It's a problem for our build server, it's a problem for our tests, it's a problem getting new people working with our tooling.

It's our only tool that has no support for any editors other than full-fat VS, which is also a problem as more and more of our team uses VS Code day to day, for reasons of cost and because it's just plain better than VS for JS/TS development (better JSX support, better literal support, and support for ES6 modules that full-fat VS just plain lacks).

This should be the priority feature request.

StevenRasmussen commented 6 years ago

Somewhat related to this if you're using Asp.Net Core - they announced as part of the 2.2 roadmap something vague around "API Client Generation": https://github.com/aspnet/Announcements/issues/307

This is what I'm using Typewriter for now (client for calling .Net Core Web Api) so this could be an option if a Typewriter cli is not feasible.

barestan commented 6 years ago

@Macadoshis, I also use Rider and create a netcore port for Typewriter with single file procession and cli: https://github.com/barestan/TypewriterCli.

wonea commented 6 years ago

@barestan Thanks very much! I'll write some PowerShell scripting to pull out of my .cs files and process them. I look forward to testing.

Beej126 commented 6 years ago

@barestan - please be chatty about your experience... i'm swamped with other things to try this myself right away but would love to hear this is a solid possibility now.

@Macadoshis - thanks for the work and sharing!

RudeySH commented 4 years ago

Is it possible to use @barestan's TypewriterCli without using Rider?

dperetz1 commented 3 years ago

is this issue still alive? someone found a reasonable way to trigger typewriter on build / some sort of CI integration? (on VS not Rider)