Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
);
if (typeof opts.seeds === 'function') {
registry.register('config:initial-models', opts.seeds);
} else {
registry.register('config:initial-models', () => []);
}
if (process.env.PROFILE_MEMORY_SEC) {
setInterval(
() => writeSnapshot((err, filename) => log.info(`heap dump written to ${filename}`)),
process.env.PROFILE_MEMORY_SEC * 1000
);
}
let container = new Container(registry);
// in the test suite we want more deterministic control of when
// indexing happens
if (!opts.disableAutomaticIndexing) {
await container.lookup(`plugin-client:${require.resolve('@cardstack/pgsearch/client')}`).ensureDatabaseSetup();
startIndexing(opts.environment, container); // dont await boot-time indexing, invalidation logic has our back
}
// this registration pattern is how we make broccoli wait for our
// asynchronous startup stuff before running the first build.
if (opts.broccoliConnector) {
opts.broccoliConnector.setSource(container.lookup('hub:code-generators'));
}
return container;
}
module.exports = async function createPluginServices() {
let registry = new Registry();
registry.register('config:project', {
path: '/Users/aaron/dev/cardstack/packages/models',
allowDevDependencies: true
});
let container = new Container(registry);
let loader = container.lookup('hub:plugin-loader');
let pluginConfigs = loadSeedModels('/Users/aaron/dev/cardstack/packages/models/tests/dummy/cardstack/seeds/development').filter(model => model.type === 'plugin-configs');
let plugins = await loader.activePlugins(pluginConfigs);
let services = plugins.listAll('docker-services').map(s => plugins.lookupFeature('docker-services', s));
return Promise.all(services.map(function(service_config) {
return createService([
'--name', service_config.name,
service_config.image
], {stdio: 'inherit'});
}));