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%

rubric.jsonevals/scenario-9/

{
  "context": "Evaluates whether the solution parses JavaScript into a Babel AST, traverses it with @babel/traverse to instrument functions and normalize logging, and regenerates code. Scoring focuses solely on correct use of Babel parser/traverse/types/generator APIs to achieve the specified transformations.",
  "type": "weighted_checklist",
  "checklist": [
    {
      "name": "Parser setup",
      "description": "Uses @babel/parser.parse (or equivalent) with sourceType: \"module\" and needed plugins to build a Babel AST instead of string manipulation before applying transformations.",
      "max_score": 20
    },
    {
      "name": "Function visitor",
      "description": "Employs @babel/traverse visitor callbacks for FunctionDeclaration/FunctionExpression/ArrowFunctionExpression paths, checks identifier names and block bodies, and uses NodePath inspection (e.g., path.get(\"body\"), path.node.id or a parent VariableDeclarator id) to find instrumentable functions while skipping those already starting with a track call.",
      "max_score": 20
    },
    {
      "name": "Tracking injection",
      "description": "Builds the track(\"<name>\") statement with @babel/types helpers (e.g., t.callExpression, t.stringLiteral, t.expressionStatement) and inserts it via NodePath mutation APIs such as unshiftContainer/unshift on the function body.",
      "max_score": 20
    },
    {
      "name": "Log rewrite",
      "description": "Within traversal, detects CallExpressions whose callee is console.log or console.debug and rewrites the callee to logger.debug using @babel/types constructs (memberExpression/identifier) while preserving the original arguments.",
      "max_score": 15
    },
    {
      "name": "Import merge",
      "description": "Ensures the output AST contains a single import { track, logger } from \"telemetry\" by adding or mutating ImportDeclaration nodes with @babel/traverse/@babel/types (e.g., augmenting existing specifiers instead of duplicating).",
      "max_score": 15
    },
    {
      "name": "Code generation",
      "description": "Generates the final source string from the modified AST using @babel/generator (or @babel/core.generate) rather than manual string building.",
      "max_score": 10
    }
  ]
}

Version

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