Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@equinor/fusion-framework-module

Package Overview
Dependencies
Maintainers
4
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@equinor/fusion-framework-module - npm Package Compare versions

Comparing version 4.2.6 to 4.2.7

dist/esm/utils/dot-path.js

214

CHANGELOG.md
# Change Log
## 4.2.7
### Patch Changes
- [#1792](https://github.com/equinor/fusion-framework/pull/1792) [`152cf73`](https://github.com/equinor/fusion-framework/commit/152cf73d39eb32ccbaddaa6941e315c437c4972d) Thanks [@odinr](https://github.com/odinr)! - improve resolve of dot path for BaseConfigBuilder
## 4.2.6

@@ -7,3 +13,3 @@

- [#1595](https://github.com/equinor/fusion-framework/pull/1595) [`9c24e84`](https://github.com/equinor/fusion-framework/commit/9c24e847d041dea8384c77439e6b237f5bdb3125) Thanks [@Gustav-Eikaas](https://github.com/Gustav-Eikaas)! - support for module resolution NodeNext & Bundler
- [#1595](https://github.com/equinor/fusion-framework/pull/1595) [`9c24e84`](https://github.com/equinor/fusion-framework/commit/9c24e847d041dea8384c77439e6b237f5bdb3125) Thanks [@Gustav-Eikaas](https://github.com/Gustav-Eikaas)! - support for module resolution NodeNext & Bundler

@@ -14,3 +20,3 @@ ## 4.2.5

- [`b5dfe5d2`](https://github.com/equinor/fusion-framework/commit/b5dfe5d29a249e0cca6c9589322931dfedd06acc) Thanks [@odinr](https://github.com/odinr)! - force patch bump, realign missing snapshot
- [`b5dfe5d2`](https://github.com/equinor/fusion-framework/commit/b5dfe5d29a249e0cca6c9589322931dfedd06acc) Thanks [@odinr](https://github.com/odinr)! - force patch bump, realign missing snapshot

@@ -21,3 +27,3 @@ ## 4.2.4

- [`9076a498`](https://github.com/equinor/fusion-framework/commit/9076a49876e7a414a27557b7fb9095a67fe3a57f) Thanks [@odinr](https://github.com/odinr)! - replace `scan` + `last` whith `reduce` in `BaseConfigBuilder._buildConfig`
- [`9076a498`](https://github.com/equinor/fusion-framework/commit/9076a49876e7a414a27557b7fb9095a67fe3a57f) Thanks [@odinr](https://github.com/odinr)! - replace `scan` + `last` whith `reduce` in `BaseConfigBuilder._buildConfig`

@@ -28,9 +34,9 @@ ## 4.2.3

- [#1109](https://github.com/equinor/fusion-framework/pull/1109) [`7ec195d4`](https://github.com/equinor/fusion-framework/commit/7ec195d42098fec8794db13e83b71ef7753ff862) Thanks [@odinr](https://github.com/odinr)! - Change packaged manager from yarn to pnpm
- [#1109](https://github.com/equinor/fusion-framework/pull/1109) [`7ec195d4`](https://github.com/equinor/fusion-framework/commit/7ec195d42098fec8794db13e83b71ef7753ff862) Thanks [@odinr](https://github.com/odinr)! - Change packaged manager from yarn to pnpm
conflicts of `@types/react` made random outcomes when using `yarn`
conflicts of `@types/react` made random outcomes when using `yarn`
this change should not affect consumer of the packages, but might conflict dependent on local package manager.
this change should not affect consumer of the packages, but might conflict dependent on local package manager.
- [#1145](https://github.com/equinor/fusion-framework/pull/1145) [`d276fc5d`](https://github.com/equinor/fusion-framework/commit/d276fc5d514566d05c64705076a1cb91c6a44272) Thanks [@dependabot](https://github.com/apps/dependabot)! - build(deps): bump rxjs from 7.5.7 to [7.8.1](https://github.com/ReactiveX/rxjs/blob/7.8.1/CHANGELOG.md)
- [#1145](https://github.com/equinor/fusion-framework/pull/1145) [`d276fc5d`](https://github.com/equinor/fusion-framework/commit/d276fc5d514566d05c64705076a1cb91c6a44272) Thanks [@dependabot](https://github.com/apps/dependabot)! - build(deps): bump rxjs from 7.5.7 to [7.8.1](https://github.com/ReactiveX/rxjs/blob/7.8.1/CHANGELOG.md)

@@ -41,5 +47,5 @@ ## 4.2.2

- [#1047](https://github.com/equinor/fusion-framework/pull/1047) [`1a2880d2`](https://github.com/equinor/fusion-framework/commit/1a2880d2e4c80ac5ce08f63ca3699fe77e4b565c) Thanks [@dependabot](https://github.com/apps/dependabot)! - build(deps): bump @typescript-eslint/eslint-plugin from 5.59.11 to 6.1.0
- [#1047](https://github.com/equinor/fusion-framework/pull/1047) [`1a2880d2`](https://github.com/equinor/fusion-framework/commit/1a2880d2e4c80ac5ce08f63ca3699fe77e4b565c) Thanks [@dependabot](https://github.com/apps/dependabot)! - build(deps): bump @typescript-eslint/eslint-plugin from 5.59.11 to 6.1.0
only style semantics updated
only style semantics updated

@@ -50,3 +56,3 @@ ## 4.2.1

- [#946](https://github.com/equinor/fusion-framework/pull/946) [`5a160d88`](https://github.com/equinor/fusion-framework/commit/5a160d88981ddfe861d391cfefe10f54dda3d352) Thanks [@odinr](https://github.com/odinr)! - Build/update typescript to 5
- [#946](https://github.com/equinor/fusion-framework/pull/946) [`5a160d88`](https://github.com/equinor/fusion-framework/commit/5a160d88981ddfe861d391cfefe10f54dda3d352) Thanks [@odinr](https://github.com/odinr)! - Build/update typescript to 5

@@ -57,82 +63,82 @@ ## 4.2.0

- [#902](https://github.com/equinor/fusion-framework/pull/902) [`3efbf0bb`](https://github.com/equinor/fusion-framework/commit/3efbf0bb93fc11aa158872cd6ab98a22bcfb59e5) Thanks [@odinr](https://github.com/odinr)! - **Feat(module)** add base module class
- [#902](https://github.com/equinor/fusion-framework/pull/902) [`3efbf0bb`](https://github.com/equinor/fusion-framework/commit/3efbf0bb93fc11aa158872cd6ab98a22bcfb59e5) Thanks [@odinr](https://github.com/odinr)! - **Feat(module)** add base module class
As a module developer there should be a base provider class to extend, which handles basic wireing.
As a module developer there should be a base provider class to extend, which handles basic wireing.
Some aspects of providers should be the same for all, like `version` handling.
Some aspects of providers should be the same for all, like `version` handling.
These new features does not change any existing code, only tooling for future development
These new features does not change any existing code, only tooling for future development
- [#882](https://github.com/equinor/fusion-framework/pull/882) [`76b30c1e`](https://github.com/equinor/fusion-framework/commit/76b30c1e86db3db18adbe759bb1e39885de1c898) Thanks [@odinr](https://github.com/odinr)! - Add possibility to add multilevel config for module
- [#882](https://github.com/equinor/fusion-framework/pull/882) [`76b30c1e`](https://github.com/equinor/fusion-framework/commit/76b30c1e86db3db18adbe759bb1e39885de1c898) Thanks [@odinr](https://github.com/odinr)! - Add possibility to add multilevel config for module
```ts
type MyModuleConfig = {
foo: string;
bar?: number;
nested?: { up: boolean };
};
```ts
type MyModuleConfig = {
foo: string;
bar?: number;
nested?: { up: boolean };
};
class MyModuleConfigurator extends BaseConfigBuilder<MyModuleConfig> {
public setFoo(cb: ModuleConfigCallback<string>) {
this._set('foo', cb);
}
class MyModuleConfigurator extends BaseConfigBuilder<MyModuleConfig> {
public setFoo(cb: ModuleConfigCallback<string>) {
this._set("foo", cb);
}
public setBar(cb: ModuleConfigCallback<number>) {
this._set('bar', cb);
}
public setBar(cb: ModuleConfigCallback<number>) {
this._set("bar", cb);
}
public setUp(cb: ModuleConfigCallback<boolean>) {
this._set('nested.up', cb);
}
public setUp(cb: ModuleConfigCallback<boolean>) {
this._set("nested.up", cb);
}
```
}
```
- [#902](https://github.com/equinor/fusion-framework/pull/902) [`3efbf0bb`](https://github.com/equinor/fusion-framework/commit/3efbf0bb93fc11aa158872cd6ab98a22bcfb59e5) Thanks [@odinr](https://github.com/odinr)! - **Feat(module): add semver**
- [#902](https://github.com/equinor/fusion-framework/pull/902) [`3efbf0bb`](https://github.com/equinor/fusion-framework/commit/3efbf0bb93fc11aa158872cd6ab98a22bcfb59e5) Thanks [@odinr](https://github.com/odinr)! - **Feat(module): add semver**
In some cases other modules might require features in sibling modules
In some cases other modules might require features in sibling modules
```ts
if (modules.context.version.satisfies('>=7.2')) {
// do some code
} else {
throw Error(
'this feature requires ContextModule of 7.2 or higher, please update depencies',
);
}
```
```ts
if (modules.context.version.satisfies(">=7.2")) {
// do some code
} else {
throw Error(
"this feature requires ContextModule of 7.2 or higher, please update depencies",
);
}
```
Usage:
Usage:
- log telemetry about module usage and outdated application
- debug code runtime by knowing version of implementation
- write inter-opt when breaking changes accour
- log telemetry about module usage and outdated application
- debug code runtime by knowing version of implementation
- write inter-opt when breaking changes accour
### Patch Changes
- [#907](https://github.com/equinor/fusion-framework/pull/907) [`7500ec2c`](https://github.com/equinor/fusion-framework/commit/7500ec2c9ca9b926a19539fc97c61c67f76fc8d9) Thanks [@odinr](https://github.com/odinr)! - export `lib` assets:
- [#907](https://github.com/equinor/fusion-framework/pull/907) [`7500ec2c`](https://github.com/equinor/fusion-framework/commit/7500ec2c9ca9b926a19539fc97c61c67f76fc8d9) Thanks [@odinr](https://github.com/odinr)! - export `lib` assets:
- SemanticVersion
- ModuleProvider
- SemanticVersion
- ModuleProvider
- [#913](https://github.com/equinor/fusion-framework/pull/913) [`83ee5abf`](https://github.com/equinor/fusion-framework/commit/83ee5abf7bcab193c85980e5ae44895cd7f6f08d) Thanks [@odinr](https://github.com/odinr)! - **Change base behavior of BaseModuleProvider**
- [#913](https://github.com/equinor/fusion-framework/pull/913) [`83ee5abf`](https://github.com/equinor/fusion-framework/commit/83ee5abf7bcab193c85980e5ae44895cd7f6f08d) Thanks [@odinr](https://github.com/odinr)! - **Change base behavior of BaseModuleProvider**
because of weird limitations of JavaScript, private fields are not accessible until all constructors are initialized (from ancestor to current child).
This causes the `abstract` init function could not access private members when overridden.
because of weird limitations of JavaScript, private fields are not accessible until all constructors are initialized (from ancestor to current child).
This causes the `abstract` init function could not access private members when overridden.
- **removed** `init` from `BaseModuleProvider`
- _this is a breaking change, but not yet published, yet the `patch` version_
- https://github.com/equinor/fusion-framework/blob/43854d9538ade189483c43e04b52eff7e1aa3b0c/packages/modules/module/src/lib/provider/BaseModuleProvider.ts#L31
- **added** `provider` sub-scope for package
- **removed** `init` from `BaseModuleProvider`
- _this is a breaking change, but not yet published, yet the `patch` version_
- https://github.com/equinor/fusion-framework/blob/43854d9538ade189483c43e04b52eff7e1aa3b0c/packages/modules/module/src/lib/provider/BaseModuleProvider.ts#L31
- **added** `provider` sub-scope for package
> The usage when extending `BaseModuleProvider` is not as 😘, but now works
> The usage when extending `BaseModuleProvider` is not as 😘, but now works
- [#907](https://github.com/equinor/fusion-framework/pull/907) [`7500ec2c`](https://github.com/equinor/fusion-framework/commit/7500ec2c9ca9b926a19539fc97c61c67f76fc8d9) Thanks [@odinr](https://github.com/odinr)! - allow `SemanticVersion` as `version` in ctor args for `BaseModuleProvider`
- [#907](https://github.com/equinor/fusion-framework/pull/907) [`7500ec2c`](https://github.com/equinor/fusion-framework/commit/7500ec2c9ca9b926a19539fc97c61c67f76fc8d9) Thanks [@odinr](https://github.com/odinr)! - allow `SemanticVersion` as `version` in ctor args for `BaseModuleProvider`
- [#924](https://github.com/equinor/fusion-framework/pull/924) [`060818eb`](https://github.com/equinor/fusion-framework/commit/060818eb04ebb9ed6deaed1f0b4530201b1181cf) Thanks [@asbjornhaland](https://github.com/asbjornhaland)! - fix(module): add config builder callback args to process config method so that
- [#924](https://github.com/equinor/fusion-framework/pull/924) [`060818eb`](https://github.com/equinor/fusion-framework/commit/060818eb04ebb9ed6deaed1f0b4530201b1181cf) Thanks [@asbjornhaland](https://github.com/asbjornhaland)! - fix(module): add config builder callback args to process config method so that
- [#905](https://github.com/equinor/fusion-framework/pull/905) [`a7858a1c`](https://github.com/equinor/fusion-framework/commit/a7858a1c01542e2dc94370709f122b4b99c3219c) Thanks [@odinr](https://github.com/odinr)! - **🚧 Chore: dedupe packages**
- [#905](https://github.com/equinor/fusion-framework/pull/905) [`a7858a1c`](https://github.com/equinor/fusion-framework/commit/a7858a1c01542e2dc94370709f122b4b99c3219c) Thanks [@odinr](https://github.com/odinr)! - **🚧 Chore: dedupe packages**
- align all versions of typescript
- update types to build
- a couple of typecasts did not [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#satisfies-support-in-jsdoc) and was recasted as `unknwon`, marked with `TODO`, should be fixed in future
- align all versions of typescript
- update types to build
- a couple of typecasts did not [satisfies](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-5-0.html#satisfies-support-in-jsdoc) and was recasted as `unknwon`, marked with `TODO`, should be fixed in future

@@ -146,3 +152,3 @@ All notable changes to this project will be documented in this file.

- **module:** create base configurator ([f94b51e](https://github.com/equinor/fusion-framework/commit/f94b51e53d6ae235456e2ea2b5a82db5aa1a18f0))
- **module:** create base configurator ([f94b51e](https://github.com/equinor/fusion-framework/commit/f94b51e53d6ae235456e2ea2b5a82db5aa1a18f0))

@@ -153,7 +159,7 @@ ## 4.0.0 (2023-05-05)

- **modules:** postInitialize no longer support void function, should not affect any application, only used internally
- **modules:** postInitialize no longer support void function, should not affect any application, only used internally
### Features
- **modules:** change postInitialize to return ObservableInput ([f1c2f56](https://github.com/equinor/fusion-framework/commit/f1c2f5644c6db2405bf5747a1094548e1723cce1))
- **modules:** change postInitialize to return ObservableInput ([f1c2f56](https://github.com/equinor/fusion-framework/commit/f1c2f5644c6db2405bf5747a1094548e1723cce1))

@@ -180,3 +186,3 @@ ## 3.0.0 (2023-04-16)

- **module:** add base module config builder ([5a897b7](https://github.com/equinor/fusion-framework/commit/5a897b762a3a9139a1de025d1b1f4ae162079028))
- **module:** add base module config builder ([5a897b7](https://github.com/equinor/fusion-framework/commit/5a897b762a3a9139a1de025d1b1f4ae162079028))

@@ -191,3 +197,3 @@ ## 1.2.10 (2022-12-01)

- **module-msal:** await redirect handling ([92686d2](https://github.com/equinor/fusion-framework/commit/92686d2ae054d7f507093b839edb2fe5775c7449))
- **module-msal:** await redirect handling ([92686d2](https://github.com/equinor/fusion-framework/commit/92686d2ae054d7f507093b839edb2fe5775c7449))

@@ -198,3 +204,3 @@ ## 1.2.8 (2022-11-03)

- **module:** allow debug logging ([315f845](https://github.com/equinor/fusion-framework/commit/315f845e78469a05f27793a56dd281832e7b5dd7))
- **module:** allow debug logging ([315f845](https://github.com/equinor/fusion-framework/commit/315f845e78469a05f27793a56dd281832e7b5dd7))

@@ -213,3 +219,3 @@ ## 1.2.7 (2022-11-02)

- **module:** update typing ([9428770](https://github.com/equinor/fusion-framework/commit/9428770eca39d5e5afe00b94d0d09a688fc821b0))
- **module:** update typing ([9428770](https://github.com/equinor/fusion-framework/commit/9428770eca39d5e5afe00b94d0d09a688fc821b0))

@@ -220,3 +226,3 @@ ## [1.2.4](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module@1.2.3...@equinor/fusion-framework-module@1.2.4) (2022-10-17)

- expose init interface for modules ([208cf79](https://github.com/equinor/fusion-framework/commit/208cf792b83d093a0c9ba1cdf919b4196e442989))
- expose init interface for modules ([208cf79](https://github.com/equinor/fusion-framework/commit/208cf792b83d093a0c9ba1cdf919b4196e442989))

@@ -231,3 +237,3 @@ ## 1.2.3 (2022-10-03)

- **module:** update interface for logging ([fc23ea3](https://github.com/equinor/fusion-framework/commit/fc23ea3602c0b18b3f54de584773f76ffe63617c))
- **module:** update interface for logging ([fc23ea3](https://github.com/equinor/fusion-framework/commit/fc23ea3602c0b18b3f54de584773f76ffe63617c))

@@ -238,3 +244,3 @@ ## 1.2.1 (2022-09-27)

- update registering of configuration ([20942ce](https://github.com/equinor/fusion-framework/commit/20942ce1c7a853ea3b55c031a242646e378db8c9))
- update registering of configuration ([20942ce](https://github.com/equinor/fusion-framework/commit/20942ce1c7a853ea3b55c031a242646e378db8c9))

@@ -245,3 +251,3 @@ ## 1.2.0 (2022-09-20)

- **module:** add has module check ([e32cf7b](https://github.com/equinor/fusion-framework/commit/e32cf7b751854ae8e306bb1d6a84260099752714))
- **module:** add has module check ([e32cf7b](https://github.com/equinor/fusion-framework/commit/e32cf7b751854ae8e306bb1d6a84260099752714))

@@ -260,3 +266,3 @@ ## [1.1.3](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module@1.1.2...@equinor/fusion-framework-module@1.1.3) (2022-09-14)

- update typings and linting ([7d2056b](https://github.com/equinor/fusion-framework/commit/7d2056b7866850b7efdfd4567385b5dbbcdf8761))
- update typings and linting ([7d2056b](https://github.com/equinor/fusion-framework/commit/7d2056b7866850b7efdfd4567385b5dbbcdf8761))

@@ -267,3 +273,3 @@ ## [1.1.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module@1.0.1...@equinor/fusion-framework-module@1.1.0) (2022-09-13)

- **module:** allow setting log levels ([017b5b3](https://github.com/equinor/fusion-framework/commit/017b5b34645aa001297f37e7aef5557e9027beee))
- **module:** allow setting log levels ([017b5b3](https://github.com/equinor/fusion-framework/commit/017b5b34645aa001297f37e7aef5557e9027beee))

@@ -286,12 +292,12 @@ ## [1.0.1](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module@1.0.1-next.1...@equinor/fusion-framework-module@1.0.1) (2022-09-12)

- **module:** initialize modules now takes configurator object as argument.
- **module:** initialize modules now takes configurator object as argument.
### Features
- **module:** rewrite config to object ([74566f3](https://github.com/equinor/fusion-framework/commit/74566f36eb73c63e1e25df05d89f6f6490dc8272))
- **module:** rewrite config to object ([74566f3](https://github.com/equinor/fusion-framework/commit/74566f36eb73c63e1e25df05d89f6f6490dc8272))
### Bug Fixes
- **module:** await all creation of configs ([25649a4](https://github.com/equinor/fusion-framework/commit/25649a4a6bc4249f2fe996c0bdf735a7ebd42186))
- **module:** expose logger ([c88574a](https://github.com/equinor/fusion-framework/commit/c88574a61d368841dd648c511d80cad2e5efd7c6))
- **module:** await all creation of configs ([25649a4](https://github.com/equinor/fusion-framework/commit/25649a4a6bc4249f2fe996c0bdf735a7ebd42186))
- **module:** expose logger ([c88574a](https://github.com/equinor/fusion-framework/commit/c88574a61d368841dd648c511d80cad2e5efd7c6))

@@ -302,12 +308,12 @@ ## [1.0.0-alpha.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module@0.4.4...@equinor/fusion-framework-module@1.0.0-alpha.0) (2022-09-12)

- **module:** initialize modules now takes configurator object as argument.
- **module:** initialize modules now takes configurator object as argument.
### Features
- **module:** rewrite config to object ([74566f3](https://github.com/equinor/fusion-framework/commit/74566f36eb73c63e1e25df05d89f6f6490dc8272))
- **module:** rewrite config to object ([74566f3](https://github.com/equinor/fusion-framework/commit/74566f36eb73c63e1e25df05d89f6f6490dc8272))
### Bug Fixes
- **module:** await all creation of configs ([25649a4](https://github.com/equinor/fusion-framework/commit/25649a4a6bc4249f2fe996c0bdf735a7ebd42186))
- **module:** expose logger ([c88574a](https://github.com/equinor/fusion-framework/commit/c88574a61d368841dd648c511d80cad2e5efd7c6))
- **module:** await all creation of configs ([25649a4](https://github.com/equinor/fusion-framework/commit/25649a4a6bc4249f2fe996c0bdf735a7ebd42186))
- **module:** expose logger ([c88574a](https://github.com/equinor/fusion-framework/commit/c88574a61d368841dd648c511d80cad2e5efd7c6))

@@ -326,3 +332,3 @@ ## 0.4.4 (2022-09-05)

- improve logging of initializing modules ([f313bca](https://github.com/equinor/fusion-framework/commit/f313bca19103356f9d1a2bc09b57d4ff975e46a0))
- improve logging of initializing modules ([f313bca](https://github.com/equinor/fusion-framework/commit/f313bca19103356f9d1a2bc09b57d4ff975e46a0))

@@ -333,34 +339,34 @@ ## [0.4.1](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module@0.4.0...@equinor/fusion-framework-module@0.4.1) (2022-08-15)

- enhance post initialize ([4d10184](https://github.com/equinor/fusion-framework/commit/4d10184bf89d8968360be726ec3885444999ef8f))
- enhance post initialize ([4d10184](https://github.com/equinor/fusion-framework/commit/4d10184bf89d8968360be726ec3885444999ef8f))
# 0.4.0 (2022-08-11)
- feat!: allow modules to displose ([32b69fb](https://github.com/equinor/fusion-framework/commit/32b69fb7cc61e78e503e67d0e77f21fb44b600b9))
- feat!: allow modules to displose ([32b69fb](https://github.com/equinor/fusion-framework/commit/32b69fb7cc61e78e503e67d0e77f21fb44b600b9))
### BREAKING CHANGES
- module.initialize now has object as arg
- module.initialize now has object as arg
# [0.3.0](https://github.com/equinor/fusion-framework/compare/@equinor/fusion-framework-module@0.2.8...@equinor/fusion-framework-module@0.3.0) (2022-08-04)
- feat(module)!: allow requireing module instnce (#190) ([3a7e67e](https://github.com/equinor/fusion-framework/commit/3a7e67e9accb5185100325c92d5850a44626e498)), closes [#190](https://github.com/equinor/fusion-framework/issues/190)
- feat(module)!: allow requireing module instnce (#190) ([3a7e67e](https://github.com/equinor/fusion-framework/commit/3a7e67e9accb5185100325c92d5850a44626e498)), closes [#190](https://github.com/equinor/fusion-framework/issues/190)
### BREAKING CHANGES
- `deps` prop is remove from module object, use `await require('MODULE')`;
- `deps` prop is remove from module object, use `await require('MODULE')`;
- feat(module)!: allow requireing module instnce
- feat(module)!: allow requireing module instnce
when module initiates it should be allowed to await an required module.
- add method for awaiting required module
- add typing for config in initialize fase
- add method for awaiting required module
- add typing for config in initialize fase
- update service discovery to await http module
- add service discovery client
- allow configuration of service discovery client
- update service discovery to await http module
- add service discovery client
- allow configuration of service discovery client
* `deps` prop is remove from module object, use `await require('MODULE')`;
* `deps` prop is remove from module object, use `await require('MODULE')`;
* fix(module-http): add default interface for HttpClientOptions
* fix(module-http): add default interface for HttpClientOptions

@@ -403,3 +409,3 @@ ## 0.2.8 (2022-08-01)

- **module:** allow modules to have deps ([#128](https://github.com/equinor/fusion-framework/issues/128)) ([2466b1a](https://github.com/equinor/fusion-framework/commit/2466b1ad9d43aa472da9daf8c59b350844c0dae9))
- **module:** allow modules to have deps ([#128](https://github.com/equinor/fusion-framework/issues/128)) ([2466b1a](https://github.com/equinor/fusion-framework/commit/2466b1ad9d43aa472da9daf8c59b350844c0dae9))

@@ -414,8 +420,8 @@ ## 0.1.1 (2022-02-09)

- **react-app:** fix AppConfigurator interface ([e5a8a21](https://github.com/equinor/fusion-framework/commit/e5a8a21ff6a558876e3db9a2596e891d9abea0cd))
- **react-app:** fix AppConfigurator interface ([e5a8a21](https://github.com/equinor/fusion-framework/commit/e5a8a21ff6a558876e3db9a2596e891d9abea0cd))
### Features
- add package for creating framework modules ([4020a1e](https://github.com/equinor/fusion-framework/commit/4020a1e444d990e62f5fd4371302fff01b73616c))
- **framework:** allow registering config, init hooks from config ([5f12718](https://github.com/equinor/fusion-framework/commit/5f1271817b73dccbb5c0b69389877c4278e6920e))
- **reat-app:** add default modules ([74bf60e](https://github.com/equinor/fusion-framework/commit/74bf60ec07ea9573901d4160de5d4252e6e9c167))
- add package for creating framework modules ([4020a1e](https://github.com/equinor/fusion-framework/commit/4020a1e444d990e62f5fd4371302fff01b73616c))
- **framework:** allow registering config, init hooks from config ([5f12718](https://github.com/equinor/fusion-framework/commit/5f1271817b73dccbb5c0b69389877c4278e6920e))
- **reat-app:** add default modules ([74bf60e](https://github.com/equinor/fusion-framework/commit/74bf60ec07ea9573901d4160de5d4252e6e9c167))

@@ -1,2 +0,2 @@

export const version = '4.2.6';
export const version = '4.2.7';
//# sourceMappingURL=version.js.map
import { type Observable, type ObservableInput } from 'rxjs';
import { Modules, ModuleType } from './types';
type ConfigPropType<T, Path extends string> = string extends Path ? unknown : Path extends keyof T ? T[Path] : Path extends `${infer K}.${infer R}` ? K extends keyof T ? ConfigPropType<T[K], R> : unknown : unknown;
type DotPrefix<T extends string> = T extends '' ? '' : `.${T}`;
type DotNestedKeys<T> = (T extends object ? {
[K in Exclude<keyof T, symbol>]: K | `${K}${DotPrefix<DotNestedKeys<T[K]>>}`;
}[Exclude<keyof T, symbol>] : '') extends infer D ? Extract<D, string> : never;
import { type DotPath, type DotPathType } from './utils/dot-path';
export type ConfigBuilderCallbackArgs<TConfig = unknown, TRef = unknown> = {

@@ -17,7 +13,7 @@ config: TConfig;

export type ConfigBuilderCallback<TReturn = unknown> = (args: ConfigBuilderCallbackArgs) => TReturn | ObservableInput<TReturn>;
export declare abstract class BaseConfigBuilder<TConfig = unknown> {
export declare abstract class BaseConfigBuilder<TConfig extends object = Record<string, unknown>> {
#private;
createConfig(init: ConfigBuilderCallbackArgs, initial?: Partial<TConfig>): Observable<TConfig>;
createConfigAsync(init: ConfigBuilderCallbackArgs, initial?: Partial<TConfig>): Promise<TConfig>;
protected _set<TTarget extends DotNestedKeys<TConfig>>(target: TTarget, cb: ConfigBuilderCallback<ConfigPropType<TConfig, TTarget>>): void;
protected _set<TTarget extends DotPath<TConfig>>(target: TTarget, cb: ConfigBuilderCallback<DotPathType<TConfig, TTarget>>): void;
protected _createConfig(init: ConfigBuilderCallbackArgs, initial?: Partial<TConfig>): Observable<TConfig>;

@@ -27,2 +23,1 @@ protected _buildConfig(init: ConfigBuilderCallbackArgs, initial?: Partial<TConfig>): Observable<Partial<TConfig>>;

}
export {};

@@ -1,1 +0,1 @@

export declare const version = "4.2.6";
export declare const version = "4.2.7";
{
"name": "@equinor/fusion-framework-module",
"version": "4.2.6",
"version": "4.2.7",
"description": "",

@@ -43,3 +43,3 @@ "main": "dist/esm/index.js",

"devDependencies": {
"@types/node": "^20.4.9",
"@types/node": "^20.11.14",
"@types/semver": "^7.5.0",

@@ -46,0 +46,0 @@ "typescript": "^5.1.3"

import { from, lastValueFrom, of, type Observable, type ObservableInput } from 'rxjs';
import { mergeMap, reduce } from 'rxjs/operators';
import { Modules, ModuleType } from './types';
import { type DotPath, type DotPathType } from './utils/dot-path';
type ConfigPropType<T, Path extends string> = string extends Path
? unknown
: Path extends keyof T
? T[Path]
: Path extends `${infer K}.${infer R}`
? K extends keyof T
? ConfigPropType<T[K], R>
: unknown
: unknown;
type DotPrefix<T extends string> = T extends '' ? '' : `.${T}`;
type DotNestedKeys<T> = (
T extends object
? { [K in Exclude<keyof T, symbol>]: K | `${K}${DotPrefix<DotNestedKeys<T[K]>>}` }[Exclude<
keyof T,
symbol
>]
: ''
) extends infer D
? Extract<D, string>
: never;
/** helper function for extracting multilevel attribute keys */

@@ -116,3 +94,3 @@ const assignConfigValue = <T>(

*/
export abstract class BaseConfigBuilder<TConfig = unknown> {
export abstract class BaseConfigBuilder<TConfig extends object = Record<string, unknown>> {
/** internal hashmap of registered callback functions */

@@ -150,5 +128,5 @@ #configCallbacks = {} as Record<string, ConfigBuilderCallback>;

*/
protected _set<TTarget extends DotNestedKeys<TConfig>>(
protected _set<TTarget extends DotPath<TConfig>>(
target: TTarget,
cb: ConfigBuilderCallback<ConfigPropType<TConfig, TTarget>>,
cb: ConfigBuilderCallback<DotPathType<TConfig, TTarget>>,
) {

@@ -155,0 +133,0 @@ this.#configCallbacks[target] = cb;

@@ -22,2 +22,8 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

/**
* Represents a configurator for modules.
*
* @template TModules - The array of modules.
* @template TRef - The reference type.
*/
export interface IModulesConfigurator<

@@ -28,6 +34,23 @@ TModules extends Array<AnyModule> = Array<AnyModule>,

logger: IModuleConsoleLogger;
/**
* Configures the modules using the provided module configurators.
*
* @param configs - The array of module configurators.
*/
configure(...configs: Array<IModuleConfigurator<any, TRef>>): void;
/**
* Adds a module configurator to the list of configurators.
*
* @param config - The module configurator to add.
*/
addConfig<T extends AnyModule>(config: IModuleConfigurator<T, TRef>): void;
/**
* Initializes the modules with the specified reference.
*
* @param ref - The reference object.
* @returns A promise that resolves to the initialized modules instance.
*/
initialize<T extends Array<AnyModule> | unknown>(

@@ -37,2 +60,7 @@ ref?: TRef,

/**
* Registers a callback function to be called when the modules are configured.
*
* @param cb - The callback function.
*/
onConfigured<T>(

@@ -42,2 +70,7 @@ cb: (config: ModulesConfigType<CombinedModules<T, TModules>>) => void | Promise<void>,

/**
* Registers a callback function to be called when the modules are initialized.
*
* @param cb - The callback function.
*/
onInitialized<T extends Array<AnyModule> | unknown>(

@@ -47,2 +80,9 @@ cb: (instance: ModulesInstanceType<CombinedModules<T, TModules>>) => void,

/**
* Disposes the modules instance with the specified reference.
*
* @param instance - The modules instance to dispose.
* @param ref - The reference object.
* @returns A promise that resolves when the disposal is complete.
*/
dispose(instance: ModulesInstanceType<TModules>, ref?: TRef): Promise<void>;

@@ -58,2 +98,5 @@ }

/**
* Error thrown when a required module times out.
*/
class RequiredModuleTimeoutError extends Error {

@@ -66,3 +109,8 @@ constructor() {

/** entry for configuring a module */
/**
* Callback function type for configuring modules.
* @template TRef The reference type.
* @param config The modules configuration.
* @param ref Optional reference parameter.
*/
type ModulesConfiguratorConfigCallback<TRef> = (

@@ -73,17 +121,39 @@ config: ModulesConfig<[AnyModule]>,

/**
* Configurator class for modules.
* @template TModules - Array of modules.
* @template TRef - Reference type.
*/
export class ModulesConfigurator<TModules extends Array<AnyModule> = Array<AnyModule>, TRef = any>
implements IModulesConfigurator<TModules, TRef>
{
/**
* Logger instance for the configurator.
*/
public logger: ModuleConsoleLogger = new ModuleConsoleLogger('ModulesConfigurator');
/**
* Array of configuration callbacks.
*/
protected _configs: Array<ModulesConfiguratorConfigCallback<TRef>> = [];
// eslint-disable-next-line @typescript-eslint/no-unused-vars
/**
* Array of callbacks to be executed after configuration.
*/
protected _afterConfiguration: Array<(config: any) => void> = [];
// eslint-disable-next-line @typescript-eslint/no-unused-vars
/**
* Array of callbacks to be executed after initialization.
*/
protected _afterInit: Array<(instance: any) => void> = [];
/**
* Set of modules.
*/
protected _modules: Set<AnyModule>;
/**
* Constructs a new ModulesConfigurator instance.
* @param modules - Array of modules.
*/
constructor(modules?: Array<AnyModule>) {

@@ -93,2 +163,6 @@ this._modules = new Set(modules);

/**
* Gets the array of modules.
* @returns Array of modules.
*/
get modules(): Array<AnyModule> {

@@ -98,2 +172,6 @@ return [...this._modules];

/**
* Configures the modules with the provided configurators.
* @param configs - Array of module configurators.
*/
public configure(...configs: Array<IModuleConfigurator<any, TRef>>) {

@@ -103,2 +181,6 @@ configs.forEach((x) => this.addConfig(x));

/**
* Adds a module configurator.
* @param config - Module configurator.
*/
public addConfig<T extends AnyModule>(config: IModuleConfigurator<T, TRef>) {

@@ -112,2 +194,6 @@ const { module, afterConfig, afterInit, configure } = config;

/**
* Registers a callback to be executed after configuration.
* @param cb - Callback function.
*/
public onConfigured<T>(

@@ -119,2 +205,6 @@ cb: (config: ModulesConfigType<CombinedModules<T, TModules>>) => void | Promise<void>,

/**
* Registers a callback to be executed after initialization.
* @param cb - Callback function.
*/
public onInitialized<T>(

@@ -126,2 +216,7 @@ cb: (instance: ModulesInstanceType<CombinedModules<T, TModules>>) => void,

/**
* Initializes the modules with the provided reference.
* @param ref - Reference object.
* @returns Promise that resolves to the initialized module instance.
*/
public async initialize<T, R extends TRef = TRef>(

@@ -140,2 +235,7 @@ ref?: R,

/**
* Configures the modules with the provided reference.
* @param ref - Reference object.
* @returns Promise that resolves to the module configuration.
*/
protected async _configure<T, R extends TRef = TRef>(

@@ -150,2 +250,7 @@ ref?: R,

/**
* Creates the module configuration with the provided reference.
* @param ref - Reference object.
* @returns Promise that resolves to the module configuration.
*/
protected _createConfig<T, R = TRef>(

@@ -187,2 +292,7 @@ ref?: R,

/**
* Executes post-configuration tasks.
* @param config - Module configuration.
* @returns Promise that resolves when post-configuration tasks are complete.
*/
protected async _postConfigure<T>(

@@ -222,2 +332,8 @@ config: ModulesConfigType<CombinedModules<T, TModules>>,

/**
* Initializes the modules with the provided configuration and reference.
* @param config - Module configuration.
* @param ref - Reference object.
* @returns Promise that resolves to the initialized module instance.
*/
protected async _initialize<T, R = TRef>(

@@ -236,2 +352,12 @@ config: ModulesConfigType<CombinedModules<T, TModules>>,

/**
* Requires an instance of a module by name.
*
* @template TKey - The key type of the module.
* @param name - The name of the module to require.
* @param wait - The timeout duration in seconds for waiting the module to be initialized. Default is 60 seconds.
* @returns A promise that resolves to the instance of the required module.
* @throws Error if the module is not defined.
* @throws RequiredModuleTimeoutError if the module initialization times out.
*/
const requireInstance = <

@@ -334,2 +460,7 @@ TKey extends keyof ModulesInstanceType<CombinedModules<T, TModules>>,

/**
* Executes post-initialization tasks.
* @param instance - Initialized module instance.
* @param ref - Reference object.
*/
protected async _postInitialize<T, R = TRef>(

@@ -336,0 +467,0 @@ instance: ModulesInstanceType<CombinedModules<T, TModules>>,

@@ -106,9 +106,10 @@ /* eslint-disable @typescript-eslint/no-explicit-any */

export type AnyModule = Module<any, any, any, any>;
export type CombinedModules<T1, T2> = T1 extends Array<AnyModule>
? T2 extends Array<AnyModule>
? [...T1, ...T2]
: T1
: T2 extends Array<AnyModule>
? T2
: never;
export type CombinedModules<T1, T2> =
T1 extends Array<AnyModule>
? T2 extends Array<AnyModule>
? [...T1, ...T2]
: T1
: T2 extends Array<AnyModule>
? T2
: never;
export type AnyModuleInstance = Record<string, AnyModule>;

@@ -126,10 +127,11 @@ export type ModuleKey<M> = M extends Module<infer TKey, any, any, any> ? TKey : never;

export type ModulesType<M extends Array<AnyModule>> = M extends Array<AnyModule>
? {
[K in keyof M as M[K] extends Module<infer T, any, any, any> ? T : never]: M[Extract<
K,
string
>];
}
: never;
export type ModulesType<M extends Array<AnyModule>> =
M extends Array<AnyModule>
? {
[K in keyof M as M[K] extends Module<infer T, any, any, any> ? T : never]: M[Extract<
K,
string
>];
}
: never;

@@ -141,4 +143,4 @@ /** Extract configs from modules */

: TModules extends Record<string, AnyModule>
? ModulesObjectConfigType<TModules>
: never;
? ModulesObjectConfigType<TModules>
: never;

@@ -149,4 +151,4 @@ export type ModulesInstanceType<TModules extends Array<AnyModule> | Record<string, AnyModule>> =

: TModules extends Record<string, AnyModule>
? ModulesObjectInstanceType<TModules>
: never;
? ModulesObjectInstanceType<TModules>
: never;

@@ -153,0 +155,0 @@ export interface IModulesConfig<M extends Array<AnyModule> | Record<string, AnyModule>> {

// Generated by genversion.
export const version = '4.2.6';
export const version = '4.2.7';

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc