Skip to content

docs: detailed English and Chinese docs, and the hook bugs they turned up - #41

Merged
linghengqian merged 3 commits into
mainfrom
docs-and-fixes
Oct 20, 2026
Merged

linghengqian merged 3 commits into
mainfrom
docs-and-fixes

Conversation

@linghengqian

Copy link
Copy Markdown
Member

The docs were thin, so this rewrites them after vfox-java's, in English and in Chinese. Writing them meant running every command against vfox 1.0.12 and 1.0.13 in Ubuntu 26.04 and Alpine 3.24.1 containers, which turned up a few bugs in the hooks. Those are fixed here too.

Three commits, so they can be read apart:

  1. fix: the hook bugs, with tests (hooks/, lib/, tests/hooks_test.lua).
  2. docs: the English README and docs/: 7 new pages, the others extended.
  3. docs: the Chinese version (README_CN.md, docs/zh-CN/) and the links between the two languages.

Bugs fixed

0.5.2 Now
Alpine without libatomic (official musl builds of 26.8.0 and later) the install succeeds, node then fails with Error loading shared library libatomic.so.1 PostInstall runs node --version once; the install stops and the message gives apk add libatomic
32-bit ARM Linux asks for linux-arm, which Node.js never published, so every install fails takes linux-armv7l (4.0.0 to 23.11.1)
.nvmrc under latest_installed / latest_available text match against vfox's text-sorted list: 22 selects 22.9.0 over 22.23.3, 22.2 matches 22.23.3, 22.x selects nothing, a file holding ( raises unfinished capture matched by number, the newest wins; 22.x and 22.* mean 22
failed SHASUMS256.txt request get checksum failed get checksum failed: HTTP 404 from <url>, or the network error
VFOX_NODEJS_MIRROR ending in // one slash is stripped all of them

The musl check is the one to look at twice. It runs node once in PostInstall, on musl only, and only an error that the dynamic loader reports (Error loading shared library ..., Error relocating ...) stops the install. Where io.popen is missing, or node fails any other way, the install goes on as before.

Reviewing

  • What exists only here, and not in 0.5.2, is marked "Unreleased" ("未发布") in the pages and listed in docs/changes.md. After the release, grep -rn -i -e unreleased -e 未发布 docs README* finds the remarks to take out (docs/development.md, "Releasing").
  • The data in the pages (platform table, musl coverage, mirror list, LTS table) is dated 2026-10-21; docs/development.md has the commands that refresh it.
  • The Chinese pages follow the English ones by hand. Each pair was compared with a throwaway script (headings, code blocks, inline code, links, tables, numbers); the script is not in this PR.
  • docs/e2e.md said the Windows suite keeps a Docker Compose runner; test(e2e): share one tools stage across the Windows images and drop the MSIs #40 replaced it with run.ps1, so that sentence is corrected.
  • Still open, listed under "Known gaps" in docs/development.md: no ARMv6 package and no 32-bit ARM package from 24 on, no libatomic check on glibc, latest_available downloads index.json at every prompt, and the LTS codename table is hand-made (Node 26 enters LTS on 2026-10-28, its codename is not announced).

Tested

  • Hook tests: 52 cases, 28 before. StyLua and LuaLS (Warning) are clean.
  • E2E on Ubuntu and Alpine, local, VFOX_VERSION=latest MIRROR=default: passes. The rest of the matrix, Windows and WSL are left to CI.
  • Alpine 3.24.1 with and without libstdc++ and libatomic: 22.23.3, 24.22.0 and 25.9.0 install without libatomic; 26.12.0 stops with the apk add libatomic message and installs once the package is there.
  • 32-bit ARM could not run here (no arm/v7 emulation): vfox plugin run --os linux --arch arm picks node-v20.19.5-linux-armv7l.tar.gz, which exists on nodejs.org.
  • Docs: every relative link and anchor in the 28 pages resolves, Chinese headings included, and the 44 external links answer 200.

Writing the new docs against vfox 1.0.12 and 1.0.13 turned up these bugs
in the hooks.

- musl: after the unpack, PostInstall runs `node --version` once and reads
  the dynamic loader's complaint. The musl builds of 26.8.0 and later need
  libatomic, which a stock Alpine does not have, so the install used to
  succeed and the first `node` failed with `Error loading shared library
  libatomic.so.1`. Now the install stops, nothing is registered, and the
  message names the package and the command that installs it (`apk add
  libatomic` on Alpine, `opkg install ...` on OpenWrt). The libstdc++
  message names its command too and no longer says the library "is
  normally installed automatically". Where no command can be run, or node
  fails for another reason, the install is left alone.
- 32-bit ARM Linux: vfox reports `arm` and Node.js names the package
  `linux-armv7l`. The plugin asked for `linux-arm`, which never existed, so
  every install on 32-bit ARM ended in "package ... is not listed".
- .nvmrc and .node-version under latest_installed and latest_available:
  releases are matched by their numbers, part by part, and the newest one
  wins. The text used to be a Lua pattern against vfox's text-sorted list,
  so `22` picked 22.9.0 over 22.23.3, `22.2` matched 22.23.3, `22.x`
  matched nothing and a file holding `(` raised `unfinished capture`.
  `22.x`, `22.x.x` and `22.*` now mean 22, text that is no release number
  (node, lts/-1, `(`) is returned as it is, and only a leading `v` is
  dropped, so an `lts/<codename>` with a `v` inside works. `^lts-` is
  escaped: it matched anything starting with `lt` and turned `lts/-1`
  into `lts//1`.
- PreInstall: `get checksum failed` says why, `HTTP 404 from <url>` or the
  network error, instead of hiding it.
- VFOX_NODEJS_MIRROR may end in several slashes, not only one.

The hook tests grow from 28 to 52 cases. The musl check is also covered
by running it against Alpine 3.24.1 with and without libstdc++ and
libatomic.
Rewrite the README and add a page per topic under docs/: versions and
names, platforms, .nvmrc and .node-version, npm and global packages,
troubleshooting, development and changes. The pages for the mirror, musl,
LTS, building from source and E2E gain the details they lacked.

The commands, messages and tables were taken from vfox 1.0.12 and 1.0.13
on Ubuntu 26.04 and Alpine 3.24.1. Pages that quote data give the day it
was taken (2026-10-21), and docs/development.md has the commands that
refresh it. What exists only on main, and not in 0.5.2, is marked
"Unreleased" with the 0.5.2 behaviour next to it and listed in
docs/changes.md. docs/development.md also lists the gaps that are still
open.

docs/e2e.md said the Windows suite keeps a Docker Compose runner; #40
replaced it with tests/e2e/windows/run.ps1.
README_CN.md and docs/zh-CN/ translate the README and every page of docs/
under the same names. Each page, in both languages, starts with a link to
the other one, and docs/development.md says how the two are kept in step.

Code blocks and quoted messages stay in English, only their comments are
translated. A link to another page points at its Chinese heading, and a
link to the vfox guides at the zh-hans site. The terms follow vfox-java's
Chinese docs.
@linghengqian linghengqian added bug Something isn't working documentation Improvements or additions to documentation labels Oct 20, 2026
@linghengqian
linghengqian merged commit e4a0b33 into main Oct 20, 2026
13 checks passed
@linghengqian
linghengqian deleted the docs-and-fixes branch October 20, 2026 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant