hegel icon indicating copy to clipboard operation
hegel copied to clipboard

How to publish packages?

Open trusktr opened this issue 5 years ago • 2 comments

Since Hegel doesn't emit its own declaration files, I am curious how to publish packages. Does Hegel just read the types from the source files?

trusktr avatar May 20 '20 19:05 trusktr

For now, the answer is yes, or will inference it in the duration of the analysis of the package (if it doesn't contain any d.ts). But, we are developing compiler (which will be a part of the @hegel/cli) which create d.ts files for the package.

JSMonk avatar May 20 '20 20:05 JSMonk

Cool! Looking forward to that!

As Hegel plans to release declaration files, it'd be great for Hegel to avoid having the same problems as TypeScript has in https://github.com/microsoft/TypeScript/issues/35822. The summary is that language features (f.e. type support for class-factory mixins) doesn't work if declaration emit is enabled.

Or in other words, it'll be very nice if all language features of Hegel are fully supported when declaration emit is enabled. Hegel, being new, has the chance to do this part the right way!

I would argue that it is better to add language features when they also work with declaration output (or to put it another way, that declaration output, as well as tests, are required for all language features).

trusktr avatar May 20 '20 20:05 trusktr