injectable
injectable copied to clipboard
Local dev experience tweaks
With this PR I propose some minor repo chores that will make the maintenance of the package slightly easier:
- Drop
pubspec.lockfiles from packages. According to the official recommendation,pubspec.lockfiles should not be commited unless it is an application. I noticed in the commit history that some contributors struggled with conflicts in these files. - Replace the
// used for testingcomment with the@visibleForTestingannotation. That will make the analyzer complain if someone accidentally misusesDependencyConfigfactories. - Use
dependency_overridesfor forcing packages to use dependencies viapath. According to the documentation
Only the dependency overrides in a package's own pubspec are considered during package resolution. Dependency overrides inside any depended-on packages are ignored. As a result, if you publish a package to pub.dev, keep in mind that your package's dependency overrides are ignored by all users of your package.
Hence such a change removes the need of updating dependencies in pubspec.yaml files for local development, keeping the behavior the same for the actual users. More robust approach would be to use melos, but for two packages in the repo that might be an overkill.