release: WRNexusJS 0.2.49

This commit is contained in:
2026-07-18 19:33:57 +05:30
parent aa6badbd31
commit 9ca1cc6b0f
61 changed files with 252 additions and 93 deletions
+13 -2
View File
@@ -43,8 +43,19 @@ export function compileNativeWireFile(source: string): string {
* Compile `.wrn` source into TypeScript source. Throws `ParseError` on invalid
* input (the dev loader surfaces this as a readable error page).
*/
export function compileWireFile(source: string): string {
const ast = parse(source);
export function compileWireFile(source: string, filePath = "<inline .wrn>"): string {
let ast;
try {
ast = parse(source);
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
throw new Error(`Failed to parse ${filePath}: ${message}`, {
cause: error,
});
}
return `// compiled from .wrn\n${generate(ast)}`;
}