phonegap-soundwave
Advanced tools
Comparing version 0.3.0 to 0.4.0
@@ -30,2 +30,10 @@ /*! | ||
/** | ||
* Create a project. | ||
* | ||
* See module for documentation. | ||
*/ | ||
module.exports.create = require('./create'); | ||
/** | ||
* Listen for connections. | ||
@@ -32,0 +40,0 @@ * |
@@ -6,4 +6,10 @@ /*! | ||
var connect = require('connect'), | ||
path = require('path'), | ||
fs = require('fs'), | ||
cordova = require('./middleware/cordova'), | ||
mstatic = require('./middleware/static'); | ||
cordova_plugins = require('./middleware/cordova_plugins'), | ||
inject = require('./middleware/inject'), | ||
mstatic = require('./middleware/static'), | ||
nocache = require('./middleware/nocache'), | ||
plugins = require('./middleware/plugins'); | ||
@@ -20,2 +26,8 @@ /** | ||
// no-cache header | ||
app.use(nocache()); | ||
// inject JavaScript to refresh app or navigate home | ||
app.use(inject()); | ||
// serve static assets | ||
@@ -27,2 +39,8 @@ app.use(mstatic()); | ||
// serve cordova_plugin js if 404'd out from previous static server | ||
app.use(cordova_plugins()); | ||
// serve plugins if 404'd out from previous static server | ||
app.use(plugins()); | ||
// return the request listener | ||
@@ -29,0 +47,0 @@ return function(req, res, next) { |
@@ -17,7 +17,8 @@ /*! | ||
return function(req, res, next) { | ||
if (req.url.indexOf('cordova.js') > 0) { | ||
if (req.url.indexOf('cordova.js') >= 0) { | ||
// assume ios only for now | ||
var cordovajs = fs.readFileSync( | ||
path.join(__dirname, '../../res/middleware/cordova/cordova.ios.js') | ||
path.join(__dirname, '../../res/middleware/cordova/ios/cordova.js') | ||
); | ||
res.writeHead(200, {'Content-Type': 'text/javascript'}); | ||
@@ -24,0 +25,0 @@ res.end(cordovajs); |
{ | ||
"name": "phonegap-soundwave", | ||
"description": "Connect middleware to stream a PhoneGap app.", | ||
"version": "0.3.0", | ||
"version": "0.4.0", | ||
"homepage": "https://github.com/phonegap/node-phonegap-soundwave", | ||
@@ -23,3 +23,9 @@ "repository": { | ||
"connect": "2.12.0", | ||
"node-static": "0.7.0" | ||
"connect-inject": "0.3.2", | ||
"home-dir": "0.1.2", | ||
"node-static": "0.7.0", | ||
"request": "2.33.0", | ||
"request-progress": "0.3.1", | ||
"shelljs": "0.2.6", | ||
"tar": "0.1.19" | ||
}, | ||
@@ -26,0 +32,0 @@ "devDependencies": { |
@@ -83,4 +83,49 @@ # phonegap-soundwave [![Build Status][travis-ci-img]][travis-ci-url] | ||
### soundwave.create(options) | ||
The project is created from the same app template used by the PhoneGap CLI | ||
and Cordova CLI. When a template does not exist, it is fetched and saved | ||
in the common directory: | ||
~/.cordova/lib/www/phonegap/VERSION/ | ||
Options: | ||
- `options` {Object} | ||
- `path` {String} is the path to create the project. | ||
- `version` {String} defines the PhoneGap app version. | ||
Events: | ||
- `progress` emits state while downloading the app template. | ||
- `state` {Object} with `received`, `total`, and `percentage`. | ||
- `error` emitted when an error occurs. | ||
- `e` {Error} | ||
- `complete` emits when the project has been created. | ||
- `data` {Object} is indentical to the input `options`. | ||
Example: | ||
soundwave.create({ | ||
path: 'path/to/app', | ||
version: '3.3.0' | ||
}) | ||
.on('progress', function(state) { | ||
// only emitted when downloading a template. | ||
// state values are only defined when response supports | ||
// content-length header. | ||
if (state.percentage) { | ||
console.log('downloaded: ' + state.percentage + '%'); | ||
} | ||
} | ||
.on('error', function(e) { | ||
// handle error | ||
}) | ||
.on('complete', function(data) { | ||
// data.path is the app path | ||
console.log('created project at: ' + data.path); | ||
}); | ||
[travis-ci-img]: https://travis-ci.org/phonegap/node-phonegap-soundwave.png?branch=master | ||
[travis-ci-url]: http://travis-ci.org/phonegap/node-phonegap-soundwave | ||
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
265648
40
6534
131
8
21
3
+ Addedconnect-inject@0.3.2
+ Addedhome-dir@0.1.2
+ Addedrequest@2.33.0
+ Addedrequest-progress@0.3.1
+ Addedshelljs@0.2.6
+ Addedtar@0.1.19
+ Addedasn1@0.1.11(transitive)
+ Addedassert-plus@0.1.5(transitive)
+ Addedasync@0.9.2(transitive)
+ Addedaws-sign2@0.5.0(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedblock-stream@0.0.9(transitive)
+ Addedboom@0.4.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcombined-stream@0.0.7(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconnect-inject@0.3.2(transitive)
+ Addedcryptiles@0.2.2(transitive)
+ Addedctype@0.5.3(transitive)
+ Addeddelayed-stream@0.0.5(transitive)
+ Addedforever-agent@0.5.2(transitive)
+ Addedform-data@0.1.4(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedfstream@0.1.31(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedgraceful-fs@3.0.12(transitive)
+ Addedhawk@1.0.0(transitive)
+ Addedhoek@0.9.1(transitive)
+ Addedhome-dir@0.1.2(transitive)
+ Addedhttp-signature@0.10.1(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminimist@1.2.8(transitive)
+ Addedmkdirp@0.5.6(transitive)
+ Addednatives@1.1.6(transitive)
+ Addednode-uuid@1.4.8(transitive)
+ Addedoauth-sign@0.3.0(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedrequest@2.33.0(transitive)
+ Addedrequest-progress@0.3.1(transitive)
+ Addedrimraf@2.7.1(transitive)
+ Addedshelljs@0.2.6(transitive)
+ Addedsntp@0.2.4(transitive)
+ Addedtar@0.1.19(transitive)
+ Addedthrottleit@0.0.2(transitive)
+ Addedtldts@6.1.83(transitive)
+ Addedtldts-core@6.1.83(transitive)
+ Addedtough-cookie@5.1.2(transitive)
+ Addedtunnel-agent@0.3.0(transitive)
+ Addedwrappy@1.0.2(transitive)