TypescriptSyntaxPaste icon indicating copy to clipboard operation
TypescriptSyntaxPaste copied to clipboard

Command-line and/or library plans?

Open joelsand opened this issue 7 years ago • 1 comments

Hi there,

Do you have any plans, or hints as to a simple way how, to make this work in a continuous integration environment? Basically, we have several .NET core apps and packages where we'd like to generate TypeScript definition files as part of the build process.

Thanks, Joel

joelsand avatar May 11 '17 15:05 joelsand

Initially I wanted to create a separate DLL Project for Converting C# -> Typescript, and then VSExtension project can have reference to it, but I got some problem, so in the end I have to put everything to VSExtension Project as of now.

As a temporary solution, you still can use VSExtension as normal DLL, and invoke programmatically like below: (I checked in the new code with sample console project)

var cScript = @"class Foo{}";

            CSharpToTypescriptConverter csharpToTypescriptConverter = new CSharpToTypescriptConverter();

            var typescript = csharpToTypescriptConverter.ConvertToTypescript(cScript, new MySettingStore());

So for CI, I think you can create your own app, and convert which every file you want.

nhabuiduc avatar May 12 '17 10:05 nhabuiduc