Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(supersearch, lxlquery): Add watch scripts #1191

Merged
merged 1 commit into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions packages/codemirror-lang-lxlquery/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# CodeMirror 6 language package template
# LXLQuery language package

This is an example repository containing a minimal [CodeMirror](https://codemirror.net/6/) language support package. The idea is to clone it, rename it, and edit it to create support for a new language.
A [CodeMirror](https://codemirror.net/6/) language support package for the Libris XL Query language.

Things you'll need to do (see the [language support example](https://codemirror.net/6/examples/lang-package/) for a more detailed tutorial):
- `src/syntax.grammar` contains the grammar covering the language. See the [Lezer system guide](https://lezer.codemirror.net/docs/guide/#writing-a-grammar) for information on this file format.

- `git grep EXAMPLE` and replace all instances with your language name.
- `src/index.ts` adds metadata to the language parser.

- Rewrite the grammar in `src/syntax.grammar` to cover your language. See the [Lezer system guide](https://lezer.codemirror.net/docs/guide/#writing-a-grammar) for information on this file format.
- `test/cases.txt` contains the grammar tests.

- Adjust the metadata in `src/index.ts` to work with your new grammar.
## Develop

- Adjust the grammar tests in `test/cases.txt`.
`npm run watch` watches for changes in `/src` and builds the language.

- Build (`npm run prepare`) and test (`npm test`).
See the [language support example](https://codemirror.net/6/examples/lang-package/) for a detailed tutorial on development.

- Rewrite this readme file.
## Build

- Optionally add a license.
`npm run prepare`

- Publish. Put your package on npm under a name like `codemirror-lang-EXAMPLE`.
## Test

`npm run test`
3 changes: 2 additions & 1 deletion packages/codemirror-lang-lxlquery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"test": "vitest",
"prepare": "rollup -c",
"lint": "eslint . && prettier --check .",
"format": "prettier --write ."
"format": "prettier --write .",
"watch": "rollup -c --watch"
},
"type": "module",
"main": "dist/index.cjs",
Expand Down
6 changes: 6 additions & 0 deletions packages/supersearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ npm run dev -- --open

Everything inside `src/lib` is part of the library, everything inside `src/routes` can be used as a showcase or preview app.

To watch `src/lib` and rebuild when it changes:

```bash
npm run watch
```

## Building

To build the library:
Expand Down
3 changes: 2 additions & 1 deletion packages/supersearch/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"test:unit": "vitest",
"lint": "eslint . && prettier --check .",
"format": "prettier --write .",
"prepare": "npm run package"
"prepare": "npm run package",
"watch": "svelte-kit sync && svelte-package -w"
},
"files": [
"dist",
Expand Down
Loading