Skip to content

Conversation

@duaneatat
Copy link
Contributor

Part of #101

Checklist

  • Modify tools/scripts/utils/stdlib_version.js to return STDLIB_DOCS_DIRNAME env var if set
  • Add STDLIB_BRANCH variable to Makefile (defaults to develop)
  • Add logic to compute STDLIB_DOCS_DIRNAME from STDLIB_BRANCH:
    • developlatest
    • Other branches: sanitize by replacing / with - (e.g., feature/docsfeature-docs)
  • Create clone-stdlib-version target that:
    • Removes existing node_modules/@stdlib/stdlib
    • Clones specified branch/tag into node_modules/@stdlib/stdlib
    • Defaults to develop branch when STDLIB_BRANCH is not specified
    • Runs make install-node-modules in stdlib directory
  • Modify api-docs target to:
    • Depend on clone-stdlib-version
    • Pass STDLIB_DOCS_DIRNAME to build scripts
  • Test make api-docs uses develop branch (outputs to latest/)
  • Test make api-docs STDLIB_BRANCH=v0.2.0 (outputs to v0.2.0/)
  • Test with branch containing / (e.g., feature/docsfeature-docs/)
  • Verify STDLIB_DOCS_DIRNAME is set correctly for all build scripts
  • Verify multiple stdlib docs versions load (with an uncommitted change to config/index.js

Description

This pull request implements the first step in #101

  1. Make build system version-aware

Make build scripts respect STDLIB_VERSION environment variable and output to version-specific directories (e.g., public/docs/api/v0.2.0/). When building, always clone stdlib into node_modules/@stdlib/stdlib - defaulting to develop branch for latest, or the specified version/tag otherwise.

So now you can build the docs for v0.3.2 with make build STDLIB_BRANCH=v0.3.2 and the generated docs will end up at public/docs/api/v0.3.2.

@stdlib-js/reviewers

@kgryte kgryte changed the title feature: Update builds to use STDLIB_BRANCH environment variable when set feat: Update builds to use STDLIB_BRANCH environment variable when set Dec 12, 2025
@kgryte kgryte changed the title feat: Update builds to use STDLIB_BRANCH environment variable when set feat: update builds to use STDLIB_BRANCH environment variable when set Dec 12, 2025
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
# @example
# make clone-stdlib-version STDLIB_BRANCH=v0.2.0
#/
clone-stdlib-version:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is a bit odd to place this target here, but I also don't immediately have a better idea, so fine to leave as is for now.

Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this PR is looking fine. Left a few minor comments.

@kgryte kgryte changed the title feat: update builds to use STDLIB_BRANCH environment variable when set build: update build sequence to use STDLIB_BRANCH environment variable Dec 12, 2025
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
Copy link
Member

@kgryte kgryte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kgryte kgryte merged commit 7268142 into master Dec 12, 2025
@kgryte kgryte deleted the db/multiple-versions-build branch December 12, 2025 20:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants