@nrwl/angular 14.7.18 → 15.0.0-beta.0

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 (101) 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/fesm2015/nrwl-angular-testing.mjs +1 -19
  6. package/fesm2015/nrwl-angular-testing.mjs.map +1 -1
  7. package/fesm2015/nrwl-angular.mjs +2 -79
  8. package/fesm2015/nrwl-angular.mjs.map +1 -1
  9. package/fesm2020/nrwl-angular-testing.mjs +1 -19
  10. package/fesm2020/nrwl-angular-testing.mjs.map +1 -1
  11. package/fesm2020/nrwl-angular.mjs +2 -79
  12. package/fesm2020/nrwl-angular.mjs.map +1 -1
  13. package/index.d.ts +1 -2
  14. package/index.js +1 -4
  15. package/index.js.map +1 -1
  16. package/migrations.json +6 -0
  17. package/ng-package.json +0 -1
  18. package/package.json +9 -10
  19. package/src/generators/application/application.js +0 -3
  20. package/src/generators/application/application.js.map +1 -1
  21. package/src/generators/application/files/src/app/app.routes.ts__tpl__ +3 -0
  22. package/src/generators/application/lib/convert-to-standalone-app.js +1 -0
  23. package/src/generators/application/lib/convert-to-standalone-app.js.map +1 -1
  24. package/src/generators/application/lib/create-files.d.ts +1 -1
  25. package/src/generators/application/lib/create-files.js +5 -2
  26. package/src/generators/application/lib/create-files.js.map +1 -1
  27. package/src/generators/application/lib/index.d.ts +0 -1
  28. package/src/generators/application/lib/index.js +0 -1
  29. package/src/generators/application/lib/index.js.map +1 -1
  30. package/src/generators/application/lib/normalized-schema.d.ts +3 -2
  31. package/src/generators/application/lib/root-router-config.js +2 -1
  32. package/src/generators/application/lib/root-router-config.js.map +1 -1
  33. package/src/generators/application/schema.d.ts +1 -23
  34. package/src/generators/application/schema.json +0 -30
  35. package/src/generators/host/host.js +4 -16
  36. package/src/generators/host/host.js.map +1 -1
  37. package/src/generators/host/schema.d.ts +1 -3
  38. package/src/generators/init/schema.d.ts +1 -1
  39. package/src/generators/library/lib/add-children.js +9 -14
  40. package/src/generators/library/lib/add-children.js.map +1 -1
  41. package/src/generators/library/lib/add-lazy-loaded-router-configuration.d.ts +1 -1
  42. package/src/generators/library/lib/add-lazy-loaded-router-configuration.js +17 -8
  43. package/src/generators/library/lib/add-lazy-loaded-router-configuration.js.map +1 -1
  44. package/src/generators/library/lib/add-load-children.js +7 -13
  45. package/src/generators/library/lib/add-load-children.js.map +1 -1
  46. package/src/generators/library/lib/add-module.js +2 -2
  47. package/src/generators/library/lib/add-module.js.map +1 -1
  48. package/src/generators/library/lib/add-router-configuration.d.ts +1 -1
  49. package/src/generators/library/lib/add-router-configuration.js +13 -5
  50. package/src/generators/library/lib/add-router-configuration.js.map +1 -1
  51. package/src/generators/library/lib/add-standalone-component.js +4 -4
  52. package/src/generators/library/lib/add-standalone-component.js.map +1 -1
  53. package/src/generators/library/lib/normalized-schema.d.ts +3 -3
  54. package/src/generators/library/schema.d.ts +2 -4
  55. package/src/generators/library/schema.json +2 -3
  56. package/src/generators/ngrx/files/__directory__/__fileName__.effects.spec.ts__tmpl__ +2 -6
  57. package/src/generators/ngrx/files/__directory__/__fileName__.effects.ts__tmpl__ +5 -17
  58. package/src/generators/ngrx/files/__directory__/__fileName__.facade.spec.ts__tmpl__ +0 -2
  59. package/src/generators/ngrx/lib/add-imports-to-module.js +0 -6
  60. package/src/generators/ngrx/lib/add-imports-to-module.js.map +1 -1
  61. package/src/generators/ngrx/schema.d.ts +0 -5
  62. package/src/generators/ngrx/schema.json +0 -6
  63. package/src/generators/remote/schema.d.ts +1 -3
  64. package/src/generators/setup-mf/files/entry-module-files/entry.module.ts__tmpl__ +3 -7
  65. package/src/generators/setup-mf/files/{standalone-entry-component-files/routes.ts__tmpl__ → entry-module-files/entry.routes.ts__tmpl__} +1 -1
  66. package/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +4 -0
  67. package/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +1 -1
  68. package/src/generators/setup-mf/lib/add-remote-entry.js +8 -1
  69. package/src/generators/setup-mf/lib/add-remote-entry.js.map +1 -1
  70. package/src/generators/setup-mf/lib/add-remote-to-host.js +9 -23
  71. package/src/generators/setup-mf/lib/add-remote-to-host.js.map +1 -1
  72. package/src/generators/setup-mf/lib/fix-bootstrap.js +2 -2
  73. package/src/generators/storybook-configuration/schema.d.ts +1 -1
  74. package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.d.ts +2 -0
  75. package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js +94 -0
  76. package/src/migrations/update-15-0-0/switch-to-jasmine-marbles.js.map +1 -0
  77. package/src/runtime/nx/data-persistence.d.ts +4 -46
  78. package/src/runtime/nx/data-persistence.js +1 -57
  79. package/src/runtime/nx/data-persistence.js.map +1 -1
  80. package/src/utils/nx-devkit/ast-utils.d.ts +1 -1
  81. package/src/utils/nx-devkit/ast-utils.js +3 -3
  82. package/src/utils/nx-devkit/ast-utils.js.map +1 -1
  83. package/src/utils/nx-devkit/route-utils.d.ts +2 -0
  84. package/src/utils/nx-devkit/route-utils.js +39 -0
  85. package/src/utils/nx-devkit/route-utils.js.map +1 -0
  86. package/src/utils/versions.d.ts +1 -0
  87. package/src/utils/versions.js +2 -1
  88. package/src/utils/versions.js.map +1 -1
  89. package/testing/index.d.ts +0 -17
  90. package/testing/index.js +1 -18
  91. package/testing/index.js.map +1 -1
  92. package/esm2020/src/runtime/nx/nx.module.mjs +0 -23
  93. package/src/generators/application/lib/add-mf.d.ts +0 -3
  94. package/src/generators/application/lib/add-mf.js +0 -24
  95. package/src/generators/application/lib/add-mf.js.map +0 -1
  96. package/src/runtime/nx/nx.module.d.ts +0 -15
  97. package/src/runtime/nx/nx.module.js +0 -24
  98. package/src/runtime/nx/nx.module.js.map +0 -1
  99. package/src/utils/nx-devkit/standalone-utils.d.ts +0 -2
  100. package/src/utils/nx-devkit/standalone-utils.js +0 -37
  101. package/src/utils/nx-devkit/standalone-utils.js.map +0 -1
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDG;AACG,SAAU,gBAAgB,CAC9B,IAAgC,EAAA;IAEhC,OAAO,CAAC,MAAgC,KAAwB;QAC9D,OAAO,MAAM,CAAC,IAAI,CAChB,iBAAiB,EAAE,EACnB,SAAS,CAAC,oBAAoB,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC,CAC3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,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,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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,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,12 @@
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
+ "switch-to-jasmine-marbles": {
177
+ "cli": "nx",
178
+ "version": "15.0.0-beta.0",
179
+ "description": "Update the usages of @nrwl/angular/testing to import jasmine-marbles symbols from jasmine-marbles itself.",
180
+ "factory": "./src/migrations/update-15-0-0/switch-to-jasmine-marbles"
175
181
  }
176
182
  },
177
183
  "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.7.18",
3
+ "version": "15.0.0-beta.0",
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.7.18",
71
- "@nrwl/devkit": "14.7.18",
72
- "@nrwl/jest": "14.7.18",
73
- "@nrwl/linter": "14.7.18",
74
- "@nrwl/storybook": "14.7.18",
75
- "@nrwl/webpack": "14.7.18",
76
- "@nrwl/workspace": "14.7.18",
70
+ "@nrwl/cypress": "15.0.0-beta.0",
71
+ "@nrwl/devkit": "15.0.0-beta.0",
72
+ "@nrwl/jest": "15.0.0-beta.0",
73
+ "@nrwl/linter": "15.0.0-beta.0",
74
+ "@nrwl/storybook": "15.0.0-beta.0",
75
+ "@nrwl/webpack": "15.0.0-beta.0",
76
+ "@nrwl/workspace": "15.0.0-beta.0",
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": "5025c300b72948081218db474fa9fb5b8f741340"
102
+ "gitHead": "40c8859ff039dcf30a8b55a9abfbbfcb38eb4b88"
104
103
  }
@@ -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":["../../../../../../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EAAE;YAC1B,IAAA,oBAAc,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SAC/B;QAED,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,IAAA,8BAAwB,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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O,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,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[] = [];
@@ -35,6 +35,7 @@ import { RouterModule } 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();
@@ -1 +1 @@
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,w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E,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,EACzB,IAAU,EACV,eAAuB;IAEvB,IAAI,iBAAyB,CAAC;IAC9B,IAAI,OAAO,CAAC,OAAO,EAAE;QACnB,MAAM,iBAAiB,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QAC9D,MAAM,GAAG,GAAG,iBAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;QAE3C,MAAM,sBAAsB,GAC1B,+HAA+H,CAAC;QAClI,MAAM,KAAK,GAAG,IAAA,iBAAO,EAAC,GAAG,EAAE,sBAAsB,EAAE;YACjD,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;QACH,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC,EAAE;YACpB,iBAAiB,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,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C;gDACwC;QAC1C,CAAC,CAAC,EACN;EACA,oBAAoB,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,CAAC;;gCAGrC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,EACvC,KAAK,oBAAoB,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAEhD,IAAI,CAAC,KAAK,CAAC,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,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"}
@@ -2,8 +2,6 @@ import { Linter } from '@nrwl/linter';
2
2
  import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
3
3
  import type { Styles } from '../utils/types';
4
4
 
5
- type AngularLinter = Exclude<Linter, Linter.TsLint>;
6
-
7
5
  export interface Schema {
8
6
  name: string;
9
7
  addTailwind?: boolean;
@@ -17,36 +15,16 @@ export interface Schema {
17
15
  skipTests?: boolean;
18
16
  directory?: string;
19
17
  tags?: string;
20
- linter?: AngularLinter;
18
+ linter?: Linter;
21
19
  unitTestRunner?: UnitTestRunner;
22
20
  e2eTestRunner?: E2eTestRunner;
23
21
  backendProject?: string;
24
22
  strict?: boolean;
25
23
  standaloneConfig?: boolean;
26
- /**
27
- * @deprecated Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version.
28
- */
29
- mf?: boolean;
30
- /**
31
- * @deprecated Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version.
32
- */
33
- mfType?: 'host' | 'remote';
34
- /**
35
- * @deprecated Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version.
36
- */
37
- remotes?: string[];
38
24
  port?: number;
39
- /**
40
- * @deprecated Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version.
41
- */
42
- host?: string;
43
25
  setParserOptionsProject?: boolean;
44
26
  skipPackageJson?: boolean;
45
27
  skipPostInstall?: boolean;
46
- /**
47
- * @deprecated Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version.
48
- */
49
- federationType?: 'static' | 'dynamic';
50
28
  skipDefaultProject?: boolean;
51
29
  standalone?: boolean;
52
30
  }
@@ -133,40 +133,10 @@
133
133
  "description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
134
134
  "type": "boolean"
135
135
  },
136
- "mf": {
137
- "description": "Generate a Module Federation configuration for the application",
138
- "type": "boolean",
139
- "default": false,
140
- "x-deprecated": "Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version."
141
- },
142
- "mfType": {
143
- "type": "string",
144
- "enum": ["host", "remote"],
145
- "description": "Type of application to generate the Module Federation configuration for.",
146
- "default": "remote",
147
- "x-deprecated": "Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version."
148
- },
149
- "federationType": {
150
- "type": "string",
151
- "enum": ["static", "dynamic"],
152
- "description": "Use either Static or Dynamic Module Federation pattern for the application.",
153
- "default": "static",
154
- "x-deprecated": "Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version."
155
- },
156
136
  "port": {
157
137
  "type": "number",
158
138
  "description": "The port at which the remote application should be served."
159
139
  },
160
- "remotes": {
161
- "type": "array",
162
- "description": "A list of remote application names that the host application should consume.",
163
- "x-deprecated": "Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version."
164
- },
165
- "host": {
166
- "type": "string",
167
- "description": "The name of the host application that the remote application will be consumed by.",
168
- "x-deprecated": "Use the `host` or `remote` generators instead. Support for generating Module Federation applications using the application generator will be removed in an upcoming version."
169
- },
170
140
  "setParserOptionsProject": {
171
141
  "type": "boolean",
172
142
  "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
@@ -6,8 +6,7 @@ const application_1 = require("../application/application");
6
6
  const remote_1 = require("../remote/remote");
7
7
  const project_1 = require("../utils/project");
8
8
  const ts = require("typescript");
9
- const ast_utils_1 = require("../../utils/nx-devkit/ast-utils");
10
- const standalone_utils_1 = require("../../utils/nx-devkit/standalone-utils");
9
+ const route_utils_1 = require("../../utils/nx-devkit/route-utils");
11
10
  const setup_mf_1 = require("../setup-mf/setup-mf");
12
11
  const test_runners_1 = require("../../utils/test-runners");
13
12
  function host(tree, options) {
@@ -62,26 +61,15 @@ ${remoteRoutes}
62
61
  </ul>
63
62
  <router-outlet></router-outlet>
64
63
  `);
65
- const pathToHostRootRoutingFile = (0, devkit_1.joinPathFragments)(sourceRoot, options.standalone ? 'bootstrap.ts' : 'app/app.module.ts');
64
+ const pathToHostRootRoutingFile = (0, devkit_1.joinPathFragments)(sourceRoot, 'app/app.routes.ts');
66
65
  const hostRootRoutingFile = tree.read(pathToHostRootRoutingFile, 'utf-8');
67
- if (!hostRootRoutingFile.includes('RouterModule.forRoot(')) {
68
- return;
69
- }
70
66
  let sourceFile = ts.createSourceFile(pathToHostRootRoutingFile, hostRootRoutingFile, ts.ScriptTarget.Latest, true);
71
- if (hostRootRoutingFile.includes('@NgModule')) {
72
- sourceFile = (0, ast_utils_1.addRoute)(tree, pathToHostRootRoutingFile, sourceFile, `{
73
- path: '',
74
- component: NxWelcomeComponent
75
- }`);
76
- }
77
- else {
78
- (0, standalone_utils_1.addStandaloneRoute)(tree, pathToHostRootRoutingFile, `{
67
+ (0, route_utils_1.addRoute)(tree, pathToHostRootRoutingFile, `{
79
68
  path: '',
80
69
  component: NxWelcomeComponent
81
70
  }`);
82
- tree.write(pathToHostRootRoutingFile, `import { NxWelcomeComponent } from './app/nx-welcome.component';
71
+ tree.write(pathToHostRootRoutingFile, `import { NxWelcomeComponent } from './nx-welcome.component';
83
72
  ${tree.read(pathToHostRootRoutingFile, 'utf-8')}`);
84
- }
85
73
  (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), (0, devkit_1.joinPathFragments)(sourceRoot, 'app'), {
86
74
  appName: (0, project_1.normalizeProjectName)(options.name, options.directory),
87
75
  tmpl: '',
@@ -1 +1 @@
1
- {"version":3,"file":"host.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/host/host.ts"],"names":[],"mappings":";;;AAAA,yCAQsB;AAEtB,4DAA8D;AAC9D,6CAA+C;AAC/C,8CA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AiB,EAAC,UAAU,EAAE,wBAAwB,CAAC,EACvD;;EAEF,YAAY;;;CAGb,CACE,CAAC;IAEF,MAAM,yBAAyB,GAAG,IAAA,0BAAiB,EACjD,UAAU,EACV,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,mBAAmB,CAC1D,CAAC;IACF,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAE1E,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAAE;QAC1D,OAAO;KACR;IAED,IAAI,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAClC,yBAAyB,EACzB,mBAAmB,EACnB,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IAEF,IAAI,mBAAmB,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QAC7C,UAAU,GAAG,IAAA,oBAAQ,EACnB,IAAI,EACJ,yBAAyB,EACzB,UAAU,EACV;;;OAGC,CACF,CAAC;KACH;SAAM;QACL,IAAA,qCAAkB,EAChB,IAAI,EACJ,yBAAyB,EACzB;;;MAGA,CACD,CAAC;QAEF,IAAI,CAAC,KAAK,CACR,yBAAyB,EACzB;MACA,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,OAAO,CAAC,EAAE,CAChD,CAAC;KACH;IAED,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EACrC,IAAA,0BAAiB,EAAC,UAAU,EAAE,KAAK,CAAC,EACpC;QACE,OAAO,EAAE,IAAA,8BAAoB,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC;QAC9D,IAAI,EAAE,EAAE;KACT,CACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"host.js","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/host/host.ts"],"names":[],"mappings":";;;A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C;IAET,IAAI,CAAC,KAAK,CACR,IAAA,0BAAiB,EAAC,UAAU,EAAE,wBAAwB,CAAC,EACvD;;EAEF,YAAY;;;CAGb,CACE,CAAC;IAEF,MAAM,yBAAyB,GAAG,IAAA,0BAAiB,EACjD,UAAU,EACV,mBAAmB,CACpB,CAAC;IAEF,MAAM,mBAAmB,GAAG,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAE1E,IAAI,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAClC,yBAAyB,EACzB,mBAAmB,EACnB,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IAEF,IAAA,sBAAQ,EACN,IAAI,EACJ,yBAAyB,EACzB;;;MAGE,CACH,CAAC;IAEF,IAAI,CAAC,KAAK,CACR,yBAAyB,EACzB;MACE,IAAI,CAAC,IAAI,CAAC,yBAAyB,EAAE,OAAO,CAAC,EAAE,CAClD,CAAC;IAEF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EACrC,IAAA,0BAAiB,EAAC,UAAU,EAAE,KAAK,CAAC,EACpC;QACE,OAAO,EAAE,IAAA,8BAAoB,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,SAAS,CAAC;QAC9D,IAAI,EAAE,EAAE;KACT,CACF,CAAC;AACJ,CAAC"}
@@ -2,8 +2,6 @@ import { Linter } from '@nrwl/linter';
2
2
  import { E2eTestRunner, UnitTestRunner } from '../../utils/test-runners';
3
3
  import type { Styles } from '../utils/types';
4
4
 
5
- type AngularLinter = Exclude<Linter, Linter.TsLint>;
6
-
7
5
  export interface Schema {
8
6
  name: string;
9
7
  remotes?: string[];
@@ -17,7 +15,7 @@ export interface Schema {
17
15
  skipTests?: boolean;
18
16
  directory?: string;
19
17
  tags?: string;
20
- linter?: AngularLinter;
18
+ linter?: Linter;
21
19
  unitTestRunner?: UnitTestRunner;
22
20
  e2eTestRunner?: E2eTestRunner;
23
21
  backendProject?: string;
@@ -8,7 +8,7 @@ export interface Schema {
8
8
  skipFormat?: boolean;
9
9
  skipInstall?: boolean;
10
10
  style?: Styles;
11
- linter?: Exclude<Linter, Linter.TsLint>;
11
+ linter?: Linter;
12
12
  skipPackageJson?: boolean;
13
13
  skipPostInstall?: boolean;
14
14
  }
@@ -5,28 +5,23 @@ const devkit_1 = require("@nrwl/devkit");
5
5
  const ast_utils_1 = require("@nrwl/workspace/src/utilities/ast-utils");
6
6
  const ts = require("typescript");
7
7
  const ast_utils_2 = require("../../../utils/nx-devkit/ast-utils");
8
- const standalone_utils_1 = require("../../../utils/nx-devkit/standalone-utils");
8
+ const route_utils_1 = require("../../../utils/nx-devkit/route-utils");
9
9
  function addChildren(tree, options) {
10
- if (!tree.exists(options.parentModule)) {
11
- throw new Error(`Cannot find '${options.parentModule}'`);
10
+ if (!tree.exists(options.parent)) {
11
+ throw new Error(`Cannot find '${options.parent}'`);
12
12
  }
13
- const moduleSource = tree.read(options.parentModule, 'utf-8');
13
+ const routeFileSource = tree.read(options.parent, 'utf-8');
14
14
  const constName = options.standalone
15
- ? `${(0, devkit_1.names)(options.name).className.toUpperCase()}_ROUTES`
15
+ ? `${(0, devkit_1.names)(options.name).propertyName}Routes`
16
16
  : `${(0, devkit_1.names)(options.fileName).propertyName}Routes`;
17
17
  const importPath = options.importPath;
18
- let sourceFile = ts.createSourceFile(options.parentModule, moduleSource, ts.ScriptTarget.Latest, true);
18
+ let sourceFile = ts.createSourceFile(options.parent, routeFileSource, ts.ScriptTarget.Latest, true);
19
19
  if (!options.standalone) {
20
- sourceFile = (0, ast_utils_2.addImportToModule)(tree, sourceFile, options.parentModule, options.moduleName);
20
+ sourceFile = (0, ast_utils_2.addImportToModule)(tree, sourceFile, options.parent, options.moduleName);
21
21
  }
22
- sourceFile = (0, ast_utils_1.insertImport)(tree, sourceFile, options.parentModule, options.standalone ? constName : `${options.moduleName}, ${constName}`, importPath);
22
+ sourceFile = (0, ast_utils_1.insertImport)(tree, sourceFile, options.parent, options.standalone ? constName : `${options.moduleName}, ${constName}`, importPath);
23
23
  const route = `{ path: '${(0, devkit_1.names)(options.fileName).fileName}', children: ${constName} }`;
24
- if (moduleSource.includes('@NgModule')) {
25
- sourceFile = (0, ast_utils_2.addRoute)(tree, options.parentModule, sourceFile, route);
26
- }
27
- else {
28
- (0, standalone_utils_1.addStandaloneRoute)(tree, options.parentModule, route, false, constName, importPath);
29
- }
24
+ (0, route_utils_1.addRoute)(tree, options.parent, route, false, constName, importPath);
30
25
  }
31
26
  exports.addChildren = addChildren;
32
27
  //# sourceMappingURL=add-children.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"add-children.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/library/lib/add-children.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,uEAAuE;AACvE,iCAAiC;AACjC,kEAG4C;AAE5C,gFAA+E;AAE/E,SAAgB,WAAW,CACzB,IAAU,EACV,OAA2C;IAE3C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,EAAE;QACtC,MAAM,IAAI,KAAK,CAAC,gBAAgB,OAAO,CAAC,YAAY,GAAG,CAAC,CAAC;KAC1D;IAED,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC9D,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU;QAClC,CAAC,CAAC,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,SAAS,CAAC,WAAW,EAAE,SAAS;QACzD,CAAC,CAAC,GAAG,IAAA,cAAK,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,YAAY,QAAQ,CAAC;IACpD,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC;IACtC,IAAI,UAAU,GAAG,EAAE,CAAC,gBAAgB,CAClC,OAAO,CAAC,YAAY,EACpB,YAAY,EACZ,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IAEF,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;QACvB,UAAU,GAAG,IAAA,6BAAiB,EAC5B,IAAI,EACJ,UAAU,EACV,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,UAAU,CACnB,CAAC;KACH;IAED,UAAU,GAAG,IAAA,wBAAY,EACvB,IAAI,EACJ,UAAU,EACV,OAAO,CAAC,YAAY,EACpB,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,UAAU,KAAK,SAAS,EAAE,EACtE,UAAU,CACX,CAAC;IAEF,MAAM,KAAK,GAAG,YACZ,IAAA,cAAK,EAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,QAC1B,gBAAgB,SAAS,IAAI,CAAC;IAE9B,IAAI,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC,EAAE;QACtC,UAAU,GAAG,IAAA,oBAAQ,EAAC,IAAI,EAAE,OAAO,CAAC,YAAY,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;KACtE;SAAM;QACL,IAAA,qCAAkB,EAChB,IAAI,EACJ,OAAO,CAAC,YAAY,EACpB,KAAK,EACL,KAAK,EACL,SAAS,EACT,UAAU,CACX,CAAC;KACH;AACH,CAAC;AArDD,kCAqDC"}
1
+ {"version":3,"file":"add-children.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/library/lib/add-children.ts"],"names":[],"mappings":";;;AAAA,yCAA2C;AAC3C,uEAAuE;AACvE,iCAAiC;AACjC,kEAAuE;AAEvE,sEAAgE;AAEhE,SAAgB,WAAW,CACzB,IAAU,EACV,OAA2C;IAE3C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAChC,MAAM,IAAI,KAAK,CAAC,gBAAgB,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;KACp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figuration(host: Tree, options: NormalizedSchema['libraryOptions']): void;
3
+ export declare function addLazyLoadedRouterConfiguration(tree: Tree, options: NormalizedSchema['libraryOptions']): void;
@@ -1,17 +1,26 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addLazyLoadedRouterConfiguration = void 0;
4
+ const devkit_1 = require("@nrwl/devkit");
4
5
  const ast_utils_1 = require("@nrwl/workspace/src/utilities/ast-utils");
5
6
  const ts = require("typescript");
6
7
  const ast_utils_2 = require("../../../utils/nx-devkit/ast-utils");
7
- function addLazyLoadedRouterConfiguration(host, options) {
8
- const moduleSource = host.read(options.modulePath).toString('utf-8');
9
- let sourceFile = ts.createSourceFile(options.modulePath, moduleSource, ts.ScriptTarget.Latest, true);
10
- sourceFile = (0, ast_utils_2.addImportToModule)(host, sourceFile, options.modulePath, `
11
- RouterModule.forChild([
12
- /* {path: '', pathMatch: 'full', component: InsertYourComponentHere} */
13
- ]) `);
14
- sourceFile = (0, ast_utils_1.insertImport)(host, sourceFile, options.modulePath, 'RouterModule', '@angular/router');
8
+ const path_1 = require("path");
9
+ function addLazyLoadedRouterConfiguration(tree, options) {
10
+ const constName = `${(0, devkit_1.names)(options.fileName).propertyName}Routes`;
11
+ tree.write((0, devkit_1.joinPathFragments)((0, path_1.dirname)(options.modulePath), 'lib.routes.ts'), `import { Route } from '@angular/router';
12
+
13
+ export const ${constName}: Route[] = [/* {path: '', pathMatch: 'full', component: InsertYourComponentHere} */];`);
14
+ const routeFileSource = tree.read(options.modulePath, 'utf-8');
15
+ let sourceFile = ts.createSourceFile(options.modulePath, routeFileSource, ts.ScriptTarget.Latest, true);
16
+ sourceFile = (0, ast_utils_2.addImportToModule)(tree, sourceFile, options.modulePath, `
17
+ RouterModule.forChild(${constName}) `);
18
+ sourceFile = (0, ast_utils_1.insertImport)(tree, sourceFile, options.modulePath, 'RouterModule', '@angular/router');
19
+ sourceFile = (0, ast_utils_1.insertImport)(tree, sourceFile, options.modulePath, constName, './lib.routes');
20
+ const pathToIndex = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src/index.ts');
21
+ const indexFileContents = tree.read(pathToIndex, 'utf-8');
22
+ tree.write(pathToIndex, `${indexFileContents}
23
+ export * from './lib/lib.routes';`);
15
24
  }
16
25
  exports.addLazyLoadedRouterConfiguration = addLazyLoadedRouterConfiguration;
17
26
  //# sourceMappingURL=add-lazy-loaded-router-configuration.js.map