{"type_of":"article","id":4999208,"title":"Meet type-tune! 🦀 Give Your TypeScript Types a Better Home! 😸","description":"Hoi hoi! 👋  I'm @nyaomaru, a frontend engineer who is actually allergic to crabs! 🙀🦀  Today, I have...","readable_publish_date":"Nov 11","slug":"meet-type-tune-give-your-typescript-types-a-better-home-1p6l","path":"/necoz/meet-type-tune-give-your-typescript-types-a-better-home-1p6l","url":"https://dev.to/necoz/meet-type-tune-give-your-typescript-types-a-better-home-1p6l","comments_count":45,"public_reactions_count":121,"collection_id":null,"published_timestamp":"2026-11-11T17:19:22Z","language":"en","subforem_id":1,"ai_disclosure_level":"some_ai","ai_disclosure_label":"AI-assisted","positive_reactions_count":121,"cover_image":"https://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnmpfwlsvrtynp0s1lm59.gif","social_image":"https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fnmpfwlsvrtynp0s1lm59.gif","canonical_url":"https://dev.to/necoz/meet-type-tune-give-your-typescript-types-a-better-home-1p6l","created_at":"2026-11-08T15:41:06Z","edited_at":null,"crossposted_at":null,"published_at":"2026-11-11T17:19:22Z","last_comment_at":"2026-11-18T07:54:16Z","reading_time_minutes":6,"tag_list":"rust, typescript, showdev, opensource","tags":["rust","typescript","showdev","opensource"],"body_html":"\u003cp\u003eHoi hoi! 👋\u003c/p\u003e\n\n\u003cp\u003eI'm \u003ca href=\"https://github.com/nyaomaru\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e@nyaomaru\u003c/a\u003e, a frontend engineer who is actually allergic to crabs! 🙀🦀\u003c/p\u003e\n\n\u003cp\u003eToday, I have another exciting announcement!\u003c/p\u003e\n\n\u003cp\u003eI've just released a new open-source tool called \u003cstrong\u003etype-tune\u003c/strong\u003e! 🦀🎉\u003c/p\u003e\n\n\n\u003cdiv class=\"ltag-github-readme-tag\"\u003e\n  \u003cdiv class=\"readme-overview\"\u003e\n    \u003ch2\u003e\n      \u003cimg src=\"https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg\" alt=\"GitHub logo\"\u003e\n      \u003ca href=\"https://github.com/necoz-oss\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n        necoz-oss\n      \u003c/a\u003e / \u003ca style=\"font-weight: 600;\" href=\"https://github.com/necoz-oss/type-tune\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n        type-tune\n      \u003c/a\u003e\n    \u003c/h2\u003e\n    \u003ch3\u003e\n      A Rust-powered CLI to find shared TypeScript types and move them safely. 🦀\n    \u003c/h3\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"ltag-github-body\"\u003e\n    \n\u003cdiv id=\"readme\" class=\"md\" data-path=\"README.md\"\u003e\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\n\u003ch1 class=\"heading-element\" dir=\"auto\"\u003etype-tune\u003c/h1\u003e\n\u003c/div\u003e\n\u003cp align=\"center\" dir=\"auto\"\u003e\n  \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/necoz-oss/type-tune/docs/public/animation/motion-logo.gif\"\u003e\u003cimg src=\"https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fnecoz-oss%2Ftype-tune%2FHEAD%2Fdocs%2Fpublic%2Fanimation%2Fmotion-logo.gif\" width=\"400\" alt=\"Animated type-tune logo\" data-animated-image=\"\" style=\"max-width: 100%;\" loading=\"lazy\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\" dir=\"auto\"\u003e\n  \u003ca href=\"https://github.com/necoz-oss/type-tune/actions/workflows/test.yml\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://github.com/necoz-oss/type-tune/actions/workflows/test.yml/badge.svg\" alt=\"Test\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/necoz-oss/type-tune/actions/workflows/docs.yml\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://github.com/necoz-oss/type-tune/actions/workflows/docs.yml/badge.svg\" alt=\"Docs\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/necoz-oss/type-tune/LICENSE\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667\" alt=\"MIT License\" data-canonical-src=\"https://img.shields.io/badge/license-MIT-blue.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\n\u003ch3 align=\"center\" class=\"heading-element\" dir=\"auto\"\u003eGive shared TypeScript types a better home. 😸\u003c/h3\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\" dir=\"auto\"\u003eScan. Review. Move. Validate.\u003c/p\u003e\n\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003etype-tune\u003c/strong\u003e is a Rust-powered CLI that finds shared TypeScript \u003ccode\u003etype\u003c/code\u003e aliases and \u003ccode\u003einterface\u003c/code\u003e declarations and helps move them without manually chasing imports.\u003c/p\u003e\n\n\u003cp dir=\"auto\"\u003eIt creates a reviewable plan, updates supported type imports and re-exports, and validates the rewrite with TypeScript. \u003cstrong\u003eYou decide what moves and where.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp dir=\"auto\"\u003eGuides for installation, the first scan, and the review workflow live in the \u003ca href=\"https://type-tune-nine.vercel.app/\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"\u003eofficial documentation\u003c/a\u003e. Releases are listed on \u003ca href=\"https://github.com/necoz-oss/type-tune/releases\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eGitHub Releases\u003c/a\u003e, and the package is \u003ca href=\"https://www.npmjs.com/package/type-tune\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"\u003e\u003ccode\u003etype-tune\u003c/code\u003e on npm\u003c/a\u003e.\u003c/p\u003e\n\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\n\u003ch2 class=\"heading-element\" dir=\"auto\"\u003eWhy type-tune?\u003c/h2\u003e\n\u003c/div\u003e\n\n\u003cp dir=\"auto\"\u003eTypes often start next to a component or utility, then end up shared across a project. Moving them later means tracking imports, local dependencies, and barrels by hand.\u003c/p\u003e\n\n\u003cul dir=\"auto\"\u003e\n\u003cli\u003e\n\u003cstrong\u003eDiscover\u003c/strong\u003e shared types with deterministic candidate IDs.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eReview\u003c/strong\u003e \u003ccode\u003eplan.md\u003c/code\u003e and choose the destination before making changes.\u003c/li\u003e\n\u003cli\u003e\n\u003cstrong\u003eRewrite\u003c/strong\u003e supported type-only imports, aliases, and simple barrels while keeping compatibility re-exports at the original…\u003c/li\u003e\n\u003c/ul\u003e\u003c/article\u003e\u003c/div\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"gh-btn-container\"\u003e\u003ca class=\"gh-btn\" href=\"https://github.com/necoz-oss/type-tune\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eView on GitHub\u003c/a\u003e\u003c/div\u003e\n\u003c/div\u003e\n\n\n\n\u003cdiv class=\"crayons-card c-embed text-styles text-styles--secondary\"\u003e\n    \u003cdiv class=\"c-embed__content\"\u003e\n      \u003cdiv class=\"c-embed__body flex items-center justify-between\"\u003e\n        \u003ca href=\"https://type-tune-docs.vercel.app/\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"c-link fw-bold flex items-center\"\u003e\n          \u003cspan class=\"mr-2\"\u003etype-tune-docs.vercel.app\u003c/span\u003e\n          \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewbox=\"0 0 24 24\" role=\"img\" aria-hidden=\"true\" class=\"crayons-icon crayons-icon--l\"\u003e\u003cpath d=\"M10.667 8v1.333H7.333v7.334h7.334v-3.334H16v4a.666.666 0 01-.667.667H6.667A.666.666 0 016 17.333V8.667A.667.667 0 016.667 8h4zM18 6v5.333h-1.333V8.275l-5.196 5.196-.942-.942 5.194-5.196h-3.056V6H18z\"\u003e\u003c/path\u003e\u003c/svg\u003e\n\n        \u003c/a\u003e\n      \u003c/div\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003eIt's a small CLI tool built with Rust 🦀 that helps you find shared TypeScript types and move them to a better place.\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eScan. Review. Move. Validate.\u003c/strong\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eSounds simple, right?\u003c/p\u003e\n\n\u003cp\u003eWell, that's exactly the idea! 😸\u003c/p\u003e\n\n\u003chr\u003e\n\u003ch2\u003e\n  \u003ca name=\"what-is-typetune\" href=\"#what-is-typetune\"\u003e\n  \u003c/a\u003e\n  🐈 What Is type-tune?\n\u003c/h2\u003e\n\n\u003cp\u003eIf you've worked on a large TypeScript project, you've probably used tools like \u003ca href=\"https://knip.dev/\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eKnip\u003c/a\u003e.\u003c/p\u003e\n\n\u003cp\u003e\u003ccode\u003eKnip\u003c/code\u003e is awesome! 🎉\u003c/p\u003e\n\n\u003cp\u003eIt helps us find unused files, exports, and dependencies, making it easier to clean up our codebases.\u003c/p\u003e\n\n\u003cp\u003eBut there's another problem I've been thinking about.\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eWhat about types that are still being used, but aren't organized very well?\u003c/strong\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eTypeScript types are incredibly reusable.\u003c/p\u003e\n\n\u003cp\u003eA type declared in one component might eventually be needed by another component, an API module, or even an entire feature.\u003c/p\u003e\n\n\u003cp\u003eBut in practice, we don't always pay much attention to maintaining our type declarations.\u003c/p\u003e\n\n\u003cp\u003eFor example, imagine we have this\u003cbr\u003e\n\u003c/p\u003e\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight typescript\"\u003e\u003ccode\u003e\u003cspan class=\"c1\"\u003e// src/features/order/OrderPage.tsx\u003c/span\u003e\n\u003cspan class=\"k\"\u003eexport\u003c/span\u003e \u003cspan class=\"kd\"\u003etype\u003c/span\u003e \u003cspan class=\"nc\"\u003eOrderSummary\u003c/span\u003e \u003cspan class=\"o\"\u003e=\u003c/span\u003e \u003cspan class=\"p\"\u003e{\u003c/span\u003e\n  \u003cspan class=\"n\"\u003eid\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e \u003cspan class=\"kt\"\u003estring\u003c/span\u003e\u003cspan class=\"p\"\u003e;\u003c/span\u003e\n  \u003cspan class=\"n\"\u003etotal\u003c/span\u003e\u003cspan class=\"p\"\u003e:\u003c/span\u003e \u003cspan class=\"kt\"\u003enumber\u003c/span\u003e\u003cspan class=\"p\"\u003e;\u003c/span\u003e\n\u003cspan class=\"p\"\u003e}\u003c/span\u003e\u003cspan class=\"p\"\u003e;\u003c/span\u003e\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003eAt first, \u003ccode\u003eOrderSummary\u003c/code\u003e might only be used by \u003ccode\u003eOrderPage\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eBut as the feature grows, other files start importing it.\u003c/p\u003e\n\n\u003cp\u003eAnd sometimes, developers \u003cstrong\u003eend up declaring similar types again\u003c/strong\u003e because they don't realize something reusable already exists.\u003c/p\u003e\n\n\u003cp\u003eEventually, we might have:\u003c/p\u003e\n\n\u003cul\u003e\n\u003cli\u003eTypes scattered across components and utilities.\u003c/li\u003e\n\u003cli\u003eSimilar type declarations repeated within the same feature.\u003c/li\u003e\n\u003cli\u003eShared types living in files that don't really belong to them.\u003c/li\u003e\n\u003cli\u003eImports that make refactoring unnecessarily complicated.\u003c/li\u003e\n\u003c/ul\u003e\n\n\u003cp\u003eEverything still works!\u003c/p\u003e\n\n\u003cp\u003eBut is it easy to maintain?\u003c/p\u003e\n\n\u003cp\u003eHmm, not really. 😹\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eThat's where type-tune comes in!\u003c/strong\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003etype-tune finds exported types and interfaces that are already shared across multiple files and helps relocate them to more appropriate locations.\u003c/p\u003e\n\n\u003cp\u003eIt can also update supported imports and preserve compatibility re-exports, so we don't have to manually chase references around the project.\u003c/p\u003e\n\n\u003cp\u003e\u003ca href=\"https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffx893qryllyg8rjg9329.gif\" class=\"article-body-image-wrapper\"\u003e\u003cimg src=\"https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ffx893qryllyg8rjg9329.gif\" alt=\"type-tune workflow\" loading=\"lazy\" width=\"800\" height=\"450\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n\u003cp\u003eUnlike \u003ccode\u003eKnip\u003c/code\u003e, which focuses on unused code, type-tune focuses on \u003cstrong\u003eorganizing types that are actually being used\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eThey're complementary tools!\u003c/p\u003e\n\n\u003cp\u003eOne helps us remove what we don't need. The other helps us organize what we still need. 😸\u003c/p\u003e\n\n\n\u003chr\u003e\n\n\u003ch2\u003e\n  \u003ca name=\"why-did-i-build-it\" href=\"#why-did-i-build-it\"\u003e\n  \u003c/a\u003e\n  💡 Why Did I Build It?\n\u003c/h2\u003e\n\n\u003cp\u003eThis idea actually came from my own experience.\u003c/p\u003e\n\n\u003cp\u003eI was working on refactoring a production codebase with \u003cstrong\u003emore than 300,000 lines of code\u003c/strong\u003e.\u003c/p\u003e\n\n\u003cp\u003eAnd one thing kept bothering me.\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eWe weren't making very good use of our existing types.\u003c/strong\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eEven within the same feature, types that could have been shared were sometimes declared separately.\u003c/p\u003e\n\n\u003cp\u003eSome types had gradually become shared dependencies, but their locations still reflected where they were originally created.\u003c/p\u003e\n\n\u003cp\u003eAs the codebase grew, maintaining those relationships became increasingly difficult.\u003c/p\u003e\n\n\u003cp\u003eAnd there was something else I noticed.\u003c/p\u003e\n\n\u003ch3\u003e\n  \u003ca name=\"types-are-even-more-valuable-in-the-ai-era\" href=\"#types-are-even-more-valuable-in-the-ai-era\"\u003e\n  \u003c/a\u003e\n  🤖 Types Are Even More Valuable in the AI Era\n\u003c/h3\u003e\n\n\u003cp\u003eI've been working with AI-assisted development quite a lot recently.\u003c/p\u003e\n\n\u003cp\u003eAnd through that experience, I've come to appreciate TypeScript's type system even more.\u003c/p\u003e\n\n\u003cp\u003eTypes aren't just there to catch mistakes.\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eThey can also act as useful guardrails for AI coding agents.\u003c/strong\u003e 🛤️\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eWell-defined types help communicate the structure of our applications, the relationships between data, and the contracts our code is expected to follow.\u003c/p\u003e\n\n\u003cp\u003eIn my experience, making those contracts clear is an important part of building an effective AI development workflow.\u003c/p\u003e\n\n\u003cp\u003eBut there's a catch!\u003c/p\u003e\n\n\u003cp\u003eIf our types are duplicated, scattered, or poorly maintained, we're not making full use of that information.\u003c/p\u003e\n\n\u003cp\u003eSo I started wondering\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eWhy don't we have a tool that helps us maintain the structure of our types automatically?\u003c/strong\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eI looked around, but couldn't find a tool that quite solved the problem I had in mind.\u003c/p\u003e\n\n\u003cp\u003eSo\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eI decided to build one myself!\u003c/strong\u003e 🦀🎉\u003c/p\u003e\n\n\u003cp\u003eYAY!!!\u003c/p\u003e\n\n\n\u003chr\u003e\n\n\u003ch2\u003e\n  \u003ca name=\"how-to-use-typetune\" href=\"#how-to-use-typetune\"\u003e\n  \u003c/a\u003e\n  🚀 How to Use type-tune\n\u003c/h2\u003e\n\n\u003cp\u003eGetting started is pretty simple!\u003c/p\u003e\n\n\u003ch3\u003e\n  \u003ca name=\"installation\" href=\"#installation\"\u003e\n  \u003c/a\u003e\n  📦 Installation\n\u003c/h3\u003e\n\n\u003cp\u003eYou can install type-tune from \u003ccode\u003enpm\u003c/code\u003e\u003cbr\u003e\n\u003c/p\u003e\n\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight shell\"\u003e\u003ccode\u003enpm install -D type-tune\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003eOr with \u003ccode\u003epnpm\u003c/code\u003e (My favorite 😸)\u003cbr\u003e\n\u003c/p\u003e\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight shell\"\u003e\u003ccode\u003epnpm add -D type-tune\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003eYou can also try it without installing it into your project\u003cbr\u003e\n\u003c/p\u003e\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight shell\"\u003e\u003ccode\u003enpx type-tune scan --project tsconfig.json\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003eThe npm package requires Node.js v22 or later and runs a platform-specific native Rust binary.\u003c/p\u003e\n\n\u003cp\u003eAnd since type-tune is written in Rust, you can also build and install it directly from GitHub using Cargo! 📦\u003cbr\u003e\n\u003c/p\u003e\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight shell\"\u003e\u003ccode\u003ecargo install --git https://github.com/necoz-oss/type-tune --tag v1.0.0 type-tune\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003eThe Rust source requires Rust 1.99 or later.\u003c/p\u003e\n\u003ch3\u003e\n  \u003ca name=\"step-1-find-shared-types\" href=\"#step-1-find-shared-types\"\u003e\n  \u003c/a\u003e\n  🔍 Step 1. Find Shared Types\n\u003c/h3\u003e\n\n\u003cp\u003eFirst, scan your TypeScript project\u003cbr\u003e\n\u003c/p\u003e\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight shell\"\u003e\u003ccode\u003enpx type-tune scan --project tsconfig.json\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003e\u003ccode\u003etype-tune\u003c/code\u003e analyzes your project and finds candidates for relocation.\u003c/p\u003e\n\n\u003cp\u003eBy default, it looks for exported types and interfaces referenced by at least two other files.\u003c/p\u003e\n\n\u003cp\u003eAnd don't worry!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eScanning doesn't modify your code.\u003c/strong\u003e 😸\u003c/p\u003e\n\u003ch3\u003e\n  \u003ca name=\"step-2-create-a-refactoring-plan\" href=\"#step-2-create-a-refactoring-plan\"\u003e\n  \u003c/a\u003e\n  📋 Step 2. Create a Refactoring Plan\n\u003c/h3\u003e\n\n\u003cp\u003eNext, generate a plan\u003cbr\u003e\n\u003c/p\u003e\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight shell\"\u003e\u003ccode\u003enpx type-tune plan \\\n  --project tsconfig.json \\\n  --out .type-tune/plan.json \\\n  --markdown .type-tune/plan.md\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003eThis creates a JSON plan and a Markdown file you can review.\u003c/p\u003e\n\n\u003cp\u003eYou can inspect which types were found, where they're currently declared, and where they could be moved.\u003c/p\u003e\n\u003ch3\u003e\n  \u003ca name=\"step-3-review-the-changes\" href=\"#step-3-review-the-changes\"\u003e\n  \u003c/a\u003e\n  🐈 Step 3. Review the Changes\n\u003c/h3\u003e\n\n\u003cp\u003eHere's an important part!\u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003etype-tune doesn't decide to move everything automatically.\u003c/strong\u003e\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eEvery candidate starts as \u003ccode\u003eignore\u003c/code\u003e.\u003c/p\u003e\n\n\u003cp\u003eYou can review the plan and choose which declarations should actually move.\u003cbr\u003e\n\u003c/p\u003e\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight shell\"\u003e\u003ccode\u003enpx type-tune review \\\n  --markdown .type-tune/plan.md\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003eYou can also edit the Markdown plan manually.\u003c/p\u003e\n\n\u003cp\u003eI wanted the tool to automate the tedious work while keeping architectural decisions in the developer's hands.\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eAutomation is useful. But control matters too!\u003c/strong\u003e 😸\u003c/p\u003e\n\u003ch3\u003e\n  \u003ca name=\"step-4-apply-the-changes\" href=\"#step-4-apply-the-changes\"\u003e\n  \u003c/a\u003e\n  🦀 Step 4. Apply the Changes\n\u003c/h3\u003e\n\n\u003cp\u003eOnce you've reviewed your plan, you can preview the refactoring\u003cbr\u003e\n\u003c/p\u003e\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight shell\"\u003e\u003ccode\u003enpx type-tune apply \\\n  --plan .type-tune/plan.json \\\n  --markdown .type-tune/plan.md \\\n  --dry-run\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003etype-tune performs the supported rewrites, validates them with TypeScript, and restores the changed files after a normal dry-run.\u003c/p\u003e\n\n\u003cp\u003eWhen you're happy with the plan, run\u003cbr\u003e\n\u003c/p\u003e\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight shell\"\u003e\u003ccode\u003enpx type-tune apply \\\n  --plan .type-tune/plan.json \\\n  --markdown .type-tune/plan.md\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003eThat's it! 🎉\u003c/p\u003e\n\n\u003cp\u003eFor supported transformations, \u003ccode\u003etype-tune\u003c/code\u003e handles moving declarations, updating type imports, and validating the result with the TypeScript compiler.\u003c/p\u003e\n\n\u003cp\u003eOf course, you should still review the Git diff and run your project's own checks.\u003c/p\u003e\n\u003ch3\u003e\n  \u003ca name=\"want-to-move-just-one-type\" href=\"#want-to-move-just-one-type\"\u003e\n  \u003c/a\u003e\n  ✨ Want to Move Just One Type?\n\u003c/h3\u003e\n\n\u003cp\u003eThere's also a direct extraction command!\u003cbr\u003e\n\u003c/p\u003e\n\u003cdiv class=\"highlight js-code-highlight\"\u003e\n\u003cpre class=\"highlight shell\"\u003e\u003ccode\u003enpx type-tune extract OrderSummary \\\n  --from src/features/order/OrderPage.tsx \\\n  --to src/features/order/types/order.ts \\\n  --project tsconfig.json \\\n  --dry-run\n\u003c/code\u003e\u003c/pre\u003e\n\u003cdiv class=\"highlight__panel js-actions-panel\"\u003e\n\u003cdiv class=\"highlight__panel-action js-fullscreen-code-action\"\u003e\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-on\"\u003e\u003ctitle\u003eEnter fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M16 3h6v6h-2V5h-4V3zM2 3h6v2H4v4H2V3zm18 16v-4h2v6h-6v-2h4zM4 19h4v2H2v-6h2v4z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n    \u003csvg xmlns=\"http://www.w3.org/2000/svg\" width=\"20px\" height=\"20px\" viewbox=\"0 0 24 24\" class=\"highlight-action crayons-icon highlight-action--fullscreen-off\"\u003e\u003ctitle\u003eExit fullscreen mode\u003c/title\u003e\n    \u003cpath d=\"M18 7h4v2h-6V3h2v4zM8 9H2V7h4V3h2v6zm10 8v4h-2v-6h6v2h-4zM8 15v6H6v-4H2v-2h6z\"\u003e\u003c/path\u003e\n\u003c/svg\u003e\n\n\u003c/div\u003e\n\u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003e\u003cstrong\u003ePretty handy, right?\u003c/strong\u003e 😸\u003c/p\u003e\n\n\u003chr\u003e\n\u003ch2\u003e\n  \u003ca name=\"lets-build-typetune-together\" href=\"#lets-build-typetune-together\"\u003e\n  \u003c/a\u003e\n  🐈 Let's Build type-tune Together!\n\u003c/h2\u003e\n\n\u003cp\u003eI released type-tune under \u003cstrong\u003eNecoz\u003c/strong\u003e because I want to build it together with other developers! 😸💚\u003c/p\u003e\n\n\n\u003cdiv class=\"crayons-card c-embed text-styles text-styles--secondary\"\u003e\n    \u003cdiv class=\"c-embed__content\"\u003e\n        \u003cdiv class=\"c-embed__cover\"\u003e\n          \u003ca href=\"https://github.com/necoz-oss\" class=\"c-link align-middle\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n            \u003cimg alt=\"\" src=\"https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F350971701%3Fs%3D280%26v%3D4\" height=\"280\" loading=\"lazy\" class=\"m-0\" width=\"280\"\u003e\n          \u003c/a\u003e\n        \u003c/div\u003e\n      \u003cdiv class=\"c-embed__body\"\u003e\n        \u003ch2 class=\"fs-xl lh-tight\"\u003e\n          \u003ca href=\"https://github.com/necoz-oss\" target=\"_blank\" rel=\"noopener noreferrer\" class=\"c-link\"\u003e\n            Necoz · GitHub\n          \u003c/a\u003e\n        \u003c/h2\u003e\n          \u003cp class=\"truncate-at-3\"\u003e\n            A friendly open-source community building small, simple, and useful tools together. 😸 - Necoz\n          \u003c/p\u003e\n        \u003cdiv class=\"color-secondary fs-s flex items-center\"\u003e\n            \u003cimg alt=\"favicon\" class=\"c-embed__favicon m-0 mr-2 radius-0\" src=\"https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fgithub.githubassets.com%2Ffavicons%2Ffavicon.svg\" loading=\"lazy\" width=\"32\" height=\"32\"\u003e\n          github.com\n        \u003c/div\u003e\n      \u003c/div\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\n\n\n\u003cp\u003eAnd this time, with Rust! 🦀\u003c/p\u003e\n\n\u003cp\u003eI believe open source becomes even more exciting when we share ideas, learn from each other, and build things together.\u003c/p\u003e\n\n\u003cp\u003eSo, if you have any ideas, suggestions, or want to contribute, \u003cstrong\u003eI'd love to hear from you!\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp\u003eLet's grow type-tune together! 🐈\u003c/p\u003e\n\n\n\u003chr\u003e\n\n\u003ch2\u003e\n  \u003ca name=\"just-the-beginning\" href=\"#just-the-beginning\"\u003e\n  \u003c/a\u003e\n  🌱 Just the Beginning!\n\u003c/h2\u003e\n\n\u003cp\u003eThis is the first public release, \u003cstrong\u003ev1\u003c/strong\u003e!\u003c/p\u003e\n\n\u003cp\u003etype-tune currently focuses on exported TypeScript \u003ccode\u003etype\u003c/code\u003e aliases and \u003ccode\u003einterface\u003c/code\u003e declarations in \u003ccode\u003e.ts\u003c/code\u003e and \u003ccode\u003e.tsx\u003c/code\u003e files.\u003c/p\u003e\n\n\u003cp\u003eIt doesn't automatically merge duplicate type definitions or handle every possible TypeScript refactoring yet.\u003c/p\u003e\n\n\u003cp\u003eBut I think it's a useful first step toward making type maintenance easier.\u003c/p\u003e\n\n\u003cp\u003eAnd there's still plenty of room to improve!\u003c/p\u003e\n\n\u003cp\u003eWe'd love to hear about the problems you've encountered while maintaining types in large TypeScript projects.\u003c/p\u003e\n\n\u003cp\u003eMaybe you've run into the same challenges!\u003c/p\u003e\n\n\u003cp\u003eOr maybe you've found a completely different approach.\u003c/p\u003e\n\n\u003cp\u003eEither way, I'd love to learn from your experience! 💚\u003c/p\u003e\n\n\n\u003chr\u003e\n\n\u003ch2\u003e\n  \u003ca name=\"check-it-out\" href=\"#check-it-out\"\u003e\n  \u003c/a\u003e\n  💚 Check It Out!\n\u003c/h2\u003e\n\n\u003cp\u003etype-tune is open source and available on GitHub!\u003c/p\u003e\n\n\n\u003cdiv class=\"ltag-github-readme-tag\"\u003e\n  \u003cdiv class=\"readme-overview\"\u003e\n    \u003ch2\u003e\n      \u003cimg src=\"https://assets.dev.to/assets/github-logo-5a155e1f9a670af7944dd5e12375bc76ed542ea80224905ecaf878b9157cdefc.svg\" alt=\"GitHub logo\"\u003e\n      \u003ca href=\"https://github.com/necoz-oss\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n        necoz-oss\n      \u003c/a\u003e / \u003ca style=\"font-weight: 600;\" href=\"https://github.com/necoz-oss/type-tune\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\n        type-tune\n      \u003c/a\u003e\n    \u003c/h2\u003e\n    \u003ch3\u003e\n      A Rust-powered CLI to find shared TypeScript types and move them safely. 🦀\n    \u003c/h3\u003e\n  \u003c/div\u003e\n  \u003cdiv class=\"ltag-github-body\"\u003e\n    \n\u003cdiv id=\"readme\" class=\"md\" data-path=\"README.md\"\u003e\u003carticle class=\"markdown-body entry-content container-lg\" itemprop=\"text\"\u003e\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\n\u003ch1 class=\"heading-element\" dir=\"auto\"\u003etype-tune\u003c/h1\u003e\n\u003c/div\u003e\n\u003cp align=\"center\" dir=\"auto\"\u003e\n  \u003ca target=\"_blank\" rel=\"noopener noreferrer\" href=\"https://github.com/necoz-oss/type-tune/docs/public/animation/motion-logo.gif\"\u003e\u003cimg src=\"https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fraw.githubusercontent.com%2Fnecoz-oss%2Ftype-tune%2FHEAD%2Fdocs%2Fpublic%2Fanimation%2Fmotion-logo.gif\" width=\"400\" alt=\"Animated type-tune logo\" data-animated-image=\"\" style=\"max-width: 100%;\" loading=\"lazy\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\" dir=\"auto\"\u003e\n  \u003ca href=\"https://github.com/necoz-oss/type-tune/actions/workflows/test.yml\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://github.com/necoz-oss/type-tune/actions/workflows/test.yml/badge.svg\" alt=\"Test\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/necoz-oss/type-tune/actions/workflows/docs.yml\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://github.com/necoz-oss/type-tune/actions/workflows/docs.yml/badge.svg\" alt=\"Docs\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/necoz-oss/type-tune/LICENSE\" target=\"_blank\" rel=\"noopener noreferrer\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667\" alt=\"MIT License\" data-canonical-src=\"https://img.shields.io/badge/license-MIT-blue.svg\" style=\"max-width: 100%;\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\n\u003ch3 align=\"center\" class=\"heading-element\" dir=\"auto\"\u003eGive shared TypeScript types a better home. 😸\u003c/h3\u003e\n\u003c/div\u003e\n\n\u003cp align=\"center\" dir=\"auto\"\u003eScan. Review. Move. Validate.\u003c/p\u003e\n\n\u003cp dir=\"auto\"\u003e\u003cstrong\u003etype-tune\u003c/strong\u003e is a Rust-powered CLI that finds shared TypeScript \u003ccode\u003etype\u003c/code\u003e aliases and \u003ccode\u003einterface\u003c/code\u003e declarations and helps move them without manually chasing imports.\u003c/p\u003e\n\n\u003cp dir=\"auto\"\u003eIt creates a reviewable plan, updates supported type imports and re-exports, and validates the rewrite with TypeScript. \u003cstrong\u003eYou decide what moves and where.\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp dir=\"auto\"\u003eGuides for installation, the first scan, and the review workflow live in the \u003ca href=\"https://type-tune-nine.vercel.app/\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"\u003eofficial documentation\u003c/a\u003e. Releases are listed on \u003ca href=\"https://github.com/necoz-oss/type-tune/releases\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eGitHub Releases\u003c/a\u003e, and the package is \u003ca href=\"https://www.npmjs.com/package/type-tune\" rel=\"nofollow noopener noreferrer\" target=\"_blank\"\u003e\u003ccode\u003etype-tune\u003c/code\u003e on npm\u003c/a\u003e.\u003c/p\u003e\n\n\u003cdiv class=\"markdown-heading\" dir=\"auto\"\u003e\n\u003ch2 class=\"heading-element\" dir=\"auto\"\u003eWhy type-tune?\u003c/h2\u003e\n\u003c/div\u003e\n\n\u003cp dir=\"auto\"\u003eTypes often start next to a component or utility, then end up shared across a project. Moving them later means tracking imports, local dependencies, and barrels by hand.\u003c/p\u003e\n\n\n\u003cul dir=\"auto\"\u003e\n\n\u003cli\u003e\n\n\u003cstrong\u003eDiscover\u003c/strong\u003e shared types with deterministic candidate IDs.\u003c/li\u003e\n\n\u003cli\u003e\n\n\u003cstrong\u003eReview\u003c/strong\u003e \u003ccode\u003eplan.md\u003c/code\u003e and choose the destination before making changes.\u003c/li\u003e\n\n\u003cli\u003e\n\n\u003cstrong\u003eRewrite\u003c/strong\u003e supported type-only imports, aliases, and simple barrels while keeping compatibility re-exports at the original…\u003c/li\u003e\n\n\u003c/ul\u003e\u003c/article\u003e\u003c/div\u003e\n\u003cbr\u003e\n  \u003c/div\u003e\n\u003cbr\u003e\n  \u003cdiv class=\"gh-btn-container\"\u003e\u003ca class=\"gh-btn\" href=\"https://github.com/necoz-oss/type-tune\" target=\"_blank\" rel=\"noopener noreferrer\"\u003eView on GitHub\u003c/a\u003e\u003c/div\u003e\n\u003cbr\u003e\n\u003c/div\u003e\n\u003cbr\u003e\n\n\n\u003cp\u003eIf you find it interesting, \u003cstrong\u003eplease consider giving it a ⭐ on GitHub!\u003c/strong\u003e 😸\u003c/p\u003e\n\n\u003cp\u003eAnd if you have any ideas, suggestions, or bugs to report, feel free to open an issue or contribute!\u003c/p\u003e\n\n\u003cp\u003eEvery bit of feedback helps make these little projects better.\u003c/p\u003e\n\n\u003ch3\u003e\n  \u003ca name=\"coming-up-next\" href=\"#coming-up-next\"\u003e\n  \u003c/a\u003e\n  🦀 Coming Up Next\n\u003c/h3\u003e\n\n\u003cp\u003eOh, and one more thing!\u003c/p\u003e\n\n\u003cp\u003eYou might be wondering \u003c/p\u003e\n\n\u003cblockquote\u003e\n\u003cp\u003e\u003cstrong\u003eWhy did I choose Rust instead of TypeScript to build a TypeScript refactoring tool? Is nyaomaru a TypeScript lover, isn't it?\u003c/strong\u003e 🤔\u003c/p\u003e\n\u003c/blockquote\u003e\n\n\u003cp\u003eThat's actually an interesting story!\u003c/p\u003e\n\n\u003cp\u003eI'll talk about the reasons behind that decision, what I learned while building it, and my experience using Rust in my next article!\u003c/p\u003e\n\n\u003cp\u003eStay tuned! 🦀\u003c/p\u003e\n\n\u003cp\u003eThanks for reading, and happy coding! 😸🙌\u003c/p\u003e\n\n\n\u003chr\u003e\n\n\u003ch2\u003e\n  \u003ca name=\"join-our-necoz-community\" href=\"#join-our-necoz-community\"\u003e\n  \u003c/a\u003e\n  💚 Join Our Necoz Community!\n\u003c/h2\u003e\n\n\u003cp\u003eOh, and one more thing! 😸\u003c/p\u003e\n\n\u003cp\u003eWe also have a \u003cstrong\u003eNecoz community on DEV\u003c/strong\u003e! 🎉\u003c/p\u003e\n\n\n\u003cdiv class=\"ltag__user ltag__user__id__15923\" style=\"border-color:#43502f;box-shadow: 3px 3px 0px #43502f;\"\u003e\n  \u003ca href=\"/necoz\" class=\"ltag__user__link profile-image-link\"\u003e\n    \u003cdiv class=\"ltag__user__pic\"\u003e\n      \u003cimg src=\"https://media2.dev.to/dynamic/image/width=150,height=150,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F15923%2F19042de3-8257-4cc5-b2c0-adebba8cbeaa.png\" alt=\"necoz image\" data-ignore-prefix=\"true\"\u003e\n    \u003c/div\u003e\n  \u003c/a\u003e\n  \u003cdiv class=\"ltag__user__content\"\u003e\n    \u003ch2\u003e\n      \u003ca href=\"/necoz\" class=\"ltag__user__link\"\u003eNecoz\u003c/a\u003e\n      \u003cbutton name=\"button\" type=\"button\" data-info='{\"className\":\"Organization\",\"style\":\"full\",\"id\":15923,\"name\":\"Necoz\"}' class=\"crayons-btn follow-action-button whitespace-nowrap c-btn--secondary fs-base \" aria-label=\"Follow organization: Necoz\" aria-pressed=\"false\"\u003eFollow\u003c/button\u003e\n    \u003c/h2\u003e\n    \u003cdiv class=\"ltag__user__summary\"\u003e\n      \u003ca href=\"/necoz\" class=\"ltag__user__link\"\u003e\n        Necoz is a friendly open-source community building small, simple, and useful tools for developers. 🐈 \n\nEveryone is welcome, from first-time contributors to experienced engineers. \n\nLet's build something awesome together! 😸\n      \u003c/a\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003cp\u003eEveryone is welcome, whether you're a developer, a writer, or just curious!\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eWanna join? Leave a comment below and I'll send you an invitation!\u003c/strong\u003e 💌\u003c/p\u003e\n\n\u003cp\u003eNo pressure, no obligations. Just come hang out with us! 🐈\u003c/p\u003e\n\n\u003cp\u003e\u003cstrong\u003eSmall. Simple. Useful. Built Together!\u003c/strong\u003e 💚\u003c/p\u003e\n\n","body_markdown":"Hoi hoi! 👋\n\nI'm [@nyaomaru](https://github.com/nyaomaru), a frontend engineer who is actually allergic to crabs! 🙀🦀\n\nToday, I have another exciting announcement!\n\nI've just released a new open-source tool called **type-tune**! 🦀🎉\n\n{% embed https://github.com/necoz-oss/type-tune %}\n\n{% embed https://type-tune-docs.vercel.app/ %}\n\nIt's a small CLI tool built with Rust 🦀 that helps you find shared TypeScript types and move them to a better place.\n\n\u003e **Scan. Review. Move. Validate.**\n\nSounds simple, right?\n\nWell, that's exactly the idea! 😸\n\n---\n\n## 🐈 What Is type-tune?\n\nIf you've worked on a large TypeScript project, you've probably used tools like [Knip](https://knip.dev/).\n\n`Knip` is awesome! 🎉\n\nIt helps us find unused files, exports, and dependencies, making it easier to clean up our codebases.\n\nBut there's another problem I've been thinking about.\n\n\u003e **What about types that are still being used, but aren't organized very well?**\n\nTypeScript types are incredibly reusable.\n\nA type declared in one component might eventually be needed by another component, an API module, or even an entire feature.\n\nBut in practice, we don't always pay much attention to maintaining our type declarations.\n\nFor example, imagine we have this\n\n```ts\n// src/features/order/OrderPage.tsx\nexport type OrderSummary = {\n  id: string;\n  total: number;\n};\n```\n\nAt first, `OrderSummary` might only be used by `OrderPage`.\n\nBut as the feature grows, other files start importing it.\n\nAnd sometimes, developers **end up declaring similar types again** because they don't realize something reusable already exists.\n\nEventually, we might have:\n\n- Types scattered across components and utilities.\n- Similar type declarations repeated within the same feature.\n- Shared types living in files that don't really belong to them.\n- Imports that make refactoring unnecessarily complicated.\n\nEverything still works!\n\nBut is it easy to maintain?\n\nHmm, not really. 😹\n\n\u003e **That's where type-tune comes in!**\n\ntype-tune finds exported types and interfaces that are already shared across multiple files and helps relocate them to more appropriate locations.\n\nIt can also update supported imports and preserve compatibility re-exports, so we don't have to manually chase references around the project.\n\n![type-tune workflow](https://raw.githubusercontent.com/necoz-oss/type-tune/main/docs/public/animation/conveyor-belt.gif)\n\nUnlike `Knip`, which focuses on unused code, type-tune focuses on **organizing types that are actually being used**.\n\nThey're complementary tools!\n\nOne helps us remove what we don't need. The other helps us organize what we still need. 😸\n\n---\n\n## 💡 Why Did I Build It?\n\nThis idea actually came from my own experience.\n\nI was working on refactoring a production codebase with **more than 300,000 lines of code**.\n\nAnd one thing kept bothering me.\n\n\u003e **We weren't making very good use of our existing types.**\n\nEven within the same feature, types that could have been shared were sometimes declared separately.\n\nSome types had gradually become shared dependencies, but their locations still reflected where they were originally created.\n\nAs the codebase grew, maintaining those relationships became increasingly difficult.\n\nAnd there was something else I noticed.\n\n### 🤖 Types Are Even More Valuable in the AI Era\n\nI've been working with AI-assisted development quite a lot recently.\n\nAnd through that experience, I've come to appreciate TypeScript's type system even more.\n\nTypes aren't just there to catch mistakes.\n\n\u003e **They can also act as useful guardrails for AI coding agents.** 🛤️\n\nWell-defined types help communicate the structure of our applications, the relationships between data, and the contracts our code is expected to follow.\n\nIn my experience, making those contracts clear is an important part of building an effective AI development workflow.\n\nBut there's a catch!\n\nIf our types are duplicated, scattered, or poorly maintained, we're not making full use of that information.\n\nSo I started wondering\n\n\u003e **Why don't we have a tool that helps us maintain the structure of our types automatically?**\n\nI looked around, but couldn't find a tool that quite solved the problem I had in mind.\n\nSo\n\n**I decided to build one myself!** 🦀🎉\n\nYAY!!!\n\n---\n\n## 🚀 How to Use type-tune\n\nGetting started is pretty simple!\n\n### 📦 Installation\n\nYou can install type-tune from `npm`\n\n```bash\nnpm install -D type-tune\n```\n\nOr with `pnpm` (My favorite 😸)\n\n```bash\npnpm add -D type-tune\n```\n\nYou can also try it without installing it into your project\n\n```bash\nnpx type-tune scan --project tsconfig.json\n```\n\nThe npm package requires Node.js v22 or later and runs a platform-specific native Rust binary.\n\nAnd since type-tune is written in Rust, you can also build and install it directly from GitHub using Cargo! 📦\n\n```bash\ncargo install --git https://github.com/necoz-oss/type-tune --tag v1.0.0 type-tune\n```\n\nThe Rust source requires Rust 1.99 or later.\n\n### 🔍 Step 1. Find Shared Types\n\nFirst, scan your TypeScript project\n\n```bash\nnpx type-tune scan --project tsconfig.json\n```\n\n`type-tune` analyzes your project and finds candidates for relocation.\n\nBy default, it looks for exported types and interfaces referenced by at least two other files.\n\nAnd don't worry!\n\n**Scanning doesn't modify your code.** 😸\n\n### 📋 Step 2. Create a Refactoring Plan\n\nNext, generate a plan\n\n```bash\nnpx type-tune plan \\\n  --project tsconfig.json \\\n  --out .type-tune/plan.json \\\n  --markdown .type-tune/plan.md\n```\n\nThis creates a JSON plan and a Markdown file you can review.\n\nYou can inspect which types were found, where they're currently declared, and where they could be moved.\n\n### 🐈 Step 3. Review the Changes\n\nHere's an important part!\n\n\u003e **type-tune doesn't decide to move everything automatically.**\n\nEvery candidate starts as `ignore`.\n\nYou can review the plan and choose which declarations should actually move.\n\n```bash\nnpx type-tune review \\\n  --markdown .type-tune/plan.md\n```\n\nYou can also edit the Markdown plan manually.\n\nI wanted the tool to automate the tedious work while keeping architectural decisions in the developer's hands.\n\n**Automation is useful. But control matters too!** 😸\n\n### 🦀 Step 4. Apply the Changes\n\nOnce you've reviewed your plan, you can preview the refactoring\n\n```bash\nnpx type-tune apply \\\n  --plan .type-tune/plan.json \\\n  --markdown .type-tune/plan.md \\\n  --dry-run\n```\n\ntype-tune performs the supported rewrites, validates them with TypeScript, and restores the changed files after a normal dry-run.\n\nWhen you're happy with the plan, run\n\n```bash\nnpx type-tune apply \\\n  --plan .type-tune/plan.json \\\n  --markdown .type-tune/plan.md\n```\n\nThat's it! 🎉\n\nFor supported transformations, `type-tune` handles moving declarations, updating type imports, and validating the result with the TypeScript compiler.\n\nOf course, you should still review the Git diff and run your project's own checks.\n\n### ✨ Want to Move Just One Type?\n\nThere's also a direct extraction command!\n\n```bash\nnpx type-tune extract OrderSummary \\\n  --from src/features/order/OrderPage.tsx \\\n  --to src/features/order/types/order.ts \\\n  --project tsconfig.json \\\n  --dry-run\n```\n\n**Pretty handy, right?** 😸\n\n---\n\n## 🐈 Let's Build type-tune Together!\n\nI released type-tune under **Necoz** because I want to build it together with other developers! 😸💚\n\n{% embed https://github.com/necoz-oss %}\n\nAnd this time, with Rust! 🦀\n\nI believe open source becomes even more exciting when we share ideas, learn from each other, and build things together.\n\nSo, if you have any ideas, suggestions, or want to contribute, **I'd love to hear from you!**\n\nLet's grow type-tune together! 🐈\n\n---\n\n## 🌱 Just the Beginning!\n\nThis is the first public release, **v1**!\n\ntype-tune currently focuses on exported TypeScript `type` aliases and `interface` declarations in `.ts` and `.tsx` files.\n\nIt doesn't automatically merge duplicate type definitions or handle every possible TypeScript refactoring yet.\n\nBut I think it's a useful first step toward making type maintenance easier.\n\nAnd there's still plenty of room to improve!\n\nWe'd love to hear about the problems you've encountered while maintaining types in large TypeScript projects.\n\nMaybe you've run into the same challenges!\n\nOr maybe you've found a completely different approach.\n\nEither way, I'd love to learn from your experience! 💚\n\n---\n\n## 💚 Check It Out!\n\ntype-tune is open source and available on GitHub!\n\n{% embed https://github.com/necoz-oss/type-tune %}\n\nIf you find it interesting, **please consider giving it a ⭐ on GitHub!** 😸\n\nAnd if you have any ideas, suggestions, or bugs to report, feel free to open an issue or contribute!\n\nEvery bit of feedback helps make these little projects better.\n\n### 🦀 Coming Up Next\n\nOh, and one more thing!\n\nYou might be wondering \n\n\u003e **Why did I choose Rust instead of TypeScript to build a TypeScript refactoring tool? Is nyaomaru a TypeScript lover, isn't it?** 🤔\n\nThat's actually an interesting story!\n\nI'll talk about the reasons behind that decision, what I learned while building it, and my experience using Rust in my next article!\n\nStay tuned! 🦀\n\nThanks for reading, and happy coding! 😸🙌\n\n---\n\n## 💚 Join Our Necoz Community!\n\nOh, and one more thing! 😸\n\nWe also have a **Necoz community on DEV**! 🎉\n\n{% embed https://dev.to/necoz %}\n\nEveryone is welcome, whether you're a developer, a writer, or just curious!\n\n**Wanna join? Leave a comment below and I'll send you an invitation!** 💌\n\nNo pressure, no obligations. Just come hang out with us! 🐈\n\n**Small. Simple. Useful. Built Together!** 💚","user":{"name":"nyaomaru","username":"nyaomaru","twitter_username":"nyaomaru_dev","github_username":"nyaomaru","user_id":1436158,"website_url":"https://nyaomaru-portfolio.vercel.app/","profile_image":"https://media2.dev.to/dynamic/image/width=640,height=640,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1436158%2Fa78bc4ed-7796-4760-baa5-06283c2404d6.png","profile_image_90":"https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1436158%2Fa78bc4ed-7796-4760-baa5-06283c2404d6.png"},"organization":{"name":"Necoz","username":"necoz","slug":"necoz","profile_image":"https://media2.dev.to/dynamic/image/width=640,height=640,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F15923%2F19042de3-8257-4cc5-b2c0-adebba8cbeaa.png","profile_image_90":"https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Forganization%2Fprofile_image%2F15923%2F19042de3-8257-4cc5-b2c0-adebba8cbeaa.png"},"flare_tag":{"name":"showdev","bg_color_hex":"#091b47","text_color_hex":"#b2ffe1"}}