@rxap/ts-morph 1.1.0-dev.2 → 1.1.0-dev.21

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 (78) hide show
  1. package/CHANGELOG.md +147 -0
  2. package/README.md +1 -1
  3. package/package.json +6 -4
  4. package/src/index.d.ts +10 -0
  5. package/src/index.js +10 -0
  6. package/src/index.js.map +1 -1
  7. package/src/lib/angular/add-route.d.ts +4 -0
  8. package/src/lib/angular/add-route.js +59 -0
  9. package/src/lib/angular/add-route.js.map +1 -0
  10. package/src/lib/angular/build-route-object.d.ts +16 -0
  11. package/src/lib/angular/build-route-object.js +55 -0
  12. package/src/lib/angular/build-route-object.js.map +1 -0
  13. package/src/lib/angular/coerce-app-navigation.d.ts +12 -0
  14. package/src/lib/angular/coerce-app-navigation.js +55 -0
  15. package/src/lib/angular/coerce-app-navigation.js.map +1 -0
  16. package/src/lib/angular/coerce-app-routes.d.ts +4 -0
  17. package/src/lib/angular/coerce-app-routes.js +27 -0
  18. package/src/lib/angular/coerce-app-routes.js.map +1 -0
  19. package/src/lib/angular/coerce-component-import.d.ts +1 -1
  20. package/src/lib/angular/coerce-component-import.js +9 -7
  21. package/src/lib/angular/coerce-component-import.js.map +1 -1
  22. package/src/lib/angular/coerce-component-input.js +10 -10
  23. package/src/lib/angular/coerce-component-input.js.map +1 -1
  24. package/src/lib/angular/coerce-component.d.ts +1 -1
  25. package/src/lib/angular/coerce-component.js +15 -2
  26. package/src/lib/angular/coerce-component.js.map +1 -1
  27. package/src/lib/angular/coerce-layout-routes.d.ts +4 -0
  28. package/src/lib/angular/coerce-layout-routes.js +63 -0
  29. package/src/lib/angular/coerce-layout-routes.js.map +1 -0
  30. package/src/lib/angular/coerce-routes.d.ts +11 -0
  31. package/src/lib/angular/coerce-routes.js +35 -0
  32. package/src/lib/angular/coerce-routes.js.map +1 -0
  33. package/src/lib/angular/find-parent-route.d.ts +2 -0
  34. package/src/lib/angular/find-parent-route.js +54 -0
  35. package/src/lib/angular/find-parent-route.js.map +1 -0
  36. package/src/lib/angular/get-component-decorator-object.js +5 -5
  37. package/src/lib/angular/get-component-decorator-object.js.map +1 -1
  38. package/src/lib/coerce-array-element.js +6 -1
  39. package/src/lib/coerce-array-element.js.map +1 -1
  40. package/src/lib/coerce-decorator.js +5 -0
  41. package/src/lib/coerce-decorator.js.map +1 -1
  42. package/src/lib/coerce-default-class-export.d.ts +1 -1
  43. package/src/lib/coerce-default-class-export.js +3 -16
  44. package/src/lib/coerce-default-class-export.js.map +1 -1
  45. package/src/lib/coerce-default-export.d.ts +2 -0
  46. package/src/lib/coerce-default-export.js +14 -0
  47. package/src/lib/coerce-default-export.js.map +1 -0
  48. package/src/lib/coerce-dependency-injection.d.ts +1 -1
  49. package/src/lib/coerce-dependency-injection.js +36 -32
  50. package/src/lib/coerce-dependency-injection.js.map +1 -1
  51. package/src/lib/coerce-statements.d.ts +1 -1
  52. package/src/lib/coerce-statements.js +8 -3
  53. package/src/lib/coerce-statements.js.map +1 -1
  54. package/src/lib/data-property.d.ts +13 -6
  55. package/src/lib/data-property.js +50 -6
  56. package/src/lib/data-property.js.map +1 -1
  57. package/src/lib/find-function.js +1 -1
  58. package/src/lib/find-function.js.map +1 -1
  59. package/src/lib/identifier.d.ts +10 -0
  60. package/src/lib/identifier.js +16 -0
  61. package/src/lib/identifier.js.map +1 -0
  62. package/src/lib/nest/add-health-endpoint.js +1 -0
  63. package/src/lib/nest/add-health-endpoint.js.map +1 -1
  64. package/src/lib/nest/coerce-nest-cache-module-import.d.ts +4 -0
  65. package/src/lib/nest/coerce-nest-cache-module-import.js +25 -0
  66. package/src/lib/nest/coerce-nest-cache-module-import.js.map +1 -0
  67. package/src/lib/nest/coerce-nest-operation.d.ts +6 -5
  68. package/src/lib/nest/coerce-nest-operation.js +30 -26
  69. package/src/lib/nest/coerce-nest-operation.js.map +1 -1
  70. package/src/lib/nest/operation-id-utilities.d.ts +1 -1
  71. package/src/lib/nest/operation-id-utilities.js +3 -3
  72. package/src/lib/nest/operation-id-utilities.js.map +1 -1
  73. package/src/lib/type-import.d.ts +19 -4
  74. package/src/lib/type-import.js +33 -13
  75. package/src/lib/type-import.js.map +1 -1
  76. package/src/lib/upstream-options.d.ts +50 -6
  77. package/src/lib/upstream-options.js +70 -15
  78. package/src/lib/upstream-options.js.map +1 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,153 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [1.1.0-dev.21](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.20...@rxap/ts-morph@1.1.0-dev.21) (2024-03-23)
7
+
8
+ ### Bug Fixes
9
+
10
+ - normalize the insert at instead to 0 if negative ([11161d8](https://gitlab.com/rxap/packages/commit/11161d86fe48c6314c7fcea3389a7d67a7c7e809))
11
+ - skip component selector if false ([d7d3bed](https://gitlab.com/rxap/packages/commit/d7d3bed5c74e204810132452d969c29e76d9f265))
12
+ - support component routes ([6431132](https://gitlab.com/rxap/packages/commit/64311320d13db6e96699613b30ffbb336388f9bf))
13
+
14
+ ### Features
15
+
16
+ - support route outlet and data ([ce4dec6](https://gitlab.com/rxap/packages/commit/ce4dec6008f77a8482a50d53c6b450522d64451c))
17
+
18
+ # [1.1.0-dev.20](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.19...@rxap/ts-morph@1.1.0-dev.20) (2024-03-15)
19
+
20
+ ### Bug Fixes
21
+
22
+ - pass missing name property ([3329809](https://gitlab.com/rxap/packages/commit/332980968b8440738e3441074fd2e4f187c01666))
23
+
24
+ ### Features
25
+
26
+ - auto detect the inset at index ([948d812](https://gitlab.com/rxap/packages/commit/948d8127d132622f442d69a593ef995b16febe40))
27
+ - support complex load children and component ([4c10be5](https://gitlab.com/rxap/packages/commit/4c10be5ce97e57c7f554870eb4f93a2555f621f3))
28
+
29
+ # [1.1.0-dev.19](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.18...@rxap/ts-morph@1.1.0-dev.19) (2024-03-14)
30
+
31
+ ### Bug Fixes
32
+
33
+ - initialize the routes var ([a76a951](https://gitlab.com/rxap/packages/commit/a76a951530d494dcd982ee31a5adcc9e18f7a29b))
34
+ - resolve syntax errors ([ebd11fd](https://gitlab.com/rxap/packages/commit/ebd11fd86e5929929ba5801d4e92bf82f4599a57))
35
+ - use current route var name ([9950d00](https://gitlab.com/rxap/packages/commit/9950d00216cef4b52f2341271e950e8e06dd95e2))
36
+ - use new angular and nestjs injection concept ([be23f6a](https://gitlab.com/rxap/packages/commit/be23f6ad51b0e6268eb4f593304177236ddbd83a))
37
+
38
+ ### Features
39
+
40
+ - add CoerceAppNavigations function ([92013b9](https://gitlab.com/rxap/packages/commit/92013b9e241af74d355528929cfd5018486d381c))
41
+ - add CoerceAppRoutes function ([175f1fb](https://gitlab.com/rxap/packages/commit/175f1fb0d24280d73d0cea2d81583ea10c54e448))
42
+ - add CoerceLayoutRoutes function ([9523ccb](https://gitlab.com/rxap/packages/commit/9523ccb4702e1c1237358ad9149c3edd5febca9a))
43
+
44
+ # [1.1.0-dev.18](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.17...@rxap/ts-morph@1.1.0-dev.18) (2024-03-11)
45
+
46
+ ### Bug Fixes
47
+
48
+ - add Overwrite options type ([abf5d68](https://gitlab.com/rxap/packages/commit/abf5d68e01b4883ebf865da740973d9a18c3e319))
49
+ - ensure no index out of change error occurs ([bdcd4e0](https://gitlab.com/rxap/packages/commit/bdcd4e0722e259ae5b50eeaf7e79d70034d50aa5))
50
+
51
+ ### Features
52
+
53
+ - add function CoerceNestCacheModuleImport ([8de41bf](https://gitlab.com/rxap/packages/commit/8de41bf32674dd652d6846377f28514553426af4))
54
+
55
+ # [1.1.0-dev.17](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.16...@rxap/ts-morph@1.1.0-dev.17) (2024-03-09)
56
+
57
+ ### Features
58
+
59
+ - support custom mappers ([3970d65](https://gitlab.com/rxap/packages/commit/3970d65e099d85b57a345017af625bbc2d3b3475))
60
+ - support to options mapper ([0672e06](https://gitlab.com/rxap/packages/commit/0672e06618f11e5af31daffc5ded8caac3ce7a16))
61
+
62
+ # [1.1.0-dev.16](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.15...@rxap/ts-morph@1.1.0-dev.16) (2024-03-09)
63
+
64
+ ### Bug Fixes
65
+
66
+ - support complex data properties ([2294a05](https://gitlab.com/rxap/packages/commit/2294a05260c5d876ebf5ff209fd450592c7ebe4b))
67
+ - support complex data properties ([39d8967](https://gitlab.com/rxap/packages/commit/39d8967c7e1ac111d15d4ac246f15494730b6b78))
68
+
69
+ # [1.1.0-dev.15](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.14...@rxap/ts-morph@1.1.0-dev.15) (2024-03-07)
70
+
71
+ ### Bug Fixes
72
+
73
+ - support templates ([af98937](https://gitlab.com/rxap/packages/commit/af9893704046c8728b1d6a778f803acf21ff8908))
74
+
75
+ # [1.1.0-dev.14](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.13...@rxap/ts-morph@1.1.0-dev.14) (2024-03-07)
76
+
77
+ ### Bug Fixes
78
+
79
+ - ensure the column name is camelized ([08edb88](https://gitlab.com/rxap/packages/commit/08edb88eb0b68309eceebc2b5b9bf7824b687eaf))
80
+
81
+ # [1.1.0-dev.13](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.12...@rxap/ts-morph@1.1.0-dev.13) (2024-03-07)
82
+
83
+ ### Features
84
+
85
+ - add IdentifierOptions interface ([0e16cc0](https://gitlab.com/rxap/packages/commit/0e16cc004509841f0ad7d4924c93ae81f90c4587))
86
+
87
+ # [1.1.0-dev.12](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.11...@rxap/ts-morph@1.1.0-dev.12) (2024-03-07)
88
+
89
+ ### Bug Fixes
90
+
91
+ - ensure the guess type is only used if required ([f663aee](https://gitlab.com/rxap/packages/commit/f663aee47f90dbd6398ed7f268f6d67d36b6f140))
92
+
93
+ # [1.1.0-dev.11](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.10...@rxap/ts-morph@1.1.0-dev.11) (2024-03-05)
94
+
95
+ **Note:** Version bump only for package @rxap/ts-morph
96
+
97
+ # [1.1.0-dev.10](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.9...@rxap/ts-morph@1.1.0-dev.10) (2024-03-04)
98
+
99
+ ### Bug Fixes
100
+
101
+ - add type TypeName ([8e3f328](https://gitlab.com/rxap/packages/commit/8e3f32805558d10d80cad46e040e88efeaa7c0d3))
102
+
103
+ # [1.1.0-dev.9](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.8...@rxap/ts-morph@1.1.0-dev.9) (2024-03-01)
104
+
105
+ ### Bug Fixes
106
+
107
+ - detect icon config ([8648071](https://gitlab.com/rxap/packages/commit/8648071772f28933d686f1984e7bb081b241f1f4))
108
+
109
+ # [1.1.0-dev.8](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.7...@rxap/ts-morph@1.1.0-dev.8) (2024-03-01)
110
+
111
+ ### Bug Fixes
112
+
113
+ - guess type for uuid ([c0dc126](https://gitlab.com/rxap/packages/commit/c0dc12663d77b56624b2dfb4be347ec3101cb4cd))
114
+
115
+ # [1.1.0-dev.7](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.6...@rxap/ts-morph@1.1.0-dev.7) (2024-02-29)
116
+
117
+ ### Bug Fixes
118
+
119
+ - add type arguments correctly ([6a4de9c](https://gitlab.com/rxap/packages/commit/6a4de9c1b7affa2bd42a854be647b7fcae36e8c9))
120
+
121
+ # [1.1.0-dev.6](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.5...@rxap/ts-morph@1.1.0-dev.6) (2024-02-29)
122
+
123
+ ### Bug Fixes
124
+
125
+ - improve operation naming and return types ([16ea0b3](https://gitlab.com/rxap/packages/commit/16ea0b3eb2f7679c101d034e72f8013f5513ecb6))
126
+
127
+ ### Features
128
+
129
+ - generate table select resolve method ([5db6649](https://gitlab.com/rxap/packages/commit/5db6649cac0ff8dd36170679fc726057fa5d57d1))
130
+
131
+ # [1.1.0-dev.5](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.4...@rxap/ts-morph@1.1.0-dev.5) (2024-02-28)
132
+
133
+ ### Bug Fixes
134
+
135
+ - respect the identifier option ([bd6c6b2](https://gitlab.com/rxap/packages/commit/bd6c6b2d6770534f7d2136ac489acae2de8f0d16))
136
+
137
+ ### Features
138
+
139
+ - support custom properties for accordion controllers ([82da170](https://gitlab.com/rxap/packages/commit/82da170f9ff490ec2502e0b21283b100848e6108))
140
+
141
+ # [1.1.0-dev.4](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.3...@rxap/ts-morph@1.1.0-dev.4) (2024-02-26)
142
+
143
+ ### Features
144
+
145
+ - support default type import ([0c50e7a](https://gitlab.com/rxap/packages/commit/0c50e7a837d4b985f3fbb5062d058e54cd223e22))
146
+
147
+ # [1.1.0-dev.3](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.2...@rxap/ts-morph@1.1.0-dev.3) (2024-02-26)
148
+
149
+ ### Bug Fixes
150
+
151
+ - support non service commands ([7346933](https://gitlab.com/rxap/packages/commit/73469338e563e4c2d589f8059959380acc6d61fb))
152
+
6
153
  # [1.1.0-dev.2](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.1...@rxap/ts-morph@1.1.0-dev.2) (2024-02-25)
7
154
 
8
155
  ### Bug Fixes
package/README.md CHANGED
@@ -17,5 +17,5 @@ yarn add @rxap/ts-morph
17
17
  ```
18
18
  **Install peer dependencies:**
19
19
  ```bash
20
- yarn add @rxap/utilities@^16.1.0-dev.0 ts-morph@^18.0.0 tslib@2.6.2
20
+ yarn add @rxap/utilities@^16.1.0-dev.7 ts-morph@^18.0.0 tslib@2.6.2
21
21
  ```
package/package.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
- "version": "1.1.0-dev.2",
2
+ "version": "1.1.0-dev.21",
3
3
  "name": "@rxap/ts-morph",
4
4
  "license": "GPL-3.0-or-later",
5
5
  "dependencies": {
6
6
  "tslib": "2.6.2"
7
7
  },
8
8
  "peerDependencies": {
9
- "@rxap/utilities": "^16.1.0-dev.0",
9
+ "@rxap/utilities": "^16.1.0-dev.7",
10
10
  "ts-morph": "^18.0.0",
11
11
  "tslib": "2.6.2"
12
12
  },
@@ -22,13 +22,15 @@
22
22
  "keywords": [
23
23
  "packages",
24
24
  "rxap",
25
+ "scope:utilities",
26
+ "standalone",
25
27
  "ts-morph"
26
28
  ],
27
29
  "nx-migrations": {
28
30
  "packageGroup": [
29
31
  {
30
32
  "package": "@rxap/utilities",
31
- "version": "16.1.0-dev.0"
33
+ "version": "16.1.0-dev.7"
32
34
  }
33
35
  ]
34
36
  },
@@ -42,7 +44,7 @@
42
44
  "directory": "packages/ts-morph"
43
45
  },
44
46
  "type": "commonjs",
45
- "gitHead": "58070f2586b30e6bb1a13247cef1330da97279a1",
47
+ "gitHead": "c325cc61fc1c4180be0712a36ec43835a590af4f",
46
48
  "main": "./src/index.js",
47
49
  "types": "./src/index.d.ts"
48
50
  }
package/src/index.d.ts CHANGED
@@ -7,6 +7,7 @@ export * from './lib/nest/coerce-health-module';
7
7
  export * from './lib/nest/coerce-nest-app-config';
8
8
  export * from './lib/nest/coerce-nest-app-controller';
9
9
  export * from './lib/nest/coerce-nest-app-module';
10
+ export * from './lib/nest/coerce-nest-cache-module-import';
10
11
  export * from './lib/nest/coerce-nest-config-module-import';
11
12
  export * from './lib/nest/coerce-nest-controller';
12
13
  export * from './lib/nest/coerce-nest-environment-provider';
@@ -27,10 +28,17 @@ export * from './lib/nest/nest-provider-object';
27
28
  export * from './lib/nest/operation-id-utilities';
28
29
  export * from './lib/nest/remove-nest-module-provider';
29
30
  export * from './lib/nest/remove-nest-provider-to-array';
31
+ export * from './lib/angular/add-route';
32
+ export * from './lib/angular/build-route-object';
30
33
  export * from './lib/angular/coerce-app-config-provider';
34
+ export * from './lib/angular/coerce-app-navigation';
35
+ export * from './lib/angular/coerce-app-routes';
31
36
  export * from './lib/angular/coerce-component-import';
32
37
  export * from './lib/angular/coerce-component-input';
33
38
  export * from './lib/angular/coerce-component';
39
+ export * from './lib/angular/coerce-layout-routes';
40
+ export * from './lib/angular/coerce-routes';
41
+ export * from './lib/angular/find-parent-route';
34
42
  export * from './lib/angular/get-component-class';
35
43
  export * from './lib/angular/get-component-decorator-object';
36
44
  export * from './lib/add-provider-to-array';
@@ -42,6 +50,7 @@ export * from './lib/coerce-class-property';
42
50
  export * from './lib/coerce-class';
43
51
  export * from './lib/coerce-decorator';
44
52
  export * from './lib/coerce-default-class-export';
53
+ export * from './lib/coerce-default-export';
45
54
  export * from './lib/coerce-dependency-injection';
46
55
  export * from './lib/coerce-imports';
47
56
  export * from './lib/coerce-mapping-class-method';
@@ -56,6 +65,7 @@ export * from './lib/get-class-decorator-arguments';
56
65
  export * from './lib/get-class';
57
66
  export * from './lib/get-coerce-array-literal-form-object-literal';
58
67
  export * from './lib/has-constructor-parameter';
68
+ export * from './lib/identifier';
59
69
  export * from './lib/provider-object';
60
70
  export * from './lib/to-mapping-object';
61
71
  export * from './lib/type-import';
package/src/index.js CHANGED
@@ -11,6 +11,7 @@ tslib_1.__exportStar(require("./lib/nest/coerce-health-module"), exports);
11
11
  tslib_1.__exportStar(require("./lib/nest/coerce-nest-app-config"), exports);
12
12
  tslib_1.__exportStar(require("./lib/nest/coerce-nest-app-controller"), exports);
13
13
  tslib_1.__exportStar(require("./lib/nest/coerce-nest-app-module"), exports);
14
+ tslib_1.__exportStar(require("./lib/nest/coerce-nest-cache-module-import"), exports);
14
15
  tslib_1.__exportStar(require("./lib/nest/coerce-nest-config-module-import"), exports);
15
16
  tslib_1.__exportStar(require("./lib/nest/coerce-nest-controller"), exports);
16
17
  tslib_1.__exportStar(require("./lib/nest/coerce-nest-environment-provider"), exports);
@@ -33,10 +34,17 @@ tslib_1.__exportStar(require("./lib/nest/remove-nest-module-provider"), exports)
33
34
  tslib_1.__exportStar(require("./lib/nest/remove-nest-provider-to-array"), exports);
34
35
  // endregion
35
36
  // region angular
37
+ tslib_1.__exportStar(require("./lib/angular/add-route"), exports);
38
+ tslib_1.__exportStar(require("./lib/angular/build-route-object"), exports);
36
39
  tslib_1.__exportStar(require("./lib/angular/coerce-app-config-provider"), exports);
40
+ tslib_1.__exportStar(require("./lib/angular/coerce-app-navigation"), exports);
41
+ tslib_1.__exportStar(require("./lib/angular/coerce-app-routes"), exports);
37
42
  tslib_1.__exportStar(require("./lib/angular/coerce-component-import"), exports);
38
43
  tslib_1.__exportStar(require("./lib/angular/coerce-component-input"), exports);
39
44
  tslib_1.__exportStar(require("./lib/angular/coerce-component"), exports);
45
+ tslib_1.__exportStar(require("./lib/angular/coerce-layout-routes"), exports);
46
+ tslib_1.__exportStar(require("./lib/angular/coerce-routes"), exports);
47
+ tslib_1.__exportStar(require("./lib/angular/find-parent-route"), exports);
40
48
  tslib_1.__exportStar(require("./lib/angular/get-component-class"), exports);
41
49
  tslib_1.__exportStar(require("./lib/angular/get-component-decorator-object"), exports);
42
50
  // endregion
@@ -50,6 +58,7 @@ tslib_1.__exportStar(require("./lib/coerce-class-property"), exports);
50
58
  tslib_1.__exportStar(require("./lib/coerce-class"), exports);
51
59
  tslib_1.__exportStar(require("./lib/coerce-decorator"), exports);
52
60
  tslib_1.__exportStar(require("./lib/coerce-default-class-export"), exports);
61
+ tslib_1.__exportStar(require("./lib/coerce-default-export"), exports);
53
62
  tslib_1.__exportStar(require("./lib/coerce-dependency-injection"), exports);
54
63
  tslib_1.__exportStar(require("./lib/coerce-imports"), exports);
55
64
  tslib_1.__exportStar(require("./lib/coerce-mapping-class-method"), exports);
@@ -64,6 +73,7 @@ tslib_1.__exportStar(require("./lib/get-class-decorator-arguments"), exports);
64
73
  tslib_1.__exportStar(require("./lib/get-class"), exports);
65
74
  tslib_1.__exportStar(require("./lib/get-coerce-array-literal-form-object-literal"), exports);
66
75
  tslib_1.__exportStar(require("./lib/has-constructor-parameter"), exports);
76
+ tslib_1.__exportStar(require("./lib/identifier"), exports);
67
77
  tslib_1.__exportStar(require("./lib/provider-object"), exports);
68
78
  tslib_1.__exportStar(require("./lib/to-mapping-object"), exports);
69
79
  tslib_1.__exportStar(require("./lib/type-import"), exports);
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/ts-morph/src/index.ts"],"names":[],"mappings":";;;AAAA,cAAc;AACd,yEAA+C;AAC/C,0EAAgD;AAChD,mFAAyD;AACzD,+EAAqD;AACrD,8EAAoD;AACpD,0EAAgD;AAChD,4EAAkD;AAClD,gFAAsD;AACtD,4EAAkD;AAClD,sFAA4D;AAC5D,4EAAkD;AAClD,sFAA4D;AAC5D,iFAAuD;AACvD,mFAAyD;AACzD,+EAAqD;AACrD,iFAAuD;AACvD,wEAA8C;AAC9C,2EAAiD;AACjD,mFAAyD;AACzD,yFAA+D;AAC/D,kFAAwD;AACxD,0EAAgD;AAChD,8EAAoD;AACpD,2EAAiD;AACjD,0EAAgD;AAChD,0EAAgD;AAChD,4EAAkD;AAClD,iFAAuD;AACvD,mFAAyD;AACzD,YAAY;AAEZ,iBAAiB;AACjB,mFAAyD;AACzD,gFAAsD;AACtD,+EAAqD;AACrD,yEAA+C;AAC/C,4EAAkD;AAClD,uFAA6D;AAC7D,YAAY;AAEZ,UAAU;AACV,sEAA4C;AAC5C,4EAAkD;AAClD,qEAA2C;AAC3C,yEAA+C;AAC/C,oEAA0C;AAC1C,sEAA4C;AAC5C,6DAAmC;AACnC,iEAAuC;AACvC,4EAAkD;AAClD,4EAAkD;AAClD,+DAAqC;AACrC,4EAAkD;AAClD,4EAAkD;AAClD,mEAAyC;AACzC,kEAAwC;AACxC,4EAAkD;AAClD,+DAAqC;AACrC,8DAAoC;AACpC,8DAAoC;AACpC,8EAAoD;AACpD,0DAAgC;AAChC,6FAAmE;AACnE,0EAAgD;AAChD,gEAAsC;AACtC,kEAAwC;AACxC,4DAAkC;AAClC,iEAAuC;AACvC,2DAAiC;AACjC,YAAY"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/ts-morph/src/index.ts"],"names":[],"mappings":";;;AAAA,cAAc;AACd,yEAA+C;AAC/C,0EAAgD;AAChD,mFAAyD;AACzD,+EAAqD;AACrD,8EAAoD;AACpD,0EAAgD;AAChD,4EAAkD;AAClD,gFAAsD;AACtD,4EAAkD;AAClD,qFAA2D;AAC3D,sFAA4D;AAC5D,4EAAkD;AAClD,sFAA4D;AAC5D,iFAAuD;AACvD,mFAAyD;AACzD,+EAAqD;AACrD,iFAAuD;AACvD,wEAA8C;AAC9C,2EAAiD;AACjD,mFAAyD;AACzD,yFAA+D;AAC/D,kFAAwD;AACxD,0EAAgD;AAChD,8EAAoD;AACpD,2EAAiD;AACjD,0EAAgD;AAChD,0EAAgD;AAChD,4EAAkD;AAClD,iFAAuD;AACvD,mFAAyD;AACzD,YAAY;AAEZ,iBAAiB;AACjB,kEAAwC;AACxC,2EAAiD;AACjD,mFAAyD;AACzD,8EAAoD;AACpD,0EAAgD;AAChD,gFAAsD;AACtD,+EAAqD;AACrD,yEAA+C;AAC/C,6EAAmD;AACnD,sEAA4C;AAC5C,0EAAgD;AAChD,4EAAkD;AAClD,uFAA6D;AAC7D,YAAY;AAEZ,UAAU;AACV,sEAA4C;AAC5C,4EAAkD;AAClD,qEAA2C;AAC3C,yEAA+C;AAC/C,oEAA0C;AAC1C,sEAA4C;AAC5C,6DAAmC;AACnC,iEAAuC;AACvC,4EAAkD;AAClD,sEAA4C;AAC5C,4EAAkD;AAClD,+DAAqC;AACrC,4EAAkD;AAClD,4EAAkD;AAClD,mEAAyC;AACzC,kEAAwC;AACxC,4EAAkD;AAClD,+DAAqC;AACrC,8DAAoC;AACpC,8DAAoC;AACpC,8EAAoD;AACpD,0DAAgC;AAChC,6FAAmE;AACnE,0EAAgD;AAChD,2DAAiC;AACjC,gEAAsC;AACtC,kEAAwC;AACxC,4DAAkC;AAClC,iEAAuC;AACvC,2DAAiC;AACjC,YAAY"}
@@ -0,0 +1,4 @@
1
+ import { ArrayLiteralExpression, SourceFile } from 'ts-morph';
2
+ import { AngularRoute } from './build-route-object';
3
+ export declare function DefaultInsertAtFactory(route: AngularRoute): (array: ArrayLiteralExpression) => number;
4
+ export declare function AddRoute(sourceFile: SourceFile, route: AngularRoute, path?: string[], name?: string, insertAt?: (array: ArrayLiteralExpression) => number): void;
@@ -0,0 +1,59 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AddRoute = exports.DefaultInsertAtFactory = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ const coerce_array_element_1 = require("../coerce-array-element");
6
+ const build_route_object_1 = require("./build-route-object");
7
+ const find_parent_route_1 = require("./find-parent-route");
8
+ function DefaultInsertAtFactory(route) {
9
+ return (array) => {
10
+ var _a;
11
+ const elementCount = array.getElements().length;
12
+ if (route.path === '') {
13
+ if (elementCount > 0) {
14
+ const lastElement = array.getElements()[elementCount - 1];
15
+ if (lastElement.isKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression)) {
16
+ if ((_a = lastElement.asKindOrThrow(ts_morph_1.SyntaxKind.ObjectLiteralExpression).getProperty('path')) === null || _a === void 0 ? void 0 : _a.getText().match(/\*\*/)) {
17
+ return elementCount - 2;
18
+ }
19
+ }
20
+ }
21
+ return array.getElements().length - 1;
22
+ }
23
+ let insertAt = 0;
24
+ if (elementCount > 0) {
25
+ // find the first object literal
26
+ // this ensures that use of variables for route imports like STATUS_CHECK_ROUTE is always the first element
27
+ for (const element of array.getElements()) {
28
+ if (!element.isKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression)) {
29
+ insertAt++;
30
+ }
31
+ else {
32
+ break;
33
+ }
34
+ }
35
+ }
36
+ return insertAt;
37
+ };
38
+ }
39
+ exports.DefaultInsertAtFactory = DefaultInsertAtFactory;
40
+ function AddRoute(sourceFile, route, path, name = 'ROUTES', insertAt = DefaultInsertAtFactory(route)) {
41
+ const routes = sourceFile.getVariableDeclaration(name);
42
+ if (routes) {
43
+ let initializer = routes.getInitializerIfKindOrThrow(ts_morph_1.SyntaxKind.ArrayLiteralExpression);
44
+ if (path === null || path === void 0 ? void 0 : path.length) {
45
+ initializer = (0, find_parent_route_1.FindParentRoute)(initializer, path);
46
+ }
47
+ if (initializer) {
48
+ (0, coerce_array_element_1.CoerceArrayElement)(initializer, (0, build_route_object_1.BuildRouteObject)(route), (0, coerce_array_element_1.FindArrayElementByObjectProperty)('path', route.path), insertAt);
49
+ }
50
+ else {
51
+ console.warn('Initializer not found');
52
+ }
53
+ }
54
+ else {
55
+ console.warn(`${name} variable not found`);
56
+ }
57
+ }
58
+ exports.AddRoute = AddRoute;
59
+ //# sourceMappingURL=add-route.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"add-route.js","sourceRoot":"","sources":["../../../../../../packages/ts-morph/src/lib/angular/add-route.ts"],"names":[],"mappings":";;;AAAA,uCAIkB;AAClB,kEAGiC;AACjC,6DAG8B;AAC9B,2DAAsD;AAEtD,SAAgB,sBAAsB,CAAC,KAAmB;IACxD,OAAO,CAAC,KAA6B,EAAE,EAAE;;QACvC,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,CAAC;QAChD,IAAI,KAAK,CAAC,IAAI,KAAK,EAAE,EAAE;YACrB,IAAI,YAAY,GAAG,CAAC,EAAE;gBACpB,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;gBAC1D,IAAI,WAAW,CAAC,MAAM,CAA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A,uDAAgC,EAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;SACzG;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,uBAAuB,CAAC,CAAC;SACvC;KACF;SAAM;QACL,OAAO,CAAC,IAAI,CAAC,GAAG,IAAI,qBAAqB,CAAC,CAAC;KAC5C;AACH,CAAC;AAhBD,4BAgBC"}
@@ -0,0 +1,16 @@
1
+ import { WriterFunction } from 'ts-morph';
2
+ export interface AngularRoute {
3
+ path: string;
4
+ component?: string;
5
+ loadChildren?: string | {
6
+ import: string;
7
+ then: string;
8
+ };
9
+ loadComponent?: string | {
10
+ import: string;
11
+ then: string;
12
+ };
13
+ outlet?: string | null;
14
+ data?: Record<string, any> | null;
15
+ }
16
+ export declare function BuildRouteObject(route: AngularRoute): WriterFunction;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.BuildRouteObject = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ function BuildRouteObject(route) {
6
+ const obj = {
7
+ path: w => w.quote(route.path),
8
+ };
9
+ if (route.loadChildren) {
10
+ if (typeof route.loadChildren === 'string') {
11
+ obj['loadChildren'] = `() => import('${route.loadChildren}')`;
12
+ }
13
+ else {
14
+ obj['loadChildren'] = `() => import('${route.loadChildren.import}').then((m) => m.${route.loadChildren.then})`;
15
+ }
16
+ }
17
+ if (route.loadComponent) {
18
+ if (typeof route.loadComponent === 'string') {
19
+ obj['loadComponent'] = `() => import('${route.loadComponent}')`;
20
+ }
21
+ else {
22
+ obj['loadComponent'] = `() => import('${route.loadComponent.import}').then((m) => m.${route.loadComponent.then})`;
23
+ }
24
+ }
25
+ else if (route.component) {
26
+ obj['component'] = route.component;
27
+ }
28
+ if (route.outlet) {
29
+ obj['outlet'] = w => w.quote(route.outlet);
30
+ }
31
+ if (route.data) {
32
+ obj['data'] = ts_morph_1.Writers.object(Object.entries(route.data)
33
+ .reduce((acc, [key, value]) => {
34
+ if (['true', 'false'].includes(value) || typeof value === 'boolean') {
35
+ if (typeof value === 'string') {
36
+ acc[key] = w => w.quote(value);
37
+ }
38
+ else {
39
+ acc[key] = value ? 'true' : 'false';
40
+ }
41
+ }
42
+ if (typeof value === 'number') {
43
+ acc[key] = value.toString();
44
+ }
45
+ if (!isNaN(Number(value))) {
46
+ acc[key] = value;
47
+ }
48
+ acc[key] = w => w.quote(value);
49
+ return acc;
50
+ }, {}));
51
+ }
52
+ return ts_morph_1.Writers.object(obj);
53
+ }
54
+ exports.BuildRouteObject = BuildRouteObject;
55
+ //# sourceMappingURL=build-route-object.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-route-object.js","sourceRoot":"","sources":["../../../../../../packages/ts-morph/src/lib/angular/build-route-object.ts"],"names":[],"mappings":";;;AAAA,uCAGkB;AAWlB,SAAgB,gBAAgB,CAAC,KAAmB;IAClD,MAAM,GAAG,GAA4C;QACnD,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC;KAC/B,CAAC;IACF,IAAI,KAAK,CAAC,YAAY,EAAE;QACtB,IAAI,OAAO,KAAK,CAAC,YAAY,KAAK,QAAQ,EAAE;YAC1C,GAAG,CAAC,cAAc,CAAC,GAAG,iBAAkB,KAAK,CAAC,YAAa,IAAI,CAAC;SACjE;aAAM;YACL,GAAG,CAAC,cAAc,CAAC,GAAG,iBAAkB,KAAK,CAAC,YAAY,CAAC,MAAO,oBAAqB,KAAK,CAAC,YAAY,CAAC,IAAK,GAAG,CAAC;SACpH;KACF;IACD,IAAI,KAAK,CAAC,aAAa,EAAE;QACvB,IAAI,OAAO,KAAK,CAAC,aAAa,KAAK,QAAQ,EAAE;YAC3C,GAAG,CAAC,eAAe,CAAC,GAAG,iBAAkB,KAAK,CAAC,aAAc,IAAI,CAAC;SACnE;aAAM;YACL,GAAG,CAAC,eAAe,CAAC,GAAG,iBAAkB,KAAK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CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;YAC/B,OAAO,GAAG,CAAC;QACb,CAAC,EAAE,EAA6C,CAAC,CAAC,CAAC;KACtD;IACD,OAAO,kBAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;AAC7B,CAAC;AA5CD,4CA4CC"}
@@ -0,0 +1,12 @@
1
+ import { IconConfig } from '@rxap/utilities';
2
+ import { SourceFile } from 'ts-morph';
3
+ export interface AppNavigationItem {
4
+ routerLink: string[];
5
+ label: string;
6
+ children?: AppNavigationItem[];
7
+ icon?: IconConfig;
8
+ }
9
+ export interface CoerceAppNavigationOptions {
10
+ itemList?: AppNavigationItem[];
11
+ }
12
+ export declare function CoerceAppNavigation(sourceFile: SourceFile, options?: CoerceAppNavigationOptions): void;
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoerceAppNavigation = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ const coerce_imports_1 = require("../coerce-imports");
6
+ const coerce_variable_declaration_1 = require("../coerce-variable-declaration");
7
+ function CoerceAppNavigation(sourceFile, options = {}) {
8
+ var _a;
9
+ const variableDeclaration = (0, coerce_variable_declaration_1.CoerceVariableDeclaration)(sourceFile, 'APP_NAVIGATION', {
10
+ type: '() => NavigationWithInserts',
11
+ initializer: '() => []',
12
+ });
13
+ (0, coerce_variable_declaration_1.CoerceVariableDeclaration)(sourceFile, 'APP_NAVIGATION_PROVIDER', {
14
+ initializer: ts_morph_1.Writers.object({
15
+ provide: 'RXAP_NAVIGATION_CONFIG',
16
+ useValue: 'APP_NAVIGATION',
17
+ }),
18
+ });
19
+ (0, coerce_imports_1.CoerceImports)(sourceFile, [
20
+ {
21
+ namedImports: ['NavigationWithInserts', 'RXAP_NAVIGATION_CONFIG'],
22
+ moduleSpecifier: '@rxap/layout',
23
+ },
24
+ ]);
25
+ const arrowFunction = variableDeclaration.getInitializerIfKindOrThrow(ts_morph_1.SyntaxKind.ArrowFunction);
26
+ const array = arrowFunction.getBody().asKindOrThrow(ts_morph_1.SyntaxKind.ArrayLiteralExpression);
27
+ const arrayLiteralExpression = array.asKindOrThrow(ts_morph_1.SyntaxKind.ArrayLiteralExpression);
28
+ const existingItems = arrayLiteralExpression.getElements()
29
+ .filter(e => e.isKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression))
30
+ .map(e => e.asKindOrThrow(ts_morph_1.SyntaxKind.ObjectLiteralExpression));
31
+ const existingItemLabels = existingItems.map(e => {
32
+ var _a;
33
+ return (_a = e.getProperty('label')) === null || _a === void 0 ? void 0 : _a.asKindOrThrow(ts_morph_1.SyntaxKind.PropertyAssignment).getInitializerIfKindOrThrow(ts_morph_1.SyntaxKind.StringLiteral).getText().trim().replace(/['"]/g, '');
34
+ });
35
+ for (const item of (_a = options.itemList) !== null && _a !== void 0 ? _a : []) {
36
+ if (!existingItemLabels.some(e => e === item.label)) {
37
+ arrayLiteralExpression.addElement(ts_morph_1.Writers.object({
38
+ routerLink: w => {
39
+ w.write('[');
40
+ for (let i = 0; i < item.routerLink.length; i++) {
41
+ const link = item.routerLink[i];
42
+ w.quote(link);
43
+ if (i < item.routerLink.length - 1) {
44
+ w.write(',');
45
+ }
46
+ }
47
+ w.write(']');
48
+ },
49
+ label: w => w.quote(item.label),
50
+ }));
51
+ }
52
+ }
53
+ }
54
+ exports.CoerceAppNavigation = CoerceAppNavigation;
55
+ //# sourceMappingURL=coerce-app-navigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerce-app-navigation.js","sourceRoot":"","sources":["../../../../../../packages/ts-morph/src/lib/angular/coerce-app-navigation.ts"],"names":[],"mappings":";;;AACA,uCAIkB;AAClB,sDAAkD;AAClD,gFAA2E;AAa3E,SAAgB,mBAAmB,CAAC,UAAsB,EAAE,UAAsC,EAAE;;IAElG,MAAM,mBAAmB,GAAG,IAAA,uDAAyB,EAAC,UAAU,EAAE,gBAAgB,EAAE;QACl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I,IAAI,MAAA,OAAO,CAAC,QAAQ,mCAAI,EAAE,EAAE;QACzC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,EAAE;YACnD,sBAAsB,CAAC,UAAU,CAAC,kBAAO,CAAC,MAAM,CAAC;gBAC/C,UAAU,EAAE,CAAC,CAAC,EAAE;oBACd,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBACb,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;wBAC/C,MAAM,IAAI,GAAG,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;wBAChC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;wBACd,IAAI,CAAC,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EAAE;4BAClC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;yBACd;qBACF;oBACD,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;gBACf,CAAC;gBACD,KAAK,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC;aAChC,CAAC,CAAC,CAAC;SACL;KAEF;AAEH,CAAC;AAlDD,kDAkDC"}
@@ -0,0 +1,4 @@
1
+ import { SourceFile } from 'ts-morph';
2
+ import { CoerceRoutesOptions } from './coerce-routes';
3
+ export type CoerceAppRoutesOptions = CoerceRoutesOptions;
4
+ export declare function CoerceAppRoutes(sourceFile: SourceFile, options?: CoerceAppRoutesOptions): import("ts-morph").VariableDeclaration;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CoerceAppRoutes = void 0;
4
+ const ts_morph_1 = require("ts-morph");
5
+ const coerce_imports_1 = require("../coerce-imports");
6
+ const coerce_routes_1 = require("./coerce-routes");
7
+ function CoerceAppRoutes(sourceFile, options = {}) {
8
+ var _a, _b;
9
+ const variableDeclaration = (0, coerce_routes_1.CoerceRoutes)(sourceFile, Object.assign(Object.assign({}, options), { name: (_a = options.name) !== null && _a !== void 0 ? _a : 'appRoutes', initializer: (_b = options.initializer) !== null && _b !== void 0 ? _b : (w => {
10
+ w.writeLine('[');
11
+ w.write('STATUS_CHECK_ROUTE,');
12
+ ts_morph_1.Writers.object({
13
+ path: w => w.quote('**'),
14
+ redirectTo: w => w.quote('')
15
+ })(w);
16
+ w.write(']');
17
+ }) }));
18
+ (0, coerce_imports_1.CoerceImports)(sourceFile, [
19
+ {
20
+ namedImports: ['STATUS_CHECK_ROUTE'],
21
+ moduleSpecifier: '@rxap/ngx-status-check'
22
+ },
23
+ ]);
24
+ return variableDeclaration;
25
+ }
26
+ exports.CoerceAppRoutes = CoerceAppRoutes;
27
+ //# sourceMappingURL=coerce-app-routes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"coerce-app-routes.js","sourceRoot":"","sources":["../../../../../../packages/ts-morph/src/lib/angular/coerce-app-routes.ts"],"names":[],"mappings":";;;AAAA,uCAGkB;AAClB,sDAAkD;AAClD,mDAGyB;AAIzB,SAAgB,eAAe,CAAC,UAAsB,EAAE,UAAkC,EAAE;;IAE1F,MAAM,mBAAmB,GAAG,IAAA,4BAAY,EAAC,UAAU,kCAC9C,OAAO,KACV,IAAI,EAAE,MAAA,OAAO,CAAC,IAAI,mCAAI,WAAW,EACjC,WAAW,EAAE,MAAA,OAAO,CAAC,WAAW,mCAAI,CAAC,CAAC,CAAC,EAAE;YACvC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YACjB,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,CAAC;YAC/B,kBAAO,CAAC,MAAM,CAAC;gBACb,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC;gBACxB,UAAU,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC,EAAE,CAAC;aAC7B,CAAC,CAAC,CAAC,CAAC,CAAC;YACN,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACf,CAAC,CAAC,IACF,CAAC;IAGH,IAAA,8BAAa,EAAC,UAAU,EAAE;QACxB;YACE,YAAY,EAAE,CAAE,oBAAoB,CAAE;YACtC,eAAe,EAAE,wBAAwB;SAC1C;KACF,CAAC,CAAC;IAEH,OAAO,mBAAmB,CAAC;AAE7B,CAAC;AA1BD,0CA0BC"}
@@ -1,5 +1,5 @@
1
- import { TypeImport } from '@rxap/ts-morph';
2
1
  import { ClassDeclaration, SourceFile } from 'ts-morph';
2
+ import { TypeImport } from '../type-import';
3
3
  /**
4
4
  * Coerces the component import by adding it to the imports array of the component decorator object.
5
5
  * If a module specifier is provided, the import is also coerced at the file level.
@@ -1,10 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CoerceComponentImport = void 0;
4
- const ts_morph_1 = require("@rxap/ts-morph");
4
+ const ts_morph_1 = require("ts-morph");
5
+ const coerce_array_element_1 = require("../coerce-array-element");
5
6
  const coerce_imports_1 = require("../coerce-imports");
6
- const ts_morph_2 = require("ts-morph");
7
7
  const get_coerce_array_literal_form_object_literal_1 = require("../get-coerce-array-literal-form-object-literal");
8
+ const type_import_1 = require("../type-import");
9
+ const get_component_class_1 = require("./get-component-class");
8
10
  const get_component_decorator_object_1 = require("./get-component-decorator-object");
9
11
  /**
10
12
  * Coerces the component import by adding it to the imports array of the component decorator object.
@@ -16,15 +18,15 @@ const get_component_decorator_object_1 = require("./get-component-decorator-obje
16
18
  */
17
19
  function CoerceComponentImport(sourceFileOrClassDeclaration, componentImport) {
18
20
  var _a;
19
- const classDeclaration = sourceFileOrClassDeclaration instanceof ts_morph_2.ClassDeclaration ? sourceFileOrClassDeclaration : (0, ts_morph_1.GetComponentClass)(sourceFileOrClassDeclaration);
20
- const sourceFile = sourceFileOrClassDeclaration instanceof ts_morph_2.SourceFile ? sourceFileOrClassDeclaration : sourceFileOrClassDeclaration.getSourceFile();
21
+ const classDeclaration = sourceFileOrClassDeclaration instanceof ts_morph_1.ClassDeclaration ? sourceFileOrClassDeclaration : (0, get_component_class_1.GetComponentClass)(sourceFileOrClassDeclaration);
22
+ const sourceFile = sourceFileOrClassDeclaration instanceof ts_morph_1.SourceFile ? sourceFileOrClassDeclaration : sourceFileOrClassDeclaration.getSourceFile();
21
23
  const importName = typeof componentImport === 'string' ? componentImport : (_a = componentImport.namedImport) !== null && _a !== void 0 ? _a : componentImport.name;
22
- if ((0, ts_morph_1.IsTypeImport)(componentImport)) {
23
- (0, coerce_imports_1.CoerceImports)(sourceFile, (0, ts_morph_1.TypeImportToImportStructure)(componentImport));
24
+ if ((0, type_import_1.IsTypeImport)(componentImport)) {
25
+ (0, coerce_imports_1.CoerceImports)(sourceFile, (0, type_import_1.TypeImportToImportStructure)(componentImport));
24
26
  }
25
27
  const componentDecoratorObject = (0, get_component_decorator_object_1.GetComponentDecoratorObject)(classDeclaration);
26
28
  const importsArray = (0, get_coerce_array_literal_form_object_literal_1.GetCoerceArrayLiteralFromObjectLiteral)(componentDecoratorObject, 'imports');
27
- (0, ts_morph_1.CoerceArrayElement)(importsArray, importName);
29
+ (0, coerce_array_element_1.CoerceArrayElement)(importsArray, importName);
28
30
  return importsArray;
29
31
  }
30
32
  exports.CoerceComponentImport = CoerceComponentImport;
@@ -1 +1 @@
1
- {"version":3,"file":"coerce-component-import.js","sourceRoot":"","sources":["../../../../../../packages/ts-morph/src/lib/angular/coerce-component-import.ts"],"names":[],"mappings":";;;AAAA,6CAMwB;AACxB,sDAAkD;AAClD,uCAGkB;AAClB,kHAAyG;AACzG,qFAA+E;AAE/E;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,4BAA2D,EAC3D,eAAoC;;IAGpC,MAAM,gBAAgB,GAAG,4BAA4B,YAAY,2BAAgB,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,IAAA,4BAAiB,EAAC,4BAA4B,CAAC,CAAC;IACnK,MAAM,UAAU,GAAG,4BAA4B,YAAY,qBAAU,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,4BAA4B,CAAC,aAAa,EAAE,CAAC;IAEpJ,MAAM,UAAU,GAAG,OAAO,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,eAAe,CAAC,WAAW,mCAAI,eAAe,CAAC,IAAI,CAAC;IAE/H,IAAI,IAAA,uBAAY,EAAC,eAAe,CAAC,EAAE;QACjC,IAAA,8BAAa,EAAC,UAAU,EAAE,IAAA,sCAA2B,EAAC,eAAe,CAAC,CAAC,CAAC;KACzE;IAED,MAAM,wBAAwB,GAAG,IAAA,4DAA2B,EAAC,gBAAgB,CAAC,CAAC;IAE/E,MAAM,YAAY,GAAG,IAAA,qFAAsC,EAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;IAEjG,IAAA,6BAAkB,EAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAE7C,OAAO,YAAY,CAAC;AAEtB,CAAC;AAtBD,sDAsBC"}
1
+ {"version":3,"file":"coerce-component-import.js","sourceRoot":"","sources":["../../../../../../packages/ts-morph/src/lib/angular/coerce-component-import.ts"],"names":[],"mappings":";;;AAAA,uCAGkB;AAClB,kEAA6D;AAC7D,sDAAkD;AAClD,kHAAyG;AACzG,gDAIwB;AACxB,+DAA0D;AAC1D,qFAA+E;AAE/E;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CACnC,4BAA2D,EAC3D,eAAoC;;IAGpC,MAAM,gBAAgB,GAAG,4BAA4B,YAAY,2BAAgB,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,IAAA,uCAAiB,EAAC,4BAA4B,CAAC,CAAC;IACnK,MAAM,UAAU,GAAG,4BAA4B,YAAY,qBAAU,CAAC,CAAC,CAAC,4BAA4B,CAAC,CAAC,CAAC,4BAA4B,CAAC,aAAa,EAAE,CAAC;IAEpJ,MAAM,UAAU,GAAG,OAAO,eAAe,KAAK,QAAQ,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,MAAA,eAAe,CAAC,WAAW,mCAAI,eAAe,CAAC,IAAI,CAAC;IAE/H,IAAI,IAAA,0BAAY,EAAC,eAAe,CAAC,EAAE;QACjC,IAAA,8BAAa,EAAC,UAAU,EAAE,IAAA,yCAA2B,EAAC,eAAe,CAAC,CAAC,CAAC;KACzE;IAED,MAAM,wBAAwB,GAAG,IAAA,4DAA2B,EAAC,gBAAgB,CAAC,CAAC;IAE/E,MAAM,YAAY,GAAG,IAAA,qFAAsC,EAAC,wBAAwB,EAAE,SAAS,CAAC,CAAC;IAEjG,IAAA,yCAAkB,EAAC,YAAY,EAAE,UAAU,CAAC,CAAC;IAE7C,OAAO,YAAY,CAAC;AAEtB,CAAC;AAtBD,sDAsBC"}