@reponova/lang-typescript
v0.2.0
Published
TypeScript language support for RepoNova
Maintainers
Readme
@reponova/lang-typescript
TypeScript language support for RepoNova. Parses .ts, .mts, and .cts files via the official tree-sitter-typescript WASM grammar.
JSX-heavy .tsx files are handled by the sibling @reponova/lang-tsx plugin, which re-uses the extractor in this package against the dedicated .tsx grammar.
Install
reponova lang add @reponova/lang-typescriptWhat it extracts
- Symbols:
functiondeclarations andfunction_signature(.d.tsambient declarations + overload signatures, deduplicated by name)classandabstract classdeclarations withextends/implementsmethoddefinitions andmethod_signatureon classes, includingconstructor. Overload signatures are deduplicated.interfacedeclarations withextendsheritagetypealiases (type X = …)enumdeclarationsnamespace/moduleblocks- Class fields (
public_field_definition) asvariablesymbols hung under the class, preservingpublic/private/protected/readonly/staticmodifiers as decorators - Getters and setters as separate symbols, tagged with
getter/setterdecorators - Top-level arrow-function constants (
const handler = () => …) classified as functions - Top-level
UPPER_SNAKE_CASEconstants - Any exported
const/let/varbinding (export const userService = …) as aconstantsymbol
- Modifier markers (prepended to
decorators):asyncon async functions, async arrow functions, and async methodsgeneratoronfunction*andasync function*declarationsgetter/setteron class accessorsabstracton abstract method signatures
- Edges:
extendsfrom each class / interface to each base type (generics collapse to the bare name)callsfrom each function / method to every called identifier or member expression in its body
- Imports: default, named (
{ a, b }), namespace (* as ns), side-effect (import 'x'), type-only (import type { … }), andexport … from '…'re-exports (flagged withisExport: true). - Docstrings: the leading
/** … */JSDoc block at file start (module docstring), at every top-level declaration, and at every class member. - Decorators: TC39 / experimental decorators on classes, methods, and class fields (
@Logger,@loggable). - File node kind:
module.
Extensions
.ts, .mts, .cts
Configuration
In reponova.yml:
plugins:
typescript:
enabled: true # default: true
# patterns: [] # override global patterns for TypeScript files
# exclude: [] # override global exclude for TypeScript files| Property | Type | Default | Description |
|----------|------|---------|-------------|
| enabled | boolean | true | Enable/disable TypeScript file detection and extraction |
| patterns | string[] | [] | Glob patterns to override global file matching for this plugin |
| exclude | string[] | [] | Glob patterns to override global exclusions for this plugin |
Resolution semantics
- Relative (
./,../) and absolute (/) imports resolve against the file system, trying.ts,.mts,.cts,.d.ts, thenindex.ts/index.mts/index.cts/index.d.tsfor directory imports. - Bare specifiers (
react,@org/pkg) resolve to[]and are treated as external by the host.tsconfig.jsonpathsrewriting is not applied at this layer; the host RepoNova resolver is expected to apply project-level rewrites if needed. - Default exports appear in
exportsas the literal string"default"; if the export has a binding, that name is also included. - Function and method overloads are collapsed: a sequence of signatures followed by an implementation produces exactly one symbol per name (the implementation, or the only signature in
.d.tsfiles). Getters and setters with the same name keep their own symbols. - Call references are recorded by name only (
foo,obj.method) — no overload resolution, no generic instantiation tracking.
License
MIT — see LICENSE.
