Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate node-express from JS sources with dox #8

Open
angelozerr opened this issue Oct 3, 2014 · 8 comments
Open

Generate node-express from JS sources with dox #8

angelozerr opened this issue Oct 3, 2014 · 8 comments

Comments

@angelozerr
Copy link
Owner

Today the JSON Type Definition of node-express is written at hand.

It should be cool if we can generat eit from JS express sources.

To do that we could use dox generates a JSON representation of the JS code.

node-mongodb-native use dox to generate their doc. See exports.extractLibraryMetaData : https://github.com/mongodb/node-mongodb-native/blob/master/dev/tools/docs.js#L81

Here my idea to generate JSON Type Definition of node-express :

  • generate a JSON representation with dox from express JS sources.
  • transform the dox JSON representation to the tern JSON Type Definition

Note that dox JSON representation information is not enough, because it doesn't provide the structure for callback function. We should inject those information while transformation.

@ghost
Copy link

ghost commented Oct 3, 2014

Tern-node-express is almost done by now. What I do not like with the handwriting is the time it takes and errors that inevitably arise. But would automation do much better? It also takes time to read it back comparing with the original documentation as errors inevitably arise too: I'll probably hate it even more...

@angelozerr
Copy link
Owner Author

What I do not like with the handwriting is the time it takes and errors that inevitably arise

Are you disapointed with tern?

I'll probably hate it even more...

It seems you don't like this idea -(

My idea is to generate the same thing that we have written at hand. So once generator will be done, we could generate tern express for any version. This generator will able to generate other fwk like https://github.com/angelozerr/tern-node-mongodb

But let's me shows you my idea. I have started (not commited) something to generate https://github.com/angelozerr/tern-node-mongodb

@ghost
Copy link

ghost commented Oct 3, 2014

Are you disapointed with tern?

But why? The plugin is working fine in Eclipse. The json typing is quite a boring task indeed but it's not the end of it.

It seems you don't like this idea -(

But I am open to test it for real: you generate the json data then I'll review it and we'll see how many corrections it takes.

@angelozerr
Copy link
Owner Author

But why? The plugin is working fine in Eclipse. The json typing is quite a boring task indeed but it's not the end of it.

You have tested it with Eclipse? If it's that, it's cool! I was a little afraid that you were disapointed with tern.

But I am open to test it for real: you generate the json data then I'll review it and we'll see how many corrections it takes.

Ok I contact you as soon as I will finish it.

@ghost
Copy link

ghost commented Oct 20, 2014

I am in the process of testing tern-node-express in a nodeclipse project finding too many auto-completion mistakes: how do you want to address these issues? One by one manually or by building a new json data handler from dox parsing?

@angelozerr
Copy link
Owner Author

One by one manually or by building a new json data handler from dox parsing?

node-express is not generated (it is written at hand).

I think you should create an issue per problem and fix it at hand. After if you think it's better to generate node-express from JS sources, tell me and I will do it.

@ghost
Copy link

ghost commented Oct 20, 2014

On a matter of principle I wonder what will happen with doxified json when express documentation will be updated. When it was done from keyboard strokes we'll have to patch it manually indeed. But when it was done with dox then patched manually for mistakes or unresolved cases then will we have to fully repatch it manually for every next dox output?

Pratically – it would be interesting to compare what we did manually with what dox is actually generating: in many case dox could have it right (or better) but the contrary is also possible.

In other words I don't know what's the best practice here but eager to find out.

In conclusion: if you could generate the json with dox to send it to me then I would compare both to address issues manually - is this making sense?

@angelozerr
Copy link
Owner Author

Ok, so I think we should generate node-express (like we have doen with node-mongoose an dnode-mongodb-native). As I explained you, the generation is done but you can override !type as you wish, so we could have the same tern plugin with or without generation for node-express.

Is there a lot of problems with node-express? I think it should be very good if you create an issue per problem to trace it (and perhaps create some test about that).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant