Giter VIP home page Giter VIP logo

walk-that-type's Introduction

Walk That Type

Netlify Status

preview

Debugging complex TypeScript types is painful, because you can't simply put log statements in them and the obscure syntax doesn't help. Introducing Walk That Type: a tool that lets you paste or write any type, then step through it while explaining what happens at each step!

๐Ÿšง Warning: this project is still in early development stage. It might include bugs and missing features (see ROADMAP to see what's still coming).

Contributing

  1. Fork this repo
  2. Create a new branch, push your changes, and open a PR.

Feel free to report any issues or feature requests using Github issues.

Development setup

  1. Install pnpm
  2. Run pnpm install
  3. Run pnpm dev to start the dev server
  4. Run pnpm test to run tests (in watch mode)

Implementing new features:

  • Make sure mapASTToTypeNodes handles parsing syntax for this feature, if not, add it. This requires adding a new TypeNode variant. Fill missing cases in functions that use TypeNode (use pnpm check:types to find all these places).
  • Add tests and implement evalT for this feature.
  • Add tests and implement extendsT for this feature (if needed).
  • Add traverse logic in traverse function.
  • In eval-tree.ts add new cases in calculateNextStep and chooseNodeToEval.
  • Finally, update EvalDescription component.

Implementing built-in types

To add a missing built-in type (e.g. Pick) you just need to implement it in the global-types.ts files according to GlobalTypeFn type.

walk-that-type's People

Contributors

mieszkosabo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

walk-that-type's Issues

ROADMAP

Roadmap

  • format displayed code
  • primitive types
  • spread operator for tuples (eg. used for concat)
  • infer
    • tuples
    • objects
    • functions
  • object types
  • union types
  • mapped types
  • distributed union
  • indexed access types
  • keyof
  • template string literals
  • object type
  • intersection types
  • function types
  • type variance
  • readonly
  • optional properties
  • built-in types
    • Uppercase
    • Lowercase
    • Capitalize
    • Uncapitalize
    • Extract,
    • Exclude
    • Pick,
    • Omit
    • Partial, Required (needs optional properties)
    • Readonly (needs readonly)
    • NonNullable (needs intersection and object type)
    • Record
    • Awaited, Promise, PromiseLike
    • Parameters, ReturnType (needs function types)
  • extends
    • any, unknown, never
    • common sets such as number, string
    • literal types
    • objects
    • union types
    • intersection types
    • function types
  • conditional types

Feel free to comment which features would you like to see first.

Also let me know if there's something you'd like that's not on the list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.