package_config 1.9.3

  • Readme
  • Changelog
  • Installing
  • 96

Build Status pub package

Support for working with Package Configuration files as described in the Package Configuration v2 design document.

The primary libraries are

  • package_config.dart: Defines the PackageConfig class and other types needed to use package configurations.

  • package_config_discovery.dart: Provides functions for reading configurations from files, and writing them back out.

The package includes deprecated backwards compatible functionality to work with the .packages file. This functionality will not be maintained, and will be removed in a future version of this package.

1.9.3 #

  • Fix Package constructor not accepting relative packageUriRoot.

1.9.2 #

  • Updated to support new rules for picking package_config.json over a specified .packages.
  • Deduce package root from .packages derived package configuration, and default all such packages to language version 2.7.

1.9.1 #

  • Remove accidental transitive import of dart:io from entrypoints that are supposed to be cross-platform compatible.

1.9.0 #

  • Based on new JSON file format with more content.
  • This version includes all the new functionality intended for a 2.0.0 version, as well as the, now deprecated, version 1 functionality. When we release 2.0.0, the deprectated functionality will be removed.

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.9.3

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

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

  • Dart: 2.8.4
  • pana: 0.13.15

Analysis suggestions

Package not compatible with runtime flutter-web on Web

Because:

  • package:package_config/package_config.dart that imports:
  • package:package_config/src/package_config_io.dart that imports:
  • package:package_config/src/util_io.dart that imports:
  • dart:io

Package not compatible with runtime js

Because:

  • package:package_config/package_config.dart that imports:
  • package:package_config/src/package_config_io.dart that imports:
  • package:package_config/src/util_io.dart that imports:
  • dart:io

Health suggestions

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

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

line 379 col 35: DO use curly braces for all flow control structures.

line 381 col 49: DO use curly braces for all flow control structures.

Fix lib/src/package_config_io.dart. (-0.50 points)

Analysis of lib/src/package_config_io.dart reported 1 hint:

line 11 col 8: Unused import: 'discovery.dart'.

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. (-7 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.7.0 <3.0.0
charcode ^1.1.0 1.1.3
path ^1.6.4 1.7.0
Dev dependencies
build_runner ^1.0.0
build_test ^0.10.0
build_web_compilers ^2.0.0
matcher ^0.12.5
pedantic ^1.9.0
test ^1.6.4