@rxap/ts-morph 1.1.0-dev.9 → 1.2.0-dev.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.
- package/CHANGELOG.md +170 -0
- package/README.md +1 -1
- package/package.json +8 -6
- package/src/index.d.ts +13 -0
- package/src/index.js +13 -0
- package/src/index.js.map +1 -1
- package/src/lib/angular/add-route.d.ts +12 -0
- package/src/lib/angular/add-route.js +77 -0
- package/src/lib/angular/add-route.js.map +1 -0
- package/src/lib/angular/build-route-object.d.ts +20 -0
- package/src/lib/angular/build-route-object.js +68 -0
- package/src/lib/angular/build-route-object.js.map +1 -0
- package/src/lib/angular/coerce-app-config-provider.js +1 -1
- package/src/lib/angular/coerce-app-config-provider.js.map +1 -1
- package/src/lib/angular/coerce-app-navigation.d.ts +13 -0
- package/src/lib/angular/coerce-app-navigation.js +99 -0
- package/src/lib/angular/coerce-app-navigation.js.map +1 -0
- package/src/lib/angular/coerce-app-routes.d.ts +4 -0
- package/src/lib/angular/coerce-app-routes.js +27 -0
- package/src/lib/angular/coerce-app-routes.js.map +1 -0
- package/src/lib/angular/coerce-component-import.d.ts +1 -1
- package/src/lib/angular/coerce-component-import.js +9 -7
- package/src/lib/angular/coerce-component-import.js.map +1 -1
- package/src/lib/angular/coerce-component-input.js +10 -10
- package/src/lib/angular/coerce-component-input.js.map +1 -1
- package/src/lib/angular/coerce-component.d.ts +1 -1
- package/src/lib/angular/coerce-component.js +15 -2
- package/src/lib/angular/coerce-component.js.map +1 -1
- package/src/lib/angular/coerce-layout-routes.d.ts +4 -0
- package/src/lib/angular/coerce-layout-routes.js +63 -0
- package/src/lib/angular/coerce-layout-routes.js.map +1 -0
- package/src/lib/angular/coerce-route-guard.d.ts +6 -0
- package/src/lib/angular/coerce-route-guard.js +34 -0
- package/src/lib/angular/coerce-route-guard.js.map +1 -0
- package/src/lib/angular/coerce-routes.d.ts +8 -0
- package/src/lib/angular/coerce-routes.js +43 -0
- package/src/lib/angular/coerce-routes.js.map +1 -0
- package/src/lib/angular/find-parent-route.d.ts +6 -0
- package/src/lib/angular/find-parent-route.js +76 -0
- package/src/lib/angular/find-parent-route.js.map +1 -0
- package/src/lib/angular/get-component-decorator-object.js +5 -5
- package/src/lib/angular/get-component-decorator-object.js.map +1 -1
- package/src/lib/angular/remove-component-import.d.ts +3 -0
- package/src/lib/angular/remove-component-import.js +23 -0
- package/src/lib/angular/remove-component-import.js.map +1 -0
- package/src/lib/angular/remove-route.d.ts +13 -0
- package/src/lib/angular/remove-route.js +58 -0
- package/src/lib/angular/remove-route.js.map +1 -0
- package/src/lib/coerce-array-element.js +6 -1
- package/src/lib/coerce-array-element.js.map +1 -1
- package/src/lib/coerce-default-class-export.d.ts +1 -1
- package/src/lib/coerce-default-class-export.js +3 -16
- package/src/lib/coerce-default-class-export.js.map +1 -1
- package/src/lib/coerce-default-export.d.ts +2 -0
- package/src/lib/coerce-default-export.js +14 -0
- package/src/lib/coerce-default-export.js.map +1 -0
- package/src/lib/coerce-dependency-injection.d.ts +1 -1
- package/src/lib/coerce-dependency-injection.js +42 -31
- package/src/lib/coerce-dependency-injection.js.map +1 -1
- package/src/lib/coerce-imports.js +10 -0
- package/src/lib/coerce-imports.js.map +1 -1
- package/src/lib/coerce-statements.d.ts +1 -1
- package/src/lib/coerce-statements.js +8 -3
- package/src/lib/coerce-statements.js.map +1 -1
- package/src/lib/data-property.d.ts +10 -6
- package/src/lib/data-property.js +31 -7
- package/src/lib/data-property.js.map +1 -1
- package/src/lib/get-coerce-array-literal-form-object-literal.d.ts +1 -0
- package/src/lib/get-coerce-array-literal-form-object-literal.js +19 -1
- package/src/lib/get-coerce-array-literal-form-object-literal.js.map +1 -1
- package/src/lib/identifier.d.ts +10 -0
- package/src/lib/identifier.js +16 -0
- package/src/lib/identifier.js.map +1 -0
- package/src/lib/nest/add-health-endpoint.js +1 -0
- package/src/lib/nest/add-health-endpoint.js.map +1 -1
- package/src/lib/nest/coerce-nest-app-config.js +14 -1
- package/src/lib/nest/coerce-nest-app-config.js.map +1 -1
- package/src/lib/nest/coerce-nest-cache-module-import.d.ts +4 -0
- package/src/lib/nest/coerce-nest-cache-module-import.js +26 -0
- package/src/lib/nest/coerce-nest-cache-module-import.js.map +1 -0
- package/src/lib/type-import.d.ts +18 -3
- package/src/lib/type-import.js +28 -8
- package/src/lib/type-import.js.map +1 -1
- package/src/lib/upstream-options.d.ts +49 -7
- package/src/lib/upstream-options.js +69 -15
- package/src/lib/upstream-options.js.map +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,176 @@
|
|
|
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.2.0-dev.0](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0...@rxap/ts-morph@1.2.0-dev.0) (2024-05-22)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
- **ts-morph:** add parameter existence check in constructor ([c97c18b](https://gitlab.com/rxap/packages/commit/c97c18b165227f12beb9b812d1d57bbefae3e6be))
|
|
11
|
+
|
|
12
|
+
# [1.1.0](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.30...@rxap/ts-morph@1.1.0) (2024-04-17)
|
|
13
|
+
|
|
14
|
+
**Note:** Version bump only for package @rxap/ts-morph
|
|
15
|
+
|
|
16
|
+
# [1.1.0-dev.30](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.29...@rxap/ts-morph@1.1.0-dev.30) (2024-04-16)
|
|
17
|
+
|
|
18
|
+
### Performance Improvements
|
|
19
|
+
|
|
20
|
+
- skip ([e0163e7](https://gitlab.com/rxap/packages/commit/e0163e7bdaa3f9397f68570365686da1a3285196))
|
|
21
|
+
|
|
22
|
+
# [1.1.0-dev.29](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.28...@rxap/ts-morph@1.1.0-dev.29) (2024-04-12)
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
- support simple module imports ([941f726](https://gitlab.com/rxap/packages/commit/941f726b85df2cdcf6d1db00ebaba25d27bf1f0e))
|
|
27
|
+
|
|
28
|
+
# [1.1.0-dev.28](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.27...@rxap/ts-morph@1.1.0-dev.28) (2024-04-10)
|
|
29
|
+
|
|
30
|
+
### Features
|
|
31
|
+
|
|
32
|
+
- support complex remove instructions ([960fac0](https://gitlab.com/rxap/packages/commit/960fac050bec4e2b017c2006fac615ccede09ab2))
|
|
33
|
+
- support search and add route by component ([6dd9f2e](https://gitlab.com/rxap/packages/commit/6dd9f2e7fedfe4cbd3af86f88be7b8221c3ae867))
|
|
34
|
+
|
|
35
|
+
# [1.1.0-dev.27](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.26...@rxap/ts-morph@1.1.0-dev.27) (2024-04-10)
|
|
36
|
+
|
|
37
|
+
### Bug Fixes
|
|
38
|
+
|
|
39
|
+
- use regex to test text ([039d854](https://gitlab.com/rxap/packages/commit/039d854c60ab798444fc527bab13f865bfc274f4))
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
- support module federation ([814c393](https://gitlab.com/rxap/packages/commit/814c393c174b8baae969bec4f060eb8a58aaa316))
|
|
44
|
+
|
|
45
|
+
# [1.1.0-dev.26](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.25...@rxap/ts-morph@1.1.0-dev.26) (2024-04-09)
|
|
46
|
+
|
|
47
|
+
### Features
|
|
48
|
+
|
|
49
|
+
- add RemoveRoute function ([187e2ec](https://gitlab.com/rxap/packages/commit/187e2ec3deebc4eee9754fff4a22a8546ad58b4a))
|
|
50
|
+
|
|
51
|
+
# [1.1.0-dev.25](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.24...@rxap/ts-morph@1.1.0-dev.25) (2024-04-07)
|
|
52
|
+
|
|
53
|
+
**Note:** Version bump only for package @rxap/ts-morph
|
|
54
|
+
|
|
55
|
+
# [1.1.0-dev.24](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.23...@rxap/ts-morph@1.1.0-dev.24) (2024-04-03)
|
|
56
|
+
|
|
57
|
+
### Features
|
|
58
|
+
|
|
59
|
+
- add CoerceRouteGuard function ([813eb34](https://gitlab.com/rxap/packages/commit/813eb34199c51b643dca36217b68b6b3a9c4e324))
|
|
60
|
+
- add the default auth guard ([c439ec4](https://gitlab.com/rxap/packages/commit/c439ec4dd30bbc25772a80e765790d0f05544cd5))
|
|
61
|
+
|
|
62
|
+
# [1.1.0-dev.23](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.22...@rxap/ts-morph@1.1.0-dev.23) (2024-04-03)
|
|
63
|
+
|
|
64
|
+
### Bug Fixes
|
|
65
|
+
|
|
66
|
+
- use environment.app to get the default sentry server name ([c89f1bd](https://gitlab.com/rxap/packages/commit/c89f1bdc99425aaee1417b51dfe05c17dbb6565e))
|
|
67
|
+
|
|
68
|
+
### Features
|
|
69
|
+
|
|
70
|
+
- support app navigation icon coerce ([b37c6c8](https://gitlab.com/rxap/packages/commit/b37c6c814d21420260c5d4966152a11ca49a81bd))
|
|
71
|
+
|
|
72
|
+
# [1.1.0-dev.22](https://gitlab.com/rxap/packages/compare/@rxap/ts-morph@1.1.0-dev.21...@rxap/ts-morph@1.1.0-dev.22) (2024-03-31)
|
|
73
|
+
|
|
74
|
+
### Bug Fixes
|
|
75
|
+
|
|
76
|
+
- ensure default string value is wrapped in quotes ([2d16467](https://gitlab.com/rxap/packages/commit/2d16467015b36db9a67e9655961a961a576ef47f))
|
|
77
|
+
- import CacheModule as global module ([fe1b28e](https://gitlab.com/rxap/packages/commit/fe1b28e86aa282c4e06968e36328bc30d1283133))
|
|
78
|
+
|
|
79
|
+
# [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)
|
|
80
|
+
|
|
81
|
+
### Bug Fixes
|
|
82
|
+
|
|
83
|
+
- normalize the insert at instead to 0 if negative ([11161d8](https://gitlab.com/rxap/packages/commit/11161d86fe48c6314c7fcea3389a7d67a7c7e809))
|
|
84
|
+
- skip component selector if false ([d7d3bed](https://gitlab.com/rxap/packages/commit/d7d3bed5c74e204810132452d969c29e76d9f265))
|
|
85
|
+
- support component routes ([6431132](https://gitlab.com/rxap/packages/commit/64311320d13db6e96699613b30ffbb336388f9bf))
|
|
86
|
+
|
|
87
|
+
### Features
|
|
88
|
+
|
|
89
|
+
- support route outlet and data ([ce4dec6](https://gitlab.com/rxap/packages/commit/ce4dec6008f77a8482a50d53c6b450522d64451c))
|
|
90
|
+
|
|
91
|
+
# [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)
|
|
92
|
+
|
|
93
|
+
### Bug Fixes
|
|
94
|
+
|
|
95
|
+
- pass missing name property ([3329809](https://gitlab.com/rxap/packages/commit/332980968b8440738e3441074fd2e4f187c01666))
|
|
96
|
+
|
|
97
|
+
### Features
|
|
98
|
+
|
|
99
|
+
- auto detect the inset at index ([948d812](https://gitlab.com/rxap/packages/commit/948d8127d132622f442d69a593ef995b16febe40))
|
|
100
|
+
- support complex load children and component ([4c10be5](https://gitlab.com/rxap/packages/commit/4c10be5ce97e57c7f554870eb4f93a2555f621f3))
|
|
101
|
+
|
|
102
|
+
# [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)
|
|
103
|
+
|
|
104
|
+
### Bug Fixes
|
|
105
|
+
|
|
106
|
+
- initialize the routes var ([a76a951](https://gitlab.com/rxap/packages/commit/a76a951530d494dcd982ee31a5adcc9e18f7a29b))
|
|
107
|
+
- resolve syntax errors ([ebd11fd](https://gitlab.com/rxap/packages/commit/ebd11fd86e5929929ba5801d4e92bf82f4599a57))
|
|
108
|
+
- use current route var name ([9950d00](https://gitlab.com/rxap/packages/commit/9950d00216cef4b52f2341271e950e8e06dd95e2))
|
|
109
|
+
- use new angular and nestjs injection concept ([be23f6a](https://gitlab.com/rxap/packages/commit/be23f6ad51b0e6268eb4f593304177236ddbd83a))
|
|
110
|
+
|
|
111
|
+
### Features
|
|
112
|
+
|
|
113
|
+
- add CoerceAppNavigations function ([92013b9](https://gitlab.com/rxap/packages/commit/92013b9e241af74d355528929cfd5018486d381c))
|
|
114
|
+
- add CoerceAppRoutes function ([175f1fb](https://gitlab.com/rxap/packages/commit/175f1fb0d24280d73d0cea2d81583ea10c54e448))
|
|
115
|
+
- add CoerceLayoutRoutes function ([9523ccb](https://gitlab.com/rxap/packages/commit/9523ccb4702e1c1237358ad9149c3edd5febca9a))
|
|
116
|
+
|
|
117
|
+
# [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)
|
|
118
|
+
|
|
119
|
+
### Bug Fixes
|
|
120
|
+
|
|
121
|
+
- add Overwrite options type ([abf5d68](https://gitlab.com/rxap/packages/commit/abf5d68e01b4883ebf865da740973d9a18c3e319))
|
|
122
|
+
- ensure no index out of change error occurs ([bdcd4e0](https://gitlab.com/rxap/packages/commit/bdcd4e0722e259ae5b50eeaf7e79d70034d50aa5))
|
|
123
|
+
|
|
124
|
+
### Features
|
|
125
|
+
|
|
126
|
+
- add function CoerceNestCacheModuleImport ([8de41bf](https://gitlab.com/rxap/packages/commit/8de41bf32674dd652d6846377f28514553426af4))
|
|
127
|
+
|
|
128
|
+
# [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)
|
|
129
|
+
|
|
130
|
+
### Features
|
|
131
|
+
|
|
132
|
+
- support custom mappers ([3970d65](https://gitlab.com/rxap/packages/commit/3970d65e099d85b57a345017af625bbc2d3b3475))
|
|
133
|
+
- support to options mapper ([0672e06](https://gitlab.com/rxap/packages/commit/0672e06618f11e5af31daffc5ded8caac3ce7a16))
|
|
134
|
+
|
|
135
|
+
# [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)
|
|
136
|
+
|
|
137
|
+
### Bug Fixes
|
|
138
|
+
|
|
139
|
+
- support complex data properties ([2294a05](https://gitlab.com/rxap/packages/commit/2294a05260c5d876ebf5ff209fd450592c7ebe4b))
|
|
140
|
+
- support complex data properties ([39d8967](https://gitlab.com/rxap/packages/commit/39d8967c7e1ac111d15d4ac246f15494730b6b78))
|
|
141
|
+
|
|
142
|
+
# [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)
|
|
143
|
+
|
|
144
|
+
### Bug Fixes
|
|
145
|
+
|
|
146
|
+
- support templates ([af98937](https://gitlab.com/rxap/packages/commit/af9893704046c8728b1d6a778f803acf21ff8908))
|
|
147
|
+
|
|
148
|
+
# [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)
|
|
149
|
+
|
|
150
|
+
### Bug Fixes
|
|
151
|
+
|
|
152
|
+
- ensure the column name is camelized ([08edb88](https://gitlab.com/rxap/packages/commit/08edb88eb0b68309eceebc2b5b9bf7824b687eaf))
|
|
153
|
+
|
|
154
|
+
# [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)
|
|
155
|
+
|
|
156
|
+
### Features
|
|
157
|
+
|
|
158
|
+
- add IdentifierOptions interface ([0e16cc0](https://gitlab.com/rxap/packages/commit/0e16cc004509841f0ad7d4924c93ae81f90c4587))
|
|
159
|
+
|
|
160
|
+
# [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)
|
|
161
|
+
|
|
162
|
+
### Bug Fixes
|
|
163
|
+
|
|
164
|
+
- ensure the guess type is only used if required ([f663aee](https://gitlab.com/rxap/packages/commit/f663aee47f90dbd6398ed7f268f6d67d36b6f140))
|
|
165
|
+
|
|
166
|
+
# [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)
|
|
167
|
+
|
|
168
|
+
**Note:** Version bump only for package @rxap/ts-morph
|
|
169
|
+
|
|
170
|
+
# [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)
|
|
171
|
+
|
|
172
|
+
### Bug Fixes
|
|
173
|
+
|
|
174
|
+
- add type TypeName ([8e3f328](https://gitlab.com/rxap/packages/commit/8e3f32805558d10d80cad46e040e88efeaa7c0d3))
|
|
175
|
+
|
|
6
176
|
# [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)
|
|
7
177
|
|
|
8
178
|
### Bug Fixes
|
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "1.
|
|
2
|
+
"version": "1.2.0-dev.0",
|
|
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
|
|
9
|
+
"@rxap/utilities": "^16.1.0",
|
|
10
|
+
"colors": "^1.4.0",
|
|
10
11
|
"ts-morph": "^18.0.0",
|
|
11
12
|
"tslib": "2.6.2"
|
|
12
13
|
},
|
|
@@ -22,13 +23,15 @@
|
|
|
22
23
|
"keywords": [
|
|
23
24
|
"packages",
|
|
24
25
|
"rxap",
|
|
26
|
+
"scope:utilities",
|
|
27
|
+
"standalone",
|
|
25
28
|
"ts-morph"
|
|
26
29
|
],
|
|
27
30
|
"nx-migrations": {
|
|
28
31
|
"packageGroup": [
|
|
29
32
|
{
|
|
30
33
|
"package": "@rxap/utilities",
|
|
31
|
-
"version": "16.1.0
|
|
34
|
+
"version": "16.1.0"
|
|
32
35
|
}
|
|
33
36
|
]
|
|
34
37
|
},
|
|
@@ -42,7 +45,6 @@
|
|
|
42
45
|
"directory": "packages/ts-morph"
|
|
43
46
|
},
|
|
44
47
|
"type": "commonjs",
|
|
45
|
-
"gitHead": "
|
|
46
|
-
"main": "./src/index.js"
|
|
47
|
-
"types": "./src/index.d.ts"
|
|
48
|
+
"gitHead": "070b26bd1ac2e04282ca1db6a8adce151c09ee66",
|
|
49
|
+
"main": "./src/index.js"
|
|
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,12 +28,22 @@ 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-route-guard';
|
|
41
|
+
export * from './lib/angular/coerce-routes';
|
|
42
|
+
export * from './lib/angular/find-parent-route';
|
|
34
43
|
export * from './lib/angular/get-component-class';
|
|
35
44
|
export * from './lib/angular/get-component-decorator-object';
|
|
45
|
+
export * from './lib/angular/remove-component-import';
|
|
46
|
+
export * from './lib/angular/remove-route';
|
|
36
47
|
export * from './lib/add-provider-to-array';
|
|
37
48
|
export * from './lib/coerce-accessor-declaration';
|
|
38
49
|
export * from './lib/coerce-array-element';
|
|
@@ -42,6 +53,7 @@ export * from './lib/coerce-class-property';
|
|
|
42
53
|
export * from './lib/coerce-class';
|
|
43
54
|
export * from './lib/coerce-decorator';
|
|
44
55
|
export * from './lib/coerce-default-class-export';
|
|
56
|
+
export * from './lib/coerce-default-export';
|
|
45
57
|
export * from './lib/coerce-dependency-injection';
|
|
46
58
|
export * from './lib/coerce-imports';
|
|
47
59
|
export * from './lib/coerce-mapping-class-method';
|
|
@@ -56,6 +68,7 @@ export * from './lib/get-class-decorator-arguments';
|
|
|
56
68
|
export * from './lib/get-class';
|
|
57
69
|
export * from './lib/get-coerce-array-literal-form-object-literal';
|
|
58
70
|
export * from './lib/has-constructor-parameter';
|
|
71
|
+
export * from './lib/identifier';
|
|
59
72
|
export * from './lib/provider-object';
|
|
60
73
|
export * from './lib/to-mapping-object';
|
|
61
74
|
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,12 +34,22 @@ 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-route-guard"), exports);
|
|
47
|
+
tslib_1.__exportStar(require("./lib/angular/coerce-routes"), exports);
|
|
48
|
+
tslib_1.__exportStar(require("./lib/angular/find-parent-route"), exports);
|
|
40
49
|
tslib_1.__exportStar(require("./lib/angular/get-component-class"), exports);
|
|
41
50
|
tslib_1.__exportStar(require("./lib/angular/get-component-decorator-object"), exports);
|
|
51
|
+
tslib_1.__exportStar(require("./lib/angular/remove-component-import"), exports);
|
|
52
|
+
tslib_1.__exportStar(require("./lib/angular/remove-route"), exports);
|
|
42
53
|
// endregion
|
|
43
54
|
// region
|
|
44
55
|
tslib_1.__exportStar(require("./lib/add-provider-to-array"), exports);
|
|
@@ -50,6 +61,7 @@ tslib_1.__exportStar(require("./lib/coerce-class-property"), exports);
|
|
|
50
61
|
tslib_1.__exportStar(require("./lib/coerce-class"), exports);
|
|
51
62
|
tslib_1.__exportStar(require("./lib/coerce-decorator"), exports);
|
|
52
63
|
tslib_1.__exportStar(require("./lib/coerce-default-class-export"), exports);
|
|
64
|
+
tslib_1.__exportStar(require("./lib/coerce-default-export"), exports);
|
|
53
65
|
tslib_1.__exportStar(require("./lib/coerce-dependency-injection"), exports);
|
|
54
66
|
tslib_1.__exportStar(require("./lib/coerce-imports"), exports);
|
|
55
67
|
tslib_1.__exportStar(require("./lib/coerce-mapping-class-method"), exports);
|
|
@@ -64,6 +76,7 @@ tslib_1.__exportStar(require("./lib/get-class-decorator-arguments"), exports);
|
|
|
64
76
|
tslib_1.__exportStar(require("./lib/get-class"), exports);
|
|
65
77
|
tslib_1.__exportStar(require("./lib/get-coerce-array-literal-form-object-literal"), exports);
|
|
66
78
|
tslib_1.__exportStar(require("./lib/has-constructor-parameter"), exports);
|
|
79
|
+
tslib_1.__exportStar(require("./lib/identifier"), exports);
|
|
67
80
|
tslib_1.__exportStar(require("./lib/provider-object"), exports);
|
|
68
81
|
tslib_1.__exportStar(require("./lib/to-mapping-object"), exports);
|
|
69
82
|
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,mFAAy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ularRoute } from './build-route-object';
|
|
3
|
+
import 'colors';
|
|
4
|
+
export declare function DefaultInsertAtFactory(route: AngularRoute): (array: ArrayLiteralExpression) => number;
|
|
5
|
+
export interface AddRouteOptions {
|
|
6
|
+
route: AngularRoute;
|
|
7
|
+
path?: string[];
|
|
8
|
+
component?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
insertAt?: (array: ArrayLiteralExpression) => number;
|
|
11
|
+
}
|
|
12
|
+
export declare function AddRoute(sourceFile: SourceFile, options: AddRouteOptions): void;
|
|
@@ -0,0 +1,77 @@
|
|
|
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
|
+
require("colors");
|
|
9
|
+
function DefaultInsertAtFactory(route) {
|
|
10
|
+
return (array) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
const elementCount = array.getElements().length;
|
|
13
|
+
if (route.path === '') {
|
|
14
|
+
if (elementCount > 0) {
|
|
15
|
+
const lastElement = array.getElements()[elementCount - 1];
|
|
16
|
+
if (lastElement.isKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression)) {
|
|
17
|
+
if ((_a = lastElement.asKindOrThrow(ts_morph_1.SyntaxKind.ObjectLiteralExpression).getProperty('path')) === null || _a === void 0 ? void 0 : _a.getText().match(/\*\*/)) {
|
|
18
|
+
return elementCount - 2;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
return array.getElements().length - 1;
|
|
23
|
+
}
|
|
24
|
+
let insertAt = 0;
|
|
25
|
+
if (elementCount > 0) {
|
|
26
|
+
// find the first object literal
|
|
27
|
+
// this ensures that use of variables for route imports like STATUS_CHECK_ROUTE is always the first element
|
|
28
|
+
for (const element of array.getElements()) {
|
|
29
|
+
if (!element.isKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression)) {
|
|
30
|
+
insertAt++;
|
|
31
|
+
}
|
|
32
|
+
if (element.isKind(ts_morph_1.SyntaxKind.ObjectLiteralExpression)) {
|
|
33
|
+
if (((_b = element.asKindOrThrow(ts_morph_1.SyntaxKind.ObjectLiteralExpression).getProperty('path')) === null || _b === void 0 ? void 0 : _b.getText()) === '') {
|
|
34
|
+
insertAt++;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return insertAt;
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
exports.DefaultInsertAtFactory = DefaultInsertAtFactory;
|
|
49
|
+
function AddRoute(sourceFile, options) {
|
|
50
|
+
const { component, route, path, name = 'ROUTES', insertAt = DefaultInsertAtFactory(route) } = options;
|
|
51
|
+
const routes = sourceFile.getVariableDeclaration(name);
|
|
52
|
+
if (routes) {
|
|
53
|
+
let initializer = routes.getInitializerIfKindOrThrow(ts_morph_1.SyntaxKind.ArrayLiteralExpression);
|
|
54
|
+
if (path === null || path === void 0 ? void 0 : path.length) {
|
|
55
|
+
initializer = (0, find_parent_route_1.FindParentRouteChildrenArrayByPath)(initializer, path);
|
|
56
|
+
}
|
|
57
|
+
if (initializer) {
|
|
58
|
+
if (component) {
|
|
59
|
+
initializer = (0, find_parent_route_1.FindParentRouteChildrenArrayByComponent)(initializer, component);
|
|
60
|
+
}
|
|
61
|
+
if (initializer) {
|
|
62
|
+
(0, coerce_array_element_1.CoerceArrayElement)(initializer, (0, build_route_object_1.BuildRouteObject)(route), (0, coerce_array_element_1.FindArrayElementByObjectProperty)('path', route.path), insertAt);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
console.log(`Could not find parent route by component for '${component}'`.yellow);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
console.log(`Could not find parent route by path for '${path}'`.yellow);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
else {
|
|
73
|
+
console.log(`${name} variable not found`.red);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.AddRoute = AddRoute;
|
|
77
|
+
//# 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,2DAG6B;AAC7B,kBAAgB;AAEhB,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,CAAC,qBAAU,CAAC,uBAAuB,CAAC,EAAE;oBAC1D,IAAI,MAAA,WAAW,CAAC,aAAa,CAAC,qBAAU,CAAC,uBAAuB,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,0CAAE,OAAO,GAAG,KAAK,CAAC,MAAM,CAAC,EAAE;wBAC9G,OAAO,YAAY,GAAG,CAAC,CAAC;qBACzB;iBACF;aACF;YACD,OAAO,KAAK,CAAC,WAAW,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SACvC;QACD,IAAI,QAAQ,GAAG,CAAC,CAAC;QACjB,IAAI,YAAY,GAAG,CAAC,EAAE;YACpB,g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f,IAAA,yCAAkB,EAChB,WAAW,EAAE,IAAA,qCAAgB,EAAC,KAAK,CAAC,EAAE,IAAA,uDAAgC,EAAC,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,CAAC;aACzG;iBAAM;gBACL,OAAO,CAAC,GAAG,CAAC,iDAAiD,SAAS,GAAG,CAAC,MAAM,CAAC,CAAC;aACnF;SACF;aAAM;YACL,OAAO,CAAC,GAAG,CAAC,4CAA4C,IAAI,GAAG,CAAC,MAAM,CAAC,CAAC;SACzE;KACF;SAAM;QACL,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,qBAAqB,CAAC,GAAG,CAAC,CAAC;KAC/C;AACH,CAAC;AAxBD,4BAwBC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
loadRemoteModule?: string | {
|
|
16
|
+
name: string;
|
|
17
|
+
entry?: string;
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export declare function BuildRouteObject(route: AngularRoute): WriterFunction;
|
|
@@ -0,0 +1,68 @@
|
|
|
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
|
+
var _a;
|
|
7
|
+
const obj = {
|
|
8
|
+
path: w => w.quote(route.path),
|
|
9
|
+
};
|
|
10
|
+
if (route.loadChildren) {
|
|
11
|
+
if (typeof route.loadChildren === 'string') {
|
|
12
|
+
obj['loadChildren'] = `() => import('${route.loadChildren}')`;
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
obj['loadChildren'] = `() => import('${route.loadChildren.import}').then((m) => m.${route.loadChildren.then})`;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (route.loadRemoteModule) {
|
|
19
|
+
let entry = './routes';
|
|
20
|
+
let name;
|
|
21
|
+
if (typeof route.loadRemoteModule === 'string') {
|
|
22
|
+
name = route.loadRemoteModule;
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
name = route.loadRemoteModule.name;
|
|
26
|
+
entry = (_a = route.loadRemoteModule.entry) !== null && _a !== void 0 ? _a : entry;
|
|
27
|
+
}
|
|
28
|
+
obj['loadChildren'] = `() => loadRemoteModule('${name}', '${entry}')`;
|
|
29
|
+
}
|
|
30
|
+
if (route.loadComponent) {
|
|
31
|
+
if (typeof route.loadComponent === 'string') {
|
|
32
|
+
obj['loadComponent'] = `() => import('${route.loadComponent}')`;
|
|
33
|
+
}
|
|
34
|
+
else {
|
|
35
|
+
obj['loadComponent'] = `() => import('${route.loadComponent.import}').then((m) => m.${route.loadComponent.then})`;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
else if (route.component) {
|
|
39
|
+
obj['component'] = route.component;
|
|
40
|
+
}
|
|
41
|
+
if (route.outlet) {
|
|
42
|
+
obj['outlet'] = w => w.quote(route.outlet);
|
|
43
|
+
}
|
|
44
|
+
if (route.data) {
|
|
45
|
+
obj['data'] = ts_morph_1.Writers.object(Object.entries(route.data)
|
|
46
|
+
.reduce((acc, [key, value]) => {
|
|
47
|
+
if (['true', 'false'].includes(value) || typeof value === 'boolean') {
|
|
48
|
+
if (typeof value === 'string') {
|
|
49
|
+
acc[key] = w => w.quote(value);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
acc[key] = value ? 'true' : 'false';
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (typeof value === 'number') {
|
|
56
|
+
acc[key] = value.toString();
|
|
57
|
+
}
|
|
58
|
+
if (!isNaN(Number(value))) {
|
|
59
|
+
acc[key] = value;
|
|
60
|
+
}
|
|
61
|
+
acc[key] = w => w.quote(value);
|
|
62
|
+
return acc;
|
|
63
|
+
}, {}));
|
|
64
|
+
}
|
|
65
|
+
return ts_morph_1.Writers.object(obj);
|
|
66
|
+
}
|
|
67
|
+
exports.BuildRouteObject = BuildRouteObject;
|
|
68
|
+
//# 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;AAYlB,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,gBAAgB,EAAE;QAC1B,IAAI,KAAK,GAAG,UAAU,CAAC;QACvB,IAAI,IAAY,CAAC;QACjB,IAAI,OAAO,KAAK,CAAC,gBAAgB,KAAK,QAAQ,EAAE;YAC9C,IAAI,GAAG,KAAK,CAAC,gBAAgB,CAAC;SAC/B;aAAM;YACL,IAAI,GAAG,KAAK,CAAC,gBAAgB,CAAC,IAAI,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BAAM;oBACL,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC;iBACrC;aACF;YACD,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;gBAC7B,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC;aAC7B;YACD,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE;gBACzB,GAAG,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;aAClB;YACD,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,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;AAvDD,4CAuDC"}
|
|
@@ -9,7 +9,7 @@ const get_coerce_array_literal_form_object_literal_1 = require("../get-coerce-ar
|
|
|
9
9
|
function CoerceAppConfigProvider(sourceFile, options) {
|
|
10
10
|
const { providers = [], httpInterceptors = [], importProvidersFrom = [], overwrite = false } = options;
|
|
11
11
|
const appConfigVariableDeclaration = (0, coerce_variable_declaration_1.CoerceVariableDeclaration)(sourceFile, 'appConfig', {
|
|
12
|
-
initializer: '{ providers: [] }',
|
|
12
|
+
initializer: '{ providers: [\n] }',
|
|
13
13
|
type: 'ApplicationConfig',
|
|
14
14
|
});
|
|
15
15
|
(0, coerce_imports_1.CoerceImports)(sourceFile, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coerce-app-config-provider.js","sourceRoot":"","sources":["../../../../../../packages/ts-morph/src/lib/angular/coerce-app-config-provider.ts"],"names":[],"mappings":";;;AAAA,uCAMkB;AAClB,oEAA8D;AAC9D,sDAAkD;AAClD,gFAA2E;AAC3E,kHAAyG;AAUzG,SAAgB,uBAAuB,CAAC,UAAsB,EAAE,OAAuC;IACrG,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,gBAAgB,GAAG,EAAE,EAAE,mBAAmB,GAAG,EAAE,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IACvG,MAAM,4BAA4B,GAAG,IAAA,uDAAyB,EAAC,UAAU,EAAE,WAAW,EAAE;QACtF,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"coerce-app-config-provider.js","sourceRoot":"","sources":["../../../../../../packages/ts-morph/src/lib/angular/coerce-app-config-provider.ts"],"names":[],"mappings":";;;AAAA,uCAMkB;AAClB,oEAA8D;AAC9D,sDAAkD;AAClD,gFAA2E;AAC3E,kHAAyG;AAUzG,SAAgB,uBAAuB,CAAC,UAAsB,EAAE,OAAuC;IACrG,MAAM,EAAE,SAAS,GAAG,EAAE,EAAE,gBAAgB,GAAG,EAAE,EAAE,mBAAmB,GAAG,EAAE,EAAE,SAAS,GAAG,KAAK,EAAE,GAAG,OAAO,CAAC;IACvG,MAAM,4BAA4B,GAAG,IAAA,uDAAyB,EAAC,UAAU,EAAE,WAAW,EAAE;QACtF,WAAW,EAAE,qBAAqB;QAClC,IAAI,EAAE,mBAAmB;KAC1B,CAAC,CAAC;IACH,IAAA,8BAAa,EAAC,UAAU,EAAE;QACxB,YAAY,EAAE,CAAE,mBAAmB,CAAE;QACrC,eAAe,EAAE,eAAe;KACjC,CAAC,CAAC;IACH,MAAM,SAAS,GAA4B,4BAA4B,CAAC,2BAA2B,CAAC,qBAAU,CAAC,uBAAuB,CAAC,CAAC;IACxI,MAAM,aAAa,GAAG,IAAA,qFAAsC,EAAC,SAAS,EAAE,WAAW,CAAC,CAAC;IACrF,KAAK,MAAM,cAAc,IAAI,SAAS,EAAE;QACtC,IAAA,0CAAkB,EAAC,cAAc,EAAE,aAAa,EAAE,SAAS,CAAC,CAAC;KAC9D;IACD,IAAI,gBAAgB,CAAC,MAAM,EAAE;QAC3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AAW,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,CAAC,CAAC;YAC7E,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBAChB,aAAa,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;aAC9B;SACF;KACF;IACD,IAAI,mBAAmB,CAAC,MAAM,EAAE;QAC9B,MAAM,aAAa,GAAG,IAAA,0CAAkB,EAAC,uBAAuB,EAAE,aAAa,EAAE,SAAS,CAAC;aACxF,aAAa,CAAC,qBAAU,CAAC,cAAc,CAAC,CAAC;QAC5C,IAAA,8BAAa,EAAC,UAAU,EAAE;YACxB,eAAe,EAAE,eAAe;YAChC,YAAY,EAAE,CAAE,qBAAqB,CAAE;SACxC,CAAC,CAAC;QACH,KAAK,MAAM,GAAG,IAAI,mBAAmB,EAAE;YACrC,MAAM,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,EAAE,KAAK,GAAG,CAAC,CAAC;YAC/E,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBAChB,aAAa,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;aAChC;SACF;KACF;AACH,CAAC;AA5DD,0DA4DC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
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
|
+
overwrite?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare function CoerceAppNavigation(sourceFile: SourceFile, options?: CoerceAppNavigationOptions): void;
|