Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 424372

Summary: global installation vs local installation
Product: [ECD] Orion Reporter: Matteo Collina <matteo.collina>
Component: NodeAssignee: Kaitlin Huben <kaitlin.huben>
Status: RESOLVED FIXED QA Contact: Maciej Bendkowski <maciej.bendkowski>
Severity: normal    
Priority: P3 CC: apeller, ken_walker, maciej.bendkowski, mamacdon
Version: unspecified   
Target Milestone: 6.0 M1   
Hardware: PC   
OS: Mac OS X   
Whiteboard:

Description Matteo Collina CLA 2013-12-18 15:02:35 EST
I think Orion is not as straightforward to use as it might be in node.js.
The basic workflow should resemble something like

$ npm install orion -g
$ cd my_project
$ orion 

or

$ orion my_project

I can help adding such a support.
Comment 1 Maciej Bendkowski CLA 2013-12-19 14:29:35 EST
(In reply to Matteo Collina from comment #0)
> I think Orion is not as straightforward to use as it might be in node.js.

I'm not fully convinced that Orion should be turned into a npm module. I can't see any straightforward advantages beyond the one you've mentioned. On the other hand, I think having single server-side components as npm modules, would be great.
Comment 2 Ken Walker CLA 2013-12-19 14:48:04 EST
I'll admit to wanting to use OrionNode as Matteo stated. Especially on embedded devices and/or around my file system on my own machine.
Comment 3 Maciej Bendkowski CLA 2013-12-23 05:52:22 EST
Matteo, could you please explain what functionality would you expect from the provided workflow? I imagine, by default, it should open Orion in a one-project mode with limited workspace capabilities. On the other hand, if a workspace argument is passed, it imports your project (top-level folder to be exact) into that particular workspace and opens the project in that workspace. Surely, such capabilities would be nice to have. AFAIK, in order to turn Orion into a npm module we have to simply publish it - is there something more to it? Your help here would be more than welcome.
Comment 4 Maciej Bendkowski CLA 2013-12-23 05:54:17 EST
Assigning Matteo.
Comment 5 Ken Walker CLA 2013-12-23 07:52:17 EST
As a first start, I wouldn't mind Orion just starting on the current working directory.  If a file was specified, then open on that file.  The Navigator should adopt if the folder is an Orion Project already (project.json present).
Comment 6 Matteo Collina CLA 2014-01-07 05:18:14 EST
Orion is already published on NPM (https://npmjs.org/package/orion).

I do not know how publishing on NPM is configured from an IP perspective, it is something I am trying to figure out myself.

I will add commander or optimist as dependency for option parsing: which one do you prefer? They are almost equivalent and very easy to use.

The first pass I would love to do is make it work as it is for the current project, so we can just '$ cd myproj; orion' and it will start up the editor.

How do I open a file directly? Is there an API for that?
Comment 7 Maciej Bendkowski CLA 2014-01-09 06:20:49 EST
(In reply to Matteo Collina from comment #6)
> Orion is already published on NPM (https://npmjs.org/package/orion).

Thanks. I wasn't aware we already published Orion as an npm module.

> I do not know how publishing on NPM is configured from an IP perspective, it
> is something I am trying to figure out myself.

AFAIK you have to choose an open-source license for the module while publishing and that sums it up. Orion is dual-licensed under the Eclipse Public License v1.0 and the Eclipse Distribution License v1.0.
 
> I will add commander or optimist as dependency for option parsing: which one
> do you prefer? They are almost equivalent and very easy to use.

Both are fine. Probably, I'd choose commander simply because I like their API, however that's just a cosmetic choice really.

> The first pass I would love to do is make it work as it is for the current
> project, so we can just '$ cd myproj; orion' and it will start up the editor.
> How do I open a file directly? Is there an API for that?

The simplest way would be to open the editor page on that particular file location. This way the navbar jumps right in the correct context.
Comment 8 Maciej Bendkowski CLA 2014-03-24 06:02:33 EDT
Matteo, any progress?
Comment 9 Matteo Collina CLA 2014-03-26 05:19:55 EDT
I'm sorry I've been busy on other stuff and I totally forgot. I'll tackle it this weekend/early next week.
Comment 10 Mark Macdonald CLA 2014-04-14 10:06:14 EDT
This has been implemented, see commit:
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=c8231d0
Comment 11 Mark Macdonald CLA 2014-04-14 10:06:30 EDT
^