@nrwl/angular 14.8.3 → 15.0.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 (132) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/esm2020/index.mjs +2 -3
  3. package/esm2020/src/runtime/nx/data-persistence.mjs +2 -59
  4. package/esm2020/testing/index.mjs +1 -18
  5. package/executors.d.ts +1 -1
  6. package/executors.js +1 -1
  7. package/executors.js.map +1 -1
  8. package/executors.json +8 -8
  9. package/fesm2015/nrwl-angular-testing.mjs +1 -19
  10. package/fesm2015/nrwl-angular-testing.mjs.map +1 -1
  11. package/fesm2015/nrwl-angular.mjs +2 -79
  12. package/fesm2015/nrwl-angular.mjs.map +1 -1
  13. package/fesm2020/nrwl-angular-testing.mjs +1 -19
  14. package/fesm2020/nrwl-angular-testing.mjs.map +1 -1
  15. package/fesm2020/nrwl-angular.mjs +2 -79
  16. package/fesm2020/nrwl-angular.mjs.map +1 -1
  17. package/index.d.ts +1 -2
  18. package/index.js +1 -4
  19. package/index.js.map +1 -1
  20. package/migrations.json +18 -0
  21. package/ng-package.json +0 -1
  22. package/package.json +9 -10
  23. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js +2 -2
  24. package/src/builders/module-federation-dev-server/module-federation-dev-server.impl.js.map +1 -1
  25. package/src/builders/{webpack-server → webpack-dev-server}/lib/index.d.ts +0 -0
  26. package/src/builders/{webpack-server → webpack-dev-server}/lib/index.js +0 -0
  27. package/src/builders/webpack-dev-server/lib/index.js.map +1 -0
  28. package/src/builders/{webpack-server → webpack-dev-server}/lib/normalize-options.d.ts +0 -0
  29. package/src/builders/{webpack-server → webpack-dev-server}/lib/normalize-options.js +0 -0
  30. package/src/builders/webpack-dev-server/lib/normalize-options.js.map +1 -0
  31. package/src/builders/{webpack-server → webpack-dev-server}/schema.d.ts +0 -0
  32. package/src/builders/{webpack-server → webpack-dev-server}/schema.json +3 -3
  33. package/src/builders/webpack-dev-server/webpack-dev-server.impl.d.ts +5 -0
  34. package/src/builders/{webpack-server/webpack-server.impl.js → webpack-dev-server/webpack-dev-server.impl.js} +5 -5
  35. package/src/builders/webpack-dev-server/webpack-dev-server.impl.js.map +1 -0
  36. package/src/generators/add-linting/schema.json +6 -0
  37. package/src/generators/application/application.js +0 -3
  38. package/src/generators/application/application.js.map +1 -1
  39. package/src/generators/application/files/src/app/app.routes.ts__tpl__ +3 -0
  40. package/src/generators/application/lib/convert-to-standalone-app.js +4 -3
  41. package/src/generators/application/lib/convert-to-standalone-app.js.map +1 -1
  42. package/src/generators/application/lib/create-files.d.ts +1 -1
  43. package/src/generators/application/lib/create-files.js +5 -2
  44. package/src/generators/application/lib/create-files.js.map +1 -1
  45. package/src/generators/application/lib/index.d.ts +0 -1
  46. package/src/generators/application/lib/index.js +0 -1
  47. package/src/generators/application/lib/index.js.map +1 -1
  48. package/src/generators/application/lib/normalized-schema.d.ts +3 -2
  49. package/src/generators/application/lib/root-router-config.js +2 -1
  50. package/src/generators/application/lib/root-router-config.js.map +1 -1
  51. package/src/generators/application/schema.d.ts +1 -23
  52. package/src/generators/application/schema.json +0 -30
  53. package/src/generators/host/host.js +4 -16
  54. package/src/generators/host/host.js.map +1 -1
  55. package/src/generators/host/schema.d.ts +1 -3
  56. package/src/generators/init/schema.d.ts +1 -1
  57. package/src/generators/library/lib/add-children.js +9 -14
  58. package/src/generators/library/lib/add-children.js.map +1 -1
  59. package/src/generators/library/lib/add-lazy-loaded-router-configuration.d.ts +1 -1
  60. package/src/generators/library/lib/add-lazy-loaded-router-configuration.js +17 -8
  61. package/src/generators/library/lib/add-lazy-loaded-router-configuration.js.map +1 -1
  62. package/src/generators/library/lib/add-load-children.js +7 -13
  63. package/src/generators/library/lib/add-load-children.js.map +1 -1
  64. package/src/generators/library/lib/add-module.js +2 -2
  65. package/src/generators/library/lib/add-module.js.map +1 -1
  66. package/src/generators/library/lib/add-router-configuration.d.ts +1 -1
  67. package/src/generators/library/lib/add-router-configuration.js +13 -5
  68. package/src/generators/library/lib/add-router-configuration.js.map +1 -1
  69. package/src/generators/library/lib/add-standalone-component.js +4 -4
  70. package/src/generators/library/lib/add-standalone-component.js.map +1 -1
  71. package/src/generators/library/lib/normalized-schema.d.ts +3 -3
  72. package/src/generators/library/schema.d.ts +2 -4
  73. package/src/generators/library/schema.json +2 -3
  74. package/src/generators/ng-add/schema.d.ts +1 -1
  75. package/src/generators/ngrx/files/__directory__/__fileName__.effects.spec.ts__tmpl__ +2 -6
  76. package/src/generators/ngrx/files/__directory__/__fileName__.effects.ts__tmpl__ +5 -17
  77. package/src/generators/ngrx/files/__directory__/__fileName__.facade.spec.ts__tmpl__ +0 -2
  78. package/src/generators/ngrx/lib/add-imports-to-module.js +0 -6
  79. package/src/generators/ngrx/lib/add-imports-to-module.js.map +1 -1
  80. package/src/generators/ngrx/schema.d.ts +0 -5
  81. package/src/generators/ngrx/schema.json +0 -6
  82. package/src/generators/remote/schema.d.ts +1 -3
  83. package/src/generators/setup-mf/files/entry-module-files/entry.module.ts__tmpl__ +3 -7
  84. package/src/generators/setup-mf/files/{standalone-entry-component-files/routes.ts__tmpl__ → entry-module-files/entry.routes.ts__tmpl__} +1 -1
  85. package/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +4 -0
  86. package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +1 -1
  87. package/src/generators/setup-mf/lib/add-remote-entry.js +8 -1
  88. package/src/generators/setup-mf/lib/add-remote-entry.js.map +1 -1
  89. package/src/generators/setup-mf/lib/add-remote-to-host.js +9 -23
  90. package/src/generators/setup-mf/lib/add-remote-to-host.js.map +1 -1
  91. package/src/generators/setup-mf/lib/fix-bootstrap.js +2 -2
  92. package/src/generators/setup-mf/lib/setup-serve-target.js +1 -1
  93. package/src/generators/setup-mf/lib/setup-serve-target.js.map +1 -1
  94. package/src/generators/storybook-configuration/schema.d.ts +1 -1
  95. package/src/migrations/update-14-8-0/rename-webpack-server.d.ts +2 -0
  96. package/src/migrations/update-14-8-0/rename-webpack-server.js +22 -0
  97. package/src/migrations/update-14-8-0/rename-webpack-server.js.map +1 -0
  98. package/src/migrations/update-15-0-0/add-karma-inputs.d.ts +2 -0
  99. package/src/migrations/update-15-0-0/add-karma-inputs.js +48 -0
  100. package/src/migrations/update-15-0-0/add-karma-inputs.js.map +1 -0
  101. package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.d.ts +2 -0
  102. package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js +94 -0
  103. package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js.map +1 -0
  104. package/src/runtime/nx/data-persistence.d.ts +4 -46
  105. package/src/runtime/nx/data-persistence.js +1 -57
  106. package/src/runtime/nx/data-persistence.js.map +1 -1
  107. package/src/utils/nx-devkit/ast-utils.d.ts +1 -1
  108. package/src/utils/nx-devkit/ast-utils.js +3 -3
  109. package/src/utils/nx-devkit/ast-utils.js.map +1 -1
  110. package/src/utils/nx-devkit/route-utils.d.ts +2 -0
  111. package/src/utils/nx-devkit/route-utils.js +39 -0
  112. package/src/utils/nx-devkit/route-utils.js.map +1 -0
  113. package/src/utils/versions.d.ts +1 -0
  114. package/src/utils/versions.js +2 -1
  115. package/src/utils/versions.js.map +1 -1
  116. package/testing/index.d.ts +0 -17
  117. package/testing/index.js +1 -18
  118. package/testing/index.js.map +1 -1
  119. package/esm2020/src/runtime/nx/nx.module.mjs +0 -23
  120. package/src/builders/webpack-server/lib/index.js.map +0 -1
  121. package/src/builders/webpack-server/lib/normalize-options.js.map +0 -1
  122. package/src/builders/webpack-server/webpack-server.impl.d.ts +0 -5
  123. package/src/builders/webpack-server/webpack-server.impl.js.map +0 -1
  124. package/src/generators/application/lib/add-mf.d.ts +0 -3
  125. package/src/generators/application/lib/add-mf.js +0 -24
  126. package/src/generators/application/lib/add-mf.js.map +0 -1
  127. package/src/runtime/nx/nx.module.d.ts +0 -15
  128. package/src/runtime/nx/nx.module.js +0 -24
  129. package/src/runtime/nx/nx.module.js.map +0 -1
  130. package/src/utils/nx-devkit/standalone-utils.d.ts +0 -2
  131. package/src/utils/nx-devkit/standalone-utils.js +0 -37
  132. package/src/utils/nx-devkit/standalone-utils.js.map +0 -1
