{"_id":"@binclusive/tree-sitter-kotlin-wasm","name":"@binclusive/tree-sitter-kotlin-wasm","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@binclusive/tree-sitter-kotlin-wasm","version":"0.1.0","description":"The tree-sitter Kotlin grammar (@tree-sitter-grammars/tree-sitter-kotlin 1.1.0) vendored as a checksum-pinned wasm asset, resolvable by package name.","license":"MIT","homepage":"https://github.com/Binclusive/monorepo/tree/main/packages/tree-sitter-kotlin-wasm","repository":{"type":"git","url":"git+https://github.com/Binclusive/monorepo.git","directory":"packages/tree-sitter-kotlin-wasm"},"keywords":["tree-sitter","kotlin","wasm","grammar"],"type":"module","sideEffects":false,"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./tree-sitter-kotlin.wasm":"./wasm/tree-sitter-kotlin.wasm","./package.json":"./package.json"},"engines":{"node":">=20"},"publishConfig":{"access":"public"},"devDependencies":{"tsup":"^8.0.0","typescript":"5.8.3","vitest":"~3.0.7","web-tree-sitter":"0.26.11","zod":"4.0.0","@binclusive/tsconfig":"^0.0.0"},"scripts":{"build":"tsup","typecheck":"tsc --noEmit","test":"vitest run","verify:tarball":"bash scripts/verify-tarball.sh"},"module":"./dist/index.js","_id":"@binclusive/tree-sitter-kotlin-wasm@0.1.0","bugs":{"url":"https://github.com/Binclusive/monorepo/issues"},"_integrity":"sha512-eCe1sUGBdSVaOxCyb30KyXCx8wawg3CWAN+w9dwpRp5Ro4PPxViF5cKEXU4di/laaVpWgnqJNFMznFb+UXPaXw==","_resolved":"/private/var/folders/7l/10nvtdw13mn_cgvnnnc93td00000gn/T/5a90e50ea7626cde4e2719ccb0cc9269/binclusive-tree-sitter-kotlin-wasm-0.1.0.tgz","_from":"file:binclusive-tree-sitter-kotlin-wasm-0.1.0.tgz","_nodeVersion":"22.21.1","_npmVersion":"10.9.4","dist":{"integrity":"sha512-eCe1sUGBdSVaOxCyb30KyXCx8wawg3CWAN+w9dwpRp5Ro4PPxViF5cKEXU4di/laaVpWgnqJNFMznFb+UXPaXw==","shasum":"b0b4e355f0359ced5e282d8c1c4e7f8f1361b666","tarball":"https://registry.npmjs.org/@binclusive/tree-sitter-kotlin-wasm/-/tree-sitter-kotlin-wasm-0.1.0.tgz","fileCount":8,"unpackedSize":3460051,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDwQ3RoFAHfqKlOQSKOnLESdWscEo631Vp2Fy0BEDnpbwIgIHtChgX5mP69ZkgTVoEgL5SBaM6t2EGowLphaFJO4DE="}]},"_npmUser":{"name":"cansirin","email":"cansirin12@gmail.com"},"directories":{},"maintainers":[{"name":"luuwa","email":"m.mucahitozekinci@gmail.com"},{"name":"cansirin","email":"cansirin12@gmail.com"},{"name":"binclusive-eng","email":"eng@binclusive.io"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/tree-sitter-kotlin-wasm_0.1.0_1785103353135_0.01303867724296004"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-26T22:02:33.022Z","0.1.0":"2026-07-26T22:02:33.271Z","modified":"2026-07-26T22:02:33.485Z"},"maintainers":[{"name":"luuwa","email":"m.mucahitozekinci@gmail.com"},{"name":"cansirin","email":"cansirin12@gmail.com"},{"name":"binclusive-eng","email":"eng@binclusive.io"}],"description":"The tree-sitter Kotlin grammar (@tree-sitter-grammars/tree-sitter-kotlin 1.1.0) vendored as a checksum-pinned wasm asset, resolvable by package name.","homepage":"https://github.com/Binclusive/monorepo/tree/main/packages/tree-sitter-kotlin-wasm","keywords":["tree-sitter","kotlin","wasm","grammar"],"repository":{"type":"git","url":"git+https://github.com/Binclusive/monorepo.git","directory":"packages/tree-sitter-kotlin-wasm"},"bugs":{"url":"https://github.com/Binclusive/monorepo/issues"},"license":"MIT","readme":"# `@binclusive/tree-sitter-kotlin-wasm`\n\nThe [tree-sitter Kotlin grammar](https://github.com/tree-sitter-grammars/tree-sitter-kotlin)\nvendored as a checksum-pinned `.wasm` asset, with zero runtime dependencies and no install script.\n\nUpstream **is** on npm, and we depended on it directly until #3834. Doing so cost **45 MB\ninstalled** and an `install: node-gyp-build` lifecycle script, to load one **3.3 MB** file — the\nother 41 MB is generated C parser source, native `.node` bindings for six platforms we never open,\nand `npm-check-updates`, a developer tool declared as a **runtime** dependency. This package\nrepublishes only the wasm, unmodified. Full provenance, the reproduce command and the upgrade\nprocedure are in [`PROVENANCE.md`](./PROVENANCE.md).\n\nThe sibling [`@binclusive/tree-sitter-swift-wasm`](../tree-sitter-swift-wasm) is the same shape for\nSwift. Both grammars now reach a customer the same way — a first-party vendored-wasm package\nresolved by name — so the Kotlin/Swift difference is a dependency name rather than a second\nacquisition mechanism.\n\n## Install\n\nPin it **exactly**. The grammar version decides what the scanner can see, so it is a correctness\ninput, not a compatible-upgrade axis (#3828, #3931):\n\n```sh\npnpm add -E @binclusive/tree-sitter-kotlin-wasm\n```\n\n## Use\n\n```ts\nimport { readFile } from \"node:fs/promises\";\nimport { fileURLToPath } from \"node:url\";\nimport {\n  KOTLIN_GRAMMAR,\n  KOTLIN_GRAMMAR_WASM_SPECIFIER,\n} from \"@binclusive/tree-sitter-kotlin-wasm\";\nimport { Language, Parser } from \"web-tree-sitter\";\n\nconst wasmPath = fileURLToPath(import.meta.resolve(KOTLIN_GRAMMAR_WASM_SPECIFIER));\n\n// Verify before you parse: a wrong or truncated grammar under-parses SILENTLY, so it\n// surfaces as missing findings rather than an error.\nconst bytes = await readFile(wasmPath);\nconst digest = Buffer.from(\n  await crypto.subtle.digest(\"SHA-256\", bytes),\n).toString(\"hex\");\nif (digest !== KOTLIN_GRAMMAR.sha256) throw new Error(\"Kotlin grammar digest mismatch\");\n\nawait Parser.init();\nconst parser = new Parser();\nparser.setLanguage(await Language.load(bytes));\n```\n\n`import.meta.resolve` is the load-bearing detail: resolution runs through this package's `exports`\nmap by name. A directory join off the *consumer's* `import.meta.url` is the exact mechanism behind\n#3120 — it resolves on the machine that built the image and nowhere else.\n\nIdentify the language from `KOTLIN_GRAMMAR`, not from the loaded module: this grammar is ABI 14,\nwhich predates grammar name metadata, so `Language.name` reads `null`.\n\n## Exports\n\n| Specifier | What |\n| --- | --- |\n| `@binclusive/tree-sitter-kotlin-wasm` | `KOTLIN_GRAMMAR` (upstream repo, npm package, version, asset name, byte length, SHA-256, ABI, licence) and `KOTLIN_GRAMMAR_WASM_SPECIFIER` |\n| `@binclusive/tree-sitter-kotlin-wasm/tree-sitter-kotlin.wasm` | the grammar bytes |\n\nThe entry point is constants only — no `node:` imports, no runtime dependency — so it loads on\nNode, Workers and the browser alike.\n\n## Publishing\n\nThe workspace tests verify the committed bytes; `verify:tarball` verifies the artifact a customer\nactually receives. It packs, installs the tarball into a throwaway directory outside this repo\n**with `--ignore-scripts`**, resolves the wasm by package name from that install and parses Kotlin\nwith it — so a broken `files` list, a `publishConfig` exports map or a newly-grown lifecycle script\nfails here rather than at a consumer:\n\n```sh\npnpm -C packages/tree-sitter-kotlin-wasm run verify:tarball\n```\n\n(`pnpm -C … run`, never `pnpm --filter … <script>` — the latter exits 0 when the script is missing,\n#3839.)\n\nThen publish the tarball (this workspace publishes packed tarballs rather than running\n`pnpm publish` in place):\n\n```sh\ncd packages/tree-sitter-kotlin-wasm\npnpm build\npnpm pack\nnpm publish --access public binclusive-tree-sitter-kotlin-wasm-<version>.tgz\n```\n\n## Licence\n\nThe grammar is MIT, © 2024 Amaan Qureshi. The upstream notice ships verbatim in\n[`LICENSE`](./LICENSE) and applies to the vendored wasm, which is the unmodified upstream artifact.\nThis package adds no separately-licensed code.\n","readmeFilename":"README.md","_rev":"1-8ffbd4691a6b664b60b6930161e10943"}