kopia lustrzana https://github.com/c9/core
Revert "Revert "Fix various sdk issues""
rodzic
ef3fa6ccc9
commit
2ee3cbf307
|
@ -381,6 +381,7 @@ module.exports = function(options) {
|
||||||
"plugins/c9.ide.immediate/evaluator",
|
"plugins/c9.ide.immediate/evaluator",
|
||||||
"plugins/c9.ide.immediate/evaluators/browserjs",
|
"plugins/c9.ide.immediate/evaluators/browserjs",
|
||||||
"plugins/c9.ide.immediate/evaluators/debugnode",
|
"plugins/c9.ide.immediate/evaluators/debugnode",
|
||||||
|
"plugins/c9.ide.immediate/evaluators/bash",
|
||||||
"plugins/c9.ide.run.debug/variables",
|
"plugins/c9.ide.run.debug/variables",
|
||||||
"plugins/c9.ide.run.debug/watches",
|
"plugins/c9.ide.run.debug/watches",
|
||||||
"plugins/c9.ide.run.debug/liveinspect",
|
"plugins/c9.ide.run.debug/liveinspect",
|
||||||
|
|
|
@ -13,9 +13,11 @@ modules._resolveFilename = function(request, parent) {
|
||||||
// Ensure client extensions can be loaded
|
// Ensure client extensions can be loaded
|
||||||
request = request.replace(/^lib\//, "node_modules/");
|
request = request.replace(/^lib\//, "node_modules/");
|
||||||
// ensure we never use node_modules outside of root dir
|
// ensure we never use node_modules outside of root dir
|
||||||
parent.paths = parent.paths.filter(function(p) {
|
if (parent.paths[0] && parent.paths[0].indexOf(root) == 0) {
|
||||||
return p.indexOf(root) == 0
|
parent.paths = parent.paths.filter(function(p) {
|
||||||
});
|
return p.indexOf(root) == 0;
|
||||||
|
});
|
||||||
|
}
|
||||||
// Add the extra paths
|
// Add the extra paths
|
||||||
extraPaths.forEach(function(p) {
|
extraPaths.forEach(function(p) {
|
||||||
if (parent.paths.indexOf(p) === -1)
|
if (parent.paths.indexOf(p) === -1)
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
"c9.ide.ace.emmet": "#6dc4585e02",
|
"c9.ide.ace.emmet": "#6dc4585e02",
|
||||||
"c9.ide.ace.gotoline": "#a8ff07c8f4",
|
"c9.ide.ace.gotoline": "#a8ff07c8f4",
|
||||||
"c9.ide.ace.keymaps": "#bf6d36213f",
|
"c9.ide.ace.keymaps": "#bf6d36213f",
|
||||||
"c9.ide.ace.repl": "#ffa15f19d3",
|
"c9.ide.ace.repl": "#723e1d80a2",
|
||||||
"c9.ide.ace.split": "#0ae0151c78",
|
"c9.ide.ace.split": "#0ae0151c78",
|
||||||
"c9.ide.ace.statusbar": "#d95be89d53",
|
"c9.ide.ace.statusbar": "#d95be89d53",
|
||||||
"c9.ide.ace.stripws": "#cf0f42ac59",
|
"c9.ide.ace.stripws": "#cf0f42ac59",
|
||||||
|
@ -88,7 +88,7 @@
|
||||||
"c9.ide.format": "#b0bb91a623",
|
"c9.ide.format": "#b0bb91a623",
|
||||||
"c9.ide.help.support": "#e95f98f87c",
|
"c9.ide.help.support": "#e95f98f87c",
|
||||||
"c9.ide.imgeditor": "#66a9733dc1",
|
"c9.ide.imgeditor": "#66a9733dc1",
|
||||||
"c9.ide.immediate": "#afa636feb8",
|
"c9.ide.immediate": "#2f0e96fa2b",
|
||||||
"c9.ide.installer": "#be8d9aa07c",
|
"c9.ide.installer": "#be8d9aa07c",
|
||||||
"c9.ide.mount": "#292b312b4b",
|
"c9.ide.mount": "#292b312b4b",
|
||||||
"c9.ide.navigate": "#6e4efa5b25",
|
"c9.ide.navigate": "#6e4efa5b25",
|
||||||
|
|
|
@ -120,7 +120,6 @@ define(function(require, exports, module) {
|
||||||
|
|
||||||
async.map(stats, function(stat, done) {
|
async.map(stats, function(stat, done) {
|
||||||
// check for folder or symlink with folder target
|
// check for folder or symlink with folder target
|
||||||
|
|
||||||
if (stat.mime !== "inode/directory"
|
if (stat.mime !== "inode/directory"
|
||||||
&& (stat.mime === "inode/symlink" && stat.linkStat.mime !== "inode/directory")
|
&& (stat.mime === "inode/symlink" && stat.linkStat.mime !== "inode/directory")
|
||||||
) {
|
) {
|
||||||
|
@ -128,13 +127,11 @@ define(function(require, exports, module) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// check folers not prefixed with [._]
|
// check folers not prefixed with [._]
|
||||||
|
|
||||||
if (stat.name[0] === "." || stat.name[0] === "_") {
|
if (stat.name[0] === "." || stat.name[0] === "_") {
|
||||||
return done();
|
return done();
|
||||||
}
|
}
|
||||||
|
|
||||||
// check and load package.json
|
// check and load package.json
|
||||||
|
|
||||||
var config = {
|
var config = {
|
||||||
name: stat.name,
|
name: stat.name,
|
||||||
path: absolutePath([ dirPath, stat.name ].join("/")),
|
path: absolutePath([ dirPath, stat.name ].join("/")),
|
||||||
|
@ -216,17 +213,14 @@ define(function(require, exports, module) {
|
||||||
*/
|
*/
|
||||||
function loadPackage(config, callback) {
|
function loadPackage(config, callback) {
|
||||||
loadPackageInstalledJs(config, function(err, installed) {
|
loadPackageInstalledJs(config, function(err, installed) {
|
||||||
var plugins;
|
var plugins = installed;
|
||||||
|
|
||||||
if (err) {
|
if (err) {
|
||||||
plugins = _.map(config.metadata.plugins, function(value, key) {
|
plugins = _.map(config.metadata.plugins, function(value, key) {
|
||||||
return [ "plugins", config.name, key ].join("/");
|
return [ "plugins", config.name, key ].join("/");
|
||||||
});
|
});
|
||||||
} else {
|
|
||||||
plugins = installed;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var architectConfig = installed.map(function(plugin) {
|
var architectConfig = plugins.map(function(plugin) {
|
||||||
if (typeof plugin == "string")
|
if (typeof plugin == "string")
|
||||||
plugin = { packagePath: plugin };
|
plugin = { packagePath: plugin };
|
||||||
|
|
||||||
|
@ -256,36 +250,41 @@ define(function(require, exports, module) {
|
||||||
listAllPackages(function(err, resolved) {
|
listAllPackages(function(err, resolved) {
|
||||||
if (err) return console.error(err);
|
if (err) return console.error(err);
|
||||||
|
|
||||||
|
var extraPackages = {};
|
||||||
|
// convert old format from db to the new one
|
||||||
|
loaderConfig.forEach(function(p) {
|
||||||
|
if (!extraPackages[p.packageName]) {
|
||||||
|
var path = "plugins/" + p.packageName;
|
||||||
|
extraPackages[path] = {
|
||||||
|
apiKey: p.apiKey,
|
||||||
|
packagePath: path,
|
||||||
|
version: p.version,
|
||||||
|
name: p.packageName
|
||||||
|
};
|
||||||
|
}
|
||||||
|
});
|
||||||
if (!loadFromDisk) {
|
if (!loadFromDisk) {
|
||||||
// filter packages by config instead of loading
|
// filter packages by config instead of loading
|
||||||
// everything from disk
|
// everything from disk
|
||||||
|
|
||||||
resolved = resolved.filter(function(config) {
|
resolved = resolved.filter(function(config) {
|
||||||
var extraConfig = _.find(loaderConfig, { packagePath: config.packagePath });
|
if (extraPackages[config.packagePath])
|
||||||
|
return true;
|
||||||
if (!extraConfig) {
|
|
||||||
console.warn("[c9.ide.loader] Not loading package "
|
console.warn("[c9.ide.loader] Not loading package "
|
||||||
+ config.path + " because it is not installed, "
|
+ config.path + " because it is not installed, "
|
||||||
+ "according to the database");
|
+ "according to the database");
|
||||||
|
return false;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
config.apiKey = extraConfig.apiKey;
|
|
||||||
|
|
||||||
return true;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
resolved.filter(function(config) {
|
||||||
loaderConfig.forEach(function(extraConfig) {
|
if (extraPackages[config.packagePath])
|
||||||
// warn about missing packages which are supposed to be installed
|
delete extraPackages[config.packagePath];
|
||||||
|
});
|
||||||
if (!_.find(resolved, { packagePath: extraConfig.packagePath })) {
|
Object.keys(extraPackages).forEach(function(extraConfig) {
|
||||||
console.warn("[c9.ide.loader] Package "
|
console.warn("[c9.ide.loader] Package "
|
||||||
+ extraConfig.packagePath + " should be installed, according "
|
+ extraConfig.packagePath + " should be installed, according "
|
||||||
+ "to the database, but was not found on the filesystem. "
|
+ "to the database, but was not found on the filesystem. "
|
||||||
+ "Try reinstalling it.");
|
+ "Try reinstalling it.");
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
names = _.pluck(resolved, "name");
|
names = _.pluck(resolved, "name");
|
||||||
|
@ -307,7 +306,6 @@ define(function(require, exports, module) {
|
||||||
load();
|
load();
|
||||||
});
|
});
|
||||||
plugin.on("unload", function() {
|
plugin.on("unload", function() {
|
||||||
loaded = false;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
/***** Register and define API *****/
|
/***** Register and define API *****/
|
||||||
|
|
Ładowanie…
Reference in New Issue