@mmapp/react-compiler 0.1.0-alpha.15 → 0.1.0-alpha.17

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.
Files changed (185) hide show
  1. package/dist/{chunk-NUPJYPFU.mjs → chunk-6LAII7OP.mjs} +79 -1
  2. package/dist/{chunk-UBDNXVL2.mjs → chunk-FPAMQXKB.mjs} +89 -3
  3. package/dist/cli/index.js +240 -9
  4. package/dist/cli/index.mjs +57 -9
  5. package/dist/dev-server.js +79 -1
  6. package/dist/dev-server.mjs +1 -1
  7. package/dist/index.js +79 -1
  8. package/dist/index.mjs +1 -1
  9. package/dist/{init-2CRSUGV5.mjs → init-CJCDWI33.mjs} +119 -0
  10. package/package.json +2 -2
  11. package/dist/chunk-26U577GB.mjs +0 -3465
  12. package/dist/chunk-2FBDFAX6.mjs +0 -2362
  13. package/dist/chunk-2L4QSMXG.mjs +0 -175
  14. package/dist/chunk-2REDFOER.mjs +0 -931
  15. package/dist/chunk-3USIFFE4.mjs +0 -2190
  16. package/dist/chunk-45YMGEVT.mjs +0 -186
  17. package/dist/chunk-46YKSHQR.mjs +0 -175
  18. package/dist/chunk-4FN2AISW.mjs +0 -148
  19. package/dist/chunk-4OPI5L7G.mjs +0 -2593
  20. package/dist/chunk-4RYTKOOJ.mjs +0 -186
  21. package/dist/chunk-4XHK6FWL.mjs +0 -2058
  22. package/dist/chunk-52XHYD2V.mjs +0 -214
  23. package/dist/chunk-5FTDWKHH.mjs +0 -244
  24. package/dist/chunk-5GUFFFGL.mjs +0 -148
  25. package/dist/chunk-5RKTOVR5.mjs +0 -244
  26. package/dist/chunk-5VNJ7C6N.mjs +0 -154
  27. package/dist/chunk-5YDMOO4X.mjs +0 -214
  28. package/dist/chunk-64ZWEMLJ.mjs +0 -148
  29. package/dist/chunk-6CQOAAMV.mjs +0 -1803
  30. package/dist/chunk-6SEVAAVT.mjs +0 -3516
  31. package/dist/chunk-6XP4KSWQ.mjs +0 -2190
  32. package/dist/chunk-6YLR5ZDA.mjs +0 -2829
  33. package/dist/chunk-72QWL54I.mjs +0 -175
  34. package/dist/chunk-7B4TRI7C.mjs +0 -4835
  35. package/dist/chunk-7JRAEFRB.mjs +0 -7510
  36. package/dist/chunk-7ZKGHTNB.mjs +0 -4952
  37. package/dist/chunk-AOGY2GK6.mjs +0 -3292
  38. package/dist/chunk-AXXUXRNA.mjs +0 -1434
  39. package/dist/chunk-CHLVKMQW.mjs +0 -175
  40. package/dist/chunk-CKGOZAB7.mjs +0 -939
  41. package/dist/chunk-D34RAZUX.mjs +0 -2223
  42. package/dist/chunk-DE3ZGQAC.mjs +0 -148
  43. package/dist/chunk-DMCY3BBG.mjs +0 -1933
  44. package/dist/chunk-DPIK3PJS.mjs +0 -244
  45. package/dist/chunk-E5IVH4RE.mjs +0 -186
  46. package/dist/chunk-E6FZNUR5.mjs +0 -4953
  47. package/dist/chunk-EJRBDQDP.mjs +0 -2607
  48. package/dist/chunk-ELO4TXJL.mjs +0 -186
  49. package/dist/chunk-EO6SYNCG.mjs +0 -175
  50. package/dist/chunk-EQGA6A6D.mjs +0 -121
  51. package/dist/chunk-EY2CSXYA.mjs +0 -822
  52. package/dist/chunk-FIQ65CDR.mjs +0 -925
  53. package/dist/chunk-FKRO52XH.mjs +0 -3446
  54. package/dist/chunk-FL4YAKU6.mjs +0 -4941
  55. package/dist/chunk-FOZXJFAR.mjs +0 -186
  56. package/dist/chunk-FX6URXWN.mjs +0 -186
  57. package/dist/chunk-FYT47UBU.mjs +0 -5076
  58. package/dist/chunk-G7SMOWOL.mjs +0 -828
  59. package/dist/chunk-GCLGPOJZ.mjs +0 -148
  60. package/dist/chunk-GGB4G5YY.mjs +0 -175
  61. package/dist/chunk-GXB4JOP7.mjs +0 -5072
  62. package/dist/chunk-HFXOUMTD.mjs +0 -175
  63. package/dist/chunk-HLRGCCIL.mjs +0 -4839
  64. package/dist/chunk-HOIUP6IF.mjs +0 -690
  65. package/dist/chunk-HRYR54PT.mjs +0 -175
  66. package/dist/chunk-HWIZ47US.mjs +0 -214
  67. package/dist/chunk-I3AU7GRD.mjs +0 -120
  68. package/dist/chunk-IB7MNPQL.mjs +0 -4953
  69. package/dist/chunk-ICSIHQCG.mjs +0 -148
  70. package/dist/chunk-ILFGMUVD.mjs +0 -1933
  71. package/dist/chunk-IPTX5MJU.mjs +0 -3223
  72. package/dist/chunk-ITGUSH2Z.mjs +0 -2783
  73. package/dist/chunk-IXHBCAMF.mjs +0 -3306
  74. package/dist/chunk-J7JUAHS4.mjs +0 -186
  75. package/dist/chunk-J7TWJ3TM.mjs +0 -2784
  76. package/dist/chunk-JDPLDGVF.mjs +0 -4810
  77. package/dist/chunk-JLA5VNQ3.mjs +0 -186
  78. package/dist/chunk-JQLWFCTM.mjs +0 -214
  79. package/dist/chunk-K53XP2DL.mjs +0 -148
  80. package/dist/chunk-K5HX2SVL.mjs +0 -1902
  81. package/dist/chunk-KFGYOOVS.mjs +0 -214
  82. package/dist/chunk-KFJJCQAL.mjs +0 -148
  83. package/dist/chunk-KFVVOS5N.mjs +0 -925
  84. package/dist/chunk-KJUIIEQE.mjs +0 -186
  85. package/dist/chunk-KNWTHRVQ.mjs +0 -175
  86. package/dist/chunk-KSG4XSZF.mjs +0 -175
  87. package/dist/chunk-L2OZ4CDV.mjs +0 -113
  88. package/dist/chunk-LF5N6DOU.mjs +0 -175
  89. package/dist/chunk-LJQCM2IM.mjs +0 -214
  90. package/dist/chunk-MIZV3TAN.mjs +0 -3293
  91. package/dist/chunk-NKKLQE5V.mjs +0 -148
  92. package/dist/chunk-NOW23XFZ.mjs +0 -186
  93. package/dist/chunk-NRXQKQ74.mjs +0 -148
  94. package/dist/chunk-NTB7OEX2.mjs +0 -2918
  95. package/dist/chunk-NW6555WJ.mjs +0 -186
  96. package/dist/chunk-O4AUS7EU.mjs +0 -148
  97. package/dist/chunk-OMZE6VLQ.mjs +0 -214
  98. package/dist/chunk-OPJKP747.mjs +0 -7506
  99. package/dist/chunk-OWI6XWCD.mjs +0 -3375
  100. package/dist/chunk-P4BR7WVO.mjs +0 -2190
  101. package/dist/chunk-PRUMNNDI.mjs +0 -3192
  102. package/dist/chunk-QQHVYH2X.mjs +0 -244
  103. package/dist/chunk-QTBD5B3F.mjs +0 -148
  104. package/dist/chunk-R57T26RR.mjs +0 -734
  105. package/dist/chunk-S5QLWLLT.mjs +0 -186
  106. package/dist/chunk-SCWGT2FY.mjs +0 -2190
  107. package/dist/chunk-SKSDPPNT.mjs +0 -3788
  108. package/dist/chunk-SMKJUSB3.mjs +0 -2190
  109. package/dist/chunk-SP2YUS33.mjs +0 -186
  110. package/dist/chunk-SU4E6E7B.mjs +0 -3153
  111. package/dist/chunk-SYUUKW5A.mjs +0 -3379
  112. package/dist/chunk-THFYE5ZX.mjs +0 -244
  113. package/dist/chunk-UDDTWG5J.mjs +0 -734
  114. package/dist/chunk-UL2XZEMA.mjs +0 -3128
  115. package/dist/chunk-VCAY2KGM.mjs +0 -175
  116. package/dist/chunk-VLTKQDJ3.mjs +0 -244
  117. package/dist/chunk-WBYMW4NQ.mjs +0 -3450
  118. package/dist/chunk-WECAV6QB.mjs +0 -148
  119. package/dist/chunk-WMKBXUCE.mjs +0 -3228
  120. package/dist/chunk-XAJ5BKKL.mjs +0 -4947
  121. package/dist/chunk-XG2X7AEA.mjs +0 -175
  122. package/dist/chunk-XG7Z23NQ.mjs +0 -148
  123. package/dist/chunk-XMWUHQVV.mjs +0 -939
  124. package/dist/chunk-XWZAOCQ7.mjs +0 -2607
  125. package/dist/chunk-XZNEDRGN.mjs +0 -3876
  126. package/dist/chunk-Y6FXYEAI.mjs +0 -10
  127. package/dist/chunk-Y6MA7ULW.mjs +0 -148
  128. package/dist/chunk-YFS6JMYO.mjs +0 -3342
  129. package/dist/chunk-YMS7Q7LG.mjs +0 -214
  130. package/dist/chunk-Z2G5RZ4H.mjs +0 -186
  131. package/dist/chunk-Z6AIQ4KL.mjs +0 -113
  132. package/dist/chunk-ZA37XTGA.mjs +0 -175
  133. package/dist/chunk-ZE3KCHBM.mjs +0 -2918
  134. package/dist/config-PL24KEWL.mjs +0 -219
  135. package/dist/dev-server-Bs_sz2DG.d.mts +0 -111
  136. package/dist/dev-server-Bs_sz2DG.d.ts +0 -111
  137. package/dist/dev-server-CjoufJ-u.d.mts +0 -109
  138. package/dist/dev-server-CjoufJ-u.d.ts +0 -109
  139. package/dist/dev-server-RmGHIntF.d.mts +0 -113
  140. package/dist/dev-server-RmGHIntF.d.ts +0 -113
  141. package/dist/engine-binary-QQUDACBJ.mjs +0 -455
  142. package/dist/envelope-DD7v0v6E.d.mts +0 -265
  143. package/dist/envelope-DD7v0v6E.d.ts +0 -265
  144. package/dist/envelope-vCVjrHlo.d.mts +0 -265
  145. package/dist/envelope-vCVjrHlo.d.ts +0 -265
  146. package/dist/index-B5gSgvnd.d.mts +0 -44
  147. package/dist/index-B5gSgvnd.d.ts +0 -44
  148. package/dist/index-Bs0MnR54.d.mts +0 -103
  149. package/dist/index-Bs0MnR54.d.ts +0 -103
  150. package/dist/index-DR0nNc_f.d.mts +0 -101
  151. package/dist/index-DR0nNc_f.d.ts +0 -101
  152. package/dist/index-revho_gS.d.mts +0 -104
  153. package/dist/index-revho_gS.d.ts +0 -104
  154. package/dist/init-7FJENUDK.mjs +0 -407
  155. package/dist/init-7JQMAAXS.mjs +0 -363
  156. package/dist/init-DQDX3QK6.mjs +0 -369
  157. package/dist/init-EHO4VQ22.mjs +0 -369
  158. package/dist/init-IXEE2RCF.mjs +0 -340
  159. package/dist/init-UC3FWPIW.mjs +0 -367
  160. package/dist/init-UNSMVKIK.mjs +0 -366
  161. package/dist/init-UNV5XIDE.mjs +0 -367
  162. package/dist/project-compiler-2P4N4DR7.mjs +0 -10
  163. package/dist/project-compiler-D2LCC27O.mjs +0 -10
  164. package/dist/project-compiler-EGJUTAJU.mjs +0 -10
  165. package/dist/project-compiler-EJ3GANJE.mjs +0 -10
  166. package/dist/project-compiler-LOQKVRZJ.mjs +0 -10
  167. package/dist/project-compiler-NNK32MPG.mjs +0 -10
  168. package/dist/project-compiler-OP2VVGJQ.mjs +0 -10
  169. package/dist/project-compiler-RQ6OQKRM.mjs +0 -10
  170. package/dist/project-compiler-VFR6CSDX.mjs +0 -10
  171. package/dist/project-compiler-VWNNCHGO.mjs +0 -10
  172. package/dist/project-compiler-XVAAU4C5.mjs +0 -10
  173. package/dist/project-compiler-YES5FGMD.mjs +0 -10
  174. package/dist/project-compiler-ZKMQDLGU.mjs +0 -10
  175. package/dist/project-decompiler-5GY2KSG4.mjs +0 -7
  176. package/dist/project-decompiler-FLXCEJHS.mjs +0 -7
  177. package/dist/project-decompiler-US7GAVIC.mjs +0 -7
  178. package/dist/project-decompiler-VLPR22QF.mjs +0 -7
  179. package/dist/pull-A2QUHW4K.mjs +0 -109
  180. package/dist/pull-FUS5QYZS.mjs +0 -109
  181. package/dist/pull-JBEQWVPE.mjs +0 -109
  182. package/dist/pull-LD5ENLGY.mjs +0 -109
  183. package/dist/pull-P44LDRWB.mjs +0 -109
  184. package/dist/verify-BYHUKARQ.mjs +0 -1833
  185. package/dist/verify-SEIXUGN4.mjs +0 -1833
