Skip to content

Commit

Permalink
fix: update broken links in config-shared.d.ts (vercel#74122)
Browse files Browse the repository at this point in the history
<!-- Thanks for opening a PR! Your contribution is much appreciated.
To make sure your PR is handled as smoothly as possible we request that
you follow the checklist sections below.
Choose the right checklist for the change(s) that you're making:

## For Contributors

### Improving Documentation

- Run `pnpm prettier-fix` to fix formatting issues before opening the
PR.
- 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

### Fixing a bug

- Related issues linked using `fixes #number`
- Tests added. See:
https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md

### Adding a feature

- Implements an existing feature request or RFC. Make sure the feature
request has been accepted for implementation before opening a PR. (A
discussion must be opened, see
https://github.com/vercel/next.js/discussions/new?category=ideas)
- Related issues/discussions are linked using `fixes #number`
- e2e tests added
(https://github.com/vercel/next.js/blob/canary/contributing/core/testing.md#writing-tests-for-nextjs)
- Documentation added
- Telemetry added. In case of a feature if it's used or not.
- Errors have a helpful link attached, see
https://github.com/vercel/next.js/blob/canary/contributing.md


## For Maintainers

- Minimal description (aim for explaining to someone not on the team to
understand the PR)
- When linking to a Slack thread, you might want to share details of the
conclusion
- Link both the Linear (Fixes NEXT-xxx) and the GitHub issues
- Add review comments if necessary to explain to the reviewer the logic
behind a change

### What?

### Why?

### How?

Closes NEXT-
Fixes #

-->

Links beginning with
`"https://nextjs.org/docs/api-reference/next.config.js"` are broken in
https://github.com/vercel/next.js/blob/canary/packages/next/src/server/config-shared.ts#L616.

And I found other broken links with same problems and fixed those.
[09ff492](vercel@09ff492)

close vercel#74121

---------

Co-authored-by: JJ Kasper <[email protected]>
  • Loading branch information
yongholeeme and ijjk authored Jan 2, 2025
1 parent 35acd7e commit ef98904
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion examples/redirects/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Redirects Example

This example shows how to use [redirects in Next.js](https://nextjs.org/docs/api-reference/next.config.js/redirects) to redirect an incoming request path to a different destination path.
This example shows how to use [redirects in Next.js](https://nextjs.org/docs/app/api-reference/config/next-config-js/redirects) to redirect an incoming request path to a different destination path.

The index page ([`app/page.tsx`](app/page.tsx)) has a list of links that match the redirects defined in [`next.config.js`](next.config.js). Run or deploy the app to see how it works!

Expand Down
2 changes: 1 addition & 1 deletion examples/redirects/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default function Home() {
<p>
The links below are custom
<Link
href="https://nextjs.org/docs/api-reference/next.config.js/redirects"
href="https://nextjs.org/docs/app/api-reference/config/next-config-js/redirects"
legacyBehavior
>
<>
Expand Down
2 changes: 1 addition & 1 deletion examples/with-sentry/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This file sets a custom webpack configuration to use your Next.js app
// with Sentry.
// https://nextjs.org/docs/api-reference/next.config.js/introduction
// https://nextjs.org/docs/app/api-reference/config/next-config-js
// https://docs.sentry.io/platforms/javascript/guides/nextjs/

const { withSentryConfig } = require("@sentry/nextjs");
Expand Down
2 changes: 1 addition & 1 deletion examples/with-zones/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Multi-Zone applications work by having one of the applications route requests fo
- The `home` app is the main app and therefore it includes the rewrites that map to the `blog` app in [next.config.js](home/next.config.js)
- `home` will serve all paths that are not specifically routed to `blog`.
- `blog` will serve the `/blog` and `/blog/*` paths.
- The `blog` app sets [`basePath`](https://nextjs.org/docs/api-reference/next.config.js/basepath) to `/blog` so that generated pages, Next.js assets and public assets are unique to the `blog` zone and won't conflict with anything from the other zones.
- The `blog` app sets [`basePath`](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath) to `/blog` so that generated pages, Next.js assets and public assets are unique to the `blog` zone and won't conflict with anything from the other zones.

NOTE: A `basePath` will prefix all pages in the application with the `basePath` automatically, including relative links. If you have many pages that don't share the same path prefix (for example, `/home` and `/blog` live in the same zone), you can use [`assetPrefix`](https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix) to add a unique prefix for Next.js assets without affecting the other pages.

Expand Down
38 changes: 19 additions & 19 deletions packages/next/src/server/config-shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ export type ExportPathMap = {
*
* This can change the behavior, enable experimental features, and configure other advanced options.
*
* Read more: [Next.js Docs: `next.config.js`](https://nextjs.org/docs/api-reference/next.config.js/introduction)
* Read more: [Next.js Docs: `next.config.js`](https://nextjs.org/docs/app/api-reference/config/next-config-js)
*/
export interface NextConfig extends Record<string, any> {
exportPathMap?: (
Expand Down Expand Up @@ -670,14 +670,14 @@ export interface NextConfig extends Record<string, any> {
/**
* Headers allow you to set custom HTTP headers for an incoming request path.
*
* @see [Headers configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/headers)
* @see [Headers configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/headers)
*/
headers?: () => Promise<Header[]>

/**
* Rewrites allow you to map an incoming request path to a different destination path.
*
* @see [Rewrites configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/rewrites)
* @see [Rewrites configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/rewrites)
*/
rewrites?: () => Promise<
| Rewrite[]
Expand All @@ -691,7 +691,7 @@ export interface NextConfig extends Record<string, any> {
/**
* Redirects allow you to redirect an incoming request path to a different destination path.
*
* @see [Redirects configuration documentation](https://nextjs.org/docs/api-reference/next.config.js/redirects)
* @see [Redirects configuration documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/redirects)
*/
redirects?: () => Promise<Redirect[]>

Expand All @@ -703,22 +703,22 @@ export interface NextConfig extends Record<string, any> {
/**
* Before continuing to add custom webpack configuration to your application make sure Next.js doesn't already support your use-case
*
* @see [Custom Webpack Config documentation](https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config)
* @see [Custom Webpack Config documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/webpack)
*/
webpack?: NextJsWebpackConfig | null

/**
* By default Next.js will redirect urls with trailing slashes to their counterpart without a trailing slash.
*
* @default false
* @see [Trailing Slash Configuration](https://nextjs.org/docs/api-reference/next.config.js/trailing-slash)
* @see [Trailing Slash Configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/trailingSlash)
*/
trailingSlash?: boolean

/**
* Next.js comes with built-in support for environment variables
*
* @see [Environment Variables documentation](https://nextjs.org/docs/api-reference/next.config.js/environment-variables)
* @see [Environment Variables documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/env)
*/
env?: Record<string, string | undefined>

Expand All @@ -735,7 +735,7 @@ export interface NextConfig extends Record<string, any> {
/**
* To set up a CDN, you can set up an asset prefix and configure your CDN's origin to resolve to the domain that Next.js is hosted on.
*
* @see [CDN Support with Asset Prefix](https://nextjs.org/docs/api-reference/next.config.js/cdn-support-with-asset-prefix)
* @see [CDN Support with Asset Prefix](https://nextjs.org/docs/app/api-reference/config/next-config-js/assetPrefix)
*/
assetPrefix?: string

Expand Down Expand Up @@ -764,20 +764,20 @@ export interface NextConfig extends Record<string, any> {
useFileSystemPublicRoutes?: boolean

/**
* @see [Configuring the build ID](https://nextjs.org/docs/api-reference/next.config.js/configuring-the-build-id)
* @see [Configuring the build ID](https://nextjs.org/docs/app/api-reference/config/next-config-js/generateBuildId)
*/
generateBuildId?: () => string | null | Promise<string | null>

/** @see [Disabling ETag Configuration](https://nextjs.org/docs/api-reference/next.config.js/disabling-etag-generation) */
/** @see [Disabling ETag Configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/generateEtags) */
generateEtags?: boolean

/** @see [Including non-page files in the pages directory](https://nextjs.org/docs/api-reference/next.config.js/custom-page-extensions) */
/** @see [Including non-page files in the pages directory](https://nextjs.org/docs/app/api-reference/config/next-config-js/pageExtensions) */
pageExtensions?: string[]

/** @see [Compression documentation](https://nextjs.org/docs/api-reference/next.config.js/compression) */
/** @see [Compression documentation](https://nextjs.org/docs/app/api-reference/config/next-config-js/compress) */
compress?: boolean

/** @see [Disabling x-powered-by](https://nextjs.org/docs/api-reference/next.config.js/disabling-x-powered-by) */
/** @see [Disabling x-powered-by](https://nextjs.org/docs/app/api-reference/config/next-config-js/poweredByHeader) */
poweredByHeader?: boolean

/** @see [Using the Image Component](https://nextjs.org/docs/app/api-reference/next-config-js/images) */
Expand All @@ -800,7 +800,7 @@ export interface NextConfig extends Record<string, any> {
/**
* Next.js exposes some options that give you some control over how the server will dispose or keep in memory built pages in development.
*
* @see [Configuring `onDemandEntries`](https://nextjs.org/docs/api-reference/next.config.js/configuring-onDemandEntries)
* @see [Configuring `onDemandEntries`](https://nextjs.org/docs/app/api-reference/config/next-config-js/onDemandEntries)
*/
onDemandEntries?: {
/** period (in ms) where the server will keep pages in the buffer */
Expand All @@ -822,7 +822,7 @@ export interface NextConfig extends Record<string, any> {
/**
* Deploy a Next.js application under a sub-path of a domain
*
* @see [Base path configuration](https://nextjs.org/docs/api-reference/next.config.js/basepath)
* @see [Base path configuration](https://nextjs.org/docs/app/api-reference/config/next-config-js/basePath)
*/
basePath?: string

Expand All @@ -848,29 +848,29 @@ export interface NextConfig extends Record<string, any> {
/**
* The Next.js runtime is Strict Mode-compliant.
*
* @see [React Strict Mode](https://nextjs.org/docs/api-reference/next.config.js/react-strict-mode)
* @see [React Strict Mode](https://nextjs.org/docs/app/api-reference/config/next-config-js/reactStrictMode)
*/
reactStrictMode?: boolean | null

/**
* The maximum length of the headers that are emitted by React and added to
* the response.
*
* @see [React Max Headers Length](https://nextjs.org/docs/api-reference/next.config.js/react-max-headers-length)
* @see [React Max Headers Length](https://nextjs.org/docs/app/api-reference/config/next-config-js/reactMaxHeadersLength)
*/
reactMaxHeadersLength?: number

/**
* Add public (in browser) runtime configuration to your app
*
* @see [Runtime configuration](https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration)
* @see [Runtime configuration](https://nextjs.org/docs/pages/api-reference/config/next-config-js/runtime-configuration
*/
publicRuntimeConfig?: { [key: string]: any }

/**
* Add server runtime configuration to your app
*
* @see [Runtime configuration](https://nextjs.org/docs/api-reference/next.config.js/runtime-configuration)
* @see [Runtime configuration](https://nextjs.org/docs/pages/api-reference/config/next-config-js/runtime-configuration
*/
serverRuntimeConfig?: { [key: string]: any }

Expand Down

0 comments on commit ef98904

Please sign in to comment.