Vue SFC (.vue) indexer plugin for CodeMap (https://github.com/qxbyte/codemap)
Project description
codemap-vue
A Vue Single File Component (
.vue) indexer for CodeMap, distributed as an independent PyPI package.
What it captures
Backed by a small regex-based SFC scanner + tree-sitter:
| SFC block | Indexed | Backed by |
|---|---|---|
<template> |
❌ Ignored | — |
<script> (lang="js" / default) |
✅ | tree-sitter-javascript (required) |
<script> (lang="jsx") |
✅ | tree-sitter-javascript (required) |
<script> (lang="ts") |
✅ (with [typescript] extra) |
tree-sitter-typescript (optional) |
<script> (lang="tsx") |
✅ (with [typescript] extra) |
tree-sitter-typescript (optional) |
<script setup> (lang="ts") |
✅ (with [typescript] extra) |
tree-sitter-typescript (optional) |
<style> |
❌ Ignored | — |
Inside the <script> block, the same symbol kinds as codemap-javascript
and codemap-typescript are surfaced:
| AST node | Symbol kind |
|---|---|
function_declaration |
function |
class_declaration |
class |
method_definition (inside class) |
method |
Top-level const / let / var |
variable (with extra.vue_block_lang) |
Line numbers are translated back to the original .vue file coordinate
space, so codemap get jumps to the correct line even when the script
block starts hundreds of lines below <template>.
Install
# JavaScript-only Vue projects (no <script lang="ts">):
pip install codemap-vue
# Vue projects that use TypeScript in <script setup lang="ts"> (the
# Vue 3 default):
pip install "codemap-vue[typescript]"
tree-sitter-typescript is an optional dependency because some Vue
projects (Vue 2 codebases, JS-only sites) do not need it. When you index
a .vue file with <script lang="ts"> and the extra is not installed,
the plugin emits a VUE003 warning instead of crashing.
Implementation notes
tree-sitter-vue is not currently published on PyPI. Rather than
bundle a hand-compiled grammar, this plugin uses a permissive regex
scanner (codemap_vue.sfc.extract_script_blocks) to locate every
top-level <script> block in the SFC, read its lang= attribute, and
slice out the inner bytes. The inner bytes are then handed to the
appropriate tree-sitter grammar.
The scanner is intentionally permissive about malformed input: a
missing </script> closing tag still produces a block that runs to
EOF, so indexing partial / in-progress files still yields useful
symbols.
SymbolID encoding
scip-vue . . . src/components/UserList.vue/fetchUser().
└──────┘ └────────────────────────────────────────┘
scheme file → namespaces / type / method
Tests
pip install -e ".[dev]"
pytest
Limits / next steps
<template>contents (directives, expressions,v-onhandlers) are not parsed. A futurecodemap-vueminor release could expose declared template refs (<input ref="emailRef" />) anddefineProps/defineEmitsmacros as symbols.<script setup>macros (defineProps,defineExpose, …) are surfaced only when they appear as ordinary function calls inside a variable declaration. Treating them as first-class component-shape symbols is a v0.2.x improvement.- Class-based component decorators (vue-class-component / vue-property-decorator) are not yet captured.
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_vue-0.2.2.tar.gz.
File metadata
- Download URL: codemap_vue-0.2.2.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8d6dea5a68aa5c84fcbab78b471bf5abd4adc49758e8d8f8c38bc6ad517cb692
|
|
| MD5 |
f8316af7094815347ab27adf98ed4021
|
|
| BLAKE2b-256 |
4a67bb609009241763b4826ef3267777d21bacff08232fea55548d4107248acf
|
Provenance
The following attestation bundles were made for codemap_vue-0.2.2.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_vue-0.2.2.tar.gz -
Subject digest:
8d6dea5a68aa5c84fcbab78b471bf5abd4adc49758e8d8f8c38bc6ad517cb692 - Sigstore transparency entry: 1734145385
- Sigstore integration time:
-
Permalink:
qxbyte/codemap@d601018378caa55a17ec5c8c0e044ecf037a454e -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/qxbyte
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d601018378caa55a17ec5c8c0e044ecf037a454e -
Trigger Event:
push
-
Statement type:
File details
Details for the file codemap_vue-0.2.2-py3-none-any.whl.
File metadata
- Download URL: codemap_vue-0.2.2-py3-none-any.whl
- Upload date:
- Size: 8.1 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 |
f36da03c47c84be8d922b047ea7396eabad8363ae6cfd9b48fede1dfcb4c3cd9
|
|
| MD5 |
454bbfa3993dd8f98af710abd477aad4
|
|
| BLAKE2b-256 |
b7b4f06836ba58ef4d0ea16fc151609b07274f1f07155724dd479ca49739974d
|
Provenance
The following attestation bundles were made for codemap_vue-0.2.2-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_vue-0.2.2-py3-none-any.whl -
Subject digest:
f36da03c47c84be8d922b047ea7396eabad8363ae6cfd9b48fede1dfcb4c3cd9 - Sigstore transparency entry: 1734145474
- Sigstore integration time:
-
Permalink:
qxbyte/codemap@d601018378caa55a17ec5c8c0e044ecf037a454e -
Branch / Tag:
refs/tags/v0.2.2 - Owner: https://github.com/qxbyte
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@d601018378caa55a17ec5c8c0e044ecf037a454e -
Trigger Event:
push
-
Statement type: