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 5CF02E76A for ; Fri, 1 Feb 2013 19:44:52 +0000 (UTC) Received: (qmail 49503 invoked by uid 500); 1 Feb 2013 19:44:52 -0000 Delivered-To: apmail-cordova-dev-archive@cordova.apache.org Received: (qmail 49482 invoked by uid 500); 1 Feb 2013 19:44:52 -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 49473 invoked by uid 99); 1 Feb 2013 19:44:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 19:44:52 +0000 X-ASF-Spam-Status: No, hits=-1.3 required=5.0 tests=FRT_ADOBE2,RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of fil@adobe.com designates 64.18.1.218 as permitted sender) Received: from [64.18.1.218] (HELO exprod6og125.obsmtp.com) (64.18.1.218) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 01 Feb 2013 19:44:46 +0000 Received: from outbound-smtp-2.corp.adobe.com ([193.104.215.16]) by exprod6ob125.postini.com ([64.18.5.12]) with SMTP ID DSNKUQwbGLdBzUpCMwkE5SfngGo29A3asgTg@postini.com; Fri, 01 Feb 2013 11:44:25 PST Received: from inner-relay-1.corp.adobe.com (inner-relay-1.adobe.com [153.32.1.51]) by outbound-smtp-2.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r11JiNC9018087 for ; Fri, 1 Feb 2013 11:44:23 -0800 (PST) Received: from nacas01.corp.adobe.com (nacas01.corp.adobe.com [10.8.189.99]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id r11JiMAV019538 for ; Fri, 1 Feb 2013 11:44:22 -0800 (PST) Received: from nambxv01a.corp.adobe.com ([10.8.189.95]) by nacas01.corp.adobe.com ([10.8.189.99]) with mapi; Fri, 1 Feb 2013 11:44:21 -0800 From: Filip Maj To: "dev@cordova.apache.org" Date: Fri, 1 Feb 2013 11:47:59 -0800 Subject: Re: Moving plugin JS files around Thread-Topic: Moving plugin JS files around Thread-Index: Ac4AtIf5kugH/QBuSO23DJ+dv8GdZw== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.5.121010 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Virus-Checked: Checked by ClamAV on apache.org isn't mit compatible with apache license? On 2/1/13 11:41 AM, "Andrew Grieve" wrote: >Did anyone act on putting this on the wiki? > >We'd need to ask Andrew to re-license from MIT -> Apache before we did so >I >think. > > >On Wed, Jan 9, 2013 at 2:10 PM, Shazron wrote: > >> +1 >> >> >> On Wed, Jan 9, 2013 at 10:57 AM, Filip Maj wrote: >> >> > https://github.com/alunny/cordova-plugin-spec >> > >> > >> > We should move this to our wiki asap >> > >> > On 1/9/13 7:28 AM, "Gord Tanner" wrote: >> > >> > >Ideally the require paths should stay true to the following rules >>(not >> > >that >> > >we follow them exactly now but we are close): >> > > >> > >1. should always start with cordova (in case we ever share a require >> > >framework) >> > >2. should follow as close as possible to the folder structure. >> > > >> > >We don't really do this now (but we are close). It is mainly to help >> with >> > >navigation of the project from a require statement: >> > > >> > > var foo =3D require('cordova/plugin/foo/submodule') >> > > >> > >Ideally I should be able to navigate to a file that lives in: >> > > >> > > ~/cordova.js/plugin/foo/submodule.js >> > > >> > >But realistically we are probably going to see: >> > > >> > > ~/cordova.js/plugin/foo/js/submodule.js >> > > >> > >Assuming we are dumping everything into a js folder here is the >> "mapping" >> > >off the top of my head: >> > > >> > > var foo =3D require('cordova/plugin/foo') >> > > ~/cordova.js/plugin/foo/js/index.js >> > > >> > > var foo =3D require('cordova/plugin/foo/ios') >> > > ~/cordova.js/plugin/foo/js/ios.js >> > > >> > > var foo =3D require('cordova/plugin/foo/blackberry/qnx') >> > > ~/cordova.js/plugin/foo/js/blackberry/qnx.js >> > > >> > >What does a plugin (native and js code) folder structure look like? >> > > >> > > >> > >On Wed, Jan 9, 2013 at 9:42 AM, Andrew Grieve >> wrote: >> > > >> > >> I'd like to take a first step towards moving plugin JS into >>separate >> > >>repos >> > >> by first moving them around within cordova-js. >> > >> >> > >> Here is my proposal: >> > >> >> > >> Current structure: >> > >> lib/common/plugin/*.js >> > >> lib/$PLATFORM/plugin/*.js >> > >> >> > >> New structure: >> > >> plugin/$PLUGIN_NAME/js/common/*.js >> > >> plugin/$PLUGIN_NAME/js/$PLATFORM/*.js >> > >> >> > >> The require path will need to change. Going from: >> > >> cordova.require('cordova/plugin/FileTransferError') >> > >> To: >> > >> cordova.require('plugin/file/FileTransferError') >> > >> >> > >> >> > >> I'll obviously need to update the builder scripts accordingly. The >> idea >> > >> here is that we: >> > >> 1. "cordova plugin add" will copy files into a project's >> plugins >> > >> directory >> > >> 2. "cordova build ios" will use the cordova-js packager and >> > >>pass it >> > >> the plugin/ directory to use >> > >> >> > >> This will not involve changing how we export modules onto >>namespaces >> in >> > >> common.js / platform.js. That will come next though. >> > >> >> > >> >> > >> The resulting structure will look like: >> > >> >> > >> plugin/accelerometer/js/common/Acceleration.js >> > >> plugin/accelerometer/js/common/accelerometer.js >> > >> plugin/battery/js/common/battery.js >> > >> plugin/compass/js/common/Compass*.js >> > >> plugin/contacts/js/common/Contact*.js >> > >> plugin/device/js/common/device.js >> > >> plugin/geolocation/js/common/Coordinates.js >> > >> plugin/geolocation/js/common/Position*.js >> > >> plugin/globalization/js/common/Globalization*.js >> > >> plugin/inappbrowser/js/common/InAppBrowser.js >> > >> plugin/logger/js/common/logger.js >> > >> plugin/logger/js/common/console-via-logger.js >> > >> plugin/media/js/common/Capture*.js >> > >> plugin/media/js/common/ConfigurationData.js >> > >> plugin/media/js/common/Media*.js >> > >> plugin/network/js/common/Connection.js >> > >> plugin/notification/js/common/notification.js >> > >> plugin/camera/js/common/Camera*.js >> > >> plugin/echo/js/common/echo.js >> > >> plugin/file/js/common/Directory*.js >> > >> plugin/file/js/common/Entry.js >> > >> plugin/file/js/common/File*.js >> > >> plugin/file/js/common/Flags.js >> > >> plugin/file/js/common/LocalFileSystem.js >> > >> plugin/file/js/common/Metadata.js >> > >> plugin/file/js/common/ProgressEvent.js >> > >> plugin/splashscreen/js/common/splashscreen.js >> > >> >> > >> > >>