Skip to content

Parses typing definitions from TypeScript and brings them at runtime.

License

Notifications You must be signed in to change notification settings

paroi-tech/typeonly

Repository files navigation

Monorepo for TypeOnly

Build Status

TypeOnly is a lightweight validation library that uses TypeScript type definitions to validate JSON data. Learn more about TypeOnly here.

Projects

  • typeonly: Parses types and interfaces from TypeScript and stores them as JSON files;
  • @typeonly/loader: Brings types and interfaces from TypeScript at runtime;
  • @typeonly/validator: An API to validate JSON data or JavaScript objects, using TypeScript typing definitions;
  • @typeonly/validator-cli: A CLI to validate JSON files, using TypeScript typing definitions.

Contribute

Install and Build

We need a JVM (Java Virtual Machine) to build the parser because we use ANTLR, which is a Java program. So, at first, install a JVM on your system.

In a terminal, open the cloned typeonly/typeonly/ repository. Then:

# Download once the ANTLR JAR file in the project's root directory
wget https://www.antlr.org/download/antlr-4.13.2-complete.jar

# Install once all Node.js dependencies
npm install

Development environment

With VS Code, our recommanded plugins are:

  • Biome from biomejs (biomejs.dev)
  • ANTLR4 grammar syntax support from Mike Lischke (mike-lischke.vscode-antlr4)

About

Parses typing definitions from TypeScript and brings them at runtime.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published