mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-10 23:57:22 +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,
|
showLastUpdateTime: true,
|
||||||
showLastUpdateAuthor: true,
|
showLastUpdateAuthor: true,
|
||||||
admonitions: {},
|
admonitions: {},
|
||||||
excludeNextVersionDocs: true,
|
|
||||||
includeCurrentVersion: false,
|
includeCurrentVersion: false,
|
||||||
disableVersioning: true,
|
disableVersioning: true,
|
||||||
editCurrentVersion: true,
|
editCurrentVersion: true,
|
||||||
|
|
|
@ -37,7 +37,6 @@ export const DEFAULT_OPTIONS: Omit<PluginOptions, 'id' | 'sidebarPath'> = {
|
||||||
showLastUpdateTime: false,
|
showLastUpdateTime: false,
|
||||||
showLastUpdateAuthor: false,
|
showLastUpdateAuthor: false,
|
||||||
admonitions: {},
|
admonitions: {},
|
||||||
excludeNextVersionDocs: false,
|
|
||||||
includeCurrentVersion: true,
|
includeCurrentVersion: true,
|
||||||
disableVersioning: false,
|
disableVersioning: false,
|
||||||
lastVersion: undefined,
|
lastVersion: undefined,
|
||||||
|
@ -102,10 +101,6 @@ export const OptionsSchema = Joi.object({
|
||||||
showLastUpdateAuthor: Joi.bool().default(
|
showLastUpdateAuthor: Joi.bool().default(
|
||||||
DEFAULT_OPTIONS.showLastUpdateAuthor,
|
DEFAULT_OPTIONS.showLastUpdateAuthor,
|
||||||
),
|
),
|
||||||
// TODO deprecated, excludeNextVersionDocs replaced by includeCurrentVersion
|
|
||||||
excludeNextVersionDocs: Joi.bool().default(
|
|
||||||
DEFAULT_OPTIONS.excludeNextVersionDocs,
|
|
||||||
),
|
|
||||||
includeCurrentVersion: Joi.bool().default(
|
includeCurrentVersion: Joi.bool().default(
|
||||||
DEFAULT_OPTIONS.includeCurrentVersion,
|
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);
|
const normalizedOptions = validate(OptionsSchema, options);
|
||||||
|
|
||||||
if (normalizedOptions.admonitions) {
|
if (normalizedOptions.admonitions) {
|
||||||
|
|
|
@ -85,7 +85,6 @@ export type PluginOptions = MetadataOptions &
|
||||||
docItemComponent: string;
|
docItemComponent: string;
|
||||||
admonitions: Record<string, unknown>;
|
admonitions: Record<string, unknown>;
|
||||||
disableVersioning: boolean;
|
disableVersioning: boolean;
|
||||||
excludeNextVersionDocs?: boolean;
|
|
||||||
includeCurrentVersion: boolean;
|
includeCurrentVersion: boolean;
|
||||||
sidebarItemsGenerator: SidebarItemsGeneratorOption;
|
sidebarItemsGenerator: SidebarItemsGeneratorOption;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue