@o3r/logger 10.2.0-prerelease.7 → 10.2.0-prerelease.71

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/logger?style=for-the-badge)](https://www.npmjs.com/package/@o3r/logger)
13
+ [![Bundle Size](https://img.shields.io/bundlephobia/min/@o3r/logger?color=green&style=for-the-badge)](https://www.npmjs.com/package/@o3r/logger)
14
+
12
15
  This module provides a bridge to target different logger (logrocket, fullstory, smartlook) with a common interface.
13
16
 
14
17
  ## How to install
@@ -19,13 +19,13 @@ export class LoggerModule {
19
19
  ]
20
20
  };
21
21
  }
22
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
23
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.3", ngImport: i0, type: LoggerModule }); }
24
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerModule, providers: [
22
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
23
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: LoggerModule }); }
24
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerModule, providers: [
25
25
  LoggerService
26
26
  ] }); }
27
27
  }
28
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerModule, decorators: [{
28
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerModule, decorators: [{
29
29
  type: NgModule,
30
30
  args: [{
31
31
  providers: [
@@ -118,10 +118,10 @@ export class LoggerService {
118
118
  .filter((metaReducer) => !!metaReducer);
119
119
  return metaReducers.length <= 1 ? metaReducers[0] : metaReducers;
120
120
  }
121
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerService, deps: [{ token: LOGGER_CLIENT_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
122
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerService, providedIn: 'root' }); }
121
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerService, deps: [{ token: LOGGER_CLIENT_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
122
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerService, providedIn: 'root' }); }
123
123
  }
124
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerService, decorators: [{
124
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerService, decorators: [{
125
125
  type: Injectable,
126
126
  args: [{
127
127
  providedIn: 'root'
@@ -187,10 +187,10 @@ class LoggerService {
187
187
  .filter((metaReducer) => !!metaReducer);
188
188
  return metaReducers.length <= 1 ? metaReducers[0] : metaReducers;
189
189
  }
190
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerService, deps: [{ token: LOGGER_CLIENT_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
191
- /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerService, providedIn: 'root' }); }
190
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerService, deps: [{ token: LOGGER_CLIENT_TOKEN, optional: true }], target: i0.ɵɵFactoryTarget.Injectable }); }
191
+ /** @nocollapse */ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerService, providedIn: 'root' }); }
192
192
  }
193
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerService, decorators: [{
193
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerService, decorators: [{
194
194
  type: Injectable,
195
195
  args: [{
196
196
  providedIn: 'root'
@@ -218,13 +218,13 @@ class LoggerModule {
218
218
  ]
219
219
  };
220
220
  }
221
- /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
222
- /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.2.3", ngImport: i0, type: LoggerModule }); }
223
- /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerModule, providers: [
221
+ /** @nocollapse */ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
222
+ /** @nocollapse */ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "17.3.1", ngImport: i0, type: LoggerModule }); }
223
+ /** @nocollapse */ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerModule, providers: [
224
224
  LoggerService
225
225
  ] }); }
226
226
  }
227
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.2.3", ngImport: i0, type: LoggerModule, decorators: [{
227
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.1", ngImport: i0, type: LoggerModule, decorators: [{
228
228
  type: NgModule,
229
229
  args: [{
230
230
  providers: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@o3r/logger",
3
- "version": "10.2.0-prerelease.7",
3
+ "version": "10.2.0-prerelease.71",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -11,12 +11,12 @@
11
11
  "otter-module"
12
12
  ],
13
13
  "peerDependencies": {
14
- "@angular/core": "~17.2.0",
15
- "@angular/platform-browser-dynamic": "~17.2.0",
14
+ "@angular/core": "~17.3.0",
15
+ "@angular/platform-browser-dynamic": "~17.3.0",
16
16
  "@fullstory/browser": "^2.0.0",
17
17
  "@ngrx/store": "~17.1.0",
18
- "@o3r/core": "^10.2.0-prerelease.7",
19
- "@o3r/schematics": "^10.2.0-prerelease.7",
18
+ "@o3r/core": "^10.2.0-prerelease.71",
19
+ "@o3r/schematics": "^10.2.0-prerelease.71",
20
20
  "logrocket": "~8.1.0",
21
21
  "logrocket-ngrx": "~0.2.1",
22
22
  "rxjs": "^7.8.1",
@@ -40,7 +40,7 @@
40
40
  }
41
41
  },
42
42
  "dependencies": {
43
- "tslib": "^2.5.3"
43
+ "tslib": "^2.6.2"
44
44
  },
45
45
  "engines": {
46
46
  "node": ">=18.0.0"
@@ -2,6 +2,7 @@ import type { Rule } from '@angular-devkit/schematics';
2
2
  import type { NgAddSchematicsSchema } from './schema';
3
3
  /**
4
4
  * Add Otter logger to an Angular Project
5
+ * @param options
5
6
  */
6
7
  export declare const ngAdd: (options: NgAddSchematicsSchema) => Rule;
7
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAEvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AAmBtD;;GAEG;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,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAC;AA2BtD;;;GAGG;AACH,eAAO,MAAM,KAAK,YAAa,qBAAqB,KAAG,IAGtD,CAAC"}
@@ -1,24 +1,35 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ngAdd = void 0;
4
- const schematics_1 = require("@o3r/schematics");
5
4
  const path = require("node:path");
6
5
  const packageJsonPath = path.resolve(__dirname, '..', '..', 'package.json');
6
+ const reportMissingSchematicsDep = (logger) => (reason) => {
7
+ logger.error(`[ERROR]: Adding @o3r/logger has failed.
8
+ If the error is related to missing @o3r dependencies you need to install '@o3r/core' to be able to use the logger package. Please run 'ng add @o3r/core' .
9
+ Otherwise, use the error message as guidance.`);
10
+ throw reason;
11
+ };
7
12
  /**
8
13
  * Add Otter logger to an Angular Project
9
14
  * @param options
10
15
  */
11
16
  function ngAddFn(options) {
12
17
  /* ng add rules */
13
- return (tree) => {
14
- return (0, schematics_1.setupDependencies)({
18
+ return async (tree) => {
19
+ const { getPackageInstallConfig, setupDependencies } = await Promise.resolve().then(() => require('@o3r/schematics'));
20
+ return setupDependencies({
15
21
  projectName: options.projectName,
16
- dependencies: (0, schematics_1.getPackageInstallConfig)(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion)
22
+ dependencies: getPackageInstallConfig(packageJsonPath, tree, options.projectName, false, !!options.exactO3rVersion)
17
23
  });
18
24
  };
19
25
  }
20
26
  /**
21
27
  * Add Otter logger to an Angular Project
28
+ * @param options
22
29
  */
23
- exports.ngAdd = (0, schematics_1.createSchematicWithMetricsIfInstalled)(ngAddFn);
30
+ const ngAdd = (options) => async (_, { logger }) => {
31
+ const { createSchematicWithMetricsIfInstalled } = await Promise.resolve().then(() => require('@o3r/schematics')).catch(reportMissingSchematicsDep(logger));
32
+ return createSchematicWithMetricsIfInstalled(ngAddFn)(options);
33
+ };
34
+ exports.ngAdd = ngAdd;
24
35
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../schematics/ng-add/index.ts"],"names":[],"mappings":";;;AACA,gDAAoH;AAEpH,kCAAkC;AAElC,MAAM,eAAe,GAAG,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;AAE5E;;;GAGG;AACH,SAAS,OAAO,CAAC,OAA8B;IAC7C,kBAAkB;IAClB,OAAO,CAAC,IAAI,EAAE,EAAE;QACd,OAAO,IAAA,8BAAiB,EAAC;YACvB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,YAAY,EAAE,IAAA,oCAAuB,EAAC,eAAe,EAAE,IAAI,EAAE,OAAO,CAAC,WAAW,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,eAAe,CAAC;SACpH,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC;AAED;;GAEG;AACU,QAAA,KAAK,GAAG,IAAA,kDAAqC,EAAC,OAAO,CAAC,CAAC"}
1
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