@@ -1,366 +0,0 @@
1
- import "./chunk-Y6FXYEAI.mjs";
2
-
3
- // src/cli/init.ts
4
- import { mkdirSync, writeFileSync, existsSync } from "fs";
5
- import { join } from "path";
6
- function toTitleCase(slug) {
7
- return slug.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join(" ");
8
- }
9
- function toPascalCase(slug) {
10
- return slug.split("-").map((w) => w.charAt(0).toUpperCase() + w.slice(1)).join("");
11
- }
12
- function generatePackageJson(name) {
13
- return JSON.stringify(
14
- {
15
- name: `@mindmatrix/blueprint-${name}`,
16
- version: "0.1.0",
17
- private: true,
18
- type: "module",
19
- scripts: {
20
- build: "mmrc build --src . --out dist",
21
- dev: "mmrc dev --src . --port 5199",
22
- deploy: "mmrc deploy --build --src ."
23
- },
24
- dependencies: {
25
- "@mmapp/react": "^0.1.0-alpha.1"
26
- },
27
- devDependencies: {
28
- typescript: "^5.5.0"
29
- }
30
- },
31
- null,
32
- 2
33
- );
34
- }
35
- function generateMmConfig(name, opts) {
36
- const title = toTitleCase(name);
37
- const desc = opts.description ?? `${title} blueprint.`;
38
- const icon = opts.icon ?? "box";
39
- const author = opts.author ?? "MindMatrix";
40
- return `import { defineBlueprint } from '@mmapp/react';
41
-
42
- export default defineBlueprint({
43
- slug: '${name}',
44
- name: '${title}',
45
- version: '1.0.0',
46
- description: '${desc}',
47
- author: '${author}',
48
- icon: '${icon}',
49
- mode: 'infer',
50
- defaultRuntime: 'collaborative',
51
-
52
- models: [
53
- 'models/item',
54
- ],
55
-
56
- routes: [
57
- { path: '/', view: 'app/page', label: 'Home' },
58
- ],
59
-
60
- dependencies: [],
61
- });
62
- `;
63
- }
64
- function generateModel(name) {
65
- const modelSlug = `${name}-item`;
66
- const pascal = toPascalCase(name);
67
- return `/**
68
- * ${pascal} Item \u2014 data model with lifecycle states.
69
- *
70
- * States: draft \u2192 active \u2192 archived
71
- */
72
-
73
- import { defineModel } from '@mmapp/react';
74
-
75
- export interface ${pascal}ItemFields {
76
- title: string;
77
- description: string;
78
- priority: 'low' | 'medium' | 'high';
79
- createdAt: number;
80
- }
81
-
82
- export default defineModel({
83
- slug: '${modelSlug}',
84
- version: '1.0.0',
85
- category: ['model', '${name}'],
86
-
87
- fields: {
88
- title: { type: 'string', required: true },
89
- description: { type: 'string', default: '' },
90
- priority: { type: 'string', default: 'medium', enum: ['low', 'medium', 'high'] },
91
- createdAt: { type: 'number', default: 0 },
92
- },
93
-
94
- states: {
95
- draft: {
96
- type: 'initial',
97
- onEnter: [
98
- { id: 'set-created', type: 'set_field', mode: 'auto', config: { field: 'createdAt', expression: 'NOW()' } },
99
- ],
100
- },
101
- active: {
102
- onEnter: [
103
- { id: 'log-activated', type: 'log_event', mode: 'auto', config: { event: '${modelSlug}.activated' } },
104
- ],
105
- },
106
- archived: {
107
- type: 'end',
108
- },
109
- },
110
-
111
- transitions: {
112
- activate: {
113
- from: 'draft',
114
- to: 'active',
115
- description: 'Publish this item',
116
- },
117
- archive: {
118
- from: 'active',
119
- to: 'archived',
120
- description: 'Archive this item',
121
- },
122
- },
123
- });
124
- `;
125
- }
126
- function generateTsconfig() {
127
- return JSON.stringify(
128
- {
129
- compilerOptions: {
130
- target: "ES2020",
131
- module: "ESNext",
132
- moduleResolution: "bundler",
133
- jsx: "react-jsx",
134
- strict: true,
135
- esModuleInterop: true,
136
- skipLibCheck: true,
137
- forceConsistentCasingInFileNames: true,
138
- declaration: false,
139
- noEmit: true
140
- },
141
- include: ["**/*.ts", "**/*.tsx"],
142
- exclude: ["node_modules", "dist"]
143
- },
144
- null,
145
- 2
146
- );
147
- }
148
- function generateLayout(name) {
149
- const title = toTitleCase(name);
150
- return `/**
151
- * @workflow slug="${name}-layout" version="1.0.0" category="view"
152
- *
153
- * Root layout with sidebar navigation.
154
- */
155
-
156
- import {
157
- Row,
158
- Stack,
159
- Slot,
160
- Text,
161
- Icon,
162
- Button,
163
- Divider,
164
- } from '@mmapp/react/atoms';
165
- import { useRouter } from '@mmapp/react';
166
-
167
- export default function Layout({ children }: { children: React.ReactNode }) {
168
- const router = useRouter();
169
-
170
- return (
171
- <Row gap={0} height="100vh" overflow="hidden">
172
- {/* Sidebar */}
173
- <Stack
174
- width={240}
175
- borderRight="1px solid token:border"
176
- height="100vh"
177
- background="token:surface"
178
- >
179
- <Row padding={12} gap={8} align="center" borderBottom="1px solid token:border">
180
- <Icon name="box" size={20} color="token:primary" />
181
- <Text variant="label" size="sm" value="${title}" />
182
- </Row>
183
-
184
- <Stack padding={8} gap={4}>
185
- <Button variant="ghost" onPress={() => router.push('/')}>
186
- <Row gap={8} align="center">
187
- <Icon name="home" size={16} />
188
- <Text size="sm" value="Home" />
189
- </Row>
190
- </Button>
191
- <Button variant="ghost" onPress={() => router.push('/settings')}>
192
- <Row gap={8} align="center">
193
- <Icon name="settings" size={16} />
194
- <Text size="sm" value="Settings" />
195
- </Row>
196
- </Button>
197
- </Stack>
198
-
199
- <Divider />
200
- <Stack flex={1} />
201
- <Row padding={12}>
202
- <Text variant="muted" size="xs" value="v1.0.0" />
203
- </Row>
204
- </Stack>
205
-
206
- {/* Main content */}
207
- <Stack flex={1} overflow="auto">
208
- {children}
209
- </Stack>
210
- </Row>
211
- );
212
- }
213
- `;
214
- }
215
- function generatePage(name) {
216
- const title = toTitleCase(name);
217
- const pascal = toPascalCase(name);
218
- return `/**
219
- * @workflow slug="${name}-home" version="1.0.0" category="page"
220
- *
221
- * Index page \u2014 lists items with create and search.
222
- */
223
-
224
- import itemModel from '../models/item';
225
- import {
226
- useQuery, useMutation, useRouter, useState,
227
- Stack, Row, Text, Button, Icon, Card, Show, Each, TextInput, Badge,
228
- } from '@mmapp/react';
229
-
230
- const PRIORITY_COLORS: Record<string, string> = {
231
- high: 'token:error',
232
- medium: 'token:warning',
233
- low: 'token:success',
234
- };
235
-
236
- export default function ${pascal}Home() {
237
- const { data: items, loading } = useQuery(itemModel);
238
- const mutation = useMutation(itemModel);
239
- const router = useRouter();
240
- const [search, setSearch] = useState('');
241
-
242
- const activeItems = items.filter(i => i.state !== 'archived');
243
- const filtered = activeItems.filter(i =>
244
- i.fields.title.toLowerCase().includes(search.toLowerCase())
245
- );
246
-
247
- const handleCreate = async () => {
248
- await mutation.create({ title: 'New Item', priority: 'medium' });
249
- };
250
-
251
- return (
252
- <Stack gap={24} padding={24}>
253
- {/* Header */}
254
- <Row justify="space-between" align="center">
255
- <Stack gap={4}>
256
- <Text variant="h3" weight="bold" value="${title}" />
257
- <Text variant="muted" size="sm" value={\`\${activeItems.length} items\`} />
258
- </Stack>
259
- <Button variant="primary" onPress={handleCreate}>
260
- <Row gap={6} align="center">
261
- <Icon name="plus" size={16} />
262
- <Text value="Add Item" />
263
- </Row>
264
- </Button>
265
- </Row>
266
-
267
- {/* Search */}
268
- <TextInput
269
- value={search}
270
- onChange={setSearch}
271
- placeholder="Search items..."
272
- />
273
-
274
- {/* Loading */}
275
- <Show when={loading}>
276
- <Card padding={32}>
277
- <Stack align="center">
278
- <Text variant="muted" value="Loading..." />
279
- </Stack>
280
- </Card>
281
- </Show>
282
-
283
- {/* Empty state */}
284
- <Show when={!loading && filtered.length === 0}>
285
- <Card padding={32}>
286
- <Stack align="center" gap={12}>
287
- <Icon name="inbox" size={40} color="token:muted" />
288
- <Text variant="muted" value="No items yet" />
289
- <Button variant="outline" onPress={handleCreate}>
290
- <Text value="Create your first item" />
291
- </Button>
292
- </Stack>
293
- </Card>
294
- </Show>
295
-
296
- {/* Item list */}
297
- <Show when={!loading && filtered.length > 0}>
298
- <Stack gap={4}>
299
- <Each items={filtered} keyField="id">
300
- {(item) => (
301
- <Card padding={12}>
302
- <Row align="center" gap={12}>
303
- <Stack flex={1} gap={2}>
304
- <Text weight="medium" value={item.fields.title} />
305
- <Show when={!!item.fields.description}>
306
- <Text size="sm" variant="muted" value={item.fields.description} />
307
- </Show>
308
- </Stack>
309
- <Badge value={item.fields.priority} />
310
- <Badge value={item.state} variant={item.state === 'active' ? 'success' : 'default'} />
311
- </Row>
312
- </Card>
313
- )}
314
- </Each>
315
- </Stack>
316
- </Show>
317
- </Stack>
318
- );
319
- }
320
- `;
321
- }
322
- async function init(options) {
323
- const { name } = options;
324
- if (!/^[a-z][a-z0-9-]*$/.test(name)) {
325
- console.error(`[mmrc] Error: Blueprint name must be lowercase alphanumeric with hyphens (got "${name}")`);
326
- process.exit(1);
327
- }
328
- const cwd = process.cwd();
329
- const packagesDir = existsSync(join(cwd, "packages")) ? join(cwd, "packages") : cwd;
330
- const blueprintDir = join(packagesDir, `blueprint-${name}`);
331
- if (existsSync(blueprintDir)) {
332
- console.error(`[mmrc] Error: Directory already exists: ${blueprintDir}`);
333
- process.exit(1);
334
- }
335
- console.log(`[mmrc] Creating blueprint: ${name}
336
- `);
337
- mkdirSync(join(blueprintDir, "models"), { recursive: true });
338
- mkdirSync(join(blueprintDir, "app"), { recursive: true });
339
- const files = [
340
- ["package.json", generatePackageJson(name)],
341
- ["tsconfig.json", generateTsconfig()],
342
- ["mm.config.ts", generateMmConfig(name, options)],
343
- ["models/item.ts", generateModel(name)],
344
- ["app/layout.tsx", generateLayout(name)],
345
- ["app/page.tsx", generatePage(name)]
346
- ];
347
- for (const [relPath, content] of files) {
348
- const fullPath = join(blueprintDir, relPath);
349
- writeFileSync(fullPath, content, "utf-8");
350
- console.log(` + ${relPath}`);
351
- }
352
- const title = toTitleCase(name);
353
- console.log(`
354
- [mmrc] Blueprint "${title}" created at:
355
- ${blueprintDir}
356
-
357
- Next steps:
358
- 1. cd ${blueprintDir.startsWith(cwd) ? blueprintDir.slice(cwd.length + 1) : blueprintDir}
359
- 2. mmrc dev # Start dev server
360
- 3. mmrc build # Compile to IR
361
- 4. mmrc deploy --build # Build + deploy to backend
362
- `);
363
- }
364
- export {
365
- init
366
- };