docs: keep site English-only#2
Merged
Merged
Conversation
Co-authored-by: Nova <nova@opencoven.ai>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Enforces an English-only configuration for the Coven docs site by removing locale-coupled search wiring and adding a build-time guard script to prevent reintroducing i18n structure/search settings.
Changes:
- Added
scripts/check-english-only.mjsto detect non-English locale directories and locale-aware search/language plumbing. - Updated
buildto run the English-only guard beforenext build. - Removed Fumadocs locale context usage from the docs search dialog.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| scripts/check-english-only.mjs | New build-time guard script intended to prevent locale directories and locale-aware search configuration. |
| package.json | Runs the English-only guard as part of production builds and adds a dedicated script entry. |
| components/search-dialog.tsx | Removes dependency on Fumadocs useI18n() and stops passing locale into useDocsSearch. |
Comment on lines
+5
to
+43
| const forbiddenLocaleDirs = new Set([ | ||
| 'ar', | ||
| 'de', | ||
| 'es', | ||
| 'fr', | ||
| 'it', | ||
| 'ja', | ||
| 'ko', | ||
| 'pt', | ||
| 'ru', | ||
| 'zh', | ||
| 'zh-CN', | ||
| 'zh-TW', | ||
| ]); | ||
| const ignoredDirs = new Set(['.git', '.next', '.source', 'node_modules']); | ||
|
|
||
| function walk(dir) { | ||
| const entries = fs.readdirSync(dir, { withFileTypes: true }); | ||
| const matches = []; | ||
|
|
||
| for (const entry of entries) { | ||
| if (!entry.isDirectory()) continue; | ||
| if (ignoredDirs.has(entry.name)) continue; | ||
|
|
||
| const entryPath = path.join(dir, entry.name); | ||
| const relative = path.relative(root, entryPath).replace(/\\/g, '/'); | ||
|
|
||
| if (forbiddenLocaleDirs.has(entry.name)) { | ||
| matches.push(relative); | ||
| continue; | ||
| } | ||
|
|
||
| matches.push(...walk(entryPath)); | ||
| } | ||
|
|
||
| return matches; | ||
| } | ||
|
|
||
| const localeDirectories = walk(root); |
| } | ||
|
|
||
| const searchDialog = fs.readFileSync(path.join(root, 'components/search-dialog.tsx'), 'utf8'); | ||
| if (searchDialog.includes('useI18n') || searchDialog.includes('locale,')) { |
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.
Summary
Verification
Co-authored-by: Nova nova@opencoven.ai