dart-neats
dart-neats copied to clipboard
consider updating the 'repository' pubspec fields with the repo+path_in_the_repo information
For this package, the pubspec contains:
homepage: https://github.com/google/dart-neats/tree/master/acyclic_steps
repository: https://github.com/google/dart-neats.git
Consider removing the homepage
field, and, updating the repository
to the repo url, plus the path within the repo (given that this is a mono-repo). So, https://github.com/google/dart-neats/tree/master/acyclic_steps
. (for this package, and the ~dozen other packages in this monorepo).
I'm not actually sure what is correct :D
I have been converting repos over to using the web style urls; so https://github.com/dart-lang/path
for a single package repo and https://github.com/google/dart-neats/tree/master/acyclic_steps
for a package within a mono-repo.
These are not however the urls you'd use to clone a repo (https://github.com/dart-lang/path.git
or [email protected]:dart-lang/path.git
).
To be fair, when I started converting packages over - from using the homepage
field to using the repository
field - I had been less aware of the .git
style urls and more aware of packages using the github web urls.
Using the web style urls does have some nice properties though: users can use them to browse the repo; we can encode both the package's repo as well as the path within the repo to the package (very useful for tooling); and, we can determine the default branch for the repo (at least for monorepos).
When you added the repository
field to the pubspec format (docs here: https://dart.dev/tools/pub/pubspec#repository), did you have expectations for what would go in that field? Expectations that it would be a specific format? Just a general indication of where the package is sourced from?
I think deep repository links are fine for now, but may not be needed soon.
The new repository verification code in pana
can detect the default branch name and the relative path inside the repository. If that code gets tested and run in a sandbox, we would just rely on that instead of the deep links provided by developer.
The new repository verification code in
pana
can detect the default branch name and the relative path inside the repository. If that code gets tested and run in a sandbox, we would just rely on that instead of the deep links provided by developer.
Ah, cool - you clone the repo and scan for pubspec files: https://github.com/dart-lang/pana/commit/8ce8894136a55a88f164fbd97a397a8ef82554f1.