Re: Proposal: hooks support for plugins

2014-07-21 Thread Jesse
;/> > > > > Thx! > > Sergey > > -Original Message- > > From: mmo...@google.com [mailto:mmo...@google.com] On Behalf Of Michal > > Mocny > > Sent: Monday, July 21, 2014 6:28 PM > > To: dev > > Subject: Re: Proposal: hooks support for

Re: Proposal: hooks support for plugins

2014-07-21 Thread Andrew Grieve
be executed > > target-dir="../../../../../hooks/pre_package"/> > > Thx! > Sergey > -Original Message- > From: mmo...@google.com [mailto:mmo...@google.com] On Behalf Of Michal > Mocny > Sent: Monday, July 21, 2014 6:28 PM > To: dev > Subject: Re: Proposa

RE: Proposal: hooks support for plugins

2014-07-21 Thread Sergey Grebnov (Akvelon)
Just a note, currently any plugin can add some custom file to hooks directory and it will be executed Thx! Sergey -Original Message- From: mmo...@google.com [mailto:mmo...@google.com] On Behalf Of Michal Mocny Sent: Monday, July 21, 2014 6:28 PM To: dev Subject: Re: Proposal: hooks

Re: Proposal: hooks support for plugins

2014-07-21 Thread Michal Mocny
Whatever the decision for default prompt/no-prompt, I suggest we add a flag to do the reverse for anyone concerned. Aka, --prompt-for-plugin-hooks or --no-prompt-for-plugin-hooks On Fri, Jul 18, 2014 at 5:55 PM, Shazron wrote: > Echoing what Jesse said - having a prompt will defeat tools, > es

Re: Proposal: hooks support for plugins

2014-07-18 Thread Shazron
Echoing what Jesse said - having a prompt will defeat tools, especially since early on we kinda had consensus not to add in a security layer. The middle way is to add a CLI option to "auto-accept" all prompts with Y, kinda like a lot of command line tools. I think there is this pattern in Windows c

Re: Proposal: hooks support for plugins

2014-07-18 Thread Jesse
Prompting would make it nearly impossible for third party tools to use, there is no one to accept. PGBuild will allow scripts, but they will only be for pre-verified plugins, just like they deal with compiling arbitrary native code ... the script-exec is NOT a new backdoor in this case, just anothe

Re: Proposal: hooks support for plugins

2014-07-18 Thread Michal Mocny
What about prompting during plugin install instead of prepare? "This plugin has hooks, would you like continue? Y/N" I'm concerned about being prompted on each prepare, especially in the face of --watch type scripts. I'm also not sure that plugin authors should worry about supporting the "no" us

Re: Proposal: hooks support for plugins

2014-07-18 Thread Andrew Grieve
Finally got to having a look. Lots of neat stuff in there! Some specific feedback: - Not a fan of "

RE: Proposal: hooks support for plugins

2014-07-11 Thread Sergey Grebnov (Akvelon)
] https://github.com/MSOpenTech/cordova-lib/blob/CB-6481-hooks/cordova-lib/templates/hooks-README.md#script-interface Thx! Sergey -Original Message- From: Shazron [mailto:shaz...@gmail.com] Sent: Wednesday, July 9, 2014 9:26 PM To: dev@cordova.apache.org Subject: Re: Proposal: hooks support

Re: Proposal: hooks support for plugins

2014-07-09 Thread Shazron
Ah ok. However I think since it is effectively deprecated we should not advertise the old way as a supported way to do things but add another section saying that support for "./cordova/hooks" may be removed in the future, and perhaps give a timeline for removal. On Wed, Jul 9, 2014 at 10:15 AM, Jo

Re: Proposal: hooks support for plugins

