feat: new chord editor prototype

This commit is contained in:
2025-12-17 17:34:32 +01:00
parent fe42dcd2ab
commit 1aff1703ac
24 changed files with 1242 additions and 377 deletions

19
vite-plugin-lezer.ts Normal file
View File

@@ -0,0 +1,19 @@
import { buildParserFile } from "@lezer/generator";
import type { Plugin, Rollup } from "vite";
const fileRegex = /\.(grammar)$/;
export function lezerGrammarPlugin() {
return {
name: "lezer-grammar",
transform(code, id) {
if (fileRegex.test(id)) {
return {
code: buildParserFile(code).parser,
map: null,
} satisfies Rollup.TransformResult;
}
return null;
},
} satisfies Plugin;
}