NIAEFEUP / uni

Mobile app designed to help students of the University of Porto to manage their academic life.
GNU General Public License v3.0
50 stars 18 forks source link

Add pubspec.lock to .gitignore in uni_ui #1367

Closed Process-ing closed 1 month ago

Process-ing commented 1 month ago

From the Dart documentation:

Don't check the lockfile of a package into source control, since libraries should support a range of dependency versions. The version constraints of a package's immediate dependencies should be as wide as possible while still ensuring that the dependencies will be compatible with the versions that were tested against.

vitormpp commented 1 month ago

That only applies for regular packages.

For regular packages, don't commit the pubspec.lock file. Regenerating the pubspec.lock file lets you test your package against the latest compatible versions of its dependencies. 1

In case of application packages (i.e., packages that contain a program or app, with a main entrypoint):

Application packages should check their lockfiles into source control, so that everyone working on the application and every location the application is deployed has a consistent set of dependencies. Because their dependencies are constrained by the lockfile, application packages usually specify any for their dependencies' version constraints. 2

For application packages, we recommend that you commit the pubspec.lock file. Versioning the pubspec.lock file ensures changes to transitive dependencies are explicit. Each time the dependencies change due to dart pub upgrade or a change in pubspec.yaml the difference will be apparent in the lock file. 1

[1] Private Files Dart.dev [2] Application package. Dart.dev