qooxdoo / qooxdoo-compiler

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

Add API generator #21

Closed johnspackman closed 5 years ago

johnspackman commented 7 years ago

This is now partially implemented, in that qooxdoo-compiler outputs a meta data file for every transpiled javascript source file, eg. there is a transpiled/qx/core/Object.json that describes everything about qx.core.Object including documentation in parsed JSDoc comments. This is a different format to the meta data which was output by the generator so the API viewer code will have to be modified to read it, but OTOH the format is much easier to read and parse so that should be a fairly straightforward task.

Current ideas on packaging (see https://github.com/qooxdoo/qooxdoo/issues/9369) suggest that the API viewer should be repackaged as a contrib rather than part of the main distribution. So that this is easily accessible to users, it would be great to have the API viewer work by:

qx api enable 
qx api run

Where qx api enable is a one-time-only task, which is the equivalent of qx contrib update && qx contrib add qooxdoo/qooxdoo-api-viewer, then adding a new application in compile.json referring to the API Viewer's Application class, and finally qx compile. This means that every time qx compile is run, the API viewer application is also updated.

qx api run would start a micro web server that the API Viewer application uses to load the meta data and display documentation.

@cboulanger For this to be possible, qooxdoo-cli needs to be modified so that the qx contrib commands are available as a Javascript API and not just as as yargs commands. What do you think?

johnspackman commented 7 years ago

Meta data docs are here: https://github.com/qooxdoo/qooxdoo-compiler/blob/master/docs/MetaData.md

cboulanger commented 7 years ago

@johnspackman Yes, qx contrib needs to be an API for sure. I had this on my list and was just about to start it because the yargs command files started too become to complex and code-redundant. Stay tuned.

hkollmann commented 5 years ago

api-viewer is ready and a contrib now.