Appearance
快速开始
安装
使用 npm 创建新项目:
bash
npx @targo/create-targo my-app
cd my-app或者在现有项目中安装:
bash
pnpm add -D @targo/cli初始化项目
bash
npx targo init这会创建:
targo.json- 项目配置tsconfig.json- TypeScript 配置(如果不存在).targo/- 生成的类型声明目录
编写代码
创建 src/main.ts:
typescript
import { fmt } from "std/fmt";
export function main(): void {
fmt.Println("Hello, Targo!");
}构建和运行
bash
# 类型检查
npx targo check
# 构建
npx targo build
# 运行
npx targo run