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

Creating tern plugins.json was: Creating repository.json #190

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

paulvi
Copy link
Contributor

@paulvi paulvi commented Dec 4, 2014

tern metadata/repository.json from *.metadata.json files

Example of output file

[
  {
    "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"
  },

@angelozerr
Copy link
Owner

Today metada is just used by Tern IDE. I host it inside tern.java but my idea is that each tern plugin host their metadata.

We don't need to know a list of metadata file. This metadata.json file could be hosted in the root of the tern project (like package.json). (see https://github.com/angelozerr/tern-node-express the metdata.json file could be hosted next to package.json)

@paulvi
Copy link
Contributor Author

paulvi commented Dec 4, 2014

My initial idea is that metadata folder together with metadata-repository.json will migrate to tern itself.

We are still discussing how to make it better.
I cannot tell the best way, as I don't know how those files are to be consumed.

@paulvi
Copy link
Contributor Author

paulvi commented Dec 4, 2014

see https://github.com/angelozerr/tern-node-express the metdata.json file could be hosted next to package.json

There is no metadata.json file there

@angelozerr
Copy link
Owner

At first you must know that list of tern modules is computed on runtime (there is no list for that) by using a folder tern root. By default it uses https://github.com/angelozerr/tern.java/tree/master/core/tern.core/node_modules/tern, but you can use your own tern repository if you wish.

To retrieve tern modules :

  • tern.java searches inside tern/plugin and tern/defs folder
  • tern.java searches inside node-modules/tern-* folder.

At this step, we need not some repository.json or metadata.json

After when you select a tern module, it displays informations about url, bugs, options, etc. Those informations comes from metadata.json. Today I search metadata.json inside tern.java, but for custom tern plugin, metadata json is not available. So it should be better that tern-* plugin host this metadata.json in their project. tern.java could load from the tern-* folder.

There is no metadata.json file there

I said "could be hosted ". My goal is that tern provides those metadata.json, after that I will do the same thing than my other tern plugin projects.

Goal of repository.json is to give the capability to install (download) "non official" tern project (like an update site), but NOT to create the list that you see in Tern -> Modules

@paulvi
Copy link
Contributor Author

paulvi commented Dec 4, 2014

To retrieve tern modules :

  • tern.java searches inside tern/plugin and tern/defs folder
  • tern.java searches inside node-modules/tern-* folder.

well, I would see it as one file defining what plugins to use.
And it seems to me that tern repository ternjs/tern#424
is have that info.

and the content of the file is what being discussed.

let's put metadata aside for a while.

@marijnh seems to accept any reasonable solution,
as tern.java would be the major user of this new solution

That why it can be maid and used here first

@angelozerr
Copy link
Owner

let's put metadata aside for a while.

yes! metadata will come after.

Here my proposition for repository.json :

{
 "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"
 }
}

Are you OK with that?

My idea is to provide a wizard which loads ternjs.net/repository.json and display list of "non offical plugins".

You can check tern plugin that you wish, and after we can execute npm install for each tern plugins to download it in a tern repository.

@paulvi
Copy link
Contributor Author

paulvi commented Dec 4, 2014

  1. You are using objects inside root.
    wouldn't having them as array entry more explicit?
    (Even though that in JavaScript there is vague difference between array and object)

  2. Why not {"name":"tern-closure", ... }?

That will make entries more similar to package.json (and metadata.json)

@paulvi
Copy link
Contributor Author

paulvi commented Dec 4, 2014

OK, "tern-closure": { is better to do search....

@angelozerr
Copy link
Owner

OK, "tern-closure": { is better to do search....

Yes that's it.

I think we could start to develop a simple wizard which displays content of this repository.json (we could host for the moment in tern.java for our test).

We select a tern plugin (like closure) and download it with npm for instance.

Do you think you could help me for that?

@angelozerr angelozerr changed the title ref https://github.com/marijnh/tern/issues/424 Creating tern repo. Download tern plugins from ternjs repository.json Dec 4, 2014
@paulvi
Copy link
Contributor Author

paulvi commented Dec 5, 2014

We select a tern plugin (like closure) and download it with npm for instance.
Do you think you could help me for that?

No promises. And that is other issue #195. I thought this one was about making that repository.json

My initial idea was just to collect all known plugins ternjs/tern#431

and as tern.java currently holds most part of plugins, we could use it to generate repository.json

Once format is OKed by @marijnh , we could go further.

@paulvi paulvi changed the title Download tern plugins from ternjs repository.json Creating repository.json Dec 5, 2014
@angelozerr
Copy link
Owner

and as tern.java currently holds most part of plugins, we could use it to generate repository.json

@paulvi I think repository.json can be written at hand.

@marijnh
Copy link

marijnh commented Dec 5, 2014

Yes, definitely write it by hand. A solution that uses a list of links and has to fetch data from them seems like a huge overkill for the problem at hand. (For distribution of packages, maybe look into building on top of npm, to prevent reinventing the wheel as much as possible.)

@angelozerr
Copy link
Owner

Yes, definitely write it by hand

Thank's @marijnh for your comment.

I have started to develop something to display list of tern modules inside Eclipse wizard. See #195 (comment)

Any comments are welcome. Thank's!

For distribution of packages, maybe look into building on top of npm, to prevent reinventing the wheel as much as possible.)

The big problem is that most of tern plugisn are not published (like tern-meteor). I have tried to explain it Slava/tern-meteor#17 but no success -(

So I think we should give 2 possibilities :

  • download with npm (tern-closure must use that to download doctrine too)
  • classic download from Github

@paulvi
Copy link
Contributor Author

paulvi commented Dec 9, 2014

there is generated plugins.json as ternjs/tern#438

{
  "angular": {
    "label": "AngularJS",
    "homepage": "https://angularjs.org/",
    "description": "Adds AngularJS support.",
    "repository": {
      "type": "git",
      "url": "https://github.com/angelozerr/tern.java.git"
    }
  },
  "aui": {
    "label": "AlloyUI",
    "homepage": "http://alloyui.com/",
    "description": "Adds AlloyUI support. AlloyUI is a framework built on top of YUI3 (JavaScript) that uses Bootstrap (HTML/CSS) to provide a simple API for building high scalable applications.",
    "repository": {
      "type": "git",
      "url": "https://github.com/angelozerr/tern.yuidoc.git"
    }
  },

tern-plugins

comparing to @angelozerr example above it lacks "category" field.

It is generated via updated script
https://github.com/paulvi/tern-plugins/blob/master/make-tern-plugins-json.js

A solution that uses a list of links and has to fetch data from them seems like a huge overkill for the problem at hand.

Well, it was too early.
Because at some point @angelozerr mentioned that metadata.json file should be in respective plugin repository. And that will create problem when data inside this plugins.json is outdated comparing to metadata.json

I proposed in #191 to have "metadataurl" property in every entry,
this way there is easy way to compare and update some fields of plugins.json automatically via script.
https://github.com/paulvi/tern-plugins/blob/master/update-tern-plugins-json.js

@paulvi paulvi changed the title Creating repository.json Creating tern plugins.json was: Creating repository.json Dec 9, 2014
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

Successfully merging this pull request may close these issues.

3 participants