Skip to content
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

Fix incorrect error manifest path #27970

Merged
merged 1 commit into from Aug 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions errors/manifest.json
Expand Up @@ -415,10 +415,6 @@
"title": "import-esm-externals",
"path": "/errors/import-esm-externals.md"
},
{
"title": "max-custom-routes-reached",
"path": "max-custom-routes-reached.md"
},
{
"title": "static-page-generation-timeout",
"path": "/errors/static-page-generation-timeout.md"
Expand Down
20 changes: 16 additions & 4 deletions scripts/check-manifests.js
Expand Up @@ -20,7 +20,7 @@ function collectPaths(routes, paths = []) {

async function main() {
const manifests = ['errors/manifest.json', 'docs/manifest.json']
let hadMissing = false
let hadError = false

for (const manifest of manifests) {
const dir = path.dirname(manifest)
Expand All @@ -38,15 +38,27 @@ async function main() {
)

if (missingFiles.length) {
hadMissing = true
hadError = true
console.log(`Missing paths in ${manifest}:\n${missingFiles.join('\n')}`)
} else {
console.log(`No missing paths in ${manifest}`)
}

for (const filePath of paths) {
if (
!(await fs.promises
.access(path.join(process.cwd(), filePath), fs.constants.F_OK)
.then(() => true)
.catch(() => false))
) {
console.log('Could not find path:', filePath)
hadError = true
}
}
}

if (hadMissing) {
throw new Error('missing manifest items detected see above')
if (hadError) {
throw new Error('missing/incorrect manifest items detected see above')
}
}

Expand Down