Skip to content

Commit f6ff2ef

Browse files
[Next Docs] Update Git Workflow (#50579)
Update our git workflow in preparation for open-sourcing the content of the docs ([linear task](https://linear.app/vercel/issue/DX-1579/set-up-github-workflow)). **Templates:** - [x] Update docs issue template to encourage contributions - [x] Update PR template to include link to new contribution guide **Code Owners / Reviewers:** - #50841 **Labels:** - [x] Add DevEx team to labeler.json so PRs get the "created by: DevEx team" **Other:** - [x] Remove docs manifest from CI checks as we no longer have one (keep the manifest for errors as they live under `/pages`) - [x] Add `unifiedjs.vscode-mdx` to the vscode extension list
1 parent 22ea7d9 commit f6ff2ef

File tree

6 files changed

+52
-73
lines changed

6 files changed

+52
-73
lines changed

.github/ISSUE_TEMPLATE/4.docs_request.yml

+6
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ title: 'Docs: '
44
labels:
55
- 'template: documentation'
66
body:
7+
- type: markdown
8+
attributes:
9+
value: Before opening this issue to request a docs improvement, is this something you can help us with? Your contributions are welcomed and appreciated. See our [Docs Contribution Guide](https://nextjs.org/docs/community/contribution-guide) to learn how to edit the Next.js docs.
10+
- type: markdown
11+
attributes:
12+
value: Thank you for helping us improve the docs!
713
- type: textarea
814
attributes:
915
label: What is the improvement or update you wish to see?

.github/labeler.json

+11-4
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,25 @@
2626
{ "type": "user", "pattern": "JanKaifer" },
2727
{ "type": "user", "pattern": "javivelasco" },
2828
{ "type": "user", "pattern": "kikobeats" },
29-
{ "type": "user", "pattern": "leerob" },
3029
{ "type": "user", "pattern": "schniz" },
3130
{ "type": "user", "pattern": "sebmarkbage" },
3231
{ "type": "user", "pattern": "shuding" },
3332
{ "type": "user", "pattern": "styfle" },
3433
{ "type": "user", "pattern": "timneutkens" },
3534
{ "type": "user", "pattern": "wyattjoh" }
3635
],
37-
"created-by: Next.js docs team": [
36+
"created-by: Next.js DevEx team": [
37+
{ "type": "user", "pattern": "leerob" },
3838
{ "type": "user", "pattern": "ismaelrumzan" },
39-
{ "type": "user", "pattern": "MaedahBatool" },
40-
{ "type": "user", "pattern": "molebox" }
39+
{ "type": "user", "pattern": "molebox" },
40+
{ "type": "user", "pattern": "delbaoliveira" },
41+
{ "type": "user", "pattern": "lydiahallie" },
42+
{ "type": "user", "pattern": "steven-tey" },
43+
{ "type": "user", "pattern": "nutlope" },
44+
{ "type": "user", "pattern": "stephdietz" },
45+
{ "type": "user", "pattern": "timeyoutakeit" },
46+
{ "type": "user", "pattern": "s3prototype" },
47+
{ "type": "user", "pattern": "manovotny" }
4148
],
4249
"created-by: web-tooling team": [
4350
{ "type": "user", "pattern": "alexkirsz" },

.github/pull_request_template.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@ Choose the right checklist for the change(s) that you're making:
44
55
## For Contributors
66
7-
### Improving Documentation or adding/fixing Examples
7+
### Improving Documentation
8+
9+
- Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide
10+
11+
### Adding or Updating Examples
812
913
- The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
1014
- Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md

.vscode/extensions.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
"ms-vsliveshare.vsliveshare",
2020

2121
// Debugging
22-
"ms-vscode.vscode-js-profile-flame"
22+
"ms-vscode.vscode-js-profile-flame",
23+
24+
// MDX Authoring
25+
"unifiedjs.vscode-mdx"
2326
]
2427
}
+2-39
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,3 @@
1-
# Updating Documentation Paths
1+
# Contributing to Documentation
22

3-
Our documentation currently leverages a [manifest file](/docs/manifest.json), which is how documentation entries are checked.
4-
5-
When adding a new entry under an existing category you only need to add an entry with `{title: '', path: '/docs/path/to/file.md'}`. The "title" is what is shown on the sidebar.
6-
7-
When moving the location/url of an entry, the "title" field can be removed from the existing entry and the ".md" extension removed from the "path", then a "redirect" field with the shape of `{permanent: true/false, destination: '/some-url'}` can be added. A new entry should be added with the "title" and "path" fields if the document is renamed within the [`docs` folder](/docs) that points to the new location in the folder, e.g. `/docs/some-url.md`
8-
9-
Example of moving documentation file:
10-
11-
Before:
12-
13-
```json
14-
[
15-
{
16-
"path": "/docs/original.md",
17-
"title": "Hello world"
18-
}
19-
]
20-
```
21-
22-
After:
23-
24-
```json
25-
[
26-
{
27-
"path": "/docs/original",
28-
"redirect": {
29-
"permanent": false,
30-
"destination": "/new"
31-
}
32-
},
33-
{
34-
"path": "/docs/new.md",
35-
"title": "Hello world"
36-
}
37-
]
38-
```
39-
40-
> **Note**: The manifest is checked automatically in the "lint" step in CI when opening a PR.
3+
See the [Docs Contribution Guide](https://nextjs.org/docs/community/contribution-guide) to learn how to contribute to the Next.js Documentation.

scripts/check-manifests.js

+24-28
Original file line numberDiff line numberDiff line change
@@ -19,41 +19,37 @@ function collectPaths(routes, paths = []) {
1919
}
2020

2121
async function main() {
22-
const manifests = ['errors/manifest.json', 'docs/manifest.json']
22+
const manifest = 'errors/manifest.json'
2323
let hadError = false
2424

25-
for (const manifest of manifests) {
26-
const dir = path.dirname(manifest)
27-
const files = await glob(path.join(dir, '**/*.md'))
25+
const dir = path.dirname(manifest)
26+
const files = await glob(path.join(dir, '**/*.md'))
2827

29-
const manifestData = JSON.parse(
30-
await fs.promises.readFile(manifest, 'utf8')
31-
)
28+
const manifestData = JSON.parse(await fs.promises.readFile(manifest, 'utf8'))
3229

33-
const paths = []
34-
collectPaths(manifestData.routes, paths)
30+
const paths = []
31+
collectPaths(manifestData.routes, paths)
3532

36-
const missingFiles = files.filter(
37-
(file) => !paths.includes(`/${file}`) && file !== 'errors/template.md'
38-
)
33+
const missingFiles = files.filter(
34+
(file) => !paths.includes(`/${file}`) && file !== 'errors/template.md'
35+
)
3936

40-
if (missingFiles.length) {
41-
hadError = true
42-
console.log(`Missing paths in ${manifest}:\n${missingFiles.join('\n')}`)
43-
} else {
44-
console.log(`No missing paths in ${manifest}`)
45-
}
37+
if (missingFiles.length) {
38+
hadError = true
39+
console.log(`Missing paths in ${manifest}:\n${missingFiles.join('\n')}`)
40+
} else {
41+
console.log(`No missing paths in ${manifest}`)
42+
}
4643

47-
for (const filePath of paths) {
48-
if (
49-
!(await fs.promises
50-
.access(path.join(process.cwd(), filePath), fs.constants.F_OK)
51-
.then(() => true)
52-
.catch(() => false))
53-
) {
54-
console.log('Could not find path:', filePath)
55-
hadError = true
56-
}
44+
for (const filePath of paths) {
45+
if (
46+
!(await fs.promises
47+
.access(path.join(process.cwd(), filePath), fs.constants.F_OK)
48+
.then(() => true)
49+
.catch(() => false))
50+
) {
51+
console.log('Could not find path:', filePath)
52+
hadError = true
5753
}
5854
}
5955

0 commit comments

Comments
 (0)