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

tern repository #424

Open
angelozerr opened this issue Nov 25, 2014 · 14 comments
Open

tern repository #424

angelozerr opened this issue Nov 25, 2014 · 14 comments

Comments

@angelozerr
Copy link
Contributor

Today it exists more and more "non official" tern plugin like Closure, Meteor, YUI, Express, etc

I try to integrate it inside tern.java. You can see list of tern plugins at https://github.com/angelozerr/tern.java/wiki/Getting-Started#tern-modules

But I think it should be very cool if tern could host a kind of site which enumerates list of tern plugin. An idea that I have is that ternjs provides this url http://ternjs.net/repository.xml and returns an XML stream like this :

<repository>
  <plugin name="tern-closure" 
              url="https://github.com/google/tern-closure.git"
              description= "A Tern plugin adding support for Closure." />
  <plugin name="tern-meteor" 
              url="https://github.com/Slava/tern-meteor.git"
              description= "Autocompletion plugin for Meteor 1.0." />
</repository>

This XML file repository could be used after by some IDE to install tern plugin (show list of existing tern plugin in an UI list).

@marijnh
Copy link
Member

marijnh commented Nov 25, 2014

If you want to author such a file, and submit a pull request that includes it in the root of the repository, it'll automatically end up on ternjs.net. But for consistency, please use JSON instead of XML.

@angelozerr
Copy link
Contributor Author

Many thank's @marijnh for your answer! I will do create a PR with this repository.json file.

please use JSON instead of XML.

Ok, I will do it.

@bfricka
Copy link
Contributor

bfricka commented Nov 25, 2014

A co-worker and I are also looking into this, w/ support for TS defs as well. We've both finally got some time and are going to be going over a game plan in the next couple of weeks.

@angelozerr
Copy link
Contributor Author

@bfricka I had intention to create a PR with repository.json after exploring it inside Eclipse IDE, but if you need it, I can create it and do a PR. I will create a second PR to add some info if will need when I will explore it inside Eclispe IDE. Tell me if you need now this repository.json

@angelozerr
Copy link
Contributor Author

Ok here a proposition about repository.json with closure and express tern plugin :

{
 "tern-closure": {
  "label": "Closure",
  "homepage": "https://developers.google.com/closure/library/",
  "repository": {
   "type": "git",
   "url": "https://github.com/google/tern-closure"
  }
 },
 "node-express": {
  "label": "Express",
  "homepage": "http://expressjs.com/",
  "description": "Add express web application framework for node support. Express is a minimal and flexible Node.js web application framework that provides a robust set of features for web and mobile applications.",
  "repository": {
   "type": "git",
   "url": "https://github.com/angelozerr/tern-node-express.git"
  },
  "category": "node"
 }
}

JSOn keys are tern plugin name which have information about tern plugin (repository, homepage, description, label). category is used to display for instance express in a tree item after the node tree ietm.

@paulvi
Copy link
Contributor

paulvi commented Dec 1, 2014

Official list of plugins #431 seems to be user facing part of this issue "tern repository.json"

@paulvi
Copy link
Contributor

paulvi commented Dec 1, 2014

@bfricka

w/ support for TS defs as well

Can you point to or create new issue for TS defs support

@angelozerr
Copy link
Contributor Author

Official list of plugins #431 seems to be user facing part of this issue "tern repository.json"

Goal of ern repository.json is to list non official tern plugins. Official tern plugins are hosted inside tern https://github.com/marijnh/tern/tree/master/defs and https://github.com/marijnh/tern/tree/master/plugin

@paulvi
Copy link
Contributor

paulvi commented Dec 1, 2014

@angelozerr said in #431

List is computed on runtime. It loops for folder from a tern folder (defs, plugin + node_modules/tern-*) ro retrieve list of tern plugins + defs (I have called that tern modules inside tern.java).

It's the first step, after that, each module displays information, like url, options of the tern plugin, etc. It uses metadata file at https://github.com/angelozerr/tern.java/tree/master/core/tern.core/metadata (I think it should be cool if each tern plugin could host this metadata file, but it's another topic)

If those files (in metadata folder) are to be hosted inside this git repository, aren't they already tern repository ? And it is easier to see history when there are multiple files, compared to one big file

(I think it should be cool if each tern plugin could host this metadata file, but it's another topic)

What if each tern plugin could can optionally hold such file to overwrite the one inside tern git repository ?

@angelozerr
Copy link
Contributor Author

If those files (in metadata folder) are to be hosted inside this git repository

I mean that each tern plugin hosts their metadata JSON file, not inside this tern git repository.

We need a list of "unnoffical" tern plugin repository.json should exists for that.

@paulvi
Copy link
Contributor

paulvi commented Dec 4, 2014

(I think it should be cool if each tern plugin could host this metadata file, but it's another topic)

If those files (in metadata folder) are to be hosted inside this git repository, aren't they already tern repository ?

I mean that each tern plugin hosts their metadata JSON file, not inside this tern git repository.

OK. Then minimal tern metadata/repository.json is to list URL to such .metadata.json files like

{
 "tern-closure": {
   "metadataurl": "https://raw.githubusercontent.com/google/tern-closure/master/tern-closure.metadata.json"
 },
 "node-express": {
   "metadataurl": "https://raw.githubusercontent.com/angelozerr/tern-node-express/master/tern-node-express.metadata.json"
 },
}

otherwise metadata/repository.json would contain copy of data that may be out of date.

Having filename as tern-*.metadata.json or fixed tern.metadata.json will make life easier.

Then any software that will use such metadata/repository.json should check/get latest version of tern-*.metadata.json files. Or a) metadata/ folder already has them and is like cache.

Or b) metadata/ folder can have them to redefine, i.e. overwrite definition, e.g. for case when plugin is already included into software package together with tern.

paulvi pushed a commit to paulvi/tern.java that referenced this issue Dec 4, 2014
@paulvi
Copy link
Contributor

paulvi commented Dec 4, 2014

See angelozerr/tern.java#190 for creating tern repository from *.metadata.json

proposed format was changed to make it resemble *.metadata.json files content.

[
  {
    "name": "angular",
    "metadataurl": "https://raw.githubusercontent.com/angelozerr/tern.java/master/core/tern.core/metadata/angular.metadata.json"
  },
  {
    "name": "aui",
    "metadataurl": "https://raw.githubusercontent.com/angelozerr/tern.java/master/core/tern.core/metadata/aui.metadata.json"
  },

@paulvi
Copy link
Contributor

paulvi commented Dec 4, 2014

There are 3 ways:

    1. tern metadata-repository.json is to be manually maintained
    1. tern metadata-repository.json is generated from *.metadata.json files
    1. tern metadata-repository.json containing "metadataurl" can be regenerated

Proposed story for Tern plugin author for way 3:

  1. create name.metadata.json file inside plugin repository
  2. modify https://github.com/marijnh/tern/blob/master/metadata/repository.json to add an entry with at least "name" and "metadataurl"
  3. optionally copy name.metadata.json to metadata folder inside https://github.com/marijnh/tern git repository (e.g. as Pull Request)

@paulvi
Copy link
Contributor

paulvi commented Dec 9, 2014

As suggested in angelozerr/tern.java#195

please rename this issue to plugins.json

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

4 participants