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

[Next Docs] Update Git Workflow #50579

Merged
merged 24 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e414282
Link to contribution guide from contribution folder
delbaoliveira May 31, 2023
4927f87
Update label for devex team contributors
delbaoliveira May 31, 2023
3a0a557
Update issue template to encourage contributions
delbaoliveira May 31, 2023
31e5496
Add DevRel as codeowners for docs
delbaoliveira May 31, 2023
0d5931c
Link to contribution guide from PR template
delbaoliveira May 31, 2023
a39dd4c
Fixes
delbaoliveira May 31, 2023
7fbb4dd
Remove docs manifest from check script
delbaoliveira May 31, 2023
dc449f2
Test lint-fix
delbaoliveira May 31, 2023
fcf82a0
Merge branch 'canary' into next-docs-git-workflow
delbaoliveira May 31, 2023
5b3de23
Change team from devrel to devex to include docs members
delbaoliveira May 31, 2023
62bcbb3
Merge branch 'next-docs-git-workflow' of https://github.com/vercel/ne…
delbaoliveira May 31, 2023
dd00363
Change teams, as it does not recognize @vercel/devex
delbaoliveira May 31, 2023
f746ed1
Revert changes to codeowners (we'll test out Vercel spaces!)
delbaoliveira Jun 2, 2023
2541a3f
Merge branch 'canary' into next-docs-git-workflow
delbaoliveira Jun 2, 2023
e16e212
Update CODEOWNERS
delbaoliveira Jun 2, 2023
7d1fce0
Merge branch 'canary' into next-docs-git-workflow
delbaoliveira Jun 2, 2023
0121418
Merge branch 'canary' into next-docs-git-workflow
delbaoliveira Jun 6, 2023
1174eee
Merge branch 'canary' into next-docs-git-workflow
delbaoliveira Jun 6, 2023
63c274f
Add mdx extension to the list for better authoring
delbaoliveira Jun 6, 2023
83002a7
Update CODEOWNERS
delbaoliveira Jun 6, 2023
60ca3af
Merge branch 'next-docs-git-workflow' of https://github.com/vercel/ne…
delbaoliveira Jun 6, 2023
165e5a0
Update .github/ISSUE_TEMPLATE/4.docs_request.yml
delbaoliveira Jun 6, 2023
e66a780
Merge branch 'canary' into next-docs-git-workflow
delbaoliveira Jun 7, 2023
e488474
Merge branch 'canary' into next-docs-git-workflow
delbaoliveira Jun 8, 2023
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
6 changes: 6 additions & 0 deletions .github/ISSUE_TEMPLATE/4.docs_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ title: 'Docs: '
labels:
- 'template: documentation'
body:
- type: markdown
attributes:
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.
- type: markdown
attributes:
value: Thank you for helping us improve the docs!
- type: textarea
attributes:
label: What is the improvement or update you wish to see?
Expand Down
15 changes: 11 additions & 4 deletions .github/labeler.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,25 @@
{ "type": "user", "pattern": "JanKaifer" },
{ "type": "user", "pattern": "javivelasco" },
{ "type": "user", "pattern": "kikobeats" },
{ "type": "user", "pattern": "leerob" },
{ "type": "user", "pattern": "schniz" },
{ "type": "user", "pattern": "sebmarkbage" },
{ "type": "user", "pattern": "shuding" },
{ "type": "user", "pattern": "styfle" },
{ "type": "user", "pattern": "timneutkens" },
{ "type": "user", "pattern": "wyattjoh" }
],
"created-by: Next.js docs team": [
"created-by: Next.js DevEx team": [
{ "type": "user", "pattern": "leerob" },
{ "type": "user", "pattern": "ismaelrumzan" },
{ "type": "user", "pattern": "MaedahBatool" },
{ "type": "user", "pattern": "molebox" }
{ "type": "user", "pattern": "molebox" },
{ "type": "user", "pattern": "delbaoliveira" },
{ "type": "user", "pattern": "lydiahallie" },
{ "type": "user", "pattern": "steven-tey" },
{ "type": "user", "pattern": "nutlope" },
{ "type": "user", "pattern": "stephdietz" },
{ "type": "user", "pattern": "timeyoutakeit" },
{ "type": "user", "pattern": "s3prototype" },
{ "type": "user", "pattern": "manovotny" }
],
"created-by: web-tooling team": [
{ "type": "user", "pattern": "alexkirsz" },
Expand Down
6 changes: 5 additions & 1 deletion .github/pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation or adding/fixing Examples
### Improving Documentation

- Read the Docs Contribution Guide to ensure your contribution follows the docs guidelines: https://nextjs.org/docs/community/contribution-guide

### Adding or Updating Examples

- The "examples guidelines" are followed from our contributing doc https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md
- Make sure the linting passes by running `pnpm build && pnpm lint`. See https://github.com/vercel/next.js/blob/canary/contributing/repository/linting.md
Expand Down
5 changes: 4 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
"ms-vsliveshare.vsliveshare",

// Debugging
"ms-vscode.vscode-js-profile-flame"
"ms-vscode.vscode-js-profile-flame",

// MDX Authoring
"unifiedjs.vscode-mdx"
]
}
41 changes: 2 additions & 39 deletions contributing/docs/adding-documentation.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,3 @@
# Updating Documentation Paths
# Contributing to Documentation

Our documentation currently leverages a [manifest file](/docs/manifest.json), which is how documentation entries are checked.

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.

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`

Example of moving documentation file:

Before:

```json
[
{
"path": "/docs/original.md",
"title": "Hello world"
}
]
```

After:

```json
[
{
"path": "/docs/original",
"redirect": {
"permanent": false,
"destination": "/new"
}
},
{
"path": "/docs/new.md",
"title": "Hello world"
}
]
```

> **Note**: The manifest is checked automatically in the "lint" step in CI when opening a PR.
See the [Docs Contribution Guide](https://nextjs.org/docs/community/contribution-guide) to learn how to contribute to the Next.js Documentation.
52 changes: 24 additions & 28 deletions scripts/check-manifests.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,41 +19,37 @@ function collectPaths(routes, paths = []) {
}

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

for (const manifest of manifests) {
const dir = path.dirname(manifest)
const files = await glob(path.join(dir, '**/*.md'))
const dir = path.dirname(manifest)
const files = await glob(path.join(dir, '**/*.md'))

const manifestData = JSON.parse(
await fs.promises.readFile(manifest, 'utf8')
)
const manifestData = JSON.parse(await fs.promises.readFile(manifest, 'utf8'))

const paths = []
collectPaths(manifestData.routes, paths)
const paths = []
collectPaths(manifestData.routes, paths)

const missingFiles = files.filter(
(file) => !paths.includes(`/${file}`) && file !== 'errors/template.md'
)
const missingFiles = files.filter(
(file) => !paths.includes(`/${file}`) && file !== 'errors/template.md'
)

if (missingFiles.length) {
hadError = true
console.log(`Missing paths in ${manifest}:\n${missingFiles.join('\n')}`)
} else {
console.log(`No missing paths in ${manifest}`)
}
if (missingFiles.length) {
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
}
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
}
}

Expand Down