feat: restore gateway HMR and add WRN formatting

This commit is contained in:
2026-07-13 14:54:03 +05:30
parent 3b46c69601
commit cff420a29e
71 changed files with 727 additions and 119 deletions
+14
View File
@@ -58,5 +58,19 @@ try {
bad("compiler bundle loads", e.message);
}
// 4. Formatter normalizes nested WRN blocks and is idempotent.
try {
const { formatWrn } = require(join(root, "src/formatter.js"));
const source = `page Home {\nview {\n<main>\n<h1>Hello</h1>\n</main>\n}\n}\n`;
const expected = `page Home {\n view {\n <main>\n <h1>Hello</h1>\n </main>\n }\n}\n`;
const formatted = formatWrn(source, { insertSpaces: true, tabSize: 2 });
formatted === expected ? ok("formatter indents WRN blocks") : bad("formatter indents WRN blocks");
formatWrn(formatted, { insertSpaces: true, tabSize: 2 }) === formatted
? ok("formatter is idempotent")
: bad("formatter is idempotent");
} catch (e) {
bad("formatter loads", e.message);
}
console.log(failures === 0 ? "\nAll extension checks passed." : `\n${failures} check(s) failed.`);
process.exit(failures === 0 ? 0 : 1);