@grouparoo/core
Version:
The Grouparoo Core
37 lines (36 loc) • 1.4 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT = void 0;
const path_1 = __importDefault(require("path"));
const pluginDetails_1 = require("../modules/pluginDetails");
const pluginInjection_1 = __importDefault(require("./pluginInjection"));
const namespace = "plugins";
const pluginManifestNamespace = "pluginManifest";
function getPluginPath(pluginName) {
return path_1.default.join(path_1.default.dirname(require.resolve(`${pluginName}/package.json`)), "..", pluginName);
}
const pluginManifest = (0, pluginDetails_1.getPluginManifest)();
const parentPlugins = {};
pluginManifest.plugins.map((p) => {
parentPlugins[p.name] = { path: p.path };
});
pluginManifest.missingPlugins.map((p) => {
console.error(`*** Could not find plugin named ${p} ***`);
});
exports.DEFAULT = {
[namespace]: () => {
const plugins = Object.assign({
"ah-sequelize-plugin": { path: getPluginPath("ah-sequelize-plugin") },
}, parentPlugins, pluginInjection_1.default);
return plugins;
},
pluginManifest: () => {
return {
url: process.env.GROUPAROO_PLUGIN_MANIFEST_URL ||
"https://www.grouparoo.com/plugins/v1/manifest.json",
};
},
};