{"id":21074794,"url":"https://github.com/dawsbot/typewriter","last_synced_at":"2025-05-16T06:31:29.564Z","repository":{"id":57382509,"uuid":"112887989","full_name":"dawsbot/typewriter","owner":"dawsbot","description":"🎹 POC TypeScript -\u003e Flow Converter","archived":false,"fork":false,"pushed_at":"2017-12-21T01:18:54.000Z","size":8507,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-28T12:52:47.665Z","etag":null,"topics":["codegen","flow","flowtype","javascript","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dawsbot.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-03T00:21:58.000Z","updated_at":"2019-11-13T09:54:09.000Z","dependencies_parsed_at":"2022-09-01T04:01:58.417Z","dependency_job_id":null,"html_url":"https://github.com/dawsbot/typewriter","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Ftypewriter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Ftypewriter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Ftypewriter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dawsbot%2Ftypewriter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dawsbot","download_url":"https://codeload.github.com/dawsbot/typewriter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225411493,"owners_count":17470246,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["codegen","flow","flowtype","javascript","typescript","typescript-library"],"created_at":"2024-11-19T19:18:01.683Z","updated_at":"2024-11-19T19:18:02.294Z","avatar_url":"https://github.com/dawsbot.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./media/typewriter.jpg\" title=\"typewriter\"/\u003e\n\n  \u003cbr/\u003e\n  \u003cimg src=\"./media/tagline.png\" title=\"typewriter\" width=\"600px\"/\u003e\n\n  \u003cbr/\u003e\n  \u003c!-- badges --\u003e\n  \u003cimg src=\"https://img.shields.io/badge/Node-%3E%3Dv4-ff69b4.svg\"\u003e\n  \u003ca href=\"https://travis-ci.org/dawsbot/typewriter\"\u003e\n    \u003cimg src=\"https://travis-ci.org/dawsbot/typewriter.svg?branch=master\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/tw-cli\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/tw-cli.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr/\u003e\n\n🎉 Using TypeScript is fun, but [Flow](https://flow.org/) is even better. The typing systems are similar, but the community is quickly supporting Flow for React. Take React Native for example, Flow is supported by default while TypeScript is a nightmare to configure (think `/build` dir, hot reloading, and concurrent typescript compilation separate from babel).\n\nWith this increase in open-source effort, many companies are doubling down on Flow (Facebook, Uber, etc.).\n\n\u003cbr/\u003e\n\u003cp align=\"center\"\u003e\n  \u003cb\u003e\n  Adopt Flow instantly with TypeWriter.\n  \u003c/b\u003e\n\u003c/p\u003e\n\u003cbr/\u003e\n\n⚡️ Tell **TypeWriter** which files you care about, and it will run a [big list of codemods](#default-codemods) instantly!\n\n⚠️ This is early stage software. There will be bugs. Please help improve it by using this and reporting issues ⚠️ \n\n🔧 *There is minor manual work after running TypeWriter. If you see room for improvement, [create an issue](https://github.com/dawsbot/typewriter/issues/new)!*\n\n\u003cbr/\u003e\n\n## Install\n\n```\n$ npm install --global tw-cli\n```\n\n## Usage\n\n```\n$ typewriter src\n✔ Converted src/index.ts -\u003e src/index.js\n✔ Converted src/App.tsx -\u003e src/App.jsx\n```\n\n[See more examples](#more-help)\n\n\u003cbr/\u003e\n\n## Codemods Included\n\n- [x] Rename files from `.ts` -\u003e `.js` \u0026 `.tsx` -\u003e `.jsx`\n```\n  a.ts -\u003e a.js\n  a.tsx -\u003e a.jsx\n```\n\n\u003cbr/\u003e\n\n- [x] Add flow keyword quote (`// @flow`)\n```\n  \"content\" -\u003e \"// @flow\\ncontent\"\n```\n\n\u003cbr/\u003e\n\n- [x] Remove `public` and `private` keywords\n```\n  \"public render()\" -\u003e \"render()\"\n```\n\n\u003cbr/\u003e\n\n- [x] `interface` -\u003e `type`\n```\n  \"interface Prop {}\" -\u003e \"type Prop = {}\"\n```\n\n\u003cbr/\u003e\n\n- [x] Type imports\n\n* *ensure your types are in `types`, `types/*`, `interface/*`, or `interfaces/*`*\n\n```\n// imports from types change\n// \"import {Prop} from './types'\" -\u003e \"import type {Prop} from './types'\"\n\n// imports from everywhere else are left alone\n// \"import {NotProp} from './not-types'\" -\u003e \"import {NotProp} from './not-types'\"\n```\n\n\u003cbr/\u003e\n\n- [x] Remove `readonly`\n\nBefore:\n```js\n{\n  readonly color: string\n}\n```\n\nAfter:\n```js\n{\n  color: string\n}\n```\n\n\u003cbr/\u003e\n\n- [x] `JSX.Element` -\u003e `React.Node`\n\nIn prop typings for TypeScript, a react element is called `JSX.Element` while in Flow this is `React.Node`.\n\nBefore:\n```js\n{\n  element: JSX.Element;\n}\n```\n\nAfter:\n```js\n{\n  element: React.Node;\n}\n```\n\n## More Help\n\n```\n$ typewriter --help\n\n  TypeScript -\u003e Flow Converter\n\n  Usage\n     $ typewriter \u003cpath|glob\u003e [...]\n\n  Examples\n     $ typewriter index.ts\n     ✔ Converted index.ts -\u003e index.js\n\n     $ typewriter src\n     ✔ Converted src/index.ts -\u003e src/index.js\n     ✔ Converted src/App.tsx -\u003e src/App.jsx\n\n     # ignore node_modules\n\n     $ typewriter * '!node_modules/*'\n     ✔ Converted src/index.ts -\u003e src/index.js\n     ✔ Converted src/App.tsx -\u003e src/App.jsx\n     ✔ Converted index.ts -\u003e index.js\n```\n\n## Support Development\n\nThe work done for this project is free. If you save time with TypeWriter, consider making a [donation](https://liberapay.com/DawsBot).\n\nAre Bitcoin (BTC) donations more your style?\n\n14xAeqDucUpRZkSDQrHCXaKsWmNPeqaB5q\n\n\u003cimg src=\"./media/bitcoin-wallet.png\" title=\"typewriter\" width=\"100px\"/\u003e\n\n## License\n\nMIT © [Dawson Botsford](https://dawsbot.com)\n","funding_links":["https://liberapay.com/DawsBot"],"categories":["📦 Legacy \u0026 Inactive Projects"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawsbot%2Ftypewriter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdawsbot%2Ftypewriter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdawsbot%2Ftypewriter/lists"}