🐛 Keep the platform's module map out of the customer's project overview

The generated overview listed every file, including wiki/modules/, which is the
platform's own map of the codebase and never shown to a customer. Naming it in a
customer page makes the page a table of contents for pages they cannot open, so
the module map is filtered from the material and from the finished page.
This commit is contained in:
wishforge 2026-11-09 10:19:07 -08:00
parent 13b7df84b0
commit 07c772022b

View File

@ -99,6 +99,7 @@ export class CodeWiki {
private clean(value: string) {
return redactSecrets(value)
.replace(LINE_NUMBER, '$1')
.replace(/wiki\/modules\/[A-Za-z0-9._/-]+/g, '内部页面')
.replace(/\n{3,}/g, '\n\n')
.trim()
.slice(0, 240 * 1024);
@ -123,7 +124,12 @@ export class CodeWiki {
this.read(code, ref, 'package.json'),
]);
const material = {
files: (tree.entries ?? []).slice(0, 200).map(entry => entry.path),
// The module map is the platform's internal view of the codebase; a customer page must not
// even name it, or the page becomes a table of contents for pages they cannot open.
files: (tree.entries ?? [])
.map(entry => entry.path)
.filter(path => !path.startsWith('wiki/modules/'))
.slice(0, 200),
readme: readme.slice(0, 8000),
manifest: manifest.slice(0, 4000),
};