Easily manage and move shared TypeScript types with confidence.
Project details
type-tune is a powerful CLI tool written in Rust that simplifies the management of shared TypeScript types. It automatically scans and identifies type aliases and interface declarations, helping to move them efficiently while keeping track of imports and dependencies. With reviewable plans and validation via TypeScript, type-tune transforms type management into a seamless experience.
type-tune is a powerful command-line interface (CLI) tool built with Rust that simplifies the process of managing shared TypeScript types. This tool allows developers to efficiently locate TypeScript type aliases and interface declarations and assists in their safe relocation within projects, removing the tedious task of manually tracking imports.
Unlike tools such as Knip, which focuses on identifying unused code, type-tune is designed specifically for relocating types that are actively in use—complementing existing workflows.
npx type-tune scan --project tsconfig.json
npx type-tune plan --project tsconfig.json \
--out .type-tune/plan.json \
--markdown .type-tune/plan.md
npx type-tune review --markdown .type-tune/plan.md
npx type-tune apply --plan .type-tune/plan.json \
--markdown .type-tune/plan.md --dry-run
npx type-tune apply --plan .type-tune/plan.json \
--markdown .type-tune/plan.md
For instance, a type initially located within a feature module can be moved to its designated location:
// Before
// src/features/order/OrderPage.tsx
export type OrderSummary = {
id: string;
total: number;
};
// After review
// src/features/order/types/order.ts
export type OrderSummary = {
id: string;
total: number;
};
With type-tune, the original module retains a type-only compatibility export, and the relevant TypeScript references are updated, preserving existing imports without disrupting consumer code.
.ts and .tsx files based on the selected tsconfig.json. It does not automatically handle Vue, Svelte, Astro, or external consumers.For comprehensive details on additional commands and development guidelines, refer to the project's documentation.
Documentation Links:
Architecture | Requirements | AI Review | Release Guide
With type-tune, TypeScript developers gain a reliable tool for managing shared types, promoting code clarity and maintainability across the project.
Comments
0Start the conversation
Share the first comment.