@nrwl/angular 13.1.3 → 13.2.0-beta.1

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 (411) hide show
  1. package/{esm2015/index.js → esm2020/index.mjs} +0 -0
  2. package/{esm2015/nrwl-angular.js → esm2020/nrwl-angular.mjs} +0 -0
  3. package/esm2020/src/runtime/nx/data-persistence.mjs +327 -0
  4. package/esm2020/src/runtime/nx/nx.module.mjs +21 -0
  5. package/esm2020/testing/index.mjs +19 -0
  6. package/{esm2015/testing/nrwl-angular-testing.js → esm2020/testing/nrwl-angular-testing.mjs} +0 -0
  7. package/{esm2015/testing/src/testing-utils.js → esm2020/testing/src/testing-utils.mjs} +0 -0
  8. package/fesm2015/{nrwl-angular-testing.js → nrwl-angular-testing.mjs} +19 -3
  9. package/fesm2015/nrwl-angular-testing.mjs.map +1 -0
  10. package/fesm2015/{nrwl-angular.js → nrwl-angular.mjs} +16 -13
  11. package/fesm2015/nrwl-angular.mjs.map +1 -0
  12. package/fesm2020/nrwl-angular-testing.mjs +56 -0
  13. package/fesm2020/nrwl-angular-testing.mjs.map +1 -0
  14. package/fesm2020/nrwl-angular.mjs +351 -0
  15. package/fesm2020/nrwl-angular.mjs.map +1 -0
  16. package/generators.js +16 -16
  17. package/generators.js.map +1 -1
  18. package/migrations.json +161 -0
  19. package/ng-package.json +3 -9
  20. package/nrwl-angular.d.ts +1 -0
  21. package/package.json +40 -15
  22. package/src/builders/webpack-browser/schema.json +4 -9
  23. package/src/builders/webpack-browser/webpack-browser.impl.d.ts +1 -1
  24. package/src/builders/webpack-browser/webpack-browser.impl.js +12 -12
  25. package/src/builders/webpack-browser/webpack-browser.impl.js.map +1 -1
  26. package/src/builders/webpack-server/lib/index.js +1 -1
  27. package/src/builders/webpack-server/lib/index.js.map +1 -1
  28. package/src/builders/webpack-server/schema.d.ts +0 -12
  29. package/src/builders/webpack-server/schema.json +0 -104
  30. package/src/builders/webpack-server/webpack-server.impl.d.ts +1 -1
  31. package/src/builders/webpack-server/webpack-server.impl.js +10 -10
  32. package/src/builders/webpack-server/webpack-server.impl.js.map +1 -1
  33. package/src/executors/delegate-build/compat.js +1 -1
  34. package/src/executors/delegate-build/compat.js.map +1 -1
  35. package/src/executors/delegate-build/delegate-build.impl.js +8 -8
  36. package/src/executors/delegate-build/delegate-build.impl.js.map +1 -1
  37. package/src/executors/ng-packagr-lite/compat.js +1 -1
  38. package/src/executors/ng-packagr-lite/compat.js.map +1 -1
  39. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/compile-ngc.d.ts +4 -2
  40. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/compile-ngc.js +22 -15
  41. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/compile-ngc.js.map +1 -1
  42. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/compile-source-files.d.ts +12 -0
  43. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/compile-source-files.js +147 -0
  44. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/compile-source-files.js.map +1 -0
  45. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/entry-point.d.ts +3 -3
  46. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/entry-point.di.js +2 -2
  47. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/entry-point.di.js.map +1 -1
  48. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/entry-point.js +7 -7
  49. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/entry-point.js.map +1 -1
  50. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/package.di.d.ts +1 -1
  51. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/package.di.js +5 -9
  52. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/package.di.js.map +1 -1
  53. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/write-package.d.ts +2 -2
  54. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/write-package.di.d.ts +2 -1
  55. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/write-package.di.js +4 -2
  56. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/write-package.di.js.map +1 -1
  57. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/write-package.js +31 -29
  58. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/write-package.js.map +1 -1
  59. package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js +6 -6
  60. package/src/executors/ng-packagr-lite/ng-packagr-lite.impl.js.map +1 -1
  61. package/src/executors/package/compat.js +1 -1
  62. package/src/executors/package/compat.js.map +1 -1
  63. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.di.js +1 -1
  64. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.di.js.map +1 -1
  65. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js +19 -42
  66. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/compile-ngc.transform.js.map +1 -1
  67. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/entry-point.di.js +1 -1
  68. package/src/executors/package/ng-packagr-adjustments/ng-package/entry-point/entry-point.di.js.map +1 -1
  69. package/src/executors/package/ng-packagr-adjustments/ng-package/package.di.js +1 -2
  70. package/src/executors/package/ng-packagr-adjustments/ng-package/package.di.js.map +1 -1
  71. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.d.ts +19 -15
  72. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js +208 -40
  73. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor.js.map +1 -1
  74. package/src/executors/package/ng-packagr-adjustments/utilities/tailwindcss.js +3 -3
  75. package/src/executors/package/ng-packagr-adjustments/utilities/tailwindcss.js.map +1 -1
  76. package/src/executors/package/package.impl.js +15 -32
  77. package/src/executors/package/package.impl.js.map +1 -1
  78. package/src/generators/add-linting/add-linting.js +6 -6
  79. package/src/generators/add-linting/add-linting.js.map +1 -1
  80. package/src/generators/add-linting/compat.js +1 -1
  81. package/src/generators/add-linting/compat.js.map +1 -1
  82. package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js +1 -1
  83. package/src/generators/add-linting/lib/add-angular-eslint-dependencies.js.map +1 -1
  84. package/src/generators/add-linting/lib/add-project-lint-target.js +2 -2
  85. package/src/generators/add-linting/lib/add-project-lint-target.js.map +1 -1
  86. package/src/generators/add-linting/lib/create-eslint-configuration.js +2 -2
  87. package/src/generators/add-linting/lib/create-eslint-configuration.js.map +1 -1
  88. package/src/generators/application/application.compat.js +1 -1
  89. package/src/generators/application/application.compat.js.map +1 -1
  90. package/src/generators/application/application.js +23 -23
  91. package/src/generators/application/application.js.map +1 -1
  92. package/src/generators/application/lib/add-e2e.js +8 -8
  93. package/src/generators/application/lib/add-e2e.js.map +1 -1
  94. package/src/generators/application/lib/add-linting.js +2 -2
  95. package/src/generators/application/lib/add-linting.js.map +1 -1
  96. package/src/generators/application/lib/add-mfe.js +2 -2
  97. package/src/generators/application/lib/add-mfe.js.map +1 -1
  98. package/src/generators/application/lib/add-protractor.js +5 -5
  99. package/src/generators/application/lib/add-protractor.js.map +1 -1
  100. package/src/generators/application/lib/add-proxy-config.js +3 -3
  101. package/src/generators/application/lib/add-proxy-config.js.map +1 -1
  102. package/src/generators/application/lib/add-unit-test-runner.js +3 -3
  103. package/src/generators/application/lib/add-unit-test-runner.js.map +1 -1
  104. package/src/generators/application/lib/create-files.js +1 -1
  105. package/src/generators/application/lib/create-files.js.map +1 -1
  106. package/src/generators/application/lib/enable-strict-type-checking.js +1 -1
  107. package/src/generators/application/lib/enable-strict-type-checking.js.map +1 -1
  108. package/src/generators/application/lib/index.js +19 -19
  109. package/src/generators/application/lib/index.js.map +1 -1
  110. package/src/generators/application/lib/normalize-options.js +6 -6
  111. package/src/generators/application/lib/normalize-options.js.map +1 -1
  112. package/src/generators/application/lib/remove-scaffolded-e2e.js +2 -2
  113. package/src/generators/application/lib/remove-scaffolded-e2e.js.map +1 -1
  114. package/src/generators/application/lib/root-router-config.js +2 -2
  115. package/src/generators/application/lib/root-router-config.js.map +1 -1
  116. package/src/generators/application/lib/set-app-strict-default.js +2 -2
  117. package/src/generators/application/lib/set-app-strict-default.js.map +1 -1
  118. package/src/generators/application/lib/update-component-spec.js +2 -2
  119. package/src/generators/application/lib/update-component-spec.js.map +1 -1
  120. package/src/generators/application/lib/update-component-styles.js +2 -2
  121. package/src/generators/application/lib/update-component-styles.js.map +1 -1
  122. package/src/generators/application/lib/update-component-template.js +2 -2
  123. package/src/generators/application/lib/update-component-template.js.map +1 -1
  124. package/src/generators/application/lib/update-config-files.js +13 -11
  125. package/src/generators/application/lib/update-config-files.js.map +1 -1
  126. package/src/generators/application/lib/update-e2e-project.js +7 -7
  127. package/src/generators/application/lib/update-e2e-project.js.map +1 -1
  128. package/src/generators/application/lib/update-editor-tsconfig.js +1 -1
  129. package/src/generators/application/lib/update-editor-tsconfig.js.map +1 -1
  130. package/src/generators/component-cypress-spec/compat.js +1 -1
  131. package/src/generators/component-cypress-spec/compat.js.map +1 -1
  132. package/src/generators/component-cypress-spec/component-cypress-spec.js +9 -9
  133. package/src/generators/component-cypress-spec/component-cypress-spec.js.map +1 -1
  134. package/src/generators/component-cypress-spec/lib/get-component-selector.js +3 -3
  135. package/src/generators/component-cypress-spec/lib/get-component-selector.js.map +1 -1
  136. package/src/generators/component-story/compat.js +1 -1
  137. package/src/generators/component-story/compat.js.map +1 -1
  138. package/src/generators/component-story/component-story.js +5 -5
  139. package/src/generators/component-story/component-story.js.map +1 -1
  140. package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js +8 -8
  141. package/src/generators/convert-tslint-to-eslint/convert-tslint-to-eslint.js.map +1 -1
  142. package/src/generators/downgrade-module/compat.js +1 -1
  143. package/src/generators/downgrade-module/compat.js.map +1 -1
  144. package/src/generators/downgrade-module/downgrade-module.js +7 -7
  145. package/src/generators/downgrade-module/downgrade-module.js.map +1 -1
  146. package/src/generators/downgrade-module/lib/add-entry-components-to-module.js +2 -2
  147. package/src/generators/downgrade-module/lib/add-entry-components-to-module.js.map +1 -1
  148. package/src/generators/downgrade-module/lib/index.js +4 -4
  149. package/src/generators/downgrade-module/lib/index.js.map +1 -1
  150. package/src/generators/downgrade-module/lib/update-main.js +2 -2
  151. package/src/generators/downgrade-module/lib/update-main.js.map +1 -1
  152. package/src/generators/downgrade-module/lib/update-module-bootstrap.js +3 -3
  153. package/src/generators/downgrade-module/lib/update-module-bootstrap.js.map +1 -1
  154. package/src/generators/init/init.compat.js +1 -1
  155. package/src/generators/init/init.compat.js.map +1 -1
  156. package/src/generators/init/init.d.ts +1 -1
  157. package/src/generators/init/init.js +25 -13
  158. package/src/generators/init/init.js.map +1 -1
  159. package/src/generators/karma/compat.js +1 -1
  160. package/src/generators/karma/compat.js.map +1 -1
  161. package/src/generators/karma/karma.js +3 -3
  162. package/src/generators/karma/karma.js.map +1 -1
  163. package/src/generators/karma-project/compat.js +1 -1
  164. package/src/generators/karma-project/compat.js.map +1 -1
  165. package/src/generators/karma-project/karma-project.js +6 -6
  166. package/src/generators/karma-project/karma-project.js.map +1 -1
  167. package/src/generators/karma-project/lib/check-test-target.js +1 -1
  168. package/src/generators/karma-project/lib/check-test-target.js.map +1 -1
  169. package/src/generators/karma-project/lib/generate-karma-project-files.js +3 -3
  170. package/src/generators/karma-project/lib/generate-karma-project-files.js.map +1 -1
  171. package/src/generators/karma-project/lib/update-tsconfig.js +3 -3
  172. package/src/generators/karma-project/lib/update-tsconfig.js.map +1 -1
  173. package/src/generators/karma-project/lib/update-workspace-config.js +7 -7
  174. package/src/generators/karma-project/lib/update-workspace-config.js.map +1 -1
  175. package/src/generators/library/lib/add-children.js +4 -4
  176. package/src/generators/library/lib/add-children.js.map +1 -1
  177. package/src/generators/library/lib/add-lazy-loaded-router-configuration.js +2 -2
  178. package/src/generators/library/lib/add-lazy-loaded-router-configuration.js.map +1 -1
  179. package/src/generators/library/lib/add-load-children.js +3 -3
  180. package/src/generators/library/lib/add-load-children.js.map +1 -1
  181. package/src/generators/library/lib/add-module.js +4 -4
  182. package/src/generators/library/lib/add-module.js.map +1 -1
  183. package/src/generators/library/lib/add-router-configuration.js +4 -4
  184. package/src/generators/library/lib/add-router-configuration.js.map +1 -1
  185. package/src/generators/library/lib/enable-strict-type-checking.js +3 -3
  186. package/src/generators/library/lib/enable-strict-type-checking.js.map +1 -1
  187. package/src/generators/library/lib/normalize-options.js +6 -6
  188. package/src/generators/library/lib/normalize-options.js.map +1 -1
  189. package/src/generators/library/lib/update-lib-package-npm-scope.js +1 -1
  190. package/src/generators/library/lib/update-lib-package-npm-scope.js.map +1 -1
  191. package/src/generators/library/lib/update-ng-package.js +3 -3
  192. package/src/generators/library/lib/update-ng-package.js.map +1 -1
  193. package/src/generators/library/lib/update-project.js +10 -10
  194. package/src/generators/library/lib/update-project.js.map +1 -1
  195. package/src/generators/library/lib/update-tsconfig.js +11 -8
  196. package/src/generators/library/lib/update-tsconfig.js.map +1 -1
  197. package/src/generators/library/library.compat.js +1 -1
  198. package/src/generators/library/library.compat.js.map +1 -1
  199. package/src/generators/library/library.js +20 -23
  200. package/src/generators/library/library.js.map +1 -1
  201. package/src/generators/library/schema.d.ts +0 -2
  202. package/src/generators/library/schema.json +0 -5
  203. package/src/generators/library-secondary-entry-point/compat.js +1 -1
  204. package/src/generators/library-secondary-entry-point/compat.js.map +1 -1
  205. package/src/generators/library-secondary-entry-point/lib/add-files.js +3 -3
  206. package/src/generators/library-secondary-entry-point/lib/add-files.js.map +1 -1
  207. package/src/generators/library-secondary-entry-point/lib/add-path-mapping.js +1 -1
  208. package/src/generators/library-secondary-entry-point/lib/add-path-mapping.js.map +1 -1
  209. package/src/generators/library-secondary-entry-point/lib/index.js +4 -4
  210. package/src/generators/library-secondary-entry-point/lib/index.js.map +1 -1
  211. package/src/generators/library-secondary-entry-point/lib/normalize-options.js +4 -4
  212. package/src/generators/library-secondary-entry-point/lib/normalize-options.js.map +1 -1
  213. package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.js +1 -1
  214. package/src/generators/library-secondary-entry-point/lib/update-linting-file-patterns.js.map +1 -1
  215. package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js +6 -6
  216. package/src/generators/library-secondary-entry-point/library-secondary-entry-point.js.map +1 -1
  217. package/src/generators/move/lib/update-module-name.js +7 -7
  218. package/src/generators/move/lib/update-module-name.js.map +1 -1
  219. package/src/generators/move/lib/update-ng-package.js +4 -4
  220. package/src/generators/move/lib/update-ng-package.js.map +1 -1
  221. package/src/generators/move/move.js +6 -6
  222. package/src/generators/move/move.js.map +1 -1
  223. package/src/generators/ngrx/compat.js +1 -1
  224. package/src/generators/ngrx/compat.js.map +1 -1
  225. package/src/generators/ngrx/files/classes-syntax/__directory__/__fileName__.effects.spec.ts__tmpl__ +1 -1
  226. package/src/generators/ngrx/files/creator-syntax/__directory__/__fileName__.effects.spec.ts__tmpl__ +1 -1
  227. package/src/generators/ngrx/lib/add-exports-barrel.js +9 -9
  228. package/src/generators/ngrx/lib/add-exports-barrel.js.map +1 -1
  229. package/src/generators/ngrx/lib/add-imports-to-module.js +21 -21
  230. package/src/generators/ngrx/lib/add-imports-to-module.js.map +1 -1
  231. package/src/generators/ngrx/lib/add-ngrx-to-package-json.js +12 -1
  232. package/src/generators/ngrx/lib/add-ngrx-to-package-json.js.map +1 -1
  233. package/src/generators/ngrx/lib/generate-files.js +5 -5
  234. package/src/generators/ngrx/lib/generate-files.js.map +1 -1
  235. package/src/generators/ngrx/lib/normalize-options.js +1 -1
  236. package/src/generators/ngrx/lib/normalize-options.js.map +1 -1
  237. package/src/generators/ngrx/ngrx.js +7 -7
  238. package/src/generators/ngrx/ngrx.js.map +1 -1
  239. package/src/generators/setup-mfe/lib/add-entry-module.js +2 -2
  240. package/src/generators/setup-mfe/lib/add-entry-module.js.map +1 -1
  241. package/src/generators/setup-mfe/lib/add-implicit-deps.js +2 -2
  242. package/src/generators/setup-mfe/lib/add-implicit-deps.js.map +1 -1
  243. package/src/generators/setup-mfe/lib/add-remote-to-host.js +5 -5
  244. package/src/generators/setup-mfe/lib/add-remote-to-host.js.map +1 -1
  245. package/src/generators/setup-mfe/lib/change-build-target.js +2 -2
  246. package/src/generators/setup-mfe/lib/change-build-target.js.map +1 -1
  247. package/src/generators/setup-mfe/lib/fix-bootstrap.js +2 -2
  248. package/src/generators/setup-mfe/lib/fix-bootstrap.js.map +1 -1
  249. package/src/generators/setup-mfe/lib/generate-config.js +2 -2
  250. package/src/generators/setup-mfe/lib/generate-config.js.map +1 -1
  251. package/src/generators/setup-mfe/lib/get-remotes-with-ports.js +1 -1
  252. package/src/generators/setup-mfe/lib/get-remotes-with-ports.js.map +1 -1
  253. package/src/generators/setup-mfe/lib/index.js +8 -8
  254. package/src/generators/setup-mfe/lib/index.js.map +1 -1
  255. package/src/generators/setup-mfe/lib/setup-serve-target.js +4 -4
  256. package/src/generators/setup-mfe/lib/setup-serve-target.js.map +1 -1
  257. package/src/generators/setup-mfe/setup-mfe.compat.js +1 -1
  258. package/src/generators/setup-mfe/setup-mfe.compat.js.map +1 -1
  259. package/src/generators/setup-mfe/setup-mfe.js +12 -12
  260. package/src/generators/setup-mfe/setup-mfe.js.map +1 -1
  261. package/src/generators/stories/compat.js +1 -1
  262. package/src/generators/stories/compat.js.map +1 -1
  263. package/src/generators/stories/lib/component-info.js +7 -7
  264. package/src/generators/stories/lib/component-info.js.map +1 -1
  265. package/src/generators/stories/lib/get-e2e-project.js +1 -1
  266. package/src/generators/stories/lib/get-e2e-project.js.map +1 -1
  267. package/src/generators/stories/lib/module-info.js +6 -6
  268. package/src/generators/stories/lib/module-info.js.map +1 -1
  269. package/src/generators/stories/lib/tree-utilities.js +2 -2
  270. package/src/generators/stories/lib/tree-utilities.js.map +1 -1
  271. package/src/generators/stories/stories.js +6 -6
  272. package/src/generators/stories/stories.js.map +1 -1
  273. package/src/generators/storybook-configuration/compat.js +1 -1
  274. package/src/generators/storybook-configuration/compat.js.map +1 -1
  275. package/src/generators/storybook-configuration/lib/assert-compatible-storybook-version.js +1 -1
  276. package/src/generators/storybook-configuration/lib/assert-compatible-storybook-version.js.map +1 -1
  277. package/src/generators/storybook-configuration/lib/generate-stories.js +3 -3
  278. package/src/generators/storybook-configuration/lib/generate-stories.js.map +1 -1
  279. package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +2 -2
  280. package/src/generators/storybook-configuration/lib/generate-storybook-configuration.js.map +1 -1
  281. package/src/generators/storybook-configuration/storybook-configuration.js +5 -5
  282. package/src/generators/storybook-configuration/storybook-configuration.js.map +1 -1
  283. package/src/generators/storybook-migrate-defaults-5-to-6/compat.js +1 -1
  284. package/src/generators/storybook-migrate-defaults-5-to-6/compat.js.map +1 -1
  285. package/src/generators/storybook-migrate-defaults-5-to-6/storybook-migrate-defaults-5-to-6.js +1 -1
  286. package/src/generators/storybook-migrate-defaults-5-to-6/storybook-migrate-defaults-5-to-6.js.map +1 -1
  287. package/src/generators/storybook-migrate-stories-to-6-2/compat.js +1 -1
  288. package/src/generators/storybook-migrate-stories-to-6-2/compat.js.map +1 -1
  289. package/src/generators/storybook-migrate-stories-to-6-2/migrate-stories-to-6-2.js +2 -2
  290. package/src/generators/storybook-migrate-stories-to-6-2/migrate-stories-to-6-2.js.map +1 -1
  291. package/src/generators/upgrade-module/compat.js +1 -1
  292. package/src/generators/upgrade-module/compat.js.map +1 -1
  293. package/src/generators/upgrade-module/lib/add-imports-to-module.js +7 -7
  294. package/src/generators/upgrade-module/lib/add-imports-to-module.js.map +1 -1
  295. package/src/generators/upgrade-module/lib/create-files.js +3 -3
  296. package/src/generators/upgrade-module/lib/create-files.js.map +1 -1
  297. package/src/generators/upgrade-module/lib/index.js +4 -4
  298. package/src/generators/upgrade-module/lib/index.js.map +1 -1
  299. package/src/generators/upgrade-module/lib/update-module-bootstrap.js +5 -5
  300. package/src/generators/upgrade-module/lib/update-module-bootstrap.js.map +1 -1
  301. package/src/generators/upgrade-module/upgrade-module.js +7 -7
  302. package/src/generators/upgrade-module/upgrade-module.js.map +1 -1
  303. package/src/generators/utils/index.d.ts +1 -0
  304. package/src/generators/utils/index.js +5 -0
  305. package/src/generators/utils/index.js.map +1 -0
  306. package/src/generators/utils/insert-ngmodule-import.js +15 -15
  307. package/src/generators/utils/insert-ngmodule-import.js.map +1 -1
  308. package/src/generators/utils/storybook.js +4 -4
  309. package/src/generators/utils/storybook.js.map +1 -1
  310. package/src/generators/utils/testing.js +5 -6
  311. package/src/generators/utils/testing.js.map +1 -1
  312. package/src/generators/utils/upgrade.js +2 -2
  313. package/src/generators/utils/upgrade.js.map +1 -1
  314. package/src/generators/web-worker/compat.js +1 -1
  315. package/src/generators/web-worker/compat.js.map +1 -1
  316. package/src/generators/web-worker/lib/index.js +2 -2
  317. package/src/generators/web-worker/lib/index.js.map +1 -1
  318. package/src/generators/web-worker/lib/update-tsconfig.js +4 -4
  319. package/src/generators/web-worker/lib/update-tsconfig.js.map +1 -1
  320. package/src/generators/web-worker/web-worker.js +6 -6
  321. package/src/generators/web-worker/web-worker.js.map +1 -1
  322. package/src/migrations/update-10-0-0/update-10-0-0.js +5 -5
  323. package/src/migrations/update-10-0-0/update-10-0-0.js.map +1 -1
  324. package/src/migrations/update-10-2-0/update-10-2-0.js +4 -4
  325. package/src/migrations/update-10-2-0/update-10-2-0.js.map +1 -1
  326. package/src/migrations/update-10-3-0/update-10-3-0.js +15 -15
  327. package/src/migrations/update-10-3-0/update-10-3-0.js.map +1 -1
  328. package/src/migrations/update-10-4-0/update-10-4-0.js +9 -9
  329. package/src/migrations/update-10-4-0/update-10-4-0.js.map +1 -1
  330. package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js +11 -11
  331. package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js.map +1 -1
  332. package/src/migrations/update-11-0-0/update-builders-config.js +5 -5
  333. package/src/migrations/update-11-0-0/update-builders-config.js.map +1 -1
  334. package/src/migrations/update-12-0-0/update-ngcc-postinstall.js +2 -2
  335. package/src/migrations/update-12-0-0/update-ngcc-postinstall.js.map +1 -1
  336. package/src/migrations/update-12-3-0/convert-webpack-browser-build-target-to-delegate-build.js +10 -10
  337. package/src/migrations/update-12-3-0/convert-webpack-browser-build-target-to-delegate-build.js.map +1 -1
  338. package/src/migrations/update-12-3-0/update-angular-eslint-rules.js +5 -5
  339. package/src/migrations/update-12-3-0/update-angular-eslint-rules.js.map +1 -1
  340. package/src/migrations/update-12-3-0/update-storybook.js +8 -8
  341. package/src/migrations/update-12-3-0/update-storybook.js.map +1 -1
  342. package/src/migrations/update-12-3-0/update-webpack-browser-config.js +4 -4
  343. package/src/migrations/update-12-3-0/update-webpack-browser-config.js.map +1 -1
  344. package/src/migrations/update-12-9-0/update-invalid-import-paths.js +12 -12
  345. package/src/migrations/update-12-9-0/update-invalid-import-paths.js.map +1 -1
  346. package/src/migrations/update-13-0-0/add-postcss-packages.js +4 -4
  347. package/src/migrations/update-13-0-0/add-postcss-packages.js.map +1 -1
  348. package/src/migrations/update-13-2-0/update-angular-config.d.ts +2 -0
  349. package/src/migrations/update-13-2-0/update-angular-config.js +21 -0
  350. package/src/migrations/update-13-2-0/update-angular-config.js.map +1 -0
  351. package/src/migrations/update-13-2-0/update-angular-jest-config.d.ts +3 -0
  352. package/src/migrations/update-13-2-0/update-angular-jest-config.js +59 -0
  353. package/src/migrations/update-13-2-0/update-angular-jest-config.js.map +1 -0
  354. package/src/migrations/update-13-2-0/update-libraries.d.ts +2 -0
  355. package/src/migrations/update-13-2-0/update-libraries.js +59 -0
  356. package/src/migrations/update-13-2-0/update-libraries.js.map +1 -0
  357. package/src/migrations/update-13-2-0/update-testing-imports.d.ts +2 -0
  358. package/src/migrations/update-13-2-0/update-testing-imports.js +95 -0
  359. package/src/migrations/update-13-2-0/update-testing-imports.js.map +1 -0
  360. package/src/migrations/update-8-12-0/change-angular-lib-builder.js +3 -3
  361. package/src/migrations/update-8-12-0/change-angular-lib-builder.js.map +1 -1
  362. package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.js +11 -11
  363. package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.js.map +1 -1
  364. package/src/migrations/update-8-5-0/upgrade-cli-8-3.js +13 -13
  365. package/src/migrations/update-8-5-0/upgrade-cli-8-3.js.map +1 -1
  366. package/src/migrations/update-9-0-0/add-postinstall.js +3 -3
  367. package/src/migrations/update-9-0-0/add-postinstall.js.map +1 -1
  368. package/src/migrations/update-9-0-0/update-9-0-0.js +5 -5
  369. package/src/migrations/update-9-0-0/update-9-0-0.js.map +1 -1
  370. package/src/runtime/nx/data-persistence.js +20 -20
  371. package/src/runtime/nx/data-persistence.js.map +1 -1
  372. package/src/runtime/nx/nx.module.js +2 -2
  373. package/src/runtime/nx/nx.module.js.map +1 -1
  374. package/src/utils/nx-devkit/ast-utils.js +13 -13
  375. package/src/utils/nx-devkit/ast-utils.js.map +1 -1
  376. package/src/utils/nx-devkit/testing.js +2 -2
  377. package/src/utils/nx-devkit/testing.js.map +1 -1
  378. package/src/utils/testing.js +6 -6
  379. package/src/utils/testing.js.map +1 -1
  380. package/src/utils/versions.d.ts +6 -7
  381. package/src/utils/versions.js +8 -9
  382. package/src/utils/versions.js.map +1 -1
  383. package/tailwind.js +1 -1
  384. package/tailwind.js.map +1 -1
  385. package/testing/index.d.ts +17 -1
  386. package/testing/index.js +17 -5
  387. package/testing/index.js.map +1 -1
  388. package/testing/nrwl-angular-testing.d.ts +1 -0
  389. package/testing/package.json +7 -6
  390. package/testing/src/testing-utils.js +2 -2
  391. package/testing/src/testing-utils.js.map +1 -1
  392. package/bundles/nrwl-angular-testing.umd.js +0 -72
  393. package/bundles/nrwl-angular-testing.umd.js.map +0 -1
  394. package/bundles/nrwl-angular.umd.js +0 -690
  395. package/bundles/nrwl-angular.umd.js.map +0 -1
  396. package/esm2015/src/runtime/nx/data-persistence.js +0 -327
  397. package/esm2015/src/runtime/nx/nx.module.js +0 -16
  398. package/esm2015/testing/index.js +0 -3
  399. package/fesm2015/nrwl-angular-testing.js.map +0 -1
  400. package/fesm2015/nrwl-angular.js.map +0 -1
  401. package/nrwl-angular.metadata.json +0 -1
  402. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/init-tsconfig.d.ts +0 -10
  403. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/init-tsconfig.js +0 -28
  404. package/src/executors/ng-packagr-lite/ng-packagr-adjustments/init-tsconfig.js.map +0 -1
  405. package/src/executors/package/ng-packagr-adjustments/ivy/styles/stylesheet-processor.d.ts +0 -30
  406. package/src/executors/package/ng-packagr-adjustments/ivy/styles/stylesheet-processor.js +0 -189
  407. package/src/executors/package/ng-packagr-adjustments/ivy/styles/stylesheet-processor.js.map +0 -1
  408. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor-worker.d.ts +0 -9
  409. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor-worker.js +0 -178
  410. package/src/executors/package/ng-packagr-adjustments/styles/stylesheet-processor-worker.js.map +0 -1
  411. package/testing/nrwl-angular-testing.metadata.json +0 -1
@@ -1,690 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@ngrx/effects'), require('@ngrx/router-store'), require('@ngrx/store'), require('rxjs'), require('rxjs/operators')) :
3
- typeof define === 'function' && define.amd ? define('@nrwl/angular', ['exports', '@angular/core', '@ngrx/effects', '@ngrx/router-store', '@ngrx/store', 'rxjs', 'rxjs/operators'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.nrwl = global.nrwl || {}, global.nrwl.angular = {}), global.ng.core, global.ngrx.effects, global.ngrx.routerStore, global.ngrx.store, global.rxjs, global.rxjs.operators));
5
- }(this, (function (exports, core, effects, routerStore, store, rxjs, operators) { 'use strict';
6
-
7
- /*! *****************************************************************************
8
- Copyright (c) Microsoft Corporation.
9
-
10
- Permission to use, copy, modify, and/or distribute this software for any
11
- purpose with or without fee is hereby granted.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
14
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
15
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
16
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
17
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
18
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
- PERFORMANCE OF THIS SOFTWARE.
20
- ***************************************************************************** */
21
- /* global Reflect, Promise */
22
- var extendStatics = function (d, b) {
23
- extendStatics = Object.setPrototypeOf ||
24
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
25
- function (d, b) { for (var p in b)
26
- if (Object.prototype.hasOwnProperty.call(b, p))
27
- d[p] = b[p]; };
28
- return extendStatics(d, b);
29
- };
30
- function __extends(d, b) {
31
- if (typeof b !== "function" && b !== null)
32
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
33
- extendStatics(d, b);
34
- function __() { this.constructor = d; }
35
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
36
- }
37
- var __assign = function () {
38
- __assign = Object.assign || function __assign(t) {
39
- for (var s, i = 1, n = arguments.length; i < n; i++) {
40
- s = arguments[i];
41
- for (var p in s)
42
- if (Object.prototype.hasOwnProperty.call(s, p))
43
- t[p] = s[p];
44
- }
45
- return t;
46
- };
47
- return __assign.apply(this, arguments);
48
- };
49
- function __rest(s, e) {
50
- var t = {};
51
- for (var p in s)
52
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
53
- t[p] = s[p];
54
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
55
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
56
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
57
- t[p[i]] = s[p[i]];
58
- }
59
- return t;
60
- }
61
- function __decorate(decorators, target, key, desc) {
62
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
63
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
64
- r = Reflect.decorate(decorators, target, key, desc);
65
- else
66
- for (var i = decorators.length - 1; i >= 0; i--)
67
- if (d = decorators[i])
68
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
69
- return c > 3 && r && Object.defineProperty(target, key, r), r;
70
- }
71
- function __param(paramIndex, decorator) {
72
- return function (target, key) { decorator(target, key, paramIndex); };
73
- }
74
- function __metadata(metadataKey, metadataValue) {
75
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
76
- return Reflect.metadata(metadataKey, metadataValue);
77
- }
78
- function __awaiter(thisArg, _arguments, P, generator) {
79
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
80
- return new (P || (P = Promise))(function (resolve, reject) {
81
- function fulfilled(value) { try {
82
- step(generator.next(value));
83
- }
84
- catch (e) {
85
- reject(e);
86
- } }
87
- function rejected(value) { try {
88
- step(generator["throw"](value));
89
- }
90
- catch (e) {
91
- reject(e);
92
- } }
93
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
94
- step((generator = generator.apply(thisArg, _arguments || [])).next());
95
- });
96
- }
97
- function __generator(thisArg, body) {
98
- var _ = { label: 0, sent: function () { if (t[0] & 1)
99
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
100
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
101
- function verb(n) { return function (v) { return step([n, v]); }; }
102
- function step(op) {
103
- if (f)
104
- throw new TypeError("Generator is already executing.");
105
- while (_)
106
- try {
107
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
108
- return t;
109
- if (y = 0, t)
110
- op = [op[0] & 2, t.value];
111
- switch (op[0]) {
112
- case 0:
113
- case 1:
114
- t = op;
115
- break;
116
- case 4:
117
- _.label++;
118
- return { value: op[1], done: false };
119
- case 5:
120
- _.label++;
121
- y = op[1];
122
- op = [0];
123
- continue;
124
- case 7:
125
- op = _.ops.pop();
126
- _.trys.pop();
127
- continue;
128
- default:
129
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
130
- _ = 0;
131
- continue;
132
- }
133
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
134
- _.label = op[1];
135
- break;
136
- }
137
- if (op[0] === 6 && _.label < t[1]) {
138
- _.label = t[1];
139
- t = op;
140
- break;
141
- }
142
- if (t && _.label < t[2]) {
143
- _.label = t[2];
144
- _.ops.push(op);
145
- break;
146
- }
147
- if (t[2])
148
- _.ops.pop();
149
- _.trys.pop();
150
- continue;
151
- }
152
- op = body.call(thisArg, _);
153
- }
154
- catch (e) {
155
- op = [6, e];
156
- y = 0;
157
- }
158
- finally {
159
- f = t = 0;
160
- }
161
- if (op[0] & 5)
162
- throw op[1];
163
- return { value: op[0] ? op[1] : void 0, done: true };
164
- }
165
- }
166
- var __createBinding = Object.create ? (function (o, m, k, k2) {
167
- if (k2 === undefined)
168
- k2 = k;
169
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
170
- }) : (function (o, m, k, k2) {
171
- if (k2 === undefined)
172
- k2 = k;
173
- o[k2] = m[k];
174
- });
175
- function __exportStar(m, o) {
176
- for (var p in m)
177
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
178
- __createBinding(o, m, p);
179
- }
180
- function __values(o) {
181
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
182
- if (m)
183
- return m.call(o);
184
- if (o && typeof o.length === "number")
185
- return {
186
- next: function () {
187
- if (o && i >= o.length)
188
- o = void 0;
189
- return { value: o && o[i++], done: !o };
190
- }
191
- };
192
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
193
- }
194
- function __read(o, n) {
195
- var m = typeof Symbol === "function" && o[Symbol.iterator];
196
- if (!m)
197
- return o;
198
- var i = m.call(o), r, ar = [], e;
199
- try {
200
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
201
- ar.push(r.value);
202
- }
203
- catch (error) {
204
- e = { error: error };
205
- }
206
- finally {
207
- try {
208
- if (r && !r.done && (m = i["return"]))
209
- m.call(i);
210
- }
211
- finally {
212
- if (e)
213
- throw e.error;
214
- }
215
- }
216
- return ar;
217
- }
218
- /** @deprecated */
219
- function __spread() {
220
- for (var ar = [], i = 0; i < arguments.length; i++)
221
- ar = ar.concat(__read(arguments[i]));
222
- return ar;
223
- }
224
- /** @deprecated */
225
- function __spreadArrays() {
226
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
227
- s += arguments[i].length;
228
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
229
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
230
- r[k] = a[j];
231
- return r;
232
- }
233
- function __spreadArray(to, from) {
234
- for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
235
- to[j] = from[i];
236
- return to;
237
- }
238
- function __await(v) {
239
- return this instanceof __await ? (this.v = v, this) : new __await(v);
240
- }
241
- function __asyncGenerator(thisArg, _arguments, generator) {
242
- if (!Symbol.asyncIterator)
243
- throw new TypeError("Symbol.asyncIterator is not defined.");
244
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
245
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
246
- function verb(n) { if (g[n])
247
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
248
- function resume(n, v) { try {
249
- step(g[n](v));
250
- }
251
- catch (e) {
252
- settle(q[0][3], e);
253
- } }
254
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
255
- function fulfill(value) { resume("next", value); }
256
- function reject(value) { resume("throw", value); }
257
- function settle(f, v) { if (f(v), q.shift(), q.length)
258
- resume(q[0][0], q[0][1]); }
259
- }
260
- function __asyncDelegator(o) {
261
- var i, p;
262
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
263
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
264
- }
265
- function __asyncValues(o) {
266
- if (!Symbol.asyncIterator)
267
- throw new TypeError("Symbol.asyncIterator is not defined.");
268
- var m = o[Symbol.asyncIterator], i;
269
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
270
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
271
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
272
- }
273
- function __makeTemplateObject(cooked, raw) {
274
- if (Object.defineProperty) {
275
- Object.defineProperty(cooked, "raw", { value: raw });
276
- }
277
- else {
278
- cooked.raw = raw;
279
- }
280
- return cooked;
281
- }
282
- ;
283
- var __setModuleDefault = Object.create ? (function (o, v) {
284
- Object.defineProperty(o, "default", { enumerable: true, value: v });
285
- }) : function (o, v) {
286
- o["default"] = v;
287
- };
288
- function __importStar(mod) {
289
- if (mod && mod.__esModule)
290
- return mod;
291
- var result = {};
292
- if (mod != null)
293
- for (var k in mod)
294
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
295
- __createBinding(result, mod, k);
296
- __setModuleDefault(result, mod);
297
- return result;
298
- }
299
- function __importDefault(mod) {
300
- return (mod && mod.__esModule) ? mod : { default: mod };
301
- }
302
- function __classPrivateFieldGet(receiver, privateMap) {
303
- if (!privateMap.has(receiver)) {
304
- throw new TypeError("attempted to get private field on non-instance");
305
- }
306
- return privateMap.get(receiver);
307
- }
308
- function __classPrivateFieldSet(receiver, privateMap, value) {
309
- if (!privateMap.has(receiver)) {
310
- throw new TypeError("attempted to set private field on non-instance");
311
- }
312
- privateMap.set(receiver, value);
313
- return value;
314
- }
315
-
316
- function pessimisticUpdate(opts) {
317
- return function (source) {
318
- return source.pipe(mapActionAndState(), operators.concatMap(runWithErrorHandling(opts.run, opts.onError)));
319
- };
320
- }
321
- function optimisticUpdate(opts) {
322
- return function (source) {
323
- return source.pipe(mapActionAndState(), operators.concatMap(runWithErrorHandling(opts.run, opts.undoAction)));
324
- };
325
- }
326
- function fetch(opts) {
327
- return function (source) {
328
- if (opts.id) {
329
- var groupedFetches = source.pipe(mapActionAndState(), operators.groupBy(function (_a) {
330
- var _b = __read(_a, 2), action = _b[0], store = _b[1];
331
- return opts.id(action, store);
332
- }));
333
- return groupedFetches.pipe(operators.mergeMap(function (pairs) { return pairs.pipe(operators.switchMap(runWithErrorHandling(opts.run, opts.onError))); }));
334
- }
335
- return source.pipe(mapActionAndState(), operators.concatMap(runWithErrorHandling(opts.run, opts.onError)));
336
- };
337
- }
338
- function navigation(component, opts) {
339
- return function (source) {
340
- var nav = source.pipe(mapActionAndState(), operators.filter(function (_a) {
341
- var _b = __read(_a, 2), action = _b[0], state = _b[1];
342
- return isStateSnapshot(action);
343
- }), operators.map(function (_a) {
344
- var _b = __read(_a, 2), action = _b[0], state = _b[1];
345
- if (!isStateSnapshot(action)) {
346
- // Because of the above filter we'll never get here,
347
- // but this properly type narrows `action`
348
- return;
349
- }
350
- return [
351
- findSnapshot(component, action.payload.routerState.root),
352
- state,
353
- ];
354
- }), operators.filter(function (_a) {
355
- var _b = __read(_a, 2), snapshot = _b[0], state = _b[1];
356
- return !!snapshot;
357
- }));
358
- return nav.pipe(operators.switchMap(runWithErrorHandling(opts.run, opts.onError)));
359
- };
360
- }
361
- function isStateSnapshot(action) {
362
- return action.type === routerStore.ROUTER_NAVIGATION;
363
- }
364
- function runWithErrorHandling(run, onError) {
365
- return function (_a) {
366
- var _b = __read(_a, 2), action = _b[0], state = _b[1];
367
- try {
368
- var r = wrapIntoObservable(run(action, state));
369
- return r.pipe(operators.catchError(function (e) { return wrapIntoObservable(onError(action, e)); }));
370
- }
371
- catch (e) {
372
- return wrapIntoObservable(onError(action, e));
373
- }
374
- };
375
- }
376
- /**
377
- * @whatItDoes maps Observable<Action | [Action, State]> to
378
- * Observable<[Action, State]>
379
- */
380
- function mapActionAndState() {
381
- return function (source) {
382
- return source.pipe(operators.map(function (value) {
383
- var _a = __read(normalizeActionAndState(value), 2), action = _a[0], store = _a[1];
384
- return [action, store];
385
- }));
386
- };
387
- }
388
- /**
389
- * @whatItDoes Normalizes either a bare action or an array of action and state
390
- * into an array of action and state (or undefined)
391
- */
392
- function normalizeActionAndState(args) {
393
- var _a;
394
- var action, state;
395
- if (args instanceof Array) {
396
- _a = __read(args, 2), action = _a[0], state = _a[1];
397
- }
398
- else {
399
- action = args;
400
- }
401
- return [action, state];
402
- }
403
- /**
404
- * @whatItDoes Provides convenience methods for implementing common operations of persisting data.
405
- */
406
- var DataPersistence = /** @class */ (function () {
407
- function DataPersistence(store, actions) {
408
- this.store = store;
409
- this.actions = actions;
410
- }
411
- /**
412
- *
413
- * @whatItDoes Handles pessimistic updates (updating the server first).
414
- *
415
- * Update the server implemented naively suffers from race conditions and poor error handling.
416
- *
417
- * `pessimisticUpdate` addresses these problems--it runs all fetches in order, which removes race conditions
418
- * and forces the developer to handle errors.
419
- *
420
- * ## Example:
421
- *
422
- * ```typescript
423
- * @Injectable()
424
- * class TodoEffects {
425
- * @Effect() updateTodo = this.s.pessimisticUpdate<UpdateTodo>('UPDATE_TODO', {
426
- * // provides an action and the current state of the store
427
- * run(a, state) {
428
- * // update the backend first, and then dispatch an action that will
429
- * // update the client side
430
- * return this.backend(state.user, a.payload).map(updated => ({
431
- * type: 'TODO_UPDATED',
432
- * payload: updated
433
- * }));
434
- * },
435
- *
436
- * onError(a, e: any) {
437
- * // we don't need to undo the changes on the client side.
438
- * // we can dispatch an error, or simply log the error here and return `null`
439
- * return null;
440
- * }
441
- * });
442
- *
443
- * constructor(private s: DataPersistence<TodosState>, private backend: Backend) {}
444
- * }
445
- * ```
446
- *
447
- * Note that if you don't return a new action from the run callback, you must set the dispatch property
448
- * of the effect to false, like this:
449
- *
450
- * ```
451
- * class TodoEffects {
452
- * @Effect({dispatch: false})
453
- * updateTodo; //...
454
- * }
455
- * ```
456
- */
457
- DataPersistence.prototype.pessimisticUpdate = function (actionType, opts) {
458
- return this.actions.pipe(effects.ofType(actionType), operators.withLatestFrom(this.store), pessimisticUpdate(opts));
459
- };
460
- /**
461
- *
462
- * @whatItDoes Handles optimistic updates (updating the client first).
463
- *
464
- * `optimisticUpdate` addresses these problems--it runs all fetches in order, which removes race conditions
465
- * and forces the developer to handle errors.
466
- *
467
- * `optimisticUpdate` is different from `pessimisticUpdate`. In case of a failure, when using `optimisticUpdate`,
468
- * the developer already updated the state locally, so the developer must provide an undo action.
469
- *
470
- * The error handling must be done in the callback, or by means of the undo action.
471
- *
472
- * ## Example:
473
- *
474
- * ```typescript
475
- * @Injectable()
476
- * class TodoEffects {
477
- * @Effect() updateTodo = this.s.optimisticUpdate<UpdateTodo>('UPDATE_TODO', {
478
- * // provides an action and the current state of the store
479
- * run: (a, state) => {
480
- * return this.backend(state.user, a.payload);
481
- * },
482
- *
483
- * undoAction: (a, e: any) => {
484
- * // dispatch an undo action to undo the changes in the client state
485
- * return ({
486
- * type: 'UNDO_UPDATE_TODO',
487
- * payload: a
488
- * });
489
- * }
490
- * });
491
- *
492
- * constructor(private s: DataPersistence<TodosState>, private backend: Backend) {}
493
- * }
494
- * ```
495
- *
496
- * Note that if you don't return a new action from the run callback, you must set the dispatch property
497
- * of the effect to false, like this:
498
- *
499
- * ```
500
- * class TodoEffects {
501
- * @Effect({dispatch: false})
502
- * updateTodo; //...
503
- * }
504
- * ```
505
- */
506
- DataPersistence.prototype.optimisticUpdate = function (actionType, opts) {
507
- return this.actions.pipe(effects.ofType(actionType), operators.withLatestFrom(this.store), optimisticUpdate(opts));
508
- };
509
- /**
510
- *
511
- * @whatItDoes Handles data fetching.
512
- *
513
- * Data fetching implemented naively suffers from race conditions and poor error handling.
514
- *
515
- * `fetch` addresses these problems--it runs all fetches in order, which removes race conditions
516
- * and forces the developer to handle errors.
517
- *
518
- * ## Example:
519
- *
520
- * ```typescript
521
- * @Injectable()
522
- * class TodoEffects {
523
- * @Effect() loadTodos = this.s.fetch<GetTodos>('GET_TODOS', {
524
- * // provides an action and the current state of the store
525
- * run: (a, state) => {
526
- * return this.backend(state.user, a.payload).map(r => ({
527
- * type: 'TODOS',
528
- * payload: r
529
- * });
530
- * },
531
- *
532
- * onError: (a, e: any) => {
533
- * // dispatch an undo action to undo the changes in the client state
534
- * }
535
- * });
536
- *
537
- * constructor(private s: DataPersistence<TodosState>, private backend: Backend) {}
538
- * }
539
- * ```
540
- *
541
- * This is correct, but because it set the concurrency to 1, it may not be performant.
542
- *
543
- * To fix that, you can provide the `id` function, like this:
544
- *
545
- * ```typescript
546
- * @Injectable()
547
- * class TodoEffects {
548
- * @Effect() loadTodo = this.s.fetch<GetTodo>('GET_TODO', {
549
- * id: (a, state) => {
550
- * return a.payload.id;
551
- * }
552
- *
553
- * // provides an action and the current state of the store
554
- * run: (a, state) => {
555
- * return this.backend(state.user, a.payload).map(r => ({
556
- * type: 'TODO',
557
- * payload: r
558
- * });
559
- * },
560
- *
561
- * onError: (a, e: any) => {
562
- * // dispatch an undo action to undo the changes in the client state
563
- * return null;
564
- * }
565
- * });
566
- *
567
- * constructor(private s: DataPersistence<TodosState>, private backend: Backend) {}
568
- * }
569
- * ```
570
- *
571
- * With this setup, the requests for Todo 1 will run concurrently with the requests for Todo 2.
572
- *
573
- * In addition, if DataPersistence notices that there are multiple requests for Todo 1 scheduled,
574
- * it will only run the last one.
575
- */
576
- DataPersistence.prototype.fetch = function (actionType, opts) {
577
- return this.actions.pipe(effects.ofType(actionType), operators.withLatestFrom(this.store), fetch(opts));
578
- };
579
- /**
580
- * @whatItDoes Handles data fetching as part of router navigation.
581
- *
582
- * Data fetching implemented naively suffers from race conditions and poor error handling.
583
- *
584
- * `navigation` addresses these problems.
585
- *
586
- * It checks if an activated router state contains the passed in component type, and, if it does, runs the `run`
587
- * callback. It provides the activated snapshot associated with the component and the current state. And it only runs
588
- * the last request.
589
- *
590
- * ## Example:
591
- *
592
- * ```typescript
593
- * @Injectable()
594
- * class TodoEffects {
595
- * @Effect() loadTodo = this.s.navigation(TodoComponent, {
596
- * run: (a, state) => {
597
- * return this.backend.fetchTodo(a.params['id']).map(todo => ({
598
- * type: 'TODO_LOADED',
599
- * payload: todo
600
- * }));
601
- * },
602
- * onError: (a, e: any) => {
603
- * // we can log and error here and return null
604
- * // we can also navigate back
605
- * return null;
606
- * }
607
- * });
608
- * constructor(private s: DataPersistence<TodosState>, private backend: Backend) {}
609
- * }
610
- * ```
611
- */
612
- DataPersistence.prototype.navigation = function (component, opts) {
613
- return this.actions.pipe(operators.withLatestFrom(this.store), navigation(component, opts));
614
- };
615
- return DataPersistence;
616
- }());
617
- DataPersistence.decorators = [
618
- { type: core.Injectable }
619
- ];
620
- DataPersistence.ctorParameters = function () { return [
621
- { type: store.Store },
622
- { type: effects.Actions }
623
- ]; };
624
- function findSnapshot(component, s) {
625
- var e_1, _a;
626
- if (s.routeConfig && s.routeConfig.component === component) {
627
- return s;
628
- }
629
- try {
630
- for (var _b = __values(s.children), _c = _b.next(); !_c.done; _c = _b.next()) {
631
- var c = _c.value;
632
- var ss = findSnapshot(component, c);
633
- if (ss) {
634
- return ss;
635
- }
636
- }
637
- }
638
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
639
- finally {
640
- try {
641
- if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
642
- }
643
- finally { if (e_1) throw e_1.error; }
644
- }
645
- return null;
646
- }
647
- function wrapIntoObservable(obj) {
648
- if (rxjs.isObservable(obj)) {
649
- return obj;
650
- }
651
- else if (!obj) {
652
- return rxjs.of();
653
- }
654
- else {
655
- return rxjs.of(obj);
656
- }
657
- }
658
-
659
- /**
660
- * @whatItDoes Provides services for enterprise Angular applications.
661
- *
662
- * See {@link DataPersistence} for more information.
663
- */
664
- var NxModule = /** @class */ (function () {
665
- function NxModule() {
666
- }
667
- NxModule.forRoot = function () {
668
- return { ngModule: NxModule, providers: [DataPersistence] };
669
- };
670
- return NxModule;
671
- }());
672
- NxModule.decorators = [
673
- { type: core.NgModule, args: [{},] }
674
- ];
675
-
676
- /**
677
- * Generated bundle index. Do not edit.
678
- */
679
-
680
- exports.DataPersistence = DataPersistence;
681
- exports.NxModule = NxModule;
682
- exports.fetch = fetch;
683
- exports.navigation = navigation;
684
- exports.optimisticUpdate = optimisticUpdate;
685
- exports.pessimisticUpdate = pessimisticUpdate;
686
-
687
- Object.defineProperty(exports, '__esModule', { value: true });
688
-
689
- })));
690
- //# sourceMappingURL=nrwl-angular.umd.js.map