From 508f8bafb1ae6266f15869180f8e56317ebbeddc Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Tue, 17 Mar 2020 20:46:00 -0600 Subject: [PATCH] chore: Add warnings for deprecated usage --- src/lib/converter/plugins/CommentPlugin.ts | 6 ++++++ src/lib/utils/options/readers/typedoc.ts | 1 + 2 files changed, 7 insertions(+) diff --git a/src/lib/converter/plugins/CommentPlugin.ts b/src/lib/converter/plugins/CommentPlugin.ts index 2c4e3cb9b..abcee12f3 100644 --- a/src/lib/converter/plugins/CommentPlugin.ts +++ b/src/lib/converter/plugins/CommentPlugin.ts @@ -358,6 +358,8 @@ export class CommentPlugin extends ConverterComponent { * @param tagName The name of the that that should be removed. */ static removeTags(comment: Comment | undefined, tagName: string) { + // Can't use a logger here, we don't have one. + console.warn('Using deprecated function removeTags. This function will be removed in the next minor release.'); comment?.removeTags(tagName); } @@ -367,6 +369,8 @@ export class CommentPlugin extends ConverterComponent { * Warn in 0.17, remove in 0.18 */ static removeReflections(project: ProjectReflection, reflections: Reflection[]) { + // Can't use a logger here, we don't have one. + console.warn('Using deprecated function removeReflections. This function will be removed in the next minor release.'); for (const reflection of reflections) { project.removeReflection(reflection, true); } @@ -378,6 +382,8 @@ export class CommentPlugin extends ConverterComponent { * Warn in 0.17, remove in 0.18 */ static removeReflection(project: ProjectReflection, reflection: Reflection) { + // Can't use a logger here, we don't have one. + console.warn('Using deprecated function removeReflections. This function will be removed in the next minor release.'); project.removeReflection(reflection, true); } diff --git a/src/lib/utils/options/readers/typedoc.ts b/src/lib/utils/options/readers/typedoc.ts index 44cb5f6af..44b867a43 100644 --- a/src/lib/utils/options/readers/typedoc.ts +++ b/src/lib/utils/options/readers/typedoc.ts @@ -69,6 +69,7 @@ export class TypeDocReader implements OptionsReader { // deprecate: data.src is alias to inputFiles as of 0.16, warn in 0.17, remove in 0.19 if ('src' in data && !('inputFiles' in data)) { + logger.warn('The `src` configuration option has been deprecated in favor of `inputFiles` and will be removed in a future release.'); data['inputFiles'] = getStringArray(data['src']); delete data['src']; }