pubspec_manager
Read, write and modify a pubspec.yaml with a type safe API including retention and modifications of comments and out of spec content.
4.0.1
85K downloads/mo
#1188 most downloaded on pub.dev
onepub-dev/pubspec_manager
What this package is like to depend on
Last release 5 months ago
01 Mar 2026
Release timing varies
gaps range from 8 days to 10 months
Nearly every release is documented
notes for 14 of 14 stable releases
2 versions withdrawn
withdrawn after publishing
3 years old
29 releases · first in 2023
10 releases in the last 12 months
see the full history below
Release timeline
29 releases · Oct 2023 to Mar 2026
2024
2025
2026
Releases
latest 29-
4.0.101 Mar 2026 -
4.0.001 Mar 2026Release notes
Open source →- Fixed comment parsing when a comment appears at a lower indentation level than expected before a child key.
- Misindented comments are now attached to the subsequent yaml element and their original indentation is preserved when writing.
- Added support for additional documented pubspec keys:
fundingfalse_secretstopicsignored_advisoriesscreenshots
- Fixed #20:
dev_dependencies.exists(...)could miss some dependencies when comments/blank lines appeared around path dependencies, which could lead to duplicate insertion logic in callers. - Added regression coverage for #20.
- Thanks to @jonpittock for reporting issue #20.
- Expanded tests for new keys, including:
- read/write round trips
- existence checks
- keys with no values
- empty list item values
- descendant-line removal behavior
-
3.2.111 Feb 2026Release notes
Open source →- Added method Environent.isFlutterPackage which returns true if the loaded pubspec.yaml is a flutter package. We look for the 'flutter' dependency in the pubspec.yaml.
-
3.2.002 Jan 2026Release notes
Open source →- work to remove move usages of late by moving to factory ctors.
- fixed a cluster of missing initialisations for fields that were late final.
-
3.1.123 Dec 2025Release notes
Open source →- changed the environment.sdkConstraint and environment.flutterConstraint to return a semver VersionConstraint rather than our interal VersionConstraint for better compatibility with the broader dart ecosystem.
-
3.1.023 Dec 2025 withdrawnRelease notes
Open source →- exposed new getters for environment.sdkConstraint and environment.flutterConstraint
-
3.0.117 Oct 2025Release notes
Open source →- marked the Dependency class as sealed is the pub.dev spec defines a closed set of types.
-
3.0.017 Oct 2025 withdrawn -
2.0.126 Sep 2025Release notes
Open source →- added isNone method to PublishTo. Publish_to will now return an empty url if there is no publish_to key or it has one but it is empty. Added a new method publish_to.isPubDev to indicate if the package would be publishe to pub.dev.
- upgraded to lint_hard 6.0 and fixed lints.
-
2.0.026 Sep 2025Release notes
Open source →- BREAKING removed publishTo.none as this was breaking debug sessions as the 'none' getter was actually settting the url to 'none'. Check all other getters to ensure we were not doing something equally stupid. You will need to change all occurances of publish_to.none to publish_to.setNone()
-
1.0.307 Jul 2025Release notes
Open source →- Widen
stringsdependency range to include4.0.0release (no breaking changes).
- Widen
-
1.0.218 Apr 2025Release notes
Open source →- Fixed a parsing bug. If there was no version for the pubspec we would grab the version from the first dependency. We now only look for a version at the top level.
- Fixed #17 - a comment line that appeared after the name of a depencency for a hosted package would cause the parser to fail.
-
1.0.104 Jan 2025Release notes
Open source →- Merge pull request #15 from Azramis/main
- Add unit tests for git deps usage
- Fixed Git dependencies usage
-
1.0.025 Mar 2024Release notes
Open source →- originally released as 0.9.0 as we are missing a few features, but the dart pub resolution keeps telling people to upgrade to the 1.x beta (which is actually older) so I need to change to 1.0.0 to keep things sane. No other changes have been made.
-
1.0.0-beta.129 Feb 2024 pre-release -
1.0.0-alpha.1727 Feb 2024 pre-releaseRelease notes
Open source →- changed publishTo.set to value - not certain this is consistent. executables.append no directly takes a name rather than requiring a builder.
- renamed Platform to PlatformSupport to avoid a conflict with the dart core Platform class.
- implemented value and set for version.
- added additional examples to the readme.
- fixed the processing of multi-line strings - essentially the description field.
- made version and environment sections and dealt with the fall out. renamed section.line to section.sectionHeading to make its use more obvious.
- added specific description class
- added update example to README.md
- added an example on how to update the version no.
-
1.0.0-alpha.1620 Feb 2024 pre-releaseRelease notes
Open source →- Fixed a bug in the iterator for dependencies, exectuables and platforms.
-
1.0.0-alpha.1519 Feb 2024 pre-releaseRelease notes
Open source →- updated tests and example in line with api changes.
- change getVersion and setVersion to getSemVersion and setSemVersion to make their nature more apparent.
- renaned the environmentBuilder arg to PubSpec to environment in keeping with the naming pattern elsewhere.
- Fixed a number of the setters for pubspec keys.
- removed the need to pass the key to the versionbuider as it is known by the builder.
- added publishTo key.
- Fixed a bug where the section for a dependency wasn't being created correctly as we created it before all of the dependencies' lines had been added to the document.
-
1.0.0-alpha.1414 Jan 2024 pre-releaseRelease notes
Open source →- Fixed a formatting issue where inline comments didn't preserve leading whitespace. We now do.
- Fixed a bug where a comment after a dep was being associated with two sections.
-
1.0.0-alpha.1313 Jan 2024 pre-releaseRelease notes
Open source →- Fixes: #3 when loading a pubspec an an exception was thrown we reported that the pubspec was being loaded from a string even when it was loaded from a file.
-
1.0.0-alpha.1213 Jan 2024 pre-releaseRelease notes
Open source →- BREAKING dependency classes have been renamed to begin with Dependency so PubHostedDependency becomes DependencyPubHosted. This is to help with discovery and auto-completion.
- HostedDependency is now called DependencyAltHosted
-
1.0.0-alpha.1125 Oct 2023 pre-releaseRelease notes
Open source →- Fixes for environment when the sdk or flutter constraints where missing.
- work on validating the function of the VersionConstraint class
-
1.0.0-alpha.1025 Oct 2023 pre-releaseRelease notes
Open source →- Fixed a bug in the version_constraint. It wasn't being updated correctly when a new value was assigned to it.
-
1.0.0-alpha.925 Oct 2023 pre-releaseRelease notes
Open source →- lint cleanup
- Change insert to InsertBefore to avoid line maths being done all over the place. Now you just pass the nearest line and we insert relative to that. Added helper functions to make the indent consistent.
- renamed the base section to builders and removed the 'attached' component of the section names;
-
1.0.0-alpha.824 Oct 2023 pre-releaseRelease notes
Open source →- fixed a bug in Line.text where the text value wasn't being updated if the key or value of the line where changed.
- additional test cases.
- line_section now implements rather than extends line.
- Added toString method to key_value
- added platform specific line terminator when writting pubspec.
- changed the pubspec render process to use a writer interface so we can switch out the render target.
- Fixed bugs in executables when trying to append or update an executable.
- imporved the readme example.
- Fixed a bug in ExectuableAttached which prevented changing of the executable name. Fixed a bug in the scriptPath. When there was no script we returned .dart rather than name.dart.
-
1.0.0-alpha.724 Oct 2023 pre-releaseNothing published for this version
-
1.0.0-alpha.604 Oct 2023 pre-releaseRelease notes
Open source →- renamed Pubspec to PubSpec.
- Fixed a bug when setting the flutter and sdk environments.
- Added logic to track if versions where quoted so we can preserve the quoting.
- general cleanup nd bug fixes.
-
0.9.123 Mar 2024Release notes
Open source →- corrected the name of DependencyAltHostedBuilder as it should be DependencyBuilderAltHosted.
-
0.9.023 Mar 2024Release notes
Open source →- released with a few, low use, missing keys. a good release is better than perfection with no release.