-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
45 lines (42 loc) · 1.02 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
const fs = require('fs');
const path = require('path');
const handlers = require('./lib/handlers');
const methods = require('./lib/methods');
const apiRoutes = require('./lib/apiRoutes');
const formats = require('./lib/formats');
module.exports = {
bundle: {
directory: 'modules',
modules: getBundleModuleNames()
},
icons: {
'database-import-icon': 'DatabaseImport'
},
options: {
name: '@apostrophecms/import-export',
i18n: {
ns: 'aposImportExport',
browser: true
},
preventUpdateAssets: false,
importDraftsOnlyDefault: false
},
init(self) {
self.formats = {
...formats,
...self.options.formats || {}
};
self.enableBrowserData();
self.timeoutIds = {};
},
handlers,
methods,
apiRoutes
};
function getBundleModuleNames() {
const source = path.join(__dirname, './modules/@apostrophecms');
return fs
.readdirSync(source, { withFileTypes: true })
.filter(dirent => dirent.isDirectory())
.map(dirent => `@apostrophecms/${dirent.name}`);
}