diff --git a/.gitignore b/.gitignore index 919dfcaa2..d81492bf0 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,5 @@ legacy/project/all_objs legacy/project/obj .vscode/settings.json package-lock.json -node_modules \ No newline at end of file +node_modules +!templates/**/node_modules \ No newline at end of file diff --git a/templates/bin/node/watch/node_modules/exec-sh/LICENSE b/templates/bin/node/watch/node_modules/exec-sh/LICENSE new file mode 100644 index 000000000..78d2aba2b --- /dev/null +++ b/templates/bin/node/watch/node_modules/exec-sh/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 Aleksandr Tsertkov + +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. diff --git a/templates/bin/node/watch/node_modules/exec-sh/lib/exec-sh.js b/templates/bin/node/watch/node_modules/exec-sh/lib/exec-sh.js new file mode 100644 index 000000000..a9defaea0 --- /dev/null +++ b/templates/bin/node/watch/node_modules/exec-sh/lib/exec-sh.js @@ -0,0 +1,89 @@ +var + cp = require("child_process"), + merge = require("merge"); + +var + sh, cmd, + defSpawnOptions = { stdio: "inherit" }; + +/** + * @summary Get shell program meta for current platform + * @private + * @returns {Object} + */ +function getShell(){ + if (process.platform === "win32") { + return { cmd: "cmd", arg: "/C" }; + } else { + return { cmd: "sh", arg: "-c" }; + } +} + +/** + * Callback is called with the output when the process terminates. Output is + * available when true is passed as options argument or stdio: null set + * within given options. + * + * @summary Execute shell command forwarding all stdio + * @param {String|Array} command + * @param {Object|TRUE} [options] spawn() options or TRUE to set stdio: null + * @param {Function} [callback] + * @returns {ChildProcess} + */ +function execSh(command, options, callback){ + if (Array.isArray(command)) { + command = command.join(";"); + } + + if (options === true) { + options = { stdio: null }; + } + + if (typeof options === "function") { + callback = options; + options = defSpawnOptions; + } else { + options = options || {}; + options = merge(true, defSpawnOptions, options); + callback = callback || function(){}; + } + + var + child, + stdout = "", stderr = "", + shell = getShell(); + + try { + child = cp.spawn(shell.cmd, [shell.arg, command], options); + } catch (e) { + callback(e, stdout, stderr); + return; + } + + if (child.stdout) { + child.stdout.on("data", function(data){ + stdout += data; + }); + } + + if (child.stderr) { + child.stderr.on("data", function(data){ + stderr += data; + }); + } + + child.on("close", function(code){ + if (code) { + var e = new Error("Shell command exit with non zero code: " + code); + e.code = code; + callback(e, stdout, stderr); + } else { + callback(null, stdout, stderr); + } + }); + + return child; +} + +module.exports = execSh; + diff --git a/templates/bin/node/watch/node_modules/exec-sh/package.json b/templates/bin/node/watch/node_modules/exec-sh/package.json new file mode 100644 index 000000000..53940c93e --- /dev/null +++ b/templates/bin/node/watch/node_modules/exec-sh/package.json @@ -0,0 +1,74 @@ +{ + "_from": "exec-sh@^0.2.0", + "_id": "exec-sh@0.2.1", + "_inBundle": false, + "_integrity": "sha512-aLt95pexaugVtQerpmE51+4QfWrNc304uez7jvj6fWnN8GeEHpttB8F36n8N7uVhUMbH/1enbxQ9HImZ4w/9qg==", + "_location": "/exec-sh", + "_phantomChildren": {}, + "_requested": { + "type": "range", + "registry": true, + "raw": "exec-sh@^0.2.0", + "name": "exec-sh", + "escapedName": "exec-sh", + "rawSpec": "^0.2.0", + "saveSpec": null, + "fetchSpec": "^0.2.0" + }, + "_requiredBy": [ + "/watch" + ], + "_resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.1.tgz", + "_shasum": "163b98a6e89e6b65b47c2a28d215bc1f63989c38", + "_spec": "exec-sh@^0.2.0", + "_where": "C:\\Projects\\Personal\\SceneBuilderTest\\node_modules\\watch", + "author": { + "name": "Aleksandr Tsertkov", + "email": "tsertkov@gmail.com" + }, + "bugs": { + "url": "https://github.com/tsertkov/exec-sh/issues" + }, + "bundleDependencies": false, + "dependencies": { + "merge": "^1.1.3" + }, + "deprecated": false, + "description": "Execute shell command forwarding all stdio.", + "devDependencies": { + "coveralls": "^2.11.2", + "istanbul": "^0.3.2", + "jsdoc": "^3.3.0-alpha8", + "jshint": "^2.5.1", + "mocha": "^1.20.1", + "sinon": "^1.10.2" + }, + "homepage": "https://github.com/tsertkov/exec-sh#readme", + "keywords": [ + "exec", + "spawn", + "terminal", + "console", + "shell", + "command", + "child_process" + ], + "license": { + "type": "MIT", + "url": "https://github.com/tsertkov/exec-sh/blob/master/LICENSE" + }, + "main": "lib/exec-sh.js", + "name": "exec-sh", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/tsertkov/exec-sh.git" + }, + "scripts": { + "cover-test": "istanbul cover --dir artifacts/coverage _mocha -- --reporter spec", + "dev": "mocha --reporter spec --watch", + "jsdoc": "jsdoc --private --destination artifacts/jsdoc lib/", + "jshint": "jshint lib/ example/ test/ package.json", + "test": "npm run cover-test && npm run jshint" + }, + "version": "0.2.1" +} diff --git a/templates/bin/node/watch/node_modules/merge/LICENSE b/templates/bin/node/watch/node_modules/merge/LICENSE new file mode 100644 index 000000000..a0fdbba8e --- /dev/null +++ b/templates/bin/node/watch/node_modules/merge/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2014 yeikos - http://www.yeikos.com + +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 diff --git a/templates/bin/node/watch/node_modules/merge/bower.json b/templates/bin/node/watch/node_modules/merge/bower.json new file mode 100644 index 000000000..bd5de03e9 --- /dev/null +++ b/templates/bin/node/watch/node_modules/merge/bower.json @@ -0,0 +1,22 @@ +{ + "name": "merge", + "version": "1.2.0", + "homepage": "https://github.com/yeikos/js.merge", + "authors": [ + "yeikos " + ], + "description": "Merge multiple objects into one, optionally creating a new cloned object. Similar to the jQuery.extend but more flexible. Works in Node.js and the browser.", + "main": "merge.js", + "keywords": [ + "merge", + "recursive", + "extend", + "clone", + "object", + "browser" + ], + "license": "MIT", + "ignore": [ + "tests" + ] +} diff --git a/templates/bin/node/watch/node_modules/merge/merge.js b/templates/bin/node/watch/node_modules/merge/merge.js new file mode 100644 index 000000000..d856db6dd --- /dev/null +++ b/templates/bin/node/watch/node_modules/merge/merge.js @@ -0,0 +1,175 @@ +/*! + * @name JavaScript/NodeJS Merge v1.2.0 + * @author yeikos + * @repository https://github.com/yeikos/js.merge + + * Copyright 2014 yeikos - MIT license + * https://raw.github.com/yeikos/js.merge/master/LICENSE + */ + +;(function(isNode) { + + /** + * Merge one or more objects + * @param bool? clone + * @param mixed,... arguments + * @return object + */ + + var Public = function(clone) { + + return merge(clone === true, false, arguments); + + }, publicName = 'merge'; + + /** + * Merge two or more objects recursively + * @param bool? clone + * @param mixed,... arguments + * @return object + */ + + Public.recursive = function(clone) { + + return merge(clone === true, true, arguments); + + }; + + /** + * Clone the input removing any reference + * @param mixed input + * @return mixed + */ + + Public.clone = function(input) { + + var output = input, + type = typeOf(input), + index, size; + + if (type === 'array') { + + output = []; + size = input.length; + + for (index=0;index