{"id":24926152,"url":"https://github.com/alexei-sintotski/pubspec_yaml","last_synced_at":"2025-07-26T18:09:40.029Z","repository":{"id":36506030,"uuid":"224975266","full_name":"alexei-sintotski/pubspec_yaml","owner":"alexei-sintotski","description":"Dart library to access and manipulate content of pubpec.yaml files","archived":false,"fork":false,"pushed_at":"2022-02-25T11:14:20.000Z","size":165,"stargazers_count":6,"open_issues_count":3,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T20:07:20.319Z","etag":null,"topics":["dart","flutter","pub","pubspec"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alexei-sintotski.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-30T07:21:32.000Z","updated_at":"2024-09-08T04:15:38.000Z","dependencies_parsed_at":"2022-08-08T15:16:45.960Z","dependency_job_id":null,"html_url":"https://github.com/alexei-sintotski/pubspec_yaml","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-sintotski%2Fpubspec_yaml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-sintotski%2Fpubspec_yaml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-sintotski%2Fpubspec_yaml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alexei-sintotski%2Fpubspec_yaml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alexei-sintotski","download_url":"https://codeload.github.com/alexei-sintotski/pubspec_yaml/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dart","flutter","pub","pubspec"],"created_at":"2025-02-02T12:26:04.260Z","updated_at":"2025-04-09T20:07:41.949Z","avatar_url":"https://github.com/alexei-sintotski.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pubspec_yaml [![Build Status](https://travis-ci.org/alexei-sintotski/pubspec_yaml.svg?branch=master)](https://travis-ci.org/alexei-sintotski/pubspec_yaml) [![codecov](https://codecov.io/gh/alexei-sintotski/pubspec_yaml/branch/master/graph/badge.svg)](https://codecov.io/gh/alexei-sintotski/pubspec_yaml) [![pubspec_lock version](https://img.shields.io/pub/v/pubspec_yaml?label=pubspec_yaml)](https://pub.dev/packages/pubspec_yaml)\n\nDart library to access and manipulate content of pubpec.yaml files\n\n## Class PubspecYaml\n\nPubspecYaml is a data type representing data stored in pubspec.yaml files.\n\nThe following fields are supported:\n* Package name\n* Package version\n* Package description\n* Package author/authors\n* Package homepage, repository, and issue tracker\n* Package documentation\n* Package server specification\n* Dependency specifications: regular, dev, and overrides\n* SDK constraints\n* Command-line executables provided by the package\n\nOther fields are accessible via PubspecYaml.customFields as a JSON structure (Map\u003cString, dynamic\u003e).\n\n## YAML Import\n\nPubspecYaml provides two methods to import pubspec.yaml content:\n* The factory method PubspecYaml.loadFromYamlString() creates an object from a string with pubspec.yaml content\n* String extension method toPubspecYaml()\n\n## YAML Export\n\nPubspecYaml.toYamlString() produces pubspec.yaml content that can be written to a file\n\n## Data Manipulation\n\nPubspecYaml uses functional_data extensions to enable equality operations and lenses (https://pub.dev/packages/functional_data).\n\n## Example\n\nThe following Dart script checks whether production dependencies have overrides:\n```\nvoid main() {\n  final pubspecYaml = File('pubspec.yaml').readAsStringSync().toPubspecYaml();\n\n  final productionOverrides = pubspecYaml.dependencyOverrides.where(\n    (override) =\u003e pubspecYaml.dependencies.any((\n      productionDependency,\n    ) =\u003e\n        productionDependency.package() == override.package()),\n  );\n\n  if (productionOverrides.isEmpty) {\n    print('SUCCESS: No overrides of production dependencies detected');\n  } else {\n    print('WARNING: Overrides of production dependencies detected:');\n    productionOverrides.forEach(print);\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexei-sintotski%2Fpubspec_yaml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexei-sintotski%2Fpubspec_yaml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexei-sintotski%2Fpubspec_yaml/lists"}