cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Grieve <agri...@google.com>
Subject Moving plugin JS files around
Date Wed, 09 Jan 2013 14:42:39 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message