2014-07-09 Thread Josh Soref
Shazron wrote:‎ > from the Cordova Hooks doc: > "This directory used to exist at .cordova/hooks, but has now been > moved to the project root." > -> doesn't this imply that .cordova/hooks > does not work anymore, you should use hooks/ ?‎ I believe it's supported for backwards compatibility (just a

Re: Proposal: hooks support for plugins

2014-07-09 Thread Shazron
_plugin_install, after_plugin_install and > before_plugin_uninstall hooks. > > Thx! > Sergey > -Original Message- > From: Sergey Grebnov (Akvelon) [mailto:v-seg...@microsoft.com] > Sent: Friday, May 16, 2014 4:08 AM > To: dev@cordova.apache.org > Subject: RE:

RE: Proposal: hooks support for plugins

2014-07-09 Thread Sergey Grebnov (Akvelon)
Thx! Sergey -Original Message- From: Sergey Grebnov (Akvelon) [mailto:v-seg...@microsoft.com] Sent: Friday, May 16, 2014 4:08 AM To: dev@cordova.apache.org Subject: RE: Proposal: hooks support for plugins Addressed code review notes, added spec tests, moved to cordova-lib repo. https://githu

RE: Proposal: hooks support for plugins

2014-05-16 Thread Sergey Grebnov (Akvelon)
: RE: Proposal: hooks support for plugins Updated code as per latest notes. Do we ready to merge this? https://github.com/apache/cordova-plugman/pull/74 Thx! Sergey -Original Message- From: mmo...@google.com [mailto:mmo...@google.com] On Behalf Of Michal Mocny Sent: Tuesday, April 22

RE: Proposal: hooks support for plugins

2014-04-30 Thread Sergey Grebnov (Akvelon)
: > > >>>> foo.js") > > >>>> - Maybe this is doable, by storing a global > > >>>> exception-was-thrown callback? > > >>>> - Gives hooks the ability to mess up cordova's environment > > >>>> (a

Re: Proposal: hooks support for plugins

2014-04-22 Thread Michal Mocny
;>> exception, we would like to be able to say "This hook script failed: > > >>>> foo.js") > > >>>> - Maybe this is doable, by storing a global exception-was-thrown > > >>>> callback? > > >>>> - Gives hoo

Re: Proposal: hooks support for plugins

2014-04-22 Thread Brian LeRoux
>> the vm thing addresses this?) > >>>> > >>>> Would like to see tests for these things added before we launch this > >>>> feature. > >>>> > >>>> > >>>> > >>>> On Tue, Apr 22, 2014 at 1

Re: Proposal: hooks support for plugins

2014-04-22 Thread purplecabbage
> the vm thing addresses this?) >>>> >>>> Would like to see tests for these things added before we launch this >>>> feature. >>>> >>>> >>>> >>>> On Tue, Apr 22, 2014 at 10:40 AM, Sergey Grebnov (Akvelon) <

Re: Proposal: hooks support for plugins

2014-04-22 Thread Brian LeRoux
thing addresses this?) > > > > > > Would like to see tests for these things added before we launch this > > > feature. > > > > > > > > > > > > On Tue, Apr 22, 2014 at 10:40 AM, Sergey Grebnov (Akvelon) < > > > v-seg...@microsoft

Re: Proposal: hooks support for plugins

2014-04-22 Thread Brian LeRoux
> > > +1, I will name it as 'context' > > > > > > Thx! > > > Sergey > > > -Original Message- > > > From: Jonathan Bond-Caron [mailto:jbo...@gdesolutions.com] > > > Sent: Tuesday, April 22, 2014 7:34 AM > &g

Re: Proposal: hooks support for plugins

2014-04-22 Thread Andrew Grieve
ese things added before we launch this > > feature. > > > > > > > > On Tue, Apr 22, 2014 at 10:40 AM, Sergey Grebnov (Akvelon) < > > v-seg...@microsoft.com> wrote: > > > > > +1, I will name it as 'context' > > > > > > Thx!

Re: Proposal: hooks support for plugins

2014-04-22 Thread Michal Mocny
t' > > > > Thx! > > Sergey > > -Original Message- > > From: Jonathan Bond-Caron [mailto:jbo...@gdesolutions.com] > > Sent: Tuesday, April 22, 2014 7:34 AM > > To: dev@cordova.apache.org > > Subject: RE: Proposal: hooks supp

Re: Proposal: hooks support for plugins

2014-04-22 Thread Andrew Grieve
April 22, 2014 7:34 AM > To: dev@cordova.apache.org > Subject: RE: Proposal: hooks support for plugins > > On Mon Apr 21 03:39 PM, Sergey Grebnov (Akvelon) wrote: > > module.exports = function(platform, projectDir, pluginDir, cmdLine) { > > console.log('hook.js:

RE: Proposal: hooks support for plugins

2014-04-22 Thread Sergey Grebnov (Akvelon)
+1, I will name it as 'context' Thx! Sergey -Original Message- From: Jonathan Bond-Caron [mailto:jbo...@gdesolutions.com] Sent: Tuesday, April 22, 2014 7:34 AM To: dev@cordova.apache.org Subject: RE: Proposal: hooks support for plugins On Mon Apr 21 03:39 PM, Sergey Grebno

RE: Proposal: hooks support for plugins

2014-04-22 Thread Jonathan Bond-Caron
On Mon Apr 21 03:39 PM, Sergey Grebnov (Akvelon) wrote: > module.exports = function(platform, projectDir, pluginDir, cmdLine) { > console.log('hook.js: ' + platform); > console.log('hook.js: ' + projectDir); > console.log('hook.js: ' + pluginDir); > console.log('hook.js: ' + cmdLine

RE: Proposal: hooks support for plugins

2014-04-22 Thread Jonathan Bond-Caron
On Fri Apr 18 11:35 AM, Sergey Grebnov (Akvelon) wrote: > Sound like most of us prefer module.export. Cool, will update the code today > and let you know once this is done. > > Since we will be moving to cordova-lib the next action item here could be > creating uniform hooks with shared code for

Re: Proposal: hooks support for plugins

2014-04-21 Thread Jesse
new Q.defer(); > > setTimeout(function(){ > deferral.resolve(); > }, 1000); > > return deferral.promise; > } > > Thx!! > Sergey > > -Original Message- > From: Parashuram Narasimhan (MS OPEN TECH) [mailto:panar...@microsoft.com] > Sent:

RE: Proposal: hooks support for plugins

2014-04-21 Thread Sergey Grebnov (Akvelon)
deferral.resolve(); }, 1000); return deferral.promise; } Thx!! Sergey -Original Message- From: Parashuram Narasimhan (MS OPEN TECH) [mailto:panar...@microsoft.com] Sent: Friday, April 18, 2014 12:30 PM To: dev@cordova.apache.org Subject: RE: Proposal: hooks support for plugins As you rig

RE: Proposal: hooks support for plugins

2014-04-18 Thread Parashuram Narasimhan (MS OPEN TECH)
t; as well? CordovaCLI can be yet another consumer of this sandbox. -Original Message- From: Shazron [mailto:shaz...@gmail.com] Sent: Friday, April 18, 2014 11:16 AM To: dev@cordova.apache.org Subject: Re: Proposal: hooks support for plugins Sorry for the flurry of emails, found a proof of c

Re: Proposal: hooks support for plugins

2014-04-18 Thread Shazron
>> > > > cordova project. An alternative would be to construct the javascript >> > > > files to >> > > have >> > > > module.exports, and we could pass in the parameters to the function >> > > > that >> > >

Re: Proposal: hooks support for plugins

2014-04-18 Thread Shazron
re could >> be >> > creating uniform hooks with shared code for both application level and >> > plugin level hooks. Thoughts? >> > >> > Thx! >> > Sergey >> > -----Original Message- >> > From: brian.ler...@gmail.com [mailto:brian.le

Re: Proposal: hooks support for plugins

2014-04-18 Thread Shazron
e parameters to the function > > > > that > > > is > > > > exported. This way, the module will not spawn a new node process. > > > > Comments, Thoughts? > > > > > > > > -Original Message- > > > > From: Sergey Gr

Re: Proposal: hooks support for plugins

2014-04-18 Thread Brian LeRoux
to:brian.ler...@gmail.com] On Behalf Of > Brian LeRoux > Sent: Friday, April 18, 2014 8:25 AM > To: dev@cordova.apache.org > Subject: Re: Proposal: hooks support for plugins > > like this too / would be much cleaner > > > > On Thu, Apr 17, 2014 at 5:38 PM, Shazron wrote: >

RE: Proposal: hooks support for plugins

2014-04-18 Thread Sergey Grebnov (Akvelon)
! Sergey -Original Message- From: brian.ler...@gmail.com [mailto:brian.ler...@gmail.com] On Behalf Of Brian LeRoux Sent: Friday, April 18, 2014 8:25 AM To: dev@cordova.apache.org Subject: Re: Proposal: hooks support for plugins like this too / would be much cleaner On Thu, Apr 17, 2014

Re: Proposal: hooks support for plugins

2014-04-18 Thread Brian LeRoux
ported. This way, the module will not spawn a new node process. > > Comments, Thoughts? > > > > -Original Message- > > From: Sergey Grebnov (Akvelon) [mailto:v-seg...@microsoft.com] > > Sent: Thursday, April 17, 2014 5:19 PM > > To: dev@cordova.apache.org

Re: Proposal: hooks support for plugins

2014-04-17 Thread Shazron
lon) [mailto:v-seg...@microsoft.com] > Sent: Thursday, April 17, 2014 5:19 PM > To: dev@cordova.apache.org > Subject: RE: Proposal: hooks support for plugins > > I've sent a pull request with initial implementation for review. > https://github.com/apache/cordova-plugman/pul

