pub repository
mirror.p-hatan.irpubspec_parse
1.7.0Simple package for parsing pubspec.yaml files with a type-safe API and rich error reporting.
Readme
Build Status pub package package publisher
What's this?
Supports parsing pubspec.yaml files with robust error reporting and support
for most of the documented features.
Usage
Parse a pubspec.yaml string with Pubspec.parse. Hosted and path
dependencies come back as HostedDependency and PathDependency.
Pubspec.parse throws a ParsedYamlException from package:checked_yaml when
a field is invalid. Pass lenient: true to ignore unknown or invalid top-level
keys.
A complete example, including loading from a file, is in example/example.dart.
More information
Read more about the pubspec format.
Changelog
1.7.0
- Added
tagPatternandversionfields toGitDependency, to support thetag_patternkey for git dependencies introduced in Dart 3.9. - Added a usage example.
- Fix
Pubspec.fromJsonwithlenient: trueto preserve the inputMap(YamlMap) whennameis invalid or missing. - Preserve nested
Map(YamlMap) keys and spans whengitorhosteddependency shorthands fail to parse or whenPubspec.fromJsonis called with a non-YamlMapMap. - Added fields to
Pubspec:falseSecrets,hooks,platforms. - Added
versiontoPathDependency, exposing the constraint from an accompanyingversionkey instead of silently discarding it.
1.6.0
- Added
toJsonmethod toPubspecto serialize the object back to aMap. - Parse
HostedDetails.urlas a non-git URI. - Require Dart 3.8
- Fix analysis issues caused by new lints.
1.5.0
- Added fields to
Pubspec:executables,resolution,workspace. - Require Dart 3.6
- Update dependencies.
1.4.0
- Require Dart 3.2
- Seal the
Dependencyclass. - Set
Pubspec.environmentto non-nullable. - Remove deprecated package_api_docs rule
- Move to
dart-lang/toolsmonorepo.
1.3.0
- Require Dart 3.0
- Added support for
ignored_advisoriesfield. - Added structural equality for
Dependencysubclasses andHostedDetails.
1.2.3
- Added topics to
pubspec.yaml.
1.2.2
- Require Dart SDK >= 2.18.0
- Required
json_annotation: ^4.8.0 - Added support for
topicsfield.
1.2.1
- Added support for
fundingfield.
1.2.0
- Added support for
screenshotsfield. - Update
HostedDetailsto reflect howhosteddependencies are parsed in Dart 2.15:- Add
HostedDetails.declaredNameas the (optional)nameproperty in ahostedblock. HostedDetails.namenow falls back to the name of the dependency if no name is declared in the block.
- Add
- Require Dart SDK >= 2.14.0
1.1.0
- Export
HostedDetailspublicly.
1.0.0
- Migrate to null-safety.
- Pubspec:
authorandauthorsare both now deprecated. See https://dart.dev/tools/pub/pubspec#authorauthors
0.1.8
- Allow the latest
package:pub_semver.
0.1.7
- Allow
package:yamlv3.x.
0.1.6
- Update SDK requirement to
>=2.7.0 <3.0.0. - Allow
package:json_annotationv4.x.
0.1.5
- Update SDK requirement to
>=2.2.0 <3.0.0. - Support the latest
package:json_annotation.
0.1.4
- Added
lenientnamed argument toPubspec.fromJsonto ignore format and type errors.
0.1.3
- Added support for
flutter,issue_tracker,publish_to, andrepositoryfields.
0.1.2+3
- Support the latest version of
package:json_annotation.
0.1.2+2
- Support
package:json_annotationv1.
0.1.2+1
- Support the Dart 2 stable release.
0.1.2
- Allow superfluous
versionkeys withgitandpathdependencies. - Improve errors when unsupported keys are provided in dependencies.
- Provide better errors with invalid
sdkdependency values. - Support "scp-like syntax" for Git SSH URIs in the form
[user@]host.xz:path/to/repo.git/.
0.1.1
- Fixed name collision with error type in latest
package:json_annotation. - Improved parsing of hosted dependencies and environment constraints.
0.1.0
- Initial release.
Installing
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.ir
flutter pub add pubspec_parsepubspec.yaml
name: pubspec_parse
version: 1.7.0
description: >-
Simple package for parsing pubspec.yaml files with a type-safe API and rich
error reporting.
repository: https://github.com/dart-lang/tools/tree/main/pkgs/pubspec_parse
issue_tracker: https://github.com/dart-lang/tools/labels/package%3Apubspec_parse
topics:
- dart-pub
environment:
sdk: ^3.8.0
dependencies:
checked_yaml: ^2.0.1
collection: ^1.19.0
json_annotation: ^4.9.0
pub_semver: ^2.1.4
yaml: ^3.1.2
dev_dependencies:
build_runner: ^2.6.0
build_verify: ^3.0.0
dart_flutter_team_lints: ^3.0.0
json_serializable: ^6.11.1
path: ^1.9.0
# Needed because we are configuring `combining_builder`
source_gen: ^4.0.0
stack_trace: ^1.10.0
test: ^1.25.9
test_descriptor: ^2.0.0
test_process: ^2.0.0
Version history
| Version | Published | Archive | SHA-256 |
|---|---|---|---|
| 0.1.0 | 2018-06-04T18:21:40.198430Z | Download | 739c9a8155d7f44cfd40a14216205bc028198de11cb2b44f963f9f11f0e004c6 |
| 0.1.1 | 2018-06-08T22:45:31.541593Z | Download | 218a071c5f6f91b66035e20a65283306ea5e52ed70b0f487f08153a6c4e3b345 |
| 0.1.2 | 2018-06-20T00:04:24.860374Z | Download | 006c48e99d6c452473ac9c6c65e01a84ed93a7ddbb1b3873e14ca74a51a8a865 |
| 0.1.2+1 | 2018-07-23T15:27:04.451213Z | Download | 85c68d1a3d3e0dd4fc80c51d1d92ec489ff8f578d9926123fc7323ea036ded12 |
| 0.1.2+2 | 2018-07-24T23:32:05.161512Z | Download | 5b637e7561dc7f64f78af77f2a6ecfee84da022cf442df74578d71c0751df72c |
| 0.1.2+3 | 2018-10-23T21:34:41.991093Z | Download | 46994784e0e97348a580ae190cead0d05f319caa6d97b0570f4a675c57171444 |
| 0.1.3 | 2018-12-20T19:27:35.969027Z | Download | 6a60a08ba1bee18b3b4d5d1d62e2ea9538639546dcfcf23574eb77b9afa61a5b |
| 0.1.4 | 2019-01-08T15:37:34.453511Z | Download | 0efddc6cb6e302bf9cbab53baeadc3245dbabf1f2a941bd8a4e512ed54559270 |
| 0.1.5 | 2019-08-08T00:17:33.719510Z | Download | e274c9f1defcff2e45b1734d03f3c9c1591a4fa448c92069057326ec889bbe04 |
| 0.1.6 | 2020-12-08T21:06:21.643212Z | Download | 638e15f7188fce557273f67a8d90ed073bf74e1b093f80a1cf48009aac47455b |
| 0.1.7 | 2020-12-08T22:03:48.544321Z | Download | 5e5ef959100457b6243b4ff2ed1de7a1400df60c06ce23ed4f02671e236262cd |
| 0.1.8 | 2021-02-08T21:57:36.907725Z | Download | d65b4c44175a6882692fae384be22c3eed8b9235bb758d8984b11fec55848b8c |
| 1.0.0 | 2021-03-02T17:31:21.371940Z | Download | 358c5ce09744e0e08b3f5f38c53d7d26a8219dd641718f8500f49cfa56240358 |
| 1.1.0 | 2021-09-15T14:59:45.778087Z | Download | 0e01f805457ef610ccaf8d18067596afc34107a27149778b06b2083edbc140c1 |
| 1.2.0 | 2021-12-07T12:10:23.024645Z | Download | 3686efe4a4613a4449b1a4ae08670aadbd3376f2e78d93e3f8f0919db02a7256 |
| 1.2.1 | 2022-08-18T13:23:03.918941Z | Download | 75f6614d6dde2dc68948dffbaa4fe5dae32cd700eb9fb763fe11dfb45a3c4d0a |
| 1.2.2 | 2023-02-28T13:46:22.796955Z | Download | ec85d7d55339d85f44ec2b682a82fea340071e8978257e5a43e69f79e98ef50c |
| 1.2.3 | 2023-05-04T12:39:27.619143Z | Download | c63b2876e58e194e4b0828fcb080ad0e06d051cb607a6be51a9e084f47cb9367 |
| 1.3.0 | 2024-05-28T22:01:40.697594Z | Download | c799b721d79eb6ee6fa56f00c04b472dcd44a30d258fac2174a6ec57302678f8 |
| 1.4.0 | 2024-12-20T13:21:46.303309Z | Download | 81876843eb50dc2e1e5b151792c9a985c5ed2536914115ed04e9c8528f6647b0 |
| 1.5.0 | 2025-01-07T18:20:43.523664Z | Download | 0560ba233314abbed0a48a2956f7f022cce7c3e1e73df540277da7544cad4082 |
| 1.6.0 | 2026-08-28T20:42:44.890663Z | Download | c38b81cbf34450b67e0265d73433569d12e34782e30ed769c9cc99c9d5f2e796 |
| 1.7.0 | 2026-10-21T20:13:21.475969Z | Download | 9ac81c01ffd6a9cf9b2713288834fbaaf6aebde05ffdf02d380e68b8e06f27d8 |
Dependencies
checked_yaml "^2.0.1"
collection "^1.19.0"
json_annotation "^4.9.0"
pub_semver "^2.1.4"
yaml "^3.1.2"