Skip to content

Release v0.5.6

Choose a tag to compare

@github-actions github-actions released this 19 Jul 13:17
· 1362 commits to main since this release

Release Notes: ast-climber-types Package

Overview

This includes the release of ast-climber-types, a new npm package that provides TypeScript type definitions for the ast-climber code analysis library with zero runtime code.

What's New

🎯 Purpose

The ast-climber-types package addresses a critical need for environments where bundle size matters, such as:

  • VSCode webview extensions
  • Browser-based development tools
  • Lightweight TypeScript projects that only need type definitions

📦 Package Details

  • Package Name: ast-climber-types
  • Initial Version: 0.5.4 (aligned with ast-climber version)
  • Size: ~10KB (types only, no logic code)
  • Zero Runtime Dependencies: Pure TypeScript definitions

✨ Features

  1. Complete Type Coverage

    • All core ast-climber types included
    • Organized into logical modules:
      • common.d.ts: Basic types (Point, SimpleRange, etc.)
      • definitions.d.ts: AST node types (Def, Ref, Import, Scope)
      • edges.d.ts: Graph edge types
      • graph.d.ts: Call graph types
  2. Automated Publishing

    • GitHub Actions workflow for automated npm releases
    • Synchronized versioning with main ast-climber package
    • Publishes on version tag push
  3. Type Safety Without the Weight

    • Full TypeScript IntelliSense support
    • No JavaScript payload in production bundles
    • Perfect for type-safe message passing between processes

Installation

npm install ast-climber-types
# or
yarn add ast-climber-types
# or
pnpm add ast-climber-types

Usage Example

// In a webview or lightweight environment
import type { CallGraph, Def, CallGraphNode } from "ast-climber-types";

// Type-safe message passing
interface GraphMessage {
  type: "graph-update";
  data: CallGraph;
}

// Process graph data with full type safety
function processCallGraph(graph: CallGraph): void {
  graph.nodes.forEach((node: CallGraphNode) => {
    console.log(`Processing: ${node.symbol}`);
  });
}

Technical Implementation

  • Build Process: No compilation needed (types-only package)
  • Testing: Comprehensive type compilation tests ensure all types are valid
  • CI/CD: Automated GitHub Actions pipeline for publishing
  • Compatibility: Works with TypeScript 4.0+

Migration Guide

If you're currently importing types from the full ast-climber package in a bundle-sensitive environment:

// Before
import type { CallGraph } from "ast-climber"; // May include runtime code

// After
import type { CallGraph } from "ast-climber-types"; // Types only, no runtime

Future Plans

  • Automatic type synchronization with main ast-climber package
  • Additional type utilities and helpers
  • Expanded documentation with more usage examples

Contributing

The types package source is maintained in the main ast-climber repository under packages/ast-climber-types/. Contributions and feedback are welcome!

Links