Return-Path: X-Original-To: apmail-cordova-dev-archive@www.apache.org Delivered-To: apmail-cordova-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id CE49F10A0B for ; Fri, 9 Jan 2015 18:59:13 +0000 (UTC) Received: (qmail 12716 invoked by uid 500); 9 Jan 2015 18:59:14 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 12675 invoked by uid 500); 9 Jan 2015 18:59:14 -0000 Mailing-List: contact dev-help@cordova.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cordova.apache.org Delivered-To: mailing list dev@cordova.apache.org Received: (qmail 12655 invoked by uid 99); 9 Jan 2015 18:59:14 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jan 2015 18:59:14 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of kamrik@google.com designates 209.85.216.175 as permitted sender) Received: from [209.85.216.175] (HELO mail-qc0-f175.google.com) (209.85.216.175) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 09 Jan 2015 18:58:49 +0000 Received: by mail-qc0-f175.google.com with SMTP id p6so10546779qcv.6 for ; Fri, 09 Jan 2015 10:58:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=RhFzUFEQlnouYLI6QfE8mNDapC+Bu0H+RSc2HNocqwg=; b=A9bMymT/otShBFaA57l92jq/Nv/xmZvPybhF6ccZAfO2Ot0o3kd3a29rXLns8LhH7I FoSpOpMEsOIco5bE8Ye6omnx4e6ON/bvY9I1f3Wq9MgyL7gZCJdc58J8d3GFhzHPgM/K OcXBhYkiihtmwpBeCwokyG43OTMz8u7LRPM/Id0ZqP8Apr0+c8PQ87KqjhigfopvzJ0I FWHkFsoWhIMBP0uFAWPCuXZIX1AxBzOnJWSJsP8VONzI/LIWEy0SY88PNFZWGJR7wNtK xggGVmDoBWMysjB7LCS7IZ2Xf50d5Pof2GjA9KStmak+9BfCVrJNYu38hqSDrKV7G6Di 9BJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:content-type; bh=RhFzUFEQlnouYLI6QfE8mNDapC+Bu0H+RSc2HNocqwg=; b=Uw/09wIZVfoaS8OVlwg890D/ZIcBekzQvEyLQ5yQMLOJSnxFsaSnVo/dUIL96THR1u LyJfKp48rDFIugHKfrIzr/4ToUhbcLNq6RXBlF5koB9viHRtpEqp8OoG7y+7RnlNK5Z8 tgi/RZIf531Cv1qkIrQkCaWUoPEQC8ehvwCFb21q8cNq0NeLXR9HqGDItpOmXF+SOgjC JwfChcmqDG8oEVM4tVT0lKmd0y/3Aod8ZL0FI+/JXQ2vVCZGiIkSTovhStIVtZBshqbC bK9CBojm2OcCUsgstde+TZafOCu7aWkTG+wE5rBMWA2OzYzWc8vHcXf/1D5PKWwPEt7i K/yQ== X-Gm-Message-State: ALoCoQl/PdNn2kUstmdh5/0g/iPN8tnvrx0qo4r6y1RqhuLNXMIx6Do/+1GaI9iHkFQ04HP2IsoG X-Received: by 10.140.31.36 with SMTP id e33mr27938511qge.36.1420829927318; Fri, 09 Jan 2015 10:58:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.96.85.227 with HTTP; Fri, 9 Jan 2015 10:58:27 -0800 (PST) In-Reply-To: References: From: Mark Koudritsky Date: Fri, 9 Jan 2015 13:58:27 -0500 Message-ID: Subject: Re: MobileSpec for testing cordova-lib@rc To: dev@cordova.apache.org Content-Type: multipart/alternative; boundary=001a113a92bc1adb60050c3cbf05 X-Virus-Checked: Checked by ClamAV on apache.org --001a113a92bc1adb60050c3cbf05 Content-Type: text/plain; charset=UTF-8 Having two different names for the same plugin would be pretty annoying (if it's not something trivial like nameB = prefix + nameA). If reverse-domain-style IDs are not really necessary, I would be glad to see them eventually replaced with shorter and more memorable names. For CLI based projects, auto adding from node_modules sounds good. On Fri, Jan 9, 2015 at 11:19 AM, Michal Mocny wrote: > So, `npm install` will look at the project root package.json and install > all "dependencies" in the npm package format. `cordova plugin add` will > take the plugin_ID and look in your plugin_search_path's for plugins with > that ID, and fallback to fetching from our plugin registry if it does not > find one. > > So, I think there is no conflict in naming the npm packages in a different, > cleaner style (i.e. cordova-plugin-file-transfer). That is because to > install a plugin from npm you would have to do two separate steps anyways: > > > npm install --save cordova-plugin-file-transfer # or just npm install > if its already in your package.json > > cordova plugin add org.apache.cordova.file-transfer # assuming > node_modules is in plugin_search_path by default > > If we want to merge these two steps into one (good idea), there are > options: > > 1. Turn our plugin registry into a plugin_ID -> npm-package-name lookup, > and support `cordova plugin add --npm plugin_ID` > 2. Always auto-add all plugins from node_modules during prepare, and ditch > the `cordova plugin add` step altogether. If you want to install local > plugins for development, use npm link. > 3. Other options? > > -Michal > > On Fri, Jan 9, 2015 at 10:32 AM, Andrew Grieve > wrote: > > > On Thu, Jan 8, 2015 at 8:39 PM, Steven Gill > > wrote: > > > > > Just checked out peer-dependencies. Looks like the way to move forward > > with > > > handling our dependency issues. > > > > > > Right now, plugman publish creates a package.json file by grabbing info > > > from plugin.xml. Once published, plugman will automatically delete the > > > package.json file. I suggest we stop deleting the package.json file and > > > actually commit it to all plugin repos. > > > > > Sounds good. This way authors can add whatever extra metadata they want. > > > > > > > > What is wrong with uploading the plugins with their current ids as > > package > > > names for npm? (ex. org.apache.cordova.device). Then you could just add > > > org.apache.cordova.device to your package.json file. It is just for > > > distinguishing which modules are plugins at plugin add time? We could > do > > > that with some sort of check looking for a plugin.xml in the directory > or > > > maybe adding a cordova plugin keyword to the package.json files. I just > > > think uploading them under a different name to npm will get confusing. > > But > > > having a standard that others use as well doesn't sound like a bad idea > > > (grunt does it ex grunt-contrib-clean). Worth discussing. > > > > > > > I think a prefix will just help for discoverability. E.g. everything that > > starts with cordova-plugin- is a cordova plugin. > > Is it still important to use reverse-domain-style IDs? > > cordova-plugin-org.apache.cordova.file-transfer? > > Seems like that's getting a bit verbose, and with the state of our > current > > "core" apis, I'm not sure we want to might them as promoted / > > distinguishable as other random ones. > > So maybe cordova-plugin-file-transfer is just fine, and if someone else > > write cordova-plugin-file-upload, then that's great! > > > > > > > > > > Ultimately, I'd like to see us support both workflows (CLI vs JS API). > > > - We would publish plugins to cordova registry & npm. > > > > > I believe npm support for multiple registries within one package.json is > > coming, but at the same time, I don't think any of us are that > interesting > > in maintaining our own database... So, +1 for migrating to npm's > database. > > > > > > > - Plugman install would pull down from one (eventually default to npm > and > > > then cordova registry as backup if not found on npm or if version is > > lower) > > > - Eventually close down the cordova plugins registry, move plugins over > > to > > > npm only. Plugins.cordova.io would just search npm based on a cordova > > > plugins keyword (like http://gruntjs.com/plugins) > > > > > +1 > > > > > > > > With the JS API workflow, users can write code in es6 and use a > > transpiler > > > (like https://www.npmjs.com/package/6to5) to convert that code to es5 > > and > > > that is their www code. Then we run the cordova JS API to create a > > project > > > out of that. Have the transpiling + creating cordova project as a build > > > step in our package.json (or grunt/gulp). I guess this technique can be > > > used to use other modules that support browserify and run that as a > build > > > step before building the cordova project. > > > > > > Fun stuff! > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > On Thu, Jan 8, 2015 at 3:36 PM, Mark Koudritsky > > wrote: > > > > > > > +1 for publishing plugins to npm > > > > > > > > We will need to come up with a good naming convention so that > > translating > > > > from plugin id to npm package name would be trivial. Preferably with > > some > > > > stable prefix (like cordova_plugin_) so that it would be easy to > > > > distinguish plugins if they are listed with other dependencies in > > > > package.json > > > > > > > > Another problem to solve are the dependencies _between_ plugins. We > > don't > > > > want nested dirs like node_modules/pluginX/node_modules/pluginY or > > > multiple > > > > version of the same plugin (like it happens for regular npm deps). > > Maybe > > > > npm peer dependencies could be used to solve this > > > > http://blog.nodejs.org/2013/02/07/peer-dependencies/ > > > > > > > > For experimenting with this, there is no need to modify cordova-lib. > We > > > > just need to publish some experimental plugins to npm registry, let > npm > > > > download them during npm install and then add ./node_modules to > > > searchpath. > > > > I tried this with platforms in > > > > https://github.com/kamrik/CordovaGulpTemplate > > > > > > > > > > > > On Thu, Jan 8, 2015 at 6:02 PM, Steven Gill > > > > wrote: > > > > > > > > > This is rad! Definitely a great example showing the JS API. > > > > > > > > > > I am thinking about also starting to publish our plugins to npm and > > > add a > > > > > flag to plugman install to fetch from npm instead of cordova > plugins > > > > > registry. Thoughts? > > > > > > > > > > On Thu, Jan 8, 2015 at 1:09 PM, Mark Koudritsky > > > > > wrote: > > > > > > > > > > > On Thu, Jan 8, 2015 at 3:47 PM, Michal Mocny < > mmocny@chromium.org> > > > > > wrote: > > > > > > > > > > > > > If we add node_modules to search path, will we be able to > adjust > > > > which > > > > > > > versions of platforms/plugins it uses just by modifying > > > package.json? > > > > > > > > > > > > > > > > > > > > Since platforms can be added by path. You can replace > > > > > > platforms = ['android'] > > > > > > with > > > > > > platforms = ['/path/to/local/cordova-android'] // Should work > for > > > > using > > > > > > e.g. cordova-android 4.x > > > > > > or > > > > > > platforms = ['../node_modules/cordova-android'] > > > > > > > > > > > > > > > > > > > Not sure if platforms use search path, or just plugins? Also > not > > > > sure > > > > > if > > > > > > > we can install plugins from our registry using npm proper, but > > you > > > > can > > > > > > use > > > > > > > the git repos as a workaround if not. > > > > > > > > > > > > > > > > > > > For plugins it's more tricky (other npm repo, different > dependency > > > > > model). > > > > > > Some options are: > > > > > > - use private cordova subsection in package.json and store > plugin > > > info > > > > > > including versions there in whatever format we want > > > > > > > > > > > > > > > > > > > > > --001a113a92bc1adb60050c3cbf05--