Skip to content

Release v0.8.12 - Auto-Install Hardening and GitHub Pages Fix#176

Merged
mgks merged 4 commits into
mainfrom
hotfix-0.8.12-gh-pages-base
Jul 12, 2026
Merged

Release v0.8.12 - Auto-Install Hardening and GitHub Pages Fix#176
mgks merged 4 commits into
mainfrom
hotfix-0.8.12-gh-pages-base

Conversation

@mgks

@mgks mgks commented Jul 12, 2026

Copy link
Copy Markdown
Member

v0.8.12 Release

What's included

  1. fix([Bug]: All assets are 404 when deployed to github pages #175): auto-derive base from URL pathname — GitHub Pages project sites no longer 404 on all assets. docmd derives the deployment subpath from url automatically. No manual base config needed.

  2. feat: hardened auto-install pipeline (CWE-78) — replaces execSync(pnpm add ${pkg}) shell-string with spawn(pm, args, { shell: false }) + strict regex validator + registry re-check. Shared runtime-deps.ts module consumed by both hooks.ts and engine.ts.

  3. feat: engine auto-installloadEngine('rust') and loadEngine('js') now auto-install missing engine packages before falling back.

  4. fix: removed @docmd/plugin-pwa from core deps — was never in CORE_PLUGINS but every npm install @docmd/core pulled it in. Now installs on demand only.

  5. Version bump to 0.8.12 across all packages.

Test results

  • 594/594 runner tests pass
  • 143/143 feature integration tests pass
  • 51 new runtime-deps test assertions
  • End-to-end isolated tarball test: summer template + pwa auto-install verified
  • [Bug]: All assets are 404 when deployed to github pages #175 reproduction: <base href="/some-project/"> confirmed correct
  • Root deployment regression: <base href="/"> confirmed unchanged

Not included (stays on dev-0.9.0)

  • Monorepo isolation gate (isMonorepoContext)
  • Consumer simulation tool (tools/simulate-consumer.mjs)

Breaking changes

None. Existing configs, plugins, and CI pipelines work unchanged.

mgks added 4 commits July 12, 2026 15:20
When base is not explicitly set and url has a non-root pathname
(e.g. https://user.github.io/repo), derive base from the URL so the
<base href> tag points at the subpath. Fixes the 404 regression for
GitHub Pages project sites introduced in 0.8.10.

- Slash-agnostic: 'repo', '/repo', '/repo/' all normalise to '/repo/'
- Auto-derivation is the default; explicit base wins when set
- Root deployments (subdomain) stay at '/' — no false-positive
- One-line info message when base is auto-derived
- Users no longer need to think about 'base' as a config option

Verified: 22/22 asset-base-url tests pass. End-to-end test with the
exact #175 config produces <base href="/some-project/">.
Three changes that make the auto-install path more robust and secure:

1. Shared runtime-deps module (packages/api/src/runtime-deps.ts):
   - Replaces execSync(`pnpm add ${pkg}`) shell-string with
     spawn(pm, args, { shell: false }) — CWE-78 fix
   - Strict regex validator: only @docmd/(plugin|template|engine)-*
     names pass, with registry lookup as defence-in-depth
   - Slash-agnostic: handles Windows .cmd shims via conditional shell
   - Idempotent TUI status reporter for dev-server rebuilds

2. Engine auto-install (packages/api/src/engine.ts):
   - loadEngine('rust') now auto-installs @docmd/engine-rust if missing
   - Falls back to JS if install fails or binary isn't usable
   - loadEngine('js') auto-installs @docmd/engine-js as last resort

3. Corrected core dependency manifest (packages/core/package.json):
   - Removed @docmd/plugin-pwa from direct deps (was never in
     CORE_PLUGINS, every npm install pulled it unnecessarily)

Both hooks.ts and engine.ts consume the same shared module — one
install behaviour, applied everywhere. 51 new test assertions in
tests/cli-contracts/runtime-deps.test.js covering the validator,
registry, install refusal paths, and static source checks.

Verified: 594/594 runner tests pass, 143/143 feature tests pass,
#175 end-to-end test still produces correct <base href>.
@mgks
mgks merged commit 82f85b6 into main Jul 12, 2026
1 check passed
@mgks
mgks deleted the hotfix-0.8.12-gh-pages-base branch July 12, 2026 13:14
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