tessl install tessl/npm-stencil--core@4.36.0A comprehensive web component compiler that transforms TypeScript and JSX code into standards-compliant web components with complete development toolchain.
Agent Success
Agent success rate when using this tile
75%
Improvement
Agent success rate improvement when using this tile compared to baseline
1.44x
Baseline
Agent success rate without this tile
52%
Build a tool that compiles a web component written in TypeScript with decorators and verifies that the compilation produces valid JavaScript output.
Your tool should:
@Component, @Prop, @State)The tool should handle compilation errors gracefully and report them clearly.
Your tool should accept a configuration object with:
sourceFile: Path to the TypeScript component file to compileoutputDir: Directory where compiled output should be writtenReturn an object with:
success: Boolean indicating if compilation and verification succeededoutputFile: Path to the compiled JavaScript file (if successful)errors: Array of error messages (if any)metadata: Object containing information about detected decorators and transformationsGiven a TypeScript file with a basic @Component decorator and a simple render method, compilation succeeds and produces a .js file with decorator metadata and no TypeScript syntax @test
Given a TypeScript file with @Component and @Prop decorators, compilation succeeds and the prop metadata is properly transformed in the output @test
Given a TypeScript file with JSX in the render method, compilation succeeds and JSX is transformed to function calls with no JSX syntax remaining @test
Given a TypeScript file with syntax errors, compilation fails gracefully with error details captured and no output file created @test
src/compiler-tool.tstest/compiler-tool.test.ts@generates
/**
* Configuration for the compiler tool
*/
export interface CompilerConfig {
sourceFile: string;
outputDir: string;
}
/**
* Result of compilation and verification
*/
export interface VerificationResult {
success: boolean;
outputFile?: string;
errors: string[];
metadata: {
decorators: string[];
hasJSXTransform: boolean;
};
}
/**
* Compiles a TypeScript component file and verifies the output
*
* @param config - Configuration specifying source file and output directory
* @returns Verification result with compilation status and metadata
*/
export function compileAndVerify(config: CompilerConfig): Promise<VerificationResult>;Provides the TypeScript compilation and transformation capabilities for web components.
@satisfied-by