microsoft / microsoft/TypeScript

improve docs of compiler APIs

Open
#17,147 7 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Docs
Dominant language
Go
Stars
111k
Forks
14.3k
Avg merge
2d 4h
Merged PRs (30d)
132

Description

hi,

i'm trying to implement an instrumenter on top of typescript compiler APIs.
i cannot find a "real" documentation beside of this wiki page but i think that it should be upgraded from a single wiki page to a dedicated section with examples for:

  • creating new nodes (e.g. create a brand new statement and attach it to an existing function body)
  • updating existing nodes (e.g. patching a statement)
  • add types declarations (e.g. add arbitrary types to a function declaration)
  • todo...

what do you think about this?

EDIT: i've found this nice article that shows some really useful code.
EDIT: i've found this nice project that can help to understand how to use the compiler apis for more advanced use cases.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the existing “Using the Compiler API” wiki page and compare it with the linked Scott Logic article and ts-simple-ast project. Define the scope of a dedicated compiler API documentation section, including examples for creating and updating nodes and adding type declarations. Done means the agreed API topics are documented with usable examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
compilers, documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.