cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ste...@apache.org
Subject [13/27] git commit: CB-5816 remove node_js from the project template and copy cordova-adroid style of node_module inclusion
Date Wed, 14 May 2014 00:09:42 GMT
CB-5816 remove node_js from the project template and copy cordova-adroid style of node_module
inclusion


Project: http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/commit/38ea4602
Tree: http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/tree/38ea4602
Diff: http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/diff/38ea4602

Branch: refs/heads/3.5.x
Commit: 38ea46024112f8d5e8beaec1665bba3cd769286d
Parents: 883b4cd
Author: braas <braas@steckelfisch.nl>
Authored: Tue Mar 18 19:52:33 2014 +0100
Committer: braas <braas@steckelfisch.nl>
Committed: Tue Mar 18 19:52:33 2014 +0100

----------------------------------------------------------------------
 bin/lib/create.js                               |    4 +-
 .../project/cordova/node_modules/.bin/shjs      |    1 -
 .../adm-zip/.idea/scopes/scope_settings.xml     |    5 -
 .../node_modules/adm-zip/MIT-LICENSE.txt        |   21 -
 .../cordova/node_modules/adm-zip/README.md      |   64 -
 .../cordova/node_modules/adm-zip/adm-zip.js     |  404 -----
 .../node_modules/adm-zip/headers/entryHeader.js |  261 ---
 .../node_modules/adm-zip/headers/index.js       |    2 -
 .../node_modules/adm-zip/headers/mainHeader.js  |   80 -
 .../node_modules/adm-zip/methods/deflater.js    | 1578 ------------------
 .../node_modules/adm-zip/methods/index.js       |    2 -
 .../node_modules/adm-zip/methods/inflater.js    |  448 -----
 .../cordova/node_modules/adm-zip/package.json   |   43 -
 .../attributes_test/New folder/hidden.txt       |   17 -
 .../New folder/hidden_readonly.txt              |   17 -
 .../attributes_test/New folder/readonly.txt     |   17 -
 .../attributes_test/New folder/somefile.txt     |   17 -
 .../attributes_test/asd/New Text Document.txt   |    0
 .../test/assets/attributes_test/blank file.txt  |    0
 .../cordova/node_modules/adm-zip/test/index.js  |    5 -
 .../node_modules/adm-zip/util/constants.js      |   84 -
 .../cordova/node_modules/adm-zip/util/errors.js |   35 -
 .../cordova/node_modules/adm-zip/util/fattr.js  |   84 -
 .../cordova/node_modules/adm-zip/util/index.js  |    4 -
 .../cordova/node_modules/adm-zip/util/utils.js  |  145 --
 .../cordova/node_modules/adm-zip/zipEntry.js    |  224 ---
 .../cordova/node_modules/adm-zip/zipFile.js     |  311 ----
 .../node_modules/shelljs/.documentup.json       |    6 -
 .../cordova/node_modules/shelljs/.jshintrc      |    7 -
 .../cordova/node_modules/shelljs/.npmignore     |    2 -
 .../cordova/node_modules/shelljs/.travis.yml    |    5 -
 .../cordova/node_modules/shelljs/LICENSE        |   26 -
 .../cordova/node_modules/shelljs/README.md      |  552 ------
 .../cordova/node_modules/shelljs/bin/shjs       |   51 -
 .../cordova/node_modules/shelljs/global.js      |    3 -
 .../cordova/node_modules/shelljs/make.js        |   47 -
 .../cordova/node_modules/shelljs/package.json   |   44 -
 .../shelljs/scripts/generate-docs.js            |   21 -
 .../node_modules/shelljs/scripts/run-tests.js   |   50 -
 .../cordova/node_modules/shelljs/shell.js       |  153 --
 .../cordova/node_modules/shelljs/src/cat.js     |   43 -
 .../cordova/node_modules/shelljs/src/cd.js      |   19 -
 .../cordova/node_modules/shelljs/src/chmod.js   |  208 ---
 .../cordova/node_modules/shelljs/src/common.js  |  189 ---
 .../cordova/node_modules/shelljs/src/cp.js      |  200 ---
 .../cordova/node_modules/shelljs/src/dirs.js    |  191 ---
 .../cordova/node_modules/shelljs/src/echo.js    |   20 -
 .../cordova/node_modules/shelljs/src/error.js   |   10 -
 .../cordova/node_modules/shelljs/src/exec.js    |  181 --
 .../cordova/node_modules/shelljs/src/find.js    |   51 -
 .../cordova/node_modules/shelljs/src/grep.js    |   52 -
 .../cordova/node_modules/shelljs/src/ls.js      |  126 --
 .../cordova/node_modules/shelljs/src/mkdir.js   |   68 -
 .../cordova/node_modules/shelljs/src/mv.js      |   80 -
 .../cordova/node_modules/shelljs/src/popd.js    |    1 -
 .../cordova/node_modules/shelljs/src/pushd.js   |    1 -
 .../cordova/node_modules/shelljs/src/pwd.js     |   11 -
 .../cordova/node_modules/shelljs/src/rm.js      |  145 --
 .../cordova/node_modules/shelljs/src/sed.js     |   43 -
 .../cordova/node_modules/shelljs/src/tempdir.js |   56 -
 .../cordova/node_modules/shelljs/src/test.js    |   85 -
 .../cordova/node_modules/shelljs/src/to.js      |   29 -
 .../cordova/node_modules/shelljs/src/toEnd.js   |   29 -
 .../cordova/node_modules/shelljs/src/which.js   |   79 -
 package.json                                    |    3 +-
 65 files changed, 5 insertions(+), 6755 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/38ea4602/bin/lib/create.js
