From 62cccda86c6ea7ac702d93f2adc80418d1351e66 Mon Sep 17 00:00:00 2001 From: xjccc <546534045@qq.com> Date: Tue, 6 Aug 2024 01:10:23 +0800 Subject: [PATCH] docs: alias links in jsdoc `@see` blocks (#28270) --- packages/schema/src/config/adhoc.ts | 2 +- packages/schema/src/config/app.ts | 17 ++++++++--------- packages/schema/src/config/build.ts | 2 +- packages/schema/src/config/common.ts | 6 +++--- packages/schema/src/config/experimental.ts | 8 ++++---- packages/schema/src/config/nitro.ts | 10 +++++----- packages/schema/src/config/postcss.ts | 8 +++++--- packages/schema/src/config/router.ts | 2 +- packages/schema/src/config/typescript.ts | 2 +- packages/schema/src/config/vite.ts | 2 +- packages/schema/src/config/webpack.ts | 22 +++++++++++----------- 11 files changed, 41 insertions(+), 40 deletions(-) diff --git a/packages/schema/src/config/adhoc.ts b/packages/schema/src/config/adhoc.ts index 4328909a32..21660fa731 100644 --- a/packages/schema/src/config/adhoc.ts +++ b/packages/schema/src/config/adhoc.ts @@ -6,7 +6,7 @@ export default defineUntypedSchema({ * * Any components in the directories configured here can be used throughout your * pages, layouts (and other components) without needing to explicitly import them. - * @see https://nuxt.com/docs/guide/directory-structure/components + * @see [`components/` directory documentation](https://nuxt.com/docs/guide/directory-structure/components) * @type {boolean | typeof import('../src/types/components').ComponentsOptions | typeof import('../src/types/components').ComponentsOptions['dirs']} */ components: { diff --git a/packages/schema/src/config/app.ts b/packages/schema/src/config/app.ts index ad4026c157..f8b408bc21 100644 --- a/packages/schema/src/config/app.ts +++ b/packages/schema/src/config/app.ts @@ -18,7 +18,7 @@ export default defineUntypedSchema({ }, /** * Options for the Vue compiler that will be passed at build time. - * @see [documentation](https://vuejs.org/api/application.html#app-config-compileroptions) + * @see [Vue documentation](https://vuejs.org/api/application.html#app-config-compileroptions) * @type {typeof import('@vue/compiler-core').CompilerOptions} */ compilerOptions: {}, @@ -158,7 +158,7 @@ export default defineUntypedSchema({ * * This can be overridden with `definePageMeta` on an individual page. * Only JSON-serializable values are allowed. - * @see https://vuejs.org/api/built-in-components.html#transition + * @see [Vue Transition docs](https://vuejs.org/api/built-in-components.html#transition) * @type {typeof import('../src/types/config').NuxtAppConfig['layoutTransition']} */ layoutTransition: false, @@ -168,7 +168,7 @@ export default defineUntypedSchema({ * * This can be overridden with `definePageMeta` on an individual page. * Only JSON-serializable values are allowed. - * @see https://vuejs.org/api/built-in-components.html#transition + * @see [Vue Transition docs](https://vuejs.org/api/built-in-components.html#transition) * @type {typeof import('../src/types/config').NuxtAppConfig['pageTransition']} */ pageTransition: false, @@ -180,7 +180,7 @@ export default defineUntypedSchema({ * [enabled in your nuxt.config file](/docs/getting-started/transitions#view-transitions-api-experimental). * * This can be overridden with `definePageMeta` on an individual page. - * @see https://nuxt.com/docs/getting-started/transitions#view-transitions-api-experimental + * @see [Nuxt View Transition API docs](https://nuxt.com/docs/getting-started/transitions#view-transitions-api-experimental) * @type {typeof import('../src/types/config').NuxtAppConfig['viewTransition']} */ viewTransition: { @@ -194,7 +194,7 @@ export default defineUntypedSchema({ * * This can be overridden with `definePageMeta` on an individual page. * Only JSON-serializable values are allowed. - * @see https://vuejs.org/api/built-in-components.html#keepalive + * @see [Vue KeepAlive](https://vuejs.org/api/built-in-components.html#keepalive) * @type {typeof import('../src/types/config').NuxtAppConfig['keepalive']} */ keepalive: false, @@ -328,7 +328,7 @@ export default defineUntypedSchema({ * @note Plugins are also auto-registered from the `~/plugins` directory * and these plugins do not need to be listed in `nuxt.config` unless you * need to customize their order. All plugins are deduplicated by their src path. - * @see https://nuxt.com/docs/guide/directory-structure/plugins + * @see [`plugins/` directory documentation](https://nuxt.com/docs/guide/directory-structure/plugins) * @example * ```js * plugins: [ @@ -375,8 +375,7 @@ export default defineUntypedSchema({ /** * An object that will be passed to `renderSSRHead` to customize the output. * - * @see https://unhead.unjs.io/setup/ssr/installation#options - * @type {typeof import('@unhead/schema').RenderSSRHeadOptions} + * @see [`unhead` options documentation](https://unhead.unjs.io/setup/ssr/installation#options) * * @example * ```ts @@ -387,7 +386,7 @@ export default defineUntypedSchema({ * } * }) * ``` - * + * @type {typeof import('@unhead/schema').RenderSSRHeadOptions} */ renderSSRHeadOptions: { $resolve: async (val: Record | undefined, get) => { diff --git a/packages/schema/src/config/build.ts b/packages/schema/src/config/build.ts index 5be66f821c..6527a2aaa3 100644 --- a/packages/schema/src/config/build.ts +++ b/packages/schema/src/config/build.ts @@ -66,7 +66,7 @@ export default defineUntypedSchema({ * You can also use a function to conditionally transpile. The function will receive an object ({ isDev, isServer, isClient, isModern, isLegacy }). * @example * ```js - transpile: [({ isLegacy }) => isLegacy && 'ky'] + * transpile: [({ isLegacy }) => isLegacy && 'ky'] * ``` * @type {Array string | RegExp | false)>} */ diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index b338ffd6b3..267f315f1a 100644 --- a/packages/schema/src/config/common.ts +++ b/packages/schema/src/config/common.ts @@ -14,9 +14,9 @@ export default defineUntypedSchema({ * * Value should be either a string or array of strings pointing to source directories or config path relative to current config. * - * You can use `github:`, `gh:` `gitlab:` or `bitbucket:`. - * @see https://github.com/unjs/c12#extending-config-layer-from-remote-sources - * @see https://github.com/unjs/giget + * You can use `github:`, `gh:` `gitlab:` or `bitbucket:` + * @see [`c12` docs on extending config layers](https://github.com/unjs/c12#extending-config-layer-from-remote-sources) + * @see [`giget` documentation](https://github.com/unjs/giget) * @type {string | [string, typeof import('c12').SourceOptions?] | (string | [string, typeof import('c12').SourceOptions?])[]} */ extends: null, diff --git a/packages/schema/src/config/experimental.ts b/packages/schema/src/config/experimental.ts index a650f86294..88724631b0 100644 --- a/packages/schema/src/config/experimental.ts +++ b/packages/schema/src/config/experimental.ts @@ -26,7 +26,7 @@ export default defineUntypedSchema({ * * You can set it to false to use the legacy 'Node' mode, which is the default for TypeScript. * - * See https://github.com/microsoft/TypeScript/pull/51669 + * @see [TypeScript PR implementing `bundler` module resolution](https://github.com/microsoft/TypeScript/pull/51669) */ typescriptBundlerResolution: { async $resolve (val, get) { @@ -247,7 +247,7 @@ export default defineUntypedSchema({ * * You can also set this to `chokidar` to watch all files in your source directory. * @see [chokidar](https://github.com/paulmillr/chokidar) - * @see [Parcel watcher](https://github.com/parcel-bundler/watcher) + * @see [@parcel/watcher](https://github.com/parcel-bundler/watcher) * @type {'chokidar' | 'parcel' | 'chokidar-granular'} */ watcher: { @@ -296,7 +296,7 @@ export default defineUntypedSchema({ * * This only works with static or strings/arrays rather than variables or conditional assignment. * - * https://github.com/nuxt/nuxt/issues/24770 + * @see [Nuxt Issues #24770](https://github.com/nuxt/nuxt/issues/24770) */ scanPageMeta: true, @@ -358,7 +358,7 @@ export default defineUntypedSchema({ /** * Automatically polyfill Node.js imports in the client build using `unenv`. - * @see https://github.com/unjs/unenv + * @see [unenv](https://github.com/unjs/unenv) * * **Note:** To make globals like `Buffer` work in the browser, you need to manually inject them. * diff --git a/packages/schema/src/config/nitro.ts b/packages/schema/src/config/nitro.ts index 855fec69a4..8da7ca4b7e 100644 --- a/packages/schema/src/config/nitro.ts +++ b/packages/schema/src/config/nitro.ts @@ -4,7 +4,7 @@ import type { RuntimeConfig } from '../types/config' export default defineUntypedSchema({ /** * Configuration for Nitro. - * @see https://nitro.unjs.io/config/ + * @see [Nitro configuration docs](https://nitro.unjs.io/config/) * @type {typeof import('nitro/types')['NitroConfig']} */ nitro: { @@ -37,7 +37,7 @@ export default defineUntypedSchema({ /** * Global route options applied to matching server routes. * @experimental This is an experimental feature and API may change in the future. - * @see https://nitro.unjs.io/config/#routerules + * @see [Nitro route rules documentation](https://nitro.unjs.io/config/#routerules) * @type {typeof import('nitro/types')['NitroConfig']['routeRules']} */ routeRules: {}, @@ -48,12 +48,12 @@ export default defineUntypedSchema({ * Each handler accepts the following options: * * - handler: The path to the file defining the handler. - * - route: The route under which the handler is available. This follows the conventions of https://github.com/unjs/radix3. + * - route: The route under which the handler is available. This follows the conventions of [radix3](https://github.com/unjs/radix3.) * - method: The HTTP method of requests that should be handled. * - middleware: Specifies whether it is a middleware handler. * - lazy: Specifies whether to use lazy loading to import the handler. * - * @see https://nuxt.com/docs/guide/directory-structure/server + * @see [`server/` directory documentation](https://nuxt.com/docs/guide/directory-structure/server) * @note Files from `server/api`, `server/middleware` and `server/routes` will be automatically registered by Nuxt. * @example * ```js @@ -67,7 +67,7 @@ export default defineUntypedSchema({ /** * Nitro development-only server handlers. - * @see https://nitro.unjs.io/guide/routing + * @see [Nitro server routes documentation](https://nitro.unjs.io/guide/routing) * @type {typeof import('nitro/types')['NitroDevEventHandler'][]} */ devServerHandlers: [], diff --git a/packages/schema/src/config/postcss.ts b/packages/schema/src/config/postcss.ts index 2395c15983..573fcefb73 100644 --- a/packages/schema/src/config/postcss.ts +++ b/packages/schema/src/config/postcss.ts @@ -38,17 +38,19 @@ export default defineUntypedSchema({ /** * Options for configuring PostCSS plugins. * - * https://postcss.org/ + * @see [PostCSS docs](https://postcss.org/) * @type {Record & { autoprefixer?: typeof import('autoprefixer').Options; cssnano?: typeof import('cssnano').Options }} */ plugins: { /** - * https://github.com/postcss/autoprefixer + * Plugin to parse CSS and add vendor prefixes to CSS rules. + * + * @see [`autoprefixer`](https://github.com/postcss/autoprefixer) */ autoprefixer: {}, /** - * https://cssnano.github.io/cssnano/docs/config-file/#configuration-options + * @see [`cssnano` configuration options](https://cssnano.github.io/cssnano/docs/config-file/#configuration-options) */ cssnano: { $resolve: async (val, get) => { diff --git a/packages/schema/src/config/router.ts b/packages/schema/src/config/router.ts index ea8a5cc44a..5365829177 100644 --- a/packages/schema/src/config/router.ts +++ b/packages/schema/src/config/router.ts @@ -7,7 +7,7 @@ export default defineUntypedSchema({ * Nuxt offers additional options to customize the router (see below). * @note Only JSON serializable options should be passed by Nuxt config. * For more control, you can use `app/router.options.ts` file. - * @see [documentation](https://router.vuejs.org/api/interfaces/routeroptions.html). + * @see [Vue Router documentation](https://router.vuejs.org/api/interfaces/routeroptions.html). * @type {typeof import('../src/types/router').RouterConfigSerializable} */ options: { diff --git a/packages/schema/src/config/typescript.ts b/packages/schema/src/config/typescript.ts index 28f0261ed6..2a4feeb67f 100644 --- a/packages/schema/src/config/typescript.ts +++ b/packages/schema/src/config/typescript.ts @@ -66,7 +66,7 @@ export default defineUntypedSchema({ * * If set to true, this will type check in development. You can restrict this to build-time type checking by setting it to `build`. * Requires to install `typescript` and `vue-tsc` as dev dependencies. - * @see https://nuxt.com/docs/guide/concepts/typescript + * @see [Nuxt TypeScript docs](https://nuxt.com/docs/guide/concepts/typescript) * @type {boolean | 'build'} */ typeCheck: false, diff --git a/packages/schema/src/config/vite.ts b/packages/schema/src/config/vite.ts index 7587e0700b..035626b581 100644 --- a/packages/schema/src/config/vite.ts +++ b/packages/schema/src/config/vite.ts @@ -8,7 +8,7 @@ export default defineUntypedSchema({ /** * Configuration that will be passed directly to Vite. * - * See https://vitejs.dev/config for more information. + * @see [Vite configuration docs](https://vitejs.dev/config) for more information. * Please note that not all vite options are supported in Nuxt. * @type {typeof import('../src/types/config').ViteConfig & { $client?: typeof import('../src/types/config').ViteConfig, $server?: typeof import('../src/types/config').ViteConfig }} */ diff --git a/packages/schema/src/config/webpack.ts b/packages/schema/src/config/webpack.ts index ad9787aea5..ee4d94843d 100644 --- a/packages/schema/src/config/webpack.ts +++ b/packages/schema/src/config/webpack.ts @@ -96,7 +96,7 @@ export default defineUntypedSchema({ /** * Customize bundle filenames. * - * To understand a bit more about the use of manifests, take a look at [this webpack documentation](https://webpack.js.org/guides/code-splitting/). + * To understand a bit more about the use of manifests, take a look at [webpack documentation](https://webpack.js.org/guides/code-splitting/). * @note Be careful when using non-hashed based filenames in production * as most browsers will cache the asset and not detect the changes on first load. * @@ -154,7 +154,7 @@ export default defineUntypedSchema({ }, /** - * See https://github.com/esbuild-kit/esbuild-loader + * @see [esbuild loader](https://github.com/esbuild-kit/esbuild-loader) * @type {Omit} */ esbuild: { @@ -164,7 +164,7 @@ export default defineUntypedSchema({ }, /** - * See: https://github.com/webpack-contrib/file-loader#options + * @see [`file-loader` Options](https://github.com/webpack-contrib/file-loader#options) * @type {Omit} * @default * ```ts @@ -174,7 +174,7 @@ export default defineUntypedSchema({ file: { esModule: false }, /** - * See: https://github.com/webpack-contrib/file-loader#options + * @see [`file-loader` Options](https://github.com/webpack-contrib/file-loader#options) * @type {Omit} * @default * ```ts @@ -184,7 +184,7 @@ export default defineUntypedSchema({ fontUrl: { esModule: false, limit: 1000 }, /** - * See: https://github.com/webpack-contrib/file-loader#options + * @see [`file-loader` Options](https://github.com/webpack-contrib/file-loader#options) * @type {Omit} * @default * ```ts @@ -194,7 +194,7 @@ export default defineUntypedSchema({ imgUrl: { esModule: false, limit: 1000 }, /** - * See: https://pugjs.org/api/reference.html#options + * @see [`pug` options](https://pugjs.org/api/reference.html#options) * @type {typeof import('pug')['Options']} */ pugPlain: {}, @@ -235,12 +235,12 @@ export default defineUntypedSchema({ }, /** - * See: https://github.com/webpack-contrib/less-loader#options + * @see [`less-loader` Options](https://github.com/webpack-contrib/less-loader#options) */ less: {}, /** - * See: https://github.com/webpack-contrib/sass-loader#options + * @see [`sass-loader` Options](https://github.com/webpack-contrib/sass-loader#options) * @type {typeof import('sass-loader')['Options']} * @default * ```ts @@ -258,13 +258,13 @@ export default defineUntypedSchema({ }, /** - * See: https://github.com/webpack-contrib/sass-loader#options + * @see [`sass-loader` Options](https://github.com/webpack-contrib/sass-loader#options) * @type {typeof import('sass-loader')['Options']} */ scss: {}, /** - * See: https://github.com/webpack-contrib/stylus-loader#options + * @see [`stylus-loader` Options](https://github.com/webpack-contrib/stylus-loader#options) */ stylus: {}, @@ -322,7 +322,7 @@ export default defineUntypedSchema({ /** * Customize PostCSS Loader. - * Same options as https://github.com/webpack-contrib/postcss-loader#options + * same options as [`postcss-loader` options](https://github.com/webpack-contrib/postcss-loader#options) * @type {{ execute?: boolean, postcssOptions: typeof import('postcss').ProcessOptions, sourceMap?: boolean, implementation?: any }} */ postcss: {