@prostojs/mate 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -58,6 +58,8 @@ console.log(mate.read(MyClass, 'methodName'))
58
58
 
59
59
  ## Constructor Params Decorators
60
60
 
61
+ `params[].type` are filled from `design:paramtypes` automatically
62
+
61
63
  ```ts
62
64
  import { Mate } from '@prostojs/mate'
63
65
  const mate = new Mate('my-metadata-key')
@@ -80,6 +82,8 @@ console.log(mate.read(MyClass))
80
82
 
81
83
  ## Method Params Decorators
82
84
 
85
+ `params[].type` are filled from `design:paramtypes` automatically
86
+
83
87
  ```ts
84
88
  import { Mate } from '@prostojs/mate'
85
89
  const mate = new Mate('my-metadata-key')
@@ -112,7 +116,10 @@ interface MyMeta extends TProstoMetadata {
112
116
  n: number
113
117
  simple: boolean
114
118
  }
115
- const mate = new Mate<MyMeta>('my-metadata-key')
119
+ const mate = new Mate<MyMeta>('my-metadata-key', {
120
+ readReturnType: true, // to copy `design:returntype` -> `returnType` of metadata object
121
+ readType: true, // to copy `design:type` -> `type` of metadata object
122
+ })
116
123
 
117
124
  // Example of simple decorator
118
125
  const SimpleDecorator = mate.decorate('simple', true)
