Release-Candidate
This commit is contained in:
2
cordova/PromisesPlugin-master/.gitignore
vendored
Normal file
2
cordova/PromisesPlugin-master/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
node_modules/
|
||||
.tmp/
|
||||
2
cordova/PromisesPlugin-master/.npmignore
Normal file
2
cordova/PromisesPlugin-master/.npmignore
Normal file
@@ -0,0 +1,2 @@
|
||||
index.js
|
||||
build
|
||||
21
cordova/PromisesPlugin-master/LICENSE
Normal file
21
cordova/PromisesPlugin-master/LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014-15 Vlad Stirbu
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
39
cordova/PromisesPlugin-master/README.md
Normal file
39
cordova/PromisesPlugin-master/README.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# PromisesPlugin
|
||||
|
||||
ES6-Promises polyfill for Cordova/PhoneGap
|
||||
|
||||
# Motivation
|
||||
|
||||
The web view components on Cordova supported platforms lack suport for ES6 Promise. A polyfill library bundled with the plugin fixes the limitation. However, as more plugin use promises, the application developer using these plugins will end up with multiple promise polyfill libraries.
|
||||
|
||||
This plugin attempts to fix this situation by providing a Promise polyfill so that other plugins can rely on this functionality.
|
||||
|
||||
# How to use
|
||||
|
||||
Configure your plugin's plugin.xml by adding this dependency:
|
||||
|
||||
```
|
||||
<dependency
|
||||
id="es6-promise-plugin"
|
||||
url="https://github.com/vstirbu/PromisesPlugin.git">
|
||||
</dependency>
|
||||
```
|
||||
|
||||
Cordova CLI takes care to install PromisesPlugin automatically:
|
||||
|
||||
```
|
||||
$ cordova plugins add {yourPlugin}
|
||||
|
||||
> Installing "{yourPlugin}" for {platform}
|
||||
> Installing "es6-promise-plugin" for {platform}
|
||||
```
|
||||
|
||||
This is all. ```window.Promise``` is available for use in your plugin.
|
||||
|
||||
# Credits
|
||||
|
||||
This plugin wraps [es6-promise](https://github.com/jakearchibald/es6-promise) in a Cordova/PhoneGap friendly way.
|
||||
|
||||
# License
|
||||
|
||||
The plugin is available under MIT license.
|
||||
18
cordova/PromisesPlugin-master/build
Normal file
18
cordova/PromisesPlugin-master/build
Normal file
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
|
||||
rm -rf .tmp
|
||||
mkdir .tmp
|
||||
browserify index.js > .tmp/bundle.js
|
||||
uglifyjs .tmp/bundle.js -c -m > .tmp/bundle.min.js
|
||||
cat > www/promise.js << EOL
|
||||
/*!
|
||||
* @overview es6-promise - a tiny implementation of Promises/A+.
|
||||
* @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)
|
||||
* @license Licensed under MIT license
|
||||
* See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE
|
||||
* @version 4.1.0
|
||||
*/
|
||||
|
||||
`cat .tmp/bundle.min.js`
|
||||
|
||||
EOL
|
||||
4
cordova/PromisesPlugin-master/index.js
vendored
Normal file
4
cordova/PromisesPlugin-master/index.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
if (window.Promise === undefined) {
|
||||
require('es6-promise').polyfill();
|
||||
}
|
||||
|
||||
25
cordova/PromisesPlugin-master/package.json
Normal file
25
cordova/PromisesPlugin-master/package.json
Normal file
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"name": "es6-promise-plugin",
|
||||
"version": "4.1.0",
|
||||
"description": "ES6-Promises polyfill for Cordova/PhoneGap",
|
||||
"main": "www/promise.js",
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
"es6-promise": "^4.1.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "./build"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/vstirbu/PromisesPlugin.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "MIT",
|
||||
"bugs": {
|
||||
"url": "https://github.com/vstirbu/PromisesPlugin/issues"
|
||||
},
|
||||
"homepage": "https://github.com/vstirbu/PromisesPlugin#readme",
|
||||
"ecosystem": "cordova"
|
||||
}
|
||||
26
cordova/PromisesPlugin-master/plugin.xml
Normal file
26
cordova/PromisesPlugin-master/plugin.xml
Normal file
@@ -0,0 +1,26 @@
|
||||
<plugin
|
||||
xmlns="http://www.phonegap.com/ns/plugins/1.0"
|
||||
id="es6-promise-plugin"
|
||||
version="4.1.0">
|
||||
|
||||
<name>Promise</name>
|
||||
<author>Vlad Stirbu</author>
|
||||
<license>MIT</license>
|
||||
<keywords>es6-promise,polyfill</keywords>
|
||||
|
||||
<description>
|
||||
A polyfill for ES6-style Promises, tracking npm es6-promise
|
||||
</description>
|
||||
|
||||
<engines>
|
||||
<engine name="cordova" version=">=3.0.0" />
|
||||
</engines>
|
||||
|
||||
<js-module src="www/promise.js" name="Promise">
|
||||
<runs />
|
||||
</js-module>
|
||||
|
||||
<platform name="ios"></platform>
|
||||
<platform name="android"></platform>
|
||||
<platform name="windows"></platform>
|
||||
</plugin>
|
||||
10
cordova/PromisesPlugin-master/www/promise.js
vendored
Normal file
10
cordova/PromisesPlugin-master/www/promise.js
vendored
Normal file
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user