----------------------------------------------------------------------
diff --git a/bin/lib/create.js b/bin/lib/create.js
index 57babe4..b3f720c 100755
--- a/bin/lib/create.js
+++ b/bin/lib/create.js
@@ -55,10 +55,12 @@ exports.createProject = function(project_path,package_name,project_name){
     //copy template folder
     shjs.cp('-r', path.join(ROOT, 'bin', 'templates', 'project', 'www'), project_path);
 
-    //copy check_reqs file ,creat bin/lip if it does not exist yet
+    //copy check_reqs file ,creat bin/lib if it does not exist yet
     if(!fs.existsSync(path.join(project_path,'cordova', 'lib'))) {
         shjs.mkdir('-p', path.join(project_path,'cordova', 'lib'));
     }
+
+    shjs.cp('-r', path.join(ROOT, 'node_modules'), path.join(project_path,'cordova'));
     shjs.cp( path.join(ROOT, 'bin', 'lib', 'check_reqs.js'), path.join(project_path,'cordova',
'lib'));
     
     //copy cordova js file

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/38ea4602/bin/templates/project/cordova/node_modules/.bin/shjs
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/node_modules/.bin/shjs b/bin/templates/project/cordova/node_modules/.bin/shjs
deleted file mode 120000
index a044997..0000000
--- a/bin/templates/project/cordova/node_modules/.bin/shjs
+++ /dev/null
@@ -1 +0,0 @@
-../shelljs/bin/shjs
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/38ea4602/bin/templates/project/cordova/node_modules/adm-zip/.idea/scopes/scope_settings.xml
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/node_modules/adm-zip/.idea/scopes/scope_settings.xml
b/bin/templates/project/cordova/node_modules/adm-zip/.idea/scopes/scope_settings.xml
deleted file mode 100644
index 922003b..0000000
--- a/bin/templates/project/cordova/node_modules/adm-zip/.idea/scopes/scope_settings.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<component name="DependencyValidationManager">
-  <state>
-    <option name="SKIP_IMPORT_STATEMENTS" value="false" />
-  </state>
-</component>
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/38ea4602/bin/templates/project/cordova/node_modules/adm-zip/MIT-LICENSE.txt
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/node_modules/adm-zip/MIT-LICENSE.txt b/bin/templates/project/cordova/node_modules/adm-zip/MIT-LICENSE.txt
deleted file mode 100644
index 0124c8a..0000000
--- a/bin/templates/project/cordova/node_modules/adm-zip/MIT-LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-Copyright (c) 2012 Another-D-Mention Software and other contributors, 
-http://www.another-d-mention.ro/
-
-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.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/38ea4602/bin/templates/project/cordova/node_modules/adm-zip/README.md
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/node_modules/adm-zip/README.md b/bin/templates/project/cordova/node_modules/adm-zip/README.md
deleted file mode 100644
index dd94d47..0000000
--- a/bin/templates/project/cordova/node_modules/adm-zip/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-# ADM-ZIP for NodeJS
-
-ADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](http://nodejs.org/).

-
-# Installation
-
-With [npm](http://npmjs.org) do:
-
-    $ npm install adm-zip
-	
-## What is it good for?
-The library allows you to:
-
-* decompress zip files directly to disk or in memory buffers
-* compress files and store them to disk in .zip format or in compressed buffers
-* update content of/add new/delete files from an existing .zip
-
-# Dependencies
-There are no other nodeJS libraries that ADM-ZIP is dependent of
-
-# Examples
-
-## Basic usage
-```javascript
-
-	var AdmZip = require('adm-zip');
-
-	// reading archives
-	var zip = new AdmZip("./my_file.zip");
-	var zipEntries = zip.getEntries(); // an array of ZipEntry records
-
-	zipEntries.forEach(function(zipEntry) {
-	    console.log(zipEntry.toString()); // outputs zip entries information
-		if (zipEntry.entryName == "my_file.txt") {
-		     console.log(zipEntry.data.toString('utf8')); 
-		}
-	});
-	// outputs the content of some_folder/my_file.txt
-	console.log(zip.readAsText("some_folder/my_file.txt")); 
-	// extracts the specified file to the specified location
-	zip.extractEntryTo(/*entry name*/"some_folder/my_file.txt", /*target path*/"/home/me/tempfolder",
/*maintainEntryPath*/false, /*overwrite*/true);
-	// extracts everything
-	zip.extractAllTo(/*target path*/"/home/me/zipcontent/", /*overwrite*/true);
-	
-	
-	// creating archives
-	var zip = new AdmZip();
-	
-	// add file directly
-	zip.addFile("test.txt", new Buffer("inner content of the file"), "entry comment goes here");
-	// add local file
-	zip.addLocalFile("/home/me/some_picture.png");
-	// get everything as a buffer
-	var willSendthis = zip.toBuffer();
-	// or write everything to disk
-	zip.writeZip(/*target file name*/"/home/me/files.zip");
-	
-	
-	// ... more examples in the wiki
-```
-
-For more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki).
-
-[![build status](https://secure.travis-ci.org/cthackers/adm-zip.png)](http://travis-ci.org/cthackers/adm-zip)

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/38ea4602/bin/templates/project/cordova/node_modules/adm-zip/adm-zip.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/node_modules/adm-zip/adm-zip.js b/bin/templates/project/cordova/node_modules/adm-zip/adm-zip.js
deleted file mode 100644
index 0a0c518..0000000
--- a/bin/templates/project/cordova/node_modules/adm-zip/adm-zip.js
+++ /dev/null
@@ -1,404 +0,0 @@
-var fs = require("fs"),
-    pth = require("path");
-
-fs.existsSync = fs.existsSync || pth.existsSync;
-
-var ZipEntry = require("./zipEntry"),
-    ZipFile =  require("./zipFile"),
-    Utils = require("./util");
-
-module.exports = function(/*String*/input) {
-    var _zip = undefined,
-        _filename = "";
-
-    if (input && typeof input === "string") { // load zip file
-        if (fs.existsSync(input)) {
-            _filename = input;
-            _zip = new ZipFile(input, Utils.Constants.FILE);
-        } else {
-           throw Utils.Errors.INVALID_FILENAME;
-        }
-    } else if(input && Buffer.isBuffer(input)) { // load buffer
-        _zip = new ZipFile(input, Utils.Constants.BUFFER);
-    } else { // create new zip file
-        _zip = new ZipFile(null, Utils.Constants.NONE);
-    }
-
-    function getEntry(/*Object*/entry) {
-        if (entry && _zip) {
-            var item;
-            // If entry was given as a file name
-            if (typeof entry === "string")
-                item = _zip.getEntry(entry);
-            // if entry was given as a ZipEntry object
-            if (typeof entry === "object" && entry.entryName != undefined &&
entry.header != undefined)
-                item =  _zip.getEntry(entry.entryName);
-
-            if (item) {
-                return item;
-            }
-        }
-        return null;
-    }
-
-    return {
-        /**
-         * Extracts the given entry from the archive and returns the content as a Buffer
object
-         * @param entry ZipEntry object or String with the full path of the entry
-         *
-         * @return Buffer or Null in case of error
-         */
-        readFile : function(/*Object*/entry) {
-            var item = getEntry(entry);
-            return item && item.getData() || null;
-        },
-
-        /**
-         * Asynchronous readFile
-         * @param entry ZipEntry object or String with the full path of the entry
-         * @param callback
-         *
-         * @return Buffer or Null in case of error
-         */
-        readFileAsync : function(/*Object*/entry, /*Function*/callback) {
-            var item = getEntry(entry);
-            if (item) {
-                item.getDataAsync(callback);
-            } else {
-                callback(null,"getEntry failed for:" + entry)
-            }
-        },
-
-        /**
-         * Extracts the given entry from the archive and returns the content as plain text
in the given encoding
-         * @param entry ZipEntry object or String with the full path of the entry
-         * @param encoding Optional. If no encoding is specified utf8 is used
-         *
-         * @return String
-         */
-        readAsText : function(/*Object*/entry, /*String - Optional*/encoding) {
-            var item = getEntry(entry);
-            if (item) {
-                var data = item.getData();
-                if (data && data.length) {
-                    return data.toString(encoding || "utf8");
-                }
-            }
-            return "";
-        },
-
-        /**
-         * Asynchronous readAsText
-         * @param entry ZipEntry object or String with the full path of the entry
-         * @param callback
-         * @param encoding Optional. If no encoding is specified utf8 is used
-         *
-         * @return String
-         */
-        readAsTextAsync : function(/*Object*/entry, /*Function*/callback, /*String - Optional*/encoding)
{
-            var item = getEntry(entry);
-            if (item) {
-                item.getDataAsync(function(data) {
-                    if (data && data.length) {
-                        callback(data.toString(encoding || "utf8"));
-                    } else {
-                        callback("");
-                    }
-                })
-            } else {
-                callback("");
-            }
-        },
-
-        /**
-         * Remove the entry from the file or the entry and all it's nested directories and
files if the given entry is a directory
-         *
-         * @param entry
-         */
-        deleteFile : function(/*Object*/entry) { // @TODO: test deleteFile
-            var item = getEntry(entry);
-            if (item) {
-                _zip.deleteEntry(item.entryName);
-            }
-        },
-
-        /**
-         * Adds a comment to the zip. The zip must be rewritten after adding the comment.
-         *
-         * @param comment
-         */
-        addZipComment : function(/*String*/comment) { // @TODO: test addZipComment
-            _zip.comment = comment;
-        },
-
-        /**
-         * Returns the zip comment
-         *
-         * @return String
-         */
-        getZipComment : function() {
-            return _zip.comment || '';
-        },
-
-        /**
-         * Adds a comment to a specified zipEntry. The zip must be rewritten after adding
the comment
-         * The comment cannot exceed 65535 characters in length
-         *
-         * @param entry
-         * @param comment
-         */
-        addZipEntryComment : function(/*Object*/entry,/*String*/comment) {
-            var item = getEntry(entry);
-            if (item) {
-                item.comment = comment;
-            }
-        },
-
-        /**
-         * Returns the comment of the specified entry
-         *
-         * @param entry
-         * @return String
-         */
-        getZipEntryComment : function(/*Object*/entry) {
-            var item = getEntry(entry);
-            if (item) {
-                return item.comment || '';
-            }
-            return ''
-        },
-
-        /**
-         * Updates the content of an existing entry inside the archive. The zip must be rewritten
after updating the content
-         *
-         * @param entry
-         * @param content
-         */
-        updateFile : function(/*Object*/entry, /*Buffer*/content) {
-            var item = getEntry(entry);
-            if (item) {
-                item.setData(content);
-            }
-        },
-
-        /**
-         * Adds a file from the disk to the archive
-         *
-         * @param localPath
-         */
-        addLocalFile : function(/*String*/localPath, /*String*/zipPath) {
-             if (fs.existsSync(localPath)) {
-                if(zipPath){
-                    zipPath=zipPath.split("\\").join("/");
-                    if(zipPath.charAt(zipPath.length - 1) != "/"){
-                        zipPath += "/";
-                    }
-                }else{
-                    zipPath="";
-                }
-                 var p = localPath.split("\\").join("/").split("/").pop();
-
-                 this.addFile(zipPath+p, fs.readFileSync(localPath), "", 0)
-             } else {
-                 throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath);
-             }
-        },
-
-        /**
-         * Adds a local directory and all its nested files and directories to the archive
-         *
-         * @param localPath
-         */
-        addLocalFolder : function(/*String*/localPath, /*String*/zipPath) {
-            if(zipPath){
-                zipPath=zipPath.split("\\").join("/");
-                if(zipPath.charAt(zipPath.length - 1) != "/"){
-                    zipPath += "/";
-                }
-            }else{
-                zipPath="";
-            }
-			localPath = localPath.split("\\").join("/"); //windows fix
-            if (localPath.charAt(localPath.length - 1) != "/")
-                localPath += "/";
-
-            if (fs.existsSync(localPath)) {
-
-                var items = Utils.findFiles(localPath),
-                    self = this;
-
-                if (items.length) {
-                    items.forEach(function(path) {
-						var p = path.split("\\").join("/").replace(localPath, ""); //windows fix
-                        if (p.charAt(p.length - 1) !== "/") {
-                            self.addFile(zipPath+p, fs.readFileSync(path), "", 0)
-                        } else {
-                            self.addFile(zipPath+p, new Buffer(0), "", 0)
-                        }
-                    });
-                }
-            } else {
-                throw Utils.Errors.FILE_NOT_FOUND.replace("%s", localPath);
-            }
-        },
-
-        /**
-         * Allows you to create a entry (file or directory) in the zip file.
-         * If you want to create a directory the entryName must end in / and a null buffer
should be provided.
-         * Comment and attributes are optional
-         *
-         * @param entryName
-         * @param content
-         * @param comment
-         * @param attr
-         */
-        addFile : function(/*String*/entryName, /*Buffer*/content, /*String*/comment, /*Number*/attr)
{
-            var entry = new ZipEntry();
-            entry.entryName = entryName;
-            entry.comment = comment || "";
-            entry.attr = attr || 438; //0666;
-            if (entry.isDirectory && content.length) {
-               // throw Utils.Errors.DIRECTORY_CONTENT_ERROR;
-            }
-            entry.setData(content);
-            _zip.setEntry(entry);
-        },
-
-        /**
-         * Returns an array of ZipEntry objects representing the files and folders inside
the archive
-         *
-         * @return Array
-         */
-        getEntries : function() {
-            if (_zip) {
-               return _zip.entries;
-            } else {
-                return [];
-            }
-        },
-
-        /**
-         * Returns a ZipEntry object representing the file or folder specified by ``name``.
-         *
-         * @param name
-         * @return ZipEntry
-         */
-        getEntry : function(/*String*/name) {
-            return getEntry(name);
-        },
-
-        /**
-         * Extracts the given entry to the given targetPath
-         * If the entry is a directory inside the archive, the entire directory and it's
subdirectories will be extracted
-         *
-         * @param entry ZipEntry object or String with the full path of the entry
-         * @param targetPath Target folder where to write the file
-         * @param maintainEntryPath If maintainEntryPath is true and the entry is inside
a folder, the entry folder
-         *                          will be created in targetPath as well. Default is TRUE
-         * @param overwrite If the file already exists at the target path, the file will
be overwriten if this is true.
-         *                  Default is FALSE
-         *
-         * @return Boolean
-         */
-        extractEntryTo : function(/*Object*/entry, /*String*/targetPath, /*Boolean*/maintainEntryPath,
/*Boolean*/overwrite) {
-            overwrite = overwrite || false;
-            maintainEntryPath = typeof maintainEntryPath == "undefined" ? true : maintainEntryPath;
-
-            var item = getEntry(entry);
-            if (!item) {
-                throw Utils.Errors.NO_ENTRY;
-            }
-
-            var target = pth.resolve(targetPath, maintainEntryPath ? item.entryName : pth.basename(item.entryName));
-
-            if (item.isDirectory) {
-                target = pth.resolve(target, "..");
-                var children = _zip.getEntryChildren(item);
-                children.forEach(function(child) {
-                    if (child.isDirectory) return;
-                    var content = child.getData();
-                    if (!content) {
-                        throw Utils.Errors.CANT_EXTRACT_FILE;
-                    }
-                    Utils.writeFileTo(pth.resolve(targetPath, maintainEntryPath ? child.entryName
: child.entryName.substr(item.entryName.length)), content, overwrite);
-                });
-                return true;
-            }
-
-            var content = item.getData();
-            if (!content) throw Utils.Errors.CANT_EXTRACT_FILE;
-
-            if (fs.existsSync(targetPath) && !overwrite) {
-                throw Utils.Errors.CANT_OVERRIDE;
-            }
-            Utils.writeFileTo(target, content, overwrite);
-
-            return true;
-        },
-
-        /**
-         * Extracts the entire archive to the given location
-         *
-         * @param targetPath Target location
-         * @param overwrite If the file already exists at the target path, the file will
be overwriten if this is true.
-         *                  Default is FALSE
-         */
-        extractAllTo : function(/*String*/targetPath, /*Boolean*/overwrite) {
-            overwrite = overwrite || false;
-            if (!_zip) {
-                throw Utils.Errors.NO_ZIP;
-            }
-
-            _zip.entries.forEach(function(entry) {
-                if (entry.isDirectory) {
-                    Utils.makeDir(pth.resolve(targetPath, entry.entryName.toString()));
-                    return;
-                }
-                var content = entry.getData();
-                if (!content) {
-                    throw Utils.Errors.CANT_EXTRACT_FILE + "2";
-                }
-                Utils.writeFileTo(pth.resolve(targetPath, entry.entryName.toString()), content,
overwrite);
-            })
-        },
-
-        /**
-         * Writes the newly created zip file to disk at the specified location or if a zip
was opened and no ``targetFileName`` is provided, it will overwrite the opened zip
-         *
-         * @param targetFileName
-         * @param callback
-         */
-        writeZip : function(/*String*/targetFileName, /*Function*/callback) {
-            if (arguments.length == 1) {
-                if (typeof targetFileName == "function") {
-                    callback = targetFileName;
-                    targetFileName = "";
-                }
-            }
-
-            if (!targetFileName && _filename) {
-                targetFileName = _filename;
-            }
-            if (!targetFileName) return;
-
-            var zipData = _zip.compressToBuffer();
-            if (zipData) {
-                Utils.writeFileTo(targetFileName, zipData, true);
-            }
-        },
-
-        /**
-         * Returns the content of the entire zip file as a Buffer object
-         *
-         * @return Buffer
-         */
-        toBuffer : function(/*Function*/onSuccess,/*Function*/onFail,/*Function*/onItemStart,/*Function*/onItemEnd)
{
-            this.valueOf = 2;
-            if (typeof onSuccess == "function") {
-                _zip.toAsyncBuffer(onSuccess,onFail,onItemStart,onItemEnd);
-                return null;
-            }
-            return _zip.compressToBuffer()
-        }
-    }
-};

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/38ea4602/bin/templates/project/cordova/node_modules/adm-zip/headers/entryHeader.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/node_modules/adm-zip/headers/entryHeader.js b/bin/templates/project/cordova/node_modules/adm-zip/headers/entryHeader.js
deleted file mode 100644
index 9a0e1bd..0000000
--- a/bin/templates/project/cordova/node_modules/adm-zip/headers/entryHeader.js
+++ /dev/null
@@ -1,261 +0,0 @@
-var Utils = require("../util"),
-    Constants = Utils.Constants;
-
-/* The central directory file header */
-module.exports = function () {
-    var _verMade = 0x0A,
-        _version = 0x0A,
-        _flags = 0,
-        _method = 0,
-        _time = 0,
-        _crc = 0,
-        _compressedSize = 0,
-        _size = 0,
-        _fnameLen = 0,
-        _extraLen = 0,
-
-        _comLen = 0,
-        _diskStart = 0,
-        _inattr = 0,
-        _attr = 0,
-        _offset = 0;
-
-    var _dataHeader = {};
-
-    function setTime(val) {
-        var val = new Date(val);
-        _time = (val.getFullYear() - 1980 & 0x7f) << 25  // b09-16 years from 1980
-            | (val.getMonth() + 1) << 21                 // b05-08 month
-            | val.getDay() << 16                         // b00-04 hour
-
-            // 2 bytes time
-            | val.getHours() << 11    // b11-15 hour
-            | val.getMinutes() << 5   // b05-10 minute
-            | val.getSeconds() >> 1;  // b00-04 seconds divided by 2
-    }
-
-    setTime(+new Date());
-
-    return {
-        get made () { return _verMade; },
-        set made (val) { _verMade = val; },
-
-        get version () { return _version; },
-        set version (val) { _version = val },
-
-        get flags () { return _flags },
-        set flags (val) { _flags = val; },
-
-        get method () { return _method; },
-        set method (val) { _method = val; },
-
-        get time () { return new Date(
-            ((_time >> 25) & 0x7f) + 1980,
-            ((_time >> 21) & 0x0f) - 1,
-            (_time >> 16) & 0x1f,
-            (_time >> 11) & 0x1f,
-            (_time >> 5) & 0x3f,
-            (_time & 0x1f) << 1
-        );
-        },
-        set time (val) {
-            setTime(val);
-        },
-
-        get crc () { return _crc; },
-        set crc (val) { _crc = val; },
-
-        get compressedSize () { return _compressedSize; },
-        set compressedSize (val) { _compressedSize = val; },
-
-        get size () { return _size; },
-        set size (val) { _size = val; },
-
-        get fileNameLength () { return _fnameLen; },
-        set fileNameLength (val) { _fnameLen = val; },
-
-        get extraLength () { return _extraLen },
-        set extraLength (val) { _extraLen = val; },
-
-        get commentLength () { return _comLen },
-        set commentLength (val) { _comLen = val },
-
-        get diskNumStart () { return _diskStart },
-        set diskNumStart (val) { _diskStart = val },
-
-        get inAttr () { return _inattr },
-        set inAttr (val) { _inattr = val },
-
-        get attr () { return _attr },
-        set attr (val) { _attr = val },
-
-        get offset () { return _offset },
-        set offset (val) { _offset = val },
-
-        get encripted () { return (_flags & 1) == 1 },
-
-        get entryHeaderSize () {
-            return Constants.CENHDR + _fnameLen + _extraLen + _comLen;
-        },
-
-        get realDataOffset () {
-            return _offset + Constants.LOCHDR + _dataHeader.fnameLen + _dataHeader.extraLen;
-        },
-
-        get dataHeader () {
-            return _dataHeader;
-        },
-
-        loadDataHeaderFromBinary : function(/*Buffer*/input) {
-            var data = input.slice(_offset, _offset + Constants.LOCHDR);
-            // 30 bytes and should start with "PK\003\004"
-            if (data.readUInt32LE(0) != Constants.LOCSIG) {
-                throw Utils.Errors.INVALID_LOC;
-            }
-            _dataHeader = {
-                // version needed to extract
-                version : data.readUInt16LE(Constants.LOCVER),
-                // general purpose bit flag
-                flags : data.readUInt16LE(Constants.LOCFLG),
-                // compression method
-                method : data.readUInt16LE(Constants.LOCHOW),
-                // modification time (2 bytes time, 2 bytes date)
-                time : data.readUInt32LE(Constants.LOCTIM),
-                // uncompressed file crc-32 value
-                crc : data.readUInt32LE(Constants.LOCCRC),
-                // compressed size
-                compressedSize : data.readUInt32LE(Constants.LOCSIZ),
-                // uncompressed size
-                size : data.readUInt32LE(Constants.LOCLEN),
-                // filename length
-                fnameLen : data.readUInt16LE(Constants.LOCNAM),
-                // extra field length
-                extraLen : data.readUInt16LE(Constants.LOCEXT)
-            }
-        },
-
-        loadFromBinary : function(/*Buffer*/data) {
-            // data should be 46 bytes and start with "PK 01 02"
-            if (data.length != Constants.CENHDR || data.readUInt32LE(0) != Constants.CENSIG)
{
-                throw Utils.Errors.INVALID_CEN;
-            }
-            // version made by
-            _verMade = data.readUInt16LE(Constants.CENVEM);
-            // version needed to extract
-            _version = data.readUInt16LE(Constants.CENVER);
-            // encrypt, decrypt flags
-            _flags = data.readUInt16LE(Constants.CENFLG);
-            // compression method
-            _method = data.readUInt16LE(Constants.CENHOW);
-            // modification time (2 bytes time, 2 bytes date)
-            _time = data.readUInt32LE(Constants.CENTIM);
-            // uncompressed file crc-32 value
-            _crc = data.readUInt32LE(Constants.CENCRC);
-            // compressed size
-            _compressedSize = data.readUInt32LE(Constants.CENSIZ);
-            // uncompressed size
-            _size = data.readUInt32LE(Constants.CENLEN);
-            // filename length
-            _fnameLen = data.readUInt16LE(Constants.CENNAM);
-            // extra field length
-            _extraLen = data.readUInt16LE(Constants.CENEXT);
-            // file comment length
-            _comLen = data.readUInt16LE(Constants.CENCOM);
-            // volume number start
-            _diskStart = data.readUInt16LE(Constants.CENDSK);
-            // internal file attributes
-            _inattr = data.readUInt16LE(Constants.CENATT);
-            // external file attributes
-            _attr = data.readUInt32LE(Constants.CENATX);
-            // LOC header offset
-            _offset = data.readUInt32LE(Constants.CENOFF);
-        },
-
-        dataHeaderToBinary : function() {
-            // LOC header size (30 bytes)
-            var data = new Buffer(Constants.LOCHDR);
-            // "PK\003\004"
-            data.writeUInt32LE(Constants.LOCSIG, 0);
-            // version needed to extract
-            data.writeUInt16LE(_version, Constants.LOCVER);
-            // general purpose bit flag
-            data.writeUInt16LE(_flags, Constants.LOCFLG);
-            // compression method
-            data.writeUInt16LE(_method, Constants.LOCHOW);
-            // modification time (2 bytes time, 2 bytes date)
-            data.writeUInt32LE(_time, Constants.LOCTIM);
-            // uncompressed file crc-32 value
-            data.writeUInt32LE(_crc, Constants.LOCCRC);
-            // compressed size
-            data.writeUInt32LE(_compressedSize, Constants.LOCSIZ);
-            // uncompressed size
-            data.writeUInt32LE(_size, Constants.LOCLEN);
-            // filename length
-            data.writeUInt16LE(_fnameLen, Constants.LOCNAM);
-            // extra field length
-            data.writeUInt16LE(_extraLen, Constants.LOCEXT);
-            return data;
-        },
-
-        entryHeaderToBinary : function() {
-            // CEN header size (46 bytes)
-            var data = new Buffer(Constants.CENHDR + _fnameLen + _extraLen + _comLen);
-            // "PK\001\002"
-            data.writeUInt32LE(Constants.CENSIG, 0);
-            // version made by
-            data.writeUInt16LE(_verMade, Constants.CENVEM);
-            // version needed to extract
-            data.writeUInt16LE(_version, Constants.CENVER);
-            // encrypt, decrypt flags
-            data.writeUInt16LE(_flags, Constants.CENFLG);
-            // compression method
-            data.writeUInt16LE(_method, Constants.CENHOW);
-            // modification time (2 bytes time, 2 bytes date)
-            data.writeUInt32LE(_time, Constants.CENTIM);
-            // uncompressed file crc-32 value
-            data.writeInt32LE(_crc, Constants.CENCRC, true);
-            // compressed size
-            data.writeUInt32LE(_compressedSize, Constants.CENSIZ);
-            // uncompressed size
-            data.writeUInt32LE(_size, Constants.CENLEN);
-            // filename length
-            data.writeUInt16LE(_fnameLen, Constants.CENNAM);
-            // extra field length
-            data.writeUInt16LE(_extraLen, Constants.CENEXT);
-            // file comment length
-            data.writeUInt16LE(_comLen, Constants.CENCOM);
-            // volume number start
-            data.writeUInt16LE(_diskStart, Constants.CENDSK);
-            // internal file attributes
-            data.writeUInt16LE(_inattr, Constants.CENATT);
-            // external file attributes
-            data.writeUInt32LE(_attr, Constants.CENATX);
-            // LOC header offset
-            data.writeUInt32LE(_offset, Constants.CENOFF);
-            // fill all with
-            data.fill(0x00, Constants.CENHDR);
-            return data;
-        },
-
-        toString : function() {
-            return '{\n' +
-                '\t"made" : ' + _verMade + ",\n" +
-                '\t"version" : ' + _version + ",\n" +
-                '\t"flags" : ' + _flags + ",\n" +
-                '\t"method" : ' + Utils.methodToString(_method) + ",\n" +
-                '\t"time" : ' + _time + ",\n" +
-                '\t"crc" : 0x' + _crc.toString(16).toUpperCase() + ",\n" +
-                '\t"compressedSize" : ' + _compressedSize + " bytes,\n" +
-                '\t"size" : ' + _size + " bytes,\n" +
-                '\t"fileNameLength" : ' + _fnameLen + ",\n" +
-                '\t"extraLength" : ' + _extraLen + " bytes,\n" +
-                '\t"commentLength" : ' + _comLen + " bytes,\n" +
-                '\t"diskNumStart" : ' + _diskStart + ",\n" +
-                '\t"inAttr" : ' + _inattr + ",\n" +
-                '\t"attr" : ' + _attr + ",\n" +
-                '\t"offset" : ' + _offset + ",\n" +
-                '\t"entryHeaderSize" : ' + (Constants.CENHDR + _fnameLen + _extraLen + _comLen)
+ " bytes\n" +
-                '}';
-        }
-    }
-};

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/38ea4602/bin/templates/project/cordova/node_modules/adm-zip/headers/index.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/node_modules/adm-zip/headers/index.js b/bin/templates/project/cordova/node_modules/adm-zip/headers/index.js
deleted file mode 100644
index b54a722..0000000
--- a/bin/templates/project/cordova/node_modules/adm-zip/headers/index.js
+++ /dev/null
@@ -1,2 +0,0 @@
-exports.EntryHeader = require("./entryHeader");
-exports.MainHeader = require("./mainHeader");

http://git-wip-us.apache.org/repos/asf/cordova-firefoxos/blob/38ea4602/bin/templates/project/cordova/node_modules/adm-zip/headers/mainHeader.js
----------------------------------------------------------------------
diff --git a/bin/templates/project/cordova/node_modules/adm-zip/headers/mainHeader.js b/bin/templates/project/cordova/node_modules/adm-zip/headers/mainHeader.js
deleted file mode 100644
index de8ae1a..0000000
--- a/bin/templates/project/cordova/node_modules/adm-zip/headers/mainHeader.js
+++ /dev/null
@@ -1,80 +0,0 @@
-var Utils = require("../util"),
-    Constants = Utils.Constants;
-
-/* The entries in the end of central directory */
-module.exports = function () {
-    var _volumeEntries = 0,
-        _totalEntries = 0,
-        _size = 0,
-        _offset = 0,
-        _commentLength = 0;
-
-    return {
-        get diskEntries () { return _volumeEntries },
-        set diskEntries (/*Number*/val) { _volumeEntries = _totalEntries = val; },
-
-        get totalEntries () { return _totalEntries },
-        set totalEntries (/*Number*/val) { _totalEntries = _volumeEntries = val; },
-
-        get size () { return _size },
-        set size (/*Number*/val) { _size = val; },
-
-        get offset () { return _offset },
-        set offset (/*Number*/val) { _offset = val; },
-
-        get commentLength () { return _commentLength },
-        set commentLength (/*Number*/val) { _commentLength = val; },
-
-        get mainHeaderSize () {
-            return Constants.ENDHDR + _commentLength;
-        },
-
-        loadFromBinary : function(/*Buffer*/data) {
-            // data should be 22 bytes and start with "PK 05 06"
-            if (data.length != Constants.ENDHDR || data.readUInt32LE(0) != Constants.ENDSIG)
-                throw Utils.Errors.INVALID_END;
-
-            // number of entries on this volume
-            _volumeEntries = data.readUInt16LE(Constants.ENDSUB);
-            // total number of entries
-            _totalEntries = data.readUInt16LE(Constants.ENDTOT);
-            // central directory size in bytes
-            _size = data.readUInt32LE(Constants.ENDSIZ);
-            // offset of first CEN header
-            _offset = data.readUInt32LE(Constants.ENDOFF);
-            // zip file comment length
-            _commentLength = data.readUInt16LE(Constants.ENDCOM);
-        },
-
-        toBinary : function() {
-           var b = new Buffer(Constants.ENDHDR + _commentLength);
-            // "PK 05 06" signature
-            b.writeUInt32LE(Constants.ENDSIG, 0);
-            b.writeUInt32LE(0, 4);
-            // number of entries on this volume
-            b.writeUInt16LE(_volumeEntries, Constants.ENDSUB);
-            // total number of entries
-            b.writeUInt16LE(_totalEntries, Constants.ENDTOT);
-            // central directory size in bytes
-            b.writeUInt32LE(_size, Constants.ENDSIZ);
-            // offset of first CEN header
-            b.writeUInt32LE(_offset, Constants.ENDOFF);
-            // zip file comment length
-            b.writeUInt16LE(_commentLength, Constants.ENDCOM);
-            // fill comment memory with spaces so no garbage is left there
-            b.fill(" ", Constants.ENDHDR);
-
-            return b;
-        },
-
-        toString : function() {
-            return '{\n' +
-                '\t"diskEntries" : ' + _volumeEntries + ",\n" +
-                '\t"totalEntries" : ' + _totalEntries + ",\n" +
-                '\t"size" : ' + _size + " bytes,\n" +
-                '\t"offset" : 0x' + _offset.toString(16).toUpperCase() + ",\n" +
-                '\t"commentLength" : 0x' + _commentLength + "\n" +
-            '}';
-        }
-    }
-};
\ No newline at end of file


Mime
View raw message