mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 15:47:23 +02:00
refactor(v2): remove deprecated docs option excludeNextVersionDocs (#5053)
This commit is contained in:
parent
462b1cf2bc
commit
05c85c7be7
3 changed files with 0 additions and 18 deletions
|
@ -42,7 +42,6 @@ describe('normalizeDocsPluginOptions', () => {
|
|||
showLastUpdateTime: true,
|
||||
showLastUpdateAuthor: true,
|
||||
admonitions: {},
|
||||
excludeNextVersionDocs: true,
|
||||
includeCurrentVersion: false,
|
||||
disableVersioning: true,
|
||||
editCurrentVersion: true,
|
||||
|
|
|
@ -37,7 +37,6 @@ export const DEFAULT_OPTIONS: Omit<PluginOptions, 'id' | 'sidebarPath'> = {
|
|||
showLastUpdateTime: false,
|
||||
showLastUpdateAuthor: false,
|
||||
admonitions: {},
|
||||
excludeNextVersionDocs: false,
|
||||
includeCurrentVersion: true,
|
||||
disableVersioning: false,
|
||||
lastVersion: undefined,
|
||||
|
@ -102,10 +101,6 @@ export const OptionsSchema = Joi.object({
|
|||
showLastUpdateAuthor: Joi.bool().default(
|
||||
DEFAULT_OPTIONS.showLastUpdateAuthor,
|
||||
),
|
||||
// TODO deprecated, excludeNextVersionDocs replaced by includeCurrentVersion
|
||||
excludeNextVersionDocs: Joi.bool().default(
|
||||
DEFAULT_OPTIONS.excludeNextVersionDocs,
|
||||
),
|
||||
includeCurrentVersion: Joi.bool().default(
|
||||
DEFAULT_OPTIONS.includeCurrentVersion,
|
||||
),
|
||||
|
@ -129,17 +124,6 @@ export function validateOptions({
|
|||
);
|
||||
}
|
||||
|
||||
if (typeof options.excludeNextVersionDocs !== 'undefined') {
|
||||
console.log(
|
||||
chalk.red(
|
||||
`The docs plugin option "excludeNextVersionDocs=${
|
||||
options.excludeNextVersionDocs
|
||||
}" is deprecated. Use the "includeCurrentVersion=${!options.excludeNextVersionDocs}" option instead!"`,
|
||||
),
|
||||
);
|
||||
options.includeCurrentVersion = !options.excludeNextVersionDocs;
|
||||
}
|
||||
|
||||
const normalizedOptions = validate(OptionsSchema, options);
|
||||
|
||||
if (normalizedOptions.admonitions) {
|
||||
|
|
|
@ -85,7 +85,6 @@ export type PluginOptions = MetadataOptions &
|
|||
docItemComponent: string;
|
||||
admonitions: Record<string, unknown>;
|
||||
disableVersioning: boolean;
|
||||
excludeNextVersionDocs?: boolean;
|
||||
includeCurrentVersion: boolean;
|
||||
sidebarItemsGenerator: SidebarItemsGeneratorOption;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue