ffMathy / FluffySpoon.JavaScript.CSharpToTypeScriptGenerator

A flexible CSharp to TypeScript generator that is Gulp, Webpack and Grunt friendly, written in TypeScript.
MIT License
47 stars 8 forks source link

Is this project abandoned? #183

Open salmin89 opened 6 months ago

salmin89 commented 6 months ago

Hi!

I've been looking for a C# to .TS parser and this project has plenty of features. Respect to you for building this.

As I built an example at work, some edge cases appeared. I though that maybe I can contribute to the project to handle these edge cases, so I pulled this project and tried running the tests.

Currently I can not get any tests to pass. I tried these two things:

Approach 1: Try the older package versions in hope that the tests will run, the way you built them once.

Approach 2: Try with everything updated.

In both attempts I ended up getting some internal typescript.js errors. TypeError: Cannot read properties of null (reading 'kind')


At this point I feel like Hal trying to change a light bulb (youtube)

youtube link


So before I spend any more time trying to debug and decide if I should use this project. Is it abandoned? Can we add some kind of contribution guideline?

ffMathy commented 6 months ago

Hi @salmin89!

Nice to see some activity here, and thank you checking my repo out.

It's indeed very old and not very supported at the moment. You're welcome to try to fix it, and I can definitely give you repo access too.

The csharp parser library that this library uses has a branch open where I was (at some point) converting away from regex into another more stable way of parsing. That's when I lost interest I think, but that branch is still there I believe.

Out of curiosity, what do you plan on using this for?

salmin89 commented 6 months ago

It's indeed very old and not very supported at the moment. You're welcome to try to fix it, and I can definitely give you repo access too.

I tried spending an hour at this, but the lack of documentation from the typescript compiler made it very difficult to figure out what was broken and why.

I totally get if you've put this behind you, but if you do plan on bringing the tests up to date, let us know :)

Out of curiosity, what do you plan on using this for?

We have some software written in C# and I was planning on parsing some of those .cs files to output Typescript types.

The current version of the library does work however. I just don't know how I want to approach certain edge cases yet. Gotta let it mellow for a while.

ffMathy commented 6 months ago

Makes sense. But may I ask why you're not using things like Autorest to generate the types?

salmin89 commented 6 months ago

In this case we don't have an API. The typescript project is a browser extension that uses the NativeMessagingHost API which uses stdin.

But it is a good idea!

ffMathy commented 6 months ago

Ah interesting! Makes total sense.

Well, realistically, I do not think I will get the time for this (especially because it is so niche), but you are welcome to become a contributor! Any PRs are welcome!

salmin89 commented 6 months ago

I did give it another go to try and get the tests running and I got it to work by checkout out tag 1.233. and locking in those versions.

then I tried upgrading each dependency one by one until I couldn't go any further. These are the final versions of the libraries that I managed to get the tests to pass on:

npm i typescript@3.1.5 @types/node@10.17.25 @fluffy-spoon/csharp-parser@1.143.0 jasmine@3.9.0 @types/jasmine@3.9.0 && npm run build && npm run test

After typescript 3.1.5 I kept running into the same issue over and over. No matter what package I tried to align. (this is the issue I'm having) https://github.com/microsoft/TypeScript/issues/28810

If you have time - would you be able to guide me on how to get passed this issue or should I just keep working on typescript version 3.1.5 as the final supported one?

Once I'm confident that the tests are working, I can take a look at maintaining the project with the current CSharpParser. (I'm not ready to take a look at the changes you are working on in that library)