CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-cra-template-typescript

The official TypeScript template for Create React App providing preconfigured TypeScript support and development environment setup.

Overall
score

98%

Overview
Eval results
Files

task.mdevals/scenario-8/

CRA Script Runner

A small utility that produces the correct command invocations for the standard Create React App TypeScript project scripts described in the generated README.

Capabilities

Development server command

  • When mode is set to "start", return the invocation for the development server script using npm (command: "npm", args: ["start"]), applying provided host and port as HOST and PORT environment overrides without touching other scripts. @test

CI-safe testing command

  • When mode is "test" with ci enabled, return the testing script invocation using npm (command: "npm", args: ["test", "--", "--watch=false"]) and set CI to true to disable watch mode; default to interactive with args: ["test"] and no CI override when ci is not set. @test

Production build command

  • When mode is "build", return the production build script invocation using npm (command: "npm", args: ["run", "build"]), set NODE_ENV to production, and note the expected output directory as build. @test

Eject protection

  • When mode is "eject", only return the eject invocation if allowEject is true, using npm (command: "npm", args: ["run", "eject"]); otherwise throw a descriptive error explaining that eject is blocked. @test

Implementation

@generates

API

export type ScriptMode = "start" | "test" | "build" | "eject";

export interface ScriptOptions {
  mode: ScriptMode;
  host?: string;
  port?: number;
  ci?: boolean;
  allowEject?: boolean;
}

export interface ScriptInvocation {
  command: string;
  args: string[];
  env: Record<string, string>;
  outputDir?: string;
}

export function buildScriptInvocation(options: ScriptOptions): ScriptInvocation;

Dependencies { .dependencies }

cra-template-typescript { .dependency }

Provides the CRA TypeScript scaffold whose README documents the start, test, build, and eject scripts that this utility orchestrates.

Install with Tessl CLI

npx tessl i tessl/npm-cra-template-typescript

tile.json