Skip to content

refactor: replace ts-parser with TypeDoc-based normalizer#39

Merged
grdsdev merged 12 commits into
mainfrom
claude/zealous-wright-bb6326
Jun 29, 2026
Merged

refactor: replace ts-parser with TypeDoc-based normalizer#39
grdsdev merged 12 commits into
mainfrom
claude/zealous-wright-bb6326

Conversation

@grdsdev

@grdsdev grdsdev commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replaces ts-parser.ts (TypeScript compiler API, syntactic-only) and parse-ts.ts with a thin normalizer (normalize-typedoc.ts) over TypeDoc 0.27 JSON output
  • TypeDoc runs the full TypeScript compiler internally, correctly handling interface, enum, type aliases, re-exports, and namespace merging that the old parser missed
  • Follows the same "external tool → thin normalizer → ParseResult" architecture established by PR feat(parsers): add Dart/Flutter public API surface parser via dartdoc_json #35 (dartdoc_json for Dart)
  • Adds entrypoint input to validate-sdk-compliance.yml (default: src/index.ts); SDK repos using the standard layout need no changes

Changes

Added:

  • scripts/capability-matrix/src/normalize-typedoc.ts — TypeDoc JSON → ParseResult normalizer
  • scripts/capability-matrix/src/normalize-typedoc-cli.ts — CLI entry point (normalize-typedoc npm script)
  • scripts/capability-matrix/test/normalize-typedoc.test.ts — 29 unit + fixture tests
  • scripts/capability-matrix/test/fixtures/typedoc-sample.json — real TypeDoc 0.27 output (hermetic, no build at test time)

Deleted:

  • scripts/capability-matrix/src/ts-parser.ts
  • scripts/capability-matrix/src/parse-ts.ts
  • scripts/capability-matrix/test/ts-parser.test.ts
  • scripts/capability-matrix/test/fixtures/ts-sample/

Modified:

  • .github/workflows/validate-sdk-compliance.yml — TypeDoc steps for javascript language; entrypoint input
  • scripts/capability-matrix/package.jsonnormalize-typedoc script replaces parse-ts
  • CLAUDE.md — updated source file table

Test plan

  • npm test — 116 tests pass (11 test files, including 29 new normalizer tests)
  • npm run typecheck — clean
  • npm run validate — schema + structural checks pass
  • CI on this PR runs green

@grdsdev grdsdev requested review from a team as code owners June 19, 2026 14:37
@grdsdev grdsdev force-pushed the claude/zealous-wright-bb6326 branch from d3c9dab to c147046 Compare June 19, 2026 14:42
@grdsdev grdsdev requested a review from mandarini June 19, 2026 14:42
grdsdev added a commit that referenced this pull request Jun 23, 2026
…icts

Merge origin/main (PRs #37#40) into this branch:
- #37: sdk-parse-ignore → .sdk-parse-ignore (already synced)
- #38: Dart symbol extractor
- #39: Swift symbolgraph parser (replaces regex parser, deletes swift-parser.test.ts)
- #40: CODEOWNERS, README, CLAUDE.md updates

Conflict resolutions:
- package.json: keep both normalize-griffe (ours) and normalize-symbolgraph (main)
- validate-sdk-compliance.yml: add Python steps alongside Dart/Swift symbolgraph steps;
  conditions on Resolve/Parse steps now exclude python, swift, and dart
@grdsdev grdsdev force-pushed the claude/zealous-wright-bb6326 branch from c147046 to de55fe8 Compare June 25, 2026 01:50
grdsdev added 11 commits June 29, 2026 06:14
- CLAUDE.md: remove stale ts-parser/parse-ts rows; add normalize-typedoc.ts
  and normalize-typedoc-cli.ts; clarify parse-ignore.ts is Swift-only
- docs/specs: add Behavioral Notes section explaining .sdk-parse-ignore no
  longer applies to TypeScript (TypeDoc uses entrypoint resolution instead)
- validate-sdk-compliance.yml: quote \${{ inputs.entrypoint }} in both
  TypeDoc run steps to handle paths with spaces
- normalize-typedoc.test.ts: replace vacuous _cache test with meaningful
  accessor fixture test; add Namespace (kind 4) traversal test
@grdsdev grdsdev force-pushed the claude/zealous-wright-bb6326 branch from 1f8db78 to a45b6e0 Compare June 29, 2026 09:16
Comment thread .github/workflows/validate-sdk-compliance.yml Outdated
@mandarini

Copy link
Copy Markdown
Contributor

It would not work as it was for supabase-js, so I pushed a commit to fix it

spydon added a commit that referenced this pull request Jun 29, 2026
Carry over the JS handling that #39 introduced on the base branch: the
javascript workflow now takes a required typedoc-packages input, enables
corepack, installs each branch with pnpm, runs every package's docs:json,
and merges the per-package TypeDoc JSON via normalize-typedoc --out —
replacing the old single npx-typedoc entrypoint flow.
@grdsdev grdsdev merged commit dd870c3 into main Jun 29, 2026
3 checks passed
@grdsdev grdsdev deleted the claude/zealous-wright-bb6326 branch June 29, 2026 12:21
spydon added a commit that referenced this pull request Jun 29, 2026
Carry over the JS handling that #39 introduced on the base branch: the
javascript workflow now takes a required typedoc-packages input, enables
corepack, installs each branch with pnpm, runs every package's docs:json,
and merges the per-package TypeDoc JSON via normalize-typedoc --out —
replacing the old single npx-typedoc entrypoint flow.
spydon added a commit that referenced this pull request Jun 30, 2026
…#49)

* ci: split validate-sdk-compliance into one reusable workflow per language

Replace the single language-gated reusable workflow with one file per
language (swift, javascript, python, dart). Each file hardcodes its
runner and steps, dropping the per-step `if: inputs.language == ...`
gates and the `language` input. Update README and CLAUDE.md.

* refactor(ci): extract shared compliance steps into composite actions

GitHub Actions does not support YAML anchors, so factor the duplicated
validate job, check-job setup, and final symbol-diff step into three
composite actions under .github/actions/sdk-compliance-*. Each
per-language workflow now references them, leaving only its
language-specific steps inline.

* refactor(ci): collapse JavaScript PR/base TypeDoc steps into a loop

Match the for-b-in-pr-base pattern the swift, python, and dart workflows
already use, replacing four explicit PR/base steps with two looped ones.

* fix(ci): address review feedback on compliance workflows

- Pass workflow inputs through env vars instead of interpolating them
  directly into run blocks, closing a shell-injection vector
  (compliance-file, entrypoint, griffe-packages, griffe-search-paths)
- Swift: collect symbol-graph files directly so multi-target packages
  no longer fail the SGDIR glob with a false 'No symbol graphs emitted'
- Python: guard against an empty griffe-packages value passing required
- Skip the symbol-diff check job on non-pull_request events, where
  pull_request.base.sha is empty and the diff would be meaningless
- Clarify griffe-packages accepts space- or comma-separated names

* ci(javascript): adopt pnpm monorepo typedoc-packages approach

Carry over the JS handling that #39 introduced on the base branch: the
javascript workflow now takes a required typedoc-packages input, enables
corepack, installs each branch with pnpm, runs every package's docs:json,
and merges the per-package TypeDoc JSON via normalize-typedoc --out —
replacing the old single npx-typedoc entrypoint flow.

* docs: add JavaScript opt-in example to README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants