@tachybase/database 1.2.15 → 1.2.16-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -31,9 +31,9 @@ __export(collection_importer_exports, {
|
|
|
31
31
|
ImporterReader: () => ImporterReader
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(collection_importer_exports);
|
|
34
|
-
var
|
|
35
|
-
var import_promises = require("fs/promises");
|
|
36
|
-
var
|
|
34
|
+
var import_node_fs = require("node:fs");
|
|
35
|
+
var import_promises = require("node:fs/promises");
|
|
36
|
+
var import_node_path = __toESM(require("node:path"));
|
|
37
37
|
var import_utils = require("@tachybase/utils");
|
|
38
38
|
var import_lodash = require("lodash");
|
|
39
39
|
const _ImporterReader = class _ImporterReader {
|
|
@@ -45,7 +45,7 @@ const _ImporterReader = class _ImporterReader {
|
|
|
45
45
|
this.extensions = new Set(extensions);
|
|
46
46
|
}
|
|
47
47
|
async read() {
|
|
48
|
-
if (!(0,
|
|
48
|
+
if (!(0, import_node_fs.existsSync)(this.directory)) {
|
|
49
49
|
return [];
|
|
50
50
|
}
|
|
51
51
|
const files = await (0, import_promises.readdir)(this.directory, {
|
|
@@ -55,10 +55,10 @@ const _ImporterReader = class _ImporterReader {
|
|
|
55
55
|
if (fileName.endsWith(".d.ts")) {
|
|
56
56
|
return false;
|
|
57
57
|
}
|
|
58
|
-
const ext =
|
|
58
|
+
const ext = import_node_path.default.parse(fileName).ext.replace(".", "");
|
|
59
59
|
return this.extensions.has(ext);
|
|
60
60
|
}).map(async (fileName) => {
|
|
61
|
-
const mod = await (0, import_utils.importModule)(
|
|
61
|
+
const mod = await (0, import_utils.importModule)(import_node_path.default.join(this.directory, fileName));
|
|
62
62
|
return typeof mod === "function" ? mod() : mod;
|
|
63
63
|
});
|
|
64
64
|
return (await Promise.all(modules)).filter((module2) => (0, import_lodash.isPlainObject)(module2)).map((module2) => (0, import_lodash.cloneDeep)(module2));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tachybase/database",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.16-alpha.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./lib/index.js",
|
|
@@ -26,8 +26,8 @@
|
|
|
26
26
|
"semver": "7.7.2",
|
|
27
27
|
"sequelize": "^6.37.5",
|
|
28
28
|
"umzug": "^3.8.2",
|
|
29
|
-
"@tachybase/logger": "1.2.
|
|
30
|
-
"@tachybase/utils": "1.2.
|
|
29
|
+
"@tachybase/logger": "1.2.16-alpha.0",
|
|
30
|
+
"@tachybase/utils": "1.2.16-alpha.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/flat": "^5.0.5",
|