qooxdoo / qooxdoo-compiler

Compiler for Qooxdoo, 100% javascript
MIT License
36 stars 23 forks source link

Script to create a qooxdoo.d.ts and publish to DefinitelyTyped #165

Open johnspackman opened 6 years ago

johnspackman commented 6 years ago

If we publish a qooxdoo.d.ts to https://github.com/DefinitelyTyped/DefinitelyTyped it will be picked up automatically by IDEs (eg Visual Code); there will still be a place for the target output because contribs and developer's own libraries will need to be output, but by publishing to DefinitelyTyped, new users will find that Qooxdoo is recognised by their IDE by default.

The work in creating a qooxdoo.d.ts is already done as part of target output, so all that remains for this issue is to generate qooxdoo.d.ts for just qx.* (which might require some kind of include/exclude filter in config.json) and a script to create a PR to https://github.com/DefinitelyTyped/DefinitelyTyped

hkollmann commented 6 years ago

We can run qx compile in qooxdoo/framework to generate the file. Then we do not need to exclude anything

oetiker commented 6 years ago

since the qx compiler can generate this on the fly, there might be an even simpler route ... by putting the project.d.ts file into a suitable location in the project it will get picked up by visual code automatically ... one location where this does work is source/class/<project>/ but I guess this is somehow configurable ... I just have not yet figured out how :)

Ideally, the compiler would put it in a location where visual code finds it automatically as soon as the project has been compiled for the first time

I guess there could also be a hybrid approach where the qooxdoo-6.0-alpha.d.ts is on DefinitlyTyped and the user's classes and contribs are provided in an extra file ...

Unfortunately, I have not found very helpful information as to were these files have to be placed for visual code to pick them up automatically.

johnspackman commented 6 years ago

The hybrid approach is the right way to go, because every class has to be compiled in order for type completion to work this is quite an overhead for qx.* because of it's shear size and most users will be using a standard release so precompiling is very helpful.

Not sure how we handle versions, I can see that DT support versions so presumably Visual Code will have a way to select which version to use?

oetiker commented 6 years ago

I looked to tech details yesterday but did not find anything ... maybe I was just too tired :(

it is all tightly integrated with npm ... so I guess it takes the same approach ... by default it follows the list of dependencies from packages.json file no extra config needed ... so I guess if it was part of the qxcompiler package that would be the easiest ....

cboulanger commented 5 years ago

@oetiker @johnspackman Is this something that should happen before release or should it be postponed?

cboulanger commented 4 years ago

@oetiker @johnspackman Thoughts?