{"_id":"@brightlocaldev/ts-migrate","_rev":"2-da27310903006643142f04bf57905360","name":"@brightlocaldev/ts-migrate","dist-tags":{"latest":"0.1.40"},"versions":{"0.1.36":{"name":"@brightlocaldev/ts-migrate","version":"0.1.36","keywords":["ts-migrate","typescript","migration","codemod"],"license":"MIT","_id":"@brightlocaldev/ts-migrate@0.1.36","maintainers":[{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},{"name":"eugeny_brightlocal","email":"eugeny@brightlocal.com"}],"contributors":[{"url":"https://github.com/brieb","name":"Brie Bunge"},{"url":"https://github.com/Rudeg","name":"Sergii Rudenko"},{"url":"https://github.com/elliotsa","name":"Elliot Sachs"},{"url":"https://github.com/jjjjhhhhhh","name":"John Haytko"},{"url":"https://github.com/lencioni","name":"Joe Lencioni"}],"homepage":"https://github.com/airbnb/ts-migrate#readme","bugs":{"url":"https://github.com/airbnb/ts-migrate/issues"},"bin":{"ts-migrate":"build/cli.js","ts-migrate-full":"bin/ts-migrate-full.sh"},"dist":{"shasum":"6513de90ca23f9ad0e3be46d8eea9eb48125b5c9","tarball":"https://registry.npmjs.org/@brightlocaldev/ts-migrate/-/ts-migrate-0.1.36.tgz","fileCount":29,"integrity":"sha512-ZOCYu2WKggosLhoSK5juNVoorw7+kp6U1d9WjDZNQVdrKHPtFcUa7HjDZQuAstcSHwnevImQ7zG5crdVlHo7mw==","signatures":[{"sig":"MEQCIA1qsnCn1xXAKWMhwGJtYGMs0t1KfeQhe7Mmw6PXYnzwAiBg5Dngz8N92tiiYjQRODIJOTz++2cydTjbUcdPTOItKQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49951},"gitHead":"d97941c3998da9b610fcc56b6f99756e279c7586","scripts":{"lint":"eslint . --ext=.js,.jsx,.ts,.tsx --ignore-path ../../.eslintignore","test":"jest --config jest-config.json","build":"tsc -p tsconfig.json","clean":"rm -rf build","prepublish":"yarn build"},"_npmUser":{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},"repository":{"url":"git+https://github.com/airbnb/ts-migrate.git","type":"git","directory":"packages/ts-migrate"},"_npmVersion":"lerna/3.22.1/node@v18.20.4+x64 (linux)","description":"A tool for migrating frontend application from JavaScript to TypeScript","directories":{"test":"tests"},"_nodeVersion":"18.20.4","dependencies":{"json5":"^2.1.1","yargs":"^15.0.2","json5-writer":"^0.1.8","updatable-log":"^0.2.0","ts-migrate-server":"^0.1.33","create-jest-runner":"^0.5.3","ts-migrate-plugins":"^0.1.35"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^7.1.6","jest":"26.6.3","react":"^16.12.0","@types/react":"^16.9.16"},"peerDependencies":{"typescript":">4.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-migrate_0.1.36_1737037422793_0.510967484146571","host":"s3://npm-registry-packages-npm-production"}},"0.1.39":{"name":"@brightlocaldev/ts-migrate","version":"0.1.39","keywords":["ts-migrate","typescript","migration","codemod"],"license":"MIT","_id":"@brightlocaldev/ts-migrate@0.1.39","maintainers":[{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},{"name":"eugeny_brightlocal","email":"eugeny@brightlocal.com"}],"contributors":[{"url":"https://github.com/brieb","name":"Brie Bunge"},{"url":"https://github.com/Rudeg","name":"Sergii Rudenko"},{"url":"https://github.com/elliotsa","name":"Elliot Sachs"},{"url":"https://github.com/jjjjhhhhhh","name":"John Haytko"},{"url":"https://github.com/lencioni","name":"Joe Lencioni"}],"homepage":"https://github.com/airbnb/ts-migrate#readme","bugs":{"url":"https://github.com/airbnb/ts-migrate/issues"},"bin":{"ts-migrate":"build/cli.js","ts-migrate-full":"bin/ts-migrate-full.sh"},"dist":{"shasum":"2e77fa96d447cadbf63539d847be9e7fb9635e81","tarball":"https://registry.npmjs.org/@brightlocaldev/ts-migrate/-/ts-migrate-0.1.39.tgz","fileCount":29,"integrity":"sha512-B7a4BE7QdxSQes6ZTPLN/j1s3lxF+2zGfll0ea9zRECW4g7bCCQtsCm+qfT7MV0fS5HhPzR0qYBMb6oLFJ3YQA==","signatures":[{"sig":"MEUCICJj4FTtLrHaYWbUCPbZT8vD7yRk8l0VZpolrLNgSzs3AiEA3u7rpXLcB6CLzhdClaY7MfwbVFh4QexxEv5RUEatuVI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":49935},"gitHead":"d5cc878764825ac643754e4eda023c83e2e86b78","scripts":{"lint":"eslint . --ext=.js,.jsx,.ts,.tsx --ignore-path ../../.eslintignore","test":"jest --config jest-config.json","build":"tsc -p tsconfig.json","clean":"rm -rf build","prepublish":"yarn build"},"_npmUser":{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},"repository":{"url":"git+https://github.com/airbnb/ts-migrate.git","type":"git","directory":"packages/ts-migrate"},"_npmVersion":"lerna/3.22.1/node@v18.20.4+x64 (linux)","description":"A tool for migrating frontend application from JavaScript to TypeScript","directories":{"test":"tests"},"_nodeVersion":"18.20.4","dependencies":{"json5":"^2.1.1","yargs":"^15.0.2","json5-writer":"^0.1.8","updatable-log":"^0.2.0","create-jest-runner":"^0.5.3","@brightlocaldev/ts-migrate-server":"^0.1.38","@brightlocaldev/ts-migrate-plugins":"^0.1.38"},"_hasShrinkwrap":false,"devDependencies":{"glob":"^7.1.6","jest":"26.6.3","react":"^16.12.0","@types/react":"^16.9.16"},"peerDependencies":{"typescript":">4.0"},"_npmOperationalInternal":{"tmp":"tmp/ts-migrate_0.1.39_1737037637711_0.06120918302301659","host":"s3://npm-registry-packages-npm-production"}},"0.1.40":{"name":"@brightlocaldev/ts-migrate","version":"0.1.40","description":"A tool for migrating frontend application from JavaScript to TypeScript","directories":{"test":"tests"},"bin":{"ts-migrate":"build/cli.js","ts-migrate-full":"bin/ts-migrate-full.sh"},"keywords":["ts-migrate","typescript","migration","codemod"],"repository":{"type":"git","url":"git+https://github.com/brightlocal/ts-migrate.git","directory":"packages/ts-migrate"},"bugs":{"url":"https://github.com/brightlocal/ts-migrate/issues"},"scripts":{"test":"jest --config jest-config.json","lint":"eslint . --ext=.js,.jsx,.ts,.tsx --ignore-path ../../.eslintignore","build":"tsc -p tsconfig.json","prepublish":"yarn build","clean":"rm -rf build"},"contributors":[{"name":"Brie Bunge","url":"https://github.com/brieb"},{"name":"Sergii Rudenko","url":"https://github.com/Rudeg"},{"name":"Elliot Sachs","url":"https://github.com/elliotsa"},{"name":"John Haytko","url":"https://github.com/jjjjhhhhhh"},{"name":"Joe Lencioni","url":"https://github.com/lencioni"}],"homepage":"https://github.com/brightlocal/ts-migrate#readme","license":"MIT","dependencies":{"@brightlocaldev/ts-migrate-plugins":"^0.1.40","@brightlocaldev/ts-migrate-server":"^0.1.40","create-jest-runner":"^0.5.3","json5":"^2.1.1","json5-writer":"^0.1.8","updatable-log":"^0.2.0","yargs":"^15.0.2"},"devDependencies":{"@types/react":"^16.9.16","glob":"^7.1.6","jest":"26.6.3","react":"^16.12.0"},"gitHead":"744cd7a9668929fdf024e467081128124c244db9","peerDependencies":{"typescript":">4.0"},"_id":"@brightlocaldev/ts-migrate@0.1.40","_nodeVersion":"18.20.4","_npmVersion":"lerna/3.22.1/node@v18.20.4+x64 (linux)","dist":{"integrity":"sha512-PJSKwb7kWBUtwOfvUbsC7kApzjMf3G7+hl1/Mr4HDZKVQWD3j6SxmwZixI3WIkxMsshbve6dUE2sW+GSnr7Ygw==","shasum":"8421bda4a7bebef598d38ad4edd642372fd85845","tarball":"https://registry.npmjs.org/@brightlocaldev/ts-migrate/-/ts-migrate-0.1.40.tgz","fileCount":29,"unpackedSize":49957,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD95/tJWXpl+RBgXyM36r0dmgQRni++rB9kcHnmS7an/QIgPs0IInPlU3RoGWxqdTDePcSsBvFkQcxt/Ri4k3Z6wLs="}]},"_npmUser":{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},"maintainers":[{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},{"name":"eugeny_brightlocal","email":"eugeny@brightlocal.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ts-migrate_0.1.40_1737462103277_0.35015582900397435"},"_hasShrinkwrap":false}},"time":{"created":"2025-01-16T14:23:42.685Z","modified":"2025-01-21T12:21:43.643Z","0.1.36":"2025-01-16T14:23:42.995Z","0.1.39":"2025-01-16T14:27:17.877Z","0.1.40":"2025-01-21T12:21:43.453Z"},"bugs":{"url":"https://github.com/brightlocal/ts-migrate/issues"},"license":"MIT","homepage":"https://github.com/brightlocal/ts-migrate#readme","keywords":["ts-migrate","typescript","migration","codemod"],"repository":{"type":"git","url":"git+https://github.com/brightlocal/ts-migrate.git","directory":"packages/ts-migrate"},"description":"A tool for migrating frontend application from JavaScript to TypeScript","contributors":[{"name":"Brie Bunge","url":"https://github.com/brieb"},{"name":"Sergii Rudenko","url":"https://github.com/Rudeg"},{"name":"Elliot Sachs","url":"https://github.com/elliotsa"},{"name":"John Haytko","url":"https://github.com/jjjjhhhhhh"},{"name":"Joe Lencioni","url":"https://github.com/lencioni"}],"maintainers":[{"name":"patryk-w-bl","email":"patryk.wojtowicz@brightlocal.com"},{"name":"eugeny_brightlocal","email":"eugeny@brightlocal.com"}],"readme":"# ts-migrate\n\n_ts-migrate is a tool for migrating frontend application to TypeScript._\nRun `npx ts-migrate <folder>` to convert your frontend application to TypeScript.\n\n_ts-migrate_ is designed around Airbnb projects. Use at your own risk.\n\n# Install\n\nInstall [_ts-migrate_](https://www.npmjs.com/package/ts-migrate) using [npm](https://www.npmjs.com):\n\n`npm install --save-dev ts-migrate`\n\nOr [yarn](https://yarnpkg.com):\n\n`yarn add --dev ts-migrate`\n\n# Usage\n\nMigrate an entire project like this:\n\n```sh\nnpx -p ts-migrate -c \"ts-migrate-full <folder>\"\n```\n\nThe `ts-migrate-full` command will perform a `git add` and `git commit` after each major step (_[details here](https://github.com/brightlocal/ts-migrate/blob/master/packages/ts-migrate/bin/ts-migrate-full.sh)_).\n\nPlease note that it may take a long time to do a full migration.\nYou can also migrate individual parts of a project by specifying a subset of sources:\n\n```sh\nnpx ts-migrate-full <folder> /                # specify the project root, and\n  --sources=\"relative/path/to/subset/**/*\" /  # list the subset to migrate,\n  --sources=\"node_modules/**/*.d.ts\"          # including any global types that the\n                                              # migrator may need to know about.\n```\n\nOr, you can run individual CLI commands:\n\n```\n$ npx ts-migrate -- --help\n\nnpm run ts-migrate -- <command> [options]\n\nCommands:\n  npm run ts-migrate -- init <folder>       Initialize tsconfig.json file in <folder>\n  npm run ts-migrate -- rename <folder>     *Rename files in folder from JS/JSX to TS/TSX\n  npm run ts-migrate -- migrate <folder>    *Fix TypeScript errors, using codemods\n  npm run ts-migrate -- reignore <folder>   Re-run ts-ignore on a project\n\n* These commands can be passed a --sources (or -s) flag. This flag accepts a relative\npath to a subset of your project as a string (glob patterns are allowed). When this flag\nis used, ts-migrate ignores your project's default source files in favor of the ones\nyou've listed. It is effectively the same as replacing your tsconfig.json's `include`\nproperty with the provided sources. The flag can be passed multiple times.\n\n\nOptions:\n  -h,  -- help      Show help\n  -i,  -- init      Initialize TypeScript (tsconfig.json) in <folder>\n  -m,  -- migrate   Fix TypeScript errors, using codemods\n  -rn, -- rename    Rename files in <folder> from JS/JSX to TS/TSX\n  -ri, -- reignore  Re-run ts-ignore on a project\n\nExamples:\n  npm run ts-migrate -- --help                Show help\n  npm run ts-migrate -- init frontend/foo     Create tsconfig.json file at frontend/foo/tsconfig.json\n  npm run ts-migrate -- rename frontend/foo   Rename files in frontend/foo from JS/JSX to TS/TSX\n\n```\n\n# Reignore\n\nIf you are in a situation where you made some big project-wide changes, update of the common library like TypeScript, React or Redux or improve types for the large codebase. As a result of these operations, you might get quite a few TypeScript compilation errors. There are two ways to proceed:\n\n1.  Fix all the errors (ideal, but time-consuming).\n2.  Make the project compilable and fix errors gradually.\n\nFor the second option we created a re-ignore script, which will fully automate this step. It will add `any` or `@ts-expect-error` (`@ts-ignores`) comments for all problematic places and will make your project compilable.\n\nUsage: `npx ts-migrate -- reignore`.\n\n# Using `--sources` for partial migrations\n\nThere are times in which migrating an entire project is too large a change. The `--sources` flag (or `-s` for short) allows you to run `ts-migrate` on a subset of your project by providing a set of sources to override the defaults specified in your tsconfig. `--sources` takes a relative path from the root of your project. It accepts globs, but remember to wrap any globs with quotes.\n\n```sh\n# Run everything on a sub-directory\nnpx ts-migrate-full /path/to/your/project --sources \"some/components/**/*\"\n\n# Or run just one sub-command\nnpx ts-migrate -- rename /path/to/your/project -s \"some/components/**/*\"\n```\n\nBecause your project's default sources are ignored when `--sources` is used, it's a good idea to specify any ambient type files your project uses as well. Otherwise, `ts-migrate` might mark unidentifiable globals as type errors, even when they aren't. For example, re-including ambient types from your node_modules folder looks like this:\n\n```sh\nnpx ts-migrate-full /path/to/your/project \\\n  --sources \"some/components/**/*\" \\\n  --sources \"node_modules/**/*.d.ts\"\n```\n\n# FAQ\n\n> Can it magically figure out all the types?\n\nUnfortunately, no, it is only so smart. It does figure out types from propTypes, but it will fall back to `any` (`$TSFixMe`) for things it can't figure it out.\n\n> I ran ts-migrate on my code and see lots of `@ts-expect-error` (`@ts-ignores`) and `any`. Is that expected?\n\nThe ts-migrate codemods are only so smart. So, follow up is required to refine the types and remove the `any` (`$TSFixMe`) and `@ts-expect-error` (`@ts-ignores`). The hope is that it's a nicer starting point than from scratch and that it helps accelerate the TypeScript migration process.\n\n> Um... ts-migrate broke my code! D:\n\nPlease file the [issue here](https://github.com/brightlocal/ts-migrate/issues/new).\n\n> What is `$TSFixMe`?\n\nIt's just an alias to `any`: `type $TSFixMe = any;`. We use it at Airbnb for simplifying the migration experience.\nWe also have the same alias for functions: `type $TSFixMeFunction = (...args: any[]) => any;`.\n\n> How did you use ts-migrate?\n\nIt was used a lot at Airbnb codebase! With the help of the ts-migrate we were able to migrate the main part of the entire codebase to the TypeScript. We were able to provide much better starting points in the migration for the huge applications (50k+ lines of codes) and they were migrated in one day!\n\n> Is ts-migrate framework-oriented?\n\nBy itself, ts-migrate is not related to any framework. We created a set of plugins, which are related to the React (link to react). So, default configuration(link) contains plugins, which are expecting a react codebase as an input. We didn't test it on any other frameworks or libraries, use at your own risk!\n\n# Contributing\n\nSee the [Contributors Guide](https://github.com/brightlocal/ts-migrate/blob/master/CONTRIBUTING.md).\n","readmeFilename":"README.md"}