RE: Proposal: hooks support for plugins

2014-04-17 Thread Parashuram Narasimhan (MS OPEN TECH)
. Comments, Thoughts? -Original Message- From: Sergey Grebnov (Akvelon) [mailto:v-seg...@microsoft.com] Sent: Thursday, April 17, 2014 5:19 PM To: dev@cordova.apache.org Subject: RE: Proposal: hooks support for plugins I've sent a pull request with initial implementation for review.

RE: Proposal: hooks support for plugins

2014-04-17 Thread Sergey Grebnov (Akvelon)
t: RE: Proposal: hooks support for plugins On Thu Mar 6 01:57 PM, Sergey Grebnov (Akvelon) wrote: > Can we think about scripts as just a new plugin module? - Similar to > js-module or config-file and which must be processed special way (by > execution). > > src="src/windows8/

RE: Proposal: hooks support for plugins

2014-03-06 Thread Jonathan Bond-Caron
On Thu Mar 6 01:57 PM, Sergey Grebnov (Akvelon) wrote: > Can we think about scripts as just a new plugin module? - Similar to > js-module or > config-file and which must be processed special way (by > execution). > > src="src/windows8/SQLitePCL.Ext.dll" custom="true"/> src="src/add_win8_toastC

RE: Proposal: hooks support for plugins

2014-03-06 Thread Sergey Grebnov (Akvelon)
; flag (or each script file can emit install and uninstall functions) Thx! Sergey -Original Message- From: Jonathan Bond-Caron [mailto:jbo...@gdesolutions.com] Sent: Thursday, March 6, 2014 9:31 PM To: dev@cordova.apache.org Subject: RE: Proposal: hooks support for plugins On Thu Mar

RE: Proposal: hooks support for plugins

2014-03-06 Thread Jonathan Bond-Caron
On Thu Mar 6 11:41 AM, Michal Mocny wrote: > On Thu, Mar 6, 2014 at 11:16 AM, Jonathan Bond-Caron < > jbo...@gdesolutions.com> wrote: > > > On Wed Mar 5 04:13 PM, Michal Mocny wrote: > > > For cli workflow: hooks (including plugin hooks) can access > > > config.xml 's for things like the sqllite c

Re: Proposal: hooks support for plugins

2014-03-06 Thread Michal Mocny
On Thu, Mar 6, 2014 at 11:16 AM, Jonathan Bond-Caron < jbo...@gdesolutions.com> wrote: > On Wed Mar 5 04:13 PM, Michal Mocny wrote: > > For cli workflow: hooks (including plugin hooks) can access config.xml > > 's for things like the sqllite compile example (recompile > only if > > settings change

RE: Proposal: hooks support for plugins

2014-03-06 Thread Jonathan Bond-Caron
On Wed Mar 5 04:13 PM, Michal Mocny wrote: > For cli workflow: hooks (including plugin hooks) can access config.xml > 's for things like the sqllite compile example (recompile only if > settings changed would be nice), and access at runtime for the > console example. > > For old workflow, perhaps

Re: Proposal: hooks support for plugins

2014-03-05 Thread Michal Mocny
For cli workflow: hooks (including plugin hooks) can access config.xml 's for things like the sqllite compile example (recompile only if settings changed would be nice), and access at runtime for the console example. For old workflow, perhaps sqllite is documented to manually run the hook to reco

Re: Proposal: hooks support for plugins

2014-03-05 Thread Jesse
Okay, you convinced me. args make sense for hooks for preinstall/install hooks, everything else, the plugin scripts should be able to manage on their own by writing some config/settings data to it's own plugin folder. I think the bigger discussion for now needs to be around the permissions, secur

RE: Proposal: hooks support for plugins

2014-03-05 Thread Jonathan Bond-Caron
On Wed Mar 5 02:54 PM, Jesse wrote: > I am a no to passing arguments, the use-case is really about doing some > extra > tasks for the current environment. > Not necessarily: https://github.com/apache/cordova-plugin-console/blob/master/www/logger.js#L48 cordova plugin add cordova-plugin-console -

Re: Proposal: hooks support for plugins

2014-03-05 Thread Jesse
We also have to keep the whole dependency tree in mind as well. ie. com.plugins.benign depends on com.plugins.nefarious Not sure how a warning banner would address this. @purplecabbage risingj.com On Wed, Mar 5, 2014 at 12:30 PM, Michal Mocny wrote: > On Wed, Mar 5, 2014 at 3:30 PM, Michal Mo

Re: Proposal: hooks support for plugins

2014-03-05 Thread Michal Mocny
On Wed, Mar 5, 2014 at 3:30 PM, Michal Mocny wrote: > > > > On Wed, Mar 5, 2014 at 3:02 PM, Brian LeRoux wrote: > >> Agree w/ your points Jesse. I'm going to reach out to Maven folks to find >> out what they've done wrt to publishing policy. >> >> >> On Wed, Mar 5, 2014 at 11:54 AM, Jesse wrote

Re: Proposal: hooks support for plugins

2014-03-05 Thread Michal Mocny
On Wed, Mar 5, 2014 at 3:02 PM, Brian LeRoux wrote: > Agree w/ your points Jesse. I'm going to reach out to Maven folks to find > out what they've done wrt to publishing policy. > > > On Wed, Mar 5, 2014 at 11:54 AM, Jesse wrote: > > > I am a no to passing arguments, the use-case is really about

Re: Proposal: hooks support for plugins

2014-03-05 Thread Brian LeRoux
Agree w/ your points Jesse. I'm going to reach out to Maven folks to find out what they've done wrt to publishing policy. On Wed, Mar 5, 2014 at 11:54 AM, Jesse wrote: > I am a no to passing arguments, the use-case is really about doing some > extra tasks for the current environment. > > I am a

Re: Proposal: hooks support for plugins

2014-03-05 Thread Jesse
I am a no to passing arguments, the use-case is really about doing some extra tasks for the current environment. I am also a 'no' to prompting the user for permission, this shortly becomes a permission list of which plugins can and can't run scripts, or do we ask this every time? We definitely ne

Re: Proposal: hooks support for plugins

2014-03-05 Thread Andrew Grieve
Not sure passing through command-line arguments is feasible for dependent plugins. Maybe have the scripts get their args from environment variables? On Wed, Mar 5, 2014 at 12:59 PM, Jonathan Bond-Caron < jbo...@gdesolutions.com> wrote: > On Wed Mar 5 12:00 PM, Marcel Kinard wrote: > > In that ca

RE: Proposal: hooks support for plugins

2014-03-05 Thread Jonathan Bond-Caron
On Wed Mar 5 12:00 PM, Marcel Kinard wrote: > In that case (i.e., "npm test") the user is explicitly invoking the > script. If we are > talking about hooks that run automatically on > "cordova plugin add", then it is > implicit. How about if the cli > prompted the user when a hook request is presen

Re: Proposal: hooks support for plugins

2014-03-05 Thread Marcel Kinard
In that case (i.e., "npm test") the user is explicitly invoking the script. If we are talking about hooks that run automatically on "cordova plugin add", then it is implicit. How about if the cli prompted the user when a hook request is present such as "plugin foobar wants to run the script xyz.

RE: Proposal: hooks support for plugins

2014-03-05 Thread Jonathan Bond-Caron
On Sat Mar 1 01:39 PM, Sergey Grebnov (Akvelon) wrote: > > > > preinstall.js is called before plugman.raw.install(platform, platformRoot, > path.basename(dir), pluginsDir, options) and could be used to check system > requirements, download/compile required libraries, etc > > afterinstall.js is

RE: Proposal: hooks support for plugins

2014-03-03 Thread Parashuram Narasimhan (MS OPEN TECH)
Note that this is very similar to npm. My guess is that security story would be the same. -Original Message- From: agri...@google.com [mailto:agri...@google.com] On Behalf Of Andrew Grieve Sent: Monday, March 3, 2014 10:45 AM To: dev Subject: Re: Proposal: hooks support for plugins

Re: Proposal: hooks support for plugins

2014-03-03 Thread Brian LeRoux
this capability is supported in npm (for which we base much of our plugin thinking and src) so technically I don't see much issue and the use cases are def there On Mon, Mar 3, 2014 at 10:44 AM, Andrew Grieve wrote: > There's definitely a security angle to this. E.g. You install a plugin and

Re: Proposal: hooks support for plugins

2014-03-03 Thread Andrew Grieve
There's definitely a security angle to this. E.g. You install a plugin and now it's running code on your machine in a non-sandboxed way. Maybe could warn before running the script for the first time, or show a badge on its plugins.cordova.io page to highlight this. install hooks might make it hard

Re: Proposal: hooks support for plugins

2014-03-01 Thread Jesse
I originally replied to the personal cc: version of this message I got. Here is what I said : It's a very interesting idea and would be powerful. My only concern is that Cordova apps can be built just by calling platform create scripts, with plugins added by calling plugman directly. The hooks a