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

Add util for generating new tests/error documents #33001

Merged
merged 10 commits into from
Jan 6, 2022
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions contributing.md
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,8 @@ In general, all warnings and errors added should have these links attached.

Below are the steps to add a new link:

1. Create a new markdown file under the `errors` directory based on
`errors/template.md`:

```shell
cp errors/template.md errors/<error-file-name>.md
```

2. Add the newly added file to `errors/manifest.json`
3. Add the following url to your warning/error:
1. Run `yarn new-error` which will create the error document and update the manifest automatically.
2. Add the following url to your warning/error:
`https://nextjs.org/docs/messages/<file-path-without-dotmd>`.

For example, to link to `errors/api-routes-static-export.md` you use the url:
Expand Down
2 changes: 1 addition & 1 deletion errors/template.md → errors/template.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <!-- INSERT TITLE HERE -->
# {{title}}

#### Why This Error Occurred

Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
"packages/*"
],
"scripts": {
"new-error": "plop error",
"new-test": "plop test",
"clean": "yarn lerna clean -y && yarn lerna bootstrap && yarn lerna exec 'rm -rf ./dist'",
"build": "yarn prepublish",
"lerna": "lerna",
Expand Down Expand Up @@ -128,6 +130,7 @@
"nprogress": "0.2.0",
"pixrem": "5.0.0",
"playwright-chromium": "1.14.1",
"plop": "3.0.5",
styfle marked this conversation as resolved.
Show resolved Hide resolved
"postcss-nested": "4.2.1",
"postcss-pseudoelements": "5.0.0",
"postcss-short-size": "4.0.0",
Expand Down
Loading