Skip to content

moostjs/atscript

Repository files navigation

Atscript Demo Atscript - Annotate Things

Atscript is a type-centric language designed to extend TypeScript with annotations. It introduces a .as file format that supports interfaces, types, and annotations (decorators starting with @).

Features

  • Type-safe annotation system
  • Imports and exports similar to TypeScript
  • VSCode extension for syntax highlighting, diagnostics, completions, and hovers
  • Core parsing and AST generation
  • Plugin support for extended functionalities (e.g., MongoDB integration, validation)
  • Configurable .as file processing

Usage

You can define types and interfaces with annotations in .as files:

@mongo.collection 'users'
export interface User {
    @label 'User ID'
    id: string

    @label 'User Name'
    name: string

    @label 'Email'
    email: string

    @expect.min 18
    age: number.int
}

Configuration

Atscript allows defining a configuration file (atscript.config.js):

Roadmap

  • VSCode extension (syntax highlighting, diagnostics, completions)
  • Core parsing and AST generation
  • Watch for config file changes
  • Generate .d.ts files from .as files
  • Generate TypeScript classes from interfaces
  • Plugin system
  • Basic Validations
  • MongoDB Sync Index

License

MIT