Skip to content

Make VuePress base, dest and sitemap hostname configurable#1663

Merged
qunabu merged 2 commits intodevelopfrom
docs/configurable-base-and-dest
Apr 28, 2026
Merged

Make VuePress base, dest and sitemap hostname configurable#1663
qunabu merged 2 commits intodevelopfrom
docs/configurable-base-and-dest

Conversation

@qunabu
Copy link
Copy Markdown

@qunabu qunabu commented Apr 28, 2026

Summary

  • Move hardcoded base: '/' and the implicit dist output path out of docs/.vuepress/config.js so the docs site can be deployed under a sub-path (e.g. /docs/) without editing the config file.
  • Add docs/.vuepress/build.config.js as a single place to set production values (base: '/docs/', dest: 'docs/.vuepress/dist/docs', sitemap hostname).
  • Resolution order for each setting: env var (DOCS_BASE / DOCS_DEST / DOCS_HOSTNAME) → build.config.js → existing built-in default. base is normalized to start and end with /.
  • No sitemap plugin change needed — vuepress-plugin-sitemap already prepends base to every URL and writes sitemap.xml into the configured dest.

Test plan

  • npm run docs:build completes successfully.
  • Output is written to docs/.vuepress/dist/docs/ (not docs/.vuepress/dist/).
  • docs/.vuepress/dist/docs/index.html references assets under /docs/....
  • docs/.vuepress/dist/docs/sitemap.xml exists and every <loc> is https://hyperformula.handsontable.com/docs/....
  • Overriding via env still works: DOCS_BASE=/ DOCS_DEST=docs/.vuepress/dist npm run docs:build reproduces the old layout.
  • npm run docs:dev still serves locally.

Note

Medium Risk
Medium risk because it changes docs build/deploy configuration (base path, output directory, sitemap hostname) and upgrades the expected Node version to 18, which could affect CI/hosting builds if environments aren’t aligned.

Overview
Makes the VuePress docs build configurable by introducing docs/.vuepress/build.config.js and allowing DOCS_BASE, DOCS_DEST, and DOCS_HOSTNAME to override base, build output dest, and sitemap hostname (with base normalized to include leading/trailing /).

Updates deployment defaults to publish docs under /docs/ and output to docs/.vuepress/dist/docs, and adds netlify.toml plus a .nvmrc bump to Node 18 to align the build environment.

Reviewed by Cursor Bugbot for commit 67f6148. Bugbot is set up for automated code reviews on this repo. Configure here.

Move hardcoded `base: '/'` and the implicit dist directory out of the
VuePress config so the docs site can be deployed under a sub-path
(e.g. `/docs/`) without editing the config file.

- `docs/.vuepress/config.js` now reads `base`, `dest` and the sitemap
  `hostname` from (in precedence order) env vars `DOCS_BASE`,
  `DOCS_DEST`, `DOCS_HOSTNAME`, then `docs/.vuepress/build.config.js`,
  then existing built-in defaults.
- New `docs/.vuepress/build.config.js` sets the production values
  (`base: '/docs/'`, `dest: 'docs/.vuepress/dist/docs'`).
- `base` is normalized to start and end with `/`.
- The sitemap plugin already prepends `base` to every URL and writes
  `sitemap.xml` to the configured `dest`, so no plugin change is needed.
