From 1345528004288300af6562530120b33e942e058b Mon Sep 17 00:00:00 2001 From: juancarmore Date: Fri, 17 Jul 2026 11:57:32 +0200 Subject: [PATCH] components-angular: update generate-docs.sh to use MINOR_VERSION for documentation links --- openvidu-components-angular/generate-docs.sh | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/openvidu-components-angular/generate-docs.sh b/openvidu-components-angular/generate-docs.sh index 0c295d4d5..997aafb3b 100755 --- a/openvidu-components-angular/generate-docs.sh +++ b/openvidu-components-angular/generate-docs.sh @@ -1,12 +1,21 @@ #!/bin/bash if [[ -z "$BASEHREF_VERSION" ]]; then - echo "Example of use: \"BASEHREF_VERSION=2.12.0 ${0}\"" 1>&2 + echo "Example of use: \"BASEHREF_VERSION=3.8.0 ${0}\"" 1>&2 exit 1 fi -# Replace version from "stable" to the specified one in all TypeDoc links -grep -rl '/latest/' projects src | xargs sed -i -e 's|/latest/|/'${BASEHREF_VERSION}'/|g' +# openvidu.io documentation is versioned by MINOR release (folders like "3.8"), so links to +# it must be pinned to the minor version (X.Y). The full X.Y.Z is left untouched: it is the +# library version, read from package.json by Compodoc and shown in the generated docs. +MINOR_VERSION=$(echo "$BASEHREF_VERSION" | grep -oE '^[0-9]+\.[0-9]+') +if [[ -z "$MINOR_VERSION" ]]; then + echo "BASEHREF_VERSION must start with X.Y (e.g. \"BASEHREF_VERSION=3.8.0 ${0}\")" 1>&2 + exit 1 +fi + +# Replace version from "latest" to the specified minor one in all TypeDoc links +grep -rl '/latest/' projects src | xargs sed -i -e 's|/latest/|/'${MINOR_VERSION}'/|g' # Replace testapp README by openvidu-components-angular README mv README.md README-testapp.md @@ -15,8 +24,8 @@ cp ./projects/openvidu-components-angular/README.md . # Generate Compodoc npm run doc:build -# Return links to "stable" version -grep -rl '/'${BASEHREF_VERSION}'/' projects src | xargs sed -i -e 's|/'${BASEHREF_VERSION}'/|/latest/|g' +# Return links to "latest" version +grep -rl '/'${MINOR_VERSION}'/' projects src | xargs sed -i -e 's|/'${MINOR_VERSION}'/|/latest/|g' # Undo changes with READMEs rm README.md @@ -24,4 +33,3 @@ mv README-testapp.md README.md # Clean previous docs from openvidu.io repo and copy new ones npm run doc:clean-copy -