From ee1fe561f2b94983099b05d75e12fa7576280df0 Mon Sep 17 00:00:00 2001 From: Tony Sansone Date: Tue, 20 Feb 2024 12:15:06 -0600 Subject: [PATCH] Fixed phrasing per @parlough --- src/content/tools/pub/dependencies.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/content/tools/pub/dependencies.md b/src/content/tools/pub/dependencies.md index c9611f1de1..2742e27da2 100644 --- a/src/content/tools/pub/dependencies.md +++ b/src/content/tools/pub/dependencies.md @@ -443,6 +443,29 @@ To identify dependencies in your app or package that aren't on the latest stable versions, use [`dart pub outdated`][]. +### Tighten version constraints for dev dependencies + +A dev dependency defines a package that you need only when developing. +A finished app won't need these packages. +Examples of these packages include tests or code generation tooling. +Set the version constraints of packages in [`dev_dependencies`][dev-dep] +to have a lower bound of the latest version on which your package depends. + +Tightening the version constraints of your dev dependencies might +resemble the following: + +```yaml +dev_dependencies: + build_runner: ^2.4.8 + lints: ^2.1.1 + test: ^1.25.1 +``` + +This YAML sets the `dependencies` to the major version and the +`dev_dependencies` to a specific patch version. + +[dev-dep]: /tools/pub/dependencies#dev-dependencies + ### Test whenever you update package dependencies If you run [`dart pub upgrade`][] without updating your pubspec,