CtrlK
CommunityDocumentationLog inGet started
Tessl Logo

tessl/npm-babel--preset-stage-0

tessl install tessl/npm-babel--preset-stage-0@7.8.0

Deprecated Babel preset for stage 0 plugins that provides migration guidelines to explicit plugin configurations

Agent Success

Agent success rate when using this tile

80%

Improvement

Agent success rate improvement when using this tile compared to baseline

1.21x

Baseline

Agent success rate without this tile

66%

task.mdevals/scenario-9/

Function Instrumentation Transformer

Transforms JavaScript modules by instrumenting named functions and normalizing debug logging in a consistent, AST-driven way.

Capabilities

Instruments named function bodies

  • Inserts a track("<name>") call as the first statement of every named function declaration or named function/arrow expression bound to a variable when the body is a block statement; the tracking string uses the function's declared identifier or the variable name, and nested functions follow the same rule. @test
  • Leaves any function whose first statement already calls track unchanged to avoid duplicate instrumentation. @test

Normalizes debug logging

  • Rewrites console.log and console.debug calls inside instrumented functions to logger.debug, preserving the original argument order and count. @test

Injects telemetry import

  • Adds a single import { track, logger } from "telemetry"; at the top of the module whenever instrumentation or log normalization occurs, merging with an existing import from that source instead of duplicating specifiers. @test

Implementation

@generates

API

/**
 * Transforms a JavaScript module string by instrumenting named functions and normalizing debug logging.
 * Returns the transformed source text.
 */
export function transformModule(sourceCode);

Dependencies { .dependencies }

@babel/traverse { .dependency }

Provides AST traversal and mutation utilities for walking module structure.

@babel/parser { .dependency }

Parses JavaScript/TypeScript source text into an AST compatible with traversal.

@babel/types { .dependency }

Constructs and compares AST nodes used while mutating the tree.

@babel/generator { .dependency }

Converts a transformed AST back into source text while preserving valid syntax.

Version

Workspace
tessl
Visibility
Public
Created
Last updated
Describes
npmpkg:npm/@babel/preset-stage-0@7.8.x
tile.json