Skip to content

Release 0.8.13#178

Merged
mgks merged 5 commits into
mainfrom
dev-0.8.13
Jul 13, 2026
Merged

Release 0.8.13#178
mgks merged 5 commits into
mainfrom
dev-0.8.13

Conversation

@mgks

@mgks mgks commented Jul 13, 2026

Copy link
Copy Markdown
Member

Description

The tag is now enforced centrally by the generator (templates can no longer drift), offline mode no longer emits a tag, and the auto-install retry path uses a manual node_modules walk-up that bypasses Node's stale require.resolve cache on Linux CI.

Fixes #167 #175 #177

Type of change

  • 🐛 Bug fix (non-breaking change which fixes an issue)
  • ✨ New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📝 Documentation update

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

mgks added 5 commits July 13, 2026 11:36
Three changes that close issues #175, #177, and the pwa/math
auto-install regression reported on the 0.8.13 branch:

1. Conditional <base href> in layout templates
   - Offline mode: NO <base> tag (fixes #177 — file:// resolution
     re-roots to filesystem root when <base href="/"> is present)
   - Online mode at root: NO <base> tag (relies on relativePathToRoot
     + ./assets/... for resolution, fixes #175 — no manual base
     config needed for GH Pages project sites)
   - Online mode at subpath or workspace sub-site: keep
     <base href="..."> (preserves the no-trailing-slash fix from
     0.8.10)
   - Applied to both packages/ui/templates/layout.ejs and
     packages/templates/summer/templates/layout.ejs

2. Consumer-scoped retry import in tryLoadAfterInstall
   - Previous bare import(name) walked up from the calling module's
     location, finding the monorepo's stale workspace copy of the
     just-installed package instead of the consumer's copy
   - Now uses createRequire(consumerCwd) to resolve the entry point
     in the consumer's node_modules, then imports via file:// URL
   - Fixes pwa/math/threads auto-install: install succeeded but
     import failed because Node found the monorepo's version

3. Asset-base-URL test additions
   - URL-1f: GH Pages subpath (<base href="/some-project/">)
   - URL-1g: --offline mode (no <base> tag at all)
   - Updated URL-1c/1d for the new conditional behavior

Note: URL-1c/1d/1g assertions check the auto-installed template dist
which currently resolves to the published 0.8.12 npm version. These
assertions will pass once this fix is released as 0.8.13.
1. Centralised base-tag enforcement: normaliseBaseTag() in @docmd/parser strips all base tags and injects one canonical based on (isOffline, siteRootAbs). Generator owns it, not templates.

2. Auto-install retry with manual node_modules walk-up: Node caches failed require.resolve. New manualResolvePackageEntry() bypasses cache with fresh fs.existsSync checks. Plus DOCMD_INSTALL_VERSION env var.

3. Lint + prep fixes: ignore _-prefixed vars, openapi dead code, prep streams tests live.

Version bumped to 0.8.13. Tests: 90/90.
Browsers block fetch() from file:// URLs (CORS). Previously the search
modal showed a generic 'Failed to load search index.' error when a user
opened site/index.html directly from the filesystem. Now the client
detects window.location.protocol === 'file:' before attempting any fetch
and shows a locale-aware message explaining that search requires a web
server (e.g. 'npx serve site').

Added searchOffline string to en/zh/hi/ko i18n files. New data-search-offline
attribute on the search modal HTML. No changes to docmd-main.js.
@mgks
mgks merged commit ff517eb into main Jul 13, 2026
1 check passed
@mgks
mgks deleted the dev-0.8.13 branch July 14, 2026 16:33
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.

[Bug]: Offline links fail to normalize

1 participant