reblessed icon indicating copy to clipboard operation
reblessed copied to clipboard

Potential Typescript support?

Open michalusio opened this issue 2 years ago • 13 comments

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?

michalusio avatar Oct 11 '22 19:10 michalusio

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 avatar Oct 27 '22 15:10 kenan238

Finished adding d.ts typings!

kenan238 avatar Oct 27 '22 15:10 kenan238

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).

michalusio avatar Oct 27 '22 19:10 michalusio

Hello @kenan238.

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

DoormatIka avatar Jan 12 '23 08:01 DoormatIka

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 avatar Jan 17 '23 17:01 kenan238

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 avatar Jan 17 '23 17:01 kenan238

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

kenan238 avatar Feb 13 '23 13:02 kenan238

@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

tracker1 avatar Feb 14 '23 06:02 tracker1

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

kenan238 avatar Feb 14 '23 06:02 kenan238

@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.

zyriab avatar Aug 24 '23 22:08 zyriab

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

kenan238 avatar Jun 01 '24 17:06 kenan238

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 :)

zyriab avatar Jun 01 '24 17:06 zyriab

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

kenan238 avatar Jun 02 '24 10:06 kenan238