@o3r/configuration 11.0.0-next.0 → 11.0.0-next.2

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 (66) hide show
  1. package/README.md +9 -4
  2. package/collection.json +6 -0
  3. package/core/configurable.d.ts +1 -1
  4. package/core/configurable.d.ts.map +1 -1
  5. package/core/configuration.d.ts.map +1 -1
  6. package/devkit/configuration-devtools.console.service.d.ts +3 -3
  7. package/devkit/configuration-devtools.service.d.ts +5 -5
  8. package/esm2022/core/configurable.mjs +1 -1
  9. package/esm2022/core/configuration.mjs +1 -1
  10. package/esm2022/devkit/configuration-devtools.console.service.mjs +7 -7
  11. package/esm2022/devkit/configuration-devtools.message.service.mjs +4 -4
  12. package/esm2022/devkit/configuration-devtools.module.mjs +4 -4
  13. package/esm2022/devkit/configuration-devtools.service.mjs +9 -9
  14. package/esm2022/rules-engine/configuration.handler-action.mjs +3 -3
  15. package/esm2022/rules-engine/configuration.rules-engine.module.mjs +4 -4
  16. package/esm2022/services/configuration/configuration.base.module.mjs +4 -4
  17. package/esm2022/services/configuration/configuration.base.service.mjs +4 -4
  18. package/esm2022/stores/config-override/config-override.module.mjs +4 -4
  19. package/esm2022/stores/config-override/config-override.sync.mjs +1 -1
  20. package/esm2022/stores/configuration/configuration.module.mjs +4 -4
  21. package/esm2022/stores/configuration/configuration.sync.mjs +1 -1
  22. package/esm2022/tools/configuration.decorators.mjs +35 -0
  23. package/esm2022/tools/configuration.observer.mjs +1 -1
  24. package/esm2022/tools/configuration.signal.mjs +19 -0
  25. package/esm2022/tools/index.mjs +3 -2
  26. package/fesm2022/o3r-configuration-rules-engine.mjs +7 -7
  27. package/fesm2022/o3r-configuration.mjs +83 -57
  28. package/fesm2022/o3r-configuration.mjs.map +1 -1
  29. package/migration.json +10 -0
  30. package/package.json +15 -12
  31. package/schematics/configuration-to-component/index.d.ts +6 -2
  32. package/schematics/configuration-to-component/index.d.ts.map +1 -1
  33. package/schematics/configuration-to-component/index.js +102 -18
  34. package/schematics/configuration-to-component/index.js.map +1 -1
  35. package/schematics/configuration-to-component/schema.d.ts +2 -0
  36. package/schematics/configuration-to-component/schema.d.ts.map +1 -1
  37. package/schematics/configuration-to-component/schema.json +5 -0
  38. package/schematics/ng-add/index.d.ts +2 -2
  39. package/schematics/ng-add/index.d.ts.map +1 -1
  40. package/schematics/ng-add/index.js +55 -45
  41. package/schematics/ng-add/index.js.map +1 -1
  42. package/schematics/ng-add/schema.d.ts +2 -0
  43. package/schematics/ng-add/schema.d.ts.map +1 -1
  44. package/schematics/ng-add/schema.json +5 -0
  45. package/schematics/ng-update/v10-3/index.d.ts +6 -0
  46. package/schematics/ng-update/v10-3/index.d.ts.map +1 -0
  47. package/schematics/ng-update/v10-3/index.js +21 -0
  48. package/schematics/ng-update/v10-3/index.js.map +1 -0
  49. package/schematics/use-config-signal/index.d.ts +8 -0
  50. package/schematics/use-config-signal/index.d.ts.map +1 -0
  51. package/schematics/use-config-signal/index.js +95 -0
  52. package/schematics/use-config-signal/index.js.map +1 -0
  53. package/schematics/use-config-signal/schema.d.ts +8 -0
  54. package/schematics/use-config-signal/schema.d.ts.map +1 -0
  55. package/schematics/use-config-signal/schema.js +3 -0
  56. package/schematics/use-config-signal/schema.js.map +1 -0
  57. package/schematics/use-config-signal/schema.json +21 -0
  58. package/tools/configuration.decorators.d.ts +10 -0
  59. package/tools/configuration.decorators.d.ts.map +1 -0
  60. package/tools/configuration.signal.d.ts +16 -0
  61. package/tools/configuration.signal.d.ts.map +1 -0
  62. package/tools/index.d.ts +2 -1
  63. package/tools/index.d.ts.map +1 -1
  64. package/esm2022/tools/configuration.decorator.mjs +0 -26
  65. package/tools/configuration.decorator.d.ts +0 -5
  66. package/tools/configuration.decorator.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../schematics/use-config-signal/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,MAAM,WAAW,iCAAkC,SAAQ,qBAAqB;IAC9E,4BAA4B;IAC5B,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,UAAU,EAAE,OAAO,CAAC;CACrB"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=schema.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../schematics/use-config-signal/schema.ts"],"names":[],"mappings":""}
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema",
3
+ "$id": "NgUseConfigSignalSchematicsSchema",
4
+ "title": "Migrate from configuration observable to signal",
5
+ "description": "Migrate from configuration observable to signal",
6
+ "properties": {
7
+ "path": {
8
+ "type": "string",
9
+ "description": "Path to the component"
10
+ },
11
+ "skipLinter": {
12
+ "type": "boolean",
13
+ "description": "Skip the linter process",
14
+ "default": false
15
+ }
16
+ },
17
+ "additionalProperties": true,
18
+ "required": [
19
+ "path"
20
+ ]
21
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Decorator to identify the configuration observer
3
+ * @deprecated please use O3rConfig, will be removed in v12
4
+ */
5
+ export declare function ConfigObserver(): (target: any, key: string) => void;
6
+ /**
7
+ * Decorator to identify the component's configuration
8
+ */
9
+ export declare function O3rConfig(): (target: any, key: string) => void;
10
+ //# sourceMappingURL=configuration.decorators.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.decorators.d.ts","sourceRoot":"","sources":["../../src/tools/configuration.decorators.ts"],"names":[],"mappings":"AAwBA;;;GAGG;AAEH,wBAAgB,cAAc,uCAE7B;AAED;;GAEG;AAEH,wBAAgB,SAAS,uCAExB"}
@@ -0,0 +1,16 @@
1
+ import type { InputSignal, Signal } from '@angular/core';
2
+ import type { Configuration } from '@o3r/core';
3
+ import type { ConfigurationBaseService } from '../services';
4
+ /** Configuration signal */
5
+ export type ConfigurationSignal<T> = Signal<T> & {
6
+ configId: string;
7
+ };
8
+ /**
9
+ * Get a configuration signal
10
+ * @param configInput
11
+ * @param configId
12
+ * @param defaultConfig
13
+ * @param configurationService
14
+ */
15
+ export declare const configSignal: <T extends Configuration>(configInput: InputSignal<Partial<T> | undefined>, configId: string, defaultConfig: T, configurationService?: ConfigurationBaseService | null) => ConfigurationSignal<T>;
16
+ //# sourceMappingURL=configuration.signal.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"configuration.signal.d.ts","sourceRoot":"","sources":["../../src/tools/configuration.signal.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAEzD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAG/C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAC;AAE5D,2BAA2B;AAC3B,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,CAAC,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE;;;;;;GAMG;AACH,eAAO,MAAM,YAAY,yCACV,YAAY,QAAQ,CAAC,CAAC,GAAG,SAAS,CAAC,YACtC,MAAM,iBACD,CAAC,yBACO,wBAAwB,GAAG,IAAI,KACrD,oBAAoB,CAAC,CAcvB,CAAC"}
package/tools/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
- export * from './configuration.decorator';
1
+ export * from './configuration.decorators';
2
2
  export * from './configuration.observer';
