@decaf-ts/for-angular 0.1.0 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (375) hide show
  1. package/{dist/lib/fesm2022 → fesm2022}/decaf-ts-for-angular.mjs +93 -109
  2. package/fesm2022/decaf-ts-for-angular.mjs.map +1 -0
  3. package/{dist/lib/index.d.ts → index.d.ts} +6 -5
  4. package/package.json +15 -86
  5. package/.editorconfig +0 -31
  6. package/.gitlab-ci.yml +0 -197
  7. package/.hintrc +0 -19
  8. package/.prettierrc +0 -49
  9. package/.snyk +0 -13
  10. package/LICENSE.md +0 -260
  11. package/angular.json +0 -274
  12. package/bs-config.json +0 -5
  13. package/cli-module.js.map +0 -1
  14. package/dist/for-angular/cli/cli-module.d.ts +0 -22
  15. package/dist/for-angular/cli/cli-module.d.ts.map +0 -1
  16. package/dist/for-angular/cli/cli-module.js +0 -131
  17. package/dist/for-angular/cli/cli-module.js.map +0 -1
  18. package/dist/lib/README.md +0 -117
  19. package/dist/lib/fesm2022/decaf-ts-for-angular.mjs.map +0 -1
  20. package/eslint.config.mjs +0 -101
  21. package/ionic.config.json +0 -14
  22. package/jest.config.ts +0 -52
  23. package/jest.setup.ts +0 -50
  24. package/karma.conf.js +0 -50
  25. package/ng-package.json +0 -17
  26. package/ngsw-config.json +0 -30
  27. package/playwright.config.ts +0 -80
  28. package/resources/favicon.png +0 -0
  29. package/resources/favicon.svg +0 -29
  30. package/resources/icon-background.png +0 -0
  31. package/resources/icon-foreground.png +0 -0
  32. package/resources/icon-only.png +0 -0
  33. package/resources/icon-only.svg +0 -29
  34. package/resources/splash-dark.png +0 -0
  35. package/resources/splash-dark2.png +0 -0
  36. package/resources/splash.png +0 -0
  37. package/resources/splash2.png +0 -0
  38. package/resources/touch-icon.svg +0 -29
  39. package/schematics/README.md +0 -28
  40. package/schematics/collection.json +0 -20
  41. package/schematics/package-lock.json +0 -1501
  42. package/schematics/package.json +0 -37
  43. package/schematics/src/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.__style__.template +0 -0
  44. package/schematics/src/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.html.template +0 -3
  45. package/schematics/src/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.spec.ts.template +0 -40
  46. package/schematics/src/component/files/__name@dasherize@if-flat__/__name@dasherize__.__type@dasherize__.ts.template +0 -37
  47. package/schematics/src/component/files/__name@dasherize@if-flat__/__name@dasherize__.module.ts.template +0 -14
  48. package/schematics/src/component/index.js +0 -146
  49. package/schematics/src/component/schema.js +0 -2
  50. package/schematics/src/component/schema.json +0 -101
  51. package/schematics/src/page/files/__name@dasherize__.page.html.template +0 -15
  52. package/schematics/src/page/files/__name@dasherize__.page.scss.template +0 -0
  53. package/schematics/src/page/files/__name@dasherize__.page.ts.template +0 -19
  54. package/schematics/src/page/index.js +0 -71
  55. package/schematics/src/page/schema.json +0 -87
  56. package/schematics/src/schematics/index.js +0 -11
  57. package/schematics/src/schematics/index_spec.js +0 -13
  58. package/schematics/src/util/ast-util.js +0 -517
  59. package/schematics/src/util/change.js +0 -96
  60. package/schematics/src/util/index.js +0 -14
  61. package/settings.json +0 -112
  62. package/tsconfig.app.json +0 -22
  63. package/tsconfig.cli.json +0 -82
  64. package/tsconfig.lib.json +0 -14
  65. package/tsconfig.lib.prod.json +0 -10
  66. package/tsconfig.spec.json +0 -22
  67. package/webpack.config.js +0 -10
  68. package/workdocs/1-Header.md +0 -5
  69. package/workdocs/2-Badges.md +0 -30
  70. package/workdocs/4-Description.md +0 -4
  71. package/workdocs/5-HowToUse.md +0 -27
  72. package/workdocs/6-Related.md +0 -7
  73. package/workdocs/7-Social.md +0 -5
  74. package/workdocs/99-Footer.md +0 -28
  75. package/workdocs/Readme.md +0 -12
  76. package/workdocs/assets/apple-touch-icon.png +0 -0
  77. package/workdocs/assets/decaf-logo.svg +0 -54
  78. package/workdocs/assets/favicon.png +0 -0
  79. package/workdocs/assets/slogans.json +0 -182
  80. package/workdocs/confluence/.markdown-confluence.template.json +0 -6
  81. package/workdocs/confluence/Angular Module.md +0 -5
  82. package/workdocs/drawings/diagram.drawio +0 -24
  83. package/workdocs/prompts/bulk.md +0 -122
  84. package/workdocs/prompts/code.md +0 -47
  85. package/workdocs/prompts/documentation.md +0 -146
  86. package/workdocs/prompts/uml.md +0 -11
  87. package/workdocs/readme-md.json +0 -6
  88. package/workdocs/reports/CHANGELOG.md +0 -12
  89. package/workdocs/reports/DEPENDENCIES.md +0 -213
  90. package/workdocs/reports/RELEASE_NOTES.md +0 -24
  91. package/workdocs/reports/coverage/.gitkeep +0 -0
  92. package/workdocs/reports/coverage/clover.xml +0 -4107
  93. package/workdocs/reports/coverage/coverage-final.json +0 -76
  94. package/workdocs/reports/coverage/lcov-report/base.css +0 -224
  95. package/workdocs/reports/coverage/lcov-report/block-navigation.js +0 -87
  96. package/workdocs/reports/coverage/lcov-report/favicon.png +0 -0
  97. package/workdocs/reports/coverage/lcov-report/index.html +0 -551
  98. package/workdocs/reports/coverage/lcov-report/prettify.css +0 -1
  99. package/workdocs/reports/coverage/lcov-report/prettify.js +0 -2
  100. package/workdocs/reports/coverage/lcov-report/sort-arrow-sprite.png +0 -0
  101. package/workdocs/reports/coverage/lcov-report/sorter.js +0 -210
  102. package/workdocs/reports/coverage/lcov-report/src/app/models/CategoryModel.ts.html +0 -277
  103. package/workdocs/reports/coverage/lcov-report/src/app/models/DemoModel.ts.html +0 -427
  104. package/workdocs/reports/coverage/lcov-report/src/app/models/UserModel.ts.html +0 -226
  105. package/workdocs/reports/coverage/lcov-report/src/app/models/index.html +0 -146
  106. package/workdocs/reports/coverage/lcov-report/src/cli-module.ts.html +0 -502
  107. package/workdocs/reports/coverage/lcov-report/src/environments/environment.ts.html +0 -166
  108. package/workdocs/reports/coverage/lcov-report/src/environments/index.html +0 -116
  109. package/workdocs/reports/coverage/lcov-report/src/index.html +0 -191
  110. package/workdocs/reports/coverage/lcov-report/src/karma-test.ts.html +0 -121
  111. package/workdocs/reports/coverage/lcov-report/src/lib/components/card/card.component.ts.html +0 -625
  112. package/workdocs/reports/coverage/lcov-report/src/lib/components/card/index.html +0 -116
  113. package/workdocs/reports/coverage/lcov-report/src/lib/components/component-renderer/component-renderer.component.ts.html +0 -772
  114. package/workdocs/reports/coverage/lcov-report/src/lib/components/component-renderer/index.html +0 -116
  115. package/workdocs/reports/coverage/lcov-report/src/lib/components/crud-field/crud-field.component.ts.html +0 -2698
  116. package/workdocs/reports/coverage/lcov-report/src/lib/components/crud-field/index.html +0 -116
  117. package/workdocs/reports/coverage/lcov-report/src/lib/components/crud-form/constants.ts.html +0 -133
  118. package/workdocs/reports/coverage/lcov-report/src/lib/components/crud-form/crud-form.component.ts.html +0 -346
  119. package/workdocs/reports/coverage/lcov-report/src/lib/components/crud-form/index.html +0 -116
  120. package/workdocs/reports/coverage/lcov-report/src/lib/components/empty-state/empty-state.component.ts.html +0 -1264
  121. package/workdocs/reports/coverage/lcov-report/src/lib/components/empty-state/index.html +0 -116
  122. package/workdocs/reports/coverage/lcov-report/src/lib/components/fieldset/fieldset.component.ts.html +0 -2965
  123. package/workdocs/reports/coverage/lcov-report/src/lib/components/fieldset/index.html +0 -116
  124. package/workdocs/reports/coverage/lcov-report/src/lib/components/file-upload/file-upload.component.ts.html +0 -2263
  125. package/workdocs/reports/coverage/lcov-report/src/lib/components/file-upload/index.html +0 -116
  126. package/workdocs/reports/coverage/lcov-report/src/lib/components/filter/filter.component.ts.html +0 -2485
  127. package/workdocs/reports/coverage/lcov-report/src/lib/components/filter/index.html +0 -116
  128. package/workdocs/reports/coverage/lcov-report/src/lib/components/for-angular-components.module.ts.html +0 -259
  129. package/workdocs/reports/coverage/lcov-report/src/lib/components/icon/icon.component.ts.html +0 -358
  130. package/workdocs/reports/coverage/lcov-report/src/lib/components/icon/index.html +0 -116
  131. package/workdocs/reports/coverage/lcov-report/src/lib/components/index.html +0 -131
  132. package/workdocs/reports/coverage/lcov-report/src/lib/components/index.ts.html +0 -181
  133. package/workdocs/reports/coverage/lcov-report/src/lib/components/layout/index.html +0 -116
  134. package/workdocs/reports/coverage/lcov-report/src/lib/components/layout/layout.component.ts.html +0 -943
  135. package/workdocs/reports/coverage/lcov-report/src/lib/components/list/index.html +0 -116
  136. package/workdocs/reports/coverage/lcov-report/src/lib/components/list/list.component.ts.html +0 -4420
  137. package/workdocs/reports/coverage/lcov-report/src/lib/components/list-item/index.html +0 -116
  138. package/workdocs/reports/coverage/lcov-report/src/lib/components/list-item/list-item.component.ts.html +0 -1741
  139. package/workdocs/reports/coverage/lcov-report/src/lib/components/modal/index.html +0 -116
  140. package/workdocs/reports/coverage/lcov-report/src/lib/components/modal/modal.component.ts.html +0 -1984
  141. package/workdocs/reports/coverage/lcov-report/src/lib/components/model-renderer/index.html +0 -116
  142. package/workdocs/reports/coverage/lcov-report/src/lib/components/model-renderer/model-renderer.component.ts.html +0 -373
  143. package/workdocs/reports/coverage/lcov-report/src/lib/components/pagination/index.html +0 -116
  144. package/workdocs/reports/coverage/lcov-report/src/lib/components/pagination/pagination.component.ts.html +0 -1165
  145. package/workdocs/reports/coverage/lcov-report/src/lib/components/searchbar/index.html +0 -116
  146. package/workdocs/reports/coverage/lcov-report/src/lib/components/searchbar/searchbar.component.ts.html +0 -1774
  147. package/workdocs/reports/coverage/lcov-report/src/lib/components/stepped-form/index.html +0 -116
  148. package/workdocs/reports/coverage/lcov-report/src/lib/components/stepped-form/stepped-form.component.ts.html +0 -1219
  149. package/workdocs/reports/coverage/lcov-report/src/lib/components/table/index.html +0 -116
  150. package/workdocs/reports/coverage/lcov-report/src/lib/components/table/table.component.ts.html +0 -1054
  151. package/workdocs/reports/coverage/lcov-report/src/lib/directives/NgxSvgDirective.ts.html +0 -163
  152. package/workdocs/reports/coverage/lcov-report/src/lib/directives/collapsable.directive.ts.html +0 -268
  153. package/workdocs/reports/coverage/lcov-report/src/lib/directives/index.html +0 -131
  154. package/workdocs/reports/coverage/lcov-report/src/lib/directives/index.ts.html +0 -91
  155. package/workdocs/reports/coverage/lcov-report/src/lib/engine/DynamicModule.ts.html +0 -133
  156. package/workdocs/reports/coverage/lcov-report/src/lib/engine/MediaService.ts.html +0 -142
  157. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxBaseComponent.ts.html +0 -2194
  158. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxComponentDirective.ts.html +0 -3430
  159. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxCrudFormField.ts.html +0 -721
  160. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxDecafComponentDirective.ts.html +0 -1864
  161. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxDecafFormFieldDirective.ts.html +0 -952
  162. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxDecafFormService.ts.html +0 -3211
  163. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxEventHandler.ts.html +0 -307
  164. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxFormDirective.ts.html +0 -1366
  165. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxFormFieldDirective.ts.html +0 -1960
  166. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxFormService.ts.html +0 -3004
  167. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxModelPageDirective.ts.html +0 -1672
  168. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxPageDirective.ts.html +0 -748
  169. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxParentComponentDirective.ts.html +0 -775
  170. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxRenderableComponentDirective.ts.html +0 -727
  171. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxRenderingEngine.ts.html +0 -2005
  172. package/workdocs/reports/coverage/lcov-report/src/lib/engine/NgxRepositoryDirective.ts.html +0 -1546
  173. package/workdocs/reports/coverage/lcov-report/src/lib/engine/ValidatorFactory.ts.html +0 -817
  174. package/workdocs/reports/coverage/lcov-report/src/lib/engine/constants.ts.html +0 -1120
  175. package/workdocs/reports/coverage/lcov-report/src/lib/engine/decorators.ts.html +0 -376
  176. package/workdocs/reports/coverage/lcov-report/src/lib/engine/helpers.ts.html +0 -694
  177. package/workdocs/reports/coverage/lcov-report/src/lib/engine/index.html +0 -356
  178. package/workdocs/reports/coverage/lcov-report/src/lib/engine/index.ts.html +0 -160
  179. package/workdocs/reports/coverage/lcov-report/src/lib/engine/overrides.ts.html +0 -502
  180. package/workdocs/reports/coverage/lcov-report/src/lib/for-angular-common.module.ts.html +0 -298
  181. package/workdocs/reports/coverage/lcov-report/src/lib/helpers/index.html +0 -131
  182. package/workdocs/reports/coverage/lcov-report/src/lib/helpers/index.ts.html +0 -121
  183. package/workdocs/reports/coverage/lcov-report/src/lib/helpers/utils.ts.html +0 -1603
  184. package/workdocs/reports/coverage/lcov-report/src/lib/i18n/FakeLoader.ts.html +0 -157
  185. package/workdocs/reports/coverage/lcov-report/src/lib/i18n/Loader.ts.html +0 -826
  186. package/workdocs/reports/coverage/lcov-report/src/lib/i18n/index.html +0 -146
  187. package/workdocs/reports/coverage/lcov-report/src/lib/i18n/index.ts.html +0 -91
  188. package/workdocs/reports/coverage/lcov-report/src/lib/index.html +0 -131
  189. package/workdocs/reports/coverage/lcov-report/src/lib/public-apis.ts.html +0 -157
  190. package/workdocs/reports/coverage/lcov-report/src/lib/services/NgxFormService.ts.html +0 -3460
  191. package/workdocs/reports/coverage/lcov-report/src/lib/services/NgxMediaService.ts.html +0 -1420
  192. package/workdocs/reports/coverage/lcov-report/src/lib/services/NgxRouterService.ts.html +0 -1243
  193. package/workdocs/reports/coverage/lcov-report/src/lib/services/NgxTranslateService.ts.html +0 -214
  194. package/workdocs/reports/coverage/lcov-report/src/lib/services/index.html +0 -176
  195. package/workdocs/reports/coverage/lcov-report/src/lib/services/index.ts.html +0 -91
  196. package/workdocs/reports/coverage/lcov-report/src/lib/utils/DecafFakerRepository.ts.html +0 -571
  197. package/workdocs/reports/coverage/lcov-report/src/lib/utils/helpers.ts.html +0 -1711
  198. package/workdocs/reports/coverage/lcov-report/src/lib/utils/index.html +0 -146
  199. package/workdocs/reports/coverage/lcov-report/src/lib/utils/index.ts.html +0 -124
  200. package/workdocs/reports/coverage/lcov-report/src/main.ts.html +0 -100
  201. package/workdocs/reports/coverage/lcov-report/src/polyfills.ts.html +0 -271
  202. package/workdocs/reports/coverage/lcov-report/src/stories/Configure.stories.ts.html +0 -1156
  203. package/workdocs/reports/coverage/lcov-report/src/stories/button.component.ts.html +0 -229
  204. package/workdocs/reports/coverage/lcov-report/src/stories/button.stories.ts.html +0 -235
  205. package/workdocs/reports/coverage/lcov-report/src/stories/crud-field.stories.ts.html +0 -325
  206. package/workdocs/reports/coverage/lcov-report/src/stories/header.stories.ts.html +0 -181
  207. package/workdocs/reports/coverage/lcov-report/src/stories/index.html +0 -281
  208. package/workdocs/reports/coverage/lcov-report/src/stories/list.stories.ts.html +0 -289
  209. package/workdocs/reports/coverage/lcov-report/src/stories/login.page.stories.ts.html +0 -175
  210. package/workdocs/reports/coverage/lcov-report/src/stories/model-renderer.stories.ts.html +0 -259
  211. package/workdocs/reports/coverage/lcov-report/src/stories/page.component.ts.html +0 -331
  212. package/workdocs/reports/coverage/lcov-report/src/stories/page.stories.ts.html +0 -193
  213. package/workdocs/reports/coverage/lcov-report/src/stories/setup.ts.html +0 -127
  214. package/workdocs/reports/coverage/lcov-report/src/stories/utils.ts.html +0 -247
  215. package/workdocs/reports/coverage/lcov-report/src/tests/index.html +0 -116
  216. package/workdocs/reports/coverage/lcov-report/src/tests/karmaErrorParser.ts.html +0 -190
  217. package/workdocs/reports/coverage/lcov-report/src/typings.d.ts.html +0 -88
  218. package/workdocs/reports/coverage/lcov-report/src/zone-flags.ts.html +0 -103
  219. package/workdocs/reports/coverage/lcov.info +0 -7898
  220. package/workdocs/reports/data/.gitkeep +0 -1
  221. package/workdocs/reports/html/.gitkeep +0 -0
  222. package/workdocs/reports/html/jest-html-reporters-attach/test-report/index.js +0 -3
  223. package/workdocs/reports/html/jest-html-reporters-attach/test-report/result.js +0 -1
  224. package/workdocs/reports/html/test-report.html +0 -1
  225. package/workdocs/reports/images/.gitkeep +0 -1
  226. package/workdocs/reports/jest.coverage.config.ts +0 -43
  227. package/workdocs/reports/junit/junit-report.xml +0 -91
  228. package/workdocs/resources/.gitlock +0 -0
  229. package/workdocs/resources/diagram-Actor.png +0 -0
  230. package/workdocs/resources/diagram-banner.png +0 -0
  231. package/workdocs/resources/diagram.png +0 -0
  232. package/workdocs/tutorials/Contributing.md +0 -64
  233. package/workdocs/tutorials/Documentation.md +0 -340
  234. package/workdocs/tutorials/For Developers.md +0 -337
  235. package/workdocs/uml/diagram.puml +0 -11
  236. package/www/1049.10b030f0de36543b.js +0 -1
  237. package/www/1102.67cedfb3e29f0a05.js +0 -1
  238. package/www/1107.6b592a1672821270.js +0 -1
  239. package/www/1459.cabc18e941afa5d7.js +0 -1
  240. package/www/1577.5221deebe3501e43.js +0 -1
  241. package/www/2075.b6dc4fbb89dd6afc.js +0 -1
  242. package/www/2348.c4cc27dadbec70ec.js +0 -1
  243. package/www/2375.318d0b24ab346271.js +0 -1
  244. package/www/2415.618d6968ffda319c.js +0 -1
  245. package/www/2460.1d97c6f48b898ee2.js +0 -1
  246. package/www/2560.2e7000dcf80b6b2c.js +0 -1
  247. package/www/2585.274d59d52bafc7ed.js +0 -1
  248. package/www/2885.d99b86afd1ff7aa8.js +0 -1
  249. package/www/3162.bbc401f4a5f82460.js +0 -1
  250. package/www/323.f64c512be5c8d797.js +0 -1
  251. package/www/3238.a3e7e8004c6b6667.js +0 -1
  252. package/www/3506.8c03f5589b33a4a6.js +0 -1
  253. package/www/3511.56b7e49bb6c2c936.js +0 -1
  254. package/www/3519.84fbb67dc803f702.js +0 -1
  255. package/www/3675.7ebfdcf145052232.js +0 -1
  256. package/www/3814.765c1794e1be63de.js +0 -1
  257. package/www/3rdpartylicenses.txt +0 -1344
  258. package/www/4171.a974bdbf9c97e4e1.js +0 -1
  259. package/www/4183.41ef1def450a2cc0.js +0 -1
  260. package/www/4406.0b2dd3839b8c1417.js +0 -1
  261. package/www/441.e1031657c7e5f0ff.js +0 -1
  262. package/www/4463.6ad7b857e5f34009.js +0 -1
  263. package/www/4591.42f34534d38b9b31.js +0 -1
  264. package/www/4699.8df8ea9806163d4c.js +0 -1
  265. package/www/5100.ed6483c55a157d67.js +0 -1
  266. package/www/5193.15ea6938534eceb1.js +0 -1
  267. package/www/5197.6733853529768a45.js +0 -1
  268. package/www/5222.8439a641c2c4b1c1.js +0 -1
  269. package/www/5373.d7878f708309f038.js +0 -1
  270. package/www/5467.f0e21031db47308c.js +0 -1
  271. package/www/5712.b08cf436ee8145ce.js +0 -1
  272. package/www/5887.3d038f564e925abb.js +0 -1
  273. package/www/5949.37330f20e95dee79.js +0 -1
  274. package/www/6024.c10cc3d1b341c748.js +0 -1
  275. package/www/6433.360fcff952bde822.js +0 -1
  276. package/www/6499.60169da9869db697.js +0 -1
  277. package/www/6521.fab1f34bfe6b8200.js +0 -1
  278. package/www/6631.eaa711da6e0aeed9.js +0 -1
  279. package/www/6717.9d970c383bb0cf1c.js +0 -1
  280. package/www/6840.7317cd962ab23932.js +0 -1
  281. package/www/7030.d115d82ca7468a4e.js +0 -1
  282. package/www/7076.cce20ed5c79ff305.js +0 -1
  283. package/www/7179.c0545989ce869b3d.js +0 -1
  284. package/www/7240.69aeb484d78eb24d.js +0 -1
  285. package/www/7372.94c62459e34f7303.js +0 -1
  286. package/www/7402.983a5ecff61e9a5d.js +0 -1
  287. package/www/7428.527ac48035a2f915.js +0 -1
  288. package/www/7676.d7db23d350e4b096.js +0 -1
  289. package/www/770.80af87d5eb0075d3.js +0 -1
  290. package/www/7720.0701576cb9966779.js +0 -1
  291. package/www/7927.ee869d0dc478250a.js +0 -1
  292. package/www/8066.894688fbb2e5c832.js +0 -1
  293. package/www/8193.7f09ecd40b6d42c2.js +0 -1
  294. package/www/8255.158098a6302c91c2.js +0 -1
  295. package/www/8314.596c1ccf26b9c93a.js +0 -1
  296. package/www/8357.c5406b92e6933d7a.js +0 -1
  297. package/www/8477.a3ccc11c25a642d3.js +0 -1
  298. package/www/8487.93b6f7465ae1b7ac.js +0 -1
  299. package/www/8584.b77ad478a5a7ac2a.js +0 -1
  300. package/www/8805.a87413652185ff8f.js +0 -1
  301. package/www/8814.b489a78ae8e926c4.js +0 -1
  302. package/www/8970.234b3db1f97528fe.js +0 -1
  303. package/www/9013.c2e6ba17a915bdd6.js +0 -1
  304. package/www/9073.16c4e42482d55a3c.js +0 -1
  305. package/www/9344.7d2d24b194b794e2.js +0 -1
  306. package/www/9364.9a028036dd89e3e7.js +0 -1
  307. package/www/944.7e4317348c48d4f4.js +0 -1
  308. package/www/964.9a979e1c1aad0f5b.js +0 -1
  309. package/www/9657.fbb680ad1064e91a.js +0 -1
  310. package/www/9956.2d00a2153e9a7799.js +0 -1
  311. package/www/9977.068cd5561462bc99.js +0 -1
  312. package/www/assets/i18n/en.json +0 -210
  313. package/www/assets/i18n/ew/en.json +0 -346
  314. package/www/assets/i18n/pt.json +0 -186
  315. package/www/assets/icons/icon-128.webp +0 -0
  316. package/www/assets/icons/icon-192.webp +0 -0
  317. package/www/assets/icons/icon-256.webp +0 -0
  318. package/www/assets/icons/icon-48.webp +0 -0
  319. package/www/assets/icons/icon-512.webp +0 -0
  320. package/www/assets/icons/icon-72.webp +0 -0
  321. package/www/assets/icons/icon-96.webp +0 -0
  322. package/www/assets/images/angular-logo.svg +0 -45
  323. package/www/assets/images/apple-touch-icon.png +0 -0
  324. package/www/assets/images/decaf-logo-black.svg +0 -22
  325. package/www/assets/images/decaf-logo-contrast.svg +0 -54
  326. package/www/assets/images/decaf-logo-white.svg +0 -22
  327. package/www/assets/images/decaf-logo.svg +0 -54
  328. package/www/assets/images/ew/product.txt +0 -1
  329. package/www/assets/images/favicon-contrast.svg +0 -7
  330. package/www/assets/images/favicon.png +0 -0
  331. package/www/assets/images/favicon.svg +0 -29
  332. package/www/assets/images/icons/document.svg +0 -7
  333. package/www/assets/images/icons/edit.svg +0 -1
  334. package/www/assets/images/icons/logout.svg +0 -4
  335. package/www/assets/images/icons/menu-collapse.svg +0 -5
  336. package/www/assets/images/icons/menu.svg +0 -3
  337. package/www/assets/images/icons/moon-stars.svg +0 -5
  338. package/www/assets/images/icons/trash.svg +0 -1
  339. package/www/cli-module.ts +0 -139
  340. package/www/common.e50b5f8708aca9a5.js +0 -1
  341. package/www/index.html +0 -29
  342. package/www/main.7814262e404641fd.js +0 -1
  343. package/www/polyfills.4c1e087fffe784e8.js +0 -1
  344. package/www/runtime.e81aa7ecff7177cd.js +0 -1
  345. package/www/styles.5a3cd83eba16afc9.css +0 -4
  346. package/www/tabler-icons.bfabe54eef86ae62.woff +0 -0
  347. package/www/tabler-icons.d9f65ab9439b4ffc.ttf +0 -0
  348. package/www/tabler-icons.f17d2c3b34a5deaa.woff2 +0 -0
  349. /package/{dist/lib/assets → assets}/i18n/en.json +0 -0
  350. /package/{dist/lib/assets → assets}/i18n/ew/en.json +0 -0
  351. /package/{dist/lib/assets → assets}/i18n/pt.json +0 -0
  352. /package/{dist/lib/assets → assets}/icons/icon-128.webp +0 -0
  353. /package/{dist/lib/assets → assets}/icons/icon-192.webp +0 -0
  354. /package/{dist/lib/assets → assets}/icons/icon-256.webp +0 -0
  355. /package/{dist/lib/assets → assets}/icons/icon-48.webp +0 -0
  356. /package/{dist/lib/assets → assets}/icons/icon-512.webp +0 -0
  357. /package/{dist/lib/assets → assets}/icons/icon-72.webp +0 -0
  358. /package/{dist/lib/assets → assets}/icons/icon-96.webp +0 -0
  359. /package/{dist/lib/assets → assets}/images/angular-logo.svg +0 -0
  360. /package/{dist/lib/assets → assets}/images/apple-touch-icon.png +0 -0
  361. /package/{dist/lib/assets → assets}/images/decaf-logo-black.svg +0 -0
  362. /package/{dist/lib/assets → assets}/images/decaf-logo-contrast.svg +0 -0
  363. /package/{dist/lib/assets → assets}/images/decaf-logo-white.svg +0 -0
  364. /package/{dist/lib/assets → assets}/images/decaf-logo.svg +0 -0
  365. /package/{dist/lib/assets → assets}/images/ew/product.txt +0 -0
  366. /package/{dist/lib/assets → assets}/images/favicon-contrast.svg +0 -0
  367. /package/{dist/lib/assets → assets}/images/favicon.png +0 -0
  368. /package/{dist/lib/assets → assets}/images/favicon.svg +0 -0
  369. /package/{dist/lib/assets → assets}/images/icons/document.svg +0 -0
  370. /package/{dist/lib/assets → assets}/images/icons/edit.svg +0 -0
  371. /package/{dist/lib/assets → assets}/images/icons/logout.svg +0 -0
  372. /package/{dist/lib/assets → assets}/images/icons/menu-collapse.svg +0 -0
  373. /package/{dist/lib/assets → assets}/images/icons/menu.svg +0 -0
  374. /package/{dist/lib/assets → assets}/images/icons/moon-stars.svg +0 -0
  375. /package/{dist/lib/assets → assets}/images/icons/trash.svg +0 -0
@@ -1,517 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.insertImport = insertImport;
4
- exports.findNodes = findNodes;
5
- exports.getSourceNodes = getSourceNodes;
6
- exports.findNode = findNode;
7
- exports.insertAfterLastOccurrence = insertAfterLastOccurrence;
8
- exports.getContentOfKeyLiteral = getContentOfKeyLiteral;
9
- exports.getDecoratorMetadata = getDecoratorMetadata;
10
- exports.getFirstNgModuleName = getFirstNgModuleName;
11
- exports.getMetadataField = getMetadataField;
12
- exports.addSymbolToNgModuleMetadata = addSymbolToNgModuleMetadata;
13
- exports.addDeclarationToModule = addDeclarationToModule;
14
- exports.addImportToModule = addImportToModule;
15
- exports.addProviderToModule = addProviderToModule;
16
- exports.addExportToModule = addExportToModule;
17
- exports.addBootstrapToModule = addBootstrapToModule;
18
- exports.addEntryComponentToModule = addEntryComponentToModule;
19
- exports.isImported = isImported;
20
- exports.getEnvironmentExportName = getEnvironmentExportName;
21
- exports.getRouterModuleDeclaration = getRouterModuleDeclaration;
22
- exports.addRouteDeclarationToModule = addRouteDeclarationToModule;
23
- const ts = require("typescript");
24
- const change_1 = require("./change");
25
- function insertImport(source, fileToEdit, symbolName, fileName, isDefault = false) {
26
- const rootNode = source;
27
- const allImports = findNodes(rootNode, ts.SyntaxKind.ImportDeclaration);
28
- // get nodes that map to import statements from the file fileName
29
- const relevantImports = allImports.filter((node) => {
30
- // StringLiteral of the ImportDeclaration is the import file (fileName in this case).
31
- const importFiles = node
32
- .getChildren()
33
- .filter((child) => child.kind === ts.SyntaxKind.StringLiteral)
34
- .map((n) => n.text);
35
- return importFiles.filter((file) => file === fileName).length === 1;
36
- });
37
- if (relevantImports.length > 0) {
38
- let importsAsterisk = false;
39
- // imports from import file
40
- const imports = [];
41
- relevantImports.forEach((n) => {
42
- Array.prototype.push.apply(imports, findNodes(n, ts.SyntaxKind.Identifier));
43
- if (findNodes(n, ts.SyntaxKind.AsteriskToken).length > 0) {
44
- importsAsterisk = true;
45
- }
46
- });
47
- // if imports * from fileName, don't add symbolName
48
- if (importsAsterisk) {
49
- return new change_1.NoopChange();
50
- }
51
- const importTextNodes = imports.filter((n) => n.text === symbolName);
52
- // insert import if it's not there
53
- if (importTextNodes.length === 0) {
54
- const fallbackPos = findNodes(relevantImports[0], ts.SyntaxKind.CloseBraceToken)[0].getStart() ||
55
- findNodes(relevantImports[0], ts.SyntaxKind.FromKeyword)[0].getStart();
56
- return insertAfterLastOccurrence(imports, `, ${symbolName}`, fileToEdit, fallbackPos);
57
- }
58
- return new change_1.NoopChange();
59
- }
60
- // no such import declaration exists
61
- const useStrict = findNodes(rootNode, ts.SyntaxKind.StringLiteral).filter((n) => n.getText() === 'use strict');
62
- let fallbackPos = 0;
63
- if (useStrict.length > 0) {
64
- fallbackPos = useStrict[0].end;
65
- }
66
- const open = isDefault ? '' : '{ ';
67
- const close = isDefault ? '' : ' }';
68
- // if there are no imports or 'use strict' statement, insert import at beginning of file
69
- const insertAtBeginning = allImports.length === 0 && useStrict.length === 0;
70
- const separator = insertAtBeginning ? '' : ';\n';
71
- const toInsert = `${separator}import ${open}${symbolName}${close}` + ` from '${fileName}'${insertAtBeginning ? ';\n' : ''}`;
72
- return insertAfterLastOccurrence(allImports, toInsert, fileToEdit, fallbackPos, ts.SyntaxKind.StringLiteral);
73
- }
74
- //Safe
75
- function findNodes(node, kind, max = Infinity, recursive = false) {
76
- if (!node || max == 0) {
77
- return [];
78
- }
79
- const arr = [];
80
- if (node.kind === kind) {
81
- arr.push(node);
82
- max--;
83
- }
84
- if (max > 0 && (recursive || node.kind !== kind)) {
85
- for (const child of node.getChildren()) {
86
- findNodes(child, kind, max).forEach((node) => {
87
- if (max > 0) {
88
- arr.push(node);
89
- }
90
- max--;
91
- });
92
- if (max <= 0) {
93
- break;
94
- }
95
- }
96
- }
97
- return arr;
98
- }
99
- function getSourceNodes(sourceFile) {
100
- const nodes = [sourceFile];
101
- const result = [];
102
- while (nodes.length > 0) {
103
- const node = nodes.shift();
104
- if (node) {
105
- result.push(node);
106
- if (node.getChildCount(sourceFile) >= 0) {
107
- nodes.unshift(...node.getChildren());
108
- }
109
- }
110
- }
111
- return result;
112
- }
113
- function findNode(node, kind, text) {
114
- if (node.kind === kind && node.getText() === text) {
115
- // throw new Error(node.getText());
116
- return node;
117
- }
118
- let foundNode = null;
119
- ts.forEachChild(node, (childNode) => {
120
- foundNode = foundNode || findNode(childNode, kind, text);
121
- });
122
- return foundNode;
123
- }
124
- function nodesByPosition(first, second) {
125
- return first.getStart() - second.getStart();
126
- }
127
- function insertAfterLastOccurrence(nodes, toInsert, file, fallbackPos, syntaxKind) {
128
- let lastItem;
129
- for (const node of nodes) {
130
- if (!lastItem || lastItem.getStart() < node.getStart()) {
131
- lastItem = node;
132
- }
133
- }
134
- if (syntaxKind && lastItem) {
135
- lastItem = findNodes(lastItem, syntaxKind).sort(nodesByPosition).pop();
136
- }
137
- if (!lastItem && fallbackPos == undefined) {
138
- throw new Error(`tried to insert ${toInsert} as first occurence with no fallback position`);
139
- }
140
- const lastItemPosition = lastItem ? lastItem.getEnd() : fallbackPos;
141
- return new change_1.InsertChange(file, lastItemPosition, toInsert);
142
- }
143
- function getContentOfKeyLiteral(_source, node) {
144
- if (node.kind == ts.SyntaxKind.Identifier) {
145
- return node.text;
146
- }
147
- else if (node.kind == ts.SyntaxKind.StringLiteral) {
148
- return node.text;
149
- }
150
- else {
151
- return null;
152
- }
153
- }
154
- function _angularImportsFromNode(node) {
155
- const ms = node.moduleSpecifier;
156
- let modulePath;
157
- switch (ms.kind) {
158
- case ts.SyntaxKind.StringLiteral:
159
- modulePath = ms.text;
160
- break;
161
- default:
162
- return {};
163
- }
164
- if (!modulePath.startsWith('@angular/')) {
165
- return {};
166
- }
167
- if (node.importClause) {
168
- if (node.importClause.name) {
169
- // This is of the form `import Name from 'path'`. Ignore.
170
- return {};
171
- }
172
- else if (node.importClause.namedBindings) {
173
- const nb = node.importClause.namedBindings;
174
- if (nb.kind == ts.SyntaxKind.NamespaceImport) {
175
- // This is of the form `import * as name from 'path'`. Return `name.`.
176
- return {
177
- [nb.name.text + '.']: modulePath,
178
- };
179
- }
180
- else {
181
- // This is of the form `import {a,b,c} from 'path'`
182
- const namedImports = nb;
183
- return namedImports.elements
184
- .map((is) => (is.propertyName ? is.propertyName.text : is.name.text))
185
- .reduce((acc, curr) => {
186
- acc[curr] = modulePath;
187
- return acc;
188
- }, {});
189
- }
190
- }
191
- return {};
192
- }
193
- else {
194
- // This is of the form `import 'path';`. Nothing to do.
195
- return {};
196
- }
197
- }
198
- function getDecoratorMetadata(source, identifier, module) {
199
- const angularImports = findNodes(source, ts.SyntaxKind.ImportDeclaration)
200
- .map((node) => _angularImportsFromNode(node))
201
- .reduce((acc, current) => {
202
- for (const key of Object.keys(current)) {
203
- acc[key] = current[key];
204
- }
205
- return acc;
206
- }, {});
207
- return getSourceNodes(source)
208
- .filter((node) => {
209
- return (node.kind == ts.SyntaxKind.Decorator && node.expression.kind == ts.SyntaxKind.CallExpression);
210
- })
211
- .map((node) => node.expression)
212
- .filter((expr) => {
213
- if (expr.expression.kind == ts.SyntaxKind.Identifier) {
214
- const id = expr.expression;
215
- return id.text == identifier && angularImports[id.text] === module;
216
- }
217
- else if (expr.expression.kind == ts.SyntaxKind.PropertyAccessExpression) {
218
- // This covers foo.NgModule when importing * as foo.
219
- const paExpr = expr.expression;
220
- // If the left expression is not an identifier, just give up at that point.
221
- if (paExpr.expression.kind !== ts.SyntaxKind.Identifier) {
222
- return false;
223
- }
224
- const id = paExpr.name.text;
225
- const moduleId = paExpr.expression.text;
226
- return id === identifier && angularImports[moduleId + '.'] === module;
227
- }
228
- return false;
229
- })
230
- .filter((expr) => expr.arguments[0] && expr.arguments[0].kind == ts.SyntaxKind.ObjectLiteralExpression)
231
- .map((expr) => expr.arguments[0]);
232
- }
233
- function findClassDeclarationParent(node) {
234
- if (ts.isClassDeclaration(node)) {
235
- return node;
236
- }
237
- return node.parent && findClassDeclarationParent(node.parent);
238
- }
239
- function getFirstNgModuleName(source) {
240
- // First, find the @NgModule decorators.
241
- const ngModulesMetadata = getDecoratorMetadata(source, 'NgModule', '@angular/core');
242
- if (ngModulesMetadata.length === 0) {
243
- return undefined;
244
- }
245
- // Then walk parent pointers up the AST, looking for the ClassDeclaration parent of the NgModule
246
- // metadata.
247
- const moduleClass = findClassDeclarationParent(ngModulesMetadata[0]);
248
- if (!moduleClass || !moduleClass.name) {
249
- return undefined;
250
- }
251
- // Get the class name of the module ClassDeclaration.
252
- return moduleClass.name.text;
253
- }
254
- function getMetadataField(node, metadataField) {
255
- return (node.properties
256
- .filter((prop) => ts.isPropertyAssignment(prop))
257
- // Filter out every fields that's not "metadataField". Also handles string literals
258
- // (but not expressions).
259
- .filter(({ name }) => {
260
- return ((ts.isIdentifier(name) || ts.isStringLiteral(name)) && (name === null || name === void 0 ? void 0 : name.getText()) === metadataField);
261
- }));
262
- }
263
- function addSymbolToNgModuleMetadata(source, ngModulePath, metadataField, symbolName, importPath = null) {
264
- const nodes = getDecoratorMetadata(source, 'NgModule', '@angular/core');
265
- let node = nodes[0];
266
- // Find the decorator declaration.
267
- if (!node) {
268
- return [];
269
- }
270
- // Get all the children property assignment of object literals.
271
- const matchingProperties = getMetadataField(node, metadataField);
272
- // Get the last node of the array literal.
273
- if (!matchingProperties) {
274
- return [];
275
- }
276
- if (matchingProperties.length == 0) {
277
- // We haven't found the field in the metadata declaration. Insert a new field.
278
- const expr = node;
279
- let position;
280
- let toInsert;
281
- if (expr.properties.length == 0) {
282
- position = expr.getEnd() - 1;
283
- toInsert = ` ${metadataField}: [${symbolName}]\n`;
284
- }
285
- else {
286
- node = expr.properties[expr.properties.length - 1];
287
- position = node.getEnd();
288
- // Get the indentation of the last element, if any.
289
- const text = node.getFullText(source);
290
- const matches = text.match(/^\r?\n\s*/);
291
- if (matches && matches.length > 0) {
292
- toInsert = `,${matches[0]}${metadataField}: [${symbolName}]`;
293
- }
294
- else {
295
- toInsert = `, ${metadataField}: [${symbolName}]`;
296
- }
297
- }
298
- if (importPath !== null) {
299
- return [
300
- new change_1.InsertChange(ngModulePath, position, toInsert),
301
- insertImport(source, ngModulePath, symbolName.replace(/\..*$/, ''), importPath),
302
- ];
303
- }
304
- else {
305
- return [new change_1.InsertChange(ngModulePath, position, toInsert)];
306
- }
307
- }
308
- const assignment = matchingProperties[0];
309
- // If it's not an array, nothing we can do really.
310
- if (assignment.initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) {
311
- return [];
312
- }
313
- const arrLiteral = assignment.initializer;
314
- if (arrLiteral.elements.length == 0) {
315
- // Forward the property.
316
- node = arrLiteral;
317
- }
318
- else {
319
- node = arrLiteral.elements;
320
- }
321
- if (!node) {
322
- console.error('No app module found. Please add your new class to your component.');
323
- return [];
324
- }
325
- if (Array.isArray(node)) {
326
- const nodeArray = node;
327
- const symbolsArray = nodeArray.map((node) => node.getText());
328
- if (symbolsArray.includes(symbolName)) {
329
- return [];
330
- }
331
- node = node[node.length - 1];
332
- }
333
- let toInsert;
334
- let position = node.getEnd();
335
- if (node.kind == ts.SyntaxKind.ObjectLiteralExpression) {
336
- // We haven't found the field in the metadata declaration. Insert a new
337
- // field.
338
- const expr = node;
339
- if (expr.properties.length == 0) {
340
- position = expr.getEnd() - 1;
341
- toInsert = ` ${symbolName}\n`;
342
- }
343
- else {
344
- // Get the indentation of the last element, if any.
345
- const text = node.getFullText(source);
346
- if (text.match(/^\r?\r?\n/)) {
347
- toInsert = `,${text.match(/^\r?\n\s*/)[0]}${symbolName}`;
348
- }
349
- else {
350
- toInsert = `, ${symbolName}`;
351
- }
352
- }
353
- }
354
- else if (node.kind == ts.SyntaxKind.ArrayLiteralExpression) {
355
- // We found the field but it's empty. Insert it just before the `]`.
356
- position--;
357
- toInsert = `${symbolName}`;
358
- }
359
- else {
360
- // Get the indentation of the last element, if any.
361
- const text = node.getFullText(source);
362
- if (text.match(/^\r?\n/)) {
363
- toInsert = `,${text.match(/^\r?\n(\r?)\s*/)[0]}${symbolName}`;
364
- }
365
- else {
366
- toInsert = `, ${symbolName}`;
367
- }
368
- }
369
- if (importPath !== null) {
370
- return [
371
- new change_1.InsertChange(ngModulePath, position, toInsert),
372
- insertImport(source, ngModulePath, symbolName.replace(/\..*$/, ''), importPath),
373
- ];
374
- }
375
- return [new change_1.InsertChange(ngModulePath, position, toInsert)];
376
- }
377
- function addDeclarationToModule(source, modulePath, classifiedName, importPath) {
378
- return addSymbolToNgModuleMetadata(source, modulePath, 'declarations', classifiedName, importPath);
379
- }
380
- function addImportToModule(source, modulePath, classifiedName, importPath) {
381
- return addSymbolToNgModuleMetadata(source, modulePath, 'imports', classifiedName, importPath);
382
- }
383
- function addProviderToModule(source, modulePath, classifiedName, importPath) {
384
- return addSymbolToNgModuleMetadata(source, modulePath, 'providers', classifiedName, importPath);
385
- }
386
- function addExportToModule(source, modulePath, classifiedName, importPath) {
387
- return addSymbolToNgModuleMetadata(source, modulePath, 'exports', classifiedName, importPath);
388
- }
389
- function addBootstrapToModule(source, modulePath, classifiedName, importPath) {
390
- return addSymbolToNgModuleMetadata(source, modulePath, 'bootstrap', classifiedName, importPath);
391
- }
392
- function addEntryComponentToModule(source, modulePath, classifiedName, importPath) {
393
- return addSymbolToNgModuleMetadata(source, modulePath, 'entryComponents', classifiedName, importPath);
394
- }
395
- function isImported(source, classifiedName, importPath) {
396
- const allNodes = getSourceNodes(source);
397
- const matchingNodes = allNodes
398
- .filter((node) => node.kind === ts.SyntaxKind.ImportDeclaration)
399
- .filter((imp) => imp.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral)
400
- .filter((imp) => {
401
- return imp.moduleSpecifier.text === importPath;
402
- })
403
- .filter((imp) => {
404
- if (!imp.importClause) {
405
- return false;
406
- }
407
- const nodes = findNodes(imp.importClause, ts.SyntaxKind.ImportSpecifier).filter((n) => n.getText() === classifiedName);
408
- return nodes.length > 0;
409
- });
410
- return matchingNodes.length > 0;
411
- }
412
- function getEnvironmentExportName(source) {
413
- // Initial value is `null` as we don't know yet if the user
414
- // has imported `environment` into the root module or not.
415
- let environmentExportName = null;
416
- const allNodes = getSourceNodes(source);
417
- allNodes
418
- .filter((node) => node.kind === ts.SyntaxKind.ImportDeclaration)
419
- .filter((declaration) => declaration.moduleSpecifier.kind === ts.SyntaxKind.StringLiteral &&
420
- declaration.importClause !== undefined)
421
- .map((declaration) =>
422
- // If `importClause` property is defined then the first
423
- // child will be `NamedImports` object (or `namedBindings`).
424
- declaration.importClause.getChildAt(0))
425
- // Find those `NamedImports` object that contains `environment` keyword
426
- // in its text. E.g. `{ environment as env }`.
427
- .filter((namedImports) => namedImports.getText().includes('environment'))
428
- .forEach((namedImports) => {
429
- for (const specifier of namedImports.elements) {
430
- // `propertyName` is defined if the specifier
431
- // has an aliased import.
432
- const name = specifier.propertyName || specifier.name;
433
- // Find specifier that contains `environment` keyword in its text.
434
- // Whether it's `environment` or `environment as env`.
435
- if (name.text.includes('environment')) {
436
- environmentExportName = specifier.name.text;
437
- }
438
- }
439
- });
440
- return environmentExportName;
441
- }
442
- function getRouterModuleDeclaration(source) {
443
- const result = getDecoratorMetadata(source, 'NgModule', '@angular/core');
444
- const node = result[0];
445
- const matchingProperties = getMetadataField(node, 'imports');
446
- if (!matchingProperties) {
447
- return;
448
- }
449
- const assignment = matchingProperties[0];
450
- if (assignment.initializer.kind !== ts.SyntaxKind.ArrayLiteralExpression) {
451
- return;
452
- }
453
- const arrLiteral = assignment.initializer;
454
- return arrLiteral.elements
455
- .filter((el) => el.kind === ts.SyntaxKind.CallExpression)
456
- .find((el) => el.getText().startsWith('RouterModule'));
457
- }
458
- function addRouteDeclarationToModule(source, fileToAdd, routeLiteral) {
459
- const routerModuleExpr = getRouterModuleDeclaration(source);
460
- if (!routerModuleExpr) {
461
- throw new Error(`Couldn't find a route declaration in ${fileToAdd}.`);
462
- }
463
- const scopeConfigMethodArgs = routerModuleExpr.arguments;
464
- if (!scopeConfigMethodArgs.length) {
465
- const { line } = source.getLineAndCharacterOfPosition(routerModuleExpr.getStart());
466
- throw new Error(`The router module method doesn't have arguments ` + `at line ${line} in ${fileToAdd}`);
467
- }
468
- let routesArr;
469
- const routesArg = scopeConfigMethodArgs[0];
470
- // Check if the route declarations array is
471
- // an inlined argument of RouterModule or a standalone variable
472
- if (ts.isArrayLiteralExpression(routesArg)) {
473
- routesArr = routesArg;
474
- }
475
- else {
476
- const routesVarName = routesArg.getText();
477
- let routesVar;
478
- if (routesArg.kind === ts.SyntaxKind.Identifier) {
479
- routesVar = source.statements
480
- .filter((s) => s.kind === ts.SyntaxKind.VariableStatement)
481
- .find((v) => {
482
- return v.declarationList.declarations[0].name.getText() === routesVarName;
483
- });
484
- }
485
- if (!routesVar) {
486
- const { line } = source.getLineAndCharacterOfPosition(routesArg.getStart());
487
- throw new Error(`No route declaration array was found that corresponds ` + `to router module at line ${line} in ${fileToAdd}`);
488
- }
489
- routesArr = findNodes(routesVar, ts.SyntaxKind.ArrayLiteralExpression, 1)[0];
490
- }
491
- const occurrencesCount = routesArr.elements.length;
492
- const text = routesArr.getFullText(source);
493
- let route = routeLiteral;
494
- let insertPos = routesArr.elements.pos;
495
- if (occurrencesCount > 0) {
496
- const lastRouteLiteral = [...routesArr.elements].pop();
497
- const lastRouteIsWildcard = ts.isObjectLiteralExpression(lastRouteLiteral) &&
498
- lastRouteLiteral.properties.some((n) => ts.isPropertyAssignment(n) &&
499
- ts.isIdentifier(n.name) &&
500
- n.name.text === 'path' &&
501
- ts.isStringLiteral(n.initializer) &&
502
- n.initializer.text === '**');
503
- const indentation = text.match(/\r?\n(\r?)\s*/) || [];
504
- const routeText = `${indentation[0] || ' '}${routeLiteral}`;
505
- // Add the new route before the wildcard route
506
- // otherwise we'll always redirect to the wildcard route
507
- if (lastRouteIsWildcard) {
508
- insertPos = lastRouteLiteral.pos;
509
- route = `${routeText},`;
510
- }
511
- else {
512
- insertPos = lastRouteLiteral.end;
513
- route = `,${routeText}`;
514
- }
515
- }
516
- return new change_1.InsertChange(fileToAdd, insertPos, route);
517
- }
@@ -1,96 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ReplaceChange = exports.RemoveChange = exports.InsertChange = exports.NoopChange = void 0;
4
- /**
5
- * An operation that does nothing.
6
- */
7
- class NoopChange {
8
- constructor() {
9
- this.description = 'No operation.';
10
- this.order = Infinity;
11
- this.path = null;
12
- }
13
- apply() {
14
- return Promise.resolve();
15
- }
16
- }
17
- exports.NoopChange = NoopChange;
18
- /**
19
- * Will add text to the source code.
20
- */
21
- class InsertChange {
22
- constructor(path, pos, toAdd) {
23
- this.path = path;
24
- this.pos = pos;
25
- this.toAdd = toAdd;
26
- if (pos < 0) {
27
- throw new Error('Negative positions are invalid');
28
- }
29
- this.description = `Inserted ${toAdd} into position ${pos} of ${path}`;
30
- this.order = pos;
31
- }
32
- /**
33
- * This method does not insert spaces if there is none in the original string.
34
- */
35
- apply(host) {
36
- return host.read(this.path).then((content) => {
37
- const prefix = content.substring(0, this.pos);
38
- const suffix = content.substring(this.pos);
39
- return host.write(this.path, `${prefix}${this.toAdd}${suffix}`);
40
- });
41
- }
42
- }
43
- exports.InsertChange = InsertChange;
44
- /**
45
- * Will remove text from the source code.
46
- */
47
- class RemoveChange {
48
- constructor(path, pos, toRemove) {
49
- this.path = path;
50
- this.pos = pos;
51
- this.toRemove = toRemove;
52
- if (pos < 0) {
53
- throw new Error('Negative positions are invalid');
54
- }
55
- this.description = `Removed ${toRemove} into position ${pos} of ${path}`;
56
- this.order = pos;
57
- }
58
- apply(host) {
59
- return host.read(this.path).then((content) => {
60
- const prefix = content.substring(0, this.pos);
61
- const suffix = content.substring(this.pos + this.toRemove.length);
62
- // TODO: throw error if toRemove doesn't match removed string.
63
- return host.write(this.path, `${prefix}${suffix}`);
64
- });
65
- }
66
- }
67
- exports.RemoveChange = RemoveChange;
68
- /**
69
- * Will replace text from the source code.
70
- */
71
- class ReplaceChange {
72
- constructor(path, pos, oldText, newText) {
73
- this.path = path;
74
- this.pos = pos;
75
- this.oldText = oldText;
76
- this.newText = newText;
77
- if (pos < 0) {
78
- throw new Error('Negative positions are invalid');
79
- }
80
- this.description = `Replaced ${oldText} into position ${pos} of ${path} with ${newText}`;
81
- this.order = pos;
82
- }
83
- apply(host) {
84
- return host.read(this.path).then((content) => {
85
- const prefix = content.substring(0, this.pos);
86
- const suffix = content.substring(this.pos + this.oldText.length);
87
- const text = content.substring(this.pos, this.pos + this.oldText.length);
88
- if (text !== this.oldText) {
89
- return Promise.reject(new Error(`Invalid replace: "${text}" != "${this.oldText}".`));
90
- }
91
- // TODO: throw error if oldText doesn't match removed string.
92
- return host.write(this.path, `${prefix}${this.newText}${suffix}`);
93
- });
94
- }
95
- }
96
- exports.ReplaceChange = ReplaceChange;
@@ -1,14 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildSelector = buildSelector;
4
- const core_1 = require("@angular-devkit/core");
5
- function buildSelector(options, projectPrefix) {
6
- let selector = core_1.strings.dasherize(options.name);
7
- if (options.prefix) {
8
- selector = `${options.prefix}-${selector}`;
9
- }
10
- else if (options.prefix === undefined && projectPrefix) {
11
- selector = `${projectPrefix}-${selector}`;
12
- }
13
- return selector;
14
- }