@lumis-sh/wasm-dart 0.26.2 → 0.26.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +34 -4
- package/index.d.ts +25 -2
- package/index.js +34 -3
- package/lumis.json +22 -0
- package/package.json +15 -10
- package/tree-sitter-dart.wasm +0 -0
- package/index.node.js +0 -3
package/README.md
CHANGED
|
@@ -1,22 +1,52 @@
|
|
|
1
1
|
# @lumis-sh/wasm-dart
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Self-contained Lumis language package for dart.
|
|
4
|
+
|
|
5
|
+
The Tree-sitter parser is compiled to WASM and ships with the queries that highlight it.
|
|
4
6
|
|
|
5
7
|
Built with [`tree-sitter build --wasm`](https://tree-sitter.github.io/tree-sitter/cli/build.html) `v0.26.11`
|
|
6
8
|
|
|
7
9
|
Used by [Lumis](https://lumis.sh) and compatible with [web-tree-sitter](https://www.npmjs.com/package/web-tree-sitter) v0.26 and other WASM runtimes.
|
|
8
10
|
|
|
11
|
+
## Installation
|
|
12
|
+
|
|
13
|
+
```sh
|
|
14
|
+
npm install @lumis-sh/wasm-dart
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
The package exports the language, ready for Lumis, in Node and in a browser:
|
|
20
|
+
|
|
21
|
+
```js
|
|
22
|
+
import { createHighlighter } from '@lumis-sh/lumis'
|
|
23
|
+
import dart from '@lumis-sh/wasm-dart'
|
|
24
|
+
|
|
25
|
+
const highlighter = await createHighlighter({ languages: [dart] })
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## What it contains
|
|
29
|
+
|
|
30
|
+
`tree-sitter-dart.wasm` is the parser. `lumis.json` describes it and records its size, its SHA-256 and the queries.
|
|
31
|
+
|
|
32
|
+
Node reads both from the installed package, and a bundler ships them with your code, so nothing is downloaded at runtime.
|
|
33
|
+
|
|
9
34
|
## Parser
|
|
10
35
|
|
|
11
36
|
| Parser | Version | Rev |
|
|
12
37
|
| ------ | ------- | --- |
|
|
13
38
|
| [https://github.com/UserNobody14/tree-sitter-dart.git](https://github.com/UserNobody14/tree-sitter-dart.git) | 1.0.0 | be07cf7118d3dba06236a3f19541685a68209934 |
|
|
14
39
|
|
|
40
|
+
The same parser is published to Hex as
|
|
41
|
+
[`lumis_wasm_dart`](https://hex.pm/packages/lumis_wasm_dart) — byte for byte, from
|
|
42
|
+
one build, so both registries serve the same artifact.
|
|
43
|
+
|
|
15
44
|
## CDN
|
|
16
45
|
|
|
17
|
-
- [https://unpkg.com/@lumis-sh/wasm-dart@0.26/tree-sitter-dart.wasm](https://unpkg.com/@lumis-sh/wasm-dart@0.26/tree-sitter-dart.wasm)
|
|
18
|
-
- [https://cdn.jsdelivr.net/npm/@lumis-sh/wasm-dart@0.26/tree-sitter-dart.wasm](https://cdn.jsdelivr.net/npm/@lumis-sh/wasm-dart@0.26/tree-sitter-dart.wasm)
|
|
46
|
+
- [https://unpkg.com/@lumis-sh/wasm-dart@0.26.4/tree-sitter-dart.wasm](https://unpkg.com/@lumis-sh/wasm-dart@0.26.4/tree-sitter-dart.wasm)
|
|
47
|
+
- [https://cdn.jsdelivr.net/npm/@lumis-sh/wasm-dart@0.26.4/tree-sitter-dart.wasm](https://cdn.jsdelivr.net/npm/@lumis-sh/wasm-dart@0.26.4/tree-sitter-dart.wasm)
|
|
19
48
|
|
|
20
49
|
## License
|
|
21
50
|
|
|
22
|
-
|
|
51
|
+
The Lumis packaging is MIT. The parser itself is redistributed from the
|
|
52
|
+
upstream project above; see that project for its license.
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A language from this package. Pass it to `createHighlighter({ languages })`
|
|
3
|
+
* from `@lumis-sh/lumis`, in Node or in a browser.
|
|
4
|
+
*/
|
|
5
|
+
export interface Language {
|
|
6
|
+
id: string
|
|
7
|
+
aliases: string[]
|
|
8
|
+
packageName: string
|
|
9
|
+
/** The parser, which a bundler ships next to your code. */
|
|
10
|
+
wasm: URL
|
|
11
|
+
languagePackage: LanguagePackage
|
|
12
|
+
/** Grammars this language cannot highlight without, loaded along with it. */
|
|
13
|
+
requires?: Language[]
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** This package's `lumis.json`: the parser's size and digest, and the queries released with it. */
|
|
17
|
+
export interface LanguagePackage {
|
|
18
|
+
packageName: string
|
|
19
|
+
version: string
|
|
20
|
+
[field: string]: unknown
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export declare const languagePackage: LanguagePackage
|
|
24
|
+
export declare const dart: Language
|
|
25
|
+
export { dart as default }
|