Release 0.8.13#178
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Checklist: