@ngrx/store-devtools 18.0.1 → 18.1.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 (42) hide show
  1. package/esm2022/src/devtools-dispatcher.mjs +3 -3
  2. package/esm2022/src/devtools.mjs +3 -3
  3. package/esm2022/src/extension.mjs +3 -3
  4. package/esm2022/src/instrument.mjs +4 -4
  5. package/fesm2022/ngrx-store-devtools.mjs +13 -13
  6. package/migrations/17_0_0-beta/index.js +1 -1
  7. package/migrations/17_0_0-beta/index.js.map +1 -1
  8. package/migrations/6_0_0/index.js +1 -1
  9. package/migrations/6_0_0/index.js.map +1 -1
  10. package/package.json +4 -2
  11. package/schematics/ng-add/index.js +1 -1
  12. package/schematics/ng-add/index.js.map +1 -1
  13. package/schematics-core/utility/ast-utils.js +14 -15
  14. package/schematics-core/utility/ast-utils.js.map +1 -1
  15. package/schematics-core/utility/change.js +5 -5
  16. package/schematics-core/utility/change.js.map +1 -1
  17. package/schematics-core/utility/config.js +2 -3
  18. package/schematics-core/utility/config.js.map +1 -1
  19. package/schematics-core/utility/find-component.js +3 -4
  20. package/schematics-core/utility/find-component.js.map +1 -1
  21. package/schematics-core/utility/find-module.js +3 -4
  22. package/schematics-core/utility/find-module.js.map +1 -1
  23. package/schematics-core/utility/json-utilts.js +1 -2
  24. package/schematics-core/utility/json-utilts.js.map +1 -1
  25. package/schematics-core/utility/libs-version.js +1 -1
  26. package/schematics-core/utility/libs-version.js.map +1 -1
  27. package/schematics-core/utility/ngrx-utils.js +6 -7
  28. package/schematics-core/utility/ngrx-utils.js.map +1 -1
  29. package/schematics-core/utility/package.js +1 -2
  30. package/schematics-core/utility/package.js.map +1 -1
  31. package/schematics-core/utility/parse-name.js +1 -2
  32. package/schematics-core/utility/parse-name.js.map +1 -1
  33. package/schematics-core/utility/project.js +4 -5
  34. package/schematics-core/utility/project.js.map +1 -1
  35. package/schematics-core/utility/standalone.js +3 -4
  36. package/schematics-core/utility/standalone.js.map +1 -1
  37. package/schematics-core/utility/strings.js +9 -10
  38. package/schematics-core/utility/strings.js.map +1 -1
  39. package/schematics-core/utility/update.js +1 -2
  40. package/schematics-core/utility/update.js.map +1 -1
  41. package/schematics-core/utility/visitors.js +7 -8
  42. package/schematics-core/utility/visitors.js.map +1 -1
@@ -2,10 +2,10 @@ import { ActionsSubject } from '@ngrx/store';
2
2
  import { Injectable } from '@angular/core';
3
3
  import * as i0 from "@angular/core";
4
4
  export class DevtoolsDispatcher extends ActionsSubject {
5
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsDispatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsDispatcher }); }
5
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsDispatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
6
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsDispatcher }); }
7
7
  }
8
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsDispatcher, decorators: [{
8
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsDispatcher, decorators: [{
9
9
  type: Injectable
10
10
  }] });
11
11
  //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGV2dG9vbHMtZGlzcGF0Y2hlci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL21vZHVsZXMvc3RvcmUtZGV2dG9vbHMvc3JjL2RldnRvb2xzLWRpc3BhdGNoZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGNBQWMsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUM3QyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sZUFBZSxDQUFDOztBQUczQyxNQUFNLE9BQU8sa0JBQW1CLFNBQVEsY0FBYztpSUFBekMsa0JBQWtCO3FJQUFsQixrQkFBa0I7OzJGQUFsQixrQkFBa0I7a0JBRDlCLFVBQVUiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBBY3Rpb25zU3ViamVjdCB9IGZyb20gJ0BuZ3J4L3N0b3JlJztcbmltcG9ydCB7IEluamVjdGFibGUgfSBmcm9tICdAYW5ndWxhci9jb3JlJztcblxuQEluamVjdGFibGUoKVxuZXhwb3J0IGNsYXNzIERldnRvb2xzRGlzcGF0Y2hlciBleHRlbmRzIEFjdGlvbnNTdWJqZWN0IHt9XG4iXX0=
@@ -115,10 +115,10 @@ export class StoreDevtools {
115
115
  pauseRecording(status) {
116
116
  this.dispatch(new Actions.PauseRecording(status));
117
117
  }
118
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtools, deps: [{ token: i1.DevtoolsDispatcher }, { token: i2.ActionsSubject }, { token: i2.ReducerObservable }, { token: i3.DevtoolsExtension }, { token: i2.ScannedActionsSubject }, { token: i0.ErrorHandler }, { token: INITIAL_STATE }, { token: STORE_DEVTOOLS_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
119
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtools }); }
118
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtools, deps: [{ token: i1.DevtoolsDispatcher }, { token: i2.ActionsSubject }, { token: i2.ReducerObservable }, { token: i3.DevtoolsExtension }, { token: i2.ScannedActionsSubject }, { token: i0.ErrorHandler }, { token: INITIAL_STATE }, { token: STORE_DEVTOOLS_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
119
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtools }); }
120
120
  }
121
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtools, decorators: [{
121
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtools, decorators: [{
122
122
  type: Injectable
123
123
  }], ctorParameters: () => [{ type: i1.DevtoolsDispatcher }, { type: i2.ActionsSubject }, { type: i2.ReducerObservable }, { type: i3.DevtoolsExtension }, { type: i2.ScannedActionsSubject }, { type: i0.ErrorHandler }, { type: undefined, decorators: [{
124
124
  type: Inject,
@@ -157,10 +157,10 @@ export class DevtoolsExtension {
157
157
  console.warn('@ngrx/store-devtools: something went wrong inside the redux devtools', err);
158
158
  }
159
159
  }
160
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsExtension, deps: [{ token: REDUX_DEVTOOLS_EXTENSION }, { token: STORE_DEVTOOLS_CONFIG }, { token: i1.DevtoolsDispatcher }], target: i0.ɵɵFactoryTarget.Injectable }); }
161
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsExtension }); }
160
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsExtension, deps: [{ token: REDUX_DEVTOOLS_EXTENSION }, { token: STORE_DEVTOOLS_CONFIG }, { token: i1.DevtoolsDispatcher }], target: i0.ɵɵFactoryTarget.Injectable }); }
161
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsExtension }); }
162
162
  }
163
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsExtension, decorators: [{
163
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsExtension, decorators: [{
164
164
  type: Injectable
165
165
  }], ctorParameters: () => [{ type: undefined, decorators: [{
166
166
  type: Inject,
@@ -11,11 +11,11 @@ export class StoreDevtoolsModule {
11
11
  providers: [provideStoreDevtools(options)],
12
12
  };
13
13
  }
14
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
15
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtoolsModule }); }
16
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtoolsModule }); }
14
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
15
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtoolsModule }); }
16
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtoolsModule }); }
17
17
  }
18
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtoolsModule, decorators: [{
18
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtoolsModule, decorators: [{
19
19
  type: NgModule,
20
20
  args: [{}]
21
21
  }] });
@@ -290,10 +290,10 @@ function injectZoneConfig(connectInZone) {
290
290
  }
291
291
 
292
292
  class DevtoolsDispatcher extends ActionsSubject {
293
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsDispatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
294
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsDispatcher }); }
293
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsDispatcher, deps: null, target: i0.ɵɵFactoryTarget.Injectable }); }
294
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsDispatcher }); }
295
295
  }
296
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsDispatcher, decorators: [{
296
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsDispatcher, decorators: [{
297
297
  type: Injectable
298
298
  }] });
299
299
 
@@ -445,10 +445,10 @@ class DevtoolsExtension {
445
445
  console.warn('@ngrx/store-devtools: something went wrong inside the redux devtools', err);
446
446
  }
447
447
  }
448
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsExtension, deps: [{ token: REDUX_DEVTOOLS_EXTENSION }, { token: STORE_DEVTOOLS_CONFIG }, { token: DevtoolsDispatcher }], target: i0.ɵɵFactoryTarget.Injectable }); }
449
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsExtension }); }
448
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsExtension, deps: [{ token: REDUX_DEVTOOLS_EXTENSION }, { token: STORE_DEVTOOLS_CONFIG }, { token: DevtoolsDispatcher }], target: i0.ɵɵFactoryTarget.Injectable }); }
449
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsExtension }); }
450
450
  }
451
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: DevtoolsExtension, decorators: [{
451
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: DevtoolsExtension, decorators: [{
452
452
  type: Injectable
453
453
  }], ctorParameters: () => [{ type: undefined, decorators: [{
454
454
  type: Inject,
@@ -923,10 +923,10 @@ class StoreDevtools {
923
923
  pauseRecording(status) {
924
924
  this.dispatch(new PauseRecording(status));
925
925
  }
926
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtools, deps: [{ token: DevtoolsDispatcher }, { token: i2.ActionsSubject }, { token: i2.ReducerObservable }, { token: DevtoolsExtension }, { token: i2.ScannedActionsSubject }, { token: i0.ErrorHandler }, { token: INITIAL_STATE }, { token: STORE_DEVTOOLS_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
927
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtools }); }
926
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtools, deps: [{ token: DevtoolsDispatcher }, { token: i2.ActionsSubject }, { token: i2.ReducerObservable }, { token: DevtoolsExtension }, { token: i2.ScannedActionsSubject }, { token: i0.ErrorHandler }, { token: INITIAL_STATE }, { token: STORE_DEVTOOLS_CONFIG }], target: i0.ɵɵFactoryTarget.Injectable }); }
927
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtools }); }
928
928
  }
929
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtools, decorators: [{
929
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtools, decorators: [{
930
930
  type: Injectable
931
931
  }], ctorParameters: () => [{ type: DevtoolsDispatcher }, { type: i2.ActionsSubject }, { type: i2.ReducerObservable }, { type: DevtoolsExtension }, { type: i2.ScannedActionsSubject }, { type: i0.ErrorHandler }, { type: undefined, decorators: [{
932
932
  type: Inject,
@@ -1024,11 +1024,11 @@ class StoreDevtoolsModule {
1024
1024
  providers: [provideStoreDevtools(options)],
1025
1025
  };
1026
1026
  }
1027
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1028
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtoolsModule }); }
1029
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtoolsModule }); }
1027
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1028
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtoolsModule }); }
1029
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtoolsModule }); }
1030
1030
  }
1031
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: StoreDevtoolsModule, decorators: [{
1031
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.5", ngImport: i0, type: StoreDevtoolsModule, decorators: [{
1032
1032
  type: NgModule,
1033
1033
  args: [{}]
1034
1034
  }] });
@@ -25,6 +25,7 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
25
25
  return to.concat(ar || Array.prototype.slice.call(from));
26
26
  };
27
27
  Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.default = default_1;
28
29
  var ts = require("typescript");
29
30
  var schematics_1 = require("@angular-devkit/schematics");
30
31
  var schematics_core_1 = require("../..//schematics-core");
@@ -130,5 +131,4 @@ function createDevtoolsConfig(sourceFile, callExpression, addChange) {
130
131
  function default_1() {
131
132
  return (0, schematics_1.chain)([migrate()]);
132
133
  }
133
- exports.default = default_1;
134
134
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/migrations/17_0_0-beta/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiC;AACjC,yDAA+D;AAC/D,0DAMgC;AAEhC,SAAS,OAAO;IACd,OAAO,UAAC,IAAU;QAChB,IAAA,oCAAkB,EAAC,IAAI,EAAE,UAAC,UAAU;YAClC,IAAM,eA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CACF,CAAC;QACF,SAAS,CACP,IAAA,qCAAmB,EACjB,UAAU,EACV,kBAAkB,CAAC,WAAW,EAC9B,YAAY,EACZ,YAAY,KAAK,MAAM;YACrB,CAAC,CAAC,OAAO;YACT,CAAC,CAAC,YAAY,KAAK,OAAO;gBAC1B,CAAC,CAAC,MAAM;gBACR,CAAC,CAAC,WAAI,YAAY,CAAE,CACvB,CACF,CAAC;IACJ,CAAC;AACH,CAAC;AAED,SAAS,oBAAoB,CAC3B,UAAyB,EACzB,cAAiC,EACjC,SAAyC;IAEzC,SAAS,CACP,IAAI,8BAAY,CACd,UAAU,CAAC,QAAQ,EACnB,cAAc,CAAC,MAAM,EAAE,GAAG,CAAC,EAC3B,uBAAuB,CACxB,CACF,CAAC;AACJ,CAAC;AAED;IACE,OAAO,IAAA,kBAAK,EAAC,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;AAC5B,CAAC;AAFD,4BAEC","sourcesContent":["import * as ts from 'typescript';\nimport { Rule, chain, Tree } from '@angular-devkit/schematics';\nimport {\n visitTSSourceFiles,\n commitChanges,\n InsertChange,\n Change,\n createReplaceChange,\n} from '../..//schematics-core';\n\nfunction migrate() {\n return (tree: Tree) => {\n visitTSSourceFiles(tree, (sourceFile) => {\n const devtoolsImports = sourceFile.statements\n .filter(ts.isImportDeclaration)\n .filter(({ moduleSpecifier }) =>\n moduleSpecifier.getText(sourceFile).includes('@ngrx/store-devtools')\n );\n\n if (devtoolsImports.length === 0) {\n return;\n }\n\n const changes = [...findAndUpdateConfigs(sourceFile)];\n\n commitChanges(tree, sourceFile.fileName, changes);\n });\n };\n}\n\nfunction findAndUpdateConfigs(sourceFile: ts.SourceFile) {\n const changes: Change[] = [];\n ts.forEachChild(sourceFile, (node) => find(node, changes));\n return changes;\n\n function find(node: ts.Node, changes: Change[]) {\n if (\n ts.isPropertyAccessExpression(node) &&\n node.name.text === 'instrument' &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === 'StoreDevtoolsModule' &&\n ts.isCallExpression(node.parent)\n ) {\n if (node.parent.arguments.length) {\n const [devtoolsConfig] = node.parent.arguments;\n\n if (ts.isObjectLiteralExpression(devtoolsConfig)) {\n updateConfig(sourceFile, devtoolsConfig, (change) =>\n changes.push(change)\n );\n }\n } else {\n createDevtoolsConfig(sourceFile, node.parent, (change) =>\n changes.push(change)\n );\n }\n }\n\n if (\n ts.isCallExpression(node) &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === 'provideStoreDevtools'\n ) {\n if (node.arguments.length) {\n const [devtoolsConfig] = node.arguments;\n\n if (ts.isObjectLiteralExpression(devtoolsConfig)) {\n updateConfig(sourceFile, devtoolsConfig, (change) =>\n changes.push(change)\n );\n }\n } else {\n createDevtoolsConfig(sourceFile, node, (change) =>\n changes.push(change)\n );\n }\n }\n\n ts.forEachChild(node, (childNode) => find(childNode, changes));\n }\n}\n\nfunction updateConfig(\n sourceFile: ts.SourceFile,\n devtoolsConfig: ts.ObjectLiteralExpression,\n addChange: (changes: Change) => number\n) {\n const connectOutsideZoneProperty = devtoolsConfig.properties.find(\n (p) =>\n ts.isPropertyAssignment(p) &&\n ts.isIdentifier(p.name) &&\n p.name.text === 'connectOutsideZone'\n );\n\n if (!connectOutsideZoneProperty) {\n addConnectInZoneProperty();\n } else if (ts.isPropertyAssignment(connectOutsideZoneProperty)) {\n replaceConnectOutsideZoneConfig(connectOutsideZoneProperty);\n }\n\n function addConnectInZoneProperty() {\n const configText = devtoolsConfig.getText(sourceFile);\n const comma =\n !devtoolsConfig.properties.length ||\n configText\n .substring(0, configText.length - 1)\n .trim()\n .endsWith(',')\n ? ''\n : ',';\n\n addChange(\n new InsertChange(\n sourceFile.fileName,\n devtoolsConfig.getEnd() - 1,\n `${comma} connectInZone: true`.trim()\n )\n );\n }\n\n function replaceConnectOutsideZoneConfig(\n connectOutsideZone: ts.PropertyAssignment\n ) {\n const currentValue = connectOutsideZone.initializer\n .getText(sourceFile)\n .trim();\n addChange(\n createReplaceChange(\n sourceFile,\n connectOutsideZone.name,\n 'connectOutsideZone',\n 'connectInZone'\n )\n );\n addChange(\n createReplaceChange(\n sourceFile,\n connectOutsideZone.initializer,\n currentValue,\n currentValue === 'true'\n ? 'false'\n : currentValue === 'false'\n ? 'true'\n : `!${currentValue}`\n )\n );\n }\n}\n\nfunction createDevtoolsConfig(\n sourceFile: ts.SourceFile,\n callExpression: ts.CallExpression,\n addChange: (...items: Change[]) => number\n) {\n addChange(\n new InsertChange(\n sourceFile.fileName,\n callExpression.getEnd() - 1,\n `{connectInZone: true}`\n )\n );\n}\n\nexport default function (): Rule {\n return chain([migrate()]);\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/migrations/17_0_0-beta/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAmKA,4BAEC;AArKD,+BAAiC;AACjC,yDAA+D;AAC/D,0DAMgC;AAEhC,SAAS,OAAO;IACd,OAAO,UAAC,IAAU;QAChB,IAAA,oCAAkB,EAAC,IAAI,EAAE,UAAC,UAAU;YAClC,IAAM,eAAe,GAAG,UAAU,CAAC,UAAU;iBAC1C,MAAM,CAAC,EAAE,CAAC,mBAAmB,CAAC;iBAC9B,MAAM,CAAC,UAAC,EAAmB;oBAAjB,eAAe,qBAAA;gBACxB,OAAA,eAAe,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,QAAQ,CAAC,sBAAsB,CAAC;YAApE,CAAoE,CACrE,CAAC;YAEJ,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBACjC,OAAO;YACT,CAAC;YAED,IAAM,OAAO,4BAAO,oBAAoB,CAAC,UAAU,CAAC,SAAC,CAAC;YAEtD,IAAA,+BAAa,EAAC,IAAI,EAAE,UAAU,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;QACpD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED,SAAS,oBAAoB,CAAC,UAAyB;IACrD,IAAM,O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C","sourcesContent":["import * as ts from 'typescript';\nimport { Rule, chain, Tree } from '@angular-devkit/schematics';\nimport {\n visitTSSourceFiles,\n commitChanges,\n InsertChange,\n Change,\n createReplaceChange,\n} from '../..//schematics-core';\n\nfunction migrate() {\n return (tree: Tree) => {\n visitTSSourceFiles(tree, (sourceFile) => {\n const devtoolsImports = sourceFile.statements\n .filter(ts.isImportDeclaration)\n .filter(({ moduleSpecifier }) =>\n moduleSpecifier.getText(sourceFile).includes('@ngrx/store-devtools')\n );\n\n if (devtoolsImports.length === 0) {\n return;\n }\n\n const changes = [...findAndUpdateConfigs(sourceFile)];\n\n commitChanges(tree, sourceFile.fileName, changes);\n });\n };\n}\n\nfunction findAndUpdateConfigs(sourceFile: ts.SourceFile) {\n const changes: Change[] = [];\n ts.forEachChild(sourceFile, (node) => find(node, changes));\n return changes;\n\n function find(node: ts.Node, changes: Change[]) {\n if (\n ts.isPropertyAccessExpression(node) &&\n node.name.text === 'instrument' &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === 'StoreDevtoolsModule' &&\n ts.isCallExpression(node.parent)\n ) {\n if (node.parent.arguments.length) {\n const [devtoolsConfig] = node.parent.arguments;\n\n if (ts.isObjectLiteralExpression(devtoolsConfig)) {\n updateConfig(sourceFile, devtoolsConfig, (change) =>\n changes.push(change)\n );\n }\n } else {\n createDevtoolsConfig(sourceFile, node.parent, (change) =>\n changes.push(change)\n );\n }\n }\n\n if (\n ts.isCallExpression(node) &&\n ts.isIdentifier(node.expression) &&\n node.expression.text === 'provideStoreDevtools'\n ) {\n if (node.arguments.length) {\n const [devtoolsConfig] = node.arguments;\n\n if (ts.isObjectLiteralExpression(devtoolsConfig)) {\n updateConfig(sourceFile, devtoolsConfig, (change) =>\n changes.push(change)\n );\n }\n } else {\n createDevtoolsConfig(sourceFile, node, (change) =>\n changes.push(change)\n );\n }\n }\n\n ts.forEachChild(node, (childNode) => find(childNode, changes));\n }\n}\n\nfunction updateConfig(\n sourceFile: ts.SourceFile,\n devtoolsConfig: ts.ObjectLiteralExpression,\n addChange: (changes: Change) => number\n) {\n const connectOutsideZoneProperty = devtoolsConfig.properties.find(\n (p) =>\n ts.isPropertyAssignment(p) &&\n ts.isIdentifier(p.name) &&\n p.name.text === 'connectOutsideZone'\n );\n\n if (!connectOutsideZoneProperty) {\n addConnectInZoneProperty();\n } else if (ts.isPropertyAssignment(connectOutsideZoneProperty)) {\n replaceConnectOutsideZoneConfig(connectOutsideZoneProperty);\n }\n\n function addConnectInZoneProperty() {\n const configText = devtoolsConfig.getText(sourceFile);\n const comma =\n !devtoolsConfig.properties.length ||\n configText\n .substring(0, configText.length - 1)\n .trim()\n .endsWith(',')\n ? ''\n : ',';\n\n addChange(\n new InsertChange(\n sourceFile.fileName,\n devtoolsConfig.getEnd() - 1,\n `${comma} connectInZone: true`.trim()\n )\n );\n }\n\n function replaceConnectOutsideZoneConfig(\n connectOutsideZone: ts.PropertyAssignment\n ) {\n const currentValue = connectOutsideZone.initializer\n .getText(sourceFile)\n .trim();\n addChange(\n createReplaceChange(\n sourceFile,\n connectOutsideZone.name,\n 'connectOutsideZone',\n 'connectInZone'\n )\n );\n addChange(\n createReplaceChange(\n sourceFile,\n connectOutsideZone.initializer,\n currentValue,\n currentValue === 'true'\n ? 'false'\n : currentValue === 'false'\n ? 'true'\n : `!${currentValue}`\n )\n );\n }\n}\n\nfunction createDevtoolsConfig(\n sourceFile: ts.SourceFile,\n callExpression: ts.CallExpression,\n addChange: (...items: Change[]) => number\n) {\n addChange(\n new InsertChange(\n sourceFile.fileName,\n callExpression.getEnd() - 1,\n `{connectInZone: true}`\n )\n );\n}\n\nexport default function (): Rule {\n return chain([migrate()]);\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
3
4
  var schematics_core_1 = require("../../schematics-core");
4
5
  function default_1() {
5
6
  return (0, schematics_core_1.updatePackage)('store-devtools');
6
7
  }
7
- exports.default = default_1;
8
8
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/migrations/6_0_0/index.ts"],"names":[],"mappings":";;AACA,yDAAsD;AAEtD;IACE,OAAO,IAAA,+BAAa,EAAC,gBAAgB,CAAC,CAAC;AACzC,CAAC;AAFD,4BAEC","sourcesContent":["import { Rule } from '@angular-devkit/schematics';\nimport { updatePackage } from '../../schematics-core';\n\nexport default function (): Rule {\n return updatePackage('store-devtools');\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/migrations/6_0_0/index.ts"],"names":[],"mappings":";;AAGA,4BAEC;AAJD,yDAAsD;AAEtD;IACE,OAAO,IAAA,+BAAa,EAAC,gBAAgB,CAAC,CAAC;AACzC,CAAC","sourcesContent":["import { Rule } from '@angular-devkit/schematics';\nimport { updatePackage } from '../../schematics-core';\n\nexport default function (): Rule {\n return updatePackage('store-devtools');\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngrx/store-devtools",
3
- "version": "18.0.1",
3
+ "version": "18.1.0",
4
4
  "description": "Developer tools for @ngrx/store",
5
5
  "repository": {
6
6
  "type": "git",
@@ -20,7 +20,8 @@
20
20
  },
21
21
  "homepage": "https://github.com/ngrx/platform#readme",
22
22
  "peerDependencies": {
23
- "@ngrx/store": "18.0.1",
23
+ "@angular/core": "^18.0.0",
24
+ "@ngrx/store": "18.1.0",
24
25
  "rxjs": "^6.5.3 || ^7.5.0"
25
26
  },
26
27
  "schematics": "./schematics/collection.json",
@@ -36,6 +37,7 @@
36
37
  "@ngrx/component-store",
37
38
  "@ngrx/component",
38
39
  "@ngrx/eslint-plugin",
40
+ "@ngrx/operators",
39
41
  "@ngrx/signals"
40
42
  ],
41
43
  "migrations": "./migrations/migration.json"
@@ -27,6 +27,7 @@ var __values = (this && this.__values) || function(o) {
27
27
  throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
28
28
  };
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
+ exports.default = default_1;
30
31
  var ts = require("typescript");
31
32
  var schematics_1 = require("@angular-devkit/schematics");
32
33
  var tasks_1 = require("@angular-devkit/schematics/tasks");
@@ -153,5 +154,4 @@ function default_1(options) {
153
154
  ])(host, context);
154
155
  };
155
156
  }
156
- exports.default = default_1;
157
157
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics/ng-add/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+BAAiC;AACjC,yDAQoC;AACpC,0DAA0E;AAC1E,yDAS+B;AAE/B,uEAGkD;AAClD,iEAA2E;AAC3E,yEAA2E;AAE3E,SAAS,mBAAmB,CAAC,OAA6B;IACxD,OAAO,UAAC,IAAU;;QAChB,IAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;QAElC,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,MAAM,IAAI,gCAAmB,CAAC,eAAQ,UAAU,qBAAkB,CAAC,CAAC;QACtE,CAAC;QACD,IAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAE1C,IAAM,MAAM,GAAG,EAAE,CAAC,gBAAgB,CAChC,UAAU,EACV,UAAU,EACV,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;QAEI,IAAA,KAAA,OAA6B,IAAA,mC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,CAAC,IAAA,iBAAI,GAAE;gBACR,CAAC,CAAC,iCAAiC,EAAE;SACxC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC;AAnCD,4BAmCC","sourcesContent":["import * as ts from 'typescript';\nimport {\n Rule,\n SchematicContext,\n SchematicsException,\n Tree,\n branchAndMerge,\n chain,\n noop,\n} from '@angular-devkit/schematics';\nimport { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';\nimport {\n InsertChange,\n addImportToModule,\n findModuleFromOptions,\n getProjectPath,\n insertImport,\n addPackageToPackageJson,\n platformVersion,\n parseName,\n} from '../../schematics-core';\nimport { Schema as StoreDevtoolsOptions } from './schema';\nimport {\n addFunctionalProvidersToStandaloneBootstrap,\n callsProvidersFunction,\n} from '../../schematics-core/utility/standalone';\nimport { getProjectMainFile } from '../../schematics-core/utility/project';\nimport { isStandaloneApp } from '@schematics/angular/utility/ng-ast-utils';\n\nfunction addImportToNgModule(options: StoreDevtoolsOptions): Rule {\n return (host: Tree) => {\n const modulePath = options.module;\n\n if (!modulePath) {\n return host;\n }\n\n if (!host.exists(modulePath)) {\n throw new Error('Specified module does not exist');\n }\n\n const text = host.read(modulePath);\n if (text === null) {\n throw new SchematicsException(`File ${modulePath} does not exist.`);\n }\n const sourceText = text.toString('utf-8');\n\n const source = ts.createSourceFile(\n modulePath,\n sourceText,\n ts.ScriptTarget.Latest,\n true\n );\n\n const [instrumentNgModuleImport] = addImportToModule(\n source,\n modulePath,\n `StoreDevtoolsModule.instrument({ maxAge: ${options.maxAge}, logOnly: !isDevMode() })`,\n modulePath\n );\n\n const changes = [\n insertImport(\n source,\n modulePath,\n 'StoreDevtoolsModule',\n '@ngrx/store-devtools'\n ),\n insertImport(source, modulePath, 'isDevMode', '@angular/core'),\n instrumentNgModuleImport,\n ];\n const recorder = host.beginUpdate(modulePath);\n\n for (const change of changes) {\n if (change instanceof InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n }\n host.commitUpdate(recorder);\n\n return host;\n };\n}\n\nfunction addNgRxStoreDevToolsToPackageJson() {\n return (host: Tree, context: SchematicContext) => {\n addPackageToPackageJson(\n host,\n 'dependencies',\n '@ngrx/store-devtools',\n platformVersion\n );\n context.addTask(new NodePackageInstallTask());\n return host;\n };\n}\n\nfunction addStandaloneConfig(options: StoreDevtoolsOptions): Rule {\n return (host: Tree) => {\n const mainFile = getProjectMainFile(host, options);\n\n if (host.exists(mainFile)) {\n const providerFn = 'provideStoreDevtools';\n\n if (callsProvidersFunction(host, mainFile, providerFn)) {\n // exit because the store config is already provided\n return host;\n }\n\n const providerOptions = [\n ts.factory.createIdentifier(\n `{ maxAge: ${options.maxAge}, logOnly: !isDevMode() }`\n ),\n ];\n\n const patchedConfigFile = addFunctionalProvidersToStandaloneBootstrap(\n host,\n mainFile,\n providerFn,\n '@ngrx/store-devtools',\n providerOptions\n );\n\n // insert reducers import into the patched file\n const configFileContent = host.read(patchedConfigFile);\n const source = ts.createSourceFile(\n patchedConfigFile,\n configFileContent?.toString('utf-8') || '',\n ts.ScriptTarget.Latest,\n true\n );\n\n const recorder = host.beginUpdate(patchedConfigFile);\n\n const changes = [\n insertImport(source, patchedConfigFile, 'isDevMode', '@angular/core'),\n ];\n\n for (const change of changes) {\n if (change instanceof InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n }\n\n host.commitUpdate(recorder);\n\n return host;\n }\n\n throw new SchematicsException(\n `Main file not found for a project ${options.project}`\n );\n };\n}\n\nexport default function (options: StoreDevtoolsOptions): Rule {\n return (host: Tree, context: SchematicContext) => {\n const mainFile = getProjectMainFile(host, options);\n const isStandalone = isStandaloneApp(host, mainFile);\n\n options.path = getProjectPath(host, options);\n\n if (options.module && !isStandalone) {\n options.module = findModuleFromOptions(host, {\n name: '',\n module: options.module,\n path: options.path,\n });\n }\n\n const parsedPath = parseName(options.path, '');\n options.path = parsedPath.path;\n\n if (options.maxAge && (options.maxAge < 0 || options.maxAge === 1)) {\n throw new SchematicsException(\n `maxAge should be an integer greater than 1.`\n );\n }\n\n const configOrModuleUpdate = isStandalone\n ? addStandaloneConfig(options)\n : addImportToNgModule(options);\n\n return chain([\n branchAndMerge(chain([configOrModuleUpdate])),\n options && options.skipPackageJson\n ? noop()\n : addNgRxStoreDevToolsToPackageJson(),\n ])(host, context);\n };\n}\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../modules/store-devtools/schematics/ng-add/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2JA,4BAmCC;AA9LD,+BAAiC;AACjC,yDAQoC;AACpC,0DAA0E;AAC1E,yDAS+B;AAE/B,uEAGkD;AAClD,iEAA2E;AAC3E,yEAA2E;AAE3E,SAAS,mBAAmB,CAAC,OAA6B;IACxD,OAAO,UAAC,IAAU;;QAChB,IAAM,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;QAElC,IAAI,CAAC,UAAU,EAAE,CAAC;YAChB,OAAO,IAAI,CAAC;QACd,CAAC;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YAC7B,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;QACrD,CAAC;QAED,IAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QACnC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,MAAM,IAAI,gCAAmB,CAAC,eAAQ,UAAU,qBAAkB,CAAC,CAAC;QACtE,CAAC;QACD,IAAM,UAAU,GAAG,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;QAE1C,IAAM,MAAM,GAAG,EAAE,CAAC,gBAAgB,CAChC,UAAU,EACV,UAAU,EACV,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;QAEI,IAAA,KAAA,OAA6B,IAAA,mCAAiB,EAClD,MAAM,EACN,UAAU,EACV,mDAA4C,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C,iCAAiC,EAAE;SACxC,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACpB,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import * as ts from 'typescript';\nimport {\n Rule,\n SchematicContext,\n SchematicsException,\n Tree,\n branchAndMerge,\n chain,\n noop,\n} from '@angular-devkit/schematics';\nimport { NodePackageInstallTask } from '@angular-devkit/schematics/tasks';\nimport {\n InsertChange,\n addImportToModule,\n findModuleFromOptions,\n getProjectPath,\n insertImport,\n addPackageToPackageJson,\n platformVersion,\n parseName,\n} from '../../schematics-core';\nimport { Schema as StoreDevtoolsOptions } from './schema';\nimport {\n addFunctionalProvidersToStandaloneBootstrap,\n callsProvidersFunction,\n} from '../../schematics-core/utility/standalone';\nimport { getProjectMainFile } from '../../schematics-core/utility/project';\nimport { isStandaloneApp } from '@schematics/angular/utility/ng-ast-utils';\n\nfunction addImportToNgModule(options: StoreDevtoolsOptions): Rule {\n return (host: Tree) => {\n const modulePath = options.module;\n\n if (!modulePath) {\n return host;\n }\n\n if (!host.exists(modulePath)) {\n throw new Error('Specified module does not exist');\n }\n\n const text = host.read(modulePath);\n if (text === null) {\n throw new SchematicsException(`File ${modulePath} does not exist.`);\n }\n const sourceText = text.toString('utf-8');\n\n const source = ts.createSourceFile(\n modulePath,\n sourceText,\n ts.ScriptTarget.Latest,\n true\n );\n\n const [instrumentNgModuleImport] = addImportToModule(\n source,\n modulePath,\n `StoreDevtoolsModule.instrument({ maxAge: ${options.maxAge}, logOnly: !isDevMode() })`,\n modulePath\n );\n\n const changes = [\n insertImport(\n source,\n modulePath,\n 'StoreDevtoolsModule',\n '@ngrx/store-devtools'\n ),\n insertImport(source, modulePath, 'isDevMode', '@angular/core'),\n instrumentNgModuleImport,\n ];\n const recorder = host.beginUpdate(modulePath);\n\n for (const change of changes) {\n if (change instanceof InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n }\n host.commitUpdate(recorder);\n\n return host;\n };\n}\n\nfunction addNgRxStoreDevToolsToPackageJson() {\n return (host: Tree, context: SchematicContext) => {\n addPackageToPackageJson(\n host,\n 'dependencies',\n '@ngrx/store-devtools',\n platformVersion\n );\n context.addTask(new NodePackageInstallTask());\n return host;\n };\n}\n\nfunction addStandaloneConfig(options: StoreDevtoolsOptions): Rule {\n return (host: Tree) => {\n const mainFile = getProjectMainFile(host, options);\n\n if (host.exists(mainFile)) {\n const providerFn = 'provideStoreDevtools';\n\n if (callsProvidersFunction(host, mainFile, providerFn)) {\n // exit because the store config is already provided\n return host;\n }\n\n const providerOptions = [\n ts.factory.createIdentifier(\n `{ maxAge: ${options.maxAge}, logOnly: !isDevMode() }`\n ),\n ];\n\n const patchedConfigFile = addFunctionalProvidersToStandaloneBootstrap(\n host,\n mainFile,\n providerFn,\n '@ngrx/store-devtools',\n providerOptions\n );\n\n // insert reducers import into the patched file\n const configFileContent = host.read(patchedConfigFile);\n const source = ts.createSourceFile(\n patchedConfigFile,\n configFileContent?.toString('utf-8') || '',\n ts.ScriptTarget.Latest,\n true\n );\n\n const recorder = host.beginUpdate(patchedConfigFile);\n\n const changes = [\n insertImport(source, patchedConfigFile, 'isDevMode', '@angular/core'),\n ];\n\n for (const change of changes) {\n if (change instanceof InsertChange) {\n recorder.insertLeft(change.pos, change.toAdd);\n }\n }\n\n host.commitUpdate(recorder);\n\n return host;\n }\n\n throw new SchematicsException(\n `Main file not found for a project ${options.project}`\n );\n };\n}\n\nexport default function (options: StoreDevtoolsOptions): Rule {\n return (host: Tree, context: SchematicContext) => {\n const mainFile = getProjectMainFile(host, options);\n const isStandalone = isStandaloneApp(host, mainFile);\n\n options.path = getProjectPath(host, options);\n\n if (options.module && !isStandalone) {\n options.module = findModuleFromOptions(host, {\n name: '',\n module: options.module,\n path: options.path,\n });\n }\n\n const parsedPath = parseName(options.path, '');\n options.path = parsedPath.path;\n\n if (options.maxAge && (options.maxAge < 0 || options.maxAge === 1)) {\n throw new SchematicsException(\n `maxAge should be an integer greater than 1.`\n );\n }\n\n const configOrModuleUpdate = isStandalone\n ? addStandaloneConfig(options)\n : addImportToNgModule(options);\n\n return chain([\n branchAndMerge(chain([configOrModuleUpdate])),\n options && options.skipPackageJson\n ? noop()\n : addNgRxStoreDevToolsToPackageJson(),\n ])(host, context);\n };\n}\n"]}
@@ -36,7 +36,20 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
36
36
  return to.concat(ar || Array.prototype.slice.call(from));
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.containsProperty = exports.replaceImport = exports.insertImport = exports.addBootstrapToModule = exports.addExportToModule = exports.addProviderToComponent = exports.addProviderToModule = exports.addImportToModule = exports.addDeclarationToModule = exports.getDecoratorMetadata = exports.getContentOfKeyLiteral = exports.insertAfterLastOccurrence = exports.getSourceNodes = exports.findNodes = void 0;
39
+ exports.findNodes = findNodes;
40
+ exports.getSourceNodes = getSourceNodes;
41
+ exports.insertAfterLastOccurrence = insertAfterLastOccurrence;
42
+ exports.getContentOfKeyLiteral = getContentOfKeyLiteral;
43
+ exports.getDecoratorMetadata = getDecoratorMetadata;
44
+ exports.addDeclarationToModule = addDeclarationToModule;
45
+ exports.addImportToModule = addImportToModule;
46
+ exports.addProviderToModule = addProviderToModule;
47
+ exports.addProviderToComponent = addProviderToComponent;
48
+ exports.addExportToModule = addExportToModule;
49
+ exports.addBootstrapToModule = addBootstrapToModule;
50
+ exports.insertImport = insertImport;
51
+ exports.replaceImport = replaceImport;
52
+ exports.containsProperty = containsProperty;
40
53
  /* istanbul ignore file */
41
54
  /**
42
55
  * @license
@@ -90,7 +103,6 @@ function findNodes(node, kind, max) {
90
103
  }
91
104
  return arr;
92
105
  }
93
- exports.findNodes = findNodes;
94
106
  /**
95
107
  * Get all the nodes from a source.
96
108
  * @param sourceFile The source file object.
@@ -110,7 +122,6 @@ function getSourceNodes(sourceFile) {
110
122
  }
111
123
  return result;
112
124
  }
113
- exports.getSourceNodes = getSourceNodes;
114
125
  /**
115
126
  * Helper for sorting nodes.
116
127
  * @return function to sort nodes in increasing order of position in sourceFile
@@ -145,7 +156,6 @@ function insertAfterLastOccurrence(nodes, toInsert, file, fallbackPos, syntaxKin
145
156
  var lastItemPosition = lastItem ? lastItem.end : fallbackPos;
146
157
  return new change_1.InsertChange(file, lastItemPosition, toInsert);
147
158
  }
148
- exports.insertAfterLastOccurrence = insertAfterLastOccurrence;
149
159
  function getContentOfKeyLiteral(_source, node) {
150
160
  if (node.kind == ts.SyntaxKind.Identifier) {
151
161
  return node.text;
@@ -157,7 +167,6 @@ function getContentOfKeyLiteral(_source, node) {
157
167
  return null;
158
168
  }
159
169
  }
160
- exports.getContentOfKeyLiteral = getContentOfKeyLiteral;
161
170
  function _angularImportsFromNode(node, _sourceFile) {
162
171
  var _a;
163
172
  var ms = node.moduleSpecifier;
@@ -258,7 +267,6 @@ function getDecoratorMetadata(source, identifier, module) {
258
267
  })
259
268
  .map(function (expr) { return expr.arguments[0]; });
260
269
  }
261
- exports.getDecoratorMetadata = getDecoratorMetadata;
262
270
  function _addSymbolToNgModuleMetadata(source, ngModulePath, metadataField, symbolName, importPath) {
263
271
  var nodes = getDecoratorMetadata(source, 'NgModule', '@angular/core');
264
272
  var node = nodes[0]; // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -541,7 +549,6 @@ function _addSymbolToComponentMetadata(source, componentPath, metadataField, sym
541
549
  function addDeclarationToModule(source, modulePath, classifiedName, importPath) {
542
550
  return _addSymbolToNgModuleMetadata(source, modulePath, 'declarations', classifiedName, importPath);
543
551
  }
544
- exports.addDeclarationToModule = addDeclarationToModule;
545
552
  /**
546
553
  * Custom function to insert a declaration (component, pipe, directive)
547
554
  * into NgModule declarations. It also imports the component.
@@ -549,35 +556,30 @@ exports.addDeclarationToModule = addDeclarationToModule;
549
556
  function addImportToModule(source, modulePath, classifiedName, importPath) {
550
557
  return _addSymbolToNgModuleMetadata(source, modulePath, 'imports', classifiedName, importPath);
551
558
  }
552
- exports.addImportToModule = addImportToModule;
553
559
  /**
554
560
  * Custom function to insert a provider into NgModule. It also imports it.
555
561
  */
556
562
  function addProviderToModule(source, modulePath, classifiedName, importPath) {
557
563
  return _addSymbolToNgModuleMetadata(source, modulePath, 'providers', classifiedName, importPath);
558
564
  }
559
- exports.addProviderToModule = addProviderToModule;
560
565
  /**
561
566
  * Custom function to insert a provider into Component. It also imports it.
562
567
  */
563
568
  function addProviderToComponent(source, componentPath, classifiedName, importPath) {
564
569
  return _addSymbolToComponentMetadata(source, componentPath, 'providers', classifiedName, importPath);
565
570
  }
566
- exports.addProviderToComponent = addProviderToComponent;
567
571
  /**
568
572
  * Custom function to insert an export into NgModule. It also imports it.
569
573
  */
570
574
  function addExportToModule(source, modulePath, classifiedName, importPath) {
571
575
  return _addSymbolToNgModuleMetadata(source, modulePath, 'exports', classifiedName, importPath);
572
576
  }
573
- exports.addExportToModule = addExportToModule;
574
577
  /**
575
578
  * Custom function to insert an export into NgModule. It also imports it.
576
579
  */
577
580
  function addBootstrapToModule(source, modulePath, classifiedName, importPath) {
578
581
  return _addSymbolToNgModuleMetadata(source, modulePath, 'bootstrap', classifiedName, importPath);
579
582
  }
580
- exports.addBootstrapToModule = addBootstrapToModule;
581
583
  /**
582
584
  * Add Import `import { symbolName } from fileName` if the import doesn't exit
583
585
  * already. Assumes fileToEdit can be resolved and accessed.
@@ -638,7 +640,6 @@ function insertImport(source, fileToEdit, symbolName, fileName, isDefault) {
638
640
  " from '".concat(fileName, "'").concat(insertAtBeginning ? ';\n' : '');
639
641
  return insertAfterLastOccurrence(allImports, toInsert, fileToEdit, fallbackPos, ts.SyntaxKind.StringLiteral);
640
642
  }
641
- exports.insertImport = insertImport;
642
643
  function replaceImport(sourceFile, path, importFrom, importAsIs, importToBe) {
643
644
  var imports = sourceFile.statements
644
645
  .filter(ts.isImportDeclaration)
@@ -692,7 +693,6 @@ function replaceImport(sourceFile, path, importFrom, importAsIs, importToBe) {
692
693
  });
693
694
  return changes.reduce(function (imports, curr) { return imports.concat(curr); }, []);
694
695
  }
695
- exports.replaceImport = replaceImport;
696
696
  function containsProperty(objectLiteral, propertyName) {
697
697
  return (objectLiteral &&
698
698
  objectLiteral.properties.some(function (prop) {
@@ -701,5 +701,4 @@ function containsProperty(objectLiteral, propertyName) {
701
701
  prop.name.text === propertyName;
702
702
  }));
703
703
  }
704
- exports.containsProperty = containsProperty;
705
704
  //# sourceMappingURL=ast-utils.js.map