* DOCS_HOSTNAME — absolute origin used for the sitemap
*/
module.exports = {
base: '/docs/',
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

New default base breaks hardcoded favicon head paths

Medium Severity

Setting the default base to '/docs/' causes the existing head entries for favicons and the web manifest to break. VuePress 1.x does not auto-prepend base to href attributes in head config entries. The five favicon/manifest links still reference /favicon/... instead of /docs/favicon/..., so they will 404 when deployed under the new default sub-path.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 1c77a8b. Configure here.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 28, 2026

Performance comparison of head (67f6148) vs base (1852159)

                                     testName |   base |   head | change
------------------------------------------------------------------------
                                      Sheet A | 508.08 | 516.58 | +1.67%
                                      Sheet B | 165.97 | 167.47 | +0.90%
                                      Sheet T | 146.54 | 145.82 | -0.49%
                                Column ranges | 483.57 | 479.57 | -0.83%
Sheet A:  change value, add/remove row/column |  16.33 |  16.05 | -1.71%
 Sheet B: change value, add/remove row/column | 140.84 | 141.97 | +0.80%
                   Column ranges - add column | 154.85 | 160.93 | +3.93%
                Column ranges - without batch | 479.46 | 484.24 | +1.00%
                        Column ranges - batch | 123.48 | 122.74 | -0.60%

@qunabu qunabu self-assigned this Apr 28, 2026
@qunabu qunabu requested a review from sequba April 28, 2026 12:36
The Netlify build was failing with "node: --openssl-legacy-provider
is not allowed in NODE_OPTIONS" because Netlify dropped Node 16
support and newer Node versions reject that flag from the env-var
allowlist. The publish directory also needed updating to match the
new `dest: docs/.vuepress/dist/docs` from this PR.

- netlify.toml: declarative build command, publish directory, and
  NODE_VERSION, replacing the stale UI-side settings.
- .nvmrc: v16 -> v18 (Node 16 is EOL and unsupported by Netlify).
  Node 18 still accepts `--openssl-legacy-provider`, which the
  current vuepress/webpack toolchain needs.
@qunabu qunabu merged commit 110a28a into develop Apr 28, 2026
30 checks passed
@qunabu qunabu deleted the docs/configurable-base-and-dest branch April 28, 2026 12:42
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 67f6148. Configure here.

Comment thread docs/.vuepress/config.js
['link', { rel: 'mask-icon', color: '#ffffff', href: '/favicon/safari-pinned-tab.svg' }],
],
base: '/',
base: DOCS_BASE,
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Non-root base breaks hardcoded head asset paths

High Severity

Changing base from '/' to DOCS_BASE (defaulting to '/docs/') breaks the head config entries which use hardcoded absolute paths like /favicon/apple-touch-icon.png. VuePress 1.x does not auto-prepend base to head tag attributes, so these will 404 in production since the actual assets are served under /docs/favicon/....

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 67f6148. Configure here.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 28, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.18%. Comparing base (1852159) to head (67f6148).
⚠️ Report is 1 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1663      +/-   ##
===========================================
+ Coverage    96.77%   97.18%   +0.41%     
===========================================
  Files          174      174              
  Lines        15086    15086              
  Branches      3223     3223              
===========================================
+ Hits         14599    14662      +63     
+ Misses         487      424      -63     

see 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

qunabu added a commit that referenced this pull request Apr 28, 2026
## Summary
Follow-up to #1663. The Netlify deploy succeeded but
`https://hyperformula-docs.netlify.app/docs/` returns 404.

Root cause: with `base: '/docs/'`, VuePress emits assets and internal
links under `/docs/...` and writes the build to
`docs/.vuepress/dist/docs/`. Setting `publish =
"docs/.vuepress/dist/docs"` made Netlify serve those files at `/`, so
the page rendered but every internal `/docs/...` reference 404'd. The
publish dir must be the **parent** of the base path so the on-disk
`docs/` subdirectory becomes the URL `/docs/`.

Change: `publish = "docs/.vuepress/dist"` in `netlify.toml`.

## Test plan
- [ ] Netlify deploys successfully.
- [ ] `https://hyperformula-docs.netlify.app/docs/` renders the docs
home (no 404).
- [ ] Sub-pages like `/docs/guide/demo.html` load with assets and CSS
intact.
- [ ] `/sitemap.xml` is reachable and entries point at
`https://hyperformula.handsontable.com/docs/...`.

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> Low risk configuration-only change that affects where Netlify serves
built docs from; primary risk is misconfiguration leading to broken/404
docs paths.
> 
> **Overview**
> Fixes the Netlify deployment config by changing the `publish`
directory from `docs/.vuepress/dist/docs` to `docs/.vuepress/dist`,
ensuring the built `docs/` subdirectory is served at `/docs/` and
internal asset/link paths resolve correctly.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
be5594b. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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.

1 participant