@openrewrite/types
Advanced tools
+7
-0
@@ -5,2 +5,9 @@ # Changelog | ||
| ### [0.0.19](https://github.com/openrewrite/typescript-types/compare/v0.0.18...v0.0.19) (2021-10-06) | ||
| ### Features | ||
| * add RecipeConstructor ([5fcc5ba](https://github.com/openrewrite/typescript-types/commit/5fcc5ba21102052b29b94fe6ec53698f6b6d46a4)) | ||
| ### [0.0.18](https://github.com/openrewrite/typescript-types/compare/v0.0.17...v0.0.18) (2021-10-05) | ||
@@ -7,0 +14,0 @@ |
@@ -1,3 +0,4 @@ | ||
| import { RecipeOptionsDescriptor, CategoryDescriptor } from './openrewrite'; | ||
| import { RecipeOptionsDescriptor, RecipeConstructor } from './openrewrite'; | ||
| import 'reflect-metadata'; | ||
| import { RecipeOptions } from '..'; | ||
@@ -22,3 +23,3 @@ type Constructor<T = any> = { new (...args: any[]): T }; | ||
| public static meta = { | ||
| ...(constructor as any)['meta'], | ||
| ...(constructor as RecipeConstructor).meta, | ||
| category: arg.category | ||
@@ -46,2 +47,6 @@ }; | ||
| } | ||
| public static getOptions(): RecipeOptions { | ||
| return this.meta.options; | ||
| } | ||
| }; | ||
@@ -48,0 +53,0 @@ }; |
@@ -161,2 +161,7 @@ export type Maybe<T> = T | null; | ||
| export interface RecipeConstructor { | ||
| new (options?: any): Recipe; | ||
| meta?: any; | ||
| } | ||
| export class Recipe<Options = { [key: string]: any }> { | ||
@@ -163,0 +168,0 @@ public recipeList: RecipeListEntry[] = []; |
+3
-4
| { | ||
| "name": "@openrewrite/types", | ||
| "version": "0.0.18", | ||
| "version": "0.0.19", | ||
| "description": "Various Typescript types to aid in OpenRewrite recipe development", | ||
@@ -15,7 +15,6 @@ "license": "Apache-2.0", | ||
| "devDependencies": { | ||
| "@types/reflect-metadata": "^0.1.0", | ||
| "cz-conventional-changelog": "3.3.0", | ||
| "prettier": "2.3.2", | ||
| "standard-version": "9.3.1", | ||
| "typescript": "4.3.5" | ||
| "typescript": "4.4.3" | ||
| }, | ||
@@ -28,4 +27,4 @@ "config": { | ||
| "dependencies": { | ||
| "reflect-metadata": "^0.1.13" | ||
| "reflect-metadata": "0.1.13" | ||
| } | ||
| } |
65119
0.67%4
-20%1109
0.73%+ Added
- Removed
Updated