|
530 | 530 |
|
531 | 531 | [dependency]: #dependency
|
532 | 532 | [`pubspec.yaml`]: /tools/pub/pubspec
|
533 |
| - [transitive dependency]: #transitive-dependency |
| 533 | + [transitive dependencies]: #transitive-dependency |
534 | 534 | related_links:
|
535 | 535 | - text: "Package dependencies"
|
536 | 536 | link: "/tools/pub/dependencies"
|
|
879 | 879 |
|
880 | 880 | Packages can have [dependencies][] on other packages
|
881 | 881 | *and* can be dependencies themselves.
|
882 |
| - A package's `/lib` directory contains the |
883 |
| - [public libraries][] that other packages can import and use. |
| 882 | + A package's `/lib` directory contains the [public libraries][] that |
| 883 | + other packages can import and use. |
884 | 884 | They can also include scripts to be run directly.
|
885 |
| - A package that is not intended to be depended on by other packages is an |
886 |
| - [application package][]. |
| 885 | + A package that is not intended to be depended on by |
| 886 | + other packages is an [application package][]. |
887 | 887 | Shared packages are [published][] to pub.dev,
|
888 | 888 | but you can also have non-published packages.
|
889 | 889 |
|
890 |
| - Don't check the [lockfile][] of a package into source |
891 |
| - control, since libraries should support a range of dependency versions. The |
892 |
| - [version constraints][] of a package's |
893 |
| - [immediate dependencies][] should be as wide as possible while still |
894 |
| - ensuring that the dependencies will be compatible with the versions that were |
895 |
| - tested against. |
896 |
| -
|
897 |
| - Since [semantic versioning][] requires |
898 |
| - that libraries increment their major version numbers for any backwards |
899 |
| - incompatible changes, packages will usually require their dependencies' |
900 |
| - versions to be greater than or equal to the versions that were tested and less |
901 |
| - than the next major version. So if your library depended on the (fictional) |
902 |
| - `transmogrify` package and you tested it at version 1.2.1, your version |
903 |
| - constraint would be `^1.2.1`. |
| 890 | + Don't check the [lockfile][] of a package into source control, |
| 891 | + since libraries should support a range of dependency versions. |
| 892 | + The [version constraints][] of a package's [immediate dependencies][] should |
| 893 | + be as wide as possible while still ensuring that the dependencies will be |
| 894 | + compatible with the versions that were tested against. |
| 895 | +
|
| 896 | + Since [semantic versioning][] requires that |
| 897 | + libraries increment their major version numbers for |
| 898 | + any backwards incompatible changes, packages will usually |
| 899 | + require their dependencies' versions to be greater than or equal to |
| 900 | + the versions that were tested and less than the next major version. |
| 901 | + So if your library depended on the (fictional) `transmogrify` package and |
| 902 | + you tested it at version `1.2.1`, your version constraint would be `^1.2.1`. |
904 | 903 |
|
905 | 904 | [libraries]: #library
|
906 | 905 | [`pubspec.yaml`]: /tools/pub/pubspec
|
|
910 | 909 | [published]: /tools/pub/publishing
|
911 | 910 | [lockfile]: #lockfile
|
912 | 911 | [version constraints]: #version-constraint
|
| 912 | + [immediate dependencies]: #immediate-dependency |
913 | 913 | [semantic versioning]: https://semver.org/spec/v2.0.0-rc.1.html
|
914 | 914 | related_links:
|
915 | 915 | - text: "How to use packages"
|
|
0 commit comments