MCPcopy
hub / github.com/airbnb/ts-migrate

github.com/airbnb/ts-migrate @v0.1.35 sqlite

repository ↗ · DeepWiki ↗ · release v0.1.35 ↗
224 symbols 619 edges 93 files 11 documented · 5%
README

ts-migrate

ts-migrate is a tool for helping migrate code to TypeScript. It takes a JavaScript, or a partial TypeScript, project in and gives a compiling TypeScript project out.

ts-migrate is intended to accelerate the TypeScript migration process. The resulting code will pass the build, but a followup is required to improve type safety. There will be lots of // @ts-expect-error, and any that will need to be fixed over time. In general, it is a lot nicer than starting from scratch.

ts-migrate is designed as a set of plugins so that it can be pretty customizable for different use-cases. Potentially, more plugins can be added for addressing things like improvements of type quality or libraries-related things (like prop-types in React).

Plugins are combined into migration configs. We currently have two main migration configs:

  • for the main JavaScript → TypeScript migration
  • for the reignore script

These configs can be moved out of the default script, and people can add custom configs with a different set of plugins for their needs.

You can find instructions on how to install and run ts-migrate in the main package. If you find any issues or have ideas for improvements, we welcome your contributions!

Check out the blog post about ts-migrate!

Published Packages

Folder Version Package
packages/ts-migrate npm version ts-migrate
packages/ts-migrate-plugins npm version ts-migrate-plugins
packages/ts-migrate-server npm version ts-migrate-server

Unpublished Packages

Folder Description
packages/ts-migrate-example basic example of usage of the ts-migrate-server with a writing a custom simple plugin

Authors

Brie Bunge Sergii Rudenko John Haytko Elliot Sachs Joe Lencioni

License

MIT, see LICENSE for details.

Extension points exported contracts — how you extend this code

InitParams (Interface)
(no doc)
packages/ts-migrate/commands/init.ts
LintConfig (Interface)
(no doc)
packages/ts-migrate-plugins/src/plugins/explicit-any.ts
PluginParams (Interface)
(no doc)
packages/ts-migrate-server/types/index.ts
RenameParams (Interface)
(no doc)
packages/ts-migrate/commands/rename.ts
LintConfig (Interface)
(no doc)
packages/ts-migrate-server/types/index.ts
Plugin (Interface)
(no doc)
packages/ts-migrate-server/types/index.ts
MigrateParams (Interface)
(no doc)
packages/ts-migrate-server/src/migrate/index.ts

Core symbols most depended-on inside this repo

run
called by 153
packages/ts-migrate-server/types/index.ts
mockPluginParams
called by 140
packages/ts-migrate-plugins/tests/test-utils.ts
addPlugin
called by 30
packages/ts-migrate-server/src/migrate/MigrateConfig.ts
replace
called by 26
packages/ts-migrate-plugins/src/plugins/utils/update.ts
mockDiagnostic
called by 19
packages/ts-migrate-plugins/tests/test-utils.ts
updateSourceText
called by 18
packages/ts-migrate-plugins/src/utils/updateSourceText.ts
realPluginParams
called by 10
packages/ts-migrate-plugins/tests/test-utils.ts
updateImports
called by 8
packages/ts-migrate-plugins/src/plugins/utils/imports.ts

Shape

Function 190
Method 16
Class 10
Interface 7
Enum 1

Languages

TypeScript100%

Modules by API surface

packages/ts-migrate-plugins/src/plugins/react-props.ts20 symbols
packages/ts-migrate-plugins/src/plugins/jsdoc.ts18 symbols
packages/ts-migrate-plugins/src/plugins/utils/imports.ts13 symbols
packages/ts-migrate-plugins/src/plugins/ts-ignore.ts12 symbols
packages/ts-migrate-plugins/src/plugins/explicit-any.ts11 symbols
packages/ts-migrate-plugins/src/plugins/utils/update.ts10 symbols
packages/ts-migrate/tests/test-utils.ts8 symbols
packages/ts-migrate-server/tests/test-utils.ts8 symbols
packages/ts-migrate-plugins/src/plugins/strip-ts-ignore.ts8 symbols
packages/ts-migrate-plugins/src/plugins/react-shape.ts8 symbols
packages/ts-migrate-plugins/src/plugins/utils/react.ts7 symbols
packages/ts-migrate-plugins/src/plugins/add-conversions.ts6 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

Dependencies from manifests, versioned

@ts-morph/bootstrap0.16.0 · 1×
@types/eslint7.29.0 · 1×
@types/jest26.0.9 · 1×
@types/jscodeshift0.11.2 · 1×
@types/json-schema7.0.7 · 1×
@types/json50.0.30 · 1×
@types/node12.20.10 · 1×
@types/react16.9.16 · 1×
@types/rimraf2.0.3 · 1×
@types/yargs13.0.3 · 1×
@typescript-eslint/eslint-plugin4.33.0 · 1×
@typescript-eslint/parser4.33.0 · 1×

For agents

$ claude mcp add ts-migrate \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact