tscode-kg 0.6.0__tar.gz → 0.7.0__tar.gz
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.
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/PKG-INFO +4 -4
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/README.md +3 -3
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/pyproject.toml +1 -1
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/__init__.py +1 -1
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_snapshot.py +40 -11
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/LICENSE +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/__main__.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/analysis.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/app.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/bridge.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/centrality.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/__init__.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_analyze.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_bridges.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_build.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_centrality.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_explain.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_framework_nodes.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_hooks.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_init.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_mcp.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_model.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_query.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/cmd_viz.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/cli/main.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/coderank.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/config.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/explain.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/extractor.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/framework_detector.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/kg.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/layout3d.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/mcp_server.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/snapshots.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/viz3d.py +0 -0
- {tscode_kg-0.6.0 → tscode_kg-0.7.0}/src/tscode_kg/viz3d_timeline.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: tscode-kg
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.7.0
|
|
4
4
|
Summary: Knowledge graph for TypeScript/JavaScript codebases — AST extraction, hybrid semantic+structural search
|
|
5
5
|
License-Expression: Elastic-2.0
|
|
6
6
|
License-File: LICENSE
|
|
@@ -42,7 +42,7 @@ Description-Content-Type: text/markdown
|
|
|
42
42
|
[](https://www.python.org/)
|
|
43
43
|
[](https://www.elastic.co/licensing/elastic-license)
|
|
44
44
|
[](https://pypi.org/project/tscode-kg/)
|
|
45
|
-
[](https://github.com/Flux-Frontiers/tscode_kg/releases)
|
|
46
46
|
[](https://github.com/Flux-Frontiers/tscode_kg/actions/workflows/ci.yml)
|
|
47
47
|
[](https://python-poetry.org/)
|
|
48
48
|
[](https://doi.org/10.5281/zenodo.22559450)
|
|
@@ -195,13 +195,13 @@ If you use TypeScriptKG in your research or project, please cite it:
|
|
|
195
195
|
|
|
196
196
|
[](https://doi.org/10.5281/zenodo.22559450)
|
|
197
197
|
|
|
198
|
-
> Suchanek, E. G. (2026). *TypeScriptKG: Semantic Knowledge Graph for TypeScript/JavaScript Codebases* (Version 0.
|
|
198
|
+
> Suchanek, E. G. (2026). *TypeScriptKG: Semantic Knowledge Graph for TypeScript/JavaScript Codebases* (Version 0.7.0) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.22559450
|
|
199
199
|
|
|
200
200
|
```bibtex
|
|
201
201
|
@software{suchanek_tscode_kg,
|
|
202
202
|
author = {Suchanek, Eric G.},
|
|
203
203
|
title = {{TypeScriptKG}: Semantic Knowledge Graph for TypeScript/JavaScript Codebases},
|
|
204
|
-
version = {0.
|
|
204
|
+
version = {0.7.0},
|
|
205
205
|
year = {2026},
|
|
206
206
|
publisher = {Flux-Frontiers},
|
|
207
207
|
doi = {10.5281/zenodo.22559450},
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://www.python.org/)
|
|
4
4
|
[](https://www.elastic.co/licensing/elastic-license)
|
|
5
5
|
[](https://pypi.org/project/tscode-kg/)
|
|
6
|
-
[](https://github.com/Flux-Frontiers/tscode_kg/releases)
|
|
7
7
|
[](https://github.com/Flux-Frontiers/tscode_kg/actions/workflows/ci.yml)
|
|
8
8
|
[](https://python-poetry.org/)
|
|
9
9
|
[](https://doi.org/10.5281/zenodo.22559450)
|
|
@@ -156,13 +156,13 @@ If you use TypeScriptKG in your research or project, please cite it:
|
|
|
156
156
|
|
|
157
157
|
[](https://doi.org/10.5281/zenodo.22559450)
|
|
158
158
|
|
|
159
|
-
> Suchanek, E. G. (2026). *TypeScriptKG: Semantic Knowledge Graph for TypeScript/JavaScript Codebases* (Version 0.
|
|
159
|
+
> Suchanek, E. G. (2026). *TypeScriptKG: Semantic Knowledge Graph for TypeScript/JavaScript Codebases* (Version 0.7.0) [Software]. Flux-Frontiers. https://doi.org/10.5281/zenodo.22559450
|
|
160
160
|
|
|
161
161
|
```bibtex
|
|
162
162
|
@software{suchanek_tscode_kg,
|
|
163
163
|
author = {Suchanek, Eric G.},
|
|
164
164
|
title = {{TypeScriptKG}: Semantic Knowledge Graph for TypeScript/JavaScript Codebases},
|
|
165
|
-
version = {0.
|
|
165
|
+
version = {0.7.0},
|
|
166
166
|
year = {2026},
|
|
167
167
|
publisher = {Flux-Frontiers},
|
|
168
168
|
doi = {10.5281/zenodo.22559450},
|
|
@@ -38,7 +38,7 @@ packages = [{ include = "tscode_kg", from = "src" }]
|
|
|
38
38
|
|
|
39
39
|
[project]
|
|
40
40
|
name = "tscode-kg"
|
|
41
|
-
version = "0.
|
|
41
|
+
version = "0.7.0"
|
|
42
42
|
description = "Knowledge graph for TypeScript/JavaScript codebases — AST extraction, hybrid semantic+structural search"
|
|
43
43
|
readme = "README.md"
|
|
44
44
|
license = "Elastic-2.0"
|
|
@@ -14,12 +14,38 @@ from __future__ import annotations
|
|
|
14
14
|
|
|
15
15
|
import json
|
|
16
16
|
import logging
|
|
17
|
+
import re
|
|
17
18
|
from pathlib import Path
|
|
18
19
|
|
|
19
20
|
import click
|
|
20
21
|
|
|
21
22
|
logger = logging.getLogger(__name__)
|
|
22
23
|
|
|
24
|
+
_CFF_VERSION_RE = re.compile(r'^version:\s*["\']?([^"\'\s]+)', re.M)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
def repo_version(repo_root: Path) -> str | None:
|
|
28
|
+
"""Return the measured repo's own version, if it declares one.
|
|
29
|
+
|
|
30
|
+
Reads ``version`` from the root ``package.json``, then from
|
|
31
|
+
``CITATION.cff``, which covers a repo whose ``package.json`` sits in a
|
|
32
|
+
subdirectory or that has none.
|
|
33
|
+
|
|
34
|
+
:param repo_root: Repository root.
|
|
35
|
+
:return: The version string, or ``None`` when neither file declares one.
|
|
36
|
+
"""
|
|
37
|
+
try:
|
|
38
|
+
version = json.loads((repo_root / "package.json").read_text()).get("version")
|
|
39
|
+
except (OSError, ValueError, AttributeError):
|
|
40
|
+
version = None
|
|
41
|
+
if isinstance(version, str) and version:
|
|
42
|
+
return version
|
|
43
|
+
try:
|
|
44
|
+
match = _CFF_VERSION_RE.search((repo_root / "CITATION.cff").read_text())
|
|
45
|
+
except OSError:
|
|
46
|
+
return None
|
|
47
|
+
return match.group(1) if match else None
|
|
48
|
+
|
|
23
49
|
|
|
24
50
|
@click.group("snapshot")
|
|
25
51
|
def snapshot() -> None:
|
|
@@ -85,9 +111,10 @@ def save_snapshot(
|
|
|
85
111
|
Reads graph statistics and JSDoc coverage from the SQLite graph, runs the
|
|
86
112
|
analyzer for issue counts and hotspots, then saves a snapshot keyed on
|
|
87
113
|
VERSION. Omit VERSION and the snapshot is keyed on a UTC timestamp, which
|
|
88
|
-
is the right answer for a corpus with no release tag
|
|
89
|
-
|
|
90
|
-
is
|
|
114
|
+
is the right answer for a corpus with no release tag, and records the
|
|
115
|
+
repo's own version from its root package.json or CITATION.cff. The tree
|
|
116
|
+
hash is recorded as provenance and auto-detected from git when not
|
|
117
|
+
provided; it is not the key.
|
|
91
118
|
|
|
92
119
|
Snapshots are stored in .tscodekg/snapshots/{key}.json, with a
|
|
93
120
|
manifest.json tracking all snapshots and their metrics.
|
|
@@ -118,10 +145,11 @@ def capture_snapshot(
|
|
|
118
145
|
) -> None:
|
|
119
146
|
"""Capture and persist a snapshot; shared by ``snapshot save`` and ``init``.
|
|
120
147
|
|
|
121
|
-
:param version: Release tag, becoming the snapshot's key
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
148
|
+
:param version: Release tag, becoming the snapshot's key. When falsy,
|
|
149
|
+
the snapshot records the repo's own version from :func:`repo_version`
|
|
150
|
+
(or, failing that, the installed package's) and is keyed on a UTC
|
|
151
|
+
timestamp instead. Never used as the key without being explicitly
|
|
152
|
+
passed here.
|
|
125
153
|
:param repo: Repository root path.
|
|
126
154
|
:param db: SQLite graph path; defaults to ``<repo>/.tscodekg/graph.sqlite``.
|
|
127
155
|
:param snapshots_dir: Snapshots directory; defaults to ``<repo>/.tscodekg/snapshots``.
|
|
@@ -129,7 +157,8 @@ def capture_snapshot(
|
|
|
129
157
|
:param tree_hash: Git tree hash, recorded as provenance; auto-detected
|
|
130
158
|
when empty. It is not the snapshot's key.
|
|
131
159
|
:param subject: What was measured, e.g. ``repo:tscode-kg``. Recorded
|
|
132
|
-
separately from ``
|
|
160
|
+
separately from ``tool`` and ``tool_version``, which name the measuring
|
|
161
|
+
tool.
|
|
133
162
|
"""
|
|
134
163
|
from tscode_kg.kg import TypeScriptKG # pylint: disable=import-outside-toplevel
|
|
135
164
|
from tscode_kg.snapshots import SnapshotManager # pylint: disable=import-outside-toplevel
|
|
@@ -180,7 +209,7 @@ def capture_snapshot(
|
|
|
180
209
|
kg.close()
|
|
181
210
|
|
|
182
211
|
snapshot_obj = snap_mgr.capture(
|
|
183
|
-
version=version or
|
|
212
|
+
version=version or repo_version(repo_root),
|
|
184
213
|
branch=branch,
|
|
185
214
|
graph_stats_dict=stats,
|
|
186
215
|
critical_issues=critical_issues,
|
|
@@ -188,8 +217,8 @@ def capture_snapshot(
|
|
|
188
217
|
hotspots=hotspots,
|
|
189
218
|
issues=issue_strings,
|
|
190
219
|
tree_hash=tree_hash,
|
|
191
|
-
# An explicit VERSION is a release tag and becomes the key.
|
|
192
|
-
#
|
|
220
|
+
# An explicit VERSION is a release tag and becomes the key. A
|
|
221
|
+
# detected one (the repo's, or the tool's) must not be.
|
|
193
222
|
key=version or "",
|
|
194
223
|
subject=subject,
|
|
195
224
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|