Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
5ba5a02
Add pubspec mod CLI (pm)
robbecker-wf Mar 20, 2026
c3ff1a2
Add --[no-]tighten
robbecker-wf Mar 20, 2026
80ea650
Merge pull request #1 from robbecker-wf/add_pm
robrbecker Mar 20, 2026
733f905
Bump actions/checkout from 4 to 6
dependabot[bot] Mar 20, 2026
cb6bb38
Merge pull request #2 from robrbecker/dependabot/github_actions/actio…
robrbecker Mar 20, 2026
457dfdf
Add tighten command
robbecker-wf Mar 20, 2026
cc72843
format and tighten
robbecker-wf Mar 20, 2026
cc1efba
updated tests and test naming
robbecker-wf Mar 20, 2026
e7d6184
format
robbecker-wf Mar 20, 2026
4f73ac6
update test for CI
robbecker-wf Mar 20, 2026
33bd9db
Merge pull request #5 from robbecker-wf/tighten_command
robrbecker Mar 20, 2026
3305801
Add changelog and publish action
robbecker-wf Mar 20, 2026
7752937
added pub_semver dependency
robbecker-wf Mar 20, 2026
24a89cd
Bump actions/checkout from 5 to 6
dependabot[bot] Mar 27, 2026
55a77ca
Added remove command and version arg
robbecker-wf Apr 13, 2026
1a5a531
Build binaries
robbecker-wf May 1, 2026
37c65ce
Bump version to 1.2.1
robbecker-wf May 1, 2026
87adfea
format
robbecker-wf May 1, 2026
359f9b2
Merge pull request #6 from robrbecker/dependabot/github_actions/actio…
robbecker-wf May 1, 2026
6aab75d
fix mac binary build
robbecker-wf May 1, 2026
717598a
Merge branch 'main' of github.com:robrbecker/replace
robbecker-wf May 1, 2026
ea28ffe
commit more skipping
robbecker-wf May 1, 2026
99af7b6
onyl build for linux
robbecker-wf May 1, 2026
719e79a
update version to 1.2.2
robbecker-wf May 1, 2026
024c181
Add pm asdf/pub-get workflow improvements
robbecker-wf May 26, 2026
11ad8c0
Enhance pm workflows for asdf, pub get, and recursive tighten behavior
robbecker-wf May 26, 2026
3619e9f
format
robbecker-wf May 26, 2026
b1d825f
format and update description
robbecker-wf May 26, 2026
30f6cb6
format again
robbecker-wf May 26, 2026
52730d4
ignore generated version file
robbecker-wf May 26, 2026
0125bcd
update CI
robbecker-wf May 26, 2026
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
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: "pub"
directory: "/"
schedule:
interval: "weekly"

- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
32 changes: 32 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: CI

on:
push:
branches:
- main
pull_request:
branches:
- main

jobs:
verify:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Set up Dart SDK
uses: dart-lang/setup-dart@v1

- name: Install dependencies
run: dart pub get

- name: Analyze
run: dart analyze .

- name: Check formatting
run: dart format -o none --set-exit-if-changed .

- name: Run tests
run: dart test
50 changes: 50 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Publish

on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+'
workflow_dispatch:

permissions:
contents: write
id-token: write
pull-requests: write

jobs:
build-and-release:
name: Build binaries and create release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5

- uses: dart-lang/setup-dart@v1

- run: dart pub get

- run: dart run build_runner build --delete-conflicting-outputs

- name: Compile for Linux
run: |
dart compile exe bin/replace.dart -o replace --target-os=linux
dart compile exe bin/pm.dart -o pm --target-os=linux

- if: github.event_name != 'workflow_dispatch'
uses: softprops/action-gh-release@v2
with:
files: |
replace
pm

publish:
name: Publish to pub.dev
if: github.event_name != 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6

- uses: dart-lang/setup-dart@v1

- run: |
dart pub get
dart pub publish --force
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
## [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`.
- Added global `pm --version` / `pm -v` output using generated package metadata.
- Added pubspec code generation with `pubspec_generator` and `build_runner`.

### Updated
- Updated CI to run `dart run build_runner build --delete-conflicting-outputs` and fail when generated files are out of date.
- Updated `pm` tests and fixtures for multi-package remove behavior across single-line, hosted, and git dependency declarations.
- Updated README documentation for `pm remove` and version flag usage.

## [1.1.0] - 2026-03-20
### Added
- Added the new `pm` CLI for editing pubspec dependency and SDK constraints.
- Added the `tighten` command to raise dependency minimums to lockfile-resolved versions.
- Added the `--[no-]tighten` option (enabled by default) for range-tightening behavior.

### Updated
- Updated tests and naming around the new `pm` functionality.
- Updated CI usage and formatting-related maintenance.

## [1.0.4] - 2022-05-11
- bug fix

Expand All @@ -20,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
39 changes: 39 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This makefile leverages automatic documentation. Running `make` will generate a list
# of the most commonly used targets. `make help` will generate a more complete list.
#
# When adding a target, prefix the doc string with two pound signs to add it to the common
# list or two pounds and VERBOSE to demote it to the `make help` list. Prefix it with two pounds
# and INTERNAL to exclude from all help, or just don't add a doc string.
#
# Based on https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html

.DEFAULT_GOAL := help
SHELL=/bin/bash -o pipefail

# Supports:
# make install /usr/local/bin
# make install
INSTALLPATH ?= $(if $(word 2,$(MAKECMDGOALS)),$(word 2,$(MAKECMDGOALS)),$(HOME)/bin)

ifneq (,$(filter install,$(MAKECMDGOALS)))
ifneq ($(word 2,$(MAKECMDGOALS)),)
.PHONY: $(word 2,$(MAKECMDGOALS))
$(word 2,$(MAKECMDGOALS)):
@:
endif
endif

.PHONY: help
help: ##META Display all make targets
@printf "\33[32m"
@echo "All documented make targets. Use 'make' to see only the most commonly used targets."
@printf "\033[0m\n"

@grep -E '^%?[a-zA-Z0-9/_-]+:.*?##(VERBOSE)? .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?##(VERBOSE)? "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'

# Compile both executables in bin
.PHONY: install
install: ## Build and install executables (default: ~/bin)
@mkdir -p "$(INSTALLPATH)"
dart compile exe bin/replace.dart -o "$(INSTALLPATH)/replace"
dart compile exe bin/pm.dart -o "$(INSTALLPATH)/pm"
Loading