milkio 0.2.6 → 0.2.8

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.6",
5
+ "version": "0.2.8",
6
6
  "peerDependencies": {
7
7
  "typescript": "^5.4.2"
8
8
  },
@@ -18,6 +18,14 @@ export default async () => {
18
18
  existsSync(join("generated", "raw")) || mkdirSync(join("generated", "raw"));
19
19
  existsSync(join("generated", "raw", "apps")) || mkdirSync(join("generated", "raw", "apps"));
20
20
 
21
+ if (!existsSync(join(cwd(), "milkio.toml"))) return;
22
+ const milkioConfig = (await import(join(cwd(), "milkio.toml"))).default as MilkioConfig;
23
+
24
+ for (const key in milkioConfig.exists) {
25
+ const file = milkioConfig.exists[key];
26
+ if (!existsSync(join(cwd(), file.path))) await writeFile(join(cwd(), file.path), file.content ?? "");
27
+ }
28
+
21
29
  if (!existsSync(join("generated", "README.md"))) {
22
30
  await writeFile(join("generated", "README.md"), "⚠️ All files in this directory are generated by milkio. Please do not modify the content, otherwise your modifications will be overwritten in the next generation.");
23
31
  }
@@ -161,8 +169,6 @@ export default {
161
169
  console.timeEnd(`Typia Stage`);
162
170
  console.log(``);
163
171
 
164
- if (!existsSync(join(cwd(), "milkio.toml"))) return;
165
- const milkioConfig = (await import(join(cwd(), "milkio.toml"))).default as MilkioConfig;
166
172
  if (!milkioConfig?.generate?.significant) return;
167
173
  let i = 0;
168
174
  for (const command of milkioConfig.generate.significant) {
package/types.ts CHANGED
@@ -42,6 +42,7 @@ export type MilkioConfig = {
42
42
  significant?: Array<string>;
43
43
  insignificant?: Array<string>;
44
44
  };
45
+ exists?: Record<string, { path: string; content: string }>;
45
46
  menubar?: {
46
47
  commands?: Array<{ name?: string; script?: string; icon?: string }>;
47
48
  };