pubspec 0.1.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 84

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

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support 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]
73
Health:
Code health derived from static analysis. [more]
91
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
84
Learn more about scoring.

We analyzed this package on Dec 6, 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: other

Primary library: package:pubspec/pubspec.dart with components: io, mirrors.

Health suggestions

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

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

line 17 col 15: Unnecessary new keyword.

line 21 col 18: Unnecessary new keyword.

line 23 col 18: Unnecessary new keyword.

line 25 col 18: Unnecessary new keyword.

line 27 col 18: Unnecessary new keyword.

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

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

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

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

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

line 84 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.2
stuff ^0.1.0 0.1.0
yaml ^2.1.15 2.2.0
Transitive dependencies
charcode 1.1.2
collection 1.14.12
matcher 0.12.6
meta 1.1.8
quiver 2.1.2+1
source_span 1.5.5
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
uri 0.11.3+1
utf 0.9.0+5
Dev dependencies
test ^1.3.3