@@ -1,11 +1,6 @@
1
- import * as i0 from '@angular/core';
2
- import { Injectable, NgModule } from '@angular/core';
3
- import * as i2 from '@ngrx/effects';
4
- import { ofType } from '@ngrx/effects';
5
1
  import { ROUTER_NAVIGATION } from '@ngrx/router-store';
6
2
  import { isObservable, of } from 'rxjs';
7
- import { concatMap, groupBy, mergeMap, switchMap, filter, map, catchError, withLatestFrom } from 'rxjs/operators';
8
- import * as i1 from '@ngrx/store';
3
+ import { concatMap, groupBy, mergeMap, switchMap, filter, map, catchError } from 'rxjs/operators';
9
4
 
10
5
  /**
11
6
  *
@@ -324,58 +319,6 @@ function normalizeActionAndState(args) {
324
319
  }
325
320
  return [action, ...slices];
326
321
  }
327
- /**
328
- * @whatItDoes Provides convenience methods for implementing common operations of persisting data.
329
- *
330
- * @deprecated Use the individual operators instead. Will be removed in v15.
331
- */
332
- class DataPersistence {
333
- constructor(store, actions) {
334
- this.store = store;
335
- this.actions = actions;
336
- }
337
- /**
338
- * See {@link pessimisticUpdate} operator for more information.
339
- *
340
- * @deprecated Use the {@link pessimisticUpdate} operator instead.
341
- * The {@link DataPersistence} class will be removed in v15.
342
- */
343
- pessimisticUpdate(actionType, opts) {
344
- return this.actions.pipe(ofType(actionType), withLatestFrom(this.store), pessimisticUpdate(opts));
345
- }
346
- /**
347
- * See {@link optimisticUpdate} operator for more information.
348
- *
349
- * @deprecated Use the {@link optimisticUpdate} operator instead.
350
- * The {@link DataPersistence} class will be removed in v15.
351
- */
352
- optimisticUpdate(actionType, opts) {
353
- return this.actions.pipe(ofType(actionType), withLatestFrom(this.store), optimisticUpdate(opts));
354
- }
355
- /**
356
- * See {@link fetch} operator for more information.
357
- *
358
- * @deprecated Use the {@link fetch} operator instead.
359
- * The {@link DataPersistence} class will be removed in v15.
360
- */
361
- fetch(actionType, opts) {
362
- return this.actions.pipe(ofType(actionType), withLatestFrom(this.store), fetch(opts));
363
- }
364
- /**
365
- * See {@link navigation} operator for more information.
366
- *
367
- * @deprecated Use the {@link navigation} operator instead.
368
- * The {@link DataPersistence} class will be removed in v15.
369
- */
370
- navigation(component, opts) {
371
- return this.actions.pipe(withLatestFrom(this.store), navigation(component, opts));
372
- }
373
- }
374
- DataPersistence.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: DataPersistence, deps: [{ token: i1.Store }, { token: i2.Actions }], target: i0.ɵɵFactoryTarget.Injectable });
375
- DataPersistence.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: DataPersistence });
376
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: DataPersistence, decorators: [{
377
- type: Injectable
378
- }], ctorParameters: function () { return [{ type: i1.Store }, { type: i2.Actions }]; } });
379
322
  function findSnapshot(component, s) {
380
323
  if (s.routeConfig && s.routeConfig.component === component) {
381
324
  return s;
@@ -400,29 +343,9 @@ function wrapIntoObservable(obj) {
400
343
  }
401
344
  }
402
345
 
403
- /**
404
- * @whatItDoes Provides services for enterprise Angular applications.
405
- *
406
- * See {@link DataPersistence} for more information.
407
- *
408
- * @deprecated Use the individual operators instead. Will be removed in v15.
409
- */
410
- class NxModule {
411
- static forRoot() {
412
- return { ngModule: NxModule, providers: [DataPersistence] };
413
- }
414
- }
415
- NxModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: NxModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
416
- NxModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "14.2.1", ngImport: i0, type: NxModule });
417
- NxModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: NxModule });
418
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.1", ngImport: i0, type: NxModule, decorators: [{
419
- type: NgModule,
420
- args: [{}]
421
- }] });
422
-
423
346
  /**
424
347
  * Generated bundle index. Do not edit.
425
348
  */
426
349
 
