patchwork 0.1.1
patchwork: ^0.1.1 copied to clipboard
Patch management for Dart projects, starting with reviewable dependency patches for pub packages.
example/README.md
Patchwork Example: Local Greeter Patch #
This example shows the pub MVP workflow with a small Dart app and a local pub
dependency named greeter.
The app starts by printing the dependency output:
cd examples/hello_patch/app
dart pub get
dart run bin/app.dart
Start a Patchwork edit session for the resolved pub package:
dart run patchwork patch greeter
Patchwork prints an edit directory similar to:
.dart_tool/patchwork/edit/pub/greeter@0.1.0
Edit lib/greeter.dart inside that directory. For example:
String greeting(String name) {
return 'Hello from a patch, $name!';
}
Commit the edit into a patch file:
dart run patchwork patch --commit greeter
Apply committed patches and refresh pub resolution:
dart run patchwork apply
dart pub get
dart run bin/app.dart
dart run patchwork status
After the patch is applied, the app prints:
Hello from a patch, Patchwork!
The generated Patchwork state lives under .dart_tool/patchwork/ and
pubspec_overrides.yaml. The committed state for a real project is
patchwork.lock plus patches/pub/*.patch.
This example uses a path dependency so it can run without a hosted package.
Patchwork still targets the package by pub package name (greeter); the
unsupported path: target syntax is not used.
Projects usually add Patchwork as a dev dependency and run it with
dart run patchwork. Global activation is optional.