@mmapp/react-compiler 0.1.0-alpha.3 → 0.1.0-alpha.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/dist/babel/index.js +2733 -303
- package/dist/babel/index.mjs +1 -1
- package/dist/chunk-52XHYD2V.mjs +214 -0
- package/dist/chunk-5GUFFFGL.mjs +148 -0
- package/dist/chunk-EO6SYNCG.mjs +175 -0
- package/dist/chunk-J7JUAHS4.mjs +186 -0
- package/dist/chunk-NTB7OEX2.mjs +2918 -0
- package/dist/chunk-OPJKP747.mjs +7506 -0
- package/dist/chunk-THFYE5ZX.mjs +244 -0
- package/dist/chunk-WBYMW4NQ.mjs +3450 -0
- package/dist/cli/index.js +13001 -7900
- package/dist/cli/index.mjs +139 -21
- package/dist/config-PL24KEWL.mjs +219 -0
- package/dist/dev-server.js +3122 -356
- package/dist/dev-server.mjs +4 -4
- package/dist/envelope.js +2731 -301
- package/dist/envelope.mjs +2 -2
- package/dist/index.d.mts +156 -1
- package/dist/index.d.ts +156 -1
- package/dist/index.js +3643 -571
- package/dist/index.mjs +216 -8
- package/dist/init-DQDX3QK6.mjs +369 -0
- package/dist/project-compiler-OP2VVGJQ.mjs +10 -0
- package/dist/project-decompiler-US7GAVIC.mjs +7 -0
- package/dist/pull-P44LDRWB.mjs +109 -0
- package/dist/testing/index.js +2741 -311
- package/dist/testing/index.mjs +1 -1
- package/dist/verify-SEIXUGN4.mjs +1833 -0
- package/dist/vite/index.js +2732 -302
- package/dist/vite/index.mjs +2 -2
- package/package.json +14 -5
package/dist/envelope.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -581,6 +581,8 @@ interface DeployOptions {
|
|
|
581
581
|
dryRun?: boolean;
|
|
582
582
|
/** Write deploy report to this file. */
|
|
583
583
|
reportFile?: string;
|
|
584
|
+
/** Resolved target name (for display). */
|
|
585
|
+
targetName?: string;
|
|
584
586
|
}
|
|
585
587
|
interface DeployResult {
|
|
586
588
|
created: string[];
|
|
@@ -591,6 +593,11 @@ interface DeployResult {
|
|
|
591
593
|
slug: string;
|
|
592
594
|
error: string;
|
|
593
595
|
}[];
|
|
596
|
+
services?: {
|
|
597
|
+
registered: string[];
|
|
598
|
+
updated: string[];
|
|
599
|
+
failed: string[];
|
|
600
|
+
};
|
|
594
601
|
}
|
|
595
602
|
declare function deploy(options: DeployOptions): Promise<DeployResult>;
|
|
596
603
|
|
|
@@ -1100,4 +1107,152 @@ declare class IncrementalProjectCompiler {
|
|
|
1100
1107
|
} & IncrementalStats;
|
|
1101
1108
|
}
|
|
1102
1109
|
|
|
1103
|
-
|
|
1110
|
+
/**
|
|
1111
|
+
* Diagnostic System — structured error/warning/info/hint collection and formatting.
|
|
1112
|
+
*
|
|
1113
|
+
* Provides a DiagnosticCollector that accumulates diagnostics during compilation,
|
|
1114
|
+
* categorized by severity and tagged with machine-readable codes.
|
|
1115
|
+
*
|
|
1116
|
+
* Diagnostic codes are namespaced by extractor:
|
|
1117
|
+
* FLOW001-099 — Flow (imperative workflow) extractor
|
|
1118
|
+
* MDLW001-099 — Middleware extractor
|
|
1119
|
+
* CNST001-099 — Constraint extractor
|
|
1120
|
+
* ACTR001-099 — Actor extractor
|
|
1121
|
+
* HOOK001-099 — Hook-based visitor diagnostics
|
|
1122
|
+
* MODL001-099 — Model extractor
|
|
1123
|
+
* EMIT001-099 — Emitter diagnostics
|
|
1124
|
+
*/
|
|
1125
|
+
type DiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
|
|
1126
|
+
interface DiagnosticLocation {
|
|
1127
|
+
file?: string;
|
|
1128
|
+
line?: number;
|
|
1129
|
+
column?: number;
|
|
1130
|
+
}
|
|
1131
|
+
interface Diagnostic {
|
|
1132
|
+
severity: DiagnosticSeverity;
|
|
1133
|
+
code: string;
|
|
1134
|
+
message: string;
|
|
1135
|
+
file?: string;
|
|
1136
|
+
line?: number;
|
|
1137
|
+
column?: number;
|
|
1138
|
+
suggestion?: string;
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* All known diagnostic codes with their default messages.
|
|
1142
|
+
* Extractors reference these codes when reporting issues.
|
|
1143
|
+
*/
|
|
1144
|
+
declare const DIAGNOSTIC_CODES: {
|
|
1145
|
+
readonly FLOW001: "No default export async function found";
|
|
1146
|
+
readonly FLOW002: "Workflow function has no typed parameter";
|
|
1147
|
+
readonly FLOW003: "Interface not found for parameter type";
|
|
1148
|
+
readonly FLOW004: "Unknown function call in workflow body";
|
|
1149
|
+
readonly FLOW005: "userAction() without a following state (cannot resolve transition target)";
|
|
1150
|
+
readonly FLOW006: "Import could not be resolved as a service";
|
|
1151
|
+
readonly FLOW007: "validate() with unparseable condition";
|
|
1152
|
+
readonly MDLW001: "defineMiddleware() missing required 'name' field";
|
|
1153
|
+
readonly MDLW002: "Invalid match pattern format";
|
|
1154
|
+
readonly MDLW003: "No before/after/around handler defined";
|
|
1155
|
+
readonly CNST001: "Unknown built-in constraint name";
|
|
1156
|
+
readonly CNST002: "Empty constraint list";
|
|
1157
|
+
readonly ACTR001: "Invalid supervision strategy";
|
|
1158
|
+
readonly ACTR002: "spawnActor() called outside workflow function";
|
|
1159
|
+
readonly HOOK001: "Forbidden hook in strict mode";
|
|
1160
|
+
readonly HOOK002: "Raw useEffect in infer mode (component becomes opaque)";
|
|
1161
|
+
readonly HOOK003: "Forbidden import in strict mode";
|
|
1162
|
+
readonly MODL001: "defineModel() missing required fields";
|
|
1163
|
+
readonly MODL002: "Unknown field type in model definition";
|
|
1164
|
+
readonly EMIT001: "Empty workflow — no states, fields, or experience extracted";
|
|
1165
|
+
};
|
|
1166
|
+
type DiagnosticCode = keyof typeof DIAGNOSTIC_CODES;
|
|
1167
|
+
declare class DiagnosticCollector {
|
|
1168
|
+
private diagnostics;
|
|
1169
|
+
/**
|
|
1170
|
+
* Record an error diagnostic.
|
|
1171
|
+
*/
|
|
1172
|
+
error(code: string, message: string, location?: DiagnosticLocation, suggestion?: string): void;
|
|
1173
|
+
/**
|
|
1174
|
+
* Record a warning diagnostic.
|
|
1175
|
+
*/
|
|
1176
|
+
warning(code: string, message: string, location?: DiagnosticLocation, suggestion?: string): void;
|
|
1177
|
+
/**
|
|
1178
|
+
* Record an informational diagnostic.
|
|
1179
|
+
*/
|
|
1180
|
+
info(code: string, message: string): void;
|
|
1181
|
+
/**
|
|
1182
|
+
* Record a hint diagnostic (always includes a suggestion).
|
|
1183
|
+
*/
|
|
1184
|
+
hint(code: string, message: string, suggestion: string): void;
|
|
1185
|
+
/**
|
|
1186
|
+
* Whether any error-level diagnostics have been recorded.
|
|
1187
|
+
*/
|
|
1188
|
+
hasErrors(): boolean;
|
|
1189
|
+
/**
|
|
1190
|
+
* Whether any warning-level diagnostics have been recorded.
|
|
1191
|
+
*/
|
|
1192
|
+
hasWarnings(): boolean;
|
|
1193
|
+
/**
|
|
1194
|
+
* Total number of diagnostics collected.
|
|
1195
|
+
*/
|
|
1196
|
+
get count(): number;
|
|
1197
|
+
/**
|
|
1198
|
+
* Return all collected diagnostics.
|
|
1199
|
+
*/
|
|
1200
|
+
getAll(): Diagnostic[];
|
|
1201
|
+
/**
|
|
1202
|
+
* Return only error-severity diagnostics.
|
|
1203
|
+
*/
|
|
1204
|
+
getErrors(): Diagnostic[];
|
|
1205
|
+
/**
|
|
1206
|
+
* Return only warning-severity diagnostics.
|
|
1207
|
+
*/
|
|
1208
|
+
getWarnings(): Diagnostic[];
|
|
1209
|
+
/**
|
|
1210
|
+
* Return only info-severity diagnostics.
|
|
1211
|
+
*/
|
|
1212
|
+
getInfos(): Diagnostic[];
|
|
1213
|
+
/**
|
|
1214
|
+
* Return only hint-severity diagnostics.
|
|
1215
|
+
*/
|
|
1216
|
+
getHints(): Diagnostic[];
|
|
1217
|
+
/**
|
|
1218
|
+
* Merge diagnostics from another collector into this one.
|
|
1219
|
+
*/
|
|
1220
|
+
merge(other: DiagnosticCollector): void;
|
|
1221
|
+
/**
|
|
1222
|
+
* Clear all collected diagnostics.
|
|
1223
|
+
*/
|
|
1224
|
+
clear(): void;
|
|
1225
|
+
/**
|
|
1226
|
+
* Pretty-print all diagnostics for terminal output.
|
|
1227
|
+
*
|
|
1228
|
+
* Format:
|
|
1229
|
+
* error[FLOW001]: No default export async function found
|
|
1230
|
+
* --> models/task.ts
|
|
1231
|
+
* = hint: Add `export default async function taskWorkflow(task: Task) { ... }`
|
|
1232
|
+
*
|
|
1233
|
+
* warning[FLOW004]: Unknown function 'processData' in workflow body
|
|
1234
|
+
* --> models/order.ts:15:5
|
|
1235
|
+
* = note: Not a local async function, not imported, and not a stdlib function
|
|
1236
|
+
* = hint: Did you mean to import it?
|
|
1237
|
+
*/
|
|
1238
|
+
format(): string;
|
|
1239
|
+
/**
|
|
1240
|
+
* Machine-readable JSON representation.
|
|
1241
|
+
*/
|
|
1242
|
+
toJSON(): {
|
|
1243
|
+
diagnostics: Diagnostic[];
|
|
1244
|
+
summary: {
|
|
1245
|
+
errors: number;
|
|
1246
|
+
warnings: number;
|
|
1247
|
+
infos: number;
|
|
1248
|
+
hints: number;
|
|
1249
|
+
total: number;
|
|
1250
|
+
};
|
|
1251
|
+
};
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Create a fresh DiagnosticCollector instance.
|
|
1255
|
+
*/
|
|
1256
|
+
declare function createDiagnosticCollector(): DiagnosticCollector;
|
|
1257
|
+
|
|
1258
|
+
export { type ActionCompilationResult, type ActionCompilerOptions, CompilerOptions, CompilerState, type ComputedFieldExtraction, DIAGNOSTIC_CODES, type DecompileOptions, type DecompileProjectOptions, type DecompileProjectResult, type DecompileResult, type DecompilerInput, type DependencyEdge, type DeployOptions, type DeployResult, type Diagnostic, type DiagnosticCode, DiagnosticCollector, type DiagnosticLocation, type DiagnosticSeverity, type DirtyFileSet, ExtractedWorkflow, type FileHash, FileRole, type FrontendDataSource, type FrontendExperienceNode, type ImportLink, IncrementalCache, IncrementalProjectCompiler, type IncrementalStats, type LayoutEntry, type ModelCompilationResult, type ModelCompilerOptions, type ProjectCompilationError, type ProjectCompilationResult, type ProjectCompilerOptions, type ProjectFile, type RoundTripDiff, type RoundTripResult, type RouteEntry, type RouteExtractionResult, type RouteExtractorOptions, type RouteTableEntry, type ServerActionEntry, type ServerActionRegistration, buildDependencyGraph, compileActions, compileModel, compileModels, compileProject, compileSource, compilerStateToWorkflow, computeTransitiveDirtySet, createDiagnosticCollector, createVisitor, decompile, decompileProject, decompileToTSX, deploy, emitCanonical, emitCompiledOutput, emitIR, emitPureForm, extractComponents, extractComputed, extractEffects, extractEvents, extractImports, extractRoutes, extractStates, extractTransitions, hashContent, normalizeDecompilerInput, resolveActionReferences, resolveImport, shouldDecompileAsProject, topologicalSort, transformToFrontend, validateRoundTrip, validateSourceRoundTrip };
|
package/dist/index.d.ts
CHANGED
|
@@ -581,6 +581,8 @@ interface DeployOptions {
|
|
|
581
581
|
dryRun?: boolean;
|
|
582
582
|
/** Write deploy report to this file. */
|
|
583
583
|
reportFile?: string;
|
|
584
|
+
/** Resolved target name (for display). */
|
|
585
|
+
targetName?: string;
|
|
584
586
|
}
|
|
585
587
|
interface DeployResult {
|
|
586
588
|
created: string[];
|
|
@@ -591,6 +593,11 @@ interface DeployResult {
|
|
|
591
593
|
slug: string;
|
|
592
594
|
error: string;
|
|
593
595
|
}[];
|
|
596
|
+
services?: {
|
|
597
|
+
registered: string[];
|
|
598
|
+
updated: string[];
|
|
599
|
+
failed: string[];
|
|
600
|
+
};
|
|
594
601
|
}
|
|
595
602
|
declare function deploy(options: DeployOptions): Promise<DeployResult>;
|
|
596
603
|
|
|
@@ -1100,4 +1107,152 @@ declare class IncrementalProjectCompiler {
|
|
|
1100
1107
|
} & IncrementalStats;
|
|
1101
1108
|
}
|
|
1102
1109
|
|
|
1103
|
-
|
|
1110
|
+
/**
|
|
1111
|
+
* Diagnostic System — structured error/warning/info/hint collection and formatting.
|
|
1112
|
+
*
|
|
1113
|
+
* Provides a DiagnosticCollector that accumulates diagnostics during compilation,
|
|
1114
|
+
* categorized by severity and tagged with machine-readable codes.
|
|
1115
|
+
*
|
|
1116
|
+
* Diagnostic codes are namespaced by extractor:
|
|
1117
|
+
* FLOW001-099 — Flow (imperative workflow) extractor
|
|
1118
|
+
* MDLW001-099 — Middleware extractor
|
|
1119
|
+
* CNST001-099 — Constraint extractor
|
|
1120
|
+
* ACTR001-099 — Actor extractor
|
|
1121
|
+
* HOOK001-099 — Hook-based visitor diagnostics
|
|
1122
|
+
* MODL001-099 — Model extractor
|
|
1123
|
+
* EMIT001-099 — Emitter diagnostics
|
|
1124
|
+
*/
|
|
1125
|
+
type DiagnosticSeverity = 'error' | 'warning' | 'info' | 'hint';
|
|
1126
|
+
interface DiagnosticLocation {
|
|
1127
|
+
file?: string;
|
|
1128
|
+
line?: number;
|
|
1129
|
+
column?: number;
|
|
1130
|
+
}
|
|
1131
|
+
interface Diagnostic {
|
|
1132
|
+
severity: DiagnosticSeverity;
|
|
1133
|
+
code: string;
|
|
1134
|
+
message: string;
|
|
1135
|
+
file?: string;
|
|
1136
|
+
line?: number;
|
|
1137
|
+
column?: number;
|
|
1138
|
+
suggestion?: string;
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* All known diagnostic codes with their default messages.
|
|
1142
|
+
* Extractors reference these codes when reporting issues.
|
|
1143
|
+
*/
|
|
1144
|
+
declare const DIAGNOSTIC_CODES: {
|
|
1145
|
+
readonly FLOW001: "No default export async function found";
|
|
1146
|
+
readonly FLOW002: "Workflow function has no typed parameter";
|
|
1147
|
+
readonly FLOW003: "Interface not found for parameter type";
|
|
1148
|
+
readonly FLOW004: "Unknown function call in workflow body";
|
|
1149
|
+
readonly FLOW005: "userAction() without a following state (cannot resolve transition target)";
|
|
1150
|
+
readonly FLOW006: "Import could not be resolved as a service";
|
|
1151
|
+
readonly FLOW007: "validate() with unparseable condition";
|
|
1152
|
+
readonly MDLW001: "defineMiddleware() missing required 'name' field";
|
|
1153
|
+
readonly MDLW002: "Invalid match pattern format";
|
|
1154
|
+
readonly MDLW003: "No before/after/around handler defined";
|
|
1155
|
+
readonly CNST001: "Unknown built-in constraint name";
|
|
1156
|
+
readonly CNST002: "Empty constraint list";
|
|
1157
|
+
readonly ACTR001: "Invalid supervision strategy";
|
|
1158
|
+
readonly ACTR002: "spawnActor() called outside workflow function";
|
|
1159
|
+
readonly HOOK001: "Forbidden hook in strict mode";
|
|
1160
|
+
readonly HOOK002: "Raw useEffect in infer mode (component becomes opaque)";
|
|
1161
|
+
readonly HOOK003: "Forbidden import in strict mode";
|
|
1162
|
+
readonly MODL001: "defineModel() missing required fields";
|
|
1163
|
+
readonly MODL002: "Unknown field type in model definition";
|
|
1164
|
+
readonly EMIT001: "Empty workflow — no states, fields, or experience extracted";
|
|
1165
|
+
};
|
|
1166
|
+
type DiagnosticCode = keyof typeof DIAGNOSTIC_CODES;
|
|
1167
|
+
declare class DiagnosticCollector {
|
|
1168
|
+
private diagnostics;
|
|
1169
|
+
/**
|
|
1170
|
+
* Record an error diagnostic.
|
|
1171
|
+
*/
|
|
1172
|
+
error(code: string, message: string, location?: DiagnosticLocation, suggestion?: string): void;
|
|
1173
|
+
/**
|
|
1174
|
+
* Record a warning diagnostic.
|
|
1175
|
+
*/
|
|
1176
|
+
warning(code: string, message: string, location?: DiagnosticLocation, suggestion?: string): void;
|
|
1177
|
+
/**
|
|
1178
|
+
* Record an informational diagnostic.
|
|
1179
|
+
*/
|
|
1180
|
+
info(code: string, message: string): void;
|
|
1181
|
+
/**
|
|
1182
|
+
* Record a hint diagnostic (always includes a suggestion).
|
|
1183
|
+
*/
|
|
1184
|
+
hint(code: string, message: string, suggestion: string): void;
|
|
1185
|
+
/**
|
|
1186
|
+
* Whether any error-level diagnostics have been recorded.
|
|
1187
|
+
*/
|
|
1188
|
+
hasErrors(): boolean;
|
|
1189
|
+
/**
|
|
1190
|
+
* Whether any warning-level diagnostics have been recorded.
|
|
1191
|
+
*/
|
|
1192
|
+
hasWarnings(): boolean;
|
|
1193
|
+
/**
|
|
1194
|
+
* Total number of diagnostics collected.
|
|
1195
|
+
*/
|
|
1196
|
+
get count(): number;
|
|
1197
|
+
/**
|
|
1198
|
+
* Return all collected diagnostics.
|
|
1199
|
+
*/
|
|
1200
|
+
getAll(): Diagnostic[];
|
|
1201
|
+
/**
|
|
1202
|
+
* Return only error-severity diagnostics.
|
|
1203
|
+
*/
|
|
1204
|
+
getErrors(): Diagnostic[];
|
|
1205
|
+
/**
|
|
1206
|
+
* Return only warning-severity diagnostics.
|
|
1207
|
+
*/
|
|
1208
|
+
getWarnings(): Diagnostic[];
|
|
1209
|
+
/**
|
|
1210
|
+
* Return only info-severity diagnostics.
|
|
1211
|
+
*/
|
|
1212
|
+
getInfos(): Diagnostic[];
|
|
1213
|
+
/**
|
|
1214
|
+
* Return only hint-severity diagnostics.
|
|
1215
|
+
*/
|
|
1216
|
+
getHints(): Diagnostic[];
|
|
1217
|
+
/**
|
|
1218
|
+
* Merge diagnostics from another collector into this one.
|
|
1219
|
+
*/
|
|
1220
|
+
merge(other: DiagnosticCollector): void;
|
|
1221
|
+
/**
|
|
1222
|
+
* Clear all collected diagnostics.
|
|
1223
|
+
*/
|
|
1224
|
+
clear(): void;
|
|
1225
|
+
/**
|
|
1226
|
+
* Pretty-print all diagnostics for terminal output.
|
|
1227
|
+
*
|
|
1228
|
+
* Format:
|
|
1229
|
+
* error[FLOW001]: No default export async function found
|
|
1230
|
+
* --> models/task.ts
|
|
1231
|
+
* = hint: Add `export default async function taskWorkflow(task: Task) { ... }`
|
|
1232
|
+
*
|
|
1233
|
+
* warning[FLOW004]: Unknown function 'processData' in workflow body
|
|
1234
|
+
* --> models/order.ts:15:5
|
|
1235
|
+
* = note: Not a local async function, not imported, and not a stdlib function
|
|
1236
|
+
* = hint: Did you mean to import it?
|
|
1237
|
+
*/
|
|
1238
|
+
format(): string;
|
|
1239
|
+
/**
|
|
1240
|
+
* Machine-readable JSON representation.
|
|
1241
|
+
*/
|
|
1242
|
+
toJSON(): {
|
|
1243
|
+
diagnostics: Diagnostic[];
|
|
1244
|
+
summary: {
|
|
1245
|
+
errors: number;
|
|
1246
|
+
warnings: number;
|
|
1247
|
+
infos: number;
|
|
1248
|
+
hints: number;
|
|
1249
|
+
total: number;
|
|
1250
|
+
};
|
|
1251
|
+
};
|
|
1252
|
+
}
|
|
1253
|
+
/**
|
|
1254
|
+
* Create a fresh DiagnosticCollector instance.
|
|
1255
|
+
*/
|
|
1256
|
+
declare function createDiagnosticCollector(): DiagnosticCollector;
|
|
1257
|
+
|
|
1258
|
+
export { type ActionCompilationResult, type ActionCompilerOptions, CompilerOptions, CompilerState, type ComputedFieldExtraction, DIAGNOSTIC_CODES, type DecompileOptions, type DecompileProjectOptions, type DecompileProjectResult, type DecompileResult, type DecompilerInput, type DependencyEdge, type DeployOptions, type DeployResult, type Diagnostic, type DiagnosticCode, DiagnosticCollector, type DiagnosticLocation, type DiagnosticSeverity, type DirtyFileSet, ExtractedWorkflow, type FileHash, FileRole, type FrontendDataSource, type FrontendExperienceNode, type ImportLink, IncrementalCache, IncrementalProjectCompiler, type IncrementalStats, type LayoutEntry, type ModelCompilationResult, type ModelCompilerOptions, type ProjectCompilationError, type ProjectCompilationResult, type ProjectCompilerOptions, type ProjectFile, type RoundTripDiff, type RoundTripResult, type RouteEntry, type RouteExtractionResult, type RouteExtractorOptions, type RouteTableEntry, type ServerActionEntry, type ServerActionRegistration, buildDependencyGraph, compileActions, compileModel, compileModels, compileProject, compileSource, compilerStateToWorkflow, computeTransitiveDirtySet, createDiagnosticCollector, createVisitor, decompile, decompileProject, decompileToTSX, deploy, emitCanonical, emitCompiledOutput, emitIR, emitPureForm, extractComponents, extractComputed, extractEffects, extractEvents, extractImports, extractRoutes, extractStates, extractTransitions, hashContent, normalizeDecompilerInput, resolveActionReferences, resolveImport, shouldDecompileAsProject, topologicalSort, transformToFrontend, validateRoundTrip, validateSourceRoundTrip };
|