@ngxs/store 3.8.2 → 18.0.0-dev.master-f4c2c19

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 (379) hide show
  1. package/README.md +1 -1
  2. package/{esm2015/index.js → esm2022/index.mjs} +2 -2
  3. package/esm2022/internals/custom-rxjs-subjects.mjs +92 -0
  4. package/esm2022/internals/index.mjs +10 -0
  5. package/esm2022/internals/initial-state.mjs +18 -0
  6. package/esm2022/internals/internal-tokens.mjs +6 -0
  7. package/esm2022/internals/memoize.mjs +45 -0
  8. package/esm2022/internals/metadata.mjs +57 -0
  9. package/esm2022/internals/ngxs-app-bootstrapped-state.mjs +19 -0
  10. package/esm2022/internals/state-stream.mjs +32 -0
  11. package/esm2022/internals/state-token.mjs +17 -0
  12. package/esm2022/internals/symbols.mjs +11 -0
  13. package/esm2022/internals/testing/fresh-platform.mjs +72 -0
  14. package/{esm2015/internals/testing/helpers/ngxs-test.component.js → esm2022/internals/testing/helpers/ngxs-test.component.mjs} +4 -4
  15. package/esm2022/internals/testing/helpers/ngxs-test.module.mjs +20 -0
  16. package/{esm2015/internals/testing/index.js → esm2022/internals/testing/index.mjs} +2 -2
  17. package/esm2022/internals/testing/ngxs.setup.mjs +48 -0
  18. package/{esm2015/internals/testing/skip-console-logging.js → esm2022/internals/testing/skip-console-logging.mjs} +1 -1
  19. package/esm2022/internals/testing/symbol.mjs +2 -0
  20. package/esm2022/operators/append.mjs +20 -0
  21. package/esm2022/operators/iif.mjs +38 -0
  22. package/esm2022/operators/insert-item.mjs +29 -0
  23. package/esm2022/operators/patch.mjs +21 -0
  24. package/esm2022/operators/remove-item.mjs +22 -0
  25. package/esm2022/operators/update-item.mjs +40 -0
  26. package/esm2022/plugins/actions.mjs +16 -0
  27. package/esm2022/plugins/index.mjs +4 -0
  28. package/esm2022/plugins/ngxs-store-plugins.mjs +5 -0
  29. package/esm2022/plugins/symbols.mjs +6 -0
  30. package/esm2022/plugins/utils.mjs +51 -0
  31. package/esm2022/src/actions/symbols.mjs +2 -0
  32. package/esm2022/src/actions-stream.mjs +52 -0
  33. package/esm2022/src/configs/messages.config.mjs +48 -0
  34. package/esm2022/src/decorators/action.mjs +31 -0
  35. package/esm2022/src/decorators/select/select-factory.mjs +29 -0
  36. package/esm2022/src/decorators/select/select.mjs +29 -0
  37. package/esm2022/src/decorators/select/symbols.mjs +29 -0
  38. package/esm2022/src/decorators/selector/selector.mjs +29 -0
  39. package/esm2022/src/decorators/selector/symbols.mjs +2 -0
  40. package/esm2022/src/decorators/selector-options.mjs +21 -0
  41. package/esm2022/src/decorators/state.mjs +35 -0
  42. package/esm2022/src/dev-features/ngxs-development.module.mjs +28 -0
  43. package/esm2022/src/dev-features/ngxs-unhandled-actions-logger.mjs +45 -0
  44. package/esm2022/src/dev-features/symbols.mjs +7 -0
  45. package/esm2022/src/execution/dispatch-outside-zone-ngxs-execution-strategy.mjs +55 -0
  46. package/{esm2015/src/execution/internal-ngxs-execution-strategy.js → esm2022/src/execution/internal-ngxs-execution-strategy.mjs} +6 -6
  47. package/{esm2015/src/execution/noop-ngxs-execution-strategy.js → esm2022/src/execution/noop-ngxs-execution-strategy.mjs} +4 -4
  48. package/esm2022/src/execution/symbols.mjs +29 -0
  49. package/esm2022/src/internal/dispatcher.mjs +106 -0
  50. package/esm2022/src/internal/fallback-subscriber.mjs +29 -0
  51. package/esm2022/src/internal/internals.mjs +206 -0
  52. package/esm2022/src/internal/lifecycle-state-manager.mjs +86 -0
  53. package/esm2022/src/internal/state-context-factory.mjs +71 -0
  54. package/esm2022/src/internal/state-factory.mjs +311 -0
  55. package/esm2022/src/internal/state-operations.mjs +63 -0
  56. package/esm2022/src/internal/state-operators.mjs +20 -0
  57. package/esm2022/src/internal/unhandled-rxjs-error-callback.mjs +39 -0
  58. package/esm2022/src/ivy/ivy-enabled-in-dev-mode.mjs +25 -0
  59. package/esm2022/src/module.mjs +27 -0
  60. package/esm2022/src/modules/ngxs-feature.module.mjs +18 -0
  61. package/esm2022/src/modules/ngxs-root.module.mjs +18 -0
  62. package/esm2022/src/ngxs-unhandled-error-handler.mjs +29 -0
  63. package/esm2022/src/operators/of-action.mjs +104 -0
  64. package/esm2022/src/plugin-manager.mjs +37 -0
  65. package/esm2022/src/plugin_api.mjs +2 -0
  66. package/{esm2015/src/private_api.js → esm2022/src/private_api.mjs} +2 -1
  67. package/esm2022/src/public_api.mjs +20 -0
  68. package/esm2022/src/selectors/create-model-selector.mjs +30 -0
  69. package/esm2022/src/selectors/create-pick-selector.mjs +16 -0
  70. package/esm2022/src/selectors/create-property-selectors.mjs +20 -0
  71. package/esm2022/src/selectors/create-selector.mjs +9 -0
  72. package/esm2022/src/selectors/private_api.mjs +2 -0
  73. package/esm2022/src/selectors/selector-checks.util.mjs +18 -0
  74. package/esm2022/src/selectors/selector-metadata.mjs +35 -0
  75. package/esm2022/src/selectors/selector-models.mjs +2 -0
  76. package/esm2022/src/selectors/selector-types.util.mjs +2 -0
  77. package/esm2022/src/selectors/selector-utils.mjs +95 -0
  78. package/esm2022/src/standalone-features/feature-providers.mjs +20 -0
  79. package/esm2022/src/standalone-features/index.mjs +5 -0
  80. package/esm2022/src/standalone-features/initializers.mjs +89 -0
  81. package/esm2022/src/standalone-features/plugin.mjs +20 -0
  82. package/esm2022/src/standalone-features/preboot.mjs +32 -0
  83. package/esm2022/src/standalone-features/provide-states.mjs +26 -0
  84. package/esm2022/src/standalone-features/provide-store.mjs +26 -0
  85. package/esm2022/src/standalone-features/root-providers.mjs +47 -0
  86. package/esm2022/src/store.mjs +117 -0
  87. package/esm2022/src/symbols.mjs +87 -0
  88. package/esm2022/src/utils/compose.mjs +26 -0
  89. package/esm2022/src/utils/create-dispatch-map.mjs +11 -0
  90. package/esm2022/src/utils/create-select-map.mjs +13 -0
  91. package/esm2022/src/utils/dispatch.mjs +7 -0
  92. package/{esm2015/src/utils/freeze.js → esm2022/src/utils/freeze.mjs} +1 -1
  93. package/esm2022/src/utils/public_api.mjs +5 -0
  94. package/esm2022/src/utils/select.mjs +19 -0
  95. package/esm2022/src/utils/store-validators.mjs +25 -0
  96. package/{fesm2015/ngxs-store-internals-testing.js → fesm2022/ngxs-store-internals-testing.mjs} +84 -81
  97. package/fesm2022/ngxs-store-internals-testing.mjs.map +1 -0
  98. package/fesm2022/ngxs-store-internals.mjs +296 -0
  99. package/fesm2022/ngxs-store-internals.mjs.map +1 -0
  100. package/{fesm2015/ngxs-store-operators.js → fesm2022/ngxs-store-operators.mjs} +3 -3
  101. package/fesm2022/ngxs-store-operators.mjs.map +1 -0
  102. package/fesm2022/ngxs-store-plugins.mjs +80 -0
  103. package/fesm2022/ngxs-store-plugins.mjs.map +1 -0
  104. package/{fesm2015/ngxs-store.js → fesm2022/ngxs-store.mjs} +1319 -1265
  105. package/fesm2022/ngxs-store.mjs.map +1 -0
  106. package/index.d.ts +1 -1
  107. package/{src/internal → internals}/custom-rxjs-subjects.d.ts +2 -2
  108. package/internals/index.d.ts +8 -4
  109. package/internals/initial-state.d.ts +5 -5
  110. package/internals/memoize.d.ts +1 -1
  111. package/internals/metadata.d.ts +25 -0
  112. package/internals/ngxs-app-bootstrapped-state.d.ts +8 -0
  113. package/internals/state-stream.d.ts +15 -0
  114. package/internals/state-token.d.ts +7 -0
  115. package/internals/symbols.d.ts +84 -3
  116. package/internals/testing/helpers/ngxs-test.component.d.ts +1 -1
  117. package/internals/testing/index.d.ts +2 -2
  118. package/internals/testing/symbol.d.ts +2 -2
  119. package/operators/patch.d.ts +2 -2
  120. package/operators/types.d.ts +5 -5
  121. package/operators/utils.d.ts +1 -1
  122. package/package.json +44 -13
  123. package/{src/actions → plugins}/actions.d.ts +3 -3
  124. package/plugins/index.d.ts +3 -0
  125. package/plugins/symbols.d.ts +13 -0
  126. package/{src/utils → plugins}/utils.d.ts +0 -17
  127. package/schematics/collection.json +36 -0
  128. package/schematics/src/actions/actions.factory.d.ts +3 -0
  129. package/schematics/src/actions/actions.factory.js +24 -0
  130. package/schematics/src/actions/actions.factory.js.map +1 -0
  131. package/schematics/src/actions/files/__name__.actions.ts__template__ +4 -0
  132. package/schematics/src/actions/schema.json +35 -0
  133. package/schematics/src/ng-add/add-declaration.d.ts +4 -0
  134. package/schematics/src/ng-add/add-declaration.js +109 -0
  135. package/schematics/src/ng-add/add-declaration.js.map +1 -0
  136. package/schematics/src/ng-add/ng-add.factory.d.ts +9 -0
  137. package/schematics/src/ng-add/ng-add.factory.js +89 -0
  138. package/schematics/src/ng-add/ng-add.factory.js.map +1 -0
  139. package/schematics/src/ng-add/schema.json +72 -0
  140. package/schematics/src/starter-kit/files/store/auth/auth.actions.ts__template__ +6 -0
  141. package/schematics/src/starter-kit/files/store/auth/auth.state.spec.ts__template__ +55 -0
  142. package/schematics/src/starter-kit/files/store/auth/auth.state.ts__template__ +47 -0
  143. package/schematics/src/starter-kit/files/store/dashboard/index.ts__template__ +4 -0
  144. package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.actions.ts__template__ +10 -0
  145. package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.state.spec.ts__template__ +92 -0
  146. package/schematics/src/starter-kit/files/store/dashboard/states/dictionary/dictionary.state.ts__template__ +62 -0
  147. package/schematics/src/starter-kit/files/store/dashboard/states/user/user.actions.ts__template__ +6 -0
  148. package/schematics/src/starter-kit/files/store/dashboard/states/user/user.state.spec.ts__template__ +61 -0
  149. package/schematics/src/starter-kit/files/store/dashboard/states/user/user.state.ts__template__ +42 -0
  150. package/schematics/src/starter-kit/files/store/store.config.ts__template__ +39 -0
  151. package/schematics/src/starter-kit/files/store/store.module.ts__template__ +22 -0
  152. package/schematics/src/starter-kit/schema.json +22 -0
  153. package/schematics/src/starter-kit/starter-kit.factory.d.ts +3 -0
  154. package/schematics/src/starter-kit/starter-kit.factory.js +21 -0
  155. package/schematics/src/starter-kit/starter-kit.factory.js.map +1 -0
  156. package/schematics/src/state/files/__name__.state.spec.ts__template__ +25 -0
  157. package/schematics/src/state/files/__name__.state.ts__template__ +22 -0
  158. package/schematics/src/state/schema.json +44 -0
  159. package/schematics/src/state/state.factory.d.ts +3 -0
  160. package/schematics/src/state/state.factory.js +29 -0
  161. package/schematics/src/state/state.factory.js.map +1 -0
  162. package/schematics/src/store/files/__name__.actions.ts__template__ +4 -0
  163. package/schematics/src/store/files/__name__.state.spec.ts__template__ +26 -0
  164. package/schematics/src/store/files/__name__.state.ts__template__ +29 -0
  165. package/schematics/src/store/schema.json +44 -0
  166. package/schematics/src/store/store.factory.d.ts +3 -0
  167. package/schematics/src/store/store.factory.js +29 -0
  168. package/schematics/src/store/store.factory.js.map +1 -0
  169. package/schematics/src/utils/common/lib.config.d.ts +10 -0
  170. package/schematics/src/utils/common/lib.config.js +15 -0
  171. package/schematics/src/utils/common/lib.config.js.map +1 -0
  172. package/schematics/src/utils/common/project-files.config.d.ts +3 -0
  173. package/schematics/src/utils/common/project-files.config.js +7 -0
  174. package/schematics/src/utils/common/project-files.config.js.map +1 -0
  175. package/schematics/src/utils/common/properties.d.ts +1 -0
  176. package/schematics/src/utils/common/properties.js +8 -0
  177. package/schematics/src/utils/common/properties.js.map +1 -0
  178. package/schematics/src/utils/config.d.ts +119 -0
  179. package/schematics/src/utils/config.js +21 -0
  180. package/schematics/src/utils/config.js.map +1 -0
  181. package/schematics/src/utils/generate-utils.d.ts +4 -0
  182. package/schematics/src/utils/generate-utils.js +14 -0
  183. package/schematics/src/utils/generate-utils.js.map +1 -0
  184. package/schematics/src/utils/interfaces/package.interface.d.ts +7 -0
  185. package/schematics/src/utils/interfaces/package.interface.js +3 -0
  186. package/schematics/src/utils/interfaces/package.interface.js.map +1 -0
  187. package/schematics/src/utils/ng-utils/README.md +1 -0
  188. package/schematics/src/utils/ng-utils/ast-utils.d.ts +99 -0
  189. package/schematics/src/utils/ng-utils/ast-utils.js +517 -0
  190. package/schematics/src/utils/ng-utils/ast-utils.js.map +1 -0
  191. package/schematics/src/utils/ng-utils/ng-ast-utils.d.ts +5 -0
  192. package/schematics/src/utils/ng-utils/ng-ast-utils.js +67 -0
  193. package/schematics/src/utils/ng-utils/ng-ast-utils.js.map +1 -0
  194. package/schematics/src/utils/ng-utils/project.d.ts +2 -0
  195. package/schematics/src/utils/ng-utils/project.js +27 -0
  196. package/schematics/src/utils/ng-utils/project.js.map +1 -0
  197. package/schematics/src/utils/ng-utils/standalone/app_config.d.ts +16 -0
  198. package/schematics/src/utils/ng-utils/standalone/app_config.js +84 -0
  199. package/schematics/src/utils/ng-utils/standalone/app_config.js.map +1 -0
  200. package/schematics/src/utils/ng-utils/standalone/code_block.d.ts +46 -0
  201. package/schematics/src/utils/ng-utils/standalone/code_block.js +73 -0
  202. package/schematics/src/utils/ng-utils/standalone/code_block.js.map +1 -0
  203. package/schematics/src/utils/ng-utils/standalone/index.d.ts +1 -0
  204. package/schematics/src/utils/ng-utils/standalone/index.js +7 -0
  205. package/schematics/src/utils/ng-utils/standalone/index.js.map +1 -0
  206. package/schematics/src/utils/ng-utils/standalone/rules.d.ts +38 -0
  207. package/schematics/src/utils/ng-utils/standalone/rules.js +195 -0
  208. package/schematics/src/utils/ng-utils/standalone/rules.js.map +1 -0
  209. package/schematics/src/utils/ng-utils/standalone/util.d.ts +28 -0
  210. package/schematics/src/utils/ng-utils/standalone/util.js +138 -0
  211. package/schematics/src/utils/ng-utils/standalone/util.js.map +1 -0
  212. package/schematics/src/utils/normalize-options.d.ts +11 -0
  213. package/schematics/src/utils/normalize-options.js +27 -0
  214. package/schematics/src/utils/normalize-options.js.map +1 -0
  215. package/schematics/src/utils/project.d.ts +19 -0
  216. package/schematics/src/utils/project.js +46 -0
  217. package/schematics/src/utils/project.js.map +1 -0
  218. package/schematics/src/utils/versions.json +3 -0
  219. package/src/actions/symbols.d.ts +3 -17
  220. package/src/actions-stream.d.ts +2 -2
  221. package/src/configs/messages.config.d.ts +3 -1
  222. package/src/decorators/action.d.ts +28 -3
  223. package/src/decorators/select/select.d.ts +3 -0
  224. package/src/decorators/select/symbols.d.ts +2 -3
  225. package/src/decorators/selector/selector.d.ts +2 -3
  226. package/src/decorators/selector/symbols.d.ts +73 -4
  227. package/src/decorators/selector-options.d.ts +2 -2
  228. package/src/decorators/state.d.ts +2 -3
  229. package/src/dev-features/ngxs-development.module.d.ts +1 -0
  230. package/src/execution/symbols.d.ts +8 -2
  231. package/src/internal/dispatcher.d.ts +5 -5
  232. package/src/internal/fallback-subscriber.d.ts +3 -0
  233. package/src/internal/internals.d.ts +13 -69
  234. package/src/internal/lifecycle-state-manager.d.ts +6 -6
  235. package/src/internal/state-factory.d.ts +8 -6
  236. package/src/internal/state-operations.d.ts +2 -2
  237. package/src/internal/unhandled-rxjs-error-callback.d.ts +2 -0
  238. package/src/module.d.ts +3 -14
  239. package/src/modules/ngxs-feature.module.d.ts +2 -9
  240. package/src/modules/ngxs-root.module.d.ts +2 -9
  241. package/src/ngxs-unhandled-error-handler.d.ts +16 -0
  242. package/src/operators/of-action.d.ts +3 -3
  243. package/src/plugin-manager.d.ts +1 -1
  244. package/src/plugin_api.d.ts +1 -5
  245. package/src/private_api.d.ts +1 -0
  246. package/src/public_api.d.ts +11 -8
  247. package/src/selectors/create-model-selector.d.ts +2 -2
  248. package/src/selectors/create-pick-selector.d.ts +1 -1
  249. package/src/selectors/create-property-selectors.d.ts +3 -3
  250. package/src/selectors/create-selector.d.ts +10 -10
  251. package/src/selectors/private_api.d.ts +7 -0
  252. package/src/selectors/selector-checks.util.d.ts +2 -2
  253. package/src/selectors/selector-metadata.d.ts +4 -4
  254. package/src/selectors/selector-models.d.ts +4 -4
  255. package/src/selectors/selector-types.util.d.ts +6 -7
  256. package/src/selectors/selector-utils.d.ts +3 -3
  257. package/src/standalone-features/feature-providers.d.ts +7 -0
  258. package/src/standalone-features/index.d.ts +4 -0
  259. package/src/standalone-features/initializers.d.ts +29 -0
  260. package/src/standalone-features/plugin.d.ts +17 -0
  261. package/src/standalone-features/preboot.d.ts +26 -0
  262. package/src/standalone-features/provide-states.d.ts +18 -0
  263. package/src/standalone-features/provide-store.d.ts +22 -0
  264. package/src/standalone-features/root-providers.d.ts +8 -0
  265. package/src/store.d.ts +13 -15
  266. package/src/symbols.d.ts +12 -54
  267. package/src/utils/compose.d.ts +1 -1
  268. package/src/utils/create-dispatch-map.d.ts +4 -0
  269. package/src/utils/create-select-map.d.ts +4 -0
  270. package/src/utils/dispatch.d.ts +2 -0
  271. package/src/utils/public_api.d.ts +4 -0
  272. package/src/utils/select.d.ts +16 -0
  273. package/src/utils/store-validators.d.ts +4 -3
  274. package/bundles/ngxs-store-internals-testing.umd.js +0 -684
  275. package/bundles/ngxs-store-internals-testing.umd.js.map +0 -1
  276. package/bundles/ngxs-store-internals.umd.js +0 -141
  277. package/bundles/ngxs-store-internals.umd.js.map +0 -1
  278. package/bundles/ngxs-store-operators.umd.js +0 -224
  279. package/bundles/ngxs-store-operators.umd.js.map +0 -1
  280. package/bundles/ngxs-store.umd.js +0 -3076
  281. package/bundles/ngxs-store.umd.js.map +0 -1
  282. package/esm2015/internals/index.js +0 -5
  283. package/esm2015/internals/initial-state.js +0 -17
  284. package/esm2015/internals/internal-tokens.js +0 -5
  285. package/esm2015/internals/memoize.js +0 -45
  286. package/esm2015/internals/ngxs-bootstrapper.js +0 -29
  287. package/esm2015/internals/src/symbols.js +0 -2
  288. package/esm2015/internals/symbols.js +0 -2
  289. package/esm2015/internals/testing/fresh-platform.js +0 -70
  290. package/esm2015/internals/testing/helpers/ngxs-test.module.js +0 -21
  291. package/esm2015/internals/testing/ngxs.setup.js +0 -46
  292. package/esm2015/internals/testing/symbol.js +0 -2
  293. package/esm2015/operators/append.js +0 -20
  294. package/esm2015/operators/iif.js +0 -38
  295. package/esm2015/operators/insert-item.js +0 -29
  296. package/esm2015/operators/patch.js +0 -21
  297. package/esm2015/operators/remove-item.js +0 -22
  298. package/esm2015/operators/update-item.js +0 -40
  299. package/esm2015/src/actions/actions.js +0 -16
  300. package/esm2015/src/actions/symbols.js +0 -2
  301. package/esm2015/src/actions-stream.js +0 -52
  302. package/esm2015/src/configs/messages.config.js +0 -36
  303. package/esm2015/src/decorators/action.js +0 -33
  304. package/esm2015/src/decorators/select/select-factory.js +0 -29
  305. package/esm2015/src/decorators/select/select.js +0 -26
  306. package/esm2015/src/decorators/select/symbols.js +0 -29
  307. package/esm2015/src/decorators/selector/selector.js +0 -32
  308. package/esm2015/src/decorators/selector/symbols.js +0 -2
  309. package/esm2015/src/decorators/selector-options.js +0 -21
  310. package/esm2015/src/decorators/state.js +0 -36
  311. package/esm2015/src/dev-features/ngxs-development.module.js +0 -22
  312. package/esm2015/src/dev-features/ngxs-unhandled-actions-logger.js +0 -46
  313. package/esm2015/src/dev-features/symbols.js +0 -6
  314. package/esm2015/src/execution/dispatch-outside-zone-ngxs-execution-strategy.js +0 -57
  315. package/esm2015/src/execution/symbols.js +0 -23
  316. package/esm2015/src/internal/custom-rxjs-subjects.js +0 -92
  317. package/esm2015/src/internal/dispatcher.js +0 -104
  318. package/esm2015/src/internal/error-handler.js +0 -64
  319. package/esm2015/src/internal/internals.js +0 -248
  320. package/esm2015/src/internal/lifecycle-state-manager.js +0 -79
  321. package/esm2015/src/internal/state-context-factory.js +0 -68
  322. package/esm2015/src/internal/state-factory.js +0 -288
  323. package/esm2015/src/internal/state-operations.js +0 -63
  324. package/esm2015/src/internal/state-operators.js +0 -20
  325. package/esm2015/src/internal/state-stream.js +0 -25
  326. package/esm2015/src/ivy/ivy-enabled-in-dev-mode.js +0 -25
  327. package/esm2015/src/module.js +0 -88
  328. package/esm2015/src/modules/ngxs-feature.module.js +0 -45
  329. package/esm2015/src/modules/ngxs-root.module.js +0 -41
  330. package/esm2015/src/operators/of-action.js +0 -102
  331. package/esm2015/src/plugin-manager.js +0 -37
  332. package/esm2015/src/plugin_api.js +0 -6
  333. package/esm2015/src/public_api.js +0 -27
  334. package/esm2015/src/public_to_deprecate.js +0 -14
  335. package/esm2015/src/selectors/create-model-selector.js +0 -30
  336. package/esm2015/src/selectors/create-pick-selector.js +0 -16
  337. package/esm2015/src/selectors/create-property-selectors.js +0 -20
  338. package/esm2015/src/selectors/create-selector.js +0 -9
  339. package/esm2015/src/selectors/selector-checks.util.js +0 -18
  340. package/esm2015/src/selectors/selector-metadata.js +0 -30
  341. package/esm2015/src/selectors/selector-models.js +0 -2
  342. package/esm2015/src/selectors/selector-types.util.js +0 -2
  343. package/esm2015/src/selectors/selector-utils.js +0 -74
  344. package/esm2015/src/state-token/state-token.js +0 -17
  345. package/esm2015/src/state-token/symbols.js +0 -2
  346. package/esm2015/src/store.js +0 -107
  347. package/esm2015/src/symbols.js +0 -58
  348. package/esm2015/src/utils/compose.js +0 -26
  349. package/esm2015/src/utils/store-validators.js +0 -25
  350. package/esm2015/src/utils/utils.js +0 -92
  351. package/fesm2015/ngxs-store-internals-testing.js.map +0 -1
  352. package/fesm2015/ngxs-store-internals.js +0 -101
  353. package/fesm2015/ngxs-store-internals.js.map +0 -1
  354. package/fesm2015/ngxs-store-operators.js.map +0 -1
  355. package/fesm2015/ngxs-store.js.map +0 -1
  356. package/internals/ngxs-bootstrapper.d.ts +0 -16
  357. package/internals/ngxs-store-internals.d.ts +0 -5
  358. package/internals/package.json +0 -10
  359. package/internals/src/symbols.d.ts +0 -7
  360. package/internals/testing/ngxs-store-internals-testing.d.ts +0 -5
  361. package/internals/testing/package.json +0 -10
  362. package/ngxs-store.d.ts +0 -5
  363. package/operators/ngxs-store-operators.d.ts +0 -5
  364. package/operators/package.json +0 -10
  365. package/src/internal/error-handler.d.ts +0 -26
  366. package/src/internal/state-stream.d.ts +0 -14
  367. package/src/public_to_deprecate.d.ts +0 -21
  368. package/src/state-token/state-token.d.ts +0 -7
  369. package/src/state-token/symbols.d.ts +0 -5
  370. /package/{esm2015/internals/ngxs-store-internals.js → esm2022/internals/ngxs-store-internals.mjs} +0 -0
  371. /package/{esm2015/internals/testing/ngxs-store-internals-testing.js → esm2022/internals/testing/ngxs-store-internals-testing.mjs} +0 -0
  372. /package/{esm2015/ngxs-store.js → esm2022/ngxs-store.mjs} +0 -0
  373. /package/{esm2015/operators/compose.js → esm2022/operators/compose.mjs} +0 -0
  374. /package/{esm2015/operators/index.js → esm2022/operators/index.mjs} +0 -0
  375. /package/{esm2015/operators/ngxs-store-operators.js → esm2022/operators/ngxs-store-operators.mjs} +0 -0
  376. /package/{esm2015/operators/types.js → esm2022/operators/types.mjs} +0 -0
  377. /package/{esm2015/operators/utils.js → esm2022/operators/utils.mjs} +0 -0
  378. /package/{esm2015/src/operators/leave-ngxs.js → esm2022/src/operators/leave-ngxs.mjs} +0 -0
  379. /package/{esm2015/src/selectors/index.js → esm2022/src/selectors/index.mjs} +0 -0
