rxdart_codemod 0.1.5

  • Readme
  • Changelog
  • Installing
  • 82

rxdart_codemod #

Build Status codecov

A utility for updating RxDart code from 0.22.x to 0.23.x.

RxDart 0.23.x removes the Observable class by taking advantage of extension methods. This change requires many small refactors, mostly around calling slightly different constructors.

This codemod runs through your codebase and performs these refactors so you don't have to!

Installation #

rxdart_codemod provides an executable via dart global packages.

In your terminal:

pub global activate rxdart_codemod 

Usage #

cd path/to/your/code
pub global run rxdart_codemod:22_to_23

Arguments #

    --[no-]recursive    Apply updates to Dart files in the current directory and all subdirectories recursively.
                        (defaults to on)

    --[no-]classes      Use Stream classes instead of Rx factories. Example: "TimerStream" instead of "Rx.timer"
                        (defaults to off)

-h, --help              Prints the help menu

0.1.5 #

  • Convert myStream as Observable<int> to myStream

0.1.4 #

  • Remove debug print statement

0.1.3 #

  • Add two missing SimpleTypeConverters

0.1.2 #

  • Fix arguments

0.1.1 #

  • Fix docs

0.1.0 #

  • Initial version
  • Converts RxDart 0.22.x to 0.23.x

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate rxdart_codemod

2. Use it

The package has the following executables:

$ 22_to_23

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  rxdart_codemod: ^0.1.5

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:rxdart_codemod/extension_methods/suggestors/as_observable_converter.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/concat_map_converter.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/constructor_converters.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/error_stream_converter.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/factory_converter.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/factory_stream_converter.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/observable_cast_converter.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/simple_type_converters.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/static_factory_converter.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/static_factory_stream_class_converter.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/stream_factory_converter.dart';
import 'package:rxdart_codemod/extension_methods/suggestors/where_type_converter.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on May 30, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.2
  • pana: 0.13.8-dev

Health issues and suggestions

Document public APIs. (-1 points)

69 out of 69 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Maintenance issues and suggestions

Support latest dependencies. (-20 points)

The version constraint in pubspec.yaml does not support the latest published versions for 2 dependencies (analyzer, codemod).

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and rxdart_codemod.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.5.0 <3.0.0
analyzer >=0.37.0 <0.39.0 0.38.5 0.39.8
args >=1.5.1 <2.0.0 1.6.0
codemod >=0.1.5 <0.2.0 0.1.5 0.2.0
source_span >=1.4.1 <2.0.0 1.7.0
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.12
convert 2.1.1
crypto 2.1.5
csslib 0.16.1
front_end 0.1.27 0.1.29
glob 1.2.0
html 0.14.0+3
io 0.3.4
js 0.6.1+1
kernel 0.3.27 0.3.29
logging 0.11.4
meta 1.1.8
node_interop 1.1.1
node_io 1.1.1
package_config 1.9.3
path 1.7.0
pub_semver 1.4.4
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+15
yaml 2.2.1
Dev dependencies
coverage >=0.13.0 <0.14.0
pedantic ^1.8.0 1.9.0
test ^1.6.0