rxdart_codemod 0.1.5

  • Readme
  • Changelog
  • Installing
  • new46

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:


dependencies:
  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';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
1
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
46
Learn more about scoring.

We analyzed this package on Dec 4, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.1
  • pana: 0.12.21

Platforms

Detected platforms: Flutter, other

Platform components identified in package: io.

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. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (analyzer).

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.

Dependencies

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.1
args >=1.5.1 <2.0.0 1.5.2
codemod >=0.1.5 <0.2.0 0.1.5
source_span >=1.4.1 <2.0.0 1.5.5
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.3
csslib 0.16.1
front_end 0.1.27 0.1.29
glob 1.2.0
html 0.14.0+3
io 0.3.3
js 0.6.1+1
kernel 0.3.27 0.3.29
logging 0.11.3+2
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
path 1.6.4
pub_semver 1.4.2
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+13
yaml 2.2.0
Dev dependencies
coverage >=0.13.0 <0.14.0
pedantic ^1.8.0 1.8.0+1
test ^1.6.0