Skip to content

KazariEX/laplacenoma

Repository files navigation

Laplacenoma

version downloads license

Laplacenoma is a reactivity analyzer built on top of the TypeScript language service, inspired by the reactivity visualization feature in vuejs/language-tools. Its goal is to provide framework-agnostic and configurable reactivity analysis.

Installation

pnpm i laplacenoma

Usage

import { createAnalyzer } from "laplacenoma";
import rulesVue from "laplacenoma/rules/vue";
import type ts from "typescript";

const analyzer = createAnalyzer({
  rules: rulesVue,
});

export function getReactivityAnalysis(
  ts: typeof import("typescript"),
  languageService: ts.LanguageService,
  fileName: string,
  position: number,
) {
  const program = languageService.getProgram()!;
  const sourceFile = program.getSourceFile(fileName)!;
  return analyzer.analyze(sourceFile, position, {
    typescript: ts,
    languageService,
  });
}

About

Reactivity analyzer for signal-based library.

Resources

License

Stars

Watchers

Forks

Packages

No packages published