Skip to content

Commit

Permalink
Minor line length and semantic break changes
Browse files Browse the repository at this point in the history
  • Loading branch information
parlough committed Oct 3, 2024
1 parent 693013b commit 870227f
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/content/guides/packages.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,17 +183,18 @@ use [`dart pub outdated`][outdated].
In some situations, `dart pub get` does not retrieve
the exact package versions locked in the `pubspec.lock` file:

* If new dependencies are added to or removed from `pubspec.yaml` after the
`pubspec.lock` file was last updated.
* If new dependencies are added to or removed from `pubspec.yaml` after
the `pubspec.lock` file was last updated.
* If the locked version no longer exists in the package repository.
* If you changed to a different version of the Dart SDK,
and some packages are no longer compatible with that new version.

In these cases `dart pub get` will:

* Unlock enough of the locked dependency versions that a resolution becomes
possible.
* Notify you about any dependency changes relative to the existing `pubspec.lock`.
* Unlock enough of the locked dependency versions that
a resolution becomes possible.
* Notify you about any dependency changes relative to
the existing `pubspec.lock`.

For example, after adding `retry: ^3.0.0` to your dependencies:

Expand All @@ -204,9 +205,9 @@ Downloading packages...
+ retry 3.1.2
```

Also, if the [content hash](/tools/pub/glossary#content-hashes) of a
published package version differs from the hash in the `pubspec.lock` file,
`pub` will warn you and update the lockfile to reflect the published version:
Also, if the [content hash][] of a published package version
differs from the hash in the `pubspec.lock` file, pub will
warn you and update the lockfile to reflect the published version.

For example, if you manually change the hash of `retry` in `pubspec.lock`:

Expand All @@ -232,10 +233,11 @@ Changed 1 dependency!
When deploying your project to production,
use `dart pub get --enforce-lockfile` to retrieve dependencies.

If your project's dependency constraints can't be satisfied with the exact
versions and content hashes in `pubspec.lock`, package retrieval and the
command will fail. This helps avoid deploying untested dependencies and
dependency versions to production.
If your project's dependency constraints can't be
satisfied with the exact versions and content hashes in `pubspec.lock`,
package retrieval and the command will fail.
This helps avoid deploying untested
dependencies and dependency versions to production.

```console
$ dart pub get --enforce-lockfile
Expand All @@ -254,10 +256,11 @@ https://dart.dev/go/content-hashes
Would change 1 dependency.
Unable to satisfy `pubspec.yaml` using `pubspec.lock`.

To update `pubspec.lock` run `dart pub get` without
`--enforce-lockfile`.
To update `pubspec.lock` run `dart pub get` without `--enforce-lockfile`.
```

[content hash]: /tools/pub/glossary#content-hashes

## More information

The following pages have more information about packages and
Expand Down

0 comments on commit 870227f

Please sign in to comment.