-
Notifications
You must be signed in to change notification settings - Fork 3
docs: hide CLI, Scaffold, and Hyperboards pages #157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Kzoeps
wants to merge
4
commits into
main
Choose a base branch
from
docs/hide-cli-scaffold-hyperboards
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 3 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "hiddenPaths": [ | ||
| "/tools/hypercerts-cli", | ||
| "/tools/scaffold", | ||
| "/tools/hyperboards" | ||
| ] | ||
| } |
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
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| const assert = require('node:assert/strict'); | ||
| const { execFileSync } = require('node:child_process'); | ||
| const { existsSync, readFileSync, readdirSync } = require('node:fs'); | ||
| const { join, relative } = require('node:path'); | ||
| const test = require('node:test'); | ||
|
|
||
| const ROOT = join(__dirname, '..'); | ||
| const PAGES_DIR = join(ROOT, 'pages'); | ||
| const HIDDEN_PATHS = [ | ||
| '/tools/hypercerts-cli', | ||
| '/tools/scaffold', | ||
| '/tools/hyperboards', | ||
| ]; | ||
| const HIDDEN_PAGE_FILES = new Set(HIDDEN_PATHS.map((path) => `pages${path}.md`)); | ||
|
|
||
| function walkMarkdownFiles(directory) { | ||
| return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => { | ||
| const path = join(directory, entry.name); | ||
| return entry.isDirectory() ? walkMarkdownFiles(path) : path.endsWith('.md') ? [path] : []; | ||
| }); | ||
| } | ||
|
|
||
| test('keeps the hidden tool page source files', () => { | ||
| for (const file of HIDDEN_PAGE_FILES) { | ||
| assert.equal(existsSync(join(ROOT, file)), true, `${file} must remain available for direct routes`); | ||
| } | ||
| }); | ||
|
|
||
| test('excludes hidden tool pages from the generated search index', () => { | ||
| execFileSync(process.execPath, ['lib/generate-search-index.js'], { cwd: ROOT }); | ||
| const index = JSON.parse(readFileSync(join(ROOT, 'public/search-index.json'), 'utf8')); | ||
| const indexedHiddenPaths = index | ||
| .map((page) => page.path) | ||
| .filter((path) => HIDDEN_PATHS.includes(path)); | ||
|
|
||
| assert.deepEqual(indexedHiddenPaths, []); | ||
| }); | ||
|
|
||
| test('excludes hidden tool pages from the generated sitemap', () => { | ||
| execFileSync(process.execPath, ['lib/generate-sitemap.js'], { cwd: ROOT }); | ||
| const sitemap = readFileSync(join(ROOT, 'public/sitemap.xml'), 'utf8'); | ||
|
|
||
| for (const path of HIDDEN_PATHS) { | ||
| assert.doesNotMatch(sitemap, new RegExp(`<loc>[^<]+${path}</loc>`)); | ||
| } | ||
| }); | ||
|
|
||
| test('does not link to hidden tool pages from visible documentation or navigation', () => { | ||
| const authoredFiles = [ | ||
| join(ROOT, 'components/Layout.js'), | ||
| join(ROOT, 'components/SearchDialog.js'), | ||
| join(ROOT, 'lib/navigation.js'), | ||
| ...walkMarkdownFiles(PAGES_DIR).filter((file) => { | ||
| const repoPath = relative(ROOT, file).split('\\').join('/'); | ||
| return !HIDDEN_PAGE_FILES.has(repoPath); | ||
| }), | ||
| ]; | ||
|
|
||
| for (const file of authoredFiles) { | ||
| const content = readFileSync(file, 'utf8'); | ||
| for (const path of HIDDEN_PATHS) { | ||
| assert.equal( | ||
| content.includes(path), | ||
| false, | ||
| `${relative(ROOT, file)} still links to ${path}`, | ||
| ); | ||
| } | ||
| } | ||
| }); | ||
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Provide the external-docs-content prerequisite before running this test.
execFileSyncinvokes the search-index generator directly, but CI reports that it crashes with missingexternal-docs-content.json; the hidden-route assertion is never reached. Add test setup/fixtures for that prerequisite, or invoke the repository’s documented preparation step before generating the index.🧰 Tools
🪛 GitHub Actions: Docs CI / 0_Test and build documentation.txt
[error] 29-30: Test failed: 'excludes hidden tool pages from the generated search index' (ERR_TEST_FAILURE) due to missing external docs content file.
🪛 GitHub Actions: Docs CI / Test and build documentation
[error] 29-30: Test failed: 'excludes hidden tool pages from the generated search index' due to missing external-docs-content.json (generate-search-index crashed with ERR_TEST_FAILURE).
🤖 Prompt for AI Agents
Source: Pipeline failures