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

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