Skip to content

build(docs-gen): add extension name extractor#1150

Draft
makhnatkin wants to merge 2 commits into
mainfrom
codex/docs-gen-name-extractor
Draft

build(docs-gen): add extension name extractor#1150
makhnatkin wants to merge 2 commits into
mainfrom
codex/docs-gen-name-extractor

Conversation

@makhnatkin

@makhnatkin makhnatkin commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

What changed

Adds the first, deliberately small version of the docs-gen extension extractor. This PR extracts only one field: name.

The output shape is already future-proofed for follow-up PRs:

{
  "extensions": [
    {"name": "Bold"}
  ]
}

Architecture

The extractor is split by responsibility so later PRs can add fields without reshaping the generator:

  • src/extract-extension-data.mjs - CLI entry point.
  • src/extractor/config.mjs - repository paths and extension entry points.
  • src/extractor/blacklist.mjs - internal and public extension skip lists.
  • src/extractor/entry-points.mjs - converts configured entry points into extension refs and applies the blacklist.
  • src/extractor/source-files.mjs - reads TS/TSX sources for an extension ref.
  • src/extractor/ast/ - TypeScript AST primitives and source scanners.
  • src/extractor/fields/ - one field controller per extracted field; currently only name.
  • src/extractor/field-config.mjs - active output field registry; currently only name.
  • src/extractor/index.mjs - orchestration.
  • src/extractor/output.mjs - writes tmp/docs-gen/extensions.json.
  • src/extractor/README.md - module map and extension instructions.

Blacklist

The PR includes an explicit blacklist:

  • BaseInputRules
  • BaseKeymap
  • BaseStyles
  • ReactRenderer
  • SharedState
  • YfmCut

Validation

  • git diff --check origin/main passed.
  • Unit tests cover AST name extraction, blacklist filtering, and field config record creation.
  • Tests were not run locally because AGENTS.md requires Docker/Podman, and podman machine start reported success but podman machine inspect immediately showed State: stopped; podman info failed with connection refused.

@sourcery-ai

sourcery-ai Bot commented Jun 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces a TypeScript‑AST–based extractor for editor extension names used by docs generation, wires it into the docs-gen package with scripts and dependencies, and adds tests for the extraction and blacklist behavior.

File-Level Changes

Change Details Files
Add a TypeScript AST-based extension name extractor and filesystem scanner for docs generation.
  • Implement parsing utilities to walk TypeScript/TSX AST and collect exported variables typed as known Extension types.
  • Detect extensions exported via Object.assign on known extension implementations.
  • Recursively scan configured extension entry points and categories under editor and page-constructor-extension packages.
  • Filter extension names using a configurable blacklist and write the result to tmp/docs-gen/extensions.json.
infra/docs-gen/src/extract-extension-names.mjs
Integrate the extractor into the docs-gen tooling with scripts, dependencies, and tests.
  • Add npm scripts to run the extractor and node --test over docs-gen source files.
  • Add TypeScript as a dependency for AST parsing in docs-gen.
  • Introduce unit tests for AST extraction and blacklist logic (and update pnpm-lock.yaml accordingly).
infra/docs-gen/package.json
infra/docs-gen/src/extract-extension-names.test.mjs
pnpm-lock.yaml

Possibly linked issues

  • #0: PR implements the first deterministic docs-gen step by extracting extension names as raw metadata from source code.

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@gravity-ui

gravity-ui Bot commented Jun 16, 2026

Copy link
Copy Markdown

Storybook Deployed

@gravity-ui

gravity-ui Bot commented Jun 16, 2026

Copy link
Copy Markdown

🎭 Playwright Report

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.

1 participant