From 19c65c34f4ca2be147d17e82ce96d7de20225809 Mon Sep 17 00:00:00 2001 From: Gerrit Birkeland Date: Tue, 17 Mar 2020 20:42:02 -0600 Subject: [PATCH] chore!: Remove deprecated Option decorator --- src/index.ts | 1 - src/lib/application.ts | 3 -- src/lib/utils/index.ts | 1 - src/lib/utils/options/index.ts | 1 - src/lib/utils/options/sources/decorator.ts | 35 ---------------------- src/lib/utils/options/sources/index.ts | 1 - tsconfig.json | 1 - 7 files changed, 43 deletions(-) delete mode 100644 src/lib/utils/options/sources/decorator.ts diff --git a/src/index.ts b/src/index.ts index dee3c33c8..604b9d6e0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -12,7 +12,6 @@ export { NavigationItem } from './lib/output/models/NavigationItem'; export { UrlMapping } from './lib/output/models/UrlMapping'; export { - Option, // deprecated BindOption, Options, OptionsReader, diff --git a/src/lib/application.ts b/src/lib/application.ts index 86d6f4b47..b2cf9fdeb 100644 --- a/src/lib/application.ts +++ b/src/lib/application.ts @@ -25,7 +25,6 @@ import { } from './utils/component'; import { Options, BindOption } from './utils'; import { TypeDocAndTSOptions } from './utils/options/declaration'; -import { addDecoratedOptions } from './utils/options/sources'; /** * The default TypeDoc main application class. @@ -129,8 +128,6 @@ export class Application extends ChildableComponent< } this.plugins.load(); - // Load decorated options from the plugins. - addDecoratedOptions(this.options); this.options.reset(); this.options.setValues(options).mapErr(errors => { diff --git a/src/lib/utils/index.ts b/src/lib/utils/index.ts index f755dc444..b2a0ca4d6 100644 --- a/src/lib/utils/index.ts +++ b/src/lib/utils/index.ts @@ -1,5 +1,4 @@ export { - Option, Options, ParameterType, ParameterHint, diff --git a/src/lib/utils/options/index.ts b/src/lib/utils/options/index.ts index 92275d7b3..99b7215d3 100644 --- a/src/lib/utils/options/index.ts +++ b/src/lib/utils/options/index.ts @@ -1,5 +1,4 @@ export { Options, OptionsReader, BindOption } from './options'; -export { Option } from './sources'; export { ArgumentsReader, TypeDocReader, TSConfigReader } from './readers'; export { TypeDocOptions, diff --git a/src/lib/utils/options/sources/decorator.ts b/src/lib/utils/options/sources/decorator.ts deleted file mode 100644 index b8b4b990a..000000000 --- a/src/lib/utils/options/sources/decorator.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { DeclarationOption } from '../declaration'; -import { Options } from '..'; -import { Application } from '../../../application'; - -const declared: DeclarationOption[] = []; - -export function addDecoratedOptions(options: Options) { - options.addDeclarations(declared); -} - -/** - * Declares the given option and binds it to the decorated property without strict checks. - * - * @deprecated Options should be declared on the options object. Will be removed in 0.17. - * @param option - */ -export function Option(option: DeclarationOption) { - console.warn('The @Option decorator is deprecated and will be removed in v0.17.'); - console.warn(` (Used to register ${option.name})`); - declared.push(option); - - return function(target: { application: Application } | { options: Options }, key: PropertyKey) { - Object.defineProperty(target, key, { - get(this: { application: Application } | { options: Options }) { - if ('options' in this) { - return this.options.getValue(name); - } else { - return this.application.options.getValue(name); - } - }, - enumerable: true, - configurable: true - }); - }; -} diff --git a/src/lib/utils/options/sources/index.ts b/src/lib/utils/options/sources/index.ts index bb350e33c..07789dc45 100644 --- a/src/lib/utils/options/sources/index.ts +++ b/src/lib/utils/options/sources/index.ts @@ -1,3 +1,2 @@ -export { addDecoratedOptions, Option } from './decorator'; export { addTSOptions } from './typescript'; export { addTypeDocOptions } from './typedoc'; diff --git a/tsconfig.json b/tsconfig.json index b101df1fd..4b36c267a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,6 @@ "compilerOptions": { "module": "commonjs", "lib": [ - "dom", "es5", "es2015.core", "es2015.collection",