Skip to content

googleapis 11.0.0 URL pattern for libraries changed, display names for libraries changed #3396

Closed
@jonasfj

Description

@jonasfj
cat doc/api/index.html | grep pubsub

outputs the following that's from the README:

<h4 id="cloud-pubsub-api---pubsubv1">Cloud Pub/Sub API - <code>pubsub.v1</code></h4>
<li><a href="https://cloud.google.com/pubsub/docs">Documentation</a></li>
<li><a href="https://pub.dev/documentation/googleapis/11.0.0/pubsub.v1/pubsub.v1-library.html">API details</a></li>
<h4 id="pubsub-lite-api---pubsublitev1">Pub/Sub Lite API - <code>pubsublite.v1</code></h4>
<li><a href="https://cloud.google.com/pubsub/lite/docs">Documentation</a></li>
<li><a href="https://pub.dev/documentation/googleapis/11.0.0/pubsublite.v1/pubsublite.v1-library.html">API details</a></li>

I think the links the README are following the old format. Thus, they are using pubsub.v1, but the generated sidebar below is using a new URL scheme.

And the following generated sidebar:

  <span class="name"><a href="pubsub_v1/pubsub_v1-library.html">v1</a></span> 
  <span class="name"><a href="pubsublite_v1/pubsublite_v1-library.html">v1</a></span> 
      <li><a href="pubsub_v1/pubsub_v1-library.html">v1</a></li>
      <li><a href="pubsublite_v1/pubsublite_v1-library.html">v1</a></li>

Also the display names for libraries here is not unique. Now, many of the libraries are just called v1 in the sidebar 🙈

It's possible that this is intended. I think it would make some sense to simplify things. In that case we just need to file a bug against package:googleapis to change library names.

Changing library names is probably a bit breaking for googleapis, but it could keep the old libraries around and just have them re-export the new libraries and do some sort of // nodoc comment to avoid the old library showing up in dartdoc. That way one can maintain compatibility and rename libraries.


Reproduce using

DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

if [ -z "$PUB_HOSTED_URL" ]; then
  PUB_HOSTED_URL='https://pub.dev'
fi

fetch_package_names() { 
  curl -Ls --compressed "$PUB_HOSTED_URL/api/package-names" | jq -r '.packages[]'
}

latest_version() {
  curl -Ls "$PUB_HOSTED_URL/api/packages/$1" | jq -r '.latest.version'
}

fetch_task_log() {
  curl --fail -Ls "$PUB_HOSTED_URL/experimental/task-log/$1/$2/"
}

P="$1"
V="$2"

if [ -z "$P" ]; then
  echo 'usage: ./reproduce-dartdoc-issue.sh <package> <version>'
  exit 1;
fi

if [ -z "$V" ]; then
  echo 'usage: ./reproduce-dartdoc-issue.sh <package> <version>'
  exit 1;
fi

cd $(mktemp -d)
echo $(mktemp -d)
curl -L "$PUB_HOSTED_URL/api/packages/$P/versions/$V/archive.tar.gz" | tar -xz
dart pub get
dart pub global activate dartdoc
dartdoc

ecbo 'Written to:'
echo $(mktemp -d)

Save file above as ./reproduce-dartdoc-issue.sh and run as ./reproduce-dartdoc-issue.sh googleapis 11.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestneeds-infoAdditional information needed from the issue author

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions