angular_cli 0.2.0

  • Readme
  • Changelog
  • Installing
  • 50

AngularDart CLI #

Pub Package Build Status

A command line interface for AngularDart. It can scaffold a skeleton AngularDart project, component, and test with page object.

Installation #

To install:

pub global activate angular_cli
pub global activate webdev

To update:

pub global activate angular_cli
pub global activate webdev

Usage #

ngdart help

For help on specific command, run ngdart help [command name] For example:

ngdart help generate test

will show how to use command generate test.

Generating AngularDart project #

ngdart new project_name
cd project_name
pub get
webdev serve

Navigate to http://localhost:8080 to visit the project you just built. Command following will assume that you are in the root directory of the project.

Generating component #

ngdart generate component AnotherComponent

This command will generate component under folder lib/. You can use option -p to change the folder.

Generating test #

ngdart generate test lib/app_component.dart

Command above will generate 2 files. One is page object file and the other one is test file. Test generated is using angular_test and test package.

Use command

pub run build_runner test --fail-on-severe -- -p chrome

to run generated test with Chrome.

Changelog #

0.1.2 #

  • Added support for generate directive
  • Added support for generate pipe

0.1.1 #

  • Fixed issues on Windows.

0.1.0+3 #

  • Exported visitors which can be used to extract info from Dart files.

0.1.0+2 #

  • Fixed an issue on formatting.
  • Enabled travis.

0.1.0+1 #

  • Added missing dependencies.

0.1.0 #

  • New implementation, support to create project, generate AngularDart component and test.

0.0.2 #

  • Fixed scaffold command so that it uses the correct platform separator. Instead of creating files in the CWD, it creates them in $name/lib and $name/test of the CWD.

0.0.1 #

  • Added scaffold command, which generates all of the files need for a component. This should be run from an empty folder and provider a selector name like my-foo-bar.

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate angular_cli

2. Use it

The package has the following executables:

$ ngdart

Use this package as a library

1. Depend on it

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

  angular_cli: ^0.2.0

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:angular_cli/visitors.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 Oct 21, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.5.1
  • pana: 0.12.21


Detected platforms: Flutter, other

Platform components identified in package: io, isolate.

Health suggestions

Fix lib/src/commands/command.dart. (-1 points)

Analysis of lib/src/commands/command.dart reported 2 hints:

line 22 col 25: Use isEmpty instead of length

line 30 col 9: Use isNotEmpty instead of length

Fix lib/src/file_reader.dart. (-1 points)

Analysis of lib/src/file_reader.dart reported 2 hints:

line 15 col 58: Use = to separate a named parameter from its default value.

line 18 col 63: Use = to separate a named parameter from its default value.

Fix bin/ngdart.dart. (-0.50 points)

Analysis of bin/ngdart.dart reported 1 hint:

line 22 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Format lib/src/package_uri_resolver.dart.

Run dartfmt to format lib/src/package_uri_resolver.dart.

Format lib/src/project_model.dart.

Run dartfmt to format lib/src/project_model.dart.

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, html).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is getting outdated. (-16.16 points)

The package was last published 60 weeks ago.

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 angular_cli.dart. Packages with multiple examples should provide example/

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.69.0 <3.0.0
analyzer ^0.32.4 0.32.6 0.39.0
ansicolor ^1.0.2 1.0.2
args ^1.4.4 1.5.2
html ^0.13.3+2 0.13.4+2 0.14.0+3
logging ^0.11.3+2 0.11.3+2
mustache ^1.0.1 1.1.1
path ^1.6.2 1.6.4
resource ^2.1.5 2.1.6
Transitive dependencies
async 2.4.0
charcode 1.1.2
collection 1.14.12
convert 2.1.1
crypto 2.1.3
csslib 0.15.0 0.16.1
front_end 0.1.4+2 0.1.28
glob 1.2.0
js 0.6.1+1
kernel 0.3.4+2 0.3.28
meta 1.1.7
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
pedantic 1.8.0+1
plugin 0.2.0+3
source_span 1.5.5
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
utf 0.9.0+5
watcher 0.9.7+12
yaml 2.2.0
Dev dependencies
test ^1.3.0