@o3r/application 10.2.0-prerelease.5 → 10.2.0-prerelease.50

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.
package/README.md CHANGED
@@ -9,6 +9,9 @@ This package is an [Otter Framework Module](https://github.com/AmadeusITGroup/ot
9
9
 
10
10
  ## Description
11
11
 
12
+ [![Stable Version](https://img.shields.io/npm/v/@o3r/application)](https://www.npmjs.com/package/@o3r/application)
13
+ [![Bundle Size](https://img.shields.io/bundlephobia/min/@o3r/application?color=green)](https://www.npmjs.com/package/@o3r/application)
14
+
12
15
  This module provides development tools for your [Otter Application](https://github.com/AmadeusITGroup/otter).
13
16
 
14
17
  ## How to install
@@ -27,10 +27,10 @@ export class ApplicationDevtoolsConsoleService {
27
27
  displayApplicationInfo() {
28
28
  console.info('Application info', this.applicationDevtools.getApplicationInformation());
29
29
  }
30
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsConsoleService, deps: [{ token: i1.OtterApplicationDevtools }, { token: OTTER_APPLICATION_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
31
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsConsoleService, providedIn: 'root' }); }
30
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsConsoleService, deps: [{ token: i1.OtterApplicationDevtools }, { token: OTTER_APPLICATION_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
31
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsConsoleService, providedIn: 'root' }); }
32
32
  }
33
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsConsoleService, decorators: [{
33
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsConsoleService, decorators: [{
34
34
  type: Injectable,
35
35
  args: [{
36
36
  providedIn: 'root'
@@ -83,10 +83,10 @@ export class ApplicationDevtoolsMessageService {
83
83
  ngOnDestroy() {
84
84
  this.subscriptions.unsubscribe();
85
85
  }
86
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsMessageService, deps: [{ token: i1.LoggerService }, { token: i2.OtterApplicationDevtools }, { token: OTTER_APPLICATION_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
87
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsMessageService, providedIn: 'root' }); }
86
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsMessageService, deps: [{ token: i1.LoggerService }, { token: i2.OtterApplicationDevtools }, { token: OTTER_APPLICATION_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
87
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsMessageService, providedIn: 'root' }); }
88
88
  }
89
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsMessageService, decorators: [{
89
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsMessageService, decorators: [{
90
90
  type: Injectable,
91
91
  args: [{
92
92
  providedIn: 'root'
@@ -20,16 +20,16 @@ export class ApplicationDevtoolsModule {
20
20
  ]
21
21
  };
22
22
  }
23
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
24
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsModule }); }
25
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsModule, providers: [
23
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
24
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsModule }); }
25
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsModule, providers: [
26
26
  { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS },
27
27
  ApplicationDevtoolsMessageService,
28
28
  ApplicationDevtoolsConsoleService,
29
29
  OtterApplicationDevtools
30
30
  ] }); }
31
31
  }
32
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsModule, decorators: [{
32
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsModule, decorators: [{
33
33
  type: NgModule,
34
34
  args: [{
35
35
  providers: [
@@ -14,10 +14,10 @@ export class OtterApplicationDevtools {
14
14
  isProduction: isProductionEnvironment(this.document?.body.dataset)
15
15
  };
16
16
  }
17
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: OtterApplicationDevtools, deps: [{ token: DOCUMENT, optional: true }, { token: ENVIRONMENT_CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
18
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: OtterApplicationDevtools, providedIn: 'root' }); }
17
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: OtterApplicationDevtools, deps: [{ token: DOCUMENT, optional: true }, { token: ENVIRONMENT_CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
18
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: OtterApplicationDevtools, providedIn: 'root' }); }
19
19
  }
20
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: OtterApplicationDevtools, decorators: [{
20
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: OtterApplicationDevtools, decorators: [{
21
21
  type: Injectable,
22
22
  args: [{ providedIn: 'root' }]
23
23
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -39,10 +39,10 @@ class OtterApplicationDevtools {
39
39
  isProduction: isProductionEnvironment(this.document?.body.dataset)
40
40
  };
41
41
  }
42
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: OtterApplicationDevtools, deps: [{ token: DOCUMENT, optional: true }, { token: ENVIRONMENT_CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
43
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: OtterApplicationDevtools, providedIn: 'root' }); }
42
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: OtterApplicationDevtools, deps: [{ token: DOCUMENT, optional: true }, { token: ENVIRONMENT_CONFIG_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
43
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: OtterApplicationDevtools, providedIn: 'root' }); }
44
44
  }
45
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: OtterApplicationDevtools, decorators: [{
45
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: OtterApplicationDevtools, decorators: [{
46
46
  type: Injectable,
47
47
  args: [{ providedIn: 'root' }]
48
48
  }], ctorParameters: () => [{ type: undefined, decorators: [{
@@ -86,10 +86,10 @@ class ApplicationDevtoolsConsoleService {
86
86
  displayApplicationInfo() {
87
87
  console.info('Application info', this.applicationDevtools.getApplicationInformation());
88
88
  }
89
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsConsoleService, deps: [{ token: OtterApplicationDevtools }, { token: OTTER_APPLICATION_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
90
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsConsoleService, providedIn: 'root' }); }
89
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsConsoleService, deps: [{ token: OtterApplicationDevtools }, { token: OTTER_APPLICATION_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
90
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsConsoleService, providedIn: 'root' }); }
91
91
  }
92
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsConsoleService, decorators: [{
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsConsoleService, decorators: [{
93
93
  type: Injectable,
94
94
  args: [{
95
95
  providedIn: 'root'
@@ -175,10 +175,10 @@ class ApplicationDevtoolsMessageService {
175
175
  ngOnDestroy() {
176
176
  this.subscriptions.unsubscribe();
177
177
  }
178
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsMessageService, deps: [{ token: i1.LoggerService }, { token: OtterApplicationDevtools }, { token: OTTER_APPLICATION_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
179
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsMessageService, providedIn: 'root' }); }
178
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsMessageService, deps: [{ token: i1.LoggerService }, { token: OtterApplicationDevtools }, { token: OTTER_APPLICATION_DEVTOOLS_OPTIONS, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
179
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsMessageService, providedIn: 'root' }); }
180
180
  }
181
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsMessageService, decorators: [{
181
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsMessageService, decorators: [{
182
182
  type: Injectable,
183
183
  args: [{
184
184
  providedIn: 'root'
@@ -206,16 +206,16 @@ class ApplicationDevtoolsModule {
206
206
  ]
207
207
  };
208
208
  }
209
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
210
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsModule }); }
211
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsModule, providers: [
209
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
210
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsModule }); }
211
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsModule, providers: [
212
212
  { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS },
213
213
  ApplicationDevtoolsMessageService,
214
214
  ApplicationDevtoolsConsoleService,
215
215
  OtterApplicationDevtools
216
216
  ] }); }
217
217
  }
218
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: ApplicationDevtoolsModule, decorators: [{
218
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: ApplicationDevtoolsModule, decorators: [{
219
219
  type: NgModule,
220
220
  args: [{
221
221
  providers: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/application",
3
- "version": "10.2.0-prerelease.5",
3
+ "version": "10.2.0-prerelease.50",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -25,17 +25,17 @@
25
25
  }
26
26
  },
27
27
  "peerDependencies": {
28
- "@angular-devkit/schematics": "~17.2.0",
29
- "@angular/common": "~17.2.0",
30
- "@angular/core": "~17.2.0",
31
- "@o3r/core": "^10.2.0-prerelease.5",
32
- "@o3r/logger": "^10.2.0-prerelease.5",
33
- "@o3r/routing": "^10.2.0-prerelease.5",
34
- "@o3r/schematics": "^10.2.0-prerelease.5",
35
- "@o3r/testing": "^10.2.0-prerelease.5",
36
- "@schematics/angular": "~17.2.0",
28
+ "@angular-devkit/schematics": "~17.3.0",
29
+ "@angular/common": "~17.3.0",
30
+ "@angular/core": "~17.3.0",
31
+ "@o3r/core": "^10.2.0-prerelease.50",
32
+ "@o3r/logger": "^10.2.0-prerelease.50",
33
+ "@o3r/routing": "^10.2.0-prerelease.50",
34
+ "@o3r/schematics": "^10.2.0-prerelease.50",
35
+ "@o3r/testing": "^10.2.0-prerelease.50",
36
+ "@schematics/angular": "~17.3.0",
37
37
  "rxjs": "^7.8.1",
38
- "typescript": "~5.3.3"
38
+ "typescript": "~5.4.2"
39
39
  },
40
40
  "peerDependenciesMeta": {
41
41
  "@angular-devkit/schematics": {
@@ -49,7 +49,7 @@
49
49
  }
50
50
  },
51
51
  "dependencies": {
52
- "tslib": "^2.5.3"
52
+ "tslib": "^2.6.2"
53
53
  },
54
54
  "engines": {
55
55
  "node": ">=18.0.0"
@@ -1 +1 @@
1
- {"version":3,"file":"cms-registration.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/cms-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8D,IAAI,EAAiB,MAAM,4BAA4B,CAAC;AAC7H,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAGvD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,YAAa,qBAAqB,KAAG,IAatE,CAAC"}
1
+ {"version":3,"file":"cms-registration.d.ts","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/cms-registration.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8D,IAAI,EAAiB,MAAM,4BAA4B,CAAC;AAC7H,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,qBAAqB,YAAa,qBAAqB,KAAG,IActE,CAAC"}
@@ -2,20 +2,20 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.generateCmsConfigFile = void 0;
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
- const schematics_2 = require("@o3r/schematics");
6
5
  /**
7
6
  * Register Otter Application module to the application
8
7
  * @param options
9
8
  */
10
9
  const generateCmsConfigFile = (options) => {
11
- return (tree, context) => {
12
- const workingDirectory = options?.projectName && (0, schematics_2.getWorkspaceConfig)(tree)?.projects[options.projectName]?.root || '.';
10
+ return async (tree) => {
11
+ const { getWorkspaceConfig } = await Promise.resolve().then(() => require('@o3r/schematics'));
12
+ const workingDirectory = options?.projectName && getWorkspaceConfig(tree)?.projects[options.projectName]?.root || '.';
13
13
  const templateSource = (0, schematics_1.apply)((0, schematics_1.url)('./templates'), [
14
14
  (0, schematics_1.template)({}),
15
15
  (0, schematics_1.renameTemplateFiles)(),
16
16
  (0, schematics_1.move)(workingDirectory)
17
17
  ]);
18
- return (0, schematics_1.mergeWith)(templateSource, schematics_1.MergeStrategy.Default)(tree, context);
18
+ return (0, schematics_1.mergeWith)(templateSource, schematics_1.MergeStrategy.Default);
19
19
  };
20
20
  };
21
21
  exports.generateCmsConfigFile = generateCmsConfigFile;
@@ -1 +1 @@
1
- {"version":3,"file":"cms-registration.js","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/cms-registration.ts"],"names":[],"mappings":";;;AAAA,2DAA6H;AAE7H,gDAAqD;AAErD;;;GAGG;AACI,MAAM,qBAAqB,GAAG,CAAC,OAA8B,EAAQ,EAAE;IAC5E,OAAO,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;QACvB,MAAM,gBAAgB,GAAG,OAAO,EAAE,WAAW,IAAI,IAAA,+BAAkB,EAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,IAAI,GAAG,CAAC;QACtH,MAAM,cAAc,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,aAAa,CAAC,EAC7C;YACE,IAAA,qBAAQ,EAAC,EAAE,CAAC;YACZ,IAAA,gCAAmB,GAAE;YACrB,IAAA,iBAAI,EAAC,gBAAgB,CAAC;SACvB,CACF,CAAC;QAEF,OAAO,IAAA,sBAAS,EAAC,cAAc,EAAE,0BAAa,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC,CAAC;AACJ,CAAC,CAAC;AAbW,QAAA,qBAAqB,yBAahC"}
1
+ {"version":3,"file":"cms-registration.js","sourceRoot":"","sources":["../../../../schematics/ng-add/helpers/cms-registration.ts"],"names":[],"mappings":";;;AAAA,2DAA6H;AAG7H;;;GAGG;AACI,MAAM,qBAAqB,GAAG,CAAC,OAA8B,EAAQ,EAAE;IAC5E,OAAO,KAAK,EAAE,IAAI,EAAE,EAAE;QACpB,MAAM,EAAE,kBAAkB,EAAE,GAAG,2CAAa,iBAAiB,EAAC,CAAC;QAC/D,MAAM,gBAAgB,GAAG,OAAO,EAAE,WAAW,IAAI,kBAAkB,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,IAAI,IAAI,GAAG,CAAC;QACtH,MAAM,cAAc,GAAG,IAAA,kBAAK,EAAC,IAAA,gBAAG,EAAC,aAAa,CAAC,EAC7C;YACE,IAAA,qBAAQ,EAAC,EAAE,CAAC;YACZ,IAAA,gCAAmB,GAAE;YACrB,IAAA,iBAAI,EAAC,gBAAgB,CAAC;SACvB,CACF,CAAC;QAEF,OAAO,IAAA,sBAAS,EAAC,cAAc,EAAE,0BAAa,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC,CAAC;AACJ,CAAC,CAAC;AAdW,QAAA,qBAAqB,yBAchC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAI/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAmGtD;;;GAGG;AACH,eAAO,MAAM,KAAK,0CAAiD,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAA0B,MAAM,4BAA4B,CAAC;AAG/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA0GtD;;;GAGG;AACH,eAAO,MAAM,KAAK,YAAa,qBAAqB,KAAG,IAGtD,CAAC"}
@@ -2,10 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngAdd = void 0;
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
- const schematics_2 = require("@o3r/schematics");
6
5
  const path = require("node:path");
7
6
  const devtools_registration_1 = require("./helpers/devtools-registration");
8
7
  const cms_registration_1 = require("./helpers/cms-registration");
8
+ const reportMissingSchematicsDep = (logger) => (reason) => {
9
+ logger.error(`[ERROR]: Adding @o3r/application has failed.
10
+ If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the o3r application package. Please run 'ng add @o3r/core' .
11
+ Otherwise, use the error message as guidance.`);
12
+ throw reason;
13
+ };
9
14
  /**
10
15
  * Add Otter application to an Angular Project
11
16
  * @param options The options to pass to ng-add execution
@@ -13,65 +18,60 @@ const cms_registration_1 = require("./helpers/cms-registration");
13
18
  function ngAddFn(options) {
14
19
  /* ng add rules */
15
20
  return async (tree, context) => {
16
- try {
17
- const { addImportToModuleFile, getAppModuleFilePath, getModuleIndex, getWorkspaceConfig, insertImportToModuleFile, setupDependencies, getO3rPeerDeps, getProjectNewDependenciesTypes } = await Promise.resolve().then(() => require('@o3r/schematics'));
18
- const { isImported } = await Promise.resolve().then(() => require('@schematics/angular/utility/ast-utils'));
19
- const ts = await Promise.resolve().then(() => require('typescript'));
20
- const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
21
- const depsInfo = getO3rPeerDeps(packageJsonPath);
22
- const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
23
- const addAngularAnimationPreferences = () => {
24
- const moduleFilePath = getAppModuleFilePath(tree, context, options.projectName);
25
- if (!moduleFilePath) {
26
- return tree;
27
- }
28
- const sourceFileContent = tree.readText(moduleFilePath);
29
- const sourceFile = ts.createSourceFile(moduleFilePath, sourceFileContent, ts.ScriptTarget.ES2015, true);
30
- if (isImported(sourceFile, 'prefersReducedMotion', '@o3r/application')) {
31
- context.logger.info('[LOG]: prefersReducedMotion from @o3r/application is already imported.');
32
- return tree;
33
- }
34
- const recorder = tree.beginUpdate(moduleFilePath);
35
- const { moduleIndex } = getModuleIndex(sourceFile, sourceFileContent);
36
- insertImportToModuleFile('prefersReducedMotion', '@o3r/application', sourceFile, recorder, moduleFilePath);
37
- addImportToModuleFile('BrowserAnimationsModule', '@angular/platform-browser/animations', sourceFile, sourceFileContent, context, recorder, moduleFilePath, moduleIndex, '.withConfig({disableAnimations: prefersReducedMotion()})', true);
38
- tree.commitUpdate(recorder);
21
+ const { addImportToModuleFile, getAppModuleFilePath, getModuleIndex, getWorkspaceConfig, insertImportToModuleFile, setupDependencies, getO3rPeerDeps, getProjectNewDependenciesTypes, getPackageInstallConfig } = await Promise.resolve().then(() => require('@o3r/schematics'));
22
+ const { isImported } = await Promise.resolve().then(() => require('@schematics/angular/utility/ast-utils'));
23
+ const ts = await Promise.resolve().then(() => require('typescript'));
24
+ const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
25
+ const depsInfo = getO3rPeerDeps(packageJsonPath);
26
+ const workspaceProject = options.projectName ? getWorkspaceConfig(tree)?.projects[options.projectName] : undefined;
27
+ const addAngularAnimationPreferences = () => {
28
+ const moduleFilePath = getAppModuleFilePath(tree, context, options.projectName);
29
+ if (!moduleFilePath) {
39
30
  return tree;
31
+ }
32
+ const sourceFileContent = tree.readText(moduleFilePath);
33
+ const sourceFile = ts.createSourceFile(moduleFilePath, sourceFileContent, ts.ScriptTarget.ES2015, true);
34
+ if (isImported(sourceFile, 'prefersReducedMotion', '@o3r/application')) {
35
+ context.logger.info('[LOG]: prefersReducedMotion from @o3r/application is already imported.');
36
+ return tree;
37
+ }
38
+ const recorder = tree.beginUpdate(moduleFilePath);
39
+ const { moduleIndex } = getModuleIndex(sourceFile, sourceFileContent);
40
+ insertImportToModuleFile('prefersReducedMotion', '@o3r/application', sourceFile, recorder, moduleFilePath);
41
+ addImportToModuleFile('BrowserAnimationsModule', '@angular/platform-browser/animations', sourceFile, sourceFileContent, context, recorder, moduleFilePath, moduleIndex, '.withConfig({disableAnimations: prefersReducedMotion()})', true);
42
+ tree.commitUpdate(recorder);
43
+ return tree;
44
+ };
45
+ const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
46
+ acc[dep] = {
47
+ inManifest: [{
48
+ range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
49
+ types: getProjectNewDependenciesTypes(workspaceProject)
50
+ }],
51
+ ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
40
52
  };
41
- const dependencies = depsInfo.o3rPeerDeps.reduce((acc, dep) => {
42
- acc[dep] = {
43
- inManifest: [{
44
- range: `${options.exactO3rVersion ? '' : '~'}${depsInfo.packageVersion}`,
45
- types: getProjectNewDependenciesTypes(workspaceProject)
46
- }],
47
- ngAddOptions: { exactO3rVersion: options.exactO3rVersion }
48
- };
49
- return acc;
50
- }, (0, schematics_2.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
51
- const registerDevtoolRule = await (0, devtools_registration_1.registerDevtools)(options);
52
- return () => (0, schematics_1.chain)([
53
- setupDependencies({
54
- projectName: options.projectName,
55
- dependencies,
56
- ngAddToRun: depsInfo.o3rPeerDeps
57
- }),
58
- addAngularAnimationPreferences,
59
- registerDevtoolRule,
60
- (0, cms_registration_1.generateCmsConfigFile)(options)
61
- ])(tree, context);
62
- }
63
- catch (e) {
64
- // o3r application needs o3r/core as peer dep. o3r/core will install o3r/schematics
65
- context.logger.error(`[ERROR]: Adding @o3r/application has failed.
66
- If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the o3r application package. Please run 'ng add @o3r/core' .
67
- Otherwise, use the error message as guidance.`);
68
- throw (e);
69
- }
53
+ return acc;
54
+ }, getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion));
55
+ const registerDevtoolRule = await (0, devtools_registration_1.registerDevtools)(options);
56
+ return () => (0, schematics_1.chain)([
57
+ setupDependencies({
58
+ projectName: options.projectName,
59
+ dependencies,
60
+ ngAddToRun: depsInfo.o3rPeerDeps
61
+ }),
62
+ addAngularAnimationPreferences,
63
+ registerDevtoolRule,
64
+ (0, cms_registration_1.generateCmsConfigFile)(options)
65
+ ])(tree, context);
70
66
  };
71
67
  }
72
68
  /**
73
69
  * Add Otter application to an Angular Project
74
70
  * @param options The options to pass to ng-add execution
75
71
  */
76
- exports.ngAdd = (0, schematics_2.createSchematicWithMetricsIfInstalled)(ngAddFn);
72
+ const ngAdd = (options) => async (_, { logger }) => {
73
+ const { createSchematicWithMetricsIfInstalled } = await Promise.resolve().then(() => require('@o3r/schematics')).catch(reportMissingSchematicsDep(logger));
74
+ return createSchematicWithMetricsIfInstalled(ngAddFn)(options);
75
+ };
76
+ exports.ngAdd = ngAdd;
77
77
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AACA,2DAAmD;AACnD,gDAAiG;AACjG,kCAAkC;AAElC,2EAAmE;AACnE,iEAAmE;AAEnE;;;GAGG;AACH,SAAS,OAAO,CAAC,OAA8B;IAC7C,kBAAkB;IAClB,OAAO,KAAK,EAAE,IAAU,EAAE,OAAyB,EAAE,EAAE;QACrD,IAAI,CAAC;YACH,MAAM,EACJ,qBAAqB,EAAE,oBAAoB,EAAE,cAAc,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,iBAAiB,EAAE,cAAc,EAAE,8BAA8B,EAC7K,GAAG,2CAAa,iBAAiB,EAAC,CAAC;YACpC,MAAM,EAAE,UAAU,EAAE,GAAG,2CAAa,uCAAuC,EAAC,CAAC;YAC7E,MAAM,EAAE,GAAG,2CAAa,YAAY,EAAC,CAAC;YACtC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;YAC5E,MAAM,QAAQ,GAAG,cAAc,CAAC,eAAe,CAAC,CAAC;YAEjD,MAAM,gBAAgB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAEnH,MAA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