Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
e61ea6f2
Unverified
Commit
e61ea6f2
authored
Aug 11, 2021
by
JJ Kasper
Committed by
GitHub
Aug 11, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add manifest check step and add missing items (#27934)
parent
94fc6f08
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
64 additions
and
0 deletions
+64
-0
build_test_deploy.yml
.github/workflows/build_test_deploy.yml
+1
-0
manifest.json
errors/manifest.json
+8
-0
check-manifests.js
scripts/check-manifests.js
+55
-0
No files found.
.github/workflows/build_test_deploy.yml
View file @
e61ea6f2
...
@@ -41,6 +41,7 @@ jobs:
...
@@ -41,6 +41,7 @@ jobs:
with
:
with
:
path
:
./*
path
:
./*
key
:
${{ github.sha }}
key
:
${{ github.sha }}
-
run
:
./scripts/check-manifests.js
-
run
:
yarn lint
-
run
:
yarn lint
checkPrecompiled
:
checkPrecompiled
:
...
...
errors/manifest.json
View file @
e61ea6f2
...
@@ -430,6 +430,14 @@
...
@@ -430,6 +430,14 @@
{
{
"title"
:
"sharp-missing-in-production"
,
"title"
:
"sharp-missing-in-production"
,
"path"
:
"/errors/sharp-missing-in-production.md"
"path"
:
"/errors/sharp-missing-in-production.md"
},
{
"title"
:
"max-custom-routes-reached"
,
"path"
:
"/errors/max-custom-routes-reached.md"
},
{
"title"
:
"module-not-found"
,
"path"
:
"/errors/module-not-found.md"
}
}
]
]
}
}
...
...
scripts/check-manifests.js
0 → 100755
View file @
e61ea6f2
#!/usr/bin/env node
const
fs
=
require
(
'fs'
)
const
path
=
require
(
'path'
)
const
globOrig
=
require
(
'glob'
)
const
{
promisify
}
=
require
(
'util'
)
const
glob
=
promisify
(
globOrig
)
function
collectPaths
(
routes
,
paths
=
[])
{
for
(
const
route
of
routes
)
{
if
(
route
.
path
)
{
paths
.
push
(
route
.
path
)
}
if
(
route
.
routes
)
{
collectPaths
(
route
.
routes
,
paths
)
}
}
}
async
function
main
()
{
const
manifests
=
[
'errors/manifest.json'
,
'docs/manifest.json'
]
let
hadMissing
=
false
for
(
const
manifest
of
manifests
)
{
const
dir
=
path
.
dirname
(
manifest
)
const
files
=
await
glob
(
path
.
join
(
dir
,
'**/*.md'
))
const
manifestData
=
JSON
.
parse
(
await
fs
.
promises
.
readFile
(
manifest
,
'utf8'
)
)
const
paths
=
[]
collectPaths
(
manifestData
.
routes
,
paths
)
const
missingFiles
=
files
.
filter
(
(
file
)
=>
!
paths
.
includes
(
`/
${
file
}
`
)
&&
file
!==
'errors/template.md'
)
if
(
missingFiles
.
length
)
{
hadMissing
=
true
console
.
log
(
`Missing paths in
${
manifest
}
:\n
${
missingFiles
.
join
(
'
\
n'
)}
`
)
}
else
{
console
.
log
(
`No missing paths in
${
manifest
}
`
)
}
}
if
(
hadMissing
)
{
throw
new
Error
(
'missing manifest items detected see above'
)
}
}
main
()
.
then
(()
=>
console
.
log
(
'success'
))
.
catch
(
console
.
error
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment