Skip to content

Commit

Permalink
Merge branch 'canary' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
kodiakhq[bot] authored Sep 21, 2020
2 parents 344113e + 231016f commit 728ec93
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ description: A custom asset prefix allows you serve static assets from a CDN. Le

# CDN Support with Asset Prefix

> **Attention**: [Deploying to Vercel](docs/deployment.md) automatically configures a global CDN for your Next.js project.
> **Attention**: [Deploying to Vercel](/docs/deployment.md) automatically configures a global CDN for your Next.js project.
> You do not need to manually setup an Asset Prefix.
> **Note**: Next.js 9.5+ added support for a customizable [Base Path](docs/api-reference/next.config.js/basepath.md), which is better
> **Note**: Next.js 9.5+ added support for a customizable [Base Path](/docs/api-reference/next.config.js/basepath.md), which is better
> suited for hosting your application on a sub-path like `/docs`.
> We do not suggest you use a custom Asset Prefix for this use case.
Expand Down
2 changes: 1 addition & 1 deletion docs/api-reference/next.config.js/exportPathMap.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ To switch back and add a trailing slash, open `next.config.js` and enable the `e

```js
module.exports = {
exportTrailingSlash: true,
trailingSlash: true,
}
```

Expand Down
2 changes: 2 additions & 0 deletions docs/basic-features/static-file-serving.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,5 @@ This folder is also useful for `robots.txt`, Google Site Verification, and any o
> **Note**: Be sure to not have a static file with the same name as a file in the `pages/` directory, as this will result in an error.
>
> Read more: <http://err.sh/next.js/conflicting-public-file-page>
> **Note**: Only assets that are in the `public` directory at [build time](/docs/api-reference/cli.md#build) will be served by Next.js. Files added at runtime won't be available. We recommend using a third party service like [AWS S3](https://aws.amazon.com/s3/) for persistent file storage.
3 changes: 1 addition & 2 deletions errors/invalid-href-passed.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@ When using any of these, it is expected they are only used for internal navigati

Either you passed a non-internal `href` to a `next/link` component or you called `Router#push` or `Router#replace` with one.

Invalid `href`s include external sites (https://google.com) and `mailto:` links. In the past, usage of these invalid `href`s could have gone unnoticed but since they can cause unexpected behavior.
We now show a warning in development for them.
Invalid `href`s include external sites (https://google.com) and `mailto:` links. In the past, usage of these invalid `href`s could have gone unnoticed, but since they can cause unexpected behavior we now show a warning in development for them.

#### Possible Ways to Fix It

Expand Down
1 change: 1 addition & 0 deletions examples/with-patternfly/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ module.exports = withCSS(
publicPath: '/_next/static/fonts/',
outputPath: 'static/fonts/',
name: '[name].[ext]',
esModule: false,
},
},
})
Expand Down
14 changes: 7 additions & 7 deletions examples/with-patternfly/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@
"start": "next start"
},
"dependencies": {
"@patternfly/react-core": "^3.112.3",
"@patternfly/react-core": "^4.50.2",
"next": "latest",
"next-transpile-modules": "^4.0.2",
"react": "^16.7.0",
"react-dom": "^16.7.0"
"next-transpile-modules": "^4.1.0",
"react": "^16.13.1",
"react-dom": "^16.13.1"
},
"devDependencies": {
"@zeit/next-css": "^1.0.1",
"file-loader": "^3.0.1",
"svg-url-loader": "^3.0.2",
"url-loader": "^1.1.2"
"file-loader": "^6.1.0",
"svg-url-loader": "^6.0.0",
"url-loader": "^4.1.0"
},
"license": "MIT"
}
2 changes: 1 addition & 1 deletion examples/with-react-intl/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const getInitialProps: typeof App.getInitialProps = async appContext => {

const [supportedLocale, messagePromise] = getMessages(requestedLocales);

const [appProps, messages] = await Promise.all([
const [, messages, appProps] = await Promise.all([
polyfill(supportedLocale),
messagePromise,
App.getInitialProps(appContext),
Expand Down
2 changes: 2 additions & 0 deletions examples/with-rebass/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
},
"dependencies": {
"babel-plugin-styled-components": "^1.1.7",
"babel-plugin-transform-object-assign": "^6.22.0",
"babel-plugin-transform-object-set-prototype-of-to-assign": "^6.22.0",
"next": "latest",
"react": "^16.7.0",
"react-dom": "^16.7.0",
Expand Down
1 change: 0 additions & 1 deletion examples/with-typescript-eslint-jest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
"@types/jest": "^25.1.4",
"@types/node": "^13.9.5",
"@types/react": "^16.9.27",
"@types/testing-library__react": "^10.0.0",
"@typescript-eslint/eslint-plugin": "^2.25.0",
"@typescript-eslint/parser": "^2.25.0",
"babel-jest": "^25.2.3",
Expand Down
15 changes: 11 additions & 4 deletions packages/eslint-plugin-next/lib/rules/no-html-link-for-pages.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ module.exports = {
},

create: function (context) {
const [pagesDirectory] = context.options
const pagesDir = pagesDirectory || path.join(context.getCwd(), 'pages')
if (!fs.existsSync(pagesDir)) {
const [customPagesDirectory] = context.options
const pagesDirs = customPagesDirectory
? [customPagesDirectory]
: [
path.join(context.getCwd(), 'pages'),
path.join(context.getCwd(), 'src', 'pages'),
]
const pagesDir = pagesDirs.find((dir) => fs.existsSync(dir))
if (!pagesDir) {
throw new Error(
`Pages directory cannot be found at ${pagesDir}, if using a custom path, please configure with the no-html-link-for-pages rule`
`Pages directory cannot be found at ${pagesDirs.join(' or ')}. ` +
`If using a custom path, please configure with the no-html-link-for-pages rule`
)
}

Expand Down

0 comments on commit 728ec93

Please sign in to comment.