react-obsidian 2.16.0 → 2.17.0

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.
Files changed (52) hide show
  1. package/dist/src/decorators/Graph.d.ts +1 -1
  2. package/dist/src/decorators/Graph.js +2 -2
  3. package/dist/src/decorators/LifecycleBound.d.ts +1 -1
  4. package/dist/src/decorators/LifecycleBound.js +2 -2
  5. package/dist/src/decorators/Singleton.d.ts +1 -1
  6. package/dist/src/decorators/Singleton.js +3 -3
  7. package/dist/src/decorators/Singleton.js.map +1 -1
  8. package/dist/src/decorators/inject/Inject.d.ts +1 -1
  9. package/dist/src/decorators/inject/Inject.js +2 -2
  10. package/dist/src/decorators/inject/Injectable.d.ts +1 -1
  11. package/dist/src/decorators/inject/Injectable.js +2 -2
  12. package/dist/src/decorators/inject/LateInject.d.ts +1 -1
  13. package/dist/src/decorators/inject/LateInject.js +2 -2
  14. package/dist/src/decorators/provides/Provides.d.ts +1 -1
  15. package/dist/src/decorators/provides/Provides.d.ts.map +1 -1
  16. package/dist/src/decorators/provides/Provides.js +3 -3
  17. package/dist/src/decorators/provides/Provides.js.map +1 -1
  18. package/dist/src/index.d.ts +42 -7
  19. package/dist/src/index.d.ts.map +1 -1
  20. package/dist/src/index.js +50 -15
  21. package/dist/src/index.js.map +1 -1
  22. package/dist/test/fixtures/LifecycleBoundGraph.d.ts.map +1 -1
  23. package/dist/test/fixtures/LifecycleBoundGraph.js +4 -5
  24. package/dist/test/fixtures/LifecycleBoundGraph.js.map +1 -1
  25. package/dist/test/fixtures/LifecycleBoundWithLifecycleBoundSubgraph.d.ts.map +1 -1
  26. package/dist/test/fixtures/LifecycleBoundWithLifecycleBoundSubgraph.js +3 -4
  27. package/dist/test/fixtures/LifecycleBoundWithLifecycleBoundSubgraph.js.map +1 -1
  28. package/dist/test/fixtures/ScopedLifecycleBoundGraph.d.ts.map +1 -1
  29. package/dist/test/fixtures/ScopedLifecycleBoundGraph.js +2 -3
  30. package/dist/test/fixtures/ScopedLifecycleBoundGraph.js.map +1 -1
  31. package/dist/test/fixtures/SingletonGraph.js +3 -3
  32. package/dist/transformers/babel-plugin-obsidian/helpers/index.d.ts +3 -2
  33. package/dist/transformers/babel-plugin-obsidian/helpers/index.d.ts.map +1 -1
  34. package/dist/transformers/babel-plugin-obsidian/helpers/index.js +11 -4
  35. package/dist/transformers/babel-plugin-obsidian/helpers/index.js.map +1 -1
  36. package/dist/transformers/babel-plugin-obsidian/index.d.ts.map +1 -1
  37. package/dist/transformers/babel-plugin-obsidian/index.js +5 -0
  38. package/dist/transformers/babel-plugin-obsidian/index.js.map +1 -1
  39. package/dist/transformers/babel-plugin-obsidian/unmagler/property.js +1 -1
  40. package/dist/transformers/babel-plugin-obsidian/unmagler/property.js.map +1 -1
  41. package/package.json +1 -1
  42. package/src/decorators/Graph.ts +1 -1
  43. package/src/decorators/LifecycleBound.ts +1 -1
  44. package/src/decorators/Singleton.ts +3 -3
  45. package/src/decorators/inject/Inject.ts +1 -1
  46. package/src/decorators/inject/Injectable.ts +1 -1
  47. package/src/decorators/inject/LateInject.ts +1 -1
  48. package/src/decorators/provides/Provides.ts +2 -2
  49. package/src/index.ts +44 -7
  50. package/transformers/babel-plugin-obsidian/helpers/index.ts +11 -3
  51. package/transformers/babel-plugin-obsidian/index.ts +5 -1
  52. package/transformers/babel-plugin-obsidian/unmagler/property.ts +2 -2
@@ -3,6 +3,6 @@ import { ObjectGraph } from '../graph/ObjectGraph';
3
3
  interface GraphParams {
4
4
  subgraphs: Constructable<ObjectGraph>[];
5
5
  }
6
- export declare function Graph({ subgraphs }?: Partial<GraphParams>): (constructor: any) => any;
6
+ export declare function graph({ subgraphs }?: Partial<GraphParams>): (constructor: any) => any;
7
7
  export {};
8
8
  //# sourceMappingURL=Graph.d.ts.map
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Graph = Graph;
6
+ exports.graph = graph;
7
7
  const GraphRegistry_1 = __importDefault(require("../graph/registry/GraphRegistry"));
8
- function Graph({ subgraphs = [] } = {}) {
8
+ function graph({ subgraphs = [] } = {}) {
9
9
  return (constructor) => {
10
10
  GraphRegistry_1.default.register(constructor, subgraphs);
11
11
  return constructor;
@@ -1,6 +1,6 @@
1
1
  type Options = {
2
2
  scope?: 'component' | 'feature' | (string & {});
3
3
  };
4
- export declare function LifecycleBound(options?: Options): (constructor: any) => any;
4
+ export declare function lifecycleBound(options?: Options): (constructor: any) => any;
5
5
  export {};
6
6
  //# sourceMappingURL=LifecycleBound.d.ts.map
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.LifecycleBound = LifecycleBound;
3
+ exports.lifecycleBound = lifecycleBound;
4
4
  const reflect_1 = require("../utils/reflect");
5
- function LifecycleBound(options) {
5
+ function lifecycleBound(options) {
6
6
  return (constructor) => {
7
7
  var _a;
8
8
  reflect_1.Reflect.defineMetadata('isLifecycleBound', true, constructor);
@@ -1,4 +1,4 @@
1
1
  import { Constructable } from '../types';
2
2
  import { ObjectGraph } from '../graph/ObjectGraph';
3
- export declare function Singleton(): (constructorOrGraph: Constructable<ObjectGraph> | ObjectGraph, _property?: string, descriptor?: PropertyDescriptor) => any;
3
+ export declare function singleton(): (constructorOrGraph: Constructable<ObjectGraph> | ObjectGraph, _property?: string, descriptor?: PropertyDescriptor) => any;
4
4
  //# sourceMappingURL=Singleton.d.ts.map
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Singleton = Singleton;
3
+ exports.singleton = singleton;
4
4
  const reflect_1 = require("../utils/reflect");
5
- function Singleton() {
6
- return function singleton(constructorOrGraph, _property, descriptor) {
5
+ function singleton() {
6
+ return (constructorOrGraph, _property, descriptor) => {
7
7
  const target = descriptor || constructorOrGraph;
8
8
  reflect_1.Reflect.defineMetadata('isSingleton', true, target);
9
9
  return target;
@@ -1 +1 @@
1
- {"version":3,"file":"Singleton.js","sourceRoot":"","sources":["../../../src/decorators/Singleton.ts"],"names":[],"mappings":";;AAIA,8BAUC;AAZD,8CAAyC;AAEzC,SAAgB,SAAS;IACvB,OAAO,SAAS,SAAS,CACvB,kBAA4D,EAC5D,SAAkB,EAClB,UAA+B;QAE/B,MAAM,MAAM,GAAG,UAAU,IAAI,kBAAkB,CAAC;QAChD,iBAAO,CAAC,cAAc,CAAC,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"Singleton.js","sourceRoot":"","sources":["../../../src/decorators/Singleton.ts"],"names":[],"mappings":";;AAIA,8BAUC;AAZD,8CAAyC;AAEzC,SAAgB,SAAS;IACvB,OAAO,CACL,kBAA4D,EAC5D,SAAkB,EAClB,UAA+B,EAC1B,EAAE;QACP,MAAM,MAAM,GAAG,UAAU,IAAI,kBAAkB,CAAC;QAChD,iBAAO,CAAC,cAAc,CAAC,aAAa,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;QACpD,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;AACJ,CAAC"}
@@ -1,2 +1,2 @@
1
- export declare function Inject(name?: string): (target: Object | any, _propertyKey?: string, indexOrPropertyDescriptor?: number | PropertyDescriptor) => void;
1
+ export declare function inject(name?: string): (target: Object | any, _propertyKey?: string, indexOrPropertyDescriptor?: number | PropertyDescriptor) => void;
2
2
  //# sourceMappingURL=Inject.d.ts.map
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Inject = Inject;
6
+ exports.inject = inject;
7
7
  const isNumber_1 = require("../../utils/isNumber");
8
8
  const InjectionMetadata_1 = __importDefault(require("../../injectors/class/InjectionMetadata"));
9
- function Inject(name) {
9
+ function inject(name) {
10
10
  return (target, _propertyKey, indexOrPropertyDescriptor) => {
11
11
  const metadata = new InjectionMetadata_1.default();
12
12
  if ((0, isNumber_1.isNumber)(indexOrPropertyDescriptor)) {
@@ -1,4 +1,4 @@
1
1
  import { Constructable } from '../../types';
2
2
  import { Graph } from '../../graph/Graph';
3
- export declare function Injectable(keyOrGraph: string | Constructable<Graph>): any;
3
+ export declare function injectable(keyOrGraph: string | Constructable<Graph>): any;
4
4
  //# sourceMappingURL=Injectable.d.ts.map
@@ -3,10 +3,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Injectable = Injectable;
6
+ exports.injectable = injectable;
7
7
  const GraphRegistry_1 = __importDefault(require("../../graph/registry/GraphRegistry"));
8
8
  const ClassInjector_1 = __importDefault(require("../../injectors/class/ClassInjector"));
9
- function Injectable(keyOrGraph) {
9
+ function injectable(keyOrGraph) {
10
10
  return new ClassInjector_1.default(GraphRegistry_1.default).inject(keyOrGraph);
11
11
  }
12
12
  //# sourceMappingURL=Injectable.js.map
@@ -1,2 +1,2 @@
1
- export declare function LateInject(name?: string): any;
1
+ export declare function lateInject(name?: string): any;
2
2
  //# sourceMappingURL=LateInject.d.ts.map
@@ -3,9 +3,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.LateInject = LateInject;
6
+ exports.lateInject = lateInject;
7
7
  const InjectionMetadata_1 = __importDefault(require("../../injectors/class/InjectionMetadata"));
8
- function LateInject(name) {
8
+ function lateInject(name) {
9
9
  return (target) => {
10
10
  const metadata = new InjectionMetadata_1.default();
11
11
  metadata.saveLatePropertyMetadata(target.constructor, name);
@@ -2,6 +2,6 @@ import { Graph } from '../../graph/Graph';
2
2
  interface ProvidesParams {
3
3
  name: string;
4
4
  }
5
- export declare function Provides({ name }?: Partial<ProvidesParams>): (graph: Graph, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
5
+ export declare function provides({ name }?: Partial<ProvidesParams>): (graph: Graph, propertyKey: string, descriptor: PropertyDescriptor) => PropertyDescriptor;
6
6
  export {};
7
7
  //# sourceMappingURL=Provides.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Provides.d.ts","sourceRoot":"","sources":["../../../../src/decorators/provides/Provides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI1C,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAE,OAAO,CAAC,cAAc,CAAM,WAC9B,KAAK,eAAe,MAAM,cAAc,kBAAkB,wBAI1F"}
1
+ {"version":3,"file":"Provides.d.ts","sourceRoot":"","sources":["../../../../src/decorators/provides/Provides.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAI1C,UAAU,cAAc;IACtB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wBAAgB,QAAQ,CAAC,EAAE,IAAI,EAAE,GAAE,OAAO,CAAC,cAAc,CAAM,WAC9C,KAAK,eAAe,MAAM,cAAc,kBAAkB,wBAI1E"}
@@ -3,11 +3,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.Provides = Provides;
6
+ exports.provides = provides;
7
7
  const ProvidedPropertiesStore_1 = __importDefault(require("../../ProvidedPropertiesStore"));
8
8
  const MemoizeDescriptor_1 = require("./MemoizeDescriptor");
9
- function Provides({ name } = {}) {
10
- return function provide(graph, propertyKey, descriptor) {
9
+ function provides({ name } = {}) {
10
+ return (graph, propertyKey, descriptor) => {
11
11
  ProvidedPropertiesStore_1.default.set(graph, propertyKey, name);
12
12
  return (0, MemoizeDescriptor_1.memoizeDescriptor)(propertyKey, descriptor);
13
13
  };
@@ -1 +1 @@
1
- {"version":3,"file":"Provides.js","sourceRoot":"","sources":["../../../../src/decorators/provides/Provides.ts"],"names":[],"mappings":";;;;;AAQA,4BAKC;AAZD,4FAAoE;AACpE,2DAAwD;AAMxD,SAAgB,QAAQ,CAAC,EAAE,IAAI,KAA8B,EAAE;IAC7D,OAAO,SAAS,OAAO,CAAC,KAAY,EAAE,WAAmB,EAAE,UAA8B;QACvF,iCAAuB,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,IAAK,CAAC,CAAC;QACvD,OAAO,IAAA,qCAAiB,EAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"Provides.js","sourceRoot":"","sources":["../../../../src/decorators/provides/Provides.ts"],"names":[],"mappings":";;;;;AAQA,4BAKC;AAZD,4FAAoE;AACpE,2DAAwD;AAMxD,SAAgB,QAAQ,CAAC,EAAE,IAAI,KAA8B,EAAE;IAC7D,OAAO,CAAC,KAAY,EAAE,WAAmB,EAAE,UAA8B,EAAE,EAAE;QAC3E,iCAAuB,CAAC,GAAG,CAAC,KAAK,EAAE,WAAW,EAAE,IAAK,CAAC,CAAC;QACvD,OAAO,IAAA,qCAAiB,EAAC,WAAW,EAAE,UAAU,CAAC,CAAC;IACpD,CAAC,CAAC;AACJ,CAAC"}
@@ -1,16 +1,51 @@
1
+ import { graph } from './decorators/Graph';
2
+ import { inject } from './decorators/inject/Inject';
3
+ import { injectable } from './decorators/inject/Injectable';
4
+ import { lateInject } from './decorators/inject/LateInject';
5
+ import { lifecycleBound } from './decorators/LifecycleBound';
6
+ import { provides } from './decorators/provides/Provides';
7
+ import { singleton } from './decorators/Singleton';
1
8
  import _Obsidian from './Obsidian';
2
9
  export * from './types';
3
- export { Graph } from './decorators/Graph';
4
- export { Singleton } from './decorators/Singleton';
10
+ export { graph } from './decorators/Graph';
11
+ export { singleton } from './decorators/Singleton';
5
12
  export { ObjectGraph } from './graph/ObjectGraph';
6
13
  export { Graph as IGraph } from './graph/Graph';
7
- export { Provides } from './decorators/provides/Provides';
8
- export { Injectable } from './decorators/inject/Injectable';
9
- export { Inject } from './decorators/inject/Inject';
10
- export { LateInject } from './decorators/inject/LateInject';
11
- export { LifecycleBound } from './decorators/LifecycleBound';
14
+ export { provides } from './decorators/provides/Provides';
15
+ export { injectable } from './decorators/inject/Injectable';
16
+ export { inject } from './decorators/inject/Inject';
17
+ export { lateInject } from './decorators/inject/LateInject';
18
+ export { lifecycleBound } from './decorators/LifecycleBound';
12
19
  export { GraphMiddleware } from './graph/registry/GraphMiddleware';
13
20
  export { GraphResolveChain as ResolveChain } from './graph/registry/GraphResolveChain';
21
+ /**
22
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming conventions. Please use `@graph` instead.
23
+ */
24
+ export declare const Graph: typeof graph;
25
+ /**
26
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@singleton` instead.
27
+ */
28
+ export declare const Singleton: typeof singleton;
29
+ /**
30
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@provides` instead.
31
+ */
32
+ export declare const Provides: typeof provides;
33
+ /**
34
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@injectable` instead.
35
+ */
36
+ export declare const Injectable: typeof injectable;
37
+ /**
38
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@inject` instead.
39
+ */
40
+ export declare const Inject: typeof inject;
41
+ /**
42
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@lateInject` instead.
43
+ */
44
+ export declare const LateInject: typeof lateInject;
45
+ /**
46
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@lifecycleBound` instead.
47
+ */
48
+ export declare const LifecycleBound: typeof lifecycleBound;
14
49
  export declare const Obsidian: _Obsidian;
15
50
  export { injectComponent } from './injectors/components/InjectComponent';
16
51
  export { injectHook, injectHookWithArguments } from './injectors/hooks/InjectHook';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,cAAc,SAAS,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAClD,OAAO,EAAE,KAAK,IAAI,MAAM,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAE,QAAQ,EAAE,MAAM,gCAAgC,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,iBAAiB,IAAI,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEvF,eAAO,MAAM,QAAQ,WAAkB,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,U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EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AACnE,OAAO,EAAE,iBAAiB,IAAI,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAEvF;;GAEG;AACH,eAAO,MAAM,KAAK,cAAQ,CAAC;AAC3B;;GAEG;AACH,eAAO,MAAM,SAAS,kBAAY,CAAC;AACnC;;GAEG;AACH,eAAO,MAAM,QAAQ,iBAAW,CAAC;AACjC;;GAEG;AACH,eAAO,MAAM,UAAU,mBAAa,CAAC;AACrC;;GAEG;AACH,eAAO,MAAM,MAAM,eAAS,CAAC;AAC7B;;GAEG;AACH,eAAO,MAAM,UAAU,mBAAa,CAAC;AACrC;;GAEG;AACH,eAAO,MAAM,cAAc,uBAAiB,CAAC;AAG7C,eAAO,MAAM,QAAQ,WAAkB,CAAC;AAExC,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AAEnF,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,0CAA0C,CAAC;AAC9E,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAEzD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/src/index.js CHANGED
@@ -17,27 +17,62 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.mockGraphs = exports.mockModel = exports.testKit = exports.Model = exports.MediatorObservable = exports.Observable = exports.useObservers = exports.useObserver = exports.injectHookWithArguments = exports.injectHook = exports.injectComponent = exports.Obsidian = exports.GraphMiddleware = exports.LifecycleBound = exports.LateInject = exports.Inject = exports.Injectable = exports.Provides = exports.ObjectGraph = exports.Singleton = exports.Graph = void 0;
20
+ exports.mockGraphs = exports.mockModel = exports.testKit = exports.Model = exports.MediatorObservable = exports.Observable = exports.useObservers = exports.useObserver = exports.injectHookWithArguments = exports.injectHook = exports.injectComponent = exports.Obsidian = exports.LifecycleBound = exports.LateInject = exports.Inject = exports.Injectable = exports.Provides = exports.Singleton = exports.Graph = exports.GraphMiddleware = exports.lifecycleBound = exports.lateInject = exports.inject = exports.injectable = exports.provides = exports.ObjectGraph = exports.singleton = exports.graph = void 0;
21
+ const Graph_1 = require("./decorators/Graph");
22
+ const Inject_1 = require("./decorators/inject/Inject");
23
+ const Injectable_1 = require("./decorators/inject/Injectable");
24
+ const LateInject_1 = require("./decorators/inject/LateInject");
25
+ const LifecycleBound_1 = require("./decorators/LifecycleBound");
26
+ const Provides_1 = require("./decorators/provides/Provides");
27
+ const Singleton_1 = require("./decorators/Singleton");
21
28
  const Obsidian_1 = __importDefault(require("./Obsidian"));
22
29
  __exportStar(require("./types"), exports);
23
- var Graph_1 = require("./decorators/Graph");
24
- Object.defineProperty(exports, "Graph", { enumerable: true, get: function () { return Graph_1.Graph; } });
25
- var Singleton_1 = require("./decorators/Singleton");
26
- Object.defineProperty(exports, "Singleton", { enumerable: true, get: function () { return Singleton_1.Singleton; } });
30
+ var Graph_2 = require("./decorators/Graph");
31
+ Object.defineProperty(exports, "graph", { enumerable: true, get: function () { return Graph_2.graph; } });
32
+ var Singleton_2 = require("./decorators/Singleton");
33
+ Object.defineProperty(exports, "singleton", { enumerable: true, get: function () { return Singleton_2.singleton; } });
27
34
  var ObjectGraph_1 = require("./graph/ObjectGraph");
28
35
  Object.defineProperty(exports, "ObjectGraph", { enumerable: true, get: function () { return ObjectGraph_1.ObjectGraph; } });
29
- var Provides_1 = require("./decorators/provides/Provides");
30
- Object.defineProperty(exports, "Provides", { enumerable: true, get: function () { return Provides_1.Provides; } });
31
- var Injectable_1 = require("./decorators/inject/Injectable");
32
- Object.defineProperty(exports, "Injectable", { enumerable: true, get: function () { return Injectable_1.Injectable; } });
33
- var Inject_1 = require("./decorators/inject/Inject");
34
- Object.defineProperty(exports, "Inject", { enumerable: true, get: function () { return Inject_1.Inject; } });
35
- var LateInject_1 = require("./decorators/inject/LateInject");
36
- Object.defineProperty(exports, "LateInject", { enumerable: true, get: function () { return LateInject_1.LateInject; } });
37
- var LifecycleBound_1 = require("./decorators/LifecycleBound");
38
- Object.defineProperty(exports, "LifecycleBound", { enumerable: true, get: function () { return LifecycleBound_1.LifecycleBound; } });
36
+ var Provides_2 = require("./decorators/provides/Provides");
37
+ Object.defineProperty(exports, "provides", { enumerable: true, get: function () { return Provides_2.provides; } });
38
+ var Injectable_2 = require("./decorators/inject/Injectable");
39
+ Object.defineProperty(exports, "injectable", { enumerable: true, get: function () { return Injectable_2.injectable; } });
40
+ var Inject_2 = require("./decorators/inject/Inject");
41
+ Object.defineProperty(exports, "inject", { enumerable: true, get: function () { return Inject_2.inject; } });
42
+ var LateInject_2 = require("./decorators/inject/LateInject");
43
+ Object.defineProperty(exports, "lateInject", { enumerable: true, get: function () { return LateInject_2.lateInject; } });
44
+ var LifecycleBound_2 = require("./decorators/LifecycleBound");
45
+ Object.defineProperty(exports, "lifecycleBound", { enumerable: true, get: function () { return LifecycleBound_2.lifecycleBound; } });
39
46
  var GraphMiddleware_1 = require("./graph/registry/GraphMiddleware");
40
47
  Object.defineProperty(exports, "GraphMiddleware", { enumerable: true, get: function () { return GraphMiddleware_1.GraphMiddleware; } });
48
+ /**
49
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming conventions. Please use `@graph` instead.
50
+ */
51
+ exports.Graph = Graph_1.graph;
52
+ /**
53
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@singleton` instead.
54
+ */
55
+ exports.Singleton = Singleton_1.singleton;
56
+ /**
57
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@provides` instead.
58
+ */
59
+ exports.Provides = Provides_1.provides;
60
+ /**
61
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@injectable` instead.
62
+ */
63
+ exports.Injectable = Injectable_1.injectable;
64
+ /**
65
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@inject` instead.
66
+ */
67
+ exports.Inject = Inject_1.inject;
68
+ /**
69
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@lateInject` instead.
70
+ */
71
+ exports.LateInject = LateInject_1.lateInject;
72
+ /**
73
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@lifecycleBound` instead.
74
+ */
75
+ exports.LifecycleBound = LifecycleBound_1.lifecycleBound;
41
76
  exports.Obsidian = new Obsidian_1.default();
42
77
  var InjectComponent_1 = require("./injectors/components/InjectComponent");
43
78
  Object.defineProperty(exports, "injectComponent", { enumerable: true, get: function () { return InjectComponent_1.injectComponent; } });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,0DAAmC;AAEnC,0CAAwB;AAExB,4CAA2C;AAAlC,8FAAA,KAAK,OAAA;AACd,oDAAmD;AAA1C,sGAAA,SAAS,OAAA;AAClB,mDAAkD;AAAzC,0GAAA,WAAW,OAAA;AAEpB,2DAA0D;AAAjD,oGAAA,QAAQ,OAAA;AACjB,6DAA4D;AAAnD,wGAAA,UAAU,OAAA;AACnB,qDAAoD;AAA3C,gGAAA,MAAM,OAAA;AACf,6DAA4D;AAAnD,wGAAA,UAA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+ {"version":3,"file":"LifecycleBoundGraph.d.ts","sourceRoot":"","sources":["../../../test/fixtures/LifecycleBoundGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAGZ,MAAM,WAAW,CAAC;AAEnB,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,qBACa,mBAAoB,SAAQ,WAAW,CAAC,KAAK,CAAC;IACzD,MAAM,CAAC,YAAY,SAAK;IACxB,OAAO,CAAC,KAAK,CAAQ;gBAET,KAAK,EAAE,KAAK;IAOxB,iBAAiB,IAAI,MAAM;IAO3B,mBAAmB,IAAI,MAAM;CAG9B"}
@@ -12,7 +12,6 @@ var LifecycleBoundGraph_1;
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.LifecycleBoundGraph = void 0;
14
14
  const src_1 = require("../../src");
15
- const LifecycleBound_1 = require("../../src/decorators/LifecycleBound");
16
15
  let LifecycleBoundGraph = LifecycleBoundGraph_1 = class LifecycleBoundGraph extends src_1.ObjectGraph {
17
16
  constructor(props) {
18
17
  super(props);
@@ -31,20 +30,20 @@ let LifecycleBoundGraph = LifecycleBoundGraph_1 = class LifecycleBoundGraph exte
31
30
  exports.LifecycleBoundGraph = LifecycleBoundGraph;
32
31
  LifecycleBoundGraph.timesCreated = 0;
33
32
  __decorate([
34
- (0, src_1.Provides)(),
33
+ (0, src_1.provides)(),
35
34
  __metadata("design:type", Function),
36
35
  __metadata("design:paramtypes", []),
37
36
  __metadata("design:returntype", String)
38
37
  ], LifecycleBoundGraph.prototype, "computedFromProps", null);
39
38
  __decorate([
40
- (0, src_1.Provides)(),
39
+ (0, src_1.provides)(),
41
40
  __metadata("design:type", Function),
42
41
  __metadata("design:paramtypes", []),
43
42
  __metadata("design:returntype", String)
44
43
  ], LifecycleBoundGraph.prototype, "doesNotRequireProps", null);
45
44
  exports.LifecycleBoundGraph = LifecycleBoundGraph = LifecycleBoundGraph_1 = __decorate([
46
- (0, LifecycleBound_1.LifecycleBound)(),
47
- (0, src_1.Graph)(),
45
+ (0, src_1.lifecycleBound)(),
46
+ (0, src_1.graph)(),
48
47
  __metadata("design:paramtypes", [Object])
49
48
  ], LifecycleBoundGraph);
50
49
  //# sourceMappingURL=LifecycleBoundGraph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LifecycleBoundGraph.js","sourceRoot":"","sources":["../../../test/fixtures/LifecycleBoundGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAAyD;AACzD,wEAAqE;AAK9D,IAAM,mBAAmB,2BAAzB,MAAM,mBAAoB,SAAQ,iBAAkB;IAIzD,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,qBAAmB,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAGD,iBAAiB;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe;YAC/B,CAAC,CAAC,8BAA8B,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;YAC5D,CAAC,CAAC,gCAAgC,CAAC;IACvC,CAAC;IAGD,mBAAmB;QACjB,OAAO,sCAAsC,CAAC;IAChD,CAAC;;AApBU,kDAAmB;AACvB,gCAAY,GAAG,CAAC,AAAJ,CAAK;AAUxB;IADC,IAAA,cAAQ,GAAE;;;;4DAKV;AAGD;IADC,IAAA,cAAQ,GAAE;;;;8DAGV;8BApBU,mBAAmB;IAD/B,IAAA,+BAAc,GAAE;IAAE,IAAA,WAAK,GAAE;;GACb,mBAAmB,CAqB/B"}
1
+ {"version":3,"file":"LifecycleBoundGraph.js","sourceRoot":"","sources":["../../../test/fixtures/LifecycleBoundGraph.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,mCAKmB;AAKZ,IAAM,mBAAmB,2BAAzB,MAAM,mBAAoB,SAAQ,iBAAkB;IAIzD,YAAY,KAAY;QACtB,KAAK,CAAC,KAAK,CAAC,CAAC;QACb,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,qBAAmB,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAGD,iBAAiB;QACf,OAAO,IAAI,CAAC,KAAK,CAAC,eAAe;YAC/B,CAAC,CAAC,8BAA8B,IAAI,CAAC,KAAK,CAAC,eAAe,EAAE;YAC5D,CAAC,CAAC,gCAAgC,CAAC;IACvC,CAAC;IAGD,mBAAmB;QACjB,OAAO,sCAAsC,CAAC;IAChD,CAAC;;AApBU,kDAAmB;AACvB,gCAAY,GAAG,CAAC,AAAJ,CAAK;AAUxB;IADC,IAAA,cAAQ,GAAE;;;;4DAKV;AAGD;IADC,IAAA,cAAQ,GAAE;;;;8DAGV;8BApBU,mBAAmB;IAD/B,IAAA,oBAAc,GAAE;IAAE,IAAA,WAAK,GAAE;;GACb,mBAAmB,CAqB/B"}
@@ -1 +1 @@
1
- {"version":3,"file":"LifecycleBoundWithLifecycleBoundSubgraph.d.ts","sourceRoot":"","sources":["../../../test/fixtures/LifecycleBoundWithLifecycleBoundSubgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAY,MAAM,WAAW,CAAC;AAIzD,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,qBACa,6CAA8C,SAAQ,WAAW;IAG5E,OAAO,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM;CAG3C"}
1
+ {"version":3,"file":"LifecycleBoundWithLifecycleBoundSubgraph.d.ts","sourceRoot":"","sources":["../../../test/fixtures/LifecycleBoundWithLifecycleBoundSubgraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,WAAW,EAGZ,MAAM,WAAW,CAAC;AAGnB,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,qBACa,6CAA8C,SAAQ,WAAW;IAG5E,OAAO,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM;CAG3C"}
@@ -11,7 +11,6 @@ var __metadata = (this && this.__metadata) || function (k, v) {
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  exports.LifecycleBoundGraphWithLifecycleBoundSubgraph = void 0;
13
13
  const src_1 = require("../../src");
14
- const LifecycleBound_1 = require("../../src/decorators/LifecycleBound");
15
14
  const LifecycleBoundGraph_1 = require("./LifecycleBoundGraph");
16
15
  let LifecycleBoundGraphWithLifecycleBoundSubgraph = class LifecycleBoundGraphWithLifecycleBoundSubgraph extends src_1.ObjectGraph {
17
16
  aString(computedFromProps) {
@@ -20,13 +19,13 @@ let LifecycleBoundGraphWithLifecycleBoundSubgraph = class LifecycleBoundGraphWit
20
19
  };
21
20
  exports.LifecycleBoundGraphWithLifecycleBoundSubgraph = LifecycleBoundGraphWithLifecycleBoundSubgraph;
22
21
  __decorate([
23
- (0, src_1.Provides)(),
22
+ (0, src_1.provides)(),
24
23
  __metadata("design:type", Function),
25
24
  __metadata("design:paramtypes", [String]),
26
25
  __metadata("design:returntype", String)
27
26
  ], LifecycleBoundGraphWithLifecycleBoundSubgraph.prototype, "aString", null);
28
27
  exports.LifecycleBoundGraphWithLifecycleBoundSubgraph = LifecycleBoundGraphWithLifecycleBoundSubgraph = __decorate([
29
- (0, LifecycleBound_1.LifecycleBound)(),
30
- (0, src_1.Graph)({ subgraphs: [LifecycleBoundGraph_1.LifecycleBoundGraph] })
28
+ (0, src_1.lifecycleBound)(),
29
+ (0, src_1.graph)({ subgraphs: [LifecycleBoundGraph_1.LifecycleBoundGraph] })
31
30
  ], LifecycleBoundGraphWithLifecycleBoundSubgraph);
32
31
  //# sourceMappingURL=LifecycleBoundWithLifecycleBoundSubgraph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"LifecycleBoundWithLifecycleBoundSubgraph.js","sourceRoot":"","sources":["../../../test/fixtures/LifecycleBoundWithLifecycleBoundSubgraph.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAyD;AACzD,wEAAqE;AACrE,+DAA4D;AAKrD,IAAM,6CAA6C,GAAnD,MAAM,6CAA8C,SAAQ,iBAAW;IAG5E,OAAO,CAAC,iBAAyB;QAC/B,OAAO,iEAAiE,iBAAiB,EAAE,CAAC;IAC9F,CAAC;CACF,CAAA;AANY,sGAA6C;AAGxD;IADC,IAAA,cAAQ,GAAE;;;;4EAGV;wDALU,6CAA6C;IADzD,IAAA,+BAAc,GAAE;IAAE,IAAA,WAAK,EAAC,EAAC,SAAS,EAAE,CAAC,yCAAmB,CAAC,EAAC,CAAC;GAC/C,6CAA6C,CAMzD"}
1
+ {"version":3,"file":"LifecycleBoundWithLifecycleBoundSubgraph.js","sourceRoot":"","sources":["../../../test/fixtures/LifecycleBoundWithLifecycleBoundSubgraph.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAKmB;AACnB,+DAA4D;AAKrD,IAAM,6CAA6C,GAAnD,MAAM,6CAA8C,SAAQ,iBAAW;IAG5E,OAAO,CAAC,iBAAyB;QAC/B,OAAO,iEAAiE,iBAAiB,EAAE,CAAC;IAC9F,CAAC;CACF,CAAA;AANY,sGAA6C;AAGxD;IADC,IAAA,cAAQ,GAAE;;;;4EAGV;wDALU,6CAA6C;IADzD,IAAA,oBAAc,GAAE;IAAE,IAAA,WAAK,EAAC,EAAE,SAAS,EAAE,CAAC,yCAAmB,CAAC,EAAE,CAAC;GACjD,6CAA6C,CAMzD"}
@@ -1 +1 @@
1
- {"version":3,"file":"ScopedLifecycleBoundGraph.d.ts","sourceRoot":"","sources":["../../../test/fixtures/ScopedLifecycleBoundGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAE,MAAM,WAAW,CAAC;AAG/C,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,qBACa,yBAA0B,SAAQ,WAAW,CAAC,KAAK,CAAC;CAEhE"}
1
+ {"version":3,"file":"ScopedLifecycleBoundGraph.d.ts","sourceRoot":"","sources":["../../../test/fixtures/ScopedLifecycleBoundGraph.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,WAAW,EAAkB,MAAM,WAAW,CAAC;AAE/D,MAAM,MAAM,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,qBACa,yBAA0B,SAAQ,WAAW,CAAC,KAAK,CAAC;CAEhE"}
@@ -8,12 +8,11 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.ScopedLifecycleBoundGraph = void 0;
10
10
  const src_1 = require("../../src");
11
- const LifecycleBound_1 = require("../../src/decorators/LifecycleBound");
12
11
  let ScopedLifecycleBoundGraph = class ScopedLifecycleBoundGraph extends src_1.ObjectGraph {
13
12
  };
14
13
  exports.ScopedLifecycleBoundGraph = ScopedLifecycleBoundGraph;
15
14
  exports.ScopedLifecycleBoundGraph = ScopedLifecycleBoundGraph = __decorate([
16
- (0, LifecycleBound_1.LifecycleBound)({ scope: 'component' }),
17
- (0, src_1.Graph)()
15
+ (0, src_1.lifecycleBound)({ scope: 'component' }),
16
+ (0, src_1.graph)()
18
17
  ], ScopedLifecycleBoundGraph);
19
18
  //# sourceMappingURL=ScopedLifecycleBoundGraph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ScopedLifecycleBoundGraph.js","sourceRoot":"","sources":["../../../test/fixtures/ScopedLifecycleBoundGraph.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mCAA+C;AAC/C,wEAAqE;AAK9D,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,iBAAkB;CAEhE,CAAA;AAFY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,+BAAc,EAAC,EAAC,KAAK,EAAE,WAAW,EAAC,CAAC;IAAE,IAAA,WAAK,GAAE;GACjC,yBAAyB,CAErC"}
1
+ {"version":3,"file":"ScopedLifecycleBoundGraph.js","sourceRoot":"","sources":["../../../test/fixtures/ScopedLifecycleBoundGraph.ts"],"names":[],"mappings":";;;;;;;;;AAAA,mCAA+D;AAKxD,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,iBAAkB;CAEhE,CAAA;AAFY,8DAAyB;oCAAzB,yBAAyB;IADrC,IAAA,oBAAc,EAAC,EAAC,KAAK,EAAE,WAAW,EAAC,CAAC;IAAE,IAAA,WAAK,GAAE;GACjC,yBAAyB,CAErC"}
@@ -22,14 +22,14 @@ let SingletonGraph = class SingletonGraph extends src_1.ObjectGraph {
22
22
  }
23
23
  };
24
24
  __decorate([
25
- (0, src_1.Provides)(),
25
+ (0, src_1.provides)(),
26
26
  __metadata("design:type", Function),
27
27
  __metadata("design:paramtypes", []),
28
28
  __metadata("design:returntype", String)
29
29
  ], SingletonGraph.prototype, "instanceId", null);
30
30
  SingletonGraph = __decorate([
31
- (0, Singleton_1.Singleton)(),
32
- (0, src_1.Graph)()
31
+ (0, Singleton_1.singleton)(),
32
+ (0, src_1.graph)()
33
33
  ], SingletonGraph);
34
34
  exports.default = SingletonGraph;
35
35
  //# sourceMappingURL=SingletonGraph.js.map
@@ -1,8 +1,9 @@
1
- import { ClassMethod, ClassProperty, Decorator, Identifier, ObjectExpression, ObjectPattern, TSParameterProperty } from '@babel/types';
1
+ import { ClassMethod, ClassProperty, Decorator, Identifier, ObjectExpression, ObjectPattern, TSParameterProperty, type StringLiteral } from '@babel/types';
2
2
  export type AcceptedNodeType = Identifier | TSParameterProperty | ClassProperty;
3
3
  export declare function providerIsNotNamed(decorator: Decorator): boolean;
4
4
  export declare function addNameToProviderArguments(node: ClassMethod, decorator: Decorator): void;
5
- export declare function getDecoratorArgument(decorator: Decorator): ObjectExpression | undefined;
5
+ export declare function getDecoratorObjectArgument(decorator: Decorator): ObjectExpression | undefined;
6
+ export declare function getDecoratorStringArgument(decorator: Decorator): StringLiteral | undefined;
6
7
  export declare function getMethodName(node: ClassMethod): string;
7
8
  export declare function getDecoratorByName(decorators: Array<Decorator> | undefined | null, decoratorName: string): Decorator | undefined;
8
9
  export declare function getDecoratorName(decorator?: Decorator): string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/helpers/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,WAAW,EACX,aAAa,EACb,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACpB,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,mBAAmB,GAAG,aAAa,CAAC;AAEhF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAWhE;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,QAOjF;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAKvF;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAGvD;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,IAAI,EAC/C,aAAa,EAAE,MAAM,GACpB,SAAS,GAAG,SAAS,CAEvB;AAED,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE1E;AAED,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,CAAC,UAAU,GAAG,GAAG,CAAC,EAAE,GAAG,aAAa,CAI3F;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,gBAAgB,EACtB,SAAS,EAAE,SAAS,QAOrB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/helpers/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,WAAW,EACX,aAAa,EACb,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,aAAa,EACb,mBAAmB,EACnB,KAAK,aAAa,EACnB,MAAM,cAAc,CAAC;AAItB,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,mBAAmB,GAAG,aAAa,CAAC;AAEhF,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAWhE;AAED,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,QAOjF;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,SAAS,GAAG,gBAAgB,GAAG,SAAS,CAK7F;AAED,wBAAgB,0BAA0B,CAAC,SAAS,EAAE,SAAS,GAAG,aAAa,GAAG,SAAS,CAK1F;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,CAGvD;AAED,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,GAAG,SAAS,GAAG,IAAI,EAC/C,aAAa,EAAE,MAAM,GACpB,SAAS,GAAG,SAAS,CAEvB;AAED,wBAAgB,gBAAgB,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,CAE1E;AAED,wBAAgB,+BAA+B,CAAC,MAAM,EAAE,CAAC,UAAU,GAAG,GAAG,CAAC,EAAE,GAAG,aAAa,CAI3F;AAED,wBAAgB,6BAA6B,CAC3C,IAAI,EAAE,gBAAgB,EACtB,SAAS,EAAE,SAAS,QAOrB"}
@@ -2,7 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.providerIsNotNamed = providerIsNotNamed;
4
4
  exports.addNameToProviderArguments = addNameToProviderArguments;
5
- exports.getDecoratorArgument = getDecoratorArgument;
5
+ exports.getDecoratorObjectArgument = getDecoratorObjectArgument;
6
+ exports.getDecoratorStringArgument = getDecoratorStringArgument;
6
7
  exports.getMethodName = getMethodName;
7
8
  exports.getDecoratorByName = getDecoratorByName;
8
9
  exports.getDecoratorName = getDecoratorName;
@@ -12,7 +13,7 @@ exports.passParamNameAsInjectArgument = passParamNameAsInjectArgument;
12
13
  const core_1 = require("@babel/core");
13
14
  const never = '';
14
15
  function providerIsNotNamed(decorator) {
15
- const argument = getDecoratorArgument(decorator);
16
+ const argument = getDecoratorObjectArgument(decorator);
16
17
  if (core_1.types.isObjectExpression(argument)) {
17
18
  return argument.properties.find((p) => {
18
19
  if (core_1.types.isObjectProperty(p)) {
@@ -25,16 +26,22 @@ function providerIsNotNamed(decorator) {
25
26
  }
26
27
  function addNameToProviderArguments(node, decorator) {
27
28
  var _a;
28
- const argument = (_a = getDecoratorArgument(decorator)) !== null && _a !== void 0 ? _a : core_1.types.objectExpression([]);
29
+ const argument = (_a = getDecoratorObjectArgument(decorator)) !== null && _a !== void 0 ? _a : core_1.types.objectExpression([]);
29
30
  argument.properties.push(core_1.types.objectProperty(core_1.types.identifier('name'), core_1.types.stringLiteral(getMethodName(node))));
30
31
  decorator.expression.arguments = [argument];
31
32
  }
32
- function getDecoratorArgument(decorator) {
33
+ function getDecoratorObjectArgument(decorator) {
33
34
  if (core_1.types.isCallExpression(decorator.expression)) {
34
35
  return decorator.expression.arguments.find((a) => core_1.types.isObjectExpression(a));
35
36
  }
36
37
  return undefined;
37
38
  }
39
+ function getDecoratorStringArgument(decorator) {
40
+ if (core_1.types.isCallExpression(decorator.expression)) {
41
+ return decorator.expression.arguments.find(a => core_1.types.isStringLiteral(a));
42
+ }
43
+ return undefined;
44
+ }
38
45
  function getMethodName(node) {
39
46
  if (core_1.types.isIdentifier(node.key))
40
47
  return node.key.name;
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/helpers/index.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GAAG,CAAC,CAAC;IACxC,OAAO,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../transformers/babel-plugin-obsidian/index.ts"],"names":[],"mappings":"AAQA,OAAO,EAAY,SAAS,EAAE,MAAM,aAAa,CAAC;AAmClD,MAAM,CAAC,OAAO,UAAU,MAAM,gDAE7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../transformers/babel-plugin-obsidian/index.ts"],"names":[],"mappings":"AAOA,OAAO,EAAY,SAAS,EAAE,MAAM,aAAa,CAAC;AAwClD,MAAM,CAAC,OAAO,UAAU,MAAM,gDAE7B"}
@@ -15,22 +15,27 @@ const providerArgumentsTransformer = {
15
15
  const internalVisitor = {
16
16
  ClassMethod: {
17
17
  enter({ node }) {
18
+ unmagler_1.default.saveClassMethod('provides', node);
18
19
  unmagler_1.default.saveClassMethod('Provides', node);
19
20
  },
20
21
  },
21
22
  ClassProperty: {
22
23
  enter({ node }) {
24
+ unmagler_1.default.saveClassProperty('inject', node);
25
+ unmagler_1.default.saveClassProperty('lateInject', node);
23
26
  unmagler_1.default.saveClassProperty('Inject', node);
24
27
  unmagler_1.default.saveClassProperty('LateInject', node);
25
28
  },
26
29
  },
27
30
  Identifier: {
28
31
  enter({ node }) {
32
+ unmagler_1.default.saveIdentifier('inject', node);
29
33
  unmagler_1.default.saveIdentifier('Inject', node);
30
34
  },
31
35
  },
32
36
  TSParameterProperty: {
33
37
  enter({ node }) {
38
+ unmagler_1.default.saveTSParameterProperty('inject', node);
34
39
  unmagler_1.default.saveTSParameterProperty('Inject', node);
35
40
  },
36
41
  },
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../transformers/babel-plugin-obsidian/index.ts"],"names":[],"mappings":";;;;;AA2CA,yBAEC;AApCD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e,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;YAC3C,kBAAQ,CAAC,eAAe,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QAC7C,CAAC;KACF;IACD,aAAa,EAAE;QACb,KAAK,CAAC,EAAE,IAAI,EAA2B;YACrC,kBAAQ,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC3C,kBAAQ,CAAC,iBAAiB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;YAC/C,kBAAQ,CAAC,iBAAiB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YAC3C,kBAAQ,CAAC,iBAAiB,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QACjD,CAAC;KACF;IACD,UAAU,EAAE;QACV,KAAK,CAAC,EAAE,IAAI,EAAwB;YAClC,kBAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACxC,kBAAQ,CAAC,cAAc,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAC1C,CAAC;KACF;IACD,mBAAmB,EAAE;QACnB,KAAK,CAAC,EAAE,IAAI,EAAiC;YAC3C,kBAAQ,CAAC,uBAAuB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;YACjD,kBAAQ,CAAC,uBAAuB,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QACnD,CAAC;KACF;CACF,CAAC;AAEF,SAAwB,MAAM;IAC5B,OAAO,4BAA4B,CAAC;AACtC,CAAC"}
@@ -8,7 +8,7 @@ function savePropertyName(name, node) {
8
8
  }
9
9
  }
10
10
  function injectIsNotNamed(decorator) {
11
- return (0, helpers_1.getDecoratorArgument)(decorator) === undefined;
11
+ return (0, helpers_1.getDecoratorStringArgument)(decorator) === undefined;
12
12
  }
13
13
  exports.default = savePropertyName;
14
14
  //# sourceMappingURL=property.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"property.js","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/unmagler/property.ts"],"names":[],"mappings":";;AACA,wCAMoB;AAEpB,SAAS,gBAAgB,CAAC,IAAY,EAAE,IAAsB;IAC5D,MAAM,SAAS,GAAG,IAAA,4BAAkB,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC5D,IAAI,IAAA,0BAAgB,EAAC,SAAS,CAAC,KAAK,IAAI,IAAI,gBAAgB,CAAC,SAAU,CAAC,EAAE,CAAC;QACzE,IAAA,uCAA6B,EAAC,IAAI,EAAE,SAAU,CAAC,CAAC;IAClD,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAoB;IAC5C,OAAO,IAAA,8BAAoB,EAAC,SAAS,CAAC,KAAK,SAAS,CAAC;AACvD,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"property.js","sourceRoot":"","sources":["../../../../transformers/babel-plugin-obsidian/unmagler/property.ts"],"names":[],"mappings":";;AACA,wCAMoB;AAEpB,SAAS,gBAAgB,CAAC,IAAY,EAAE,IAAsB;IAC5D,MAAM,SAAS,GAAG,IAAA,4BAAkB,EAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;IAC5D,IAAI,IAAA,0BAAgB,EAAC,SAAS,CAAC,KAAK,IAAI,IAAI,gBAAgB,CAAC,SAAU,CAAC,EAAE,CAAC;QACzE,IAAA,uCAA6B,EAAC,IAAI,EAAE,SAAU,CAAC,CAAC;IAClD,CAAC;AACH,CAAC;AAED,SAAS,gBAAgB,CAAC,SAAoB;IAC5C,OAAO,IAAA,oCAA0B,EAAC,SAAS,CAAC,KAAK,SAAS,CAAC;AAC7D,CAAC;AAED,kBAAe,gBAAgB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-obsidian",
3
- "version": "2.16.0",
3
+ "version": "2.17.0+alpha.1",
4
4
  "description": "Dependency injection framework for React and React Native applications",
5
5
  "scripts": {
6
6
  "prepack": "npm run lint && tsc --project tsconfig.prod.json",
@@ -6,7 +6,7 @@ interface GraphParams {
6
6
  subgraphs: Constructable<ObjectGraph>[];
7
7
  }
8
8
 
9
- export function Graph({ subgraphs = [] }: Partial<GraphParams> = {}) {
9
+ export function graph({ subgraphs = [] }: Partial<GraphParams> = {}) {
10
10
  return (constructor: any) => {
11
11
  graphRegistry.register(constructor, subgraphs);
12
12
  return constructor;
@@ -4,7 +4,7 @@ type Options = {
4
4
  scope?: 'component' | 'feature' | (string & {});
5
5
  };
6
6
 
7
- export function LifecycleBound(options?: Options) {
7
+ export function lifecycleBound(options?: Options) {
8
8
  return (constructor: any) => {
9
9
  Reflect.defineMetadata('isLifecycleBound', true, constructor);
10
10
  Reflect.defineMetadata('lifecycleScope', options?.scope ?? 'feature', constructor);
@@ -2,12 +2,12 @@ import { Constructable } from '../types';
2
2
  import { ObjectGraph } from '../graph/ObjectGraph';
3
3
  import {Reflect} from '../utils/reflect';
4
4
 
5
- export function Singleton() {
6
- return function singleton(
5
+ export function singleton() {
6
+ return (
7
7
  constructorOrGraph: Constructable<ObjectGraph> | ObjectGraph,
8
8
  _property?: string,
9
9
  descriptor?: PropertyDescriptor,
10
- ): any {
10
+ ): any => {
11
11
  const target = descriptor || constructorOrGraph;
12
12
  Reflect.defineMetadata('isSingleton', true, target);
13
13
  return target;
@@ -1,7 +1,7 @@
1
1
  import { isNumber } from '../../utils/isNumber';
2
2
  import InjectionMetadata from '../../injectors/class/InjectionMetadata';
3
3
 
4
- export function Inject(name?: string) {
4
+ export function inject(name?: string) {
5
5
  return (
6
6
  target: Object | any,
7
7
  _propertyKey?: string,
@@ -3,6 +3,6 @@ import { Graph } from '../../graph/Graph';
3
3
  import graphRegistry from '../../graph/registry/GraphRegistry';
4
4
  import ClassInjector from '../../injectors/class/ClassInjector';
5
5
 
6
- export function Injectable(keyOrGraph: string | Constructable<Graph>): any {
6
+ export function injectable(keyOrGraph: string | Constructable<Graph>): any {
7
7
  return new ClassInjector(graphRegistry).inject(keyOrGraph);
8
8
  }
@@ -1,6 +1,6 @@
1
1
  import InjectionMetadata from '../../injectors/class/InjectionMetadata';
2
2
 
3
- export function LateInject(name?: string): any {
3
+ export function lateInject(name?: string): any {
4
4
  return (target: object) => {
5
5
  const metadata = new InjectionMetadata();
6
6
  metadata.saveLatePropertyMetadata(target.constructor, name!);
@@ -6,8 +6,8 @@ interface ProvidesParams {
6
6
  name: string;
7
7
  }
8
8
 
9
- export function Provides({ name }: Partial<ProvidesParams> = {}) {
10
- return function provide(graph: Graph, propertyKey: string, descriptor: PropertyDescriptor) {
9
+ export function provides({ name }: Partial<ProvidesParams> = {}) {
10
+ return (graph: Graph, propertyKey: string, descriptor: PropertyDescriptor) => {
11
11
  providedPropertiesStore.set(graph, propertyKey, name!);
12
12
  return memoizeDescriptor(propertyKey, descriptor);
13
13
  };
package/src/index.ts CHANGED
@@ -1,19 +1,56 @@
1
+ import { graph } from './decorators/Graph';
2
+ import { inject } from './decorators/inject/Inject';
3
+ import { injectable } from './decorators/inject/Injectable';
4
+ import { lateInject } from './decorators/inject/LateInject';
5
+ import { lifecycleBound } from './decorators/LifecycleBound';
6
+ import { provides } from './decorators/provides/Provides';
7
+ import { singleton } from './decorators/Singleton';
1
8
  import _Obsidian from './Obsidian';
2
9
 
3
10
  export * from './types';
4
11
 
5
- export { Graph } from './decorators/Graph';
6
- export { Singleton } from './decorators/Singleton';
12
+ export { graph } from './decorators/Graph';
13
+ export { singleton } from './decorators/Singleton';
7
14
  export { ObjectGraph } from './graph/ObjectGraph';
8
15
  export { Graph as IGraph } from './graph/Graph';
9
- export { Provides } from './decorators/provides/Provides';
10
- export { Injectable } from './decorators/inject/Injectable';
11
- export { Inject } from './decorators/inject/Inject';
12
- export { LateInject } from './decorators/inject/LateInject';
13
- export { LifecycleBound } from './decorators/LifecycleBound';
16
+ export { provides } from './decorators/provides/Provides';
17
+ export { injectable } from './decorators/inject/Injectable';
18
+ export { inject } from './decorators/inject/Inject';
19
+ export { lateInject } from './decorators/inject/LateInject';
20
+ export { lifecycleBound } from './decorators/LifecycleBound';
14
21
  export { GraphMiddleware } from './graph/registry/GraphMiddleware';
15
22
  export { GraphResolveChain as ResolveChain } from './graph/registry/GraphResolveChain';
16
23
 
24
+ /**
25
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming conventions. Please use `@graph` instead.
26
+ */
27
+ export const Graph = graph;
28
+ /**
29
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@singleton` instead.
30
+ */
31
+ export const Singleton = singleton;
32
+ /**
33
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@provides` instead.
34
+ */
35
+ export const Provides = provides;
36
+ /**
37
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@injectable` instead.
38
+ */
39
+ export const Injectable = injectable;
40
+ /**
41
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@inject` instead.
42
+ */
43
+ export const Inject = inject;
44
+ /**
45
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@lateInject` instead.
46
+ */
47
+ export const LateInject = lateInject;
48
+ /**
49
+ * @deprecated Uppercase decorators are deprecated in favor of lowercase decorators to align with common naming convention. Please use `@lifecycleBound` instead.
50
+ */
51
+ export const LifecycleBound = lifecycleBound;
52
+
53
+
17
54
  export const Obsidian = new _Obsidian();
18
55
 
19
56
  export { injectComponent } from './injectors/components/InjectComponent';
@@ -9,6 +9,7 @@ import {
9
9
  ObjectExpression,
10
10
  ObjectPattern,
11
11
  TSParameterProperty,
12
+ type StringLiteral,
12
13
  } from '@babel/types';
13
14
 
14
15
  const never = '';
@@ -16,7 +17,7 @@ const never = '';
16
17
  export type AcceptedNodeType = Identifier | TSParameterProperty | ClassProperty;
17
18
 
18
19
  export function providerIsNotNamed(decorator: Decorator): boolean {
19
- const argument = getDecoratorArgument(decorator);
20
+ const argument = getDecoratorObjectArgument(decorator);
20
21
  if (t.isObjectExpression(argument)) {
21
22
  return argument.properties.find((p) => {
22
23
  if (t.isObjectProperty(p)) {
@@ -29,7 +30,7 @@ export function providerIsNotNamed(decorator: Decorator): boolean {
29
30
  }
30
31
 
31
32
  export function addNameToProviderArguments(node: ClassMethod, decorator: Decorator) {
32
- const argument = getDecoratorArgument(decorator) ?? t.objectExpression([]);
33
+ const argument = getDecoratorObjectArgument(decorator) ?? t.objectExpression([]);
33
34
  argument.properties.push(t.objectProperty(
34
35
  t.identifier('name'),
35
36
  t.stringLiteral(getMethodName(node)),
@@ -37,13 +38,20 @@ export function addNameToProviderArguments(node: ClassMethod, decorator: Decorat
37
38
  (decorator.expression as CallExpression).arguments = [argument];
38
39
  }
39
40
 
40
- export function getDecoratorArgument(decorator: Decorator): ObjectExpression | undefined {
41
+ export function getDecoratorObjectArgument(decorator: Decorator): ObjectExpression | undefined {
41
42
  if (t.isCallExpression(decorator.expression)) {
42
43
  return decorator.expression.arguments.find((a) => t.isObjectExpression(a)) as ObjectExpression;
43
44
  }
44
45
  return undefined;
45
46
  }
46
47
 
48
+ export function getDecoratorStringArgument(decorator: Decorator): StringLiteral | undefined {
49
+ if (t.isCallExpression(decorator.expression)) {
50
+ return decorator.expression.arguments.find(a => t.isStringLiteral(a)) as StringLiteral;
51
+ }
52
+ return undefined;
53
+ }
54
+
47
55
  export function getMethodName(node: ClassMethod): string {
48
56
  if (t.isIdentifier(node.key)) return node.key.name;
49
57
  throw new Error(`Tried to get class name but encountered unexpected key of type: ${node.key.type}`);
@@ -1,4 +1,3 @@
1
- /* eslint-disable no-param-reassign */
2
1
  import {
3
2
  ClassMethod,
4
3
  ClassProperty,
@@ -20,22 +19,27 @@ const providerArgumentsTransformer: PluginObj = {
20
19
  const internalVisitor = {
21
20
  ClassMethod: {
22
21
  enter({ node }: NodePath<ClassMethod>) {
22
+ unmagler.saveClassMethod('provides', node);
23
23
  unmagler.saveClassMethod('Provides', node);
24
24
  },
25
25
  },
26
26
  ClassProperty: {
27
27
  enter({ node }: NodePath<ClassProperty>) {
28
+ unmagler.saveClassProperty('inject', node);
29
+ unmagler.saveClassProperty('lateInject', node);
28
30
  unmagler.saveClassProperty('Inject', node);
29
31
  unmagler.saveClassProperty('LateInject', node);
30
32
  },
31
33
  },
32
34
  Identifier: {
33
35
  enter({ node }: NodePath<Identifier>) {
36
+ unmagler.saveIdentifier('inject', node);
34
37
  unmagler.saveIdentifier('Inject', node);
35
38
  },
36
39
  },
37
40
  TSParameterProperty: {
38
41
  enter({ node }: NodePath<TSParameterProperty>) {
42
+ unmagler.saveTSParameterProperty('inject', node);
39
43
  unmagler.saveTSParameterProperty('Inject', node);
40
44
  },
41
45
  },
@@ -3,7 +3,7 @@ import {
3
3
  getDecoratorName,
4
4
  getDecoratorByName,
5
5
  passParamNameAsInjectArgument,
6
- getDecoratorArgument,
6
+ getDecoratorStringArgument,
7
7
  AcceptedNodeType,
8
8
  } from '../helpers';
9
9
 
@@ -15,7 +15,7 @@ function savePropertyName(name: string, node: AcceptedNodeType) {
15
15
  }
16
16
 
17
17
  function injectIsNotNamed(decorator: Decorator): boolean {
18
- return getDecoratorArgument(decorator) === undefined;
18
+ return getDecoratorStringArgument(decorator) === undefined;
19
19
  }
20
20
 
21
21
  export default savePropertyName;