milkio 0.0.5 → 0.0.6
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.
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "milkio",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"module": "index.ts",
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.6",
|
|
6
6
|
"peerDependencies": {
|
|
7
7
|
"typescript": "^5.4.2"
|
|
8
8
|
},
|
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
"@poech/camel-hump-under": "^1.1.0",
|
|
11
11
|
"@southern-aurora/tson": "2.0.2",
|
|
12
12
|
"ulidx": "^2.3.0",
|
|
13
|
-
"walk-sync": "^3.0.0",
|
|
14
13
|
"typia": "5.5.5",
|
|
15
14
|
"ejs": "^3.1.9"
|
|
16
15
|
},
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
import ejs from "ejs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import walkSync from "walk-sync";
|
|
6
5
|
import { existsSync, mkdirSync } from "node:fs";
|
|
7
6
|
import { cwd, exit } from "node:process";
|
|
8
7
|
import { unlink, writeFile } from "node:fs/promises";
|
|
9
8
|
import { exec as nodeExec } from "node:child_process";
|
|
10
9
|
import { camel, hyphen } from "@poech/camel-hump-under";
|
|
10
|
+
import { Glob } from "bun";
|
|
11
11
|
|
|
12
12
|
const utils = {
|
|
13
13
|
camel: (str: string) => camel(str).replaceAll("-", "").replaceAll("_", ""),
|
|
@@ -41,9 +41,8 @@ export async function generateApp() {
|
|
|
41
41
|
apiTestPaths: [] as Array<string>
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
});
|
|
44
|
+
const glob = new Glob("**/*.ts");
|
|
45
|
+
const appFiles = await Array.fromAsync(glob.scan({ cwd: join(cwd(), "src", "apps") }));
|
|
47
46
|
|
|
48
47
|
for (const path of appFiles) {
|
|
49
48
|
if (!path.endsWith(".ts")) continue;
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
import ejs from "ejs";
|
|
4
4
|
import { join } from "node:path";
|
|
5
|
-
import walkSync from "walk-sync";
|
|
6
5
|
import { existsSync } from "node:fs";
|
|
7
6
|
import { cwd } from "node:process";
|
|
8
7
|
import { writeFile } from "node:fs/promises";
|
|
8
|
+
import { Glob } from "bun";
|
|
9
9
|
|
|
10
10
|
export async function generateDatabase() {
|
|
11
11
|
if (existsSync(join(cwd(), "src", "databases"))) {
|
|
@@ -13,9 +13,8 @@ export async function generateDatabase() {
|
|
|
13
13
|
await writeFile(join("generate", "database-schema.ts"), ``);
|
|
14
14
|
}
|
|
15
15
|
const filePath = join(cwd(), "generate", "database-schema.ts");
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
}).filter((file) => file.endsWith(".ts"));
|
|
16
|
+
const glob = new Glob("**/*.ts");
|
|
17
|
+
const databaseFiles = await Array.fromAsync(glob.scan({ cwd: join(cwd(), "src", "databases") }));
|
|
19
18
|
const template = `<% for (const path of ${"databaseFiles"}) { %>export * from '${"../src/databases"}/<%= path.slice(0, -3) %>'
|
|
20
19
|
<% } %>`;
|
|
21
20
|
await writeFile(filePath, ejs.render(template, { databaseFiles }));
|