docbridge 0.11.0 → 0.12.0

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +56 -1
  2. package/README.md +16 -9
  3. package/dist/bin/darwin-arm64/SHA256SUMS +3 -3
  4. package/dist/bin/darwin-arm64/docbridge-go-scanner +0 -0
  5. package/dist/bin/darwin-arm64/docbridge-swift-scanner +0 -0
  6. package/dist/bin/darwin-arm64/docbridge_dart_scanner +0 -0
  7. package/dist/bin/linux-x64/SHA256SUMS +2 -2
  8. package/dist/bin/linux-x64/docbridge-go-scanner +0 -0
  9. package/dist/bin/linux-x64/docbridge-swift-scanner +1 -1
  10. package/dist/index.js +1761 -678
  11. package/dist/workers/java/docbridge-java-scanner.jar +0 -0
  12. package/dist/workers/python/docbridge_python_scanner/__init__.py +6 -0
  13. package/dist/workers/python/docbridge_python_scanner/comments.py +177 -0
  14. package/dist/workers/python/docbridge_python_scanner/declarations.py +318 -0
  15. package/dist/workers/python/docbridge_python_scanner/links.py +62 -0
  16. package/dist/workers/python/docbridge_python_scanner/positions.py +75 -0
  17. package/dist/workers/python/docbridge_python_scanner/protocol.py +105 -0
  18. package/dist/workers/python/docbridge_python_scanner/scanner.py +214 -0
  19. package/dist/workers/python/docbridge_python_scanner.py +16 -0
  20. package/dist/workers/ruby/bin/docbridge-ruby-scanner +10 -0
  21. package/dist/workers/ruby/lib/docbridge_ruby_scanner/cli.rb +30 -0
  22. package/dist/workers/ruby/lib/docbridge_ruby_scanner/comments.rb +55 -0
  23. package/dist/workers/ruby/lib/docbridge_ruby_scanner/compat.rb +39 -0
  24. package/dist/workers/ruby/lib/docbridge_ruby_scanner/declarations.rb +230 -0
  25. package/dist/workers/ruby/lib/docbridge_ruby_scanner/links.rb +38 -0
  26. package/dist/workers/ruby/lib/docbridge_ruby_scanner/positions.rb +50 -0
  27. package/dist/workers/ruby/lib/docbridge_ruby_scanner/probe.rb +28 -0
  28. package/dist/workers/ruby/lib/docbridge_ruby_scanner/protocol.rb +161 -0
  29. package/dist/workers/ruby/lib/docbridge_ruby_scanner.rb +21 -0
  30. package/docs/README.md +10 -3
  31. package/docs/user/automation.md +8 -4
  32. package/docs/user/commands.md +11 -3
  33. package/docs/user/configuration.md +104 -17
  34. package/docs/user/getting-started.md +1 -1
  35. package/docs/user/linking.md +79 -10
  36. package/docs/user/troubleshooting.md +22 -9
  37. package/package.json +1 -1
  38. package/schemas/common-output.schema.json +11 -1
  39. package/schemas/context-output.schema.json +1 -1
  40. package/schemas/docbridge.schema.json +95 -2
  41. package/schemas/graph-output.schema.json +1 -1
  42. package/schemas/scanner-worker.schema.json +1 -1
  43. package/templates/skills/docbridge/SKILL.md +12 -2
