Shield external portal jumps (keep EXTERNAL_* for later), serve /nav from static build, and proxy /book + /community to vertical Next apps with Caddy notes. Co-authored-by: Cursor <cursoragent@cursor.com>
25 lines
777 B
JavaScript
25 lines
777 B
JavaScript
import fs from 'node:fs'
|
|
|
|
const s = fs.readFileSync(
|
|
new URL('../dist/pages/reader/index.js', import.meta.url),
|
|
'utf8'
|
|
)
|
|
|
|
const checks = {
|
|
pageScrollTo: s.includes('pageScrollTo'),
|
|
chapAnchor: s.includes('chap'),
|
|
readerRoot: s.includes('reader-root'),
|
|
// old broken approach: ScrollView with scrollIntoView on main content
|
|
noScrollIntoViewOnContent:
|
|
!s.includes('scrollIntoView:fe') && !/scrollY:!0,className:"content"[^}]*scrollIntoView/.test(s),
|
|
usesPageContent: s.includes('id:"reader-root"') || s.includes('reader-root'),
|
|
}
|
|
|
|
const failed = Object.entries(checks).filter(([, ok]) => !ok)
|
|
console.log(checks)
|
|
if (failed.length) {
|
|
console.error('dist verify FAILED:', failed.map(([k]) => k).join(', '))
|
|
process.exit(1)
|
|
}
|
|
console.log('dist verify: OK')
|