diff --git a/scripts/apidoc/apiDocsWriter.ts b/scripts/apidoc/apiDocsWriter.ts index 146c79235aa..6f00f64a313 100644 --- a/scripts/apidoc/apiDocsWriter.ts +++ b/scripts/apidoc/apiDocsWriter.ts @@ -41,6 +41,7 @@ export function writeApiDocsModulePage( moduleName: string, lowerModuleName: string, comment: string, + deprecated: string | undefined, methods: Method[] ): void { // Write api docs page @@ -57,6 +58,16 @@ export function writeApiDocsModulePage( ::: v-pre + ${ + deprecated == null + ? '' + : `
+

Deprecated

+

This module is deprecated and will be removed in a future version.

+ ${deprecated} +
` + } + ${comment} ::: diff --git a/scripts/apidoc/moduleMethods.ts b/scripts/apidoc/moduleMethods.ts index cdd9222e35e..20cbc2b8056 100644 --- a/scripts/apidoc/moduleMethods.ts +++ b/scripts/apidoc/moduleMethods.ts @@ -3,6 +3,7 @@ import type { Method } from '../../docs/.vitepress/components/api-docs/method'; import { writeApiDocsData, writeApiDocsModulePage } from './apiDocsWriter'; import { analyzeSignature, stripAbsoluteFakerUrls, toBlock } from './signature'; import { + extractDeprecated, extractModuleFieldName, extractModuleName, selectApiMethodSignatures, @@ -41,7 +42,7 @@ function processModuleMethod(module: DeclarationReflection): PageAndDiffIndex { const moduleFieldName = extractModuleFieldName(module); console.log(`Processing Module ${moduleName}`); const comment = stripAbsoluteFakerUrls(toBlock(module.comment)); - + const deprecated = extractDeprecated(module); const methods: Method[] = []; // Generate method section @@ -52,7 +53,13 @@ function processModuleMethod(module: DeclarationReflection): PageAndDiffIndex { methods.push(analyzeSignature(signature, moduleFieldName, methodName)); } - writeApiDocsModulePage(moduleName, moduleFieldName, comment, methods); + writeApiDocsModulePage( + moduleName, + moduleFieldName, + comment, + deprecated, + methods + ); writeApiDocsData(moduleFieldName, methods); return [ diff --git a/src/modules/random/index.ts b/src/modules/random/index.ts index df58d2929d8..2a44b0e2977 100644 --- a/src/modules/random/index.ts +++ b/src/modules/random/index.ts @@ -12,10 +12,6 @@ import type { /** * Generates random values of different kinds. * - * ### Overview - * - * All the methods in this module are deprecated. - * * @deprecated Use the modules specific to the type of data you want to generate instead. */ export class RandomModule {