Skip to content

Commit

Permalink
Add util for generating new tests/error documents (#33001)
Browse files Browse the repository at this point in the history
* Add util for generating new tests/error documents

* update compiled

* lint-fix

* apply suggestions

* update wording

* update compiled
  • Loading branch information
ijjk committed Jan 6, 2022
1 parent 48c0bc8 commit efabf81
Show file tree
Hide file tree
Showing 9 changed files with 7,496 additions and 6,785 deletions.
11 changes: 2 additions & 9 deletions contributing.md
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
@@ -1,4 +1,4 @@
# <!-- INSERT TITLE HERE -->
# {{title}}

#### Why This Error Occurred

Expand Down
3 changes: 3 additions & 0 deletions package.json
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",
"postcss-nested": "4.2.1",
"postcss-pseudoelements": "5.0.0",
"postcss-short-size": "4.0.0",
Expand Down

0 comments on commit efabf81

Please sign in to comment.