@mmapp/react-compiler 0.1.0-alpha.16 → 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.
- package/dist/{chunk-NUPJYPFU.mjs → chunk-6LAII7OP.mjs} +79 -1
- package/dist/{chunk-GVCJJX7E.mjs → chunk-FPAMQXKB.mjs} +14 -18
- package/dist/cli/index.js +175 -35
- package/dist/cli/index.mjs +55 -8
- package/dist/dev-server.js +16 -28
- package/dist/dev-server.mjs +1 -1
- package/dist/index.js +16 -28
- package/dist/index.mjs +1 -1
- package/dist/{init-2CRSUGV5.mjs → init-CJCDWI33.mjs} +119 -0
- package/package.json +2 -2
- package/dist/chunk-26U577GB.mjs +0 -3465
- package/dist/chunk-2FBDFAX6.mjs +0 -2362
- package/dist/chunk-2L4QSMXG.mjs +0 -175
- package/dist/chunk-2REDFOER.mjs +0 -931
- package/dist/chunk-3USIFFE4.mjs +0 -2190
- package/dist/chunk-45YMGEVT.mjs +0 -186
- package/dist/chunk-46YKSHQR.mjs +0 -175
- package/dist/chunk-4FN2AISW.mjs +0 -148
- package/dist/chunk-4OPI5L7G.mjs +0 -2593
- package/dist/chunk-4RYTKOOJ.mjs +0 -186
- package/dist/chunk-4XHK6FWL.mjs +0 -2058
- package/dist/chunk-52XHYD2V.mjs +0 -214
- package/dist/chunk-5FTDWKHH.mjs +0 -244
- package/dist/chunk-5GUFFFGL.mjs +0 -148
- package/dist/chunk-5RKTOVR5.mjs +0 -244
- package/dist/chunk-5VNJ7C6N.mjs +0 -154
- package/dist/chunk-5YDMOO4X.mjs +0 -214
- package/dist/chunk-64ZWEMLJ.mjs +0 -148
- package/dist/chunk-6CQOAAMV.mjs +0 -1803
- package/dist/chunk-6SEVAAVT.mjs +0 -3516
- package/dist/chunk-6XP4KSWQ.mjs +0 -2190
- package/dist/chunk-6YLR5ZDA.mjs +0 -2829
- package/dist/chunk-72QWL54I.mjs +0 -175
- package/dist/chunk-7B4TRI7C.mjs +0 -4835
- package/dist/chunk-7JRAEFRB.mjs +0 -7510
- package/dist/chunk-7ZKGHTNB.mjs +0 -4952
- package/dist/chunk-AOGY2GK6.mjs +0 -3292
- package/dist/chunk-AXXUXRNA.mjs +0 -1434
- package/dist/chunk-CHLVKMQW.mjs +0 -175
- package/dist/chunk-CKGOZAB7.mjs +0 -939
- package/dist/chunk-D34RAZUX.mjs +0 -2223
- package/dist/chunk-DE3ZGQAC.mjs +0 -148
- package/dist/chunk-DMCY3BBG.mjs +0 -1933
- package/dist/chunk-DPIK3PJS.mjs +0 -244
- package/dist/chunk-E5IVH4RE.mjs +0 -186
- package/dist/chunk-E6FZNUR5.mjs +0 -4953
- package/dist/chunk-EJRBDQDP.mjs +0 -2607
- package/dist/chunk-ELO4TXJL.mjs +0 -186
- package/dist/chunk-EO6SYNCG.mjs +0 -175
- package/dist/chunk-EQGA6A6D.mjs +0 -121
- package/dist/chunk-EY2CSXYA.mjs +0 -822
- package/dist/chunk-FIQ65CDR.mjs +0 -925
- package/dist/chunk-FKRO52XH.mjs +0 -3446
- package/dist/chunk-FL4YAKU6.mjs +0 -4941
- package/dist/chunk-FOZXJFAR.mjs +0 -186
- package/dist/chunk-FX6URXWN.mjs +0 -186
- package/dist/chunk-FYT47UBU.mjs +0 -5076
- package/dist/chunk-G7SMOWOL.mjs +0 -828
- package/dist/chunk-GCLGPOJZ.mjs +0 -148
- package/dist/chunk-GGB4G5YY.mjs +0 -175
- package/dist/chunk-GXB4JOP7.mjs +0 -5072
- package/dist/chunk-HFXOUMTD.mjs +0 -175
- package/dist/chunk-HLRGCCIL.mjs +0 -4839
- package/dist/chunk-HOIUP6IF.mjs +0 -690
- package/dist/chunk-HRYR54PT.mjs +0 -175
- package/dist/chunk-HWIZ47US.mjs +0 -214
- package/dist/chunk-I3AU7GRD.mjs +0 -120
- package/dist/chunk-IB7MNPQL.mjs +0 -4953
- package/dist/chunk-ICSIHQCG.mjs +0 -148
- package/dist/chunk-ILFGMUVD.mjs +0 -1933
- package/dist/chunk-IPTX5MJU.mjs +0 -3223
- package/dist/chunk-ITGUSH2Z.mjs +0 -2783
- package/dist/chunk-IXHBCAMF.mjs +0 -3306
- package/dist/chunk-J7JUAHS4.mjs +0 -186
- package/dist/chunk-J7TWJ3TM.mjs +0 -2784
- package/dist/chunk-JDPLDGVF.mjs +0 -4810
- package/dist/chunk-JLA5VNQ3.mjs +0 -186
- package/dist/chunk-JQLWFCTM.mjs +0 -214
- package/dist/chunk-K53XP2DL.mjs +0 -148
- package/dist/chunk-K5HX2SVL.mjs +0 -1902
- package/dist/chunk-KFGYOOVS.mjs +0 -214
- package/dist/chunk-KFJJCQAL.mjs +0 -148
- package/dist/chunk-KFVVOS5N.mjs +0 -925
- package/dist/chunk-KJUIIEQE.mjs +0 -186
- package/dist/chunk-KNWTHRVQ.mjs +0 -175
- package/dist/chunk-KSG4XSZF.mjs +0 -175
- package/dist/chunk-L2OZ4CDV.mjs +0 -113
- package/dist/chunk-LF5N6DOU.mjs +0 -175
- package/dist/chunk-LJQCM2IM.mjs +0 -214
- package/dist/chunk-MIZV3TAN.mjs +0 -3293
- package/dist/chunk-NKKLQE5V.mjs +0 -148
- package/dist/chunk-NOW23XFZ.mjs +0 -186
- package/dist/chunk-NRXQKQ74.mjs +0 -148
- package/dist/chunk-NTB7OEX2.mjs +0 -2918
- package/dist/chunk-NW6555WJ.mjs +0 -186
- package/dist/chunk-O4AUS7EU.mjs +0 -148
- package/dist/chunk-OMZE6VLQ.mjs +0 -214
- package/dist/chunk-OPJKP747.mjs +0 -7506
- package/dist/chunk-OWI6XWCD.mjs +0 -3375
- package/dist/chunk-P4BR7WVO.mjs +0 -2190
- package/dist/chunk-PRUMNNDI.mjs +0 -3192
- package/dist/chunk-QQHVYH2X.mjs +0 -244
- package/dist/chunk-QTBD5B3F.mjs +0 -148
- package/dist/chunk-R57T26RR.mjs +0 -734
- package/dist/chunk-S5QLWLLT.mjs +0 -186
- package/dist/chunk-SCWGT2FY.mjs +0 -2190
- package/dist/chunk-SKSDPPNT.mjs +0 -3788
- package/dist/chunk-SMKJUSB3.mjs +0 -2190
- package/dist/chunk-SP2YUS33.mjs +0 -186
- package/dist/chunk-SU4E6E7B.mjs +0 -3153
- package/dist/chunk-SYUUKW5A.mjs +0 -3379
- package/dist/chunk-THFYE5ZX.mjs +0 -244
- package/dist/chunk-UBDNXVL2.mjs +0 -801
- package/dist/chunk-UDDTWG5J.mjs +0 -734
- package/dist/chunk-UL2XZEMA.mjs +0 -3128
- package/dist/chunk-VCAY2KGM.mjs +0 -175
- package/dist/chunk-VLTKQDJ3.mjs +0 -244
- package/dist/chunk-WBYMW4NQ.mjs +0 -3450
- package/dist/chunk-WECAV6QB.mjs +0 -148
- package/dist/chunk-WMKBXUCE.mjs +0 -3228
- package/dist/chunk-XAJ5BKKL.mjs +0 -4947
- package/dist/chunk-XG2X7AEA.mjs +0 -175
- package/dist/chunk-XG7Z23NQ.mjs +0 -148
- package/dist/chunk-XMWUHQVV.mjs +0 -939
- package/dist/chunk-XWZAOCQ7.mjs +0 -2607
- package/dist/chunk-XZNEDRGN.mjs +0 -3876
- package/dist/chunk-Y6FXYEAI.mjs +0 -10
- package/dist/chunk-Y6MA7ULW.mjs +0 -148
- package/dist/chunk-YFS6JMYO.mjs +0 -3342
- package/dist/chunk-YMS7Q7LG.mjs +0 -214
- package/dist/chunk-Z2G5RZ4H.mjs +0 -186
- package/dist/chunk-Z6AIQ4KL.mjs +0 -113
- package/dist/chunk-ZA37XTGA.mjs +0 -175
- package/dist/chunk-ZE3KCHBM.mjs +0 -2918
- package/dist/config-PL24KEWL.mjs +0 -219
- package/dist/dev-server-Bs_sz2DG.d.mts +0 -111
- package/dist/dev-server-Bs_sz2DG.d.ts +0 -111
- package/dist/dev-server-CjoufJ-u.d.mts +0 -109
- package/dist/dev-server-CjoufJ-u.d.ts +0 -109
- package/dist/dev-server-RmGHIntF.d.mts +0 -113
- package/dist/dev-server-RmGHIntF.d.ts +0 -113
- package/dist/engine-binary-QQUDACBJ.mjs +0 -455
- package/dist/envelope-DD7v0v6E.d.mts +0 -265
- package/dist/envelope-DD7v0v6E.d.ts +0 -265
- package/dist/envelope-vCVjrHlo.d.mts +0 -265
- package/dist/envelope-vCVjrHlo.d.ts +0 -265
- package/dist/index-B5gSgvnd.d.mts +0 -44
- package/dist/index-B5gSgvnd.d.ts +0 -44
- package/dist/index-Bs0MnR54.d.mts +0 -103
- package/dist/index-Bs0MnR54.d.ts +0 -103
- package/dist/index-DR0nNc_f.d.mts +0 -101
- package/dist/index-DR0nNc_f.d.ts +0 -101
- package/dist/index-revho_gS.d.mts +0 -104
- package/dist/index-revho_gS.d.ts +0 -104
- package/dist/init-7FJENUDK.mjs +0 -407
- package/dist/init-7JQMAAXS.mjs +0 -363
- package/dist/init-DQDX3QK6.mjs +0 -369
- package/dist/init-EHO4VQ22.mjs +0 -369
- package/dist/init-IXEE2RCF.mjs +0 -340
- package/dist/init-UC3FWPIW.mjs +0 -367
- package/dist/init-UNSMVKIK.mjs +0 -366
- package/dist/init-UNV5XIDE.mjs +0 -367
- package/dist/project-compiler-2P4N4DR7.mjs +0 -10
- package/dist/project-compiler-D2LCC27O.mjs +0 -10
- package/dist/project-compiler-EGJUTAJU.mjs +0 -10
- package/dist/project-compiler-EJ3GANJE.mjs +0 -10
- package/dist/project-compiler-LOQKVRZJ.mjs +0 -10
- package/dist/project-compiler-NNK32MPG.mjs +0 -10
- package/dist/project-compiler-OP2VVGJQ.mjs +0 -10
- package/dist/project-compiler-RQ6OQKRM.mjs +0 -10
- package/dist/project-compiler-VFR6CSDX.mjs +0 -10
- package/dist/project-compiler-VWNNCHGO.mjs +0 -10
- package/dist/project-compiler-XVAAU4C5.mjs +0 -10
- package/dist/project-compiler-YES5FGMD.mjs +0 -10
- package/dist/project-compiler-ZKMQDLGU.mjs +0 -10
- package/dist/project-decompiler-5GY2KSG4.mjs +0 -7
- package/dist/project-decompiler-FLXCEJHS.mjs +0 -7
- package/dist/project-decompiler-US7GAVIC.mjs +0 -7
- package/dist/project-decompiler-VLPR22QF.mjs +0 -7
- package/dist/pull-A2QUHW4K.mjs +0 -109
- package/dist/pull-FUS5QYZS.mjs +0 -109
- package/dist/pull-JBEQWVPE.mjs +0 -109
- package/dist/pull-LD5ENLGY.mjs +0 -109
- package/dist/pull-P44LDRWB.mjs +0 -109
- package/dist/verify-BYHUKARQ.mjs +0 -1833
- package/dist/verify-SEIXUGN4.mjs +0 -1833
package/dist/config-PL24KEWL.mjs
DELETED
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
import "./chunk-CIESM3BP.mjs";
|
|
2
|
-
|
|
3
|
-
// src/cli/config.ts
|
|
4
|
-
import { existsSync, readFileSync, writeFileSync } from "fs";
|
|
5
|
-
import { resolve, join } from "path";
|
|
6
|
-
var DEFAULT_CONFIG = {
|
|
7
|
-
dev: {
|
|
8
|
-
port: 5199,
|
|
9
|
-
apiPort: 4200,
|
|
10
|
-
db: "sqlite://mm-dev.db",
|
|
11
|
-
redis: "",
|
|
12
|
-
api: "http://localhost:4200/api/v1",
|
|
13
|
-
seed: false,
|
|
14
|
-
open: false
|
|
15
|
-
},
|
|
16
|
-
build: {
|
|
17
|
-
mode: "infer",
|
|
18
|
-
outDir: "dist/workflows",
|
|
19
|
-
skipTypeCheck: false
|
|
20
|
-
},
|
|
21
|
-
test: {
|
|
22
|
-
minCoverage: 80,
|
|
23
|
-
minMutationScore: 60,
|
|
24
|
-
integration: false
|
|
25
|
-
},
|
|
26
|
-
environments: {
|
|
27
|
-
local: { apiUrl: "http://localhost:4200/api/v1" },
|
|
28
|
-
dev: { apiUrl: "https://dev.mindmatrix.club/api/v1" }
|
|
29
|
-
},
|
|
30
|
-
defaultTarget: "dev"
|
|
31
|
-
};
|
|
32
|
-
function isPlainObject(val) {
|
|
33
|
-
return typeof val === "object" && val !== null && !Array.isArray(val);
|
|
34
|
-
}
|
|
35
|
-
function deepMerge(target, source) {
|
|
36
|
-
const result = { ...target };
|
|
37
|
-
for (const key of Object.keys(source)) {
|
|
38
|
-
const srcVal = source[key];
|
|
39
|
-
const tgtVal = target[key];
|
|
40
|
-
if (isPlainObject(srcVal) && isPlainObject(tgtVal)) {
|
|
41
|
-
result[key] = deepMerge(tgtVal, srcVal);
|
|
42
|
-
} else if (srcVal !== void 0) {
|
|
43
|
-
result[key] = srcVal;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
return result;
|
|
47
|
-
}
|
|
48
|
-
function findConfigPath(startDir) {
|
|
49
|
-
let dir = startDir ?? process.cwd();
|
|
50
|
-
const root = resolve("/");
|
|
51
|
-
while (true) {
|
|
52
|
-
for (const name of ["mmrc.config.ts", "mmrc.config.json"]) {
|
|
53
|
-
const candidate = join(dir, name);
|
|
54
|
-
if (existsSync(candidate)) return candidate;
|
|
55
|
-
}
|
|
56
|
-
const parent = resolve(dir, "..");
|
|
57
|
-
if (parent === dir || parent === root) break;
|
|
58
|
-
dir = parent;
|
|
59
|
-
}
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
function loadConfigFromFile(configPath) {
|
|
63
|
-
const content = readFileSync(configPath, "utf-8");
|
|
64
|
-
if (configPath.endsWith(".json")) {
|
|
65
|
-
try {
|
|
66
|
-
return JSON.parse(content);
|
|
67
|
-
} catch {
|
|
68
|
-
return {};
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
let js = content.replace(/\/\*[\s\S]*?\*\//g, "").replace(/(?<![:'"])\/\/.*$/gm, "").replace(/^import\s+.*$/gm, "").replace(/^export\s+default\s+/m, "module.exports = ").replace(/^export\s+/gm, "").replace(/:\s*MmrcConfig/g, "").replace(/as\s+const/g, "").replace(/satisfies\s+\w+/g, "");
|
|
72
|
-
js = `function defineMmrc(c) { return c; }
|
|
73
|
-
${js}`;
|
|
74
|
-
try {
|
|
75
|
-
const m = {};
|
|
76
|
-
const fn = new Function("module", "exports", "require", js);
|
|
77
|
-
fn(m, m, () => ({}));
|
|
78
|
-
const exported = m.exports ?? m;
|
|
79
|
-
return isPlainObject(exported) ? exported : {};
|
|
80
|
-
} catch {
|
|
81
|
-
return {};
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
function getConfig(startDir) {
|
|
85
|
-
const configPath = findConfigPath(startDir);
|
|
86
|
-
if (!configPath) return { ...DEFAULT_CONFIG };
|
|
87
|
-
const userConfig = loadConfigFromFile(configPath);
|
|
88
|
-
return deepMerge(DEFAULT_CONFIG, userConfig);
|
|
89
|
-
}
|
|
90
|
-
function getConfigValue(config, key) {
|
|
91
|
-
const parts = key.split(".");
|
|
92
|
-
let current = config;
|
|
93
|
-
for (const part of parts) {
|
|
94
|
-
if (!isPlainObject(current)) return void 0;
|
|
95
|
-
current = current[part];
|
|
96
|
-
}
|
|
97
|
-
return current;
|
|
98
|
-
}
|
|
99
|
-
function setConfigValue(config, key, value) {
|
|
100
|
-
const parts = key.split(".");
|
|
101
|
-
let current = config;
|
|
102
|
-
for (let i = 0; i < parts.length - 1; i++) {
|
|
103
|
-
const part = parts[i];
|
|
104
|
-
if (!isPlainObject(current[part])) {
|
|
105
|
-
current[part] = {};
|
|
106
|
-
}
|
|
107
|
-
current = current[part];
|
|
108
|
-
}
|
|
109
|
-
const last = parts[parts.length - 1];
|
|
110
|
-
if (value === "true") current[last] = true;
|
|
111
|
-
else if (value === "false") current[last] = false;
|
|
112
|
-
else if (/^\d+$/.test(value)) current[last] = parseInt(value, 10);
|
|
113
|
-
else current[last] = value;
|
|
114
|
-
}
|
|
115
|
-
function flattenConfig(obj, prefix = "") {
|
|
116
|
-
const entries = [];
|
|
117
|
-
if (!isPlainObject(obj)) {
|
|
118
|
-
entries.push([prefix, String(obj)]);
|
|
119
|
-
return entries;
|
|
120
|
-
}
|
|
121
|
-
for (const [key, val] of Object.entries(obj)) {
|
|
122
|
-
const fullKey = prefix ? `${prefix}.${key}` : key;
|
|
123
|
-
if (isPlainObject(val)) {
|
|
124
|
-
entries.push(...flattenConfig(val, fullKey));
|
|
125
|
-
} else {
|
|
126
|
-
entries.push([fullKey, String(val)]);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
return entries;
|
|
130
|
-
}
|
|
131
|
-
function writeConfigFile(configPath, config) {
|
|
132
|
-
const json = JSON.stringify(config, null, 2);
|
|
133
|
-
const content = `/**
|
|
134
|
-
* mmrc.config.ts \u2014 MindMatrix React Compiler configuration.
|
|
135
|
-
*
|
|
136
|
-
* Configures the mmrc CLI for local dev, builds, tests, and deploy targets.
|
|
137
|
-
* Edit directly or run \`mmrc config set <key> <value>\`.
|
|
138
|
-
*/
|
|
139
|
-
|
|
140
|
-
const config = ${json};
|
|
141
|
-
|
|
142
|
-
export default config;
|
|
143
|
-
`;
|
|
144
|
-
writeFileSync(configPath, content, "utf-8");
|
|
145
|
-
}
|
|
146
|
-
function resolveTarget(targetName, config, fallbackApiUrl) {
|
|
147
|
-
if (!config || !config.environments) {
|
|
148
|
-
return { name: targetName ?? "default", apiUrl: fallbackApiUrl, token: null };
|
|
149
|
-
}
|
|
150
|
-
const name = targetName ?? config.defaultTarget ?? "local";
|
|
151
|
-
const env = config.environments[name];
|
|
152
|
-
if (!env) {
|
|
153
|
-
const available = Object.keys(config.environments).join(", ");
|
|
154
|
-
throw new Error(`Unknown target "${name}". Available environments: ${available}`);
|
|
155
|
-
}
|
|
156
|
-
return { name, apiUrl: env.apiUrl, token: env.token ?? null };
|
|
157
|
-
}
|
|
158
|
-
function generateMmrcConfig() {
|
|
159
|
-
return `/**
|
|
160
|
-
* mmrc.config.ts \u2014 MindMatrix React Compiler configuration.
|
|
161
|
-
*
|
|
162
|
-
* Configures the mmrc CLI for local dev, builds, tests, and deploy targets.
|
|
163
|
-
* Edit directly or run \`mmrc config set <key> <value>\`.
|
|
164
|
-
*/
|
|
165
|
-
|
|
166
|
-
const config = {
|
|
167
|
-
dev: {
|
|
168
|
-
port: 5199,
|
|
169
|
-
apiPort: 4200,
|
|
170
|
-
db: 'sqlite://mm-dev.db',
|
|
171
|
-
redis: '',
|
|
172
|
-
api: 'https://dev.mindmatrix.club/api/v1',
|
|
173
|
-
seed: false,
|
|
174
|
-
open: false,
|
|
175
|
-
},
|
|
176
|
-
|
|
177
|
-
build: {
|
|
178
|
-
mode: 'infer',
|
|
179
|
-
outDir: 'dist/workflows',
|
|
180
|
-
skipTypeCheck: false,
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
test: {
|
|
184
|
-
minCoverage: 80,
|
|
185
|
-
minMutationScore: 60,
|
|
186
|
-
integration: false,
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
environments: {
|
|
190
|
-
local: { apiUrl: 'http://localhost:4200/api/v1' },
|
|
191
|
-
dev: { apiUrl: 'https://dev.mindmatrix.club/api/v1' },
|
|
192
|
-
},
|
|
193
|
-
|
|
194
|
-
defaultTarget: 'dev',
|
|
195
|
-
};
|
|
196
|
-
|
|
197
|
-
export default config;
|
|
198
|
-
`;
|
|
199
|
-
}
|
|
200
|
-
function loadMmrcConfig(dir) {
|
|
201
|
-
const path = findConfigPath(dir);
|
|
202
|
-
if (!path) return null;
|
|
203
|
-
const partial = loadConfigFromFile(path);
|
|
204
|
-
return deepMerge(DEFAULT_CONFIG, partial);
|
|
205
|
-
}
|
|
206
|
-
export {
|
|
207
|
-
DEFAULT_CONFIG,
|
|
208
|
-
deepMerge,
|
|
209
|
-
findConfigPath,
|
|
210
|
-
flattenConfig,
|
|
211
|
-
generateMmrcConfig,
|
|
212
|
-
getConfig,
|
|
213
|
-
getConfigValue,
|
|
214
|
-
loadConfigFromFile,
|
|
215
|
-
loadMmrcConfig,
|
|
216
|
-
resolveTarget,
|
|
217
|
-
setConfigValue,
|
|
218
|
-
writeConfigFile
|
|
219
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { ViteDevServer } from 'vite';
|
|
2
|
-
import { IRWorkflowDefinition } from '@mindmatrix/player-core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* CLI Build Command — compiles workflow files to Pure Form JSON.
|
|
6
|
-
*
|
|
7
|
-
* Supports three file types:
|
|
8
|
-
* - *.workflow.tsx — React workflow components
|
|
9
|
-
* - models/*.ts — TypeScript model files
|
|
10
|
-
* - *.server.ts — Server action files
|
|
11
|
-
*
|
|
12
|
-
* Produces:
|
|
13
|
-
* - *.workflow.json — IR (Pure Form)
|
|
14
|
-
* - *.json — Engine-compatible definition
|
|
15
|
-
* - envelope.json — Source envelope with file manifest
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
interface BuildOptions {
|
|
19
|
-
src?: string;
|
|
20
|
-
outDir?: string;
|
|
21
|
-
mode?: 'strict' | 'infer';
|
|
22
|
-
/** Generate source envelope. */
|
|
23
|
-
envelope?: boolean;
|
|
24
|
-
/** Blueprint slug for envelope. */
|
|
25
|
-
slug?: string;
|
|
26
|
-
/** Blueprint version for envelope. */
|
|
27
|
-
version?: string;
|
|
28
|
-
/** Skip TypeScript type checking (not recommended). */
|
|
29
|
-
skipTypeCheck?: boolean;
|
|
30
|
-
}
|
|
31
|
-
interface BuildResult {
|
|
32
|
-
compiled: number;
|
|
33
|
-
errors: number;
|
|
34
|
-
warnings: number;
|
|
35
|
-
definitions: IRWorkflowDefinition[];
|
|
36
|
-
errorDetails: {
|
|
37
|
-
file: string;
|
|
38
|
-
message: string;
|
|
39
|
-
line?: number;
|
|
40
|
-
}[];
|
|
41
|
-
}
|
|
42
|
-
declare function build(options?: BuildOptions): Promise<BuildResult>;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Dev Server — Vite-based development server for MindMatrix React workflows.
|
|
46
|
-
*
|
|
47
|
-
* Uses the Vite plugin to watch .workflow.tsx files. On file change:
|
|
48
|
-
* 1. Compile through Babel plugin → extract IR
|
|
49
|
-
* 2. Diff IR against last known state
|
|
50
|
-
* 3. Notify connected frontends via WebSocket
|
|
51
|
-
* 4. Optionally seed definitions to the dev API
|
|
52
|
-
*
|
|
53
|
-
* Usage (programmatic):
|
|
54
|
-
* import { createDevServer } from '@mindmatrix/react-compiler';
|
|
55
|
-
* const server = await createDevServer({ port: 5199 });
|
|
56
|
-
* // ... server.close() to stop
|
|
57
|
-
*
|
|
58
|
-
* Usage (CLI):
|
|
59
|
-
* mmrc dev --port 5199 --src src/workflows --seed
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
/** Minimal WebSocket interface — avoids requiring @types/ws at compile time */
|
|
63
|
-
interface WsClient {
|
|
64
|
-
readyState: number;
|
|
65
|
-
send(data: string): void;
|
|
66
|
-
close(): void;
|
|
67
|
-
on(event: string, listener: (...args: unknown[]) => void): void;
|
|
68
|
-
}
|
|
69
|
-
interface DevServerOptions {
|
|
70
|
-
/** Port for the dev server. Default: 5199 */
|
|
71
|
-
port?: number;
|
|
72
|
-
/** Source directory to watch. Default: 'src/workflows' */
|
|
73
|
-
src?: string;
|
|
74
|
-
/** Compilation mode. Default: 'infer' */
|
|
75
|
-
mode?: 'strict' | 'infer';
|
|
76
|
-
/** Glob patterns for workflow files. Default: ['**\/*.workflow.tsx'] */
|
|
77
|
-
include?: string[];
|
|
78
|
-
/** Output directory for .workflow.json sidecar files. Default: 'dist/workflows' */
|
|
79
|
-
outDir?: string;
|
|
80
|
-
/** Seed compiled definitions to the dev API on change. Default: false */
|
|
81
|
-
seed?: boolean;
|
|
82
|
-
/** Dev API base URL. Default: 'http://localhost:4200/api/v1' */
|
|
83
|
-
apiUrl?: string;
|
|
84
|
-
/** Auth token for dev API. Default: reads from MINDMATRIX_TOKEN env */
|
|
85
|
-
authToken?: string;
|
|
86
|
-
/** Enable WebSocket notification channel. Default: true */
|
|
87
|
-
ws?: boolean;
|
|
88
|
-
/** Open browser on start. Default: false */
|
|
89
|
-
open?: boolean;
|
|
90
|
-
}
|
|
91
|
-
interface DevServerInstance {
|
|
92
|
-
/** The underlying Vite dev server */
|
|
93
|
-
vite: ViteDevServer;
|
|
94
|
-
/** Port the server is running on */
|
|
95
|
-
port: number;
|
|
96
|
-
/** Connected WebSocket clients */
|
|
97
|
-
clients: Set<WsClient>;
|
|
98
|
-
/** Trigger a full rebuild of all workflow files */
|
|
99
|
-
rebuild: () => Promise<BuildResult>;
|
|
100
|
-
/** Stop the dev server */
|
|
101
|
-
close: () => Promise<void>;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Create and start a MindMatrix dev server.
|
|
105
|
-
*
|
|
106
|
-
* This is a thin Vite server configured with the mindmatrixReact plugin,
|
|
107
|
-
* plus a WebSocket channel that pushes compile events to connected editors.
|
|
108
|
-
*/
|
|
109
|
-
declare function createDevServer(options?: DevServerOptions): Promise<DevServerInstance>;
|
|
110
|
-
|
|
111
|
-
export { type BuildOptions as B, type DevServerOptions as D, type DevServerInstance as a, build as b, createDevServer as c, type BuildResult as d };
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { ViteDevServer } from 'vite';
|
|
2
|
-
import { IRWorkflowDefinition } from '@mindmatrix/player-core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* CLI Build Command — compiles workflow files to Pure Form JSON.
|
|
6
|
-
*
|
|
7
|
-
* Supports three file types:
|
|
8
|
-
* - *.workflow.tsx — React workflow components
|
|
9
|
-
* - models/*.ts — TypeScript model files
|
|
10
|
-
* - *.server.ts — Server action files
|
|
11
|
-
*
|
|
12
|
-
* Produces:
|
|
13
|
-
* - *.workflow.json — IR (Pure Form)
|
|
14
|
-
* - *.json — Engine-compatible definition
|
|
15
|
-
* - envelope.json — Source envelope with file manifest
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
interface BuildOptions {
|
|
19
|
-
src?: string;
|
|
20
|
-
outDir?: string;
|
|
21
|
-
mode?: 'strict' | 'infer';
|
|
22
|
-
/** Generate source envelope. */
|
|
23
|
-
envelope?: boolean;
|
|
24
|
-
/** Blueprint slug for envelope. */
|
|
25
|
-
slug?: string;
|
|
26
|
-
/** Blueprint version for envelope. */
|
|
27
|
-
version?: string;
|
|
28
|
-
/** Skip TypeScript type checking (not recommended). */
|
|
29
|
-
skipTypeCheck?: boolean;
|
|
30
|
-
}
|
|
31
|
-
interface BuildResult {
|
|
32
|
-
compiled: number;
|
|
33
|
-
errors: number;
|
|
34
|
-
warnings: number;
|
|
35
|
-
definitions: IRWorkflowDefinition[];
|
|
36
|
-
errorDetails: {
|
|
37
|
-
file: string;
|
|
38
|
-
message: string;
|
|
39
|
-
line?: number;
|
|
40
|
-
}[];
|
|
41
|
-
}
|
|
42
|
-
declare function build(options?: BuildOptions): Promise<BuildResult>;
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Dev Server — Vite-based development server for MindMatrix React workflows.
|
|
46
|
-
*
|
|
47
|
-
* Uses the Vite plugin to watch .workflow.tsx files. On file change:
|
|
48
|
-
* 1. Compile through Babel plugin → extract IR
|
|
49
|
-
* 2. Diff IR against last known state
|
|
50
|
-
* 3. Notify connected frontends via WebSocket
|
|
51
|
-
* 4. Optionally seed definitions to the dev API
|
|
52
|
-
*
|
|
53
|
-
* Usage (programmatic):
|
|
54
|
-
* import { createDevServer } from '@mindmatrix/react-compiler';
|
|
55
|
-
* const server = await createDevServer({ port: 5199 });
|
|
56
|
-
* // ... server.close() to stop
|
|
57
|
-
*
|
|
58
|
-
* Usage (CLI):
|
|
59
|
-
* mmrc dev --port 5199 --src src/workflows --seed
|
|
60
|
-
*/
|
|
61
|
-
|
|
62
|
-
/** Minimal WebSocket interface — avoids requiring @types/ws at compile time */
|
|
63
|
-
interface WsClient {
|
|
64
|
-
readyState: number;
|
|
65
|
-
send(data: string): void;
|
|
66
|
-
close(): void;
|
|
67
|
-
on(event: string, listener: (...args: unknown[]) => void): void;
|
|
68
|
-
}
|
|
69
|
-
interface DevServerOptions {
|
|
70
|
-
/** Port for the dev server. Default: 5199 */
|
|
71
|
-
port?: number;
|
|
72
|
-
/** Source directory to watch. Default: 'src/workflows' */
|
|
73
|
-
src?: string;
|
|
74
|
-
/** Compilation mode. Default: 'infer' */
|
|
75
|
-
mode?: 'strict' | 'infer';
|
|
76
|
-
/** Glob patterns for workflow files. Default: ['**\/*.workflow.tsx'] */
|
|
77
|
-
include?: string[];
|
|
78
|
-
/** Output directory for .workflow.json sidecar files. Default: 'dist/workflows' */
|
|
79
|
-
outDir?: string;
|
|
80
|
-
/** Seed compiled definitions to the dev API on change. Default: false */
|
|
81
|
-
seed?: boolean;
|
|
82
|
-
/** Dev API base URL. Default: 'http://localhost:4200/api/v1' */
|
|
83
|
-
apiUrl?: string;
|
|
84
|
-
/** Auth token for dev API. Default: reads from MINDMATRIX_TOKEN env */
|
|
85
|
-
authToken?: string;
|
|
86
|
-
/** Enable WebSocket notification channel. Default: true */
|
|
87
|
-
ws?: boolean;
|
|
88
|
-
/** Open browser on start. Default: false */
|
|
89
|
-
open?: boolean;
|
|
90
|
-
}
|
|
91
|
-
interface DevServerInstance {
|
|
92
|
-
/** The underlying Vite dev server */
|
|
93
|
-
vite: ViteDevServer;
|
|
94
|
-
/** Port the server is running on */
|
|
95
|
-
port: number;
|
|
96
|
-
/** Connected WebSocket clients */
|
|
97
|
-
clients: Set<WsClient>;
|
|
98
|
-
/** Trigger a full rebuild of all workflow files */
|
|
99
|
-
rebuild: () => Promise<BuildResult>;
|
|
100
|
-
/** Stop the dev server */
|
|
101
|
-
close: () => Promise<void>;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Create and start a MindMatrix dev server.
|
|
105
|
-
*
|
|
106
|
-
* This is a thin Vite server configured with the mindmatrixReact plugin,
|
|
107
|
-
* plus a WebSocket channel that pushes compile events to connected editors.
|
|
108
|
-
*/
|
|
109
|
-
declare function createDevServer(options?: DevServerOptions): Promise<DevServerInstance>;
|
|
110
|
-
|
|
111
|
-
export { type BuildOptions as B, type DevServerOptions as D, type DevServerInstance as a, build as b, createDevServer as c, type BuildResult as d };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { ViteDevServer } from 'vite';
|
|
2
|
-
import { IRWorkflowDefinition } from '@mindmatrix/player-core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* CLI Build Command — compiles workflow files to Pure Form JSON.
|
|
6
|
-
*
|
|
7
|
-
* Supports three file types:
|
|
8
|
-
* - *.workflow.tsx — React workflow components
|
|
9
|
-
* - models/*.ts — TypeScript model files
|
|
10
|
-
* - *.server.ts — Server action files
|
|
11
|
-
*
|
|
12
|
-
* Produces:
|
|
13
|
-
* - *.workflow.json — IR (Pure Form)
|
|
14
|
-
* - *.json — Engine-compatible definition
|
|
15
|
-
* - envelope.json — Source envelope with file manifest
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
interface BuildOptions {
|
|
19
|
-
src?: string;
|
|
20
|
-
outDir?: string;
|
|
21
|
-
mode?: 'strict' | 'infer';
|
|
22
|
-
/** Generate source envelope. */
|
|
23
|
-
envelope?: boolean;
|
|
24
|
-
/** Blueprint slug for envelope. */
|
|
25
|
-
slug?: string;
|
|
26
|
-
/** Blueprint version for envelope. */
|
|
27
|
-
version?: string;
|
|
28
|
-
}
|
|
29
|
-
interface BuildResult {
|
|
30
|
-
compiled: number;
|
|
31
|
-
errors: number;
|
|
32
|
-
warnings: number;
|
|
33
|
-
definitions: IRWorkflowDefinition[];
|
|
34
|
-
errorDetails: {
|
|
35
|
-
file: string;
|
|
36
|
-
message: string;
|
|
37
|
-
line?: number;
|
|
38
|
-
}[];
|
|
39
|
-
}
|
|
40
|
-
declare function build(options?: BuildOptions): Promise<BuildResult>;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Dev Server — Vite-based development server for MindMatrix React workflows.
|
|
44
|
-
*
|
|
45
|
-
* Uses the Vite plugin to watch .workflow.tsx files. On file change:
|
|
46
|
-
* 1. Compile through Babel plugin → extract IR
|
|
47
|
-
* 2. Diff IR against last known state
|
|
48
|
-
* 3. Notify connected frontends via WebSocket
|
|
49
|
-
* 4. Optionally seed definitions to the dev API
|
|
50
|
-
*
|
|
51
|
-
* Usage (programmatic):
|
|
52
|
-
* import { createDevServer } from '@mindmatrix/react-compiler';
|
|
53
|
-
* const server = await createDevServer({ port: 5199 });
|
|
54
|
-
* // ... server.close() to stop
|
|
55
|
-
*
|
|
56
|
-
* Usage (CLI):
|
|
57
|
-
* mmrc dev --port 5199 --src src/workflows --seed
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
/** Minimal WebSocket interface — avoids requiring @types/ws at compile time */
|
|
61
|
-
interface WsClient {
|
|
62
|
-
readyState: number;
|
|
63
|
-
send(data: string): void;
|
|
64
|
-
close(): void;
|
|
65
|
-
on(event: string, listener: (...args: unknown[]) => void): void;
|
|
66
|
-
}
|
|
67
|
-
interface DevServerOptions {
|
|
68
|
-
/** Port for the dev server. Default: 5199 */
|
|
69
|
-
port?: number;
|
|
70
|
-
/** Source directory to watch. Default: 'src/workflows' */
|
|
71
|
-
src?: string;
|
|
72
|
-
/** Compilation mode. Default: 'infer' */
|
|
73
|
-
mode?: 'strict' | 'infer';
|
|
74
|
-
/** Glob patterns for workflow files. Default: ['**\/*.workflow.tsx'] */
|
|
75
|
-
include?: string[];
|
|
76
|
-
/** Output directory for .workflow.json sidecar files. Default: 'dist/workflows' */
|
|
77
|
-
outDir?: string;
|
|
78
|
-
/** Seed compiled definitions to the dev API on change. Default: false */
|
|
79
|
-
seed?: boolean;
|
|
80
|
-
/** Dev API base URL. Default: 'http://localhost:4200/api/v1' */
|
|
81
|
-
apiUrl?: string;
|
|
82
|
-
/** Auth token for dev API. Default: reads from MINDMATRIX_TOKEN env */
|
|
83
|
-
authToken?: string;
|
|
84
|
-
/** Enable WebSocket notification channel. Default: true */
|
|
85
|
-
ws?: boolean;
|
|
86
|
-
/** Open browser on start. Default: false */
|
|
87
|
-
open?: boolean;
|
|
88
|
-
}
|
|
89
|
-
interface DevServerInstance {
|
|
90
|
-
/** The underlying Vite dev server */
|
|
91
|
-
vite: ViteDevServer;
|
|
92
|
-
/** Port the server is running on */
|
|
93
|
-
port: number;
|
|
94
|
-
/** Connected WebSocket clients */
|
|
95
|
-
clients: Set<WsClient>;
|
|
96
|
-
/** Trigger a full rebuild of all workflow files */
|
|
97
|
-
rebuild: () => Promise<BuildResult>;
|
|
98
|
-
/** Stop the dev server */
|
|
99
|
-
close: () => Promise<void>;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Create and start a MindMatrix dev server.
|
|
103
|
-
*
|
|
104
|
-
* This is a thin Vite server configured with the mindmatrixReact plugin,
|
|
105
|
-
* plus a WebSocket channel that pushes compile events to connected editors.
|
|
106
|
-
*/
|
|
107
|
-
declare function createDevServer(options?: DevServerOptions): Promise<DevServerInstance>;
|
|
108
|
-
|
|
109
|
-
export { type BuildOptions as B, type DevServerOptions as D, type DevServerInstance as a, build as b, createDevServer as c, type BuildResult as d };
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { ViteDevServer } from 'vite';
|
|
2
|
-
import { IRWorkflowDefinition } from '@mindmatrix/player-core';
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* CLI Build Command — compiles workflow files to Pure Form JSON.
|
|
6
|
-
*
|
|
7
|
-
* Supports three file types:
|
|
8
|
-
* - *.workflow.tsx — React workflow components
|
|
9
|
-
* - models/*.ts — TypeScript model files
|
|
10
|
-
* - *.server.ts — Server action files
|
|
11
|
-
*
|
|
12
|
-
* Produces:
|
|
13
|
-
* - *.workflow.json — IR (Pure Form)
|
|
14
|
-
* - *.json — Engine-compatible definition
|
|
15
|
-
* - envelope.json — Source envelope with file manifest
|
|
16
|
-
*/
|
|
17
|
-
|
|
18
|
-
interface BuildOptions {
|
|
19
|
-
src?: string;
|
|
20
|
-
outDir?: string;
|
|
21
|
-
mode?: 'strict' | 'infer';
|
|
22
|
-
/** Generate source envelope. */
|
|
23
|
-
envelope?: boolean;
|
|
24
|
-
/** Blueprint slug for envelope. */
|
|
25
|
-
slug?: string;
|
|
26
|
-
/** Blueprint version for envelope. */
|
|
27
|
-
version?: string;
|
|
28
|
-
}
|
|
29
|
-
interface BuildResult {
|
|
30
|
-
compiled: number;
|
|
31
|
-
errors: number;
|
|
32
|
-
warnings: number;
|
|
33
|
-
definitions: IRWorkflowDefinition[];
|
|
34
|
-
errorDetails: {
|
|
35
|
-
file: string;
|
|
36
|
-
message: string;
|
|
37
|
-
line?: number;
|
|
38
|
-
}[];
|
|
39
|
-
}
|
|
40
|
-
declare function build(options?: BuildOptions): Promise<BuildResult>;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Dev Server — Vite-based development server for MindMatrix React workflows.
|
|
44
|
-
*
|
|
45
|
-
* Uses the Vite plugin to watch .workflow.tsx files. On file change:
|
|
46
|
-
* 1. Compile through Babel plugin → extract IR
|
|
47
|
-
* 2. Diff IR against last known state
|
|
48
|
-
* 3. Notify connected frontends via WebSocket
|
|
49
|
-
* 4. Optionally seed definitions to the dev API
|
|
50
|
-
*
|
|
51
|
-
* Usage (programmatic):
|
|
52
|
-
* import { createDevServer } from '@mindmatrix/react-compiler';
|
|
53
|
-
* const server = await createDevServer({ port: 5199 });
|
|
54
|
-
* // ... server.close() to stop
|
|
55
|
-
*
|
|
56
|
-
* Usage (CLI):
|
|
57
|
-
* mmrc dev --port 5199 --src src/workflows --seed
|
|
58
|
-
*/
|
|
59
|
-
|
|
60
|
-
/** Minimal WebSocket interface — avoids requiring @types/ws at compile time */
|
|
61
|
-
interface WsClient {
|
|
62
|
-
readyState: number;
|
|
63
|
-
send(data: string): void;
|
|
64
|
-
close(): void;
|
|
65
|
-
on(event: string, listener: (...args: unknown[]) => void): void;
|
|
66
|
-
}
|
|
67
|
-
interface DevServerOptions {
|
|
68
|
-
/** Port for the dev server. Default: 5199 */
|
|
69
|
-
port?: number;
|
|
70
|
-
/** Source directory to watch. Default: 'src/workflows' */
|
|
71
|
-
src?: string;
|
|
72
|
-
/** Compilation mode. Default: 'infer' */
|
|
73
|
-
mode?: 'strict' | 'infer';
|
|
74
|
-
/** Glob patterns for workflow files. Default: ['**\/*.workflow.tsx'] */
|
|
75
|
-
include?: string[];
|
|
76
|
-
/** Output directory for .workflow.json sidecar files. Default: 'dist/workflows' */
|
|
77
|
-
outDir?: string;
|
|
78
|
-
/** Seed compiled definitions to the dev API on change. Default: false */
|
|
79
|
-
seed?: boolean;
|
|
80
|
-
/** Dev API base URL. Default: 'http://localhost:4200/api/v1' */
|
|
81
|
-
apiUrl?: string;
|
|
82
|
-
/** Auth token for dev API. Default: reads from MINDMATRIX_TOKEN env */
|
|
83
|
-
authToken?: string;
|
|
84
|
-
/** Enable WebSocket notification channel. Default: true */
|
|
85
|
-
ws?: boolean;
|
|
86
|
-
/** Open browser on start. Default: false */
|
|
87
|
-
open?: boolean;
|
|
88
|
-
}
|
|
89
|
-
interface DevServerInstance {
|
|
90
|
-
/** The underlying Vite dev server */
|
|
91
|
-
vite: ViteDevServer;
|
|
92
|
-
/** Port the server is running on */
|
|
93
|
-
port: number;
|
|
94
|
-
/** Connected WebSocket clients */
|
|
95
|
-
clients: Set<WsClient>;
|
|
96
|
-
/** Trigger a full rebuild of all workflow files */
|
|
97
|
-
rebuild: () => Promise<BuildResult>;
|
|
98
|
-
/** Stop the dev server */
|
|
99
|
-
close: () => Promise<void>;
|
|
100
|
-
}
|
|
101
|
-
/**
|
|
102
|
-
* Create and start a MindMatrix dev server.
|
|
103
|
-
*
|
|
104
|
-
* This is a thin Vite server configured with the mindmatrixReact plugin,
|
|
105
|
-
* plus a WebSocket channel that pushes compile events to connected editors.
|
|
106
|
-
*/
|
|
107
|
-
declare function createDevServer(options?: DevServerOptions): Promise<DevServerInstance>;
|
|
108
|
-
|
|
109
|
-
export { type BuildOptions as B, type DevServerOptions as D, type DevServerInstance as a, build as b, createDevServer as c, type BuildResult as d };
|