@o3r/application 10.2.0-prerelease.4 → 10.2.0-prerelease.40
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 +3 -0
- package/esm2022/devkit/application-devtools.console.service.mjs +3 -3
- package/esm2022/devkit/application-devtools.message.service.mjs +3 -3
- package/esm2022/devkit/application-devtools.module.mjs +4 -4
- package/esm2022/devkit/application-devtools.service.mjs +3 -3
- package/fesm2022/o3r-application.mjs +13 -13
- package/package.json +12 -12
- package/schematics/ng-add/helpers/cms-registration.d.ts.map +1 -1
- package/schematics/ng-add/helpers/cms-registration.js +4 -4
- package/schematics/ng-add/helpers/cms-registration.js.map +1 -1
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +54 -54
- package/schematics/ng-add/index.js.map +1 -1
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
|
+
[](https://www.npmjs.com/package/@o3r/application)
|
|
13
|
+
[](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.
|
|
31
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
30
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", 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.0", ngImport: i0, type: ApplicationDevtoolsConsoleService, providedIn: 'root' }); }
|
|
32
32
|
}
|
|
33
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
33
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", 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.
|
|
87
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
86
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", 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.0", ngImport: i0, type: ApplicationDevtoolsMessageService, providedIn: 'root' }); }
|
|
88
88
|
}
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", 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.
|
|
24
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
25
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
23
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ApplicationDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
24
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.0", ngImport: i0, type: ApplicationDevtoolsModule }); }
|
|
25
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.0", 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.
|
|
32
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", 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.
|
|
18
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
17
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", 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.0", ngImport: i0, type: OtterApplicationDevtools, providedIn: 'root' }); }
|
|
19
19
|
}
|
|
20
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
20
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", 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.
|
|
43
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
42
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", 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.0", ngImport: i0, type: OtterApplicationDevtools, providedIn: 'root' }); }
|
|
44
44
|
}
|
|
45
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", 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.
|
|
90
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
89
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", 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.0", ngImport: i0, type: ApplicationDevtoolsConsoleService, providedIn: 'root' }); }
|
|
91
91
|
}
|
|
92
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
92
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", 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.
|
|
179
|
-
/** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.
|
|
178
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", 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.0", ngImport: i0, type: ApplicationDevtoolsMessageService, providedIn: 'root' }); }
|
|
180
180
|
}
|
|
181
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.
|
|
181
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", 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.
|
|
210
|
-
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.
|
|
211
|
-
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.
|
|
209
|
+
/** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: ApplicationDevtoolsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
210
|
+
/** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.0", ngImport: i0, type: ApplicationDevtoolsModule }); }
|
|
211
|
+
/** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.0", 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.
|
|
218
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", 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.
|
|
3
|
+
"version": "10.2.0-prerelease.40",
|
|
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.
|
|
29
|
-
"@angular/common": "~17.
|
|
30
|
-
"@angular/core": "~17.
|
|
31
|
-
"@o3r/core": "^10.2.0-prerelease.
|
|
32
|
-
"@o3r/logger": "^10.2.0-prerelease.
|
|
33
|
-
"@o3r/routing": "^10.2.0-prerelease.
|
|
34
|
-
"@o3r/schematics": "^10.2.0-prerelease.
|
|
35
|
-
"@o3r/testing": "^10.2.0-prerelease.
|
|
36
|
-
"@schematics/angular": "~17.
|
|
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.40",
|
|
32
|
+
"@o3r/logger": "^10.2.0-prerelease.40",
|
|
33
|
+
"@o3r/routing": "^10.2.0-prerelease.40",
|
|
34
|
+
"@o3r/schematics": "^10.2.0-prerelease.40",
|
|
35
|
+
"@o3r/testing": "^10.2.0-prerelease.40",
|
|
36
|
+
"@schematics/angular": "~17.3.0",
|
|
37
37
|
"rxjs": "^7.8.1",
|
|
38
|
-
"typescript": "~5.
|
|
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.
|
|
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;
|
|
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
|
|
12
|
-
const
|
|
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)
|
|
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;
|
|
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;
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
|
|
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
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
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,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AACA,2DAAmD;AACnD,kCAAkC;AAElC,2EAAmE;AACnE,iEAAmE;AAEnE,MAAM,0BAA0B,GAAG,CAAC,MAA2C,EAAE,EAAE,CAAC,CAAC,MAAW,EAAE,EAAE;IAClG,MAAM,CAAC,KAAK,CAAC;;8CAE+B,CAAC,CAAC;IAC9C,MA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