JavaScript / JSX indexer plugin for CodeMap (https://github.com/qxbyte/codemap)
Project description
codemap-javascript
A JavaScript / JSX indexer for CodeMap, distributed as an independent PyPI package.
What this package covers
| Extension | Grammar | Notes |
|---|---|---|
.js |
tree-sitter-javascript |
Plain JavaScript |
.jsx |
tree-sitter-javascript |
React-style JSX (the grammar handles JSX natively) |
.mjs |
tree-sitter-javascript |
ES module |
.cjs |
tree-sitter-javascript |
CommonJS module |
A single grammar instance handles all four extensions — .jsx is not
a separate grammar in tree-sitter-javascript.
Install
pip install codemap-javascript
After installation, codemap doctor lists javascript alongside the
built-in indexers (ADR-004 + ADR-L001).
What it captures
Backed by tree-sitter-javascript. Single-file, no cross-file resolution:
| AST node | Symbol kind | SymbolID descriptor |
|---|---|---|
function_declaration |
function |
<path>/name(). |
class_declaration |
class |
<path>/Cls# |
method_definition (inside class) |
method |
<path>/Cls#name(). |
Top-level const / let / var |
variable |
<path>/Name. |
Edges:
import_statementis read for future cross-module bridge consumption, but no edge is emitted at the module top-level (parity with the TypeScript plugin).
SymbolID encoding
scip-javascript . . . src/app/Service.js/UserService#login().
└─────────────┘ └──────────────────────────────────────┘
scheme file → namespaces / type / method
Why a separate plugin (vs. extending codemap-typescript)
TypeScript is a syntactic superset of JavaScript, so tree-sitter-typescript
can parse most .js / .jsx files. We ship a dedicated plugin instead
for three reasons:
- Clean dependency:
codemap-javascriptdoes not depend ontree-sitter-typescript. Users who only have JavaScript code do not need the larger grammar. - JS-specific error recovery: when a
.jsfile has a syntax error, the JavaScript grammar's error nodes point at JS-shaped tokens rather than TS-shaped ones, which produces tighter diagnostics. - Independent versioning: JS language updates (decorators, class
fields, RegExp
vflag) can ship at their own cadence without bumping the TypeScript plugin.
For pure type-extraction purposes the two plugins produce equivalent
symbol output for .js / .jsx files. Install whichever matches your
codebase; install both if you have a mixed code-base.
Tests
pip install -e ".[dev]"
pytest
Limits / next steps
- No cross-file
importresolution. Ajavascript_cross_modulebridge, sibling topython_cross_module, would be a future addition. - Arrow functions assigned to top-level
constare indexed asvariable, notfunction— matching the TypeScript plugin. Named arrow detection across both plugins is a v0.2.x improvement. - JSX-specific component patterns are not yet captured beyond the underlying function/class symbols.
License
MIT — same as the host project.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file codemap_javascript-0.4.0.tar.gz.
File metadata
- Download URL: codemap_javascript-0.4.0.tar.gz
- Upload date:
- Size: 6.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bed99deeed8e73de48dea4f25e3264c8561efa11d868e6ded3ba9c7707e95b42
|
|
| MD5 |
81e8c9aff4f7e39dfb5641991bc4f4f2
|
|
| BLAKE2b-256 |
65019781ab5485530b5bc3065be088507805a2a762e7d3d1130db2da45b3e706
|
Provenance
The following attestation bundles were made for codemap_javascript-0.4.0.tar.gz:
Publisher:
publish.yml on qxbyte/codemap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codemap_javascript-0.4.0.tar.gz -
Subject digest:
bed99deeed8e73de48dea4f25e3264c8561efa11d868e6ded3ba9c7707e95b42 - Sigstore transparency entry: 1970015404
- Sigstore integration time:
-
Permalink:
qxbyte/codemap@3f4e32839eac4b6c466d871d78f569948b04ab78 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/qxbyte
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3f4e32839eac4b6c466d871d78f569948b04ab78 -
Trigger Event:
push
-
Statement type:
File details
Details for the file codemap_javascript-0.4.0-py3-none-any.whl.
File metadata
- Download URL: codemap_javascript-0.4.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
951c9e32a340fbdc1b0ed23b7ede75a2c4aefafa97ea0026d499b64aef072e44
|
|
| MD5 |
64f665bcf2afa2b6a067a1b6a013b35c
|
|
| BLAKE2b-256 |
24d5f394fc4395c1cac42fc7a5c01c927e98447a62113be4a955d205a1410418
|
Provenance
The following attestation bundles were made for codemap_javascript-0.4.0-py3-none-any.whl:
Publisher:
publish.yml on qxbyte/codemap
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
codemap_javascript-0.4.0-py3-none-any.whl -
Subject digest:
951c9e32a340fbdc1b0ed23b7ede75a2c4aefafa97ea0026d499b64aef072e44 - Sigstore transparency entry: 1970015473
- Sigstore integration time:
-
Permalink:
qxbyte/codemap@3f4e32839eac4b6c466d871d78f569948b04ab78 -
Branch / Tag:
refs/tags/v0.4.0 - Owner: https://github.com/qxbyte
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3f4e32839eac4b6c466d871d78f569948b04ab78 -
Trigger Event:
push
-
Statement type: