@ngxs/store 3.8.2-dev.master-0fd1fe5 → 3.8.2

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 (273) hide show
  1. package/bundles/ngxs-store-internals-testing.umd.js +684 -0
  2. package/bundles/ngxs-store-internals-testing.umd.js.map +1 -0
  3. package/bundles/ngxs-store-internals.umd.js +141 -0
  4. package/bundles/ngxs-store-internals.umd.js.map +1 -0
  5. package/bundles/ngxs-store-operators.umd.js +224 -0
  6. package/bundles/ngxs-store-operators.umd.js.map +1 -0
  7. package/bundles/ngxs-store.umd.js +3076 -0
  8. package/bundles/ngxs-store.umd.js.map +1 -0
  9. package/esm2015/internals/index.js +5 -0
  10. package/esm2015/internals/initial-state.js +17 -0
  11. package/esm2015/internals/internal-tokens.js +5 -0
  12. package/{esm2020/internals/ngxs-bootstrapper.mjs → esm2015/internals/ngxs-bootstrapper.js} +4 -4
  13. package/esm2015/internals/src/symbols.js +2 -0
  14. package/esm2015/internals/symbols.js +2 -0
  15. package/esm2015/internals/testing/fresh-platform.js +70 -0
  16. package/{esm2020/internals/testing/helpers/ngxs-test.component.mjs → esm2015/internals/testing/helpers/ngxs-test.component.js} +4 -4
  17. package/esm2015/internals/testing/helpers/ngxs-test.module.js +21 -0
  18. package/{esm2020/internals/testing/ngxs.setup.mjs → esm2015/internals/testing/ngxs.setup.js} +2 -4
  19. package/esm2015/internals/testing/symbol.js +2 -0
  20. package/esm2015/operators/patch.js +21 -0
  21. package/{esm2020/src/actions-stream.mjs → esm2015/src/actions-stream.js} +7 -7
  22. package/esm2015/src/configs/messages.config.js +36 -0
  23. package/{esm2020/src/decorators/select/select-factory.mjs → esm2015/src/decorators/select/select-factory.js} +4 -4
  24. package/esm2015/src/decorators/selector/selector.js +32 -0
  25. package/esm2015/src/decorators/state.js +36 -0
  26. package/{esm2020/src/dev-features/ngxs-development.module.mjs → esm2015/src/dev-features/ngxs-development.module.js} +5 -5
  27. package/{esm2020/src/dev-features/ngxs-unhandled-actions-logger.mjs → esm2015/src/dev-features/ngxs-unhandled-actions-logger.js} +4 -4
  28. package/{esm2020/src/execution/dispatch-outside-zone-ngxs-execution-strategy.mjs → esm2015/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js} +4 -4
  29. package/{esm2020/src/execution/internal-ngxs-execution-strategy.mjs → esm2015/src/execution/internal-ngxs-execution-strategy.js} +4 -4
  30. package/{esm2020/src/execution/noop-ngxs-execution-strategy.mjs → esm2015/src/execution/noop-ngxs-execution-strategy.js} +4 -4
  31. package/esm2015/src/execution/symbols.js +23 -0
  32. package/{esm2020/src/internal/dispatcher.mjs → esm2015/src/internal/dispatcher.js} +11 -11
  33. package/{esm2020/src/internal/error-handler.mjs → esm2015/src/internal/error-handler.js} +5 -5
  34. package/esm2015/src/internal/internals.js +248 -0
  35. package/esm2015/src/internal/lifecycle-state-manager.js +79 -0
  36. package/{esm2020/src/internal/state-context-factory.mjs → esm2015/src/internal/state-context-factory.js} +4 -4
  37. package/esm2015/src/internal/state-factory.js +288 -0
  38. package/{esm2020/src/internal/state-operations.mjs → esm2015/src/internal/state-operations.js} +5 -5
  39. package/esm2015/src/internal/state-operators.js +20 -0
  40. package/esm2015/src/internal/state-stream.js +25 -0
  41. package/{esm2020/src/ivy/ivy-enabled-in-dev-mode.mjs → esm2015/src/ivy/ivy-enabled-in-dev-mode.js} +2 -2
  42. package/esm2015/src/module.js +88 -0
  43. package/esm2015/src/modules/ngxs-feature.module.js +45 -0
  44. package/esm2015/src/modules/ngxs-root.module.js +41 -0
  45. package/{esm2020/src/operators/of-action.mjs → esm2015/src/operators/of-action.js} +10 -10
  46. package/{esm2020/src/plugin-manager.mjs → esm2015/src/plugin-manager.js} +4 -4
  47. package/esm2015/src/public_api.js +27 -0
  48. package/esm2015/src/selectors/create-property-selectors.js +20 -0
  49. package/esm2015/src/selectors/selector-metadata.js +30 -0
  50. package/esm2015/src/selectors/selector-types.util.js +2 -0
  51. package/{esm2020/src/store.mjs → esm2015/src/store.js} +5 -6
  52. package/esm2015/src/symbols.js +58 -0
  53. package/esm2015/src/utils/utils.js +92 -0
  54. package/fesm2015/{ngxs-store-internals-testing.mjs → ngxs-store-internals-testing.js} +13 -19
  55. package/fesm2015/ngxs-store-internals-testing.js.map +1 -0
  56. package/{fesm2020/ngxs-store-internals.mjs → fesm2015/ngxs-store-internals.js} +8 -21
  57. package/fesm2015/ngxs-store-internals.js.map +1 -0
  58. package/fesm2015/{ngxs-store-operators.mjs → ngxs-store-operators.js} +1 -1
  59. package/fesm2015/ngxs-store-operators.js.map +1 -0
  60. package/{fesm2020/ngxs-store.mjs → fesm2015/ngxs-store.js} +1029 -1192
  61. package/fesm2015/ngxs-store.js.map +1 -0
  62. package/internals/index.d.ts +1 -1
  63. package/internals/initial-state.d.ts +1 -1
  64. package/internals/ngxs-store-internals.d.ts +5 -0
  65. package/internals/package.json +10 -0
  66. package/internals/src/symbols.d.ts +1 -4
  67. package/internals/symbols.d.ts +1 -4
  68. package/internals/testing/helpers/ngxs-test.component.d.ts +1 -1
  69. package/internals/testing/ngxs-store-internals-testing.d.ts +5 -0
  70. package/internals/testing/package.json +10 -0
  71. package/internals/testing/symbol.d.ts +2 -2
  72. package/ngxs-store.d.ts +5 -0
  73. package/operators/ngxs-store-operators.d.ts +5 -0
  74. package/operators/package.json +10 -0
  75. package/package.json +11 -48
  76. package/src/configs/messages.config.d.ts +0 -2
  77. package/src/decorators/state.d.ts +2 -2
  78. package/src/execution/symbols.d.ts +2 -8
  79. package/src/internal/internals.d.ts +5 -5
  80. package/src/internal/lifecycle-state-manager.d.ts +1 -3
  81. package/src/module.d.ts +14 -3
  82. package/src/modules/ngxs-feature.module.d.ts +9 -2
  83. package/src/modules/ngxs-root.module.d.ts +9 -2
  84. package/src/public_api.d.ts +4 -5
  85. package/src/selectors/selector-types.util.d.ts +3 -3
  86. package/src/symbols.d.ts +8 -5
  87. package/esm2020/internals/index.mjs +0 -6
  88. package/esm2020/internals/initial-state.mjs +0 -18
  89. package/esm2020/internals/internal-tokens.mjs +0 -6
  90. package/esm2020/internals/src/symbols.mjs +0 -11
  91. package/esm2020/internals/symbols.mjs +0 -11
  92. package/esm2020/internals/testing/fresh-platform.mjs +0 -72
  93. package/esm2020/internals/testing/helpers/ngxs-test.module.mjs +0 -20
  94. package/esm2020/internals/testing/symbol.mjs +0 -2
  95. package/esm2020/operators/patch.mjs +0 -21
  96. package/esm2020/src/configs/messages.config.mjs +0 -48
  97. package/esm2020/src/decorators/selector/selector.mjs +0 -32
  98. package/esm2020/src/decorators/state.mjs +0 -36
  99. package/esm2020/src/execution/symbols.mjs +0 -27
  100. package/esm2020/src/internal/internals.mjs +0 -248
  101. package/esm2020/src/internal/lifecycle-state-manager.mjs +0 -97
  102. package/esm2020/src/internal/state-factory.mjs +0 -292
  103. package/esm2020/src/internal/state-operators.mjs +0 -20
  104. package/esm2020/src/internal/state-stream.mjs +0 -27
  105. package/esm2020/src/module.mjs +0 -27
  106. package/esm2020/src/modules/ngxs-feature.module.mjs +0 -18
  107. package/esm2020/src/modules/ngxs-root.module.mjs +0 -18
  108. package/esm2020/src/public_api.mjs +0 -28
  109. package/esm2020/src/selectors/create-property-selectors.mjs +0 -20
  110. package/esm2020/src/selectors/selector-metadata.mjs +0 -35
  111. package/esm2020/src/selectors/selector-types.util.mjs +0 -2
  112. package/esm2020/src/standalone-features/feature-providers.mjs +0 -20
  113. package/esm2020/src/standalone-features/index.mjs +0 -4
  114. package/esm2020/src/standalone-features/initializers.mjs +0 -86
  115. package/esm2020/src/standalone-features/plugin.mjs +0 -20
  116. package/esm2020/src/standalone-features/provide-states.mjs +0 -26
  117. package/esm2020/src/standalone-features/provide-store.mjs +0 -26
  118. package/esm2020/src/standalone-features/root-providers.mjs +0 -47
  119. package/esm2020/src/symbols.mjs +0 -65
  120. package/esm2020/src/utils/utils.mjs +0 -92
  121. package/fesm2015/ngxs-store-internals-testing.mjs.map +0 -1
  122. package/fesm2015/ngxs-store-internals.mjs +0 -114
  123. package/fesm2015/ngxs-store-internals.mjs.map +0 -1
  124. package/fesm2015/ngxs-store-operators.mjs.map +0 -1
  125. package/fesm2015/ngxs-store.mjs +0 -2454
  126. package/fesm2015/ngxs-store.mjs.map +0 -1
  127. package/fesm2020/ngxs-store-internals-testing.mjs +0 -180
  128. package/fesm2020/ngxs-store-internals-testing.mjs.map +0 -1
  129. package/fesm2020/ngxs-store-internals.mjs.map +0 -1
  130. package/fesm2020/ngxs-store-operators.mjs +0 -202
  131. package/fesm2020/ngxs-store-operators.mjs.map +0 -1
  132. package/fesm2020/ngxs-store.mjs.map +0 -1
  133. package/schematics/collection.json +0 -36
  134. package/schematics/src/actions/actions.factory.d.ts +0 -3
  135. package/schematics/src/actions/actions.factory.js +0 -22
  136. package/schematics/src/actions/actions.factory.js.map +0 -1
  137. package/schematics/src/actions/files/__name__.actions.ts__template__ +0 -4
  138. package/schematics/src/actions/schema.json +0 -28
  139. package/schematics/src/ng-add/add-declaration.d.ts +0 -4
  140. package/schematics/src/ng-add/add-declaration.js +0 -109
  141. package/schematics/src/ng-add/add-declaration.js.map +0 -1
  142. package/schematics/src/ng-add/ng-add.factory.d.ts +0 -9
  143. package/schematics/src/ng-add/ng-add.factory.js +0 -86
  144. package/schematics/src/ng-add/ng-add.factory.js.map +0 -1
  145. package/schematics/src/ng-add/schema.json +0 -72
  146. package/schematics/src/starter-kit/files/store/auth/auth.actions.ts__template__ +0 -7
  147. package/schematics/src/starter-kit/files/store/auth/auth.state.spec.ts__template__ +0 -46
  148. package/schematics/src/starter-kit/files/store/auth/auth.state.ts__template__ +0 -45
  149. package/schematics/src/starter-kit/files/store/dashboard/index.ts__template__ +0 -11
  150. package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.actions.ts__template__ +0 -13
  151. package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.state.spec.ts__template__ +0 -77
  152. package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.state.ts__template__ +0 -60
  153. package/schematics/src/starter-kit/files/store/dashboard/states/user/user.actions.ts__template__ +0 -6
  154. package/schematics/src/starter-kit/files/store/dashboard/states/user/user.state.spec.ts__template__ +0 -54
  155. package/schematics/src/starter-kit/files/store/dashboard/states/user/user.state.ts__template__ +0 -40
  156. package/schematics/src/starter-kit/files/store/store.config.ts__template__ +0 -38
  157. package/schematics/src/starter-kit/files/store/store.module.ts__template__ +0 -22
  158. package/schematics/src/starter-kit/schema.json +0 -18
  159. package/schematics/src/starter-kit/starter-kit.factory.d.ts +0 -3
  160. package/schematics/src/starter-kit/starter-kit.factory.js +0 -12
  161. package/schematics/src/starter-kit/starter-kit.factory.js.map +0 -1
  162. package/schematics/src/state/files/__name__.state.spec.ts__template__ +0 -22
  163. package/schematics/src/state/files/__name__.state.ts__template__ +0 -20
  164. package/schematics/src/state/schema.json +0 -33
  165. package/schematics/src/state/state.factory.d.ts +0 -3
  166. package/schematics/src/state/state.factory.js +0 -20
  167. package/schematics/src/state/state.factory.js.map +0 -1
  168. package/schematics/src/store/files/__name__.actions.ts__template__ +0 -4
  169. package/schematics/src/store/files/__name__.state.spec.ts__template__ +0 -24
  170. package/schematics/src/store/files/__name__.state.ts__template__ +0 -27
  171. package/schematics/src/store/schema.json +0 -33
  172. package/schematics/src/store/store.factory.d.ts +0 -3
  173. package/schematics/src/store/store.factory.js +0 -20
  174. package/schematics/src/store/store.factory.js.map +0 -1
  175. package/schematics/src/utils/common/lib.config.d.ts +0 -10
  176. package/schematics/src/utils/common/lib.config.js +0 -15
  177. package/schematics/src/utils/common/lib.config.js.map +0 -1
  178. package/schematics/src/utils/common/project-files.config.d.ts +0 -3
  179. package/schematics/src/utils/common/project-files.config.js +0 -7
  180. package/schematics/src/utils/common/project-files.config.js.map +0 -1
  181. package/schematics/src/utils/common/properties.d.ts +0 -1
  182. package/schematics/src/utils/common/properties.js +0 -8
  183. package/schematics/src/utils/common/properties.js.map +0 -1
  184. package/schematics/src/utils/config.d.ts +0 -119
  185. package/schematics/src/utils/config.js +0 -21
  186. package/schematics/src/utils/config.js.map +0 -1
  187. package/schematics/src/utils/generate-utils.d.ts +0 -4
  188. package/schematics/src/utils/generate-utils.js +0 -14
  189. package/schematics/src/utils/generate-utils.js.map +0 -1
  190. package/schematics/src/utils/interfaces/package.interface.d.ts +0 -7
  191. package/schematics/src/utils/interfaces/package.interface.js +0 -3
  192. package/schematics/src/utils/interfaces/package.interface.js.map +0 -1
  193. package/schematics/src/utils/ng-utils/README.md +0 -1
  194. package/schematics/src/utils/ng-utils/ast-utils.d.ts +0 -99
  195. package/schematics/src/utils/ng-utils/ast-utils.js +0 -517
  196. package/schematics/src/utils/ng-utils/ast-utils.js.map +0 -1
  197. package/schematics/src/utils/ng-utils/ng-ast-utils.d.ts +0 -5
  198. package/schematics/src/utils/ng-utils/ng-ast-utils.js +0 -67
  199. package/schematics/src/utils/ng-utils/ng-ast-utils.js.map +0 -1
  200. package/schematics/src/utils/ng-utils/project.d.ts +0 -2
  201. package/schematics/src/utils/ng-utils/project.js +0 -21
  202. package/schematics/src/utils/ng-utils/project.js.map +0 -1
  203. package/schematics/src/utils/ng-utils/standalone/app_config.d.ts +0 -16
  204. package/schematics/src/utils/ng-utils/standalone/app_config.js +0 -84
  205. package/schematics/src/utils/ng-utils/standalone/app_config.js.map +0 -1
  206. package/schematics/src/utils/ng-utils/standalone/code_block.d.ts +0 -46
  207. package/schematics/src/utils/ng-utils/standalone/code_block.js +0 -73
  208. package/schematics/src/utils/ng-utils/standalone/code_block.js.map +0 -1
  209. package/schematics/src/utils/ng-utils/standalone/index.d.ts +0 -1
  210. package/schematics/src/utils/ng-utils/standalone/index.js +0 -7
  211. package/schematics/src/utils/ng-utils/standalone/index.js.map +0 -1
  212. package/schematics/src/utils/ng-utils/standalone/rules.d.ts +0 -38
  213. package/schematics/src/utils/ng-utils/standalone/rules.js +0 -195
  214. package/schematics/src/utils/ng-utils/standalone/rules.js.map +0 -1
  215. package/schematics/src/utils/ng-utils/standalone/util.d.ts +0 -28
  216. package/schematics/src/utils/ng-utils/standalone/util.js +0 -138
  217. package/schematics/src/utils/ng-utils/standalone/util.js.map +0 -1
  218. package/schematics/src/utils/normalize-options.d.ts +0 -9
  219. package/schematics/src/utils/normalize-options.js +0 -24
  220. package/schematics/src/utils/normalize-options.js.map +0 -1
  221. package/schematics/src/utils/project.d.ts +0 -16
  222. package/schematics/src/utils/project.js +0 -40
  223. package/schematics/src/utils/project.js.map +0 -1
  224. package/schematics/src/utils/versions.json +0 -3
  225. package/src/standalone-features/feature-providers.d.ts +0 -7
  226. package/src/standalone-features/index.d.ts +0 -3
  227. package/src/standalone-features/initializers.d.ts +0 -29
  228. package/src/standalone-features/plugin.d.ts +0 -17
  229. package/src/standalone-features/provide-states.d.ts +0 -18
  230. package/src/standalone-features/provide-store.d.ts +0 -22
  231. package/src/standalone-features/root-providers.d.ts +0 -8
  232. /package/{esm2020/index.mjs → esm2015/index.js} +0 -0
  233. /package/{esm2020/internals/memoize.mjs → esm2015/internals/memoize.js} +0 -0
  234. /package/{esm2020/internals/ngxs-store-internals.mjs → esm2015/internals/ngxs-store-internals.js} +0 -0
  235. /package/{esm2020/internals/testing/index.mjs → esm2015/internals/testing/index.js} +0 -0
  236. /package/{esm2020/internals/testing/ngxs-store-internals-testing.mjs → esm2015/internals/testing/ngxs-store-internals-testing.js} +0 -0
  237. /package/{esm2020/internals/testing/skip-console-logging.mjs → esm2015/internals/testing/skip-console-logging.js} +0 -0
  238. /package/{esm2020/ngxs-store.mjs → esm2015/ngxs-store.js} +0 -0
  239. /package/{esm2020/operators/append.mjs → esm2015/operators/append.js} +0 -0
  240. /package/{esm2020/operators/compose.mjs → esm2015/operators/compose.js} +0 -0
  241. /package/{esm2020/operators/iif.mjs → esm2015/operators/iif.js} +0 -0
  242. /package/{esm2020/operators/index.mjs → esm2015/operators/index.js} +0 -0
  243. /package/{esm2020/operators/insert-item.mjs → esm2015/operators/insert-item.js} +0 -0
  244. /package/{esm2020/operators/ngxs-store-operators.mjs → esm2015/operators/ngxs-store-operators.js} +0 -0
  245. /package/{esm2020/operators/remove-item.mjs → esm2015/operators/remove-item.js} +0 -0
  246. /package/{esm2020/operators/types.mjs → esm2015/operators/types.js} +0 -0
  247. /package/{esm2020/operators/update-item.mjs → esm2015/operators/update-item.js} +0 -0
  248. /package/{esm2020/operators/utils.mjs → esm2015/operators/utils.js} +0 -0
  249. /package/{esm2020/src/actions/actions.mjs → esm2015/src/actions/actions.js} +0 -0
  250. /package/{esm2020/src/actions/symbols.mjs → esm2015/src/actions/symbols.js} +0 -0
  251. /package/{esm2020/src/decorators/action.mjs → esm2015/src/decorators/action.js} +0 -0
  252. /package/{esm2020/src/decorators/select/select.mjs → esm2015/src/decorators/select/select.js} +0 -0
  253. /package/{esm2020/src/decorators/select/symbols.mjs → esm2015/src/decorators/select/symbols.js} +0 -0
  254. /package/{esm2020/src/decorators/selector/symbols.mjs → esm2015/src/decorators/selector/symbols.js} +0 -0
  255. /package/{esm2020/src/decorators/selector-options.mjs → esm2015/src/decorators/selector-options.js} +0 -0
  256. /package/{esm2020/src/dev-features/symbols.mjs → esm2015/src/dev-features/symbols.js} +0 -0
  257. /package/{esm2020/src/internal/custom-rxjs-subjects.mjs → esm2015/src/internal/custom-rxjs-subjects.js} +0 -0
  258. /package/{esm2020/src/operators/leave-ngxs.mjs → esm2015/src/operators/leave-ngxs.js} +0 -0
  259. /package/{esm2020/src/plugin_api.mjs → esm2015/src/plugin_api.js} +0 -0
  260. /package/{esm2020/src/private_api.mjs → esm2015/src/private_api.js} +0 -0
  261. /package/{esm2020/src/public_to_deprecate.mjs → esm2015/src/public_to_deprecate.js} +0 -0
  262. /package/{esm2020/src/selectors/create-model-selector.mjs → esm2015/src/selectors/create-model-selector.js} +0 -0
  263. /package/{esm2020/src/selectors/create-pick-selector.mjs → esm2015/src/selectors/create-pick-selector.js} +0 -0
  264. /package/{esm2020/src/selectors/create-selector.mjs → esm2015/src/selectors/create-selector.js} +0 -0
  265. /package/{esm2020/src/selectors/index.mjs → esm2015/src/selectors/index.js} +0 -0
  266. /package/{esm2020/src/selectors/selector-checks.util.mjs → esm2015/src/selectors/selector-checks.util.js} +0 -0
  267. /package/{esm2020/src/selectors/selector-models.mjs → esm2015/src/selectors/selector-models.js} +0 -0
  268. /package/{esm2020/src/selectors/selector-utils.mjs → esm2015/src/selectors/selector-utils.js} +0 -0
  269. /package/{esm2020/src/state-token/state-token.mjs → esm2015/src/state-token/state-token.js} +0 -0
  270. /package/{esm2020/src/state-token/symbols.mjs → esm2015/src/state-token/symbols.js} +0 -0
  271. /package/{esm2020/src/utils/compose.mjs → esm2015/src/utils/compose.js} +0 -0
  272. /package/{esm2020/src/utils/freeze.mjs → esm2015/src/utils/freeze.js} +0 -0
  273. /package/{esm2020/src/utils/store-validators.mjs → esm2015/src/utils/store-validators.js} +0 -0
@@ -1,67 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.isStandaloneApp = exports.getAppModulePath = exports.findBootstrapModuleCall = void 0;
4
- const core_1 = require("@angular-devkit/core");
5
- const schematics_1 = require("@angular-devkit/schematics");
6
- const path_1 = require("path");
7
- const ts = require("@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript");
8
- const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
9
- const standalone_1 = require("@schematics/angular/private/standalone");
10
- function findBootstrapModuleCall(host, mainPath) {
11
- const mainText = host.readText(mainPath);
12
- const source = ts.createSourceFile(mainPath, mainText, ts.ScriptTarget.Latest, true);
13
- const allNodes = (0, ast_utils_1.getSourceNodes)(source);
14
- let bootstrapCall = null;
15
- for (const node of allNodes) {
16
- let bootstrapCallNode = null;
17
- bootstrapCallNode = (0, ast_utils_1.findNode)(node, ts.SyntaxKind.Identifier, 'bootstrapModule');
18
- // Walk up the parent until CallExpression is found.
19
- while (bootstrapCallNode &&
20
- bootstrapCallNode.parent &&
21
- bootstrapCallNode.parent.kind !== ts.SyntaxKind.CallExpression) {
22
- bootstrapCallNode = bootstrapCallNode.parent;
23
- }
24
- if (bootstrapCallNode !== null &&
25
- bootstrapCallNode.parent !== undefined &&
26
- bootstrapCallNode.parent.kind === ts.SyntaxKind.CallExpression) {
27
- bootstrapCall = bootstrapCallNode.parent;
28
- break;
29
- }
30
- }
31
- return bootstrapCall;
32
- }
33
- exports.findBootstrapModuleCall = findBootstrapModuleCall;
34
- function findBootstrapModulePath(host, mainPath) {
35
- const bootstrapCall = findBootstrapModuleCall(host, mainPath);
36
- if (!bootstrapCall) {
37
- throw new schematics_1.SchematicsException('Bootstrap call not found');
38
- }
39
- const bootstrapModule = bootstrapCall.arguments[0];
40
- const mainText = host.readText(mainPath);
41
- const source = ts.createSourceFile(mainPath, mainText, ts.ScriptTarget.Latest, true);
42
- const allNodes = (0, ast_utils_1.getSourceNodes)(source);
43
- const bootstrapModuleRelativePath = allNodes
44
- .filter(ts.isImportDeclaration)
45
- .filter(imp => {
46
- return (0, ast_utils_1.findNode)(imp, ts.SyntaxKind.Identifier, bootstrapModule.getText());
47
- })
48
- .map(imp => {
49
- const modulePathStringLiteral = imp.moduleSpecifier;
50
- return modulePathStringLiteral.text;
51
- })[0];
52
- return bootstrapModuleRelativePath;
53
- }
54
- function getAppModulePath(host, mainPath) {
55
- const moduleRelativePath = findBootstrapModulePath(host, mainPath);
56
- const mainDir = (0, path_1.dirname)(mainPath);
57
- const modulePath = (0, core_1.normalize)(`/${mainDir}/${moduleRelativePath}.ts`);
58
- return modulePath;
59
- }
60
- exports.getAppModulePath = getAppModulePath;
61
- function isStandaloneApp(host, mainPath) {
62
- const source = ts.createSourceFile(mainPath, host.readText(mainPath), ts.ScriptTarget.Latest, true);
63
- const bootstrapCall = (0, standalone_1.findBootstrapApplicationCall)(source);
64
- return bootstrapCall !== null;
65
- }
66
- exports.isStandaloneApp = isStandaloneApp;
67
- //# sourceMappingURL=ng-ast-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ng-ast-utils.js","sourceRoot":"","sources":["../../../../../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AED,SAAgB,eAAe,CAAC,IAAU,EAAE,QAAgB;IAC1D,MAAM,MAAM,GAAG,EAAE,CAAC,gBAAgB,CAChC,QAAQ,EACR,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACvB,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IACF,MAAM,aAAa,GAAG,IAAA,yCAA4B,EAAC,MAAM,CAAC,CAAC;IAE3D,OAAO,aAAa,KAAK,IAAI,CAAC;AAChC,CAAC;AAVD,0CAUC"}
@@ -1,2 +0,0 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- export declare function getProjectMainFile(host: Tree, project?: string): string;
@@ -1,21 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getProjectMainFile = void 0;
4
- const schematics_1 = require("@angular-devkit/schematics");
5
- const project_1 = require("../project");
6
- function getProjectMainFile(host, project) {
7
- const resolvedProject = (0, project_1.getProject)(host, project);
8
- if (!resolvedProject) {
9
- throw new schematics_1.SchematicsException(`Project "${project}" does not exist.`);
10
- }
11
- if ((0, project_1.isLib)(host, project)) {
12
- throw new schematics_1.SchematicsException(`Invalid project type`);
13
- }
14
- const projectOptions = resolvedProject.architect['build'].options;
15
- if (!(projectOptions === null || projectOptions === void 0 ? void 0 : projectOptions.main)) {
16
- throw new schematics_1.SchematicsException(`Could not find the main file`);
17
- }
18
- return projectOptions.main;
19
- }
20
- exports.getProjectMainFile = getProjectMainFile;
21
- //# sourceMappingURL=project.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"project.js","sourceRoot":"","sources":["../../../../../../packages/store/schematics/src/utils/ng-utils/project.ts"],"names":[],"mappings":";;;AAAA,2DAAuE;AACvE,wCAA+C;AAE/C,SAAgB,kBAAkB,CAAC,IAAU,EAAE,OAAgB;IAC7D,MAAM,eAAe,GAAG,IAAA,oBAAU,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,CAAC,eAAe,EAAE;QACpB,MAAM,IAAI,gCAAmB,CAAC,YAAY,OAAO,mBAAmB,CAAC,CAAC;KACvE;IACD,IAAI,IAAA,eAAK,EAAC,IAAI,EAAE,OAAO,CAAC,EAAE;QACxB,MAAM,IAAI,gCAAmB,CAAC,sBAAsB,CAAC,CAAC;KACvD;IACD,MAAM,cAAc,GAAG,eAAe,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;IAElE,IAAI,CAAC,CAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,IAAI,CAAA,EAAE;QACzB,MAAM,IAAI,gCAAmB,CAAC,8BAA8B,CAAC,CAAC;KAC/D;IAED,OAAO,cAAc,CAAC,IAAc,CAAC;AACvC,CAAC;AAfD,gDAeC"}
@@ -1,16 +0,0 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- import * as ts from '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript';
3
- /** App config that was resolved to its source node. */
4
- export interface ResolvedAppConfig {
5
- /** Tree-relative path of the file containing the app config. */
6
- filePath: string;
7
- /** Node defining the app config. */
8
- node: ts.ObjectLiteralExpression;
9
- }
10
- /**
11
- * Resolves the node that defines the app config from a bootstrap call.
12
- * @param bootstrapCall Call for which to resolve the config.
13
- * @param tree File tree of the project.
14
- * @param filePath File path of the bootstrap call.
15
- */
16
- export declare function findAppConfig(bootstrapCall: ts.CallExpression, tree: Tree, filePath: string): ResolvedAppConfig | null;
@@ -1,84 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.findAppConfig = void 0;
4
- const path_1 = require("path");
5
- const ts = require("@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript");
6
- const util_1 = require("./util");
7
- /**
8
- * Resolves the node that defines the app config from a bootstrap call.
9
- * @param bootstrapCall Call for which to resolve the config.
10
- * @param tree File tree of the project.
11
- * @param filePath File path of the bootstrap call.
12
- */
13
- function findAppConfig(bootstrapCall, tree, filePath) {
14
- if (bootstrapCall.arguments.length > 1) {
15
- const config = bootstrapCall.arguments[1];
16
- if (ts.isObjectLiteralExpression(config)) {
17
- return { filePath, node: config };
18
- }
19
- if (ts.isIdentifier(config)) {
20
- return resolveAppConfigFromIdentifier(config, tree, filePath);
21
- }
22
- }
23
- return null;
24
- }
25
- exports.findAppConfig = findAppConfig;
26
- /**
27
- * Resolves the app config from an identifier referring to it.
28
- * @param identifier Identifier referring to the app config.
29
- * @param tree File tree of the project.
30
- * @param bootstapFilePath Path of the bootstrap call.
31
- */
32
- function resolveAppConfigFromIdentifier(identifier, tree, bootstapFilePath) {
33
- var _a;
34
- const sourceFile = identifier.getSourceFile();
35
- for (const node of sourceFile.statements) {
36
- // Only look at relative imports. This will break if the app uses a path
37
- // mapping to refer to the import, but in order to resolve those, we would
38
- // need knowledge about the entire program.
39
- if (!ts.isImportDeclaration(node) ||
40
- !((_a = node.importClause) === null || _a === void 0 ? void 0 : _a.namedBindings) ||
41
- !ts.isNamedImports(node.importClause.namedBindings) ||
42
- !ts.isStringLiteralLike(node.moduleSpecifier) ||
43
- !node.moduleSpecifier.text.startsWith('.')) {
44
- continue;
45
- }
46
- for (const specifier of node.importClause.namedBindings.elements) {
47
- if (specifier.name.text !== identifier.text) {
48
- continue;
49
- }
50
- // Look for a variable with the imported name in the file. Note that ideally we would use
51
- // the type checker to resolve this, but we can't because these utilities are set up to
52
- // operate on individual files, not the entire program.
53
- const filePath = (0, path_1.join)((0, path_1.dirname)(bootstapFilePath), node.moduleSpecifier.text + '.ts');
54
- const importedSourceFile = (0, util_1.getSourceFile)(tree, filePath);
55
- const resolvedVariable = findAppConfigFromVariableName(importedSourceFile, (specifier.propertyName || specifier.name).text);
56
- if (resolvedVariable) {
57
- return { filePath, node: resolvedVariable };
58
- }
59
- }
60
- }
61
- const variableInSameFile = findAppConfigFromVariableName(sourceFile, identifier.text);
62
- return variableInSameFile ? { filePath: bootstapFilePath, node: variableInSameFile } : null;
63
- }
64
- /**
65
- * Finds an app config within the top-level variables of a file.
66
- * @param sourceFile File in which to search for the config.
67
- * @param variableName Name of the variable containing the config.
68
- */
69
- function findAppConfigFromVariableName(sourceFile, variableName) {
70
- for (const node of sourceFile.statements) {
71
- if (ts.isVariableStatement(node)) {
72
- for (const decl of node.declarationList.declarations) {
73
- if (ts.isIdentifier(decl.name) &&
74
- decl.name.text === variableName &&
75
- decl.initializer &&
76
- ts.isObjectLiteralExpression(decl.initializer)) {
77
- return decl.initializer;
78
- }
79
- }
80
- }
81
- }
82
- return null;
83
- }
84
- //# sourceMappingURL=app_config.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"app_config.js","sourceRoot":"","sources":["../../../../../../../packages/store/schematics/src/utils/ng-utils/standalone/app_config.ts"],"names":[],"mappings":";;;AACA,+BAAqC;AACrC,qGAAqG;AACrG,iCAAuC;AAWvC;;;;;GAKG;AACH,SAAgB,aAAa,CAC3B,aAAgC,EAChC,IAAU,EACV,QAAgB;IAEhB,IAAI,aAAa,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE;QACtC,MAAM,MAAM,GAAG,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC;QAE1C,IAAI,EAAE,CAAC,yBAAyB,CAAC,MAAM,CAAC,EAAE;YACxC,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;SACnC;QAED,IAAI,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;YAC3B,OAAO,8BAA8B,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;SAC/D;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC;AAlBD,sCAkBC;AAED;;;;;GAKG;AACH,SAAS,8BAA8B,CACrC,UAAyB,EACzB,IAAU,EACV,gBAAwB;;IAExB,MAAM,UAAU,GAAG,UAAU,CAAC,aAAa,EAAE,CAAC;IAE9C,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,UAAU,EAAE;QACxC,wEAAwE;QACxE,0EAA0E;Q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AAI,CAAC;AAC9F,CAAC;AAED;;;;GAIG;AACH,SAAS,6BAA6B,CACpC,UAAyB,EACzB,YAAoB;IAEpB,KAAK,MAAM,IAAI,IAAI,UAAU,CAAC,UAAU,EAAE;QACxC,IAAI,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE;YAChC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,YAAY,EAAE;gBACpD,IACE,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;oBAC1B,IAAI,CAAC,IAAI,CAAC,IAAI,KAAK,YAAY;oBAC/B,IAAI,CAAC,WAAW;oBAChB,EAAE,CAAC,yBAAyB,CAAC,IAAI,CAAC,WAAW,CAAC,EAC9C;oBACA,OAAO,IAAI,CAAC,WAAW,CAAC;iBACzB;aACF;SACF;KACF;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -1,46 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- /** Generated code that hasn't been interpolated yet. */
3
- export interface PendingCode {
4
- /** Code that will be inserted. */
5
- expression: string;
6
- /** Imports that need to be added to the file in which the code is inserted. */
7
- imports: PendingImports;
8
- }
9
- /** Map keeping track of imports and aliases under which they're referred to in an expresion. */
10
- declare type PendingImports = Map<string, Map<string, string>>;
11
- /**
12
- * Callback invoked by a Rule that produces the code
13
- * that needs to be inserted somewhere in the app.
14
- */
15
- export declare type CodeBlockCallback = (block: CodeBlock) => PendingCode;
16
- /**
17
- * Utility class used to generate blocks of code that
18
- * can be inserted by the devkit into a user's app.
19
- */
20
- export declare class CodeBlock {
21
- private _imports;
22
- /** Function used to tag a code block in order to produce a `PendingCode` object. */
23
- code: (strings: TemplateStringsArray, ...params: unknown[]) => PendingCode;
24
- /**
25
- * Used inside of a code block to mark external symbols and which module they should be imported
26
- * from. When the code is inserted, the required import statements will be produced automatically.
27
- * @param symbolName Name of the external symbol.
28
- * @param moduleName Module from which the symbol should be imported.
29
- */
30
- external: (symbolName: string, moduleName: string) => string;
31
- /**
32
- * Produces the necessary rules to transform a `PendingCode` object into valid code.
33
- * @param initialCode Code pending transformed.
34
- * @param filePath Path of the file in which the code will be inserted.
35
- */
36
- static transformPendingCode(initialCode: PendingCode, filePath: string): {
37
- code: {
38
- /** Code that will be inserted. */
39
- expression: string;
40
- /** Imports that need to be added to the file in which the code is inserted. */
41
- imports: PendingImports;
42
- };
43
- rules: Rule[];
44
- };
45
- }
46
- export {};
@@ -1,73 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CodeBlock = void 0;
4
- const ts = require("@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript");
5
- const ast_utils_1 = require("../ast-utils");
6
- const change_1 = require("@schematics/angular/utility/change");
7
- /** Counter used to generate unique IDs. */
8
- let uniqueIdCounter = 0;
9
- /**
10
- * Utility class used to generate blocks of code that
11
- * can be inserted by the devkit into a user's app.
12
- */
13
- class CodeBlock {
14
- constructor() {
15
- this._imports = new Map();
16
- // Note: the methods here are defined as arrow function so that they can be destructured by
17
- // consumers without losing their context. This makes the API more concise.
18
- /** Function used to tag a code block in order to produce a `PendingCode` object. */
19
- this.code = (strings, ...params) => {
20
- return {
21
- expression: strings.map((part, index) => part + (params[index] || '')).join(''),
22
- imports: this._imports
23
- };
24
- };
25
- /**
26
- * Used inside of a code block to mark external symbols and which module they should be imported
27
- * from. When the code is inserted, the required import statements will be produced automatically.
28
- * @param symbolName Name of the external symbol.
29
- * @param moduleName Module from which the symbol should be imported.
30
- */
31
- this.external = (symbolName, moduleName) => {
32
- if (!this._imports.has(moduleName)) {
33
- this._imports.set(moduleName, new Map());
34
- }
35
- const symbolsPerModule = this._imports.get(moduleName);
36
- if (!symbolsPerModule.has(symbolName)) {
37
- symbolsPerModule.set(symbolName, `@@__SCHEMATIC_PLACEHOLDER_${uniqueIdCounter++}__@@`);
38
- }
39
- return symbolsPerModule.get(symbolName);
40
- };
41
- }
42
- /**
43
- * Produces the necessary rules to transform a `PendingCode` object into valid code.
44
- * @param initialCode Code pending transformed.
45
- * @param filePath Path of the file in which the code will be inserted.
46
- */
47
- static transformPendingCode(initialCode, filePath) {
48
- const code = Object.assign({}, initialCode);
49
- const rules = [];
50
- code.imports.forEach((symbols, moduleName) => {
51
- symbols.forEach((placeholder, symbolName) => {
52
- rules.push((tree) => {
53
- const recorder = tree.beginUpdate(filePath);
54
- const sourceFile = ts.createSourceFile(filePath, tree.readText(filePath), ts.ScriptTarget.Latest, true);
55
- // Note that this could still technically clash if there's a top-level symbol called
56
- // `${symbolName}_alias`, however this is unlikely. We can revisit this if it becomes
57
- // a problem.
58
- const alias = (0, ast_utils_1.hasTopLevelIdentifier)(sourceFile, symbolName, moduleName)
59
- ? symbolName + '_alias'
60
- : undefined;
61
- code.expression = code.expression.replace(new RegExp(placeholder, 'g'), alias || symbolName);
62
- (0, change_1.applyToUpdateRecorder)(recorder, [
63
- (0, ast_utils_1.insertImport)(sourceFile, filePath, symbolName, moduleName, false, alias)
64
- ]);
65
- tree.commitUpdate(recorder);
66
- });
67
- });
68
- });
69
- return { code, rules };
70
- }
71
- }
72
- exports.CodeBlock = CodeBlock;
73
- //# sourceMappingURL=code_block.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"code_block.js","sourceRoot":"","sources":["../../../../../../../packages/store/schematics/src/utils/ng-utils/standalone/code_block.ts"],"names":[],"mappings":";;;AACA,qGAAqG;AACrG,4CAAmE;AACnE,+DAA2E;AAc3E,2CAA2C;AAC3C,IAAI,eAAe,GAAG,CAAC,CAAC;AAQxB;;;GAGG;AACH,MAAa,SAAS;IAAtB;QACU,aAAQ,GAAmB,IAAI,GAAG,EAA+B,CAAC;QAE1E,2FAA2F;QAC3F,2EAA2E;QAE3E,oFAAoF;QACpF,SAAI,GAAG,CAAC,OAA6B,EAAE,GAAG,MAAiB,EAAe,EAAE;YAC1E,OAAO;gBACL,UAAU,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,K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AQ,EACR,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,EACvB,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;oBAEF,oFAAoF;oBACpF,qFAAqF;oBACrF,aAAa;oBACb,MAAM,KAAK,GAAG,IAAA,iCAAqB,EAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC;wBACrE,CAAC,CAAC,UAAU,GAAG,QAAQ;wBACvB,CAAC,CAAC,SAAS,CAAC;oBAEd,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,OAAO,CACvC,IAAI,MAAM,CAAC,WAAW,EAAE,GAAG,CAAC,EAC5B,KAAK,IAAI,UAAU,CACpB,CAAC;oBAEF,IAAA,8BAAqB,EAAC,QAAQ,EAAE;wBAC9B,IAAA,wBAAY,EAAC,UAAU,EAAE,QAAQ,EAAE,UAAU,EAAE,UAAU,EAAE,KAAK,EAAE,KAAK,CAAC;qBACzE,CAAC,CAAC;oBACH,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAC,CAAC;gBAC9B,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;IACzB,CAAC;CACF;AA5ED,8BA4EC"}
@@ -1 +0,0 @@
1
- export { addRootImport, addRootProvider } from './rules';
@@ -1,7 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addRootProvider = exports.addRootImport = void 0;
4
- var rules_1 = require("./rules");
5
- Object.defineProperty(exports, "addRootImport", { enumerable: true, get: function () { return rules_1.addRootImport; } });
6
- Object.defineProperty(exports, "addRootProvider", { enumerable: true, get: function () { return rules_1.addRootProvider; } });
7
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/store/schematics/src/utils/ng-utils/standalone/index.ts"],"names":[],"mappings":";;;AAAA,iCAAyD;AAAhD,sGAAA,aAAa,OAAA;AAAE,wGAAA,eAAe,OAAA"}
@@ -1,38 +0,0 @@
1
- import { Rule } from '@angular-devkit/schematics';
2
- import { CodeBlockCallback } from './code_block';
3
- /**
4
- * Adds an import to the root of the project.
5
- * @param project Name of the project to which to add the import.
6
- * @param callback Function that generates the code block which should be inserted.
7
- * @example
8
- *
9
- * ```ts
10
- * import { Rule } from '@angular-devkit/schematics';
11
- * import { addRootImport } from '@schematics/angular/utility';
12
- *
13
- * export default function(): Rule {
14
- * return addRootImport('default', ({code, external}) => {
15
- * return code`${external('MyModule', '@my/module')}.forRoot({})`;
16
- * });
17
- * }
18
- * ```
19
- */
20
- export declare function addRootImport(project: string, callback: CodeBlockCallback): Rule;
21
- /**
22
- * Adds a provider to the root of the project.
23
- * @param project Name of the project to which to add the import.
24
- * @param callback Function that generates the code block which should be inserted.
25
- * @example
26
- *
27
- * ```ts
28
- * import { Rule } from '@angular-devkit/schematics';
29
- * import { addRootProvider } from '@schematics/angular/utility';
30
- *
31
- * export default function(): Rule {
32
- * return addRootProvider('default', ({code, external}) => {
33
- * return code`${external('provideLibrary', '@my/library')}({})`;
34
- * });
35
- * }
36
- * ```
37
- */
38
- export declare function addRootProvider(project: string, callback: CodeBlockCallback): Rule;
@@ -1,195 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.addRootProvider = exports.addRootImport = void 0;
13
- const core_1 = require("@angular-devkit/core");
14
- const schematics_1 = require("@angular-devkit/schematics");
15
- const ast_utils_1 = require("@schematics/angular/utility/ast-utils");
16
- const change_1 = require("@schematics/angular/utility/change");
17
- const ng_ast_utils_1 = require("@schematics/angular/utility/ng-ast-utils");
18
- const app_config_1 = require("./app_config");
19
- const code_block_1 = require("./code_block");
20
- const util_1 = require("./util");
21
- const ng_ast_utils_2 = require("../ng-ast-utils");
22
- /**
23
- * Adds an import to the root of the project.
24
- * @param project Name of the project to which to add the import.
25
- * @param callback Function that generates the code block which should be inserted.
26
- * @example
27
- *
28
- * ```ts
29
- * import { Rule } from '@angular-devkit/schematics';
30
- * import { addRootImport } from '@schematics/angular/utility';
31
- *
32
- * export default function(): Rule {
33
- * return addRootImport('default', ({code, external}) => {
34
- * return code`${external('MyModule', '@my/module')}.forRoot({})`;
35
- * });
36
- * }
37
- * ```
38
- */
39
- function addRootImport(project, callback) {
40
- return getRootInsertionRule(project, callback, 'imports', {
41
- name: 'importProvidersFrom',
42
- module: '@angular/core'
43
- });
44
- }
45
- exports.addRootImport = addRootImport;
46
- /**
47
- * Adds a provider to the root of the project.
48
- * @param project Name of the project to which to add the import.
49
- * @param callback Function that generates the code block which should be inserted.
50
- * @example
51
- *
52
- * ```ts
53
- * import { Rule } from '@angular-devkit/schematics';
54
- * import { addRootProvider } from '@schematics/angular/utility';
55
- *
56
- * export default function(): Rule {
57
- * return addRootProvider('default', ({code, external}) => {
58
- * return code`${external('provideLibrary', '@my/library')}({})`;
59
- * });
60
- * }
61
- * ```
62
- */
63
- function addRootProvider(project, callback) {
64
- return getRootInsertionRule(project, callback, 'providers');
65
- }
66
- exports.addRootProvider = addRootProvider;
67
- /**
68
- * Creates a rule that inserts code at the root of either a standalone or NgModule-based project.
69
- * @param project Name of the project into which to inser tthe code.
70
- * @param callback Function that generates the code block which should be inserted.
71
- * @param ngModuleField Field of the root NgModule into which the code should be inserted, if the
72
- * app is based on NgModule
73
- * @param standaloneWrapperFunction Function with which to wrap the code if the app is standalone.
74
- */
75
- function getRootInsertionRule(project, callback, ngModuleField, standaloneWrapperFunction) {
76
- return (host) => __awaiter(this, void 0, void 0, function* () {
77
- const mainFilePath = yield (0, util_1.getMainFilePath)(host, project);
78
- const codeBlock = new code_block_1.CodeBlock();
79
- if ((0, ng_ast_utils_2.isStandaloneApp)(host, mainFilePath)) {
80
- return tree => addProviderToStandaloneBootstrap(tree, callback(codeBlock), mainFilePath, standaloneWrapperFunction);
81
- }
82
- const modulePath = (0, ng_ast_utils_1.getAppModulePath)(host, mainFilePath);
83
- const pendingCode = code_block_1.CodeBlock.transformPendingCode(callback(codeBlock), modulePath);
84
- return (0, schematics_1.chain)([
85
- ...pendingCode.rules,
86
- tree => {
87
- const changes = (0, ast_utils_1.addSymbolToNgModuleMetadata)((0, util_1.getSourceFile)(tree, modulePath), modulePath, ngModuleField, pendingCode.code.expression,
88
- // Explicitly set the import path to null since we deal with imports here separately.
89
- null);
90
- (0, util_1.applyChangesToFile)(tree, modulePath, changes);
91
- }
92
- ]);
93
- });
94
- }
95
- /**
96
- * Adds a provider to the root of a standalone project.
97
- * @param host Tree of the root rule.
98
- * @param pendingCode Code that should be inserted.
99
- * @param mainFilePath Path to the project's main file.
100
- * @param wrapperFunction Optional function with which to wrap the provider.
101
- */
102
- function addProviderToStandaloneBootstrap(host, pendingCode, mainFilePath, wrapperFunction) {
103
- var _a;
104
- const bootstrapCall = (0, util_1.findBootstrapApplicationCall)(host, mainFilePath);
105
- const fileToEdit = ((_a = (0, app_config_1.findAppConfig)(bootstrapCall, host, mainFilePath)) === null || _a === void 0 ? void 0 : _a.filePath) || mainFilePath;
106
- const { code, rules } = code_block_1.CodeBlock.transformPendingCode(pendingCode, fileToEdit);
107
- return (0, schematics_1.chain)([
108
- ...rules,
109
- () => {
110
- let wrapped;
111
- let additionalRules;
112
- if (wrapperFunction) {
113
- const block = new code_block_1.CodeBlock();
114
- const result = code_block_1.CodeBlock.transformPendingCode(block.code `${block.external(wrapperFunction.name, wrapperFunction.module)}(${code.expression})`, fileToEdit);
115
- wrapped = result.code;
116
- additionalRules = result.rules;
117
- }
118
- else {
119
- wrapped = code;
120
- additionalRules = [];
121
- }
122
- return (0, schematics_1.chain)([
123
- ...additionalRules,
124
- tree => insertStandaloneRootProvider(tree, mainFilePath, wrapped.expression)
125
- ]);
126
- }
127
- ]);
128
- }
129
- /**
130
- * Inserts a string expression into the root of a standalone project.
131
- * @param tree File tree used to modify the project.
132
- * @param mainFilePath Path to the main file of the project.
133
- * @param expression Code expression to be inserted.
134
- */
135
- function insertStandaloneRootProvider(tree, mainFilePath, expression) {
136
- const bootstrapCall = (0, util_1.findBootstrapApplicationCall)(tree, mainFilePath);
137
- const appConfig = (0, app_config_1.findAppConfig)(bootstrapCall, tree, mainFilePath);
138
- if (bootstrapCall.arguments.length === 0) {
139
- throw new schematics_1.SchematicsException(`Cannot add provider to invalid bootstrapApplication call in ${bootstrapCall.getSourceFile().fileName}`);
140
- }
141
- if (appConfig) {
142
- addProvidersExpressionToAppConfig(tree, appConfig, expression);
143
- return;
144
- }
145
- const newAppConfig = `, {\n${core_1.tags.indentBy(2) `providers: [${expression}]`}\n}`;
146
- let targetCall;
147
- if (bootstrapCall.arguments.length === 1) {
148
- targetCall = bootstrapCall;
149
- }
150
- else if ((0, util_1.isMergeAppConfigCall)(bootstrapCall.arguments[1])) {
151
- targetCall = bootstrapCall.arguments[1];
152
- }
153
- else {
154
- throw new schematics_1.SchematicsException(`Cannot statically analyze bootstrapApplication call in ${bootstrapCall.getSourceFile().fileName}`);
155
- }
156
- (0, util_1.applyChangesToFile)(tree, mainFilePath, [
157
- (0, ast_utils_1.insertAfterLastOccurrence)(targetCall.arguments, newAppConfig, mainFilePath, targetCall.getEnd() - 1)
158
- ]);
159
- }
160
- /**
161
- * Adds a string expression to an app config object.
162
- * @param tree File tree used to modify the project.
163
- * @param appConfig Resolved configuration object of the project.
164
- * @param expression Code expression to be inserted.
165
- */
166
- function addProvidersExpressionToAppConfig(tree, appConfig, expression) {
167
- const { node, filePath } = appConfig;
168
- const configProps = node.properties;
169
- const providersLiteral = (0, util_1.findProvidersLiteral)(node);
170
- // If there's a `providers` property, we can add the provider
171
- // to it, otherwise we need to declare it ourselves.
172
- if (providersLiteral) {
173
- const hasTrailingComma = providersLiteral.elements.hasTrailingComma;
174
- (0, util_1.applyChangesToFile)(tree, filePath, [
175
- (0, ast_utils_1.insertAfterLastOccurrence)(providersLiteral.elements, (hasTrailingComma || providersLiteral.elements.length === 0 ? '' : ', ') + expression, filePath, providersLiteral.getStart() + 1)
176
- ]);
177
- }
178
- else {
179
- const prop = core_1.tags.indentBy(2) `providers: [${expression}]`;
180
- let toInsert;
181
- let insertPosition;
182
- if (configProps.length === 0) {
183
- toInsert = '\n' + prop + '\n';
184
- insertPosition = node.getEnd() - 1;
185
- }
186
- else {
187
- const hasTrailingComma = configProps.hasTrailingComma;
188
- toInsert = (hasTrailingComma ? '' : ',') + '\n' + prop;
189
- insertPosition =
190
- configProps[configProps.length - 1].getEnd() + (hasTrailingComma ? 1 : 0);
191
- }
192
- (0, util_1.applyChangesToFile)(tree, filePath, [new change_1.InsertChange(filePath, insertPosition, toInsert)]);
193
- }
194
- }
195
- //# sourceMappingURL=rules.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rules.js","sourceRoot":"","sources":["../../../../../../../packages/store/schematics/src/utils/ng-utils/standalone/rules.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,+CAA4C;AAC5C,2DAAoF;AAEpF,qEAG+C;AAC/C,+DAAkE;AAClE,2EAA4E;AAC5E,6CAAgE;AAChE,6CAAyE;AACzE,iCAOgB;AAChB,kDAAkD;AAElD;;;;;;;;;;;;;;;;GAgBG;AACH,SAAgB,aAAa,CAAC,OAAe,EAAE,QAA2B;IACxE,OAAO,oBAAoB,CAAC,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE;QACxD,IAAI,EAAE,qBAAqB;QAC3B,MAAM,EAAE,eAAe;KACxB,C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SAC7E;QAED,IAAA,yBAAkB,EAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,IAAI,qBAAY,CAAC,QAAQ,EAAE,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;KAC5F;AACH,CAAC"}
@@ -1,28 +0,0 @@
1
- import { Tree } from '@angular-devkit/schematics';
2
- import * as ts from '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript';
3
- import { Change } from '@schematics/angular/utility/change';
4
- /**
5
- * Finds the main file of a project.
6
- * @param tree File tree for the project.
7
- * @param projectName Name of the project in which to search.
8
- */
9
- export declare function getMainFilePath(tree: Tree, projectName: string): Promise<string>;
10
- /**
11
- * Gets a TypeScript source file at a specific path.
12
- * @param tree File tree of a project.
13
- * @param path Path to the file.
14
- */
15
- export declare function getSourceFile(tree: Tree, path: string): ts.SourceFile;
16
- /** Finds the call to `bootstrapApplication` within a file. */
17
- export declare function findBootstrapApplicationCall(tree: Tree, mainFilePath: string): ts.CallExpression;
18
- /**
19
- * Applies a set of changes to a file.
20
- * @param tree File tree of the project.
21
- * @param path Path to the file that is being changed.
22
- * @param changes Changes that should be applied to the file.
23
- */
24
- export declare function applyChangesToFile(tree: Tree, path: string, changes: Change[]): void;
25
- /** Checks whether a node is a call to `mergeApplicationConfig`. */
26
- export declare function isMergeAppConfigCall(node: ts.Node): node is ts.CallExpression;
27
- /** Finds the `providers` array literal within an application config. */
28
- export declare function findProvidersLiteral(config: ts.ObjectLiteralExpression): ts.ArrayLiteralExpression | null;