milkio 0.2.3 → 0.2.5

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.2.3",
5
+ "version": "0.2.5",
6
6
  "peerDependencies": {
7
7
  "typescript": "^5.4.2"
8
8
  },
@@ -1,5 +1,5 @@
1
1
  import ejs from "ejs";
2
- import { join } from "node:path";
2
+ import { join, dirname } from "node:path";
3
3
  import { existsSync, mkdirSync } from "node:fs";
4
4
  import { cwd, exit } from "node:process";
5
5
  import { unlink, writeFile } from "node:fs/promises";
@@ -49,8 +49,9 @@ export default async () => {
49
49
 
50
50
  console.time(`File Stage`);
51
51
 
52
- for (const path of appFiles) {
53
- if (!path.endsWith(".ts")) continue;
52
+ for (const pathRaw of appFiles) {
53
+ if (!pathRaw.endsWith(".ts")) continue;
54
+ const path = pathRaw.replaceAll("\\", "/");
54
55
  const module = await import(/* @vite-ignore */ join(cwd(), "src", "apps", path));
55
56
 
56
57
  if (module?.api?.isApi === true) {
@@ -98,6 +99,7 @@ export const randParams = async () => typia.random<ParamsT>();
98
99
  `.trim();
99
100
  // export const paramsSchema = typia.json.application<[{ data: ParamsT }], "swagger">();
100
101
 
102
+ if (!existsSync(dirname(filePath))) mkdirSync(dirname(filePath), { recursive: true });
101
103
  await writeFile(filePath, ejs.render(template, { ...templateVars, path }));
102
104
  }
103
105
  }