Repository navigation
fix(cli): stop treating every directory under the docs root as a language - #365
Merged
Merged
Conversation
…uage
Every directory directly under the docs root became a language, apart from
`dist`, `node_modules`, `public` and `shared`. Each language gets a
`/<lang>/products` page whose heading comes from `TRANSLATIONS[lang]`, which
only has `en`, `zh` and `ru`. So when `tektoncd-operator` added a shell script
under `docs/scripts/`, every docs build of both its branches failed from then
on with
Page "/scripts/products" SSG rendering failed.
TypeError: Cannot read properties of undefined (reading 'all_product_documentation')
and no config could work around it: the languages cannot be named in the
config, and a `themeConfig.locales` list is appended to the detected one
rather than replacing it.
A directory is now a language only if its name is one of
`SUPPORTED_LANGUAGES`, the list `doom lint` and `doom translate` already use.
`-I` / `-E` still pick the candidates first. Any other directory stays in
`allLanguages`, so it ends up in `unusedLanguages` and its routes are excluded
the way `shared/` is, and a warning names it. That includes a directory of
pages in a language doom does not support, such as `docs/ja/`: its pages are
not built, and the warning is the only sign of it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 54e418c The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #365 +/- ##
==========================================
+ Coverage 65.39% 65.94% +0.54%
==========================================
Files 99 100 +1
Lines 3893 3900 +7
Branches 1153 1151 -2
==========================================
+ Hits 2546 2572 +26
+ Misses 1070 1056 -14
+ Partials 277 272 -5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
github-actions Bot
pushed a commit
that referenced
this pull request
Oct 28, 2026
…uage (#365) Every directory directly under the docs root became a language, apart from `dist`, `node_modules`, `public` and `shared`. Each language gets a `/<lang>/products` page whose heading comes from `TRANSLATIONS[lang]`, which only has `en`, `zh` and `ru`. So when `tektoncd-operator` added a shell script under `docs/scripts/`, every docs build of both its branches failed from then on with Page "/scripts/products" SSG rendering failed. TypeError: Cannot read properties of undefined (reading 'all_product_documentation') and no config could work around it: the languages cannot be named in the config, and a `themeConfig.locales` list is appended to the detected one rather than replacing it. A directory is now a language only if its name is one of `SUPPORTED_LANGUAGES`, the list `doom lint` and `doom translate` already use. `-I` / `-E` still pick the candidates first. Any other directory stays in `allLanguages`, so it ends up in `unusedLanguages` and its routes are excluded the way `shared/` is, and a warning names it. That includes a directory of pages in a language doom does not support, such as `docs/ja/`: its pages are not built, and the warning is the only sign of it. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.
A documentation site that added a shell script under
docs/scripts/failed every build from then on, with an error that says nothing about the directory.What happens
AlaudaDevops/tektoncd-operatoraddeddocs/scripts/test-doc-branding.shto both itsmainandrelease-4.6branches. From that commit on, every docs build of both branches failed — 65 runs over two days, none green — while rendering the site:Moving the script out of
docs/— to the repository root, or intodocs/shared/— made the build pass with nothing else changed.Why
getCommonConfiglists the docs root and makes every directory a language, apart fromdist,node_modules,publicandshared. The global plugin gives each language a/<lang>/loginand a/<lang>/productspage, and the products page takes its heading fromTRANSLATIONS[lang], which only hasen,zhandru. Soscriptsbecame a language, its products page looked upTRANSLATIONS.scripts, and rendering threw.A site cannot work around this in its config. Only
-I/-Eon the command line choose languages, and athemeConfig.localeslist indoom.config.ymlis appended to the detected list bymergeRsbuildConfigrather than replacing it:enthen appears twice and the build stops atroutePath /login has already been added.The rest of doom already treats
SUPPORTED_LANGUAGESas the list of languages —doom lintonly lints those directories,doom translateonly accepts those languages, and the i18n guide describesen/zhsubfolders. Locale detection was the one place that took any directory.The fix
After
-I/-Ehave picked the candidates, a directory whose name is not one ofSUPPORTED_LANGUAGESis not a language. It stays inallLanguages, so it lands inunusedLanguagesand its routes are excluded exactly like an unselected language's. None of its files becomes a page, which matters because rspress treats.js,.tsand.tsxfiles as pages too. A warning names the directory:Deliberate behaviours, all covered by tests:
-I/-Eare applied first, unchanged. A directory they leave out was already excluded and still is, silently. The warning only fires for a directory that would otherwise have become a language in this build.docs/ja/, is skipped the same way, and the build goes on. Its pages are not on the site, and the warning is the only sign of it.langto an empty value (the Chinese-only mode) never run locale detection and are not affected.Verification
New
test/cli/load-config.spec.ts, 7 tests, lays out docs roots in a temp directory and runsloadConfigon them:scripts,imagesandjadirectories are not languages and their routes are excluded; the global plugin no longer adds/scripts/products;-Ibehaves as before and stays silent;sharedandpublicare untouched; every supported language keeps its display name; andTRANSLATIONScovers exactlySUPPORTED_LANGUAGES.The new tests were run against the unmodified source first. The
scripts,imagesandjatests fail there on the language list (["en", "scripts", "zh"]and so on), so they test the bug rather than a fixture.yarn build,yarn test(665 passed),yarn typecov(100%),yarn lintandyarn docs:buildpass locally.End to end on the site that failed: a copy of
tektoncd-operatorrelease-4.6at11ddf575, with dependencies installed andpackage.jsonscripts rewritten the way its docs pipeline does it, built with the pipeline's own scripts. "This PR" ispackages/doom/libbuilt from this branch, which differs from the published 2.8.2 package only inlib/cli/load-config.js.build-exports(-E ru)build-exports(-E ru)/productsand/zh/productsonly; one warning, fordocs/scriptsbuild-exports-russian(-I ru -I en)-Ileavesscriptsout before it is judgedbuild-exportswith an addeddocs/ja/index.mddocs/jaanddocs/scripts; nothing from either directory indist🤖 Generated with Claude Code