3
+ export * from './configuration.signal';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/tools/index.ts"],"names":[],"mappings":"AAAA,cAAc,4BAA4B,CAAC;AAC3C,cAAc,0BAA0B,CAAC;AACzC,cAAc,wBAAwB,CAAC"}
@@ -1,26 +0,0 @@
1
- import { otterComponentInfoPropertyName } from '@o3r/core';
2
- /**
3
- * Decorator to identify the configuration observer
4
- */
5
- // eslint-disable-next-line @typescript-eslint/naming-convention
6
- export function ConfigObserver() {
7
- return (target, key) => {
8
- const privateField = `_${key}`;
9
- if (delete target[key]) {
10
- Object.defineProperty(target, key, {
11
- get: function () {
12
- return this[privateField];
13
- },
14
- set: function (value) {
15
- this[privateField] = value;
16
- if (this[otterComponentInfoPropertyName]) {
17
- this[otterComponentInfoPropertyName].configId = this[privateField].configId;
18
- }
19
- },
20
- enumerable: true,
21
- configurable: true
22
- });
23
- }
24
- };
25
- }
26
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbi5kZWNvcmF0b3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvdG9vbHMvY29uZmlndXJhdGlvbi5kZWNvcmF0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFpQiw4QkFBOEIsRUFBRSxNQUFNLFdBQVcsQ0FBQztBQUcxRTs7R0FFRztBQUNILGdFQUFnRTtBQUNoRSxNQUFNLFVBQVUsY0FBYztJQUM1QixPQUFPLENBQUMsTUFBVyxFQUFFLEdBQVcsRUFBRSxFQUFFO1FBQ2xDLE1BQU0sWUFBWSxHQUFHLElBQUksR0FBRyxFQUFFLENBQUM7UUFFL0IsSUFBSSxPQUFPLE1BQU0sQ0FBQyxHQUFHLENBQUMsRUFBRTtZQUN0QixNQUFNLENBQUMsY0FBYyxDQUFDLE1BQU0sRUFBRSxHQUFHLEVBQUU7Z0JBQ2pDLEdBQUcsRUFBRTtvQkFDSCxPQUFPLElBQUksQ0FBQyxZQUFZLENB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ICAgICAgZ2V0OiBmdW5jdGlvbiAodGhpczogYW55KSB7XG4gICAgICAgICAgcmV0dXJuIHRoaXNbcHJpdmF0ZUZpZWxkXTtcbiAgICAgICAgfSxcbiAgICAgICAgc2V0OiBmdW5jdGlvbiAodGhpczogYW55LCB2YWx1ZTogUmVjb3JkPHN0cmluZywgdW5rbm93bj4pIHtcbiAgICAgICAgICB0aGlzW3ByaXZhdGVGaWVsZF0gPSB2YWx1ZTtcbiAgICAgICAgICBpZiAodGhpc1tvdHRlckNvbXBvbmVudEluZm9Qcm9wZXJ0eU5hbWVdKSB7XG4gICAgICAgICAgICB0aGlzW290dGVyQ29tcG9uZW50SW5mb1Byb3BlcnR5TmFtZV0uY29uZmlnSWQgPSAodGhpc1twcml2YXRlRmllbGRdIGFzIENvbmZpZ3VyYXRpb25PYnNlcnZlcjxDb25maWd1cmF0aW9uPikuY29uZmlnSWQ7XG4gICAgICAgICAgfVxuICAgICAgICB9LFxuICAgICAgICBlbnVtZXJhYmxlOiB0cnVlLFxuICAgICAgICBjb25maWd1cmFibGU6IHRydWVcbiAgICAgIH0pO1xuICAgIH1cbiAgfTtcbn1cbiJdfQ==
@@ -1,5 +0,0 @@
1
- /**
2
- * Decorator to identify the configuration observer
3
- */
4
- export declare function ConfigObserver(): (target: any, key: string) => void;
5
- //# sourceMappingURL=configuration.decorator.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configuration.decorator.d.ts","sourceRoot":"","sources":["../../src/tools/configuration.decorator.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH,wBAAgB,cAAc,aACZ,GAAG,OAAO,MAAM,UAmBjC"}