Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 0 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@ jobs:
- name: Install dependencies
run: dart pub get

- name: Build generated files
run: dart run build_runner build --delete-conflicting-outputs

- name: Verify generated files are up to date
run: |
if [[ -n "$(git status --porcelain)" ]]; then
echo "Generated files are not up to date."
echo "Run: dart run build_runner build --delete-conflicting-outputs"
git --no-pager diff
# exit 1
fi

- name: Analyze
run: dart analyze .

Expand Down
15 changes: 14 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## [1.2.3] - 2026-05-26
### Added
- Added `pm set-asdf-dart` to read `environment.sdk` from `pubspec.yaml` and run `asdf set dart` for Dart 2 (`2.19.6`) or Dart 3.
- Added `--dart-3-version` to `pm set-asdf-dart` so the Dart 3 version can be overridden (default: `3.11.6`).
- Added global `--pub-get` to run `dart pub get` in directories where a command modified `pubspec.yaml`.

### Updated
- Updated `pm` tests to cover `set-asdf-dart` behavior for Dart 2, Dart 3, and custom `--dart-3-version` values.
- Updated README command docs and examples for `set-asdf-dart` and `--dart-3-version`.
- Updated `pm` tests and docs for `--pub-get` behavior on changed and unchanged pubspecs.
- Updated `set-asdf-dart` to support recursive mode (`-r`) across discovered `pubspec.yaml` files.
- Updated `tighten -r` to use each pubspec directory's `pubspec.lock` by default.

## [1.2.0] - 2026-04-13
### Added
- Added `pm remove` to remove one or more packages from `dependencies` and `dev_dependencies`.
Expand Down Expand Up @@ -41,4 +54,4 @@
### Added
- Initial Version

[1.0.0]: https://github.com/robrbecker/replace/releases/tag/1.0.0
[1.0.0]: https://github.com/robrbecker/replace/releases/tag/1.0.0
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ Global options:
- `-r, --recursive` Recurse through subdirectories and process all pubspec.yaml files
- `--fail-on-parse-error` Exit with non-zero if any pubspec.yaml cannot be parsed
- `--[no-]tighten` Tighten is enabled by default. Use `--no-tighten` to keep explicit range output.
- `--pub-get` Run `dart pub get` in each directory where `pubspec.yaml` was modified by the command

Commands:

Expand All @@ -99,6 +100,7 @@ Commands:
- `raise-max` Raise the maximum bound (exclusive) of a version range
- `lower-max` Lower the maximum bound (exclusive) of a version range
- `set-sdk` Set `environment.sdk` constraint exactly as provided
- `set-asdf-dart` Read `environment.sdk` and run `asdf set dart <dart3 version>` (Dart 3, default `3.11.6`, overridable with `--dart-3-version`) or `asdf set dart 2.19.6` (Dart 2)
- `raise-min-sdk` Raise the minimum `environment.sdk` bound (inclusive)
- `raise-max-sdk` Raise the maximum `environment.sdk` bound (exclusive)
- `tighten` Raise all dependency minimums to resolved versions from `pubspec.lock` (or a provided lockfile path)
Expand All @@ -110,10 +112,12 @@ Notes:
- SDK commands update `environment.sdk` only
- `set` accepts any valid Dart version constraint, for example `^1.9.0` or `'>=1.9.0 <2.0.0'`
- `set-sdk` accepts any valid Dart SDK constraint, for example `'>=3.3.0 <4.0.0'`
- `set-asdf-dart` uses `environment.sdk` from the current `pubspec.yaml` (or all discovered pubspec files with `-r`) and accepts optional `--dart-3-version` (default `3.11.6`)
- `raise-min`, `raise-max`, and `lower-max` expect a specific semantic version, for example `1.9.1`
- `raise-min-sdk` and `raise-max-sdk` expect a specific semantic version, for example `3.4.0`
- Tightening is enabled by default and only rewrites when the updated range is exactly equivalent to a caret constraint
- `tighten` reads `pubspec.lock` in the current directory by default and applies the equivalent of `raise-min <dep> <locked-version> --tighten` for each locked package
- `--pub-get` only runs in directories where a command actually changed `pubspec.yaml`
- `tighten` reads `pubspec.lock` in the current directory by default (or each pubspec directory when used with `-r`) and applies the equivalent of `raise-min <dep> <locked-version> --tighten` for each locked package
- `'>=3.0.0 <4.0.0'` becomes `^3.0.0`
- `'>=0.18.2 <0.19.0'` becomes `^0.18.2`
- `'>=1.2.3 <4.0.0'` stays as a range (not equivalent to a caret constraint)
Expand Down Expand Up @@ -216,6 +220,12 @@ Lower max version and fail if any pubspec is malformed:
pm lower-max path 2.5.0 -r --fail-on-parse-error
```

Raise minimum and run `dart pub get` for each modified pubspec directory:

```sh
pm raise-min path 1.9.1 -r --pub-get
```

Remove multiple dependencies in a single command:

```sh
Expand Down Expand Up @@ -250,6 +260,18 @@ Set SDK constraint:
pm set-sdk '>=3.3.0 <4.0.0'
```

Set local asdf Dart version from SDK constraint:

```sh
pm set-asdf-dart
```

Set local asdf Dart version with an overridden Dart 3 target:

```sh
pm set-asdf-dart --dart-3-version 3.12.1
```

Raise SDK minimum recursively across a monorepo:

```sh
Expand Down
2 changes: 1 addition & 1 deletion analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
analyzer:
exclude:
- test/fixtures/**
- test/fixtures/**
Loading