CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-tsconfig--node14

A base TSConfig for working with Node 14.

84

1.05x
Overview
Eval results
Files

task.mdevals/scenario-6/

Runtime Configuration Manager

Overview

Build a TypeScript configuration recommendation tool that helps developers choose appropriate TypeScript configurations for different JavaScript runtime environments. The tool should provide configuration recommendations for Deno, Bun, and legacy JavaScript engines.

Requirements

Core Functionality

  1. Configuration Loader: Create a module that loads base TypeScript configurations for different runtime environments from the configuration package.

  2. Configuration Recommender: Build a recommender that provides the appropriate base configuration for a target runtime. Support:

    • Deno runtime
    • Bun runtime
    • Legacy JavaScript engine (QJSEngine/ES5 compatible)
  3. Configuration Analyzer: Implement an analyzer that extracts and reports key configuration settings from a loaded configuration:

    • ECMAScript target version
    • Module system (CommonJS, ESNext, etc.)
    • Module resolution strategy
    • Special runtime features (like JSX support, import extensions support)

Implementation Details

Input/Output

  • The configuration loader should accept a runtime identifier and return the loaded configuration
  • The recommender should accept a runtime identifier and return configuration with explanations
  • The analyzer should accept a configuration object and return structured information about its settings

Test Cases { .test-cases }

Test Case 1: Load Deno Configuration { .test-case @test }

Input:

  • Runtime identifier: "deno"

Expected Output:

  • Configuration loader successfully loads Deno base configuration
  • Analyzer reports minimal library definitions (empty lib array)
  • Analyzer confirms JSX support is configured

Test Case 2: Load Bun Configuration { .test-case @test }

Input:

  • Runtime identifier: "bun"

Expected Output:

  • Configuration loader successfully loads Bun base configuration
  • Analyzer reports ESNext target
  • Analyzer reports bundler module resolution
  • Analyzer confirms support for importing TypeScript extensions

Test Case 3: Load QJSEngine Configuration { .test-case @test }

Input:

  • Runtime identifier: "qjsengine"

Expected Output:

  • Configuration loader successfully loads QJSEngine base configuration
  • Analyzer reports ES5 target
  • Analyzer reports conservative module settings (module: "none")

Files to Create

  • src/config-loader.ts - Configuration loading logic
  • src/config-recommender.ts - Configuration recommendations
  • src/config-analyzer.ts - Configuration analysis
  • src/types.ts - Type definitions
  • src/config-loader.test.ts - Tests for configuration loader
  • src/config-analyzer.test.ts - Tests for analyzer

Dependencies { .dependencies }

@tsconfig/bases { .dependency }

Provides pre-configured TypeScript settings for different runtime environments including Deno, Bun, and various JavaScript engines. This package contains standardized base configurations that can be extended for different runtimes.

Install with Tessl CLI

npx tessl i tessl/npm-tsconfig--node14

tile.json