Move the base CodeMirror KCL support to a local package (#4897)

* Move CodeMirror LRLanguage to new file

This separates the base language support from the LSP and color picker.

* Move the base CodeMirror KCL support to a local package

* Start CodeMirror grammar tests

* Exclude vitest config in tsconfig

* Add KCL path to tsconfig

* Remove stray import

* Drop extension from import

* Use __filename for commonjs compat

* Check exec return before access

* Build ES and CJS to dist

* Format

* Exclude all.test.ts from codespell

This is to work around "fileTests" imported from Lezer. Future codespell versions look
like they'll allow the code to be annotated, which would be nicer.

---------

Co-authored-by: Matt Mundell <matt@mundell.me>
This commit is contained in:
Jonathan Tran
2025-01-04 13:57:24 -05:00
committed by GitHub
parent 474acb1c68
commit 3c53babb50
15 changed files with 962 additions and 38 deletions

View File

@ -58,6 +58,7 @@ const config = defineConfig({
resolve: {
alias: {
'@kittycad/codemirror-lsp-client': '/packages/codemirror-lsp-client/src',
'@kittycad/codemirror-lang-kcl': '/packages/codemirror-lang-kcl/src',
},
},
plugins: [react(), viteTsconfigPaths(), eslint(), version(), lezer()],