package/CHANGELOG.md CHANGED
@@ -7,6 +7,60 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.12.0] - 2026-10-01
11
+
12
+ ### Added
13
+
14
+ - JavaScript is a first-party code language. Configure
15
+ `include.code.javascript` with `.js`, `.jsx`, `.mjs`, or `.cjs` patterns and
16
+ put `@doc` in the JSDoc comment of an exported declaration or a member of an
17
+ exported class. The built-in TypeScript scanner reads these files, so the
18
+ declarations, canonical IDs, and `visibility` values match TypeScript, and
19
+ JSX parses in every JavaScript file. CommonJS assignments such as
20
+ `module.exports = ...` are not endpoints; an `@doc` on one is
21
+ `unsupported_declaration`.
22
+ - `include.code.typescript` accepts `.tsx`, `.mts`, and `.cts` patterns, and
23
+ `.d.mts` and `.d.cts` declaration files are skipped like `.d.ts`. JSX parses
24
+ in `.tsx` files, and hover and `context` fence their declarations as `tsx`.
25
+ - Python is a first-party code language. Configure `include.code.python` and
26
+ put `@doc` in the docstring of a `def`, `async def`, or `class`, or in the
27
+ `#` comment block above it. The bundled worker runs on the CPython 3.10 or
28
+ later installed on the machine, on any platform, and parses with the
29
+ standard library alone; it never imports project code. Canonical IDs are
30
+ dot-qualified (`AuthService.login`), and a property's accessors and an
31
+ `@overload` group each share one endpoint. Visibility defaults to `public`;
32
+ `private` adds names that start with `_`.
33
+ - Ruby is a first-party code language. Configure `include.code.ruby` and put
34
+ `@doc` in the `#` comment block above a `class`, `module`, constant, or
35
+ method. The bundled worker runs on the CRuby 3.3 or later installed on the
36
+ machine with its bundled Prism parser. Canonical IDs use `::` between
37
+ constants and `.` before a method (`Auth::Service.login`, and
38
+ `Auth::Service.self.build` for a singleton method). Visibility follows
39
+ `private`, `protected`, and `public` calls and defaults to `public`.
40
+ - An optional top-level `scanners` key names the interpreter that runs the
41
+ Python or Ruby worker, for example
42
+ `"scanners": { "python": { "command": ["/opt/py/bin/python3"] } }`. Without
43
+ it, `DOCBRIDGE_PYTHON_RUNTIME` or `DOCBRIDGE_RUBY_RUNTIME` can name one, and
44
+ otherwise DocBridge tries `python3` and then `python` (`py -3` and then
45
+ `python` on Windows), and `ruby`, on `PATH`. A missing or too-old interpreter
46
+ is `code_scanner_unavailable` naming what was found, and a configured
47
+ interpreter is never replaced by another.
48
+ - The VS Code extension activates for JavaScript, JavaScript React, Python,
49
+ and Ruby files. `docbridge init` proposes JavaScript and TypeScript source
50
+ roots for every suffix, `src/` and each top-level Python package, and Ruby's
51
+ `lib/` and `app/`.
52
+
53
+ ### Changed
54
+
55
+ - A scan sends every file of a worker-backed language to its scanner in one
56
+ request instead of starting a process per file, which speeds up checking
57
+ large Swift, Dart, Rust, and Go projects. A failed request reports its
58
+ diagnostic on every file it carried, and each request may run for 30
59
+ seconds plus 1 second per file.
60
+ - The editor language server rescans in the background: it keeps answering
61
+ hover, definition, and references from the last completed scan, rescans only
62
+ files that changed, and drops a scan that a newer edit made stale.
63
+
10
64
  ## [0.11.0] - 2026-09-30
11
65
 
12
66
  ### Added
@@ -469,7 +523,8 @@ Initial release of the SpecLink CLI.
469
523
  - `speclink check` command with `--root`, `--json`, and `--audit` options.
470
524
  - `speclink --version` (alias `-v`) and `speclink --help` (alias `-h`).
471
525
 
472
- [Unreleased]: https://github.com/salan70/docbridge/compare/v0.11.0...HEAD
526
+ [Unreleased]: https://github.com/salan70/docbridge/compare/v0.12.0...HEAD
527
+ [0.12.0]: https://github.com/salan70/docbridge/releases/tag/v0.12.0
473
528
  [0.11.0]: https://github.com/salan70/docbridge/releases/tag/v0.11.0
474
529
  [0.10.1]: https://github.com/salan70/docbridge/releases/tag/v0.10.1
475
530
  [0.10.0]: https://github.com/salan70/docbridge/releases/tag/v0.10.0
package/README.md CHANGED
@@ -6,8 +6,8 @@
6
6
 
7
7
  DocBridge keeps Markdown documentation and the code that implements it linked
8
8
  in both directions. It validates `@doc` annotations on supported TypeScript,
9
- Swift, Dart, Rust, and Go declarations against `@code` annotations on Markdown
10
- headings, so humans and coding agents can find the right counterpart before a
9
+ JavaScript, Swift, Dart, Rust, Go, Python, and Ruby declarations against
10
+ `@code` annotations on Markdown headings, so humans and coding agents can find the right counterpart before a
11
11
  change drifts.
12
12
 
13
13
  ## Requirements
@@ -15,9 +15,11 @@ change drifts.
15
15
  - Node.js 22 or later, or Bun 1.1.31 or later
16
16
  - A project containing Markdown and supported source files
17
17
 
18
- Prebuilt Swift, Dart, Rust, and Go scanners are included for supported macOS and
19
- Linux platforms. See [Releases](https://github.com/salan70/docbridge/releases)
20
- for packaged-platform details.
18
+ Prebuilt Swift, Dart, Rust, and Go scanners are included for `darwin-arm64` and
19
+ `linux-x64`. Python and Ruby projects need CPython 3.10 or later or CRuby 3.3
20
+ or later on the machine, on any platform. See
21
+ [Languages](docs/user/configuration.md#languages) for each language's file
22
+ extensions, visibility defaults, and scanner.
21
23
 
22
24
  ## Install
23
25
 
@@ -41,7 +43,8 @@ Create a starting configuration interactively:
41
43
  npx docbridge init
42
44
  ```
43
45
 
44
- Or write the minimal TypeScript configuration yourself:
46
+ Or write the minimal TypeScript configuration yourself as
47
+ `docbridge.config.json` in the project root:
45
48
 
46
49
  ```json
47
50
  {
@@ -57,14 +60,15 @@ Or write the minimal TypeScript configuration yourself:
57
60
  }
58
61
  ```
59
62
 
60
- Add a documentation target to a supported declaration:
63
+ Add a documentation target to a supported declaration in `src/auth.ts`:
61
64
 
62
65
  ```ts
63
66
  /** @doc docs/auth.md#login-flow */
64
67
  export function login(): void {}
65
68
  ```
66
69
 
67
- Add the reciprocal code target immediately before the Markdown heading:
70
+ Add the reciprocal code target immediately before the heading in
71
+ `docs/auth.md`:
68
72
 
69
73
  ```md
70
74
  <!-- @code src/auth.ts#login -->
@@ -79,7 +83,8 @@ npx docbridge check
79
83
  ```
80
84
 
81
85
  A valid graph exits `0`. Invalid configuration, unresolved targets, and missing
82
- backlinks produce diagnostics and exit `1`.
86
+ backlinks produce diagnostics and exit `1`. Paths in annotations are relative
87
+ to the project root, and each file must match a configured pattern.
83
88
 
84
89
  ## Choose the next guide
85
90
 
@@ -96,6 +101,8 @@ backlinks produce diagnostics and exit `1`.
96
101
  - [Automation](docs/user/automation.md) — coding agents, Git hooks, and CI
97
102
  - [Troubleshooting](docs/user/troubleshooting.md) — diagnose configuration,
98
103
  scanning, and link failures
104
+ - [Examples](examples/) — one small project per supported language
105
+ - [Changelog](CHANGELOG.md) — release history
99
106
  - [日本語ドキュメント](docs/ja/README.md)
100
107
 
101
108
  The CLI ships the English task guides with its own version. Run
@@ -1,4 +1,4 @@
1
- 5db695997d6c32f0fd69722d43aabacd38b0ca67ce46f3f80160aff132d9b5d1 docbridge-swift-scanner
2
- f0218c70949d7fae587d0e208cf9e959ff51fae4bceb7d60b92325c65723af37 docbridge_dart_scanner
1
+ 6cf11435899f942ec0327339f489595a1e03b4865d18ae8b42af893a007add63 docbridge-swift-scanner
2
+ 3987abf57ca786393b2c45a53b14d8f922b43214320fbca54ab60e75a8c7b702 docbridge_dart_scanner
3
3
  7fc3e6842b3e1bf425b8fd63e241eee7e64875f16be7ba8d1ae4a25baa7f2338 docbridge-rust-scanner
4
- 2779c979bd91996bd0075afbed097fe7c9e2bf71ec331073a09b305e6a8ac510 docbridge-go-scanner
4
+ 456ca7abccb9815954ef4d736dcc5a31c572eda2721ca5583442dcd68b4fba8b docbridge-go-scanner
@@ -1,4 +1,4 @@
1
- ce42be3326a3c7fa127709edbca34056f9e5eda8af3dba1623b51a1c41050328 docbridge-swift-scanner
1
+ aaaf5889c91db30cbdd81aa0a5670b5f5f874bad33efb64c3e8c18084e92c02a docbridge-swift-scanner
2
2
  b75b14006ca792ed3ca8faf7ceee9e4d33c895f27dd416b640818cf8a4bdd9c8 docbridge_dart_scanner
3
3
  e0da7b8cc6ee23704f5fe8514cc309f0bb60380c77b55e3bc5ed113abd1f3478 docbridge-rust-scanner
4
- 4b8b52ff6c806bdd7096afcce59fb05dcdf1cb27a3c5f0ffc8f1908a01085194 docbridge-go-scanner
4
+ d666df6dbbf63d2063454e42cbfa5d81d7d87d4b700e9e9aaade338004a4cbf5 docbridge-go-scanner
@@ -1,4 +1,4 @@
1
1
  [diffend] Oversized file quarantined before diffing.
2
2
  name: package/dist/bin/linux-x64/docbridge-swift-scanner
3
3
  size: 40932352 bytes
4
- sha256: ce42be3326a3c7fa127709edbca34056f9e5eda8af3dba1623b51a1c41050328
4
+ sha256: aaaf5889c91db30cbdd81aa0a5670b5f5f874bad33efb64c3e8c18084e92c02a