kenan238 / reblessed

A high-level terminal interface library for node.js.
MIT License
87 stars 10 forks source link

Potential Typescript support? #9

Open michalusio opened 2 years ago

michalusio commented 2 years ago

Hi!

First of all, thank you for creating a fork of blessed.

I am currently in the process of writing a JSX wrapper for blessed and I've wanted to use your fork as the basis. However the package does not have any typings, there's no DefinitelyTyped for it, and @types/blessed has many incorrect typings.

I was thinking to either add Typescript to this project, or add a d.ts file with correct typings for now.

I could take a look at it soon if the package is still maintained?

kenan238 commented 2 years ago

Hello, about switching to Typescript, I don't think I really wanna do that. Incrementally adopting it is gonna get messy and rewriting the huge library is gonna be a hard task so I'll go with making d.ts file, I'll start working on it right away.

kenan238 commented 2 years ago

Finished adding d.ts typings!

michalusio commented 2 years ago

Hello @kenan238 !

I'm really not sure why this issue was closed, but I just wanted to say that those typings are not really great (Box accepting any as options...). I can start working on adding declaration files or rewriting the library into TS (You can do that easily using "checkJS" options in tsconfig).

DoormatIka commented 1 year ago

Hello @kenan238.

The .d.ts module doesn't exist in my end, would you please update the npm module for it? image

kenan238 commented 1 year ago

Hello @DoormatIka, just pushed a new version of the library, had to wait until I added some other new stuff to go along with it.

kenan238 commented 1 year ago

Hello @michalusio, I'm not sure about writing manual typings, because of how tedious it would be to constantly update the files and I don't have too much time these days, these will have to do for now. The idea of rewriting it in TS has my approval even though it's gonna be extremely tedious, I'll check out other ways to automate that however

kenan238 commented 1 year ago

Hello again, I'm starting the refactor on another branch

tracker1 commented 1 year ago

@kenan238 nice to hear about the refactor, and looking forward to TS... hoping this will let the library work in Deno, as importing with 'npm:reblessed' and trying to run the demo results in an error.

error: Uncaught RangeError: Maximum call stack size exceeded
kenan238 commented 1 year ago

Cool! I'll fix up the base lib and go on with the refactor

zyriab commented 1 year ago

@kenan238 Do you need any help with the TS refactor? I'd be happy to help if I can! Thanks for keeping this lib alive, btw

By the way, have you seen this @types package? There seems to be problems with your actual TS port (I can't get it working with ESM, for example) that don't exist with this implementation.

kenan238 commented 6 months ago

It'd be handy if you could help since I have been bombarded with exams and I am itching for summer to arrive.

zyriab commented 6 months ago

Hey, I got too much work so I can't help. I tried to rewrite the lib in TS using modern syntax (class, const, etc) as well as refactoring in general but it's really a lot of work and the original code was written in such a way that it's often not obvious what was the author's intent.

To reduce the amount of work I suggest writing d.ts files and adding JSDoc comments here and there in the source but I'd avoid rewriting everything because it would need some reworking on the architecture, etc if you really want to go full in.

Anyway, good luck :)

kenan238 commented 6 months ago

That's what I thought, the original library is such a mess, I'd like to look into re-writing it during my free time