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