Skip to content

Commit

Permalink
feat: expose a global executable (ReactiveX#19)
Browse files Browse the repository at this point in the history
Now the migration is as follow:

```
npm i -g rxjs-tslint
rxjs-5-to-6-migrate -p [PATH_TO_TSCONFIG]
```

**Important**: the package introduces tslint and TypeScript as dependencies. This helps us to make sure we're using the right version (see #1).
  • Loading branch information
mgechev authored Apr 24, 2018
1 parent fe88cbb commit 186ab4d
Show file tree
Hide file tree
Showing 9 changed files with 182 additions and 112 deletions.
27 changes: 5 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,35 +17,18 @@ This repository provides the following rules:

Using the current set of rules allows you to automatically migrate your project which uses RxJS 5 to RxJS 6. Here's how you can perform the automatic migration:

1. Install `rxjs-tslint`:

```bash
npm i rxjs-tslint
```

2. In your project's directory, create a file called `migrate-rxjs.tslint.json` with the following content:

```json
{
"rulesDirectory": ["node_modules/rxjs-tslint"],
"rules": {
"rxjs-proper-imports": true,
"rxjs-pipeable-operators-only": true,
"rxjs-no-static-observable-methods": true,
"rxjs-collapse-imports": true
}
}
npm i -g rxjs-tslint
rxjs-5-to-6-migrate -p [PATH_TO_TSCONFIG]
```

3. Run tslint, pointing to the `tsconfig.json` file that you use for TypeScript compilation (this is used so the checks can use type information). For example if your `tsconfig` is in `src/tsconfig.app.json` (the default from Angular CLI), the command would be:
For an Angular CLI project the invocation of `rxjs-5-to-6-migrate` will be:

```bash
./node_modules/.bin/tslint -c migrate-rxjs.tslint.json --project src/tsconfig.app.json --fix
rxjs-5-to-6-migrate -p src/tsconfig.app.json
```

4. Enjoy! 😎

#### Notes
### Notes

* Once you run all the migrations check the diff and make sure that everything looks as expected. These fixers cover almost all cases we know of, but it's possible that some manual fixes can be required.
* Although the migration will format your source code, it's likely that that the style is not consistent with the rest of your project. To make sure that everything is properly following your project's style guide, we recommend you apply a formatter such as prettier or clang-format after the edits are made.
Expand Down
4 changes: 4 additions & 0 deletions bin/rxjs-5-to-6-migrate
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env node

require('../rxjs-5-to-6-migrate');

189 changes: 121 additions & 68 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 186ab4d

Please sign in to comment.