427
- export { DataPersistence, NxModule, fetch, navigation, optimisticUpdate, pessimisticUpdate };
350
+ export { fetch, navigation, optimisticUpdate, pessimisticUpdate };
428
351
  //# sourceMappingURL=nrwl-angular.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"nrwl-angular.mjs","sources":["../../src/runtime/nx/data-persistence.ts","../../src/runtime/nx/nx.module.ts","../../nrwl-angular.ts"],"sourcesContent":["import { Injectable, Type } from '@angular/core';\nimport { ActivatedRouteSnapshot, RouterStateSnapshot } from '@angular/router';\nimport { Actions, ofType } from '@ngrx/effects';\nimport { ROUTER_NAVIGATION, RouterNavigationAction } from '@ngrx/router-store';\nimport { Action, Store, ActionCreator } from '@ngrx/store';\nimport { isObservable, Observable, of } from 'rxjs';\nimport {\n catchError,\n concatMap,\n filter,\n groupBy,\n map,\n mergeMap,\n switchMap,\n withLatestFrom,\n} from 'rxjs/operators';\n\nexport interface PessimisticUpdateOpts<T extends Array<unknown>, A> {\n run(a: A, ...slices: [...T]): Observable<Action> | Action | void;\n onError(a: A, e: any): Observable<any> | any;\n}\n\nexport interface OptimisticUpdateOpts<T extends Array<unknown>, A> {\n run(a: A, ...slices: [...T]): Observable<Action> | Action | void;\n undoAction(a: A, e: any): Observable<Action> | Action;\n}\n\nexport interface FetchOpts<T extends Array<unknown>, A> {\n id?(a: A, ...slices: [...T]): any;\n run(a: A, ...slices: [...T]): Observable<Action> | Action | void;\n onError?(a: A, e: any): Observable<any> | any;\n}\n\nexport interface HandleNavigationOpts<T extends Array<unknown>> {\n run(\n a: ActivatedRouteSnapshot,\n ...slices: [...T]\n ): Observable<Action> | Action | void;\n onError?(a: ActivatedRouteSnapshot, e: any): Observable<any> | any;\n}\n\nexport type ActionOrActionWithStates<T extends Array<unknown>, A> =\n | A\n | [A, ...T];\nexport type ActionOrActionWithState<T, A> = ActionOrActionWithStates<[T], A>;\nexport type ActionStatesStream<T extends Array<unknown>, A> = Observable<\n ActionOrActionWithStates<T, A>\n>;\nexport type ActionStateStream<T, A> = Observable<\n ActionOrActionWithStates<[T], A>\n>;\n\n/**\n *\n * @whatItDoes Handles pessimistic updates (updating the server first).\n *\n * Updating the server, when implemented naively, suffers from race conditions and poor error handling.\n *\n * `pessimisticUpdate` addresses these problems. It runs all fetches in order, which removes race conditions\n * and forces the developer to handle errors.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('UPDATE_TODO'),\n * pessimisticUpdate({\n * // provides an action\n * run: (action: UpdateTodo) => {\n * // update the backend first, and then dispatch an action that will\n * // update the client side\n * return this.backend.updateTodo(action.todo.id, action.todo).pipe(\n * map((updated) => ({\n * type: 'UPDATE_TODO_SUCCESS',\n * todo: updated,\n * }))\n * );\n * },\n * onError: (action: UpdateTodo, error: any) => {\n * // we don't need to undo the changes on the client side.\n * // we can dispatch an error, or simply log the error here and return `null`\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * Note that if you don't return a new action from the run callback, you must set the dispatch property\n * of the effect to false, like this:\n *\n * ```typescript\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * //...\n * ), { dispatch: false }\n * );\n * }\n * ```\n *\n * @param opts\n */\nexport function pessimisticUpdate<T extends Array<unknown>, A extends Action>(\n opts: PessimisticUpdateOpts<T, A>\n) {\n return (source: ActionStatesStream<T, A>): Observable<Action> => {\n return source.pipe(\n mapActionAndState(),\n concatMap(runWithErrorHandling(opts.run, opts.onError))\n );\n };\n}\n\n/**\n *\n * @whatItDoes Handles optimistic updates (updating the client first).\n *\n * It runs all fetches in order, which removes race conditions and forces the developer to handle errors.\n *\n * When using `optimisticUpdate`, in case of a failure, the developer has already updated the state locally,\n * so the developer must provide an undo action.\n *\n * The error handling must be done in the callback, or by means of the undo action.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('UPDATE_TODO'),\n * optimisticUpdate({\n * // provides an action\n * run: (action: UpdateTodo) => {\n * return this.backend.updateTodo(action.todo.id, action.todo).pipe(\n * mapTo({\n * type: 'UPDATE_TODO_SUCCESS',\n * })\n * );\n * },\n * undoAction: (action: UpdateTodo, error: any) => {\n * // dispatch an undo action to undo the changes in the client state\n * return {\n * type: 'UNDO_TODO_UPDATE',\n * todo: action.todo,\n * };\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * Note that if you don't return a new action from the run callback, you must set the dispatch property\n * of the effect to false, like this:\n *\n * ```typescript\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * //...\n * ), { dispatch: false }\n * );\n * }\n * ```\n *\n * @param opts\n */\nexport function optimisticUpdate<T extends Array<unknown>, A extends Action>(\n opts: OptimisticUpdateOpts<T, A>\n) {\n return (source: ActionStatesStream<T, A>): Observable<Action> => {\n return source.pipe(\n mapActionAndState(),\n concatMap(runWithErrorHandling(opts.run, opts.undoAction))\n );\n };\n}\n\n/**\n *\n * @whatItDoes Handles data fetching.\n *\n * Data fetching implemented naively suffers from race conditions and poor error handling.\n *\n * `fetch` addresses these problems. It runs all fetches in order, which removes race conditions\n * and forces the developer to handle errors.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * loadTodos$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('GET_TODOS'),\n * fetch({\n * // provides an action\n * run: (a: GetTodos) => {\n * return this.backend.getAll().pipe(\n * map((response) => ({\n * type: 'TODOS',\n * todos: response.todos,\n * }))\n * );\n * },\n * onError: (action: GetTodos, error: any) => {\n * // dispatch an undo action to undo the changes in the client state\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * This is correct, but because it set the concurrency to 1, it may not be performant.\n *\n * To fix that, you can provide the `id` function, like this:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * loadTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('GET_TODO'),\n * fetch({\n * id: (todo: GetTodo) => {\n * return todo.id;\n * },\n * // provides an action\n * run: (todo: GetTodo) => {\n * return this.backend.getTodo(todo.id).map((response) => ({\n * type: 'LOAD_TODO_SUCCESS',\n * todo: response.todo,\n * }));\n * },\n * onError: (action: GetTodo, error: any) => {\n * // dispatch an undo action to undo the changes in the client state\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * With this setup, the requests for Todo 1 will run concurrently with the requests for Todo 2.\n *\n * In addition, if there are multiple requests for Todo 1 scheduled, it will only run the last one.\n *\n * @param opts\n */\nexport function fetch<T extends Array<unknown>, A extends Action>(\n opts: FetchOpts<T, A>\n) {\n return (source: ActionStatesStream<T, A>): Observable<Action> => {\n if (opts.id) {\n const groupedFetches = source.pipe(\n mapActionAndState(),\n groupBy(([action, ...store]) => {\n return opts.id(action, ...store);\n })\n );\n\n return groupedFetches.pipe(\n mergeMap((pairs) =>\n pairs.pipe(switchMap(runWithErrorHandling(opts.run, opts.onError)))\n )\n );\n }\n\n return source.pipe(\n mapActionAndState(),\n concatMap(runWithErrorHandling(opts.run, opts.onError))\n );\n };\n}\n\n/**\n * @whatItDoes Handles data fetching as part of router navigation.\n *\n * Data fetching implemented naively suffers from race conditions and poor error handling.\n *\n * `navigation` addresses these problems.\n *\n * It checks if an activated router state contains the passed in component type, and, if it does, runs the `run`\n * callback. It provides the activated snapshot associated with the component and the current state. And it only runs\n * the last request.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * loadTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * // listens for the routerNavigation action from @ngrx/router-store\n * navigation(TodoComponent, {\n * run: (activatedRouteSnapshot: ActivatedRouteSnapshot) => {\n * return this.backend\n * .fetchTodo(activatedRouteSnapshot.params['id'])\n * .pipe(\n * map((todo) => ({\n * type: 'LOAD_TODO_SUCCESS',\n * todo: todo,\n * }))\n * );\n * },\n * onError: (\n * activatedRouteSnapshot: ActivatedRouteSnapshot,\n * error: any\n * ) => {\n * // we can log and error here and return null\n * // we can also navigate back\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * @param component\n * @param opts\n */\nexport function navigation<T extends Array<unknown>, A extends Action>(\n component: Type<any>,\n opts: HandleNavigationOpts<T>\n) {\n return (source: ActionStatesStream<T, A>) => {\n const nav = source.pipe(\n mapActionAndState(),\n filter(([action]) => isStateSnapshot(action)),\n map(([action, ...slices]) => {\n if (!isStateSnapshot(action)) {\n // Because of the above filter we'll never get here,\n // but this properly type narrows `action`\n return;\n }\n\n return [\n findSnapshot(component, action.payload.routerState.root),\n ...slices,\n ] as [ActivatedRouteSnapshot, ...T];\n }),\n filter(([snapshot]) => !!snapshot)\n );\n\n return nav.pipe(switchMap(runWithErrorHandling(opts.run, opts.onError)));\n };\n}\n\nfunction isStateSnapshot(\n action: any\n): action is RouterNavigationAction<RouterStateSnapshot> {\n return action.type === ROUTER_NAVIGATION;\n}\n\nfunction runWithErrorHandling<T extends Array<unknown>, A, R>(\n run: (a: A, ...slices: [...T]) => Observable<R> | R | void,\n onError: any\n) {\n return ([action, ...slices]: [A, ...T]): Observable<R> => {\n try {\n const r = wrapIntoObservable(run(action, ...slices));\n return r.pipe(catchError((e) => wrapIntoObservable(onError(action, e))));\n } catch (e) {\n return wrapIntoObservable(onError(action, e));\n }\n };\n}\n\n/**\n * @whatItDoes maps Observable<Action | [Action, State]> to\n * Observable<[Action, State]>\n */\nfunction mapActionAndState<T extends Array<unknown>, A>() {\n return (source: Observable<ActionOrActionWithStates<T, A>>) => {\n return source.pipe(\n map((value) => normalizeActionAndState(value) as [A, ...T])\n );\n };\n}\n\n/**\n * @whatItDoes Normalizes either a bare action or an array of action and slices\n * into an array of action and slices (or undefined)\n */\nfunction normalizeActionAndState<T extends Array<unknown>, A>(\n args: ActionOrActionWithStates<T, A>\n): [A, ...T] {\n let action: A, slices: T;\n\n if (args instanceof Array) {\n [action, ...slices] = args;\n } else {\n slices = [] as T;\n action = args;\n }\n\n return [action, ...slices];\n}\n\n/**\n * @whatItDoes Provides convenience methods for implementing common operations of persisting data.\n *\n * @deprecated Use the individual operators instead. Will be removed in v15.\n */\n@Injectable()\nexport class DataPersistence<T> {\n constructor(public store: Store<T>, public actions: Actions) {}\n\n /**\n * See {@link pessimisticUpdate} operator for more information.\n *\n * @deprecated Use the {@link pessimisticUpdate} operator instead.\n * The {@link DataPersistence} class will be removed in v15.\n */\n pessimisticUpdate<A extends Action = Action>(\n actionType: string | ActionCreator,\n opts: PessimisticUpdateOpts<[T], A>\n ): Observable<any> {\n return this.actions.pipe(\n ofType<A>(actionType),\n withLatestFrom(this.store),\n pessimisticUpdate(opts)\n );\n }\n\n /**\n * See {@link optimisticUpdate} operator for more information.\n *\n * @deprecated Use the {@link optimisticUpdate} operator instead.\n * The {@link DataPersistence} class will be removed in v15.\n */\n optimisticUpdate<A extends Action = Action>(\n actionType: string | ActionCreator,\n opts: OptimisticUpdateOpts<[T], A>\n ): Observable<any> {\n return this.actions.pipe(\n ofType<A>(actionType),\n withLatestFrom(this.store),\n optimisticUpdate(opts)\n );\n }\n\n /**\n * See {@link fetch} operator for more information.\n *\n * @deprecated Use the {@link fetch} operator instead.\n * The {@link DataPersistence} class will be removed in v15.\n */\n fetch<A extends Action = Action>(\n actionType: string | ActionCreator,\n opts: FetchOpts<[T], A>\n ): Observable<any> {\n return this.actions.pipe(\n ofType<A>(actionType),\n withLatestFrom(this.store),\n fetch(opts)\n );\n }\n\n /**\n * See {@link navigation} operator for more information.\n *\n * @deprecated Use the {@link navigation} operator instead.\n * The {@link DataPersistence} class will be removed in v15.\n */\n navigation(\n component: Type<any>,\n opts: HandleNavigationOpts<[T]>\n ): Observable<any> {\n return this.actions.pipe(\n withLatestFrom(this.store),\n navigation(component, opts)\n );\n }\n}\n\nfunction findSnapshot(\n component: Type<any>,\n s: ActivatedRouteSnapshot\n): ActivatedRouteSnapshot {\n if (s.routeConfig && s.routeConfig.component === component) {\n return s;\n }\n for (const c of s.children) {\n const ss = findSnapshot(component, c);\n if (ss) {\n return ss;\n }\n }\n return null;\n}\n\nfunction wrapIntoObservable<O>(obj: Observable<O> | O | void): Observable<O> {\n if (isObservable(obj)) {\n return obj;\n } else if (!obj) {\n return of();\n } else {\n return of(obj as O);\n }\n}\n","import { ModuleWithProviders, NgModule } from '@angular/core';\nimport { DataPersistence } from './data-persistence';\n\n/**\n * @whatItDoes Provides services for enterprise Angular applications.\n *\n * See {@link DataPersistence} for more information.\n *\n * @deprecated Use the individual operators instead. Will be removed in v15.\n */\n@NgModule({})\nexport class NxModule {\n static forRoot(): ModuleWithProviders<NxModule> {\n return { ngModule: NxModule, providers: [DataPersistence] };\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAoDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDG;AACG,SAAU,iBAAiB,CAC/B,IAAiC,EAAA;IAEjC,OAAO,CAAC,MAAgC,KAAwB;QAC9D,OAAO,MAAM,CAAC,IAAI,CAChB,iBAAiB,EAAE,EACnB,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CACxD,CAAC;AACJ,KAAC,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,kBAAkB,CAAI,GAA6B,EAAA;AAC1D,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE;AACrB,QAAA,OAAO,GAAG,CAAC;AACZ,KAAA;SAAM,IAAI,CAAC,GAAG,EAAE;QACf,OAAO,EAAE,EAAE,CAAC;AACb,KAAA;AAAM,SAAA;AACL,QAAA,OAAO,EAAE,CAAC,GAAQ,CAAC,CAAC;AACrB,KAAA;AACH;;ACtgBA;;;;;;AAMG;MAEU,QAAQ,CAAA;AACnB,IAAA,OAAO,OAAO,GAAA;QACZ,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,eAAe,CAAC,EAAE,CAAC;KAC7D;;qGAHU,QAAQ,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;sGAAR,QAAQ,EAAA,CAAA,CAAA;sGAAR,QAAQ,EAAA,CAAA,CAAA;2FAAR,QAAQ,EAAA,UAAA,EAAA,CAAA;kBADpB,QAAQ;mBAAC,EAAE,CAAA;;;ACVZ;;AAEG;;;;"}
1
+ {"version":3,"file":"nrwl-angular.mjs","sources":["../../src/runtime/nx/data-persistence.ts","../../nrwl-angular.ts"],"sourcesContent":["import type { Type } from '@angular/core';\nimport type {\n ActivatedRouteSnapshot,\n RouterStateSnapshot,\n} from '@angular/router';\nimport type { RouterNavigationAction } from '@ngrx/router-store';\nimport { ROUTER_NAVIGATION } from '@ngrx/router-store';\nimport type { Action } from '@ngrx/store';\nimport type { Observable } from 'rxjs';\nimport { isObservable, of } from 'rxjs';\nimport {\n catchError,\n concatMap,\n filter,\n groupBy,\n map,\n mergeMap,\n switchMap,\n} from 'rxjs/operators';\n\nexport interface PessimisticUpdateOpts<T extends Array<unknown>, A> {\n run(a: A, ...slices: [...T]): Observable<Action> | Action | void;\n onError(a: A, e: any): Observable<any> | any;\n}\n\nexport interface OptimisticUpdateOpts<T extends Array<unknown>, A> {\n run(a: A, ...slices: [...T]): Observable<Action> | Action | void;\n undoAction(a: A, e: any): Observable<Action> | Action;\n}\n\nexport interface FetchOpts<T extends Array<unknown>, A> {\n id?(a: A, ...slices: [...T]): any;\n run(a: A, ...slices: [...T]): Observable<Action> | Action | void;\n onError?(a: A, e: any): Observable<any> | any;\n}\n\nexport interface HandleNavigationOpts<T extends Array<unknown>> {\n run(\n a: ActivatedRouteSnapshot,\n ...slices: [...T]\n ): Observable<Action> | Action | void;\n onError?(a: ActivatedRouteSnapshot, e: any): Observable<any> | any;\n}\n\nexport type ActionOrActionWithStates<T extends Array<unknown>, A> =\n | A\n | [A, ...T];\nexport type ActionOrActionWithState<T, A> = ActionOrActionWithStates<[T], A>;\nexport type ActionStatesStream<T extends Array<unknown>, A> = Observable<\n ActionOrActionWithStates<T, A>\n>;\nexport type ActionStateStream<T, A> = Observable<\n ActionOrActionWithStates<[T], A>\n>;\n\n/**\n *\n * @whatItDoes Handles pessimistic updates (updating the server first).\n *\n * Updating the server, when implemented naively, suffers from race conditions and poor error handling.\n *\n * `pessimisticUpdate` addresses these problems. It runs all fetches in order, which removes race conditions\n * and forces the developer to handle errors.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('UPDATE_TODO'),\n * pessimisticUpdate({\n * // provides an action\n * run: (action: UpdateTodo) => {\n * // update the backend first, and then dispatch an action that will\n * // update the client side\n * return this.backend.updateTodo(action.todo.id, action.todo).pipe(\n * map((updated) => ({\n * type: 'UPDATE_TODO_SUCCESS',\n * todo: updated,\n * }))\n * );\n * },\n * onError: (action: UpdateTodo, error: any) => {\n * // we don't need to undo the changes on the client side.\n * // we can dispatch an error, or simply log the error here and return `null`\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * Note that if you don't return a new action from the run callback, you must set the dispatch property\n * of the effect to false, like this:\n *\n * ```typescript\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * //...\n * ), { dispatch: false }\n * );\n * }\n * ```\n *\n * @param opts\n */\nexport function pessimisticUpdate<T extends Array<unknown>, A extends Action>(\n opts: PessimisticUpdateOpts<T, A>\n) {\n return (source: ActionStatesStream<T, A>): Observable<Action> => {\n return source.pipe(\n mapActionAndState(),\n concatMap(runWithErrorHandling(opts.run, opts.onError))\n );\n };\n}\n\n/**\n *\n * @whatItDoes Handles optimistic updates (updating the client first).\n *\n * It runs all fetches in order, which removes race conditions and forces the developer to handle errors.\n *\n * When using `optimisticUpdate`, in case of a failure, the developer has already updated the state locally,\n * so the developer must provide an undo action.\n *\n * The error handling must be done in the callback, or by means of the undo action.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('UPDATE_TODO'),\n * optimisticUpdate({\n * // provides an action\n * run: (action: UpdateTodo) => {\n * return this.backend.updateTodo(action.todo.id, action.todo).pipe(\n * mapTo({\n * type: 'UPDATE_TODO_SUCCESS',\n * })\n * );\n * },\n * undoAction: (action: UpdateTodo, error: any) => {\n * // dispatch an undo action to undo the changes in the client state\n * return {\n * type: 'UNDO_TODO_UPDATE',\n * todo: action.todo,\n * };\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * Note that if you don't return a new action from the run callback, you must set the dispatch property\n * of the effect to false, like this:\n *\n * ```typescript\n * class TodoEffects {\n * updateTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * //...\n * ), { dispatch: false }\n * );\n * }\n * ```\n *\n * @param opts\n */\nexport function optimisticUpdate<T extends Array<unknown>, A extends Action>(\n opts: OptimisticUpdateOpts<T, A>\n) {\n return (source: ActionStatesStream<T, A>): Observable<Action> => {\n return source.pipe(\n mapActionAndState(),\n concatMap(runWithErrorHandling(opts.run, opts.undoAction))\n );\n };\n}\n\n/**\n *\n * @whatItDoes Handles data fetching.\n *\n * Data fetching implemented naively suffers from race conditions and poor error handling.\n *\n * `fetch` addresses these problems. It runs all fetches in order, which removes race conditions\n * and forces the developer to handle errors.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * loadTodos$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('GET_TODOS'),\n * fetch({\n * // provides an action\n * run: (a: GetTodos) => {\n * return this.backend.getAll().pipe(\n * map((response) => ({\n * type: 'TODOS',\n * todos: response.todos,\n * }))\n * );\n * },\n * onError: (action: GetTodos, error: any) => {\n * // dispatch an undo action to undo the changes in the client state\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * This is correct, but because it set the concurrency to 1, it may not be performant.\n *\n * To fix that, you can provide the `id` function, like this:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * loadTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * ofType('GET_TODO'),\n * fetch({\n * id: (todo: GetTodo) => {\n * return todo.id;\n * },\n * // provides an action\n * run: (todo: GetTodo) => {\n * return this.backend.getTodo(todo.id).map((response) => ({\n * type: 'LOAD_TODO_SUCCESS',\n * todo: response.todo,\n * }));\n * },\n * onError: (action: GetTodo, error: any) => {\n * // dispatch an undo action to undo the changes in the client state\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * With this setup, the requests for Todo 1 will run concurrently with the requests for Todo 2.\n *\n * In addition, if there are multiple requests for Todo 1 scheduled, it will only run the last one.\n *\n * @param opts\n */\nexport function fetch<T extends Array<unknown>, A extends Action>(\n opts: FetchOpts<T, A>\n) {\n return (source: ActionStatesStream<T, A>): Observable<Action> => {\n if (opts.id) {\n const groupedFetches = source.pipe(\n mapActionAndState(),\n groupBy(([action, ...store]) => {\n return opts.id(action, ...store);\n })\n );\n\n return groupedFetches.pipe(\n mergeMap((pairs) =>\n pairs.pipe(switchMap(runWithErrorHandling(opts.run, opts.onError)))\n )\n );\n }\n\n return source.pipe(\n mapActionAndState(),\n concatMap(runWithErrorHandling(opts.run, opts.onError))\n );\n };\n}\n\n/**\n * @whatItDoes Handles data fetching as part of router navigation.\n *\n * Data fetching implemented naively suffers from race conditions and poor error handling.\n *\n * `navigation` addresses these problems.\n *\n * It checks if an activated router state contains the passed in component type, and, if it does, runs the `run`\n * callback. It provides the activated snapshot associated with the component and the current state. And it only runs\n * the last request.\n *\n * ## Example:\n *\n * ```typescript\n * @Injectable()\n * class TodoEffects {\n * loadTodo$ = createEffect(() =>\n * this.actions$.pipe(\n * // listens for the routerNavigation action from @ngrx/router-store\n * navigation(TodoComponent, {\n * run: (activatedRouteSnapshot: ActivatedRouteSnapshot) => {\n * return this.backend\n * .fetchTodo(activatedRouteSnapshot.params['id'])\n * .pipe(\n * map((todo) => ({\n * type: 'LOAD_TODO_SUCCESS',\n * todo: todo,\n * }))\n * );\n * },\n * onError: (\n * activatedRouteSnapshot: ActivatedRouteSnapshot,\n * error: any\n * ) => {\n * // we can log and error here and return null\n * // we can also navigate back\n * return null;\n * },\n * })\n * )\n * );\n *\n * constructor(private actions$: Actions, private backend: Backend) {}\n * }\n * ```\n *\n * @param component\n * @param opts\n */\nexport function navigation<T extends Array<unknown>, A extends Action>(\n component: Type<any>,\n opts: HandleNavigationOpts<T>\n) {\n return (source: ActionStatesStream<T, A>) => {\n const nav = source.pipe(\n mapActionAndState(),\n filter(([action]) => isStateSnapshot(action)),\n map(([action, ...slices]) => {\n if (!isStateSnapshot(action)) {\n // Because of the above filter we'll never get here,\n // but this properly type narrows `action`\n return;\n }\n\n return [\n findSnapshot(component, action.payload.routerState.root),\n ...slices,\n ] as [ActivatedRouteSnapshot, ...T];\n }),\n filter(([snapshot]) => !!snapshot)\n );\n\n return nav.pipe(switchMap(runWithErrorHandling(opts.run, opts.onError)));\n };\n}\n\nfunction isStateSnapshot(\n action: any\n): action is RouterNavigationAction<RouterStateSnapshot> {\n return action.type === ROUTER_NAVIGATION;\n}\n\nfunction runWithErrorHandling<T extends Array<unknown>, A, R>(\n run: (a: A, ...slices: [...T]) => Observable<R> | R | void,\n onError: any\n) {\n return ([action, ...slices]: [A, ...T]): Observable<R> => {\n try {\n const r = wrapIntoObservable(run(action, ...slices));\n return r.pipe(catchError((e) => wrapIntoObservable(onError(action, e))));\n } catch (e) {\n return wrapIntoObservable(onError(action, e));\n }\n };\n}\n\n/**\n * @whatItDoes maps Observable<Action | [Action, State]> to\n * Observable<[Action, State]>\n */\nfunction mapActionAndState<T extends Array<unknown>, A>() {\n return (source: Observable<ActionOrActionWithStates<T, A>>) => {\n return source.pipe(\n map((value) => normalizeActionAndState(value) as [A, ...T])\n );\n };\n}\n\n/**\n * @whatItDoes Normalizes either a bare action or an array of action and slices\n * into an array of action and slices (or undefined)\n */\nfunction normalizeActionAndState<T extends Array<unknown>, A>(\n args: ActionOrActionWithStates<T, A>\n): [A, ...T] {\n let action: A, slices: T;\n\n if (args instanceof Array) {\n [action, ...slices] = args;\n } else {\n slices = [] as T;\n action = args;\n }\n\n return [action, ...slices];\n}\n\nfunction findSnapshot(\n component: Type<any>,\n s: ActivatedRouteSnapshot\n): ActivatedRouteSnapshot {\n if (s.routeConfig && s.routeConfig.component === component) {\n return s;\n }\n for (const c of s.children) {\n const ss = findSnapshot(component, c);\n if (ss) {\n return ss;\n }\n }\n return null;\n}\n\nfunction wrapIntoObservable<O>(obj: Observable<O> | O | void): Observable<O> {\n if (isObservable(obj)) {\n return obj;\n } else if (!obj) {\n return of();\n } else {\n return of(obj as O);\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;AAuDA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwDG;AACG,SAAU,iBAAiB,CAC/B,IAAiC,EAAA;IAEjC,OAAO,CAAC,MAAgC,KAAwB;QAC9D,OAAO,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AAA,IAAI,EAAE,EAAE;AACN,YAAA,OAAO,EAAE,CAAC;AACX,SAAA;AACF,KAAA;AACD,IAAA,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,kBAAkB,CAAI,GAA6B,EAAA;AAC1D,IAAA,IAAI,YAAY,CAAC,GAAG,CAAC,EAAE;AACrB,QAAA,OAAO,GAAG,CAAC;AACZ,KAAA;SAAM,IAAI,CAAC,GAAG,EAAE;QACf,OAAO,EAAE,EAAE,CAAC;AACb,KAAA;AAAM,SAAA;AACL,QAAA,OAAO,EAAE,CAAC,GAAQ,CAAC,CAAC;AACrB,KAAA;AACH;;AC/bA;;AAEG;;;;"}
package/index.d.ts CHANGED
@@ -1,2 +1 @@
1
- export { DataPersistence, fetch, navigation, optimisticUpdate, pessimisticUpdate, } from './src/runtime/nx/data-persistence';
2
- export { NxModule } from './src/runtime/nx/nx.module';
1
+ export { fetch, navigation, optimisticUpdate, pessimisticUpdate, } from './src/runtime/nx/data-persistence';
package/index.js CHANGED
@@ -1,12 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.NxModule = exports.pessimisticUpdate = exports.optimisticUpdate = exports.navigation = exports.fetch = exports.DataPersistence = void 0;
3
+ exports.pessimisticUpdate = exports.optimisticUpdate = exports.navigation = exports.fetch = void 0;
4
4
  var data_persistence_1 = require("./src/runtime/nx/data-persistence");
5
- Object.defineProperty(exports, "DataPersistence", { enumerable: true, get: function () { return data_persistence_1.DataPersistence; } });
6
5
  Object.defineProperty(exports, "fetch", { enumerable: true, get: function () { return data_persistence_1.fetch; } });
7
6
  Object.defineProperty(exports, "navigation", { enumerable: true, get: function () { return data_persistence_1.navigation; } });
8
7
  Object.defineProperty(exports, "optimisticUpdate", { enumerable: true, get: function () { return data_persistence_1.optimisticUpdate; } });
9
8
  Object.defineProperty(exports, "pessimisticUpdate", { enumerable: true, get: function () { return data_persistence_1.pessimisticUpdate; } });
10
- var nx_module_1 = require("./src/runtime/nx/nx.module");
11
- Object.defineProperty(exports, "NxModule", { enumerable: true, get: function () { return nx_module_1.NxModule; } });
12
9
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/angular/index.ts"],"names":[],"mappings":";;;AAAA,sEAM2C;AALzC,mHAAA,eAAe,OAAA;AACf,yGAAA,KAAK,OAAA;AACL,8GAAA,UAAU,OAAA;AACV,oHAAA,gBAAgB,OAAA;AAChB,qHAAA,iBAAiB,OAAA;AAEnB,wDAAsD;AAA7C,qGAAA,QAAQ,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../packages/angular/index.ts"],"names":[],"mappings":";;;AAAA,sEAK2C;AAJzC,yGAAA,KAAK,OAAA;AACL,8GAAA,UAAU,OAAA;AACV,oHAAA,gBAAgB,OAAA;AAChB,qHAAA,iBAAiB,OAAA"}
package/migrations.json CHANGED
@@ -172,6 +172,24 @@
172
172
  "version": "14.6.0-beta.0",
173
173
  "description": "Update the @angular/cli package version to ~14.2.0.",
174
174
  "factory": "./src/migrations/update-14-6-0/update-angular-cli"
175
+ },
176
+ "rename-webpack-server-executor": {
177
+ "cli": "nx",
178
+ "version": "15.0.0-beta.0",
179
+ "description": "Rename @nrwl/angular:webpack-server executor to @nrwl/angular:webpack-dev-server",
180
+ "factory": "./src/migrations/update-14-8-0/rename-webpack-server"
181
+ },
182
+ "switch-to-jasmine-marbles": {
183
+ "cli": "nx",
184
+ "version": "15.0.0-beta.0",
185
+ "description": "Update the usages of @nrwl/angular/testing to import jasmine-marbles symbols from jasmine-marbles itself.",
186
+ "factory": "./src/migrations/update-15-0-0/switch-to-jasmine-marbles"
187
+ },
188
+ "add-karma-inputs": {
189
+ "cli": "nx",
190
+ "version": "15.0.0-beta.1",
191
+ "description": "Stop hashing karma spec files and config files for build targets and dependent tasks",
192
+ "factory": "./src/migrations/update-15-0-0/add-karma-inputs"
175
193
  }