@@ -0,0 +1,3 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { StateSchema } from './state.schema';
3
+ export declare function state(options: StateSchema): Rule;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.state = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const path_1 = require("path");
6
+ const properties_1 = require("../utils/common/properties");
7
+ const generate_utils_1 = require("../utils/generate-utils");
8
+ const ng_ast_utils_1 = require("../utils/ng-utils/ng-ast-utils");
9
+ const project_1 = require("../utils/ng-utils/project");
10
+ const normalize_options_1 = require("../utils/normalize-options");
11
+ function state(options) {
12
+ return (host) => {
13
+ if ((0, properties_1.isEmpty)(options.name)) {
14
+ throw new schematics_1.SchematicsException('Invalid options, "name" is required.');
15
+ }
16
+ let isStandalone = options.standalone;
17
+ if (typeof isStandalone !== 'boolean') {
18
+ const mainFile = (0, project_1.getProjectMainFile)(host, options.project);
19
+ isStandalone = !!mainFile && (0, ng_ast_utils_1.isStandaloneApp)(host, mainFile);
20
+ }
21
+ const normalizedOptions = (0, normalize_options_1.normalizeBaseOptions)(host, options);
22
+ const path = options.flat
23
+ ? normalizedOptions.path
24
+ : (0, path_1.join)(normalizedOptions.path, normalizedOptions.name);
25
+ return (0, generate_utils_1.generateFiles)((0, schematics_1.url)('./files'), path, Object.assign(Object.assign({}, normalizedOptions), { isStandalone }), options.spec);
26
+ };
27
+ }
28
+ exports.state = state;
29
+ //# sourceMappingURL=state.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"state.factory.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/state/state.factory.ts"],"names":[],"mappings":";;;AAAA,2DAAkF;AAClF,+BAA4B;AAC5B,2DAAqD;AACrD,4DAAwD;AACxD,iEAAiE;AACjE,uDAA+D;AAC/D,kEAAkE;AAGlE,SAAgB,KAAK,CAAC,OAAoB;IACxC,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,IAAI,IAAA,oBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,gCAAmB,CAAC,sCAAsC,CAAC,CAAC;QACxE,CAAC;QAED,IAAI,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,OAAO,YAAY,KAAK,SAAS,EAAE,CAAC;YACtC,MAAM,QAAQ,GAAG,IAAA,4BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAC3D,YAAY,GAAG,CAAC,CAAC,QAAQ,IAAI,IAAA,8BAAe,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,iBAAiB,GAAG,IAAA,wCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;YACvB,CAAC,CAAC,iBAAiB,CAAC,IAAI;YACxB,CAAC,CAAC,IAAA,WAAI,EAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO,IAAA,8BAAa,EAClB,IAAA,gBAAG,EAAC,SAAS,CAAC,EACd,IAAI,kCACC,iBAAiB,KAAE,YAAY,KACpC,OAAO,CAAC,IAAI,CACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAxBD,sBAwBC"}
@@ -0,0 +1,4 @@
1
+ export class <%= classify(name) %>Action {
2
+ static readonly type = '[<%= classify(name) %>] Add item';
3
+ constructor(readonly payload: string) { }
4
+ }
@@ -0,0 +1,26 @@
1
+ import { TestBed } from '@angular/core/testing';
2
+ import { <% if (isStandalone) { %> provideStore, <% } else { %> NgxsModule, <% } %> Store } from '@ngxs/store';
3
+ import { <%= classify(name) %>State, <%= classify(name) %>StateModel } from './<%= dasherize(name) %>.state';
4
+ import { <%= classify(name) %>Action } from './<%= dasherize(name) %>.actions';
5
+
6
+ describe('<%= classify(name) %> store', () => {
7
+ let store: Store;
8
+ beforeEach(() => {
9
+ TestBed.configureTestingModule({
10
+ <% if (isStandalone) { %> providers: [provideStore([<%= classify(name) %>State])]
11
+ <% } else { %> imports: [NgxsModule.forRoot([<%= classify(name) %>State])] <% } %>
12
+ });
13
+
14
+ store = TestBed.inject(Store);
15
+ });
16
+
17
+ it('should create an action and add an item', () => {
18
+ const expected: <%= classify(name) %>StateModel = {
19
+ items: ['item-1']
20
+ };
21
+ store.dispatch(new <%= classify(name) %>Action('item-1'));
22
+ const actual = store.selectSnapshot(<%= classify(name) %>State.getState);
23
+ expect(actual).toEqual(expected);
24
+ });
25
+
26
+ });
@@ -0,0 +1,29 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { State, Action, Selector, StateContext } from '@ngxs/store';
3
+ import { <%= classify(name) %>Action } from './<%= dasherize(name) %>.actions';
4
+
5
+ export interface <%= classify(name) %>StateModel {
6
+ items: string[];
7
+ }
8
+
9
+ @State<<%= classify(name) %>StateModel>({
10
+ name: '<%= camelize(name) %>',
11
+ defaults: {
12
+ items: []
13
+ }
14
+ })
15
+ @Injectable()
16
+ export class <%= classify(name) %>State {
17
+
18
+ @Selector()
19
+ static getState(state: <%= classify(name) %>StateModel) {
20
+ return state;
21
+ }
22
+
23
+ @Action(<%= classify(name) %>Action)
24
+ add(ctx: StateContext<<%= classify(name) %>StateModel>, { payload }: <%= classify(name) %>Action) {
25
+ const stateModel = ctx.getState();
26
+ stateModel.items = [...stateModel.items, payload];
27
+ ctx.setState(stateModel);
28
+ }
29
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "http://json-schema.org/schema",
3
+ "$id": "SchematicsNgxsStore",
4
+ "title": "Ngxs Store Options Schema",
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "description": "The name of the store.",
9
+ "type": "string",
10
+ "$default": {
11
+ "$source": "argv",
12
+ "index": 0
13
+ },
14
+ "x-prompt": "What name would you like to use for the store?",
15
+ "x-priority": "important"
16
+ },
17
+ "path": {
18
+ "type": "string",
19
+ "format": "path",
20
+ "description": "The path to create the store. Relative to the specified (or default) project."
21
+ },
22
+ "spec": {
23
+ "type": "boolean",
24
+ "description": "Specifies if a spec file is generated.",
25
+ "default": true
26
+ },
27
+ "flat": {
28
+ "type": "boolean",
29
+ "default": false,
30
+ "description": "Flag to indicate if a dir is created."
31
+ },
32
+ "project": {
33
+ "type": "string",
34
+ "description": "The name of the project.",
35
+ "aliases": ["p"],
36
+ "x-dropdown": "projects"
37
+ },
38
+ "standalone": {
39
+ "type": "boolean",
40
+ "description": "Explicitly set whether should generate standalone APIs for the generated store."
41
+ }
42
+ },
43
+ "required": ["name"]
44
+ }
@@ -0,0 +1,3 @@
1
+ import { Rule } from '@angular-devkit/schematics';
2
+ import { StoreSchema } from './store.schema';
3
+ export declare function store(options: StoreSchema): Rule;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.store = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ const path_1 = require("path");
6
+ const properties_1 = require("../utils/common/properties");
7
+ const generate_utils_1 = require("../utils/generate-utils");
8
+ const ng_ast_utils_1 = require("../utils/ng-utils/ng-ast-utils");
9
+ const project_1 = require("../utils/ng-utils/project");
10
+ const normalize_options_1 = require("../utils/normalize-options");
11
+ function store(options) {
12
+ return (host) => {
13
+ if ((0, properties_1.isEmpty)(options.name)) {
14
+ throw new schematics_1.SchematicsException('Invalid options, "name" is required.');
15
+ }
16
+ let isStandalone = options.standalone;
17
+ if (typeof isStandalone !== 'boolean') {
18
+ const mainFile = (0, project_1.getProjectMainFile)(host, options.project);
19
+ isStandalone = !!mainFile && (0, ng_ast_utils_1.isStandaloneApp)(host, mainFile);
20
+ }
21
+ const normalizedOptions = (0, normalize_options_1.normalizeBaseOptions)(host, options);
22
+ const path = options.flat
23
+ ? normalizedOptions.path
24
+ : (0, path_1.join)(normalizedOptions.path, normalizedOptions.name);
25
+ return (0, generate_utils_1.generateFiles)((0, schematics_1.url)('./files'), path, Object.assign(Object.assign({}, normalizedOptions), { isStandalone }), options.spec);
26
+ };
27
+ }
28
+ exports.store = store;
29
+ //# sourceMappingURL=store.factory.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"store.factory.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/store/store.factory.ts"],"names":[],"mappings":";;;AAAA,2DAAkF;AAClF,+BAA4B;AAC5B,2DAAqD;AACrD,4DAAwD;AACxD,iEAAiE;AACjE,uDAA+D;AAC/D,kEAAkE;AAGlE,SAAgB,KAAK,CAAC,OAAoB;IACxC,OAAO,CAAC,IAAU,EAAE,EAAE;QACpB,IAAI,IAAA,oBAAO,EAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,MAAM,IAAI,gCAAmB,CAAC,sCAAsC,CAAC,CAAC;QACxE,CAAC;QAED,IAAI,YAAY,GAAG,OAAO,CAAC,UAAU,CAAC;QACtC,IAAI,OAAO,YAAY,KAAK,SAAS,EAAE,CAAC;YACtC,MAAM,QAAQ,GAAG,IAAA,4BAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YAC3D,YAAY,GAAG,CAAC,CAAC,QAAQ,IAAI,IAAA,8BAAe,EAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;QAC/D,CAAC;QAED,MAAM,iBAAiB,GAAG,IAAA,wCAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI;YACvB,CAAC,CAAC,iBAAiB,CAAC,IAAI;YACxB,CAAC,CAAC,IAAA,WAAI,EAAC,iBAAiB,CAAC,IAAI,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAEzD,OAAO,IAAA,8BAAa,EAClB,IAAA,gBAAG,EAAC,SAAS,CAAC,EACd,IAAI,kCACC,iBAAiB,KAAE,YAAY,KACpC,OAAO,CAAC,IAAI,CACb,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC;AAxBD,sBAwBC"}
@@ -0,0 +1,10 @@
1
+ export declare enum LIBRARIES {
2
+ DEVTOOLS = "@ngxs/devtools-plugin",
3
+ FORM = "@ngxs/form-plugin",
4
+ HMR = "@ngxs/hmr-plugin",
5
+ LOGGER = "@ngxs/logger-plugin",
6
+ ROUTER = "@ngxs/router-plugin",
7
+ STORAGE = "@ngxs/storage-plugin",
8
+ STORE = "@ngxs/store",
9
+ WEBSOCKET = "@ngxs/websocket-plugin"
10
+ }
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.LIBRARIES = void 0;
4
+ var LIBRARIES;
5
+ (function (LIBRARIES) {
6
+ LIBRARIES["DEVTOOLS"] = "@ngxs/devtools-plugin";
7
+ LIBRARIES["FORM"] = "@ngxs/form-plugin";
8
+ LIBRARIES["HMR"] = "@ngxs/hmr-plugin";
9
+ LIBRARIES["LOGGER"] = "@ngxs/logger-plugin";
10
+ LIBRARIES["ROUTER"] = "@ngxs/router-plugin";
11
+ LIBRARIES["STORAGE"] = "@ngxs/storage-plugin";
12
+ LIBRARIES["STORE"] = "@ngxs/store";
13
+ LIBRARIES["WEBSOCKET"] = "@ngxs/websocket-plugin";
14
+ })(LIBRARIES || (exports.LIBRARIES = LIBRARIES = {}));
15
+ //# sourceMappingURL=lib.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lib.config.js","sourceRoot":"","sources":["../../../../../../packages/store/schematics/src/utils/common/lib.config.ts"],"names":[],"mappings":";;;AAAA,IAAY,SASX;AATD,WAAY,SAAS;IACnB,+CAAkC,CAAA;IAClC,uCAA0B,CAAA;IAC1B,qCAAwB,CAAA;IACxB,2CAA8B,CAAA;IAC9B,2CAA8B,CAAA;IAC9B,6CAAgC,CAAA;IAChC,kCAAqB,CAAA;IACrB,iDAAoC,CAAA;AACtC,CAAC,EATW,SAAS,yBAAT,SAAS,QASpB"}
@@ -0,0 +1,3 @@
1
+ export declare const PACKAGE_JSON = "package.json";
2
+ export declare const ANGULAR_JSON = "angular.json";
3
+ export declare const TSCONFIG_SPEC_JSON = "src/tsconfig.spec.json";
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TSCONFIG_SPEC_JSON = exports.ANGULAR_JSON = exports.PACKAGE_JSON = void 0;
4
+ exports.PACKAGE_JSON = 'package.json';
5
+ exports.ANGULAR_JSON = 'angular.json';
6
+ exports.TSCONFIG_SPEC_JSON = 'src/tsconfig.spec.json';
7
+ //# sourceMappingURL=project-files.config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project-files.config.js","sourceRoot":"","sources":["../../../../../../packages/store/schematics/src/utils/common/project-files.config.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,YAAY,GAAG,cAAc,CAAC;AAC9B,QAAA,kBAAkB,GAAG,wBAAwB,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function isEmpty(value: string | undefined): boolean;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isEmpty = void 0;
4
+ function isEmpty(value) {
5
+ return typeof value !== 'undefined' && !value.trim().length;
6
+ }
7
+ exports.isEmpty = isEmpty;
8
+ //# sourceMappingURL=properties.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"properties.js","sourceRoot":"","sources":["../../../../../../packages/store/schematics/src/utils/common/properties.ts"],"names":[],"mappings":";;;AAAA,SAAgB,OAAO,CAAC,KAAyB;IAC/C,OAAO,OAAO,KAAK,KAAK,WAAW,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,MAAM,CAAC;AAC9D,CAAC;AAFD,0BAEC"}
@@ -0,0 +1,119 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ export interface AppConfig {
3
+ /**
4
+ * Name of the app.
5
+ */
6
+ name?: string;
7
+ /**
8
+ * Directory where app files are placed.
9
+ */
10
+ appRoot?: string;
11
+ /**
12
+ * The root directory of the app.
13
+ */
14
+ root?: string;
15
+ /**
16
+ * The output directory for build results.
17
+ */
18
+ outDir?: string;
19
+ /**
20
+ * List of application assets.
21
+ */
22
+ assets?: (string | {
23
+ /**
24
+ * The pattern to match.
25
+ */
26
+ glob?: string;
27
+ /**
28
+ * The dir to search within.
29
+ */
30
+ input?: string;
31
+ /**
32
+ * The output path (relative to the outDir).
33
+ */
34
+ output?: string;
35
+ })[];
36
+ /**
37
+ * URL where files will be deployed.
38
+ */
39
+ deployUrl?: string;
40
+ /**
41
+ * Base url for the application being built.
42
+ */
43
+ baseHref?: string;
44
+ /**
45
+ * The runtime platform of the app.
46
+ */
47
+ platform?: 'browser' | 'server';
48
+ /**
49
+ * The name of the start HTML file.
50
+ */
51
+ index?: string;
52
+ /**
53
+ * The name of the main entry-point file.
54
+ */
55
+ main?: string;
56
+ /**
57
+ * The name of the polyfills file.
58
+ */
59
+ polyfills?: string;
60
+ /**
61
+ * The name of the test entry-point file.
62
+ */
63
+ test?: string;
64
+ /**
65
+ * The name of the TypeScript configuration file.
66
+ */
67
+ tsconfig?: string;
68
+ /**
69
+ * The name of the TypeScript configuration file for unit tests.
70
+ */
71
+ testTsconfig?: string;
72
+ /**
73
+ * The prefix to apply to generated selectors.
74
+ */
75
+ prefix?: string;
76
+ /**
77
+ * Experimental support for a service worker from @angular/service-worker.
78
+ */
79
+ serviceWorker?: boolean;
80
+ /**
81
+ * Global styles to be included in the build.
82
+ */
83
+ styles?: (string | {
84
+ input?: string;
85
+ [name: string]: any;
86
+ })[];
87
+ /**
88
+ * Options to pass to style preprocessors
89
+ */
90
+ stylePreprocessorOptions?: {
91
+ /**
92
+ * Paths to include. Paths will be resolved to project root.
93
+ */
94
+ includePaths?: string[];
95
+ };
96
+ /**
97
+ * Global scripts to be included in the build.
98
+ */
99
+ scripts?: (string | {
100
+ input: string;
101
+ [name: string]: any;
102
+ })[];
103
+ /**
104
+ * Source file for environment config.
105
+ */
106
+ environmentSource?: string;
107
+ /**
108
+ * Name and corresponding file for environment config.
109
+ */
110
+ environments?: {
111
+ [name: string]: any;
112
+ };
113
+ appShell?: {
114
+ app: string;
115
+ route: string;
116
+ };
117
+ }
118
+ export declare function getWorkspacePath(host: Tree): string | undefined;
119
+ export declare function getWorkspace(host: Tree): any;
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getWorkspace = exports.getWorkspacePath = void 0;
4
+ const schematics_1 = require("@angular-devkit/schematics");
5
+ function getWorkspacePath(host) {
6
+ const possibleFiles = ['/angular.json', '/.angular.json', '/workspace.json'];
7
+ const path = possibleFiles.find(path => host.exists(path));
8
+ return path;
9
+ }
10
+ exports.getWorkspacePath = getWorkspacePath;
11
+ function getWorkspace(host) {
12
+ const path = getWorkspacePath(host);
13
+ const configBuffer = path ? host.read(path) : null;
14
+ if (configBuffer === null) {
15
+ throw new schematics_1.SchematicsException(`Could not find (${path})`);
16
+ }
17
+ const config = configBuffer.toString();
18
+ return JSON.parse(config);
19
+ }
20
+ exports.getWorkspace = getWorkspace;
21
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/utils/config.ts"],"names":[],"mappings":";;;AAAA,2DAAuE;AAkIvE,SAAgB,gBAAgB,CAAC,IAAU;IACzC,MAAM,aAAa,GAAG,CAAC,eAAe,EAAE,gBAAgB,EAAE,iBAAiB,CAAC,CAAC;IAC7E,MAAM,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAE3D,OAAO,IAAI,CAAC;AACd,CAAC;AALD,4CAKC;AAED,SAAgB,YAAY,CAAC,IAAU;IACrC,MAAM,IAAI,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACpC,MAAM,YAAY,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IACnD,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QAC1B,MAAM,IAAI,gCAAmB,CAAC,mBAAmB,IAAI,GAAG,CAAC,CAAC;IAC5D,CAAC;IACD,MAAM,MAAM,GAAG,YAAY,CAAC,QAAQ,EAAE,CAAC;IAEvC,OAAO,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAC5B,CAAC;AATD,oCASC"}
@@ -0,0 +1,4 @@
1
+ import { Rule, Source } from '@angular-devkit/schematics';
2
+ export declare function generateFiles(srcFolder: Source, target: string, substitutions: {
3
+ [k: string]: any;
4
+ }, generateSpecs?: boolean): Rule;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.generateFiles = void 0;
4
+ const core_1 = require("@angular-devkit/core");
5
+ const schematics_1 = require("@angular-devkit/schematics");
6
+ function generateFiles(srcFolder, target, substitutions, generateSpecs) {
7
+ return (0, schematics_1.mergeWith)((0, schematics_1.apply)(srcFolder, [
8
+ generateSpecs ? (0, schematics_1.noop)() : (0, schematics_1.filter)(path => !path.includes('.spec')),
9
+ (0, schematics_1.template)(Object.assign(Object.assign({ template: '' }, core_1.strings), substitutions)),
10
+ (0, schematics_1.move)(target)
11
+ ]));
12
+ }
13
+ exports.generateFiles = generateFiles;
14
+ //# sourceMappingURL=generate-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-utils.js","sourceRoot":"","sources":["../../../../../packages/store/schematics/src/utils/generate-utils.ts"],"names":[],"mappings":";;;AAAA,+CAA+C;AAC/C,2DASoC;AAEpC,SAAgB,aAAa,CAC3B,SAAiB,EACjB,MAAc,EACd,aAEC,EACD,aAAuB;IAEvB,OAAO,IAAA,sBAAS,EACd,IAAA,kBAAK,EAAC,SAAS,EAAE;QACf,aAAa,CAAC,CAAC,CAAC,IAAA,iBAAI,GAAE,CAAC,CAAC,CAAC,IAAA,mBAAM,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAChE,IAAA,qBAAQ,gCACN,QAAQ,EAAE,EAAE,IACT,cAAO,GACP,aAAa,EAChB;QACF,IAAA,iBAAI,EAAC,MAAM,CAAC;KACb,CAAC,CACH,CAAC;AACJ,CAAC;AAnBD,sCAmBC"}
@@ -0,0 +1,7 @@
1
+ import { Tree } from '@angular-devkit/schematics';
2
+ export interface PackageToJsonInterface {
3
+ host: Tree;
4
+ type: string;
5
+ pkg: string;
6
+ version: string;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=package.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"package.interface.js","sourceRoot":"","sources":["../../../../../../packages/store/schematics/src/utils/interfaces/package.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ The ng-utils folder represents a set of files copied from the @schematics/angular package's latest version. These utilities can be removed once @ngxs supports @angular >=16 as the minimum required version.
@@ -0,0 +1,99 @@
1
+ import * as ts from '@schematics/angular/third_party/github.com/Microsoft/TypeScript/lib/typescript';
2
+ import { Change } from '@schematics/angular/utility/change';
3
+ /**
4
+ * Add Import `import { symbolName } from fileName` if the import doesn't exit
5
+ * already. Assumes fileToEdit can be resolved and accessed.
6
+ * @param fileToEdit File we want to add import to.
7
+ * @param symbolName Item to import.
8
+ * @param fileName Path to the file.
9
+ * @param isDefault If true, import follows style for importing default exports.
10
+ * @param alias Alias that the symbol should be inserted under.
11
+ * @return Change
12
+ */
13
+ export declare function insertImport(source: ts.SourceFile, fileToEdit: string, symbolName: string, fileName: string, isDefault?: boolean, alias?: string): Change;
14
+ /**
15
+ * Find all nodes from the AST in the subtree of node of SyntaxKind kind.
16
+ * @param node
17
+ * @param kind
18
+ * @param max The maximum number of items to return.
19
+ * @param recursive Continue looking for nodes of kind recursive until end
20
+ * the last child even when node of kind has been found.
21
+ * @return all nodes of kind, or [] if none is found
22
+ */
23
+ export declare function findNodes(node: ts.Node, kind: ts.SyntaxKind, max?: number, recursive?: boolean): ts.Node[];
24
+ /**
25
+ * Find all nodes from the AST in the subtree that satisfy a type guard.
26
+ * @param node
27
+ * @param guard
28
+ * @param max The maximum number of items to return.
29
+ * @param recursive Continue looking for nodes of kind recursive until end
30
+ * the last child even when node of kind has been found.
31
+ * @return all nodes that satisfy the type guard, or [] if none is found
32
+ */
33
+ export declare function findNodes<T extends ts.Node>(node: ts.Node, guard: (node: ts.Node) => node is T, max?: number, recursive?: boolean): T[];
34
+ /**
35
+ * Get all the nodes from a source.
36
+ * @param sourceFile The source file object.
37
+ * @returns {Array<ts.Node>} An array of all the nodes in the source.
38
+ */
39
+ export declare function getSourceNodes(sourceFile: ts.SourceFile): ts.Node[];
40
+ export declare function findNode(node: ts.Node, kind: ts.SyntaxKind, text: string): ts.Node | null;
41
+ /**
42
+ * Insert `toInsert` after the last occurence of `ts.SyntaxKind[nodes[i].kind]`
43
+ * or after the last of occurence of `syntaxKind` if the last occurence is a sub child
44
+ * of ts.SyntaxKind[nodes[i].kind] and save the changes in file.
45
+ *
46
+ * @param nodes insert after the last occurence of nodes
47
+ * @param toInsert string to insert
48
+ * @param file file to insert changes into
49
+ * @param fallbackPos position to insert if toInsert happens to be the first occurence
50
+ * @param syntaxKind the ts.SyntaxKind of the subchildren to insert after
51
+ * @return Change instance
52
+ * @throw Error if toInsert is first occurence but fall back is not set
53
+ */
54
+ export declare function insertAfterLastOccurrence(nodes: ts.Node[] | ts.NodeArray<ts.Node>, toInsert: string, file: string, fallbackPos: number, syntaxKind?: ts.SyntaxKind): Change;
55
+ export declare function getDecoratorMetadata(source: ts.SourceFile, identifier: string, module: string): ts.Node[];
56
+ export declare function getMetadataField(node: ts.ObjectLiteralExpression, metadataField: string): ts.ObjectLiteralElement[];
57
+ export declare function addSymbolToNgModuleMetadata(source: ts.SourceFile, ngModulePath: string, metadataField: string, symbolName: string, importPath?: string | null): Change[];
58
+ /**
59
+ * Custom function to insert a declaration (component, pipe, directive)
60
+ * into NgModule declarations. It also imports the component.
61
+ */
62
+ export declare function addDeclarationToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
63
+ /**
64
+ * Custom function to insert an NgModule into NgModule imports. It also imports the module.
65
+ */
66
+ export declare function addImportToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
67
+ /**
68
+ * Custom function to insert a provider into NgModule. It also imports it.
69
+ */
70
+ export declare function addProviderToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
71
+ /**
72
+ * Custom function to insert an export into NgModule. It also imports it.
73
+ */
74
+ export declare function addExportToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
75
+ /**
76
+ * Custom function to insert an export into NgModule. It also imports it.
77
+ */
78
+ export declare function addBootstrapToModule(source: ts.SourceFile, modulePath: string, classifiedName: string, importPath: string): Change[];
79
+ /**
80
+ * Determine if an import already exists.
81
+ */
82
+ export declare function isImported(source: ts.SourceFile, classifiedName: string, importPath: string): boolean;
83
+ /**
84
+ * Returns the RouterModule declaration from NgModule metadata, if any.
85
+ */
86
+ export declare function getRouterModuleDeclaration(source: ts.SourceFile): ts.Expression | undefined;
87
+ /**
88
+ * Adds a new route declaration to a router module (i.e. has a RouterModule declaration)
89
+ */
90
+ export declare function addRouteDeclarationToModule(source: ts.SourceFile, fileToAdd: string, routeLiteral: string): Change;
91
+ /**
92
+ * Determines if a SourceFile has a top-level declaration whose name matches a specific symbol.
93
+ * Can be used to avoid conflicts when inserting new imports into a file.
94
+ * @param sourceFile File in which to search.
95
+ * @param symbolName Name of the symbol to search for.
96
+ * @param skipModule Path of the module that the symbol may have been imported from. Used to
97
+ * avoid false positives where the same symbol we're looking for may have been imported.
98
+ */
99
+ export declare function hasTopLevelIdentifier(sourceFile: ts.SourceFile, symbolName: string, skipModule?: string | null): boolean;