@lumis-sh/wasm-slim 0.0.0-stage → 0.26.1

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Leandro Pereira
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,52 @@
1
- # Temporary Holding Version
1
+ # @lumis-sh/wasm-slim
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Self-contained Lumis language package for slim.
4
+
5
+ The Tree-sitter parser is compiled to WASM and ships with the queries that highlight it.
6
+
7
+ Built with [`tree-sitter build --wasm`](https://tree-sitter.github.io/tree-sitter/cli/build.html) `v0.26.11`
8
+
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.
10
+
11
+ ## Installation
12
+
13
+ ```sh
14
+ npm install @lumis-sh/wasm-slim
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 slim from '@lumis-sh/wasm-slim'
24
+
25
+ const highlighter = await createHighlighter({ languages: [slim] })
26
+ ```
27
+
28
+ ## What it contains
29
+
30
+ `tree-sitter-slim.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
+
34
+ ## Parser
35
+
36
+ | Parser | Version | Rev |
37
+ | ------ | ------- | --- |
38
+ | [https://github.com/theoo/tree-sitter-slim.git](https://github.com/theoo/tree-sitter-slim.git) | 0.0.1 | d4ff7e388eb271c04662f2176c08548c9c51078f |
39
+
40
+ The same parser is published to Hex as
41
+ [`lumis_wasm_slim`](https://hex.pm/packages/lumis_wasm_slim) — byte for byte, from
42
+ one build, so both registries serve the same artifact.
43
+
44
+ ## CDN
45
+
46
+ - [https://unpkg.com/@lumis-sh/wasm-slim@0.26.1/tree-sitter-slim.wasm](https://unpkg.com/@lumis-sh/wasm-slim@0.26.1/tree-sitter-slim.wasm)
47
+ - [https://cdn.jsdelivr.net/npm/@lumis-sh/wasm-slim@0.26.1/tree-sitter-slim.wasm](https://cdn.jsdelivr.net/npm/@lumis-sh/wasm-slim@0.26.1/tree-sitter-slim.wasm)
48
+
49
+ ## License
50
+
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 ADDED
@@ -0,0 +1,28 @@
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
+ /**
10
+ * The parser, which a bundler ships next to your code: a `URL`, or a
11
+ * `WebAssembly.Module` on Cloudflare Workers and Vercel's Edge runtime.
12
+ */
13
+ wasm: URL | WebAssembly.Module
14
+ languagePackage: LanguagePackage
15
+ /** Grammars this language cannot highlight without, loaded along with it. */
16
+ requires?: Language[]
17
+ }
18
+
19
+ /** This package's `lumis.json`: the parser's digest, and the queries released with it. */
20
+ export interface LanguagePackage {
21
+ packageName: string
22
+ version: string
23
+ [field: string]: unknown
24
+ }
25
+
26
+ export declare const languagePackage: LanguagePackage
27
+ export declare const slim: Language
28
+ export { slim as default }
package/index.edge.js ADDED
@@ -0,0 +1,15 @@
1
+ import { languagePackage } from './language-package.js'
2
+
3
+ import wasm from './tree-sitter-slim.wasm?module'
4
+
5
+ export { languagePackage }
6
+
7
+ export const slim = {
8
+ id: "slim",
9
+ aliases: [],
10
+ packageName: "@lumis-sh/wasm-slim",
11
+ wasm,
12
+ languagePackage,
13
+ }
14
+
15
+ export default slim
package/index.js ADDED
@@ -0,0 +1,15 @@
1
+ import { languagePackage } from './language-package.js'
2
+
3
+ const wasm = new URL('./tree-sitter-slim.wasm', import.meta.url)
4
+
5
+ export { languagePackage }
6
+
7
+ export const slim = {
8
+ id: "slim",
9
+ aliases: [],
10
+ packageName: "@lumis-sh/wasm-slim",
11
+ wasm,
12
+ languagePackage,
13
+ }
14
+
15
+ export default slim
@@ -0,0 +1,15 @@
1
+ import { languagePackage } from './language-package.js'
2
+
3
+ import wasm from './tree-sitter-slim.wasm'
4
+
5
+ export { languagePackage }
6
+
7
+ export const slim = {
8
+ id: "slim",
9
+ aliases: [],
10
+ packageName: "@lumis-sh/wasm-slim",
11
+ wasm,
12
+ languagePackage,
13
+ }
14
+
15
+ export default slim
@@ -0,0 +1,22 @@
1
+ export const languagePackage = {
2
+ "packageName": "@lumis-sh/wasm-slim",
3
+ "version": "0.26.1",
4
+ "definitionHash": "bc4564409cfd749e9325aef0fb81e501a3281963df170a83849174734a4ad4d8",
5
+ "parser": {
6
+ "name": "tree-sitter-slim",
7
+ "grammarName": "slim",
8
+ "upstreamVersion": "0.0.1",
9
+ "revision": "d4ff7e388eb271c04662f2176c08548c9c51078f",
10
+ "sha256": "b9f41a17967333915c2d5e86520b5ba1cd26cf9a46c27f99da22105fdc2b53ae",
11
+ "size": 196428
12
+ },
13
+ "languages": {
14
+ "slim": {
15
+ "aliases": [],
16
+ "highlights": "; This file is auto-generated. Do not edit.\n(comment) @comment \n\n(tag_id) @keyword.function\n\n(tag_class) @keyword.type\n\n(injector) @keyword.import\n\n(directive_sign) @keyword.directive\n\n[\n (string_start)\n (string_content)\n (string_end)\n] @string\n\n(bracket) @punctuation.bracket\n\n[\n \"#{\"\n \"}\"\n] @punctuation.special\n\n(delimiter) @tag.delimiter\n\n(parameter_name) @variable.parameter\n\n(parameter_value) @tag.attribute\n\n[\n (text_inline)\n (text_block)\n] @markup.raw.block\n\n; Markup tags\n; https://developer.mozilla.org/en-US/docs/Web/HTML/Element\n(tag_name) @tag\n\n((tag_name) @tag.builtin\n (#any-of? @tag.builtin\n \"doctype\" \"html\" \"head\" \"title\" \"base\" \"link\" \"meta\" \"style\" \"body\" \"article\" \"section\" \"nav\"\n \"aside\" \"hgroup\" \"footer\" \"address\" \"p\" \"hr\" \"pre\" \"blockquote\" \"menu\" \"figure\" \"figcaption\"\n \"main\" \"div\" \"small\" \"s\" \"cite\" \"q\" \"dfn\" \"abbr\" \"rt\" \"rp\" \"data\" \"time\" \"code\" \"var\" \"samp\"\n \"kbd\" \"sub\" \"sup\" \"u\" \"mark\" \"bdi\" \"bdo\" \"span\" \"br\" \"wbr\" \"ins\" \"del\" \"picture\" \"source\" \"img\"\n \"iframe\" \"embed\" \"object\" \"param\" \"video\" \"audio\" \"track\" \"map\" \"area\" \"table\" \"caption\"\n \"colgroup\" \"col\" \"tbody\" \"thead\" \"tfoot\" \"tr\" \"td\" \"th\" \"form\" \"label\" \"input\" \"button\" \"select\"\n \"datalist\" \"optgroup\" \"option\" \"textarea\" \"output\" \"progress\" \"meter\" \"fieldset\" \"legend\"\n \"details\" \"summary\" \"dialog\" \"script\" \"noscript\" \"template\" \"slot\" \"canvas\"))\n\n((tag_name) @markup.strong\n (#any-of? @markup.strong \"b\" \"strong\"))\n\n((tag_name) @markup.italic\n (#any-of? @markup.italic \"i\" \"em\"))\n\n((tag_name) @markup.link\n (#eq? @markup.link \"a\"))\n\n; Headings\n((tag_name) @markup.heading\n (#eq? @markup.heading \"header\"))\n\n((tag_name) @markup.heading.1\n (#eq? @markup.heading.1 \"h1\"))\n\n((tag_name) @markup.heading.2\n (#eq? @markup.heading.2 \"h2\"))\n\n((tag_name) @markup.heading.3\n (#eq? @markup.heading.3 \"h3\"))\n\n((tag_name) @markup.heading.4\n (#eq? @markup.heading.4 \"h4\"))\n\n((tag_name) @markup.heading.5\n (#eq? @markup.heading.5 \"h5\"))\n\n((tag_name) @markup.heading.6\n (#eq? @markup.heading.6 \"h6\"))\n\n((tag_name) @markup.list\n (#any-of? @markup.list \"ul\" \"ol\" \"li\" \"dl\" \"dt\" \"dd\"))",
17
+ "injections": "; This file is auto-generated. Do not edit.\n((ruby_inline) @injection.content\n (#set! injection.language \"ruby\"))\n\n((ruby_lang) @injection.content\n (#set! injection.language \"ruby\")\n (#set! injection.combined))\n\n((javascript_lang) @injection.content\n (#set! injection.language \"javascript\")\n (#set! injection.combined))\n\n((css_lang) @injection.content\n (#set! injection.language \"css\")\n (#set! injection.combined))\n\n((sass_lang) @injection.content\n (#set! injection.language \"sass\")\n (#set! injection.combined))\n\n((scss_lang) @injection.content\n (#set! injection.language \"scss\")\n (#set! injection.combined))\n\n((less_lang) @injection.content\n (#set! injection.language \"less\")\n (#set! injection.combined))\n\n((scss_lang) @injection.content\n (#set! injection.language \"scss\")\n (#set! injection.combined))\n\n((markdown_lang) @injection.content\n (#set! injection.language \"markdown\"))\n\n((rdoc_lang) @injection.content\n (#set! injection.language \"rdoc\"))\n\n((comment) @injection.content\n (#set! injection.language \"comment\"))",
18
+ "locals": "; This file is auto-generated. Do not edit.\n(child) @local.scope\n\n(tag_name) @local.definition.function\n\n(tag_class) @local.definition.parameter\n\n(tag_id) @local.definition.constant",
19
+ "brackets": "; This file is auto-generated. Do not edit.\n(\"(\" @open\n \")\" @close)\n\n(\"[\" @open\n \"]\" @close)\n\n(\"{\" @open\n \"}\" @close)\n"
20
+ }
21
+ }
22
+ }
package/lumis.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "packageName": "@lumis-sh/wasm-slim",
3
+ "version": "0.26.1",
4
+ "definitionHash": "bc4564409cfd749e9325aef0fb81e501a3281963df170a83849174734a4ad4d8",
5
+ "parser": {
6
+ "name": "tree-sitter-slim",
7
+ "grammarName": "slim",
8
+ "upstreamVersion": "0.0.1",
9
+ "revision": "d4ff7e388eb271c04662f2176c08548c9c51078f",
10
+ "sha256": "b9f41a17967333915c2d5e86520b5ba1cd26cf9a46c27f99da22105fdc2b53ae",
11
+ "size": 196428
12
+ },
13
+ "languages": {
14
+ "slim": {
15
+ "aliases": [],
16
+ "highlights": "; This file is auto-generated. Do not edit.\n(comment) @comment \n\n(tag_id) @keyword.function\n\n(tag_class) @keyword.type\n\n(injector) @keyword.import\n\n(directive_sign) @keyword.directive\n\n[\n (string_start)\n (string_content)\n (string_end)\n] @string\n\n(bracket) @punctuation.bracket\n\n[\n \"#{\"\n \"}\"\n] @punctuation.special\n\n(delimiter) @tag.delimiter\n\n(parameter_name) @variable.parameter\n\n(parameter_value) @tag.attribute\n\n[\n (text_inline)\n (text_block)\n] @markup.raw.block\n\n; Markup tags\n; https://developer.mozilla.org/en-US/docs/Web/HTML/Element\n(tag_name) @tag\n\n((tag_name) @tag.builtin\n (#any-of? @tag.builtin\n \"doctype\" \"html\" \"head\" \"title\" \"base\" \"link\" \"meta\" \"style\" \"body\" \"article\" \"section\" \"nav\"\n \"aside\" \"hgroup\" \"footer\" \"address\" \"p\" \"hr\" \"pre\" \"blockquote\" \"menu\" \"figure\" \"figcaption\"\n \"main\" \"div\" \"small\" \"s\" \"cite\" \"q\" \"dfn\" \"abbr\" \"rt\" \"rp\" \"data\" \"time\" \"code\" \"var\" \"samp\"\n \"kbd\" \"sub\" \"sup\" \"u\" \"mark\" \"bdi\" \"bdo\" \"span\" \"br\" \"wbr\" \"ins\" \"del\" \"picture\" \"source\" \"img\"\n \"iframe\" \"embed\" \"object\" \"param\" \"video\" \"audio\" \"track\" \"map\" \"area\" \"table\" \"caption\"\n \"colgroup\" \"col\" \"tbody\" \"thead\" \"tfoot\" \"tr\" \"td\" \"th\" \"form\" \"label\" \"input\" \"button\" \"select\"\n \"datalist\" \"optgroup\" \"option\" \"textarea\" \"output\" \"progress\" \"meter\" \"fieldset\" \"legend\"\n \"details\" \"summary\" \"dialog\" \"script\" \"noscript\" \"template\" \"slot\" \"canvas\"))\n\n((tag_name) @markup.strong\n (#any-of? @markup.strong \"b\" \"strong\"))\n\n((tag_name) @markup.italic\n (#any-of? @markup.italic \"i\" \"em\"))\n\n((tag_name) @markup.link\n (#eq? @markup.link \"a\"))\n\n; Headings\n((tag_name) @markup.heading\n (#eq? @markup.heading \"header\"))\n\n((tag_name) @markup.heading.1\n (#eq? @markup.heading.1 \"h1\"))\n\n((tag_name) @markup.heading.2\n (#eq? @markup.heading.2 \"h2\"))\n\n((tag_name) @markup.heading.3\n (#eq? @markup.heading.3 \"h3\"))\n\n((tag_name) @markup.heading.4\n (#eq? @markup.heading.4 \"h4\"))\n\n((tag_name) @markup.heading.5\n (#eq? @markup.heading.5 \"h5\"))\n\n((tag_name) @markup.heading.6\n (#eq? @markup.heading.6 \"h6\"))\n\n((tag_name) @markup.list\n (#any-of? @markup.list \"ul\" \"ol\" \"li\" \"dl\" \"dt\" \"dd\"))",
17
+ "injections": "; This file is auto-generated. Do not edit.\n((ruby_inline) @injection.content\n (#set! injection.language \"ruby\"))\n\n((ruby_lang) @injection.content\n (#set! injection.language \"ruby\")\n (#set! injection.combined))\n\n((javascript_lang) @injection.content\n (#set! injection.language \"javascript\")\n (#set! injection.combined))\n\n((css_lang) @injection.content\n (#set! injection.language \"css\")\n (#set! injection.combined))\n\n((sass_lang) @injection.content\n (#set! injection.language \"sass\")\n (#set! injection.combined))\n\n((scss_lang) @injection.content\n (#set! injection.language \"scss\")\n (#set! injection.combined))\n\n((less_lang) @injection.content\n (#set! injection.language \"less\")\n (#set! injection.combined))\n\n((scss_lang) @injection.content\n (#set! injection.language \"scss\")\n (#set! injection.combined))\n\n((markdown_lang) @injection.content\n (#set! injection.language \"markdown\"))\n\n((rdoc_lang) @injection.content\n (#set! injection.language \"rdoc\"))\n\n((comment) @injection.content\n (#set! injection.language \"comment\"))",
18
+ "locals": "; This file is auto-generated. Do not edit.\n(child) @local.scope\n\n(tag_name) @local.definition.function\n\n(tag_class) @local.definition.parameter\n\n(tag_id) @local.definition.constant",
19
+ "brackets": "; This file is auto-generated. Do not edit.\n(\"(\" @open\n \")\" @close)\n\n(\"[\" @open\n \"]\" @close)\n\n(\"{\" @open\n \"}\" @close)\n"
20
+ }
21
+ }
22
+ }
package/package.json CHANGED
@@ -1,6 +1,38 @@
1
1
  {
2
2
  "name": "@lumis-sh/wasm-slim",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.26.1",
4
+ "type": "module",
5
+ "types": "./index.d.ts",
6
+ "description": "Tree-sitter parser and queries for slim, compiled to WASM for Lumis",
7
+ "author": "Leandro Pereira",
8
+ "license": "MIT",
9
+ "homepage": "https://lumis.sh",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "git+https://github.com/leandrocp/lumis.git"
13
+ },
14
+ "exports": {
15
+ ".": {
16
+ "types": "./index.d.ts",
17
+ "workerd": "./index.workerd.js",
18
+ "edge-light": "./index.edge.js",
19
+ "default": "./index.js"
20
+ },
21
+ "./tree-sitter-slim.wasm": "./tree-sitter-slim.wasm",
22
+ "./lumis.json": "./lumis.json"
23
+ },
24
+ "lumis": {
25
+ "treeSitter": "0.26",
26
+ "formatVersion": 5,
27
+ "definitionHash": "bc4564409cfd749e9325aef0fb81e501a3281963df170a83849174734a4ad4d8"
28
+ },
29
+ "peerDependencies": {
30
+ "@lumis-sh/lumis": ">=0.9.0"
31
+ },
32
+ "peerDependenciesMeta": {
33
+ "@lumis-sh/lumis": { "optional": true }
34
+ },
35
+ "dependencies": {},
36
+ "keywords": ["lumis-sh", "wasm", "tree-sitter"],
37
+ "files": ["*.wasm", "*.json", "*.js", "*.d.ts", "README.md", "LICENSE"]
38
+ }
Binary file