diff --git a/node_modules/c9/git.js b/node_modules/c9/git.js index 307d5402..dcbf0328 100644 --- a/node_modules/c9/git.js +++ b/node_modules/c9/git.js @@ -1,16 +1,44 @@ "use strict"; -require("amd-loader"); - +var Url = require("url"); var Fs = require("fs"); var Path = require("path"); var exec = require("child_process").exec; -exports.parse = require("./git_url_parse"); exports.isValidUrl = function(url) { return !!exports.parse(url); }; +exports.parse = function(url) { + var m = url.match(/^(git)@([\w\.\d\-\_]+)(?:\/|:)([\w\.\d\-\_\/]+)/); + if (m) { + return { + protocol: "ssh:", + auth: m[1], + hostname: m[2], + pathname: m[3] + }; + } + + var parsed = Url.parse(url); + if ( + parsed && + parsed.protocol && + parsed.protocol.match(/^(git|http|https):$/) && + parsed.hostname && + parsed.slashes && + parsed.pathname + ) + return { + protocol: parsed.protocol, + auth: parsed.auth || "", + hostname: parsed.hostname, + pathname: parsed.pathname.replace(/^\/+/, ""), + full: url + }; + else + return null; +}; exports.getHeadRevision = function(path, callback) { exec("git rev-parse HEAD", { diff --git a/node_modules/c9/git_test.js b/node_modules/c9/git_test.js index 04234bfc..fae73a2b 100644 --- a/node_modules/c9/git_test.js +++ b/node_modules/c9/git_test.js @@ -62,7 +62,7 @@ module.exports = { assert.equal(rev.length, 40); next(); - }, + }, "test get head branch": function(next) { git.getHeadBranch(__dirname, function(err, rev) { diff --git a/node_modules/c9/git_url_parse.js b/node_modules/c9/git_url_parse.js deleted file mode 100644 index e701228a..00000000 --- a/node_modules/c9/git_url_parse.js +++ /dev/null @@ -1,36 +0,0 @@ -define(function(require, exports, module) { - "use strict"; - - var Url = require("url"); - - module.exports = function(url) { - var m = url.match(/^(git)@([\w\.\d\-\_]+)(?:\/|:)([\w\.\d\-\_\/]+)/); - if (m) { - return { - protocol: "ssh:", - auth: m[1], - hostname: m[2], - pathname: m[3] - }; - } - - var parsed = Url.parse(url); - if ( - parsed && - parsed.protocol && - parsed.protocol.match(/^(git|http|https):$/) && - parsed.hostname && - parsed.slashes && - parsed.pathname - ) - return { - protocol: parsed.protocol, - auth: parsed.auth || "", - hostname: parsed.hostname, - pathname: parsed.pathname.replace(/^\/+/, ""), - full: url - }; - else - return null; - }; -}); \ No newline at end of file diff --git a/node_modules/vfs-local/localfs.js b/node_modules/vfs-local/localfs.js index cfbd0aac..36d0f3aa 100644 --- a/node_modules/vfs-local/localfs.js +++ b/node_modules/vfs-local/localfs.js @@ -1157,7 +1157,6 @@ module.exports = function setup(fsOptions) { } try { - removeFromList(); fileWatchers[path] = fileWatchers[path] || []; fileWatchers[path].push(_self); @@ -1235,15 +1234,14 @@ module.exports = function setup(fsOptions) { } } - var handleWatchEvent = this.handleWatchEvent = function(event, filename, isVfsWrite) { + function handleWatchEvent(event, filename) { + console.log("watch event", event, filename, path); // it is a temp file if (filename && filename.substr(-1) == "~" && filename.charAt(0) == ".") return; createStatEntry(pathBasename(path), path, function(entry) { - entry.vfsWrite = isVfsWrite || false; - if (entry.err) { event = "delete"; close(); @@ -1294,7 +1292,7 @@ module.exports = function setup(fsOptions) { } var sendToAllListeners = this.sendToAllListeners = function(event, filename, entry, files) { - listeners.forEach(function(fn) { + listeners.forEach(function(fn){ fn(event, filename, entry, files); }); }; @@ -1370,11 +1368,7 @@ module.exports = function setup(fsOptions) { function writeToWatchedFile(path, callback) { if (!fileWatchers[path]) return callback(function(c) { c(); }); - var watchers = fileWatchers[path].slice(); - var parentDir = dirname(path) + "/"; - var dirWatchers = (fileWatchers[parentDir] || []).slice(); - watchers.forEach(function(w) { w.pause(); }); diff --git a/plugins/c9.ide.watcher/watcher.js b/plugins/c9.ide.watcher/watcher.js index 48207171..eb02680e 100644 --- a/plugins/c9.ide.watcher/watcher.js +++ b/plugins/c9.ide.watcher/watcher.js @@ -175,39 +175,33 @@ define(function(require, exports, module) { if (WAIT_FOR_SIGNAL) ignore(path, 200); // console.warn("[watchers] ignored event for", path, stat.vfsWrite ? "(was vfsWrite)" : "(was on ignore list)"); - - fireWatcherEvent(".all"); - } else { - fireWatcherEvent(""); - fireWatcherEvent(".all"); + return; } - function fireWatcherEvent(eventSuffix) { - if (event == "error") { - // console.error("[watchers] received error for", path, err, stat); - } - else if (event == "delete") { - fs.unwatch(path, handler); - delete handlers[path]; - // console.log("[watchers] received", event, "event for", path, stat); - emit("delete" + eventSuffix, { path : path }); - } - else if (event == "directory") { - emit("directory" + eventSuffix, { - path: path, - files: files, - stat: stat - }); - } - else { - // console.log("[watchers] received", event, "event for", path, stat); - emit("change" + eventSuffix, { - type: event, // change || rename - filename: filename, - path: path, - stat: stat - }); - } + if (event == "error") { + // console.error("[watchers] received error for", path, err, stat); + } + else if (event == "delete") { + fs.unwatch(path, handler); + delete handlers[path]; + // console.log("[watchers] received", event, "event for", path, stat); + emit("delete", { path : path }); + } + else if (event == "directory") { + emit("directory", { + path: path, + files: files, + stat: stat + }); + } + else { + // console.log("[watchers] received", event, "event for", path, stat); + emit("change", { + type: event, //change || rename + filename: filename, + path: path, + stat: stat + }); } }); } diff --git a/plugins/c9.static/build.js b/plugins/c9.static/build.js index e93d4662..b33a5db0 100644 --- a/plugins/c9.static/build.js +++ b/plugins/c9.static/build.js @@ -206,7 +206,12 @@ function main(options, imports, register) { function sharedModules() { return [ - "lib/architect/architect" + "lib/architect/architect", + "ace/mode/html", + "ace/mode/javascript", + "ace/mode/css", + "ace/mode/c9search", + "ace/multi_select" ]; } diff --git a/scripts/makestatic.js b/scripts/makestatic.js index d640ac78..5c40cd54 100755 --- a/scripts/makestatic.js +++ b/scripts/makestatic.js @@ -20,8 +20,6 @@ if (!module.parent) { .boolean("symlink") .describe("compress", "Compress output files") .boolean("compress") - .describe("react-style", "compile react less CSS") - .boolean("react-style") .describe("dest", "destination folder for the static files") .boolean("help") .describe("help", "Show command line options."); @@ -108,12 +106,6 @@ function main(config, settings, options, callback) { app.services.makestatic.getMounts(options.dest, callback); else if (options.symlink) app.services.makestatic.symlink(options.dest, callback); - else if (options["react-style"]) - app.services["react.style"].compile(function(err, code) { - if (err) return callback(err); - console.log(code); - callback(); - }); else app.services.makestatic.copy(options.dest, callback); });