package_config 1.1.0

  • Readme
  • Changelog
  • Installing
  • 90

package_config #

Support for working with Package Resolution Configuration files as described in this DEP, under review here.

Build Status pub package

Features and bugs #

Please file feature requests and bugs at the issue tracker.

1.1.0 #

  • Allow parsing files with default-package entries and metadata. A default-package entry has an empty key and a valid package name as value. Metadata is attached as fragments to base URIs.

1.0.5 #

  • Fix usage of SDK constants.

1.0.4 #

  • Set max SDK version to <3.0.0.

1.0.3 #

  • Removed unneeded dependency constraint on SDK.

1.0.2 #

  • Update SDK constraint to be 2.0.0 dev friendly.

1.0.1 #

  • Fix test to not write to sink after it's closed.

1.0.0 #

  • Public API marked stable.

0.1.5 #

  • FilePackagesDirectoryPackages.getBase(..) performance improvements.

0.1.4 #

  • Strong mode fixes.

0.1.3 #

  • Invalid test cleanup (to keep up with changes in Uri).

0.1.1 #

  • Syntax updates.

0.1.0 #

  • Initial implementation.

Use this package as a library

1. Depend on it

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


dependencies:
  package_config: ^1.1.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:package_config/discovery.dart';
import 'package:package_config/discovery_analysis.dart';
import 'package:package_config/packages.dart';
import 'package:package_config/packages_file.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
97
Health:
Code health derived from static analysis. [more]
78
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
87
Overall:
Weighted score of the above. [more]
90
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4

Health suggestions

Fix lib/discovery.dart. (-9.08 points)

Analysis of lib/discovery.dart reported 19 hints, including:

line 34 col 12: Unnecessary new keyword.

line 38 col 17: Unnecessary new keyword.

line 57 col 27: Unnecessary new keyword.

line 58 col 12: Unnecessary new keyword.

line 63 col 10: Unnecessary new keyword.

Fix lib/packages_file.dart. (-5.36 points)

Analysis of lib/packages_file.dart reported 11 hints, including:

line 65 col 23: Unnecessary new keyword.

line 72 col 9: Unnecessary new keyword.

line 114 col 11: Unnecessary new keyword.

line 126 col 18: Unnecessary new keyword.

line 133 col 13: Unnecessary new keyword.

Fix lib/src/util.dart. (-4.41 points)

Analysis of lib/src/util.dart reported 9 hints, including:

line 46 col 11: Unnecessary new keyword.

line 50 col 11: Unnecessary new keyword.

line 55 col 11: Unnecessary new keyword.

line 63 col 11: Unnecessary new keyword.

line 67 col 11: Unnecessary new keyword.

Fix additional 4 files with analysis or formatting issues. (-4.97 points)

Additional issues in the following files:

  • lib/src/packages_impl.dart (5 hints)
  • lib/src/packages_io_impl.dart (3 hints)
  • lib/discovery_analysis.dart (1 hint)
  • lib/packages.dart (1 hint)

Maintenance suggestions

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

For more information see the pub package layout conventions.

The package description is too short. (-3 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.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev <3.0.0
charcode ^1.1.0 1.1.2
path ^1.0.0 1.6.4
Dev dependencies
test ^1.3.0