@@ -22,12 +22,19 @@ function isConstructor(v) {
22
22
 
23
23
  require('reflect-metadata');
24
24
  class Mate {
25
- constructor(workspace) {
25
+ constructor(workspace, options = {}) {
26
26
  this.workspace = workspace;
27
+ this.options = options;
27
28
  }
28
29
  set(args, key, value, isArray) {
29
30
  var _a;
30
31
  let meta = Reflect.getMetadata(this.workspace, args.target, args.propKey) || {};
32
+ if (args.propKey && this.options.readReturnType && !meta.returnType) {
33
+ meta.returnType = Reflect.getMetadata('design:returntype', args.target, args.propKey);
34
+ }
35
+ if (args.propKey && this.options.readType && !meta.type) {
36
+ meta.type = Reflect.getMetadata('design:type', args.target, args.propKey);
37
+ }
31
38
  const { index } = args;
32
39
  const cb = typeof key === 'function' ? key : undefined;
33
40
  let data = meta;
package/dist/mate.d.ts CHANGED
@@ -1,10 +1,11 @@
1
1
  export declare function getConstructor<T = TObject>(instance: T): TFunction;
2
2
 
3
- export declare function isConstructor<T = TAny>(v: T): v is T & TClassConstructor;
3
+ export declare function isConstructor<T = TAny>(v: T): v is (T & TClassConstructor);
4
4
 
5
5
  export declare class Mate<T extends TProstoMetadata = TProstoMetadata> {
6
6
  protected workspace: string;
7
- constructor(workspace: string);
7
+ protected options: TMateOptions;
8
+ constructor(workspace: string, options?: TMateOptions);
8
9
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, cb: ((meta: R & RP) => R & RP)): void;
9
10
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, key: keyof R | keyof RP, value: ((R & RP)[keyof R] & (R & RP)[keyof RP]) | undefined): void;
10
11
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, key: keyof R | keyof RP, value: ((R & RP)[keyof R] & (R & RP)[keyof RP]) | undefined, isArray: boolean | undefined): void;
@@ -21,6 +22,11 @@ declare type TClassConstructor<T = unknown> = new (...args: TAny[]) => T;
21
22
 
22
23
  declare type TFunction = Function;
23
24
 
25
+ export declare interface TMateOptions {
26
+ readReturnType?: boolean;
27
+ readType?: boolean;
28
+ }
29
+
24
30
  export declare interface TMergedDecoratorArgs {
25
31
  target: TFunction | TObject;
26
32
  propKey?: string | symbol;
@@ -32,10 +38,12 @@ declare type TObject = object;
32
38
 
33
39
  export declare interface TProstoMetadata<TParams extends TProstoParamsMetadata = TProstoParamsMetadata> {
34
40
  params: TParams[];
41
+ type?: TFunction;
42
+ returnType?: TFunction;
35
43
  }
36
44
 
37
45
  export declare interface TProstoParamsMetadata {
38
- type: TFunction;
46
+ type?: TFunction;
39
47
  }
40
48
 
41
49
  export { }
@@ -1 +1 @@
1
- function e(e){console.error(`[prostojs/mate][${(new Date).toISOString().replace("T"," ").replace(/\.\d{3}z$/i,"")}] `+e+"")}function t(e){return Object.getPrototypeOf(e).constructor}function r(e){return"function"==typeof e&&Object.getOwnPropertyNames(e).includes("prototype")&&!Object.getOwnPropertyNames(e).includes("caller")&&!!e.name}require("reflect-metadata");class a{constructor(e){this.workspace=e}set(t,r,a,o){var p;let n=Reflect.getMetadata(this.workspace,t.target,t.propKey)||{};const{index:s}=t,c="function"==typeof r?r:void 0;let i=n;if(i.params||(i.params=null===(p=Reflect.getMetadata("design:paramtypes",t.target,t.propKey))||void 0===p?void 0:p.map((e=>({type:e})))),"number"==typeof s&&(i.params=i.params||[],i.params[s]=i.params[s]||{type:void 0},c?i.params[s]=c(i.params[s]):i=i.params[s]),"function"!=typeof r)if(o){const t=i[r]||[];Array.isArray(t)||(e(f="Mate.add (isArray=true) called for non-array metadata"),new Error(f)),t.unshift(a),i[r]=t}else i[r]=a;else c&&"number"!=typeof s&&(n=c(i));var f;Reflect.defineMetadata(this.workspace,n,t.target,t.propKey)}read(e,a){return Reflect.getMetadata(this.workspace,"string"==typeof a?r(e)?e.prototype:e:r(e)?e:t(e),a)}apply(...e){return(t,r,a)=>{for(const o of e)o(t,r,a)}}decorate(e,t,r){return(a,o,p)=>{this.set({target:a,propKey:o,descriptor:"number"==typeof p?void 0:p,index:"number"==typeof p?p:void 0},e,t,r)}}}export{a as Mate,t as getConstructor,r as isConstructor};
1
+ function e(e){console.error(`[prostojs/mate][${(new Date).toISOString().replace("T"," ").replace(/\.\d{3}z$/i,"")}] `+e+"")}function t(e){return Object.getPrototypeOf(e).constructor}function r(e){return"function"==typeof e&&Object.getOwnPropertyNames(e).includes("prototype")&&!Object.getOwnPropertyNames(e).includes("caller")&&!!e.name}require("reflect-metadata");class a{constructor(e,t={}){this.workspace=e,this.options=t}set(t,r,a,o){var p;let n=Reflect.getMetadata(this.workspace,t.target,t.propKey)||{};t.propKey&&this.options.readReturnType&&!n.returnType&&(n.returnType=Reflect.getMetadata("design:returntype",t.target,t.propKey)),t.propKey&&this.options.readType&&!n.type&&(n.type=Reflect.getMetadata("design:type",t.target,t.propKey));const{index:s}=t,i="function"==typeof r?r:void 0;let c=n;if(c.params||(c.params=null===(p=Reflect.getMetadata("design:paramtypes",t.target,t.propKey))||void 0===p?void 0:p.map((e=>({type:e})))),"number"==typeof s&&(c.params=c.params||[],c.params[s]=c.params[s]||{type:void 0},i?c.params[s]=i(c.params[s]):c=c.params[s]),"function"!=typeof r)if(o){const t=c[r]||[];Array.isArray(t)||(e(y="Mate.add (isArray=true) called for non-array metadata"),new Error(y)),t.unshift(a),c[r]=t}else c[r]=a;else i&&"number"!=typeof s&&(n=i(c));var y;Reflect.defineMetadata(this.workspace,n,t.target,t.propKey)}read(e,a){return Reflect.getMetadata(this.workspace,"string"==typeof a?r(e)?e.prototype:e:r(e)?e:t(e),a)}apply(...e){return(t,r,a)=>{for(const o of e)o(t,r,a)}}decorate(e,t,r){return(a,o,p)=>{this.set({target:a,propKey:o,descriptor:"number"==typeof p?void 0:p,index:"number"==typeof p?p:void 0},e,t,r)}}}export{a as Mate,t as getConstructor,r as isConstructor};
@@ -18,12 +18,19 @@ function isConstructor(v) {
18
18
 
19
19
  require('reflect-metadata');
20
20
  class Mate {
21
- constructor(workspace) {
21
+ constructor(workspace, options = {}) {
22
22
  this.workspace = workspace;
23
+ this.options = options;
23
24
  }
24
25
  set(args, key, value, isArray) {
25
26
  var _a;
26
27
  let meta = Reflect.getMetadata(this.workspace, args.target, args.propKey) || {};
28
+ if (args.propKey && this.options.readReturnType && !meta.returnType) {
29
+ meta.returnType = Reflect.getMetadata('design:returntype', args.target, args.propKey);
30
+ }
31
+ if (args.propKey && this.options.readType && !meta.type) {
32
+ meta.type = Reflect.getMetadata('design:type', args.target, args.propKey);
33
+ }
27
34
  const { index } = args;
28
35
  const cb = typeof key === 'function' ? key : undefined;
29
36
  let data = meta;
@@ -1 +1 @@
1
- var ProstoMate=function(e){"use strict";function t(e){console.error(`[prostojs/mate][${(new Date).toISOString().replace("T"," ").replace(/\.\d{3}z$/i,"")}] `+e+"")}function r(e){return Object.getPrototypeOf(e).constructor}function a(e){return"function"==typeof e&&Object.getOwnPropertyNames(e).includes("prototype")&&!Object.getOwnPropertyNames(e).includes("caller")&&!!e.name}require("reflect-metadata");return e.Mate=class{constructor(e){this.workspace=e}set(e,r,a,o){var n;let s=Reflect.getMetadata(this.workspace,e.target,e.propKey)||{};const{index:p}=e,c="function"==typeof r?r:void 0;let i=s;if(i.params||(i.params=null===(n=Reflect.getMetadata("design:paramtypes",e.target,e.propKey))||void 0===n?void 0:n.map((e=>({type:e})))),"number"==typeof p&&(i.params=i.params||[],i.params[p]=i.params[p]||{type:void 0},c?i.params[p]=c(i.params[p]):i=i.params[p]),"function"!=typeof r)if(o){const e=i[r]||[];Array.isArray(e)||(t(u="Mate.add (isArray=true) called for non-array metadata"),new Error(u)),e.unshift(a),i[r]=e}else i[r]=a;else c&&"number"!=typeof p&&(s=c(i));var u;Reflect.defineMetadata(this.workspace,s,e.target,e.propKey)}read(e,t){return Reflect.getMetadata(this.workspace,"string"==typeof t?a(e)?e.prototype:e:a(e)?e:r(e),t)}apply(...e){return(t,r,a)=>{for(const o of e)o(t,r,a)}}decorate(e,t,r){return(a,o,n)=>{this.set({target:a,propKey:o,descriptor:"number"==typeof n?void 0:n,index:"number"==typeof n?n:void 0},e,t,r)}}},e.getConstructor=r,e.isConstructor=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
1
+ var ProstoMate=function(e){"use strict";function t(e){console.error(`[prostojs/mate][${(new Date).toISOString().replace("T"," ").replace(/\.\d{3}z$/i,"")}] `+e+"")}function r(e){return Object.getPrototypeOf(e).constructor}function a(e){return"function"==typeof e&&Object.getOwnPropertyNames(e).includes("prototype")&&!Object.getOwnPropertyNames(e).includes("caller")&&!!e.name}require("reflect-metadata");return e.Mate=class{constructor(e,t={}){this.workspace=e,this.options=t}set(e,r,a,o){var p;let n=Reflect.getMetadata(this.workspace,e.target,e.propKey)||{};e.propKey&&this.options.readReturnType&&!n.returnType&&(n.returnType=Reflect.getMetadata("design:returntype",e.target,e.propKey)),e.propKey&&this.options.readType&&!n.type&&(n.type=Reflect.getMetadata("design:type",e.target,e.propKey));const{index:s}=e,i="function"==typeof r?r:void 0;let c=n;if(c.params||(c.params=null===(p=Reflect.getMetadata("design:paramtypes",e.target,e.propKey))||void 0===p?void 0:p.map((e=>({type:e})))),"number"==typeof s&&(c.params=c.params||[],c.params[s]=c.params[s]||{type:void 0},i?c.params[s]=i(c.params[s]):c=c.params[s]),"function"!=typeof r)if(o){const e=c[r]||[];Array.isArray(e)||(t(y="Mate.add (isArray=true) called for non-array metadata"),new Error(y)),e.unshift(a),c[r]=e}else c[r]=a;else i&&"number"!=typeof s&&(n=i(c));var y;Reflect.defineMetadata(this.workspace,n,e.target,e.propKey)}read(e,t){return Reflect.getMetadata(this.workspace,"string"==typeof t?a(e)?e.prototype:e:a(e)?e:r(e),t)}apply(...e){return(t,r,a)=>{for(const o of e)o(t,r,a)}}decorate(e,t,r){return(a,o,p)=>{this.set({target:a,propKey:o,descriptor:"number"==typeof p?void 0:p,index:"number"==typeof p?p:void 0},e,t,r)}}},e.getConstructor=r,e.isConstructor=a,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
@@ -8,13 +8,20 @@ export interface TMergedDecoratorArgs {
8
8
  }
9
9
  export interface TProstoMetadata<TParams extends TProstoParamsMetadata = TProstoParamsMetadata> {
10
10
  params: TParams[];
11
+ type?: TFunction;
12
+ returnType?: TFunction;
11
13
  }
12
14
  export interface TProstoParamsMetadata {
13
- type: TFunction;
15
+ type?: TFunction;
16
+ }
17
+ export interface TMateOptions {
18
+ readReturnType?: boolean;
19
+ readType?: boolean;
14
20
  }
15
21
  export declare class Mate<T extends TProstoMetadata = TProstoMetadata> {
16
22
  protected workspace: string;
17
- constructor(workspace: string);
23
+ protected options: TMateOptions;
24
+ constructor(workspace: string, options?: TMateOptions);
18
25
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, cb: ((meta: R & RP) => R & RP)): void;
19
26
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, key: keyof R | keyof RP, value: ((R & RP)[keyof R] & (R & RP)[keyof RP]) | undefined): void;
20
27
  set<R extends T = T, RP = R['params'][0]>(args: TMergedDecoratorArgs, key: keyof R | keyof RP, value: ((R & RP)[keyof R] & (R & RP)[keyof RP]) | undefined, isArray: boolean | undefined): void;
@@ -1 +1 @@
1
- {"version":3,"file":"mate.d.ts","sourceRoot":"","sources":["../../src/mate.ts"],"names":[],"mappings":"AACA,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,MAAK,SAAS,CAAA;AAGjD,MAAM,WAAW,oBAAoB;IACjC,MAAM,EAAE,SAAS,GAAG,OAAO,CAAA;IAC3B,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,UAAU,CAAC,EAAE,uBAAuB,CAAC,IAAI,CAAC,CAAA;IAC1C,KAAK,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,eAAe,CAAC,OAAO,SAAS,qBAAqB,GAAG,qBAAqB;IAC1F,MAAM,EAAE,OAAO,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,qBAAqB;IAClC,IAAI,EAAE,SAAS,CAAA;CAClB;AAED,qBAAa,IAAI,CAAC,CAAC,SAAS,eAAe,GAAG,eAAe;IAC7C,SAAS,CAAC,SAAS,EAAE,MAAM;gBAAjB,SAAS,EAAE,MAAM;IAEvC,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACpC,IAAI,EAAE,oBAAoB,EAC1B,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,GAC/B,IAAI;IAEP,GAAG,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC,QAAQ,C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AC,QAAQ,CAAC,CAAC,CAAC,CAAC,EACzC,GAAG,EAAG,MAAM,CAAC,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,EAAE,CAAC,EACrD,KAAK,EAAE,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,GAAG,SAAS,EAC3D,OAAO,EAAE,OAAO,GAAG,SAAS,GAC7B,eAAe,GAAG,cAAc,GAAG,kBAAkB;CAiB3D"}
@@ -1,6 +1,6 @@
1
1
  export declare class DecoratorHelpersTestClass {
2
2
  constructor(_a: string);
3
- test(_b: string): void;
3
+ test(_b: string): string;
4
4
  viaCB(_c: string): void;
5
5
  }
6
6
  export declare class DecoratorHelpersTestClass2 {
@@ -1 +1 @@
1
- {"version":3,"file":"mate.artifacts.d.ts","sourceRoot":"","sources":["../../../src/tests/mate.artifacts.ts"],"names":[],"mappings":"AASA,qBAGa,yBAAyB;gBAK1B,EAAE,EAAE,MAAM;IAQlB,IAAI,CAII,EAAE,EAAE,MAAM;IAgBlB,KAAK,CAMG,EAAE,EAAE,MAAM;CAGrB;AAED,qBACa,0BAA0B;IAInC,IAAI;CAGP"}
1
+ {"version":3,"file":"mate.artifacts.d.ts","sourceRoot":"","sources":["../../../src/tests/mate.artifacts.ts"],"names":[],"mappings":"AAYA,qBAGa,yBAAyB;gBAK1B,EAAE,EAAE,MAAM;IAQlB,IAAI,CAII,EAAE,EAAE,MAAM,GAAG,MAAM;IAgB3B,KAAK,CAMG,EAAE,EAAE,MAAM;CAGrB;AAED,qBACa,0BAA0B;IAInC,IAAI;CAGP"}
@@ -1,4 +1,4 @@
1
1
  import { TAny, TClassConstructor, TFunction, TObject } from '../types';
2
2
  export declare function getConstructor<T = TObject>(instance: T): TFunction;
3
- export declare function isConstructor<T = TAny>(v: T): v is T & TClassConstructor;
3
+ export declare function isConstructor<T = TAny>(v: T): v is (T & TClassConstructor);
4
4
  //# sourceMappingURL=helpers.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEtE,wBAAgB,cAAc,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,SAAS,CAGlE;AAED,wBAAgB,aAAa,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,iBAAiB,CAExE"}
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,iBAAiB,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAEtE,wBAAgB,cAAc,CAAC,CAAC,GAAG,OAAO,EAAE,QAAQ,EAAE,CAAC,GAAG,SAAS,CAGlE;AAED,wBAAgB,aAAa,CAAC,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,iBAAiB,CAAC,CAE1E"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@prostojs/mate",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "MATE is TS Metadata Organizer",
5
5
  "main": "index.js",
6
6
  "module": "dist/mate.esm-bundler.js",
@@ -52,16 +52,16 @@
52
52
  },
53
53
  "homepage": "https://github.com/prostojs/mate#readme",
54
54
  "devDependencies": {
55
- "@microsoft/api-extractor": "^7.15.1",
56
- "@prostojs/dye": "^0.2.0",
55
+ "@microsoft/api-extractor": "^7.30.0",
56
+ "@prostojs/dye": "^0.3.0",
57
57
  "@rollup/plugin-commonjs": "^21.0.0",
58
58
  "@rollup/plugin-node-resolve": "^13.0.6",
59
59
  "@rollup/plugin-replace": "^3.0.0",
60
- "@types/jest": "^27.0.2",
61
- "@types/node": "^16.10.3",
60
+ "@types/jest": "^27.5.2",
61
+ "@types/node": "^16.11.57",
62
62
  "@typescript-eslint/eslint-plugin": "^4.33.0",
63
63
  "@typescript-eslint/parser": "^4.33.0",
64
- "brotli": "^1.3.2",
64
+ "brotli": "^1.3.3",
65
65
  "conventional-changelog": "^3.1.24",
66
66
  "conventional-changelog-cli": "^2.1.1",
67
67
  "enquirer": "^2.3.6",
@@ -71,15 +71,15 @@
71
71
  "execa": "^5.1.1",
72
72
  "fs-extra": "^10.0.0",
73
73
  "jest": "^27.2.5",
74
- "minimist": "^1.2.5",
74
+ "minimist": "^1.2.6",
75
75
  "rollup": "^2.58.0",
76
76
  "rollup-plugin-terser": "^7.0.2",
77
77
  "rollup-plugin-typescript2": "^0.30.0",
78
78
  "semver": "^7.3.5",
79
79
  "ts-jest": "^27.0.5",
80
- "ts-node": "^10.8.2",
80
+ "ts-node": "^10.9.1",
81
81
  "tslib": "^2.3.1",
82
- "typescript": "^4.4.3",
82
+ "typescript": "^4.8.2",
83
83
  "yorkie": "^2.0.0",
84
84
  "zlib": "^1.0.5"
85
85
  }