0.16.2 • Published 10 months ago

flowts v0.16.2

Weekly downloads
109
License
MIT
Repository
github
Last release
10 months ago

Flow to Typescript

Usage:

npm install -g flowts

Usage: flowts [options] ./path/to/project

Flow to TypeScript migration tool

Options:
  -V, --version                output the version number
  -R, --no-recast              use babel generator instead of recast
  -P, --no-prettier            do not run prettier on converted code
  --no-allow-js                convert all JS files to TypeScript(including without Flow)
  --interactive-rename         Wait for interactive confirmation after renaming, before writing converted code 
                                 (allowing to have separate commit to better preserve file history) (default: false)
  -i, --include <includeGlob>  Glob expression of files to include,
                               default: "**/*.{js,mjs,jsx,js.flow}" (default: "**/*.{js,mjs,jsx,js.flow}")
  -x, --exclude <excludeGlob>  Additional excludes glob expression (by default node_modules 
                               and files from .gitignore is excluded) (default: "**/node_modules/**")
  -h, --help                   display help for command

How it works

  1. Convert source code using: https://github.com/zxbodya/flowts/tree/master/packages/babel-plugin-flow-to-typescript
  2. Do some additional fixes for types embedded in flow library (for example react types are somewhat different from typescript version)
  3. Prints code using recast (https://github.com/benjamn/recast), so most of the formatting is preserved.
  4. Because not all formatting can be preserved - it also re-formats code using prettier (assumption is that converted codebase is using it, and there is configured in standard way, like having .prettierrc). Also be sure you already have prettier 2.0 (it needed for TypeScript 3.8)
  5. Before writing converted file - script verifies that there are no changes other than type annotations (all errors are logged - so, be sure to check logs and to adjustments accordingly)

Project priorities

  1. Only type annotation should be changed, so code after migration is in "working" state
  2. Type information should be preserved as much as possible
  3. When possible formatting and comments should be preserved

Cavearts

There might be unexpected formatting changes, or bugs related to using recast - it is good, but there can be bugs…

Rarely, but sometimes:

  • there might be unexpected formatting changes
  • some comments might be removed
0.16.0

10 months ago

0.16.1

10 months ago

0.16.2

10 months ago

0.15.21

1 year ago

0.15.19

1 year ago

0.15.20

1 year ago

0.15.17

2 years ago

0.15.18

2 years ago

0.15.15

2 years ago

0.15.16

2 years ago

0.15.13

2 years ago

0.15.14

2 years ago

0.15.12

2 years ago

0.15.8

2 years ago

0.15.9

2 years ago

0.15.9-alpha.0

2 years ago

0.15.9-alpha.1

2 years ago

0.15.10

2 years ago

0.15.11

2 years ago

0.15.4

2 years ago

0.15.5

2 years ago

0.15.6

2 years ago

0.15.7

2 years ago

0.15.2

2 years ago

0.15.3

2 years ago

0.13.0

2 years ago

0.13.1

2 years ago

0.15.0

2 years ago

0.13.2

2 years ago

0.15.1

2 years ago

0.14.0

2 years ago

0.14.1

2 years ago

0.12.6

3 years ago

0.12.5

3 years ago

0.12.4

3 years ago

0.12.2

3 years ago

0.12.3

3 years ago

0.12.0

3 years ago

0.12.1

3 years ago

0.11.20

3 years ago

0.11.21

3 years ago

0.11.19

3 years ago

0.11.17

3 years ago

0.11.18

3 years ago

0.11.15

3 years ago

0.11.16

3 years ago

0.11.14

3 years ago

0.11.13

3 years ago

0.11.12

3 years ago

0.11.10

3 years ago

0.11.11

3 years ago

0.11.9

3 years ago

0.11.8

3 years ago

0.11.7

3 years ago

0.11.6

3 years ago

0.11.5

3 years ago

0.11.4

3 years ago

0.11.3

4 years ago

0.11.2

4 years ago

0.11.1

4 years ago

0.11.0

4 years ago

0.10.8

4 years ago

0.10.7

4 years ago

0.10.6

4 years ago

0.10.5

4 years ago

0.10.4

4 years ago

0.10.3

4 years ago

0.10.2

4 years ago

0.10.1

4 years ago

0.10.0

4 years ago

0.9.5

4 years ago

0.9.4

4 years ago

0.9.3

4 years ago

0.9.2

4 years ago

0.9.1

4 years ago

0.9.0

4 years ago

0.8.6

4 years ago

0.8.5

4 years ago

0.8.4

4 years ago

0.8.3

4 years ago

0.8.2

4 years ago

0.8.1

5 years ago

0.8.0

5 years ago

0.7.0

5 years ago

0.6.0

5 years ago

0.5.0

5 years ago

0.4.8

5 years ago

0.4.7

5 years ago

0.4.6

5 years ago

0.4.5

5 years ago

0.4.4

5 years ago

0.4.3

5 years ago

0.4.2

5 years ago

0.4.1

5 years ago

0.4.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago