New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to generate docs for a package which is a re-export of an SDK vendored package? #7597
Comments
We recently introduced dynamic fetching of analysis/dartdoc sdk based on the sdk constraint. If the sdk constraint of the package does not satisfy the one pub has fixed, it will attempt to download the latest matching sdk. I think this will work for package:macros:
|
Oh ok interesting. We weren't actually planning on bumping the min SDK I don't think, and often would be publishing pre-releases that are only available on the main channel SDK (due to the _macros constraint). We are trying to avoid being tightly coupled with SDK releases to make that process go as smoothly as possible. But, maybe we can make something work. |
If the package can be used with multiple sdk's I guess that docs generated with any of those sdks should be valid? |
For most releases, they will only actually be able to get a version solve on the absolute latest SDK, but this is through the After that point, the package is only resolvable until the next change to |
Ah gotcha. Not sure how we'll support that. |
Given how tightly linked it is to the SDK, I think it makes sense for the docs to be generated with the SDK docs? |
But where should they be served? api.dartlang.org? Perhaps that would make some sense, but require some special casing. |
There are two things that make this not possible right now: SDK selection is based only the actual package constraints, and does not consider any dependent packages. (This is something we could look into, but for the time being, we can assume this remains). The I think it should be helpful if the package would have at least a prerelease min SDK constraint, so that we don't attempt resolve it with a stable SDK. |
The problem is we don't know what constraint to put... we don't know what dev release it will be associated with until after the changes land. And need to publish right away for users on the main channel. |
Use whatever the latest dev SDK version is. It is very likely that it will trigger the |
The
macros
package will be a pub package, which only re-exports APIs from the_macros
package, which is an SDK vendored package.I can generate docs for the macros package today, but the API that it sees will be that of package:_macros from the current SDK. In the case of pub generated docs for packages, this will either just fail (if it tries to do a pub get, the version solve will fail unless the version is the exact one it requires), or it will generate wrong documentation (based on the SDK pub used to generate the docs, not the SDK that the package is tied to).
One idea, is to generate the docs for
package:macros
with the SDK docs, hosted at api.dart.dev, and just redirect the pub docs link to there?The text was updated successfully, but these errors were encountered: