pubspec 0.1.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 90

pubspec #

A library for manipulating pubspec files.

Usage #

A simple usage example:

import 'package:pubspec/pubspec.dart';

main() {
  // load it
  var pubSpec = await PubSpec.load(myDirectory);

  // change the dependencies to a single path dependency on project 'foo'
  var newPubSpec = pubSpec.copy(dependencies: { 'foo': new PathReference('../foo') });

  // save it
  await newPubSpec.save(myDirectory);
}

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Changelog #

0.1.3 #

Demoved the dependency on the stuff package has it had a dependency on mirrors. The result is that you couldn't do a native compile of any package dependent on pubspec. Copied the class Json_utils.dart from stuff package to make this possible.

0.1.1 #

  • load from file
  • replace deprecated isInstanceOf

0.1.0 #

  • Dart 2

0.0.11 #

  • additional constructor

0.0.10 #

  • tidied a few things

0.0.9 #

  • Bug Fix. publish_to was serialising to publishTo

0.0.8 #

  • upgraded some dependencies

0.0.7 #

  • add publish_to

0.0.6 #

  • tidy dependencies

0.0.3 #

  • Added property allDependencies which combines dependencies with devDependencies

0.0.2 #

  • Added == and hashCode to dependency reference classes

0.0.1 #

  • Initial version, created by Stagehand

example/pubspec.dart

// Copyright (c) 2015, Anders Holmgren. All rights reserved. Use of this source code
// is governed by a BSD-style license that can be found in the LICENSE file.

library pubspec.example;

main() {}

Use this package as a library

1. Depend on it

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


dependencies:
  pubspec: ^0.1.4

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

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

  • Dart: 2.7.1
  • pana: 0.13.6

Health suggestions

Fix lib/src/dependency.dart. (-6.78 points)

Analysis of lib/src/dependency.dart reported 14 hints, including:

line 18 col 15: Unnecessary new keyword.

line 22 col 18: Unnecessary new keyword.

line 24 col 18: Unnecessary new keyword.

line 26 col 18: Unnecessary new keyword.

line 28 col 18: Unnecessary new keyword.

Fix lib/src/json_utils.dart. (-3.45 points)

Analysis of lib/src/json_utils.dart reported 7 hints, including:

line 10 col 30: Unnecessary new keyword.

line 11 col 45: Use = to separate a named parameter from its default value.

line 12 col 5: Unnecessary new keyword.

line 16 col 34: Use = to separate a named parameter from its default value.

line 86 col 35: Unnecessary new keyword.

Fix lib/src/pubspec.dart. (-1.99 points)

Analysis of lib/src/pubspec.dart reported 4 hints:

line 82 col 24: Use = to separate a named parameter from its default value.

line 83 col 27: Use = to separate a named parameter from its default value.

line 84 col 31: Use = to separate a named parameter from its default value.

line 85 col 24: Use = to separate a named parameter from its default value.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.2.2 <3.0.0
path ^1.6.2 1.6.4
pub_semver ^1.4.2 1.4.4
uri ^0.11.3+1 0.11.3+1
yaml ^2.1.15 2.2.0
Transitive dependencies
charcode 1.1.3
collection 1.14.12
matcher 0.12.6
meta 1.1.8
quiver 2.1.3
source_span 1.7.0
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
utf 0.9.0+5
Dev dependencies
test ^1.3.3