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

Metadata for tern defs+plugins "package.json" like #330

Closed
angelozerr opened this issue May 10, 2014 · 6 comments
Closed

Metadata for tern defs+plugins "package.json" like #330

angelozerr opened this issue May 10, 2014 · 6 comments

Comments

@angelozerr
Copy link
Contributor

It should be very cool, if tern could host metadata files for each tern defs/plugins to describe it like :

  • give a description, url.
  • give the author.
  • give the dependencies to other tern defs/plugins
  • give the waited options of the plugin.

This metadata file can be used by each IDE to display, description, author, etc in an UI preferences.

jquery.json.metadata could look like this:

{
  "name": "jquery",
  "url": "http://jquery.com/",
  "author": "Marijn Haverbeke <marijnh@gmail.com>",
  "description": "jQuery support",
  "dependencies": ["browser"]
}
@marijnh
Copy link
Member

marijnh commented May 28, 2014

There is a !data field you can add to any object in a JSON spec, which could be used for this. Separate files seems a bit painful -- just pack it into the file itself.

@angelozerr
Copy link
Contributor Author

I would like to know metadata information without running tern. If tern def is inside js plugin, it's very hard to read it.

In tern.java I manage tern plugins + defs selection with this UI :

ternfacets

When you select a plugin, you see a description. I would like to use a simple JSON to read this description metadata and not execute a tern server.

@marijnh
Copy link
Member

marijnh commented Jun 6, 2014

The files are JSON. You don't need to run Tern to read them.

@angelozerr
Copy link
Contributor Author

For JSON Type Definion like jQuery, I agree with you, but for Tern plugin like requirejs, it's hard to load it.

I have done those metadata files in my github that you can find at https://github.com/angelozerr/tern.java/tree/master/core/tern.core/metadata

I use those metadata file inside tern.java in Eclipse UI to select Tern Plugin or JSON Type Definition. Here a screenshot which shows you detail (metadata) of the requirejs tern plugin (I must display dependencies and options of tern plugin too) :

eclipseternmetadata

When you select requirejs tern plugin, it uses this JSON metadata file https://github.com/angelozerr/tern.java/blob/master/core/tern.core/metadata/requirejs.metadata.json

As requirejs is tern plugin, it's very hard to read the JSON Type Definition inside the Javascript code, that's why I have created a new JSON file per def/plugin.

@marijnh
Copy link
Member

marijnh commented Jun 6, 2014

That's true. Still, this seems too marginally useful to include. The amount of plugins in the core distribution are limited anyway, you can just put them in your own JSON file if you need this kind of info.

@marijnh marijnh closed this as completed Jun 6, 2014
@angelozerr
Copy link
Contributor Author

Ok I will keep my metadata JSON files. Thank's.

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

2 participants