176
194
  },
177
195
  "packageJsonUpdates": {
package/ng-package.json CHANGED
@@ -13,7 +13,6 @@
13
13
  "chalk",
14
14
  "chokidar",
15
15
  "ignore",
16
- "jasmine-marbles",
17
16
  "minimatch",
18
17
  "rxjs-for-await",
19
18
  "webpack-merge",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nrwl/angular",
3
- "version": "14.8.3",
3
+ "version": "15.0.0-beta.1",
4
4
  "private": false,
5
5
  "description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Cypress, Karma, and Protractor. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Upgrading AngularJS applications \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
6
6
  "repository": {
@@ -67,20 +67,19 @@
67
67
  },
68
68
  "dependencies": {
69
69
  "@angular-devkit/schematics": "~14.2.0",
70
- "@nrwl/cypress": "14.8.3",
71
- "@nrwl/devkit": "14.8.3",
72
- "@nrwl/jest": "14.8.3",
73
- "@nrwl/linter": "14.8.3",
74
- "@nrwl/storybook": "14.8.3",
75
- "@nrwl/webpack": "14.8.3",
76
- "@nrwl/workspace": "14.8.3",
70
+ "@nrwl/cypress": "15.0.0-beta.1",
71
+ "@nrwl/devkit": "15.0.0-beta.1",
72
+ "@nrwl/jest": "15.0.0-beta.1",
73
+ "@nrwl/linter": "15.0.0-beta.1",
74
+ "@nrwl/storybook": "15.0.0-beta.1",
75
+ "@nrwl/webpack": "15.0.0-beta.1",
76
+ "@nrwl/workspace": "15.0.0-beta.1",
77
77
  "@phenomnomnominal/tsquery": "4.1.1",
78
78
  "@schematics/angular": "~14.2.0",
79
79
  "chalk": "4.1.0",
80
80
  "chokidar": "^3.5.1",
81
81
  "http-server": "^14.1.0",
82
82
  "ignore": "^5.0.4",
83
- "jasmine-marbles": "~0.8.4",
84
83
  "magic-string": "~0.26.2",
85
84
  "minimatch": "3.0.5",
86
85
  "semver": "7.3.4",
@@ -100,5 +99,5 @@
100
99
  "fesm2015": "fesm2015/nrwl-angular.mjs",
101
100
  "typings": "index.d.ts",
102
101
  "sideEffects": false,
103
- "gitHead": "c30d39a028f495c54811a8cd9cc09b84ac5130c8"
102
+ "gitHead": "49c5e5069b80605943ef3bbe965e291d79354cd5"
104
103
  }
@@ -6,7 +6,7 @@ const devkit_1 = require("@nrwl/devkit");
6
6
  const ngcli_adapter_1 = require("nx/src/adapter/ngcli-adapter");
7
7
  const architect_1 = require("@angular-devkit/architect");
8
8
  const path_1 = require("path");
9
- const webpack_server_impl_1 = require("../webpack-server/webpack-server.impl");
9
+ const webpack_dev_server_impl_1 = require("../webpack-dev-server/webpack-dev-server.impl");
10
10
  const fs_1 = require("fs");
11
11
  const project_graph_1 = require("nx/src/project-graph/project-graph");
12
12
  function getDynamicRemotes(project, context, workspaceProjects) {
@@ -109,7 +109,7 @@ function executeModuleFederationDevServerBuilder(schema, context) {
109
109
  });
110
110
  });
111
111
  }
112
- return (0, webpack_server_impl_1.executeWebpackServerBuilder)(options, context);
112
+ return (0, webpack_dev_server_impl_1.executeWebpackDevServerBuilder)(options, context);
113
113
  }
114
114
  exports.executeModuleFederationDevServerBuilder = executeModuleFederationDevServerBuilder;
115
115
  exports.default = (0, architect_1.createBuilder)(executeModuleFederationDevServerBuilder);
@@ -1 +1 @@
1
- {"version":3,"file":"module-federation-dev-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,gEAA8D;AAC9D,yDAA0E;AAE1E,+BAA4B;AAC5B,+EAAoF;AACpF,2BAA8C;AAC9C,sEAA+F;AAE/F,SAAS,iBAAiB,CACxB,OAA6B,EAC7B,OAAuB,EACvB,iBAAuD;IAEvD,4BAA4B;IAC5B,6DAA6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AE,EAAE,CAC3F,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,IAAA,iDAA2B,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC;AAnED,0FAmEC;AAED,kBAAe,IAAA,yBAAa,EAC1B,uCAAuC,CACxC,CAAC"}
1
+ {"version":3,"file":"module-federation-dev-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/module-federation-dev-server/module-federation-dev-server.impl.ts"],"names":[],"mappings":";;;;AACA,yCAKsB;AACtB,gEAA8D;AAC9D,yDAA0E;AAE1E,+BAA4B;AAC5B,2FAA+F;AAC/F,2BAA8C;AAC9C,sEAA+F;AAE/F,SAAS,iBAAiB,CACxB,OAA6B,EAC7B,OAAuB,EACvB,iBAAuD;IAEvD,4BAA4B;IAC5B,6DAA6D;IAC7D,8BAA8B;IAE9B,MAAM,qCAAqC,GAAG,IAAA,WAAI,EAChD,OAAO,CAAC,aAAa,EACrB,OAAO,CAAC,UAAU,EAClB,wCAAwC,CACzC,CAAC;IACF,IAAI,CAAC,IAAA,eAAU,EAAC,qCAAqC,CAAC,EAAE;QACtD,OAAO,EAAE,CAAC;KACX;IAED,MAAM,4BAA4B,GAAG,IAAA,iBAAY,EAC/C,qCAAqC,EACrC,OAAO,CACR,CAAC;IAEF,IAAI,CAAC,4BAA4B,EAAE;QACjC,OAAO,EAAE,CAAC;KACX;IAED,4BAA4B;IAC5B,IAAI;IACJ,oCAAoC;IACpC,IAAI;IACJ,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChE,IACE,CAAC,MAAM,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC,KAAK,CAChC,CAAC,GAAG,EAAE,EAAE,CACN,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,cAAc,CAAC,GAAG,CAAC,KAAK,QAAQ,CACrE,EACD;QACA,OAAO,EAAE,CAAC;KACX;IAED,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C,UAAU,EAAE,QAAQ,CAAC,CAAC;YAEzD,IAAI,MAAM,CAAC,oBAAoB,IAAI,SAAS,IAAI,MAAM,CAAC,UAAU,EAAE;gBACjE,UAAU,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;aACtC;SACF;QAED,IAAA,8BAAc,EACZ,OAAO,CAAC,aAAa,EACrB;YACE,OAAO,EAAE,MAAM;YACf,MAAM;YACN,aAAa,EAAE,OAAO,CAAC,MAAM,CAAC,aAAa;YAC3C,UAAU;SACX,EACD,OAAO,CAAC,OAAO,CAChB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE;YACb,GAAG,CAAC,SAAS,EAAE,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;gBAC5B,MAAM,IAAI,KAAK,CACb,WAAW,MAAM,yDAAyD,GAAG,CAAC,QAAQ,EAAE,EAAE,CAC3F,CAAC;YACJ,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;KACJ;IAED,OAAO,IAAA,wDAA8B,EAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC1D,CAAC;AAnED,0FAmEC;AAED,kBAAe,IAAA,yBAAa,EAC1B,uCAAuC,CACxC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/builders/webpack-dev-server/lib/index.ts"],"names":[],"mappings":";;;AAAA,8DAAoC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/builders/webpack-dev-server/lib/normalize-options.ts"],"names":[],"mappings":";;;AAEA,SAAgB,gBAAgB,CAAC,MAAc;IAC7C,uBACE,IAAI,EAAE,WAAW,EACjB,IAAI,EAAE,IAAI,EACV,UAAU,EAAE,IAAI,EAChB,IAAI,EAAE,KAAK,EACX,GAAG,EAAE,KAAK,IACP,MAAM,EACT;AACJ,CAAC;AATD,4CASC"}
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-07/schema",
3
- "title": "Schema for Webpack Server",
4
- "description": "The webpack-server executor is very similar to the standard dev server builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration.",
5
- "examplesFile": "../../../docs/webpack-server-examples.md",
3
+ "title": "Schema for Webpack Dev Server",
4
+ "description": "The webpack-dev-server executor is very similar to the standard dev server builder provided by the Angular Devkit. It is usually used in tandem with `@nrwl/angular:webpack-browser` when your Angular application uses a custom webpack configuration.",
5
+ "examplesFile": "../../../docs/webpack-dev-server-examples.md",
6
6
  "type": "object",
7
7
  "presets": [
8
8
  {
@@ -0,0 +1,5 @@
1
+ import { BuilderContext } from '@angular-devkit/architect';
2
+ import type { Schema } from './schema';
3
+ export declare function executeWebpackDevServerBuilder(rawOptions: Schema, context: BuilderContext): import("rxjs").Observable<import("@angular-devkit/build-angular").DevServerBuilderOutput>;
4
+ declare const _default: any;
5
+ export default _default;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.executeWebpackServerBuilder = void 0;
3
+ exports.executeWebpackDevServerBuilder = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const architect_1 = require("@angular-devkit/architect");
6
6
  const build_angular_1 = require("@angular-devkit/build-angular");
@@ -13,7 +13,7 @@ const operators_1 = require("nx/src/project-graph/operators");
13
13
  const webpack_merge_1 = require("webpack-merge");
14
14
  const webpack_1 = require("../utilities/webpack");
15
15
  const lib_1 = require("./lib");
16
- function executeWebpackServerBuilder(rawOptions, context) {
16
+ function executeWebpackDevServerBuilder(rawOptions, context) {
17
17
  var _a, _b, _c, _d, _e;
18
18
  process.env.NX_TSCONFIG_PATH = (0, devkit_1.joinPathFragments)(context.workspaceRoot, 'tsconfig.base.json');
19
19
  const options = (0, lib_1.normalizeOptions)(rawOptions);
@@ -85,6 +85,6 @@ function executeWebpackServerBuilder(rawOptions, context) {
85
85
  }),
86
86
  });
87
87
  }
88
- exports.executeWebpackServerBuilder = executeWebpackServerBuilder;
89
- exports.default = (0, architect_1.createBuilder)(executeWebpackServerBuilder);
90
- //# sourceMappingURL=webpack-server.impl.js.map
88
+ exports.executeWebpackDevServerBuilder = executeWebpackDevServerBuilder;
89
+ exports.default = (0, architect_1.createBuilder)(executeWebpackDevServerBuilder);
90
+ //# sourceMappingURL=webpack-dev-server.impl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webpack-dev-server.impl.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/builders/webpack-dev-server/webpack-dev-server.impl.ts"],"names":[],"mappings":";;;;AAAA,yDAA0E;AAC1E,iEAGuC;AAEvC,yCAIsB;AACtB,yHAAkH;AAClH,6FAI4D;AAC5D,sEAAoF;AACpF,2BAAgC;AAChC,8DAA8D;AAC9D,iDAAsC;AACtC,kDAAkE;AAClE,+BAAyC;AAGzC,SAAgB,8BAA8B,CAC5C,UAAkB,EAClB,OAAuB;;IAEvB,OAAO,CAAC,GAAG,CAAC,gBAAgB,GAAG,IAAA,0BAAiB,EAC9C,OAAO,CAAC,aAAa,EACrB,oBAAoB,CACrB,CAAC;IAEF,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,UAAU,CAAC,CAAC;IAE7C,MAAM,mBAAmB,GAAG,IAAA,0BAAiB,EAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IACrE,MAAM,iCAAiC,GAAG,IAAA,8CAA8B,EACtE,mBAAmB,CAAC,OAAO,CAC5B,CAAC;IAEF,MAAM,WAAW,GACf,iCAAiC,CAAC,OAAO,CAAC,mBAAmB,CAAC,MAAM,CAAC,CAAC;IAExE,MAAM,wBAAwB,GAAG,mBAAmB,CAAC,aAAa;QAChE,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,mBAAmB,CAAC,aAAa,CAAC;QAC/D,CAAC,CAAC,WAAW,CAAC,oBAAoB;YAClC,CAAC,CAAC,WAAW,CAAC,cAAc,CAAC,WA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M,0BAA0B,GAAG,IAAA,oCAA0B,EAC3D,mBAAmB,EACnB,WAAW,CAAC,OAAO,CAAC,QAAQ,CAC7B,CAAC;YACF,gFAAgF;YAChF,yFAAyF;YACzF,4CAA4C;YAC5C,MAAM,MAAM,GAAG,MAAM,0BAA0B,CAAC;YAEhD,0FAA0F;YAC1F,4DAA4D;YAC5D,IAAI,OAAO,MAAM,KAAK,UAAU,EAAE;gBAChC,OAAO,MAAM,CACX,iBAAiB,EACjB,wBAAwB,EACxB,OAAO,CAAC,MAAM,CACf,CAAC;aACH;YAED,OAAO,IAAA,qBAAK,EAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;QAC1C,CAAC,CAAA;KACF,CAAC,CAAC;AACL,CAAC;AAlID,wEAkIC;AAED,kBAAe,IAAA,yBAAa,EAC1B,8BAA8B,CACxB,CAAC"}
@@ -5,6 +5,12 @@
5
5
  "description": "Adds linting configuration to an Angular project.",
6
6
  "cli": "nx",
7
7
  "type": "object",
8
+ "examples": [
9
+ {
10
+ "command": "nx g @nrwl/angular:add-linting --prefix=cool --projectName=cool-lib --projectRoot=libs/cool-lib",
11
+ "description": "Adds ESLint with Angular-specific rules for an existing project named `cool-lib` with the [prefix](https://angular.io/guide/styleguide#style-02-07) `cool`"
12
+ }
13
+ ],
8
14
  "properties": {
9
15
  "prefix": {
10
16
  "type": "string",
@@ -85,9 +85,6 @@ function applicationGenerator(host, schema) {
85
85
  if (options.standalone) {
86
86
  (0, lib_1.convertToStandaloneApp)(host, options);
87
87
  }
88
- if (options.mf) {
89
- yield (0, lib_1.addMf)(host, options);
90
- }
91
88
  if (!options.skipFormat) {
92
89
  yield (0, devkit_1.formatFiles)(host);
93
90
  }
@@ -1 +1 @@
1
- {"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/application/application.ts"],"names":[],"mappings":";;;;AAAA,yCAKsB;AACtB,8DAAwE;AACxE,2DAAyE;AACzE,2DAA0D;AAC1D,uCAAoD;AACpD,qEAA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,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SACzC;aAAM;YACL,IAAA,iCAA2B,EAAC,IAAI,EAAE,KAAK,CAAC,CAAC;SAC1C;QAED,IAAI,OAAO,CAAC,gBAAgB,EAAE;YAC5B,MAAM,IAAA,wCAA2B,EAAC,IAAI,EAAE;gBACtC,OAAO,EAAE,OAAO,CAAC,IAAI;gBACrB,GAAG,EAAE,KAAK;aACX,CAAC,CAAC;SACJ;QAED,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,IAAA,4BAAsB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SACvC;QAED,IAAI,OAAO,CAAC,EAAE,EAAE;YACd,MAAM,IAAA,WAAK,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SAC5B;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,GAAG,EAAE;YACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC;CAAA;AApHD,oDAoHC;AAED,kBAAe,oBAAoB,CAAC"}
1
+ {"version":3,"file":"application.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/application/application.ts"],"names":[],"mappings":";;;;AAAA,yCAKsB;AACtB,8DAAwE;AACxE,2DAAyE;AACzE,2DAA0D;AAC1D,uCAAoD;AACpD,qEAA0E;AAC1E,+BAiBe;AAGf,SAAsB,oBAAoB,CACxC,IAAU,EACV,MAAuB;;QAEvB,MAAM,OAAO,GAAG,IAAA,sBAAgB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAE/C,MAAM,IAAA,2BAAoB,EAAC,IAAI,kCAC1B,OAAO,KACV,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,MAAM,mBAAmB,GAAG,IAAA,0CAA0B,EACpD,qBAAqB,EACrB,aAAa,CACd,CAAC;QACF,MAAM,mBAAmB,CAAC,IAAI,E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IAAI,EAAE,OAAO,CAAC,CAAC;SACvC;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,GAAG,EAAE;YACV,IAAA,4BAAmB,EAAC,IAAI,CAAC,CAAC;QAC5B,CAAC,CAAC;IACJ,CAAC;CAAA;AAhHD,oDAgHC;AAED,kBAAe,oBAAoB,CAAC"}
@@ -0,0 +1,3 @@
1
+ import { Route } from '@angular/router';
2
+
3
+ export const appRoutes: Route[] = [];
@@ -28,13 +28,14 @@ function updateMainEntrypoint(options, tree, pathToAppModule) {
28
28
  }
29
29
  tree.write((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/main.ts'), standaloneComponentMainContents(routerModuleSetup));
30
30
  }
31
- const standaloneComponentMainContents = (routerModuleSetup) => `import { enableProdMode${routerModuleSetup ? `, importProvidersFrom` : ``} } from '@angular/core';
31
+ const standaloneComponentMainContents = (routerModuleSetup) => `import { enableProdMode } from '@angular/core';
32
32
  import { bootstrapApplication } from '@angular/platform-browser';${routerModuleSetup
33
33
  ? `
34
- import { RouterModule } from '@angular/router'`
34
+ import { provideRouter, withNonEnabledBlockingInitialNavigation } from '@angular/router'`
35
35
  : ``};
36
36
  import { AppComponent } from './app/app.component';
37
37
  import { environment } from './environments/environment';
38
+ ${routerModuleSetup ? `import { appRoutes } from './app/app.routes';` : ''}
38
39
 
39
40
  if (environment.production) {
40
41
  enableProdMode();
@@ -42,7 +43,7 @@ if (environment.production) {
42
43
 
43
44
  bootstrapApplication(AppComponent${routerModuleSetup
44
45
  ? `, {
45
- providers: [importProvidersFrom(${routerModuleSetup})],
46
+ providers: [provideRouter(appRoutes, withEnabledBlockingInitialNavigation())],
46
47
  }`
47
48
  : ''}).catch((err) => console.error(err));`;
48
49
  function updateAppComponent(tree, options) {
@@ -1 +1 @@
1
- {"version":3,"file":"convert-to-standalone-app.js","sourceRoot":"","sources":["../../../../../../../packages/angular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AC,kBAAkB,EAAE,uBAAuB,CAAC,CAAC;AAC1D,CAAC;AAED,SAAS,sBAAsB,CAAC,IAAU,EAAE,OAAyB;IACnE,MAAM,sBAAsB,GAAG,IAAA,0BAAiB,EAC9C,OAAO,CAAC,cAAc,EACtB,+BAA+B,CAChC,CAAC;IACF,MAAM,wBAAwB,GAAG,IAAI,CAAC,IAAI,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC;IAE5E,IAAI,2BAAmC,CAAC;IACxC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,2BAA2B,GAAG,wBAAwB,CAAC,OAAO,CAC5D,cAAc,EACd,SAAS,CACV,CAAC;KACH;SAAM;QACL,2BAA2B,GAAG,wBAAwB;aACnD,OAAO,CACN,iCAAiC,EACjC,kEAAkE,CACnE;aACA,OAAO,CAAC,kDAAkD,EAAE,EAAE,CAAC,CAAC;KACpE;IAED,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC;AAClE,CAAC"}
1
+ {"version":3,"file":"convert-to-standalone-app.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/convert-to-standalone-app.ts"],"names":[],"mappings":";;;AACA,yCAAiD;AAEjD,uDAAoD;AAEpD,SAAgB,sBAAsB,CAAC,IAAU,EAAE,OAAyB;IAC1E,MAAM,eAAe,GAAG,IAAA,0BAAiB,EACvC,OAAO,CAAC,cAAc,EACtB,uBAAuB,CACxB,CAAC;IACF,oBAAoB,CAAC,OAAO,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;IACrD,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;QACtB,sBAAsB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;KACvC;IAED,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;AAC/B,CAAC;AAZD,wDAYC;AAED,SAAS,oBAAoB,CAC3B,OAAyB,EACz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;KACpE;IAED,IAAI,CAAC,KAAK,CAAC,sBAAsB,EAAE,2BAA2B,CAAC,CAAC;AAClE,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import type { Tree } from '@nrwl/devkit';
2
2
  import type { NormalizedSchema } from './normalized-schema';
3
- export declare function createFiles(host: Tree, options: NormalizedSchema): void;
3
+ export declare function createFiles(tree: Tree, options: NormalizedSchema): void;
@@ -3,8 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createFiles = void 0;
4
4
  const devkit_1 = require("@nrwl/devkit");
5
5
  const typescript_1 = require("@nrwl/workspace/src/utilities/typescript");
6
- function createFiles(host, options) {
7
- (0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, '../files'), options.appProjectRoot, Object.assign(Object.assign({}, options), { rootTsConfigPath: (0, typescript_1.getRelativePathToRootTsConfig)(host, options.appProjectRoot), tpl: '' }));
6
+ function createFiles(tree, options) {
7
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files'), options.appProjectRoot, Object.assign(Object.assign({}, options), { rootTsConfigPath: (0, typescript_1.getRelativePathToRootTsConfig)(tree, options.appProjectRoot), tpl: '' }));
8
+ if (!options.routing) {
9
+ tree.delete((0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/app/app.routes.ts'));
10
+ }
8
11
  }
9
12
  exports.createFiles = createFiles;
10
13
  //# sourceMappingURL=create-files.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"create-files.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/create-files.ts"],"names":[],"mappings":";;;AACA,yCAAgE;AAChE,yEAAyF;AAGzF,SAAgB,WAAW,CAAC,IAAU,EAAE,OAAyB;IAC/D,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,UAAU,CAAC,EACxC,OAAO,CAAC,cAAc,kCAEjB,OAAO,KACV,gBAAgB,EAAE,IAAA,0CAA6B,EAC7C,IAAI,EACJ,OAAO,CAAC,cAAc,CACvB,EACD,GAAG,EAAE,EAAE,IAEV,CAAC;AACJ,CAAC;AAdD,kCAcC"}
1
+ {"version":3,"file":"create-files.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/create-files.ts"],"names":[],"mappings":";;;AACA,yCAAgE;AAChE,yEAAyF;AAGzF,SAAgB,WAAW,CAAC,IAAU,EAAE,OAAyB;IAC/D,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,UAAU,CAAC,EACxC,OAAO,CAAC,cAAc,kCAEjB,OAAO,KACV,gBAAgB,EAAE,IAAA,0CAA6B,EAC7C,IAAI,EACJ,OAAO,CAAC,cAAc,CACvB,EACD,GAAG,EAAE,EAAE,IAEV,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE;QACpB,IAAI,CAAC,MAAM,CACT,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,uBAAuB,CAAC,CACnE,CAAC;KACH;AACH,CAAC;AApBD,kCAoBC"}
@@ -1,6 +1,5 @@
1
1
  export * from './add-e2e';
2
2
  export * from './add-linting';
3
- export * from './add-mf';
4
3
  export * from './add-protractor';
5
4
  export * from './add-proxy-config';
6
5
  export * from './add-unit-test-runner';
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./add-e2e"), exports);
5
5
  tslib_1.__exportStar(require("./add-linting"), exports);
6
- tslib_1.__exportStar(require("./add-mf"), exports);
7
6
  tslib_1.__exportStar(require("./add-protractor"), exports);
8
7
  tslib_1.__exportStar(require("./add-proxy-config"), exports);
9
8
  tslib_1.__exportStar(require("./add-unit-test-runner"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,wDAA8B;AAC9B,mDAAyB;AACzB,2DAAiC;AACjC,6DAAmC;AACnC,iEAAuC;AACvC,yDAA+B;AAC/B,wEAA8C;AAC9C,8DAAoC;AACpC,8DAAoC;AACpC,0DAAgC;AAChC,kEAAwC;AACxC,+DAAqC;AACrC,mEAAyC;AACzC,gEAAsC;AACtC,kEAAwC;AACxC,0EAAgD;AAChD,yEAA+C;AAC/C,gEAAsC;AACtC,+DAAqC;AACrC,mEAAyC;AACzC,sEAA4C"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,wDAA8B;AAC9B,2DAAiC;AACjC,6DAAmC;AACnC,iEAAuC;AACvC,yDAA+B;AAC/B,wEAA8C;AAC9C,8DAAoC;AACpC,8DAAoC;AACpC,0DAAgC;AAChC,kEAAwC;AACxC,+DAAqC;AACrC,mEAAyC;AACzC,gEAAsC;AACtC,kEAAwC;AACxC,0EAAgD;AAChD,yEAA+C;AAC/C,gEAAsC;AACtC,+DAAqC;AACrC,mEAAyC;AACzC,sEAA4C"}
@@ -1,7 +1,8 @@
1
1
  import { E2eTestRunner, UnitTestRunner } from '../../../utils/test-runners';
2
- import type { AngularLinter, Schema } from '../schema';
2
+ import type { Schema } from '../schema';
3
+ import { Linter } from '@nrwl/linter';
3
4
  export interface NormalizedSchema extends Schema {
4
- linter: AngularLinter;
5
+ linter: Linter;
5
6
  unitTestRunner: UnitTestRunner;
6
7
  e2eTestRunner: E2eTestRunner;
7
8
  prefix: string;
@@ -9,7 +9,8 @@ function addRouterRootConfiguration(host, options) {
9
9
  const moduleSource = host.read(modulePath, 'utf-8');
10
10
  let sourceFile = ts.createSourceFile(modulePath, moduleSource, ts.ScriptTarget.Latest, true);
11
11
  sourceFile = (0, ast_utils_1.insertImport)(host, sourceFile, modulePath, 'RouterModule', '@angular/router');
12
- sourceFile = (0, ast_utils_2.addImportToModule)(host, sourceFile, modulePath, `RouterModule.forRoot([], {initialNavigation: 'enabledBlocking'})`);
12
+ sourceFile = (0, ast_utils_1.insertImport)(host, sourceFile, modulePath, 'appRoutes', './app.routes');
13
+ sourceFile = (0, ast_utils_2.addImportToModule)(host, sourceFile, modulePath, `RouterModule.forRoot(appRoutes, {initialNavigation: 'enabledBlocking'})`);
13
14
  }
14
15
  exports.addRouterRootConfiguration = addRouterRootConfiguration;
15
16
  //# sourceMappingURL=root-router-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"root-router-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/root-router-config.ts"],"names":[],"mappings":";;;AAGA,uEAAuE;AACvE,iCAAiC;AACjC,kEAAuE;AAEvE,SAAgB,0BAA0B,CACxC,IAAU,EACV,OAAyB;IAEzB,MAAM,UAAU,GAAG,GAAG,OAAO,CAAC,cAAc,wBAAwB,CAAC;IACrE,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEpD,IAAI,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAClC,UAAU,EACV,YAAY,EACZ,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IAEF,UAAU,GAAG,IAAA,wBAAY,EACvB,IAAI,EACJ,UAAU,EACV,UAAU,EACV,cAAc,EACd,iBAAiB,CAClB,CAAC;IACF,UAAU,GAAG,IAAA,6BAAiB,EAC5B,IAAI,EACJ,UAAU,EACV,UAAU,EACV,kEAAkE,CACnE,CAAC;AACJ,CAAC;AA3BD,gEA2BC"}
1
+ {"version":3,"file":"root-router-config.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/application/lib/root-router-config.ts"],"names":[],"mappings":";;;AAGA,uEAAuE;AACvE,iCAAiC;AACjC,kEAAuE;AAEvE,SAAgB,0BAA0B,CACxC,IAAU,EACV,OAAyB;IAEzB,MAAM,UAAU,GAAG,GAAG,OAAO,CAAC,cAAc,wBAAwB,CAAC;IACrE,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAEpD,IAAI,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAClC,UAAU,EACV,YAAY,EACZ,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IAEF,UAAU,GAAG,IAAA,wBAAY,EACvB,IAAI,EACJ,UAAU,EACV,UAAU,EACV,cAAc,EACd,iBAAiB,CAClB,CAAC;IACF,UAAU,GAAG,IAAA,wBAAY,EACvB,IAAI,EACJ,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,CACf,CAAC;IACF,UAAU,GAAG,IAAA,6BAAiB,EAC5B,IAAI,EACJ,UAAU,EACV,UAAU,EACV,yEAAyE,CAC1E,CAAC;AACJ,CAAC;AAlCD,gEAkCC"}