Skip to content

Commit

Permalink
Fixed phrasing per @parlough
Browse files Browse the repository at this point in the history
  • Loading branch information
atsansone committed Feb 20, 2024
1 parent 913267e commit ee1fe56
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/content/tools/pub/dependencies.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ee1fe56

Please sign in to comment.