@equinor/fusion-framework 7.4.14-next.0 → 8.0.0

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/CHANGELOG.md CHANGED
@@ -1,20 +1,52 @@
1
1
  # Change Log
2
2
 
3
- ## 7.4.14-next.0
3
+ ## 8.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - abffa53: Major version bump for Fusion Framework React 19 release.
8
+
9
+ All packages are bumped to the next major version as part of the React 19 upgrade. This release drops support for React versions below 18 and includes breaking changes across the framework.
10
+
11
+ **Breaking changes:**
12
+ - Peer dependencies now require React 18 or 19 (`^18.0.0 || ^19.0.0`)
13
+ - React Router upgraded from v6 to v7
14
+ - Navigation module refactored with new history API
15
+ - `renderComponent` and `renderApp` now use `createRoot` API
16
+
17
+ **Migration:**
18
+ - Update your React version to 18.0.0 or higher before upgrading
19
+ - Replace `NavigationProvider.createRouter()` with `@equinor/fusion-framework-react-router`
20
+ - See individual package changelogs for package-specific migration steps
4
21
 
5
22
  ### Patch Changes
6
23
 
7
- - [#3820](https://github.com/equinor/fusion-framework/pull/3820) [`f647825`](https://github.com/equinor/fusion-framework/commit/f647825cb5712763b09dafda21fd996211c78b78) Thanks [@odinr](https://github.com/odinr)! - relase next
24
+ - aaa3f74: fix(security): address undici multiple vulnerabilities (CVE-2026-1524, 1527, 1528, 2581)
25
+
26
+ Upgrade undici from 7.22.0 to 7.24.3 to fix multiple security vulnerabilities affecting WebSocket parsing, HTTP header validation, and request deduplication:
27
+ - **CVE-2026-1528** (HIGH): WebSocket 64-bit length integer overflow causing process crash
28
+ - **CVE-2026-1524** (MODERATE): HTTP/1.1 response field header injection
29
+ - **CVE-2026-1527** (MODERATE): CRLF injection via upgrade option enabling protocol smuggling
30
+ - **CVE-2026-2581** (MODERATE): Unbounded memory consumption in deduplication handler
31
+
32
+ These are non-breaking security patches that harden undici against untrusted upstream endpoints and malicious WebSocket frames.
8
33
 
9
- - Updated dependencies [[`f647825`](https://github.com/equinor/fusion-framework/commit/f647825cb5712763b09dafda21fd996211c78b78)]:
10
- - @equinor/fusion-framework-module-telemetry@4.6.5-next.0
11
- - @equinor/fusion-framework-module-context@7.0.4-next.0
12
- - @equinor/fusion-framework-module-event@5.0.2-next.0
13
- - @equinor/fusion-framework-module-http@7.0.9-next.0
14
- - @equinor/fusion-framework-module@5.0.7-next.0
15
- - @equinor/fusion-framework-module-msal@7.3.2-next.0
16
- - @equinor/fusion-framework-module-service-discovery@9.1.2-next.0
17
- - @equinor/fusion-framework-module-services@7.2.2-next.0
34
+ **Advisories**: GHSA-f269-vfmq-vjvj, GHSA-v9p9-hfj2-hcw8, GHSA-4992-7rv2-5pvq, GHSA-phc3-fgpg-7m6h
35
+ **Fixed in**: undici 7.24.0+ (deployed 7.24.3)
36
+
37
+ - Updated dependencies [abffa53]
38
+ - Updated dependencies [abffa53]
39
+ - Updated dependencies [abffa53]
40
+ - Updated dependencies [8f30948]
41
+ - Updated dependencies [abffa53]
42
+ - @equinor/fusion-framework-module@6.0.0
43
+ - @equinor/fusion-framework-module-context@8.0.0
44
+ - @equinor/fusion-framework-module-event@6.0.0
45
+ - @equinor/fusion-framework-module-http@8.0.0
46
+ - @equinor/fusion-framework-module-msal@8.0.0
47
+ - @equinor/fusion-framework-module-service-discovery@10.0.0
48
+ - @equinor/fusion-framework-module-services@8.0.0
49
+ - @equinor/fusion-framework-module-telemetry@5.0.0
18
50
 
19
51
  ## 7.4.13
20
52
 
@@ -105,22 +137,6 @@
105
137
  - @equinor/fusion-framework-module-msal@7.0.0
106
138
  - @equinor/fusion-framework-module-http@7.0.7
107
139
 
108
- ## 7.4.3-next.0
109
-
110
- ### Patch Changes
111
-
112
- - [#3820](https://github.com/equinor/fusion-framework/pull/3820) [`265bb76`](https://github.com/equinor/fusion-framework/commit/265bb767249989eeb1971e83f3fba94879e0813b) Thanks [@odinr](https://github.com/odinr)! - relase next
113
-
114
- - Updated dependencies [[`265bb76`](https://github.com/equinor/fusion-framework/commit/265bb767249989eeb1971e83f3fba94879e0813b), [`d252b0d`](https://github.com/equinor/fusion-framework/commit/d252b0d442b7c8c1b50bf2768cf9ecbbb55a76f8)]:
115
- - @equinor/fusion-framework-module-telemetry@5.0.0-next.0
116
- - @equinor/fusion-framework-module-context@7.0.3-next.0
117
- - @equinor/fusion-framework-module-event@4.4.1-next.0
118
- - @equinor/fusion-framework-module-http@7.0.6-next.0
119
- - @equinor/fusion-framework-module@5.0.6-next.0
120
- - @equinor/fusion-framework-module-msal@7.0.0-next.0
121
- - @equinor/fusion-framework-module-service-discovery@9.0.5-next.0
122
- - @equinor/fusion-framework-module-services@7.1.6-next.0
123
-
124
140
  ## 7.4.2
125
141
 
126
142
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,100 @@
1
1
  # @equinor/fusion-framework
2
2
 
3
- > support package for initializing framework modules
3
+ > Bootstrap and configure the core Fusion Framework module graph — authentication, HTTP, service discovery, context, telemetry, and more — in a single initialization call.
4
4
 
5
- ## 📚 read the [Doc](https://equinor.github.io/fusion-framework/)
5
+ ## What is this package?
6
+
7
+ `@equinor/fusion-framework` is the top-level entry point for starting a Fusion Framework instance. It bundles the built-in module set (MSAL auth, HTTP client factory, service discovery, services, context, event bus, and telemetry) behind a single `FrameworkConfigurator` / `init` API so consumers do not have to wire each module individually.
8
+
9
+ **Use this package when** you are building a portal shell, a standalone application host, or any runtime that needs the full Fusion module stack. Micro-frontend applications that run _inside_ an already-initialized portal typically use `@equinor/fusion-framework-react-app` instead.
10
+
11
+ ## Quick start
12
+
13
+ ```typescript
14
+ import { FrameworkConfigurator, init } from '@equinor/fusion-framework';
15
+
16
+ // 1. Create a configurator
17
+ const configurator = new FrameworkConfigurator();
18
+
19
+ // 2. Set up authentication (MSAL)
20
+ configurator.configureMsal({
21
+ clientId: '<your-client-id>',
22
+ authority: 'https://login.microsoftonline.com/<your-tenant-id>',
23
+ });
24
+
25
+ // 3. Point service discovery at your registry
26
+ configurator.configureServiceDiscovery({
27
+ client: { baseUri: 'https://service-registry.example.com' },
28
+ });
29
+
30
+ // 4. Bootstrap — resolves all modules and assigns window.Fusion
31
+ const fusion = await init(configurator);
32
+ console.log(fusion.modules); // fully initialized module instances
33
+ ```
34
+
35
+ ## Key concepts
36
+
37
+ | Concept | Description |
38
+ |---|---|
39
+ | **FrameworkConfigurator** | Collects configuration for every module before initialization. Provides typed helpers such as `configureMsal`, `configureHttp`, `configureHttpClient`, and `configureServiceDiscovery`. |
40
+ | **init** | Async function that takes a `FrameworkConfigurator`, initializes all modules, sets `window.Fusion`, and dispatches the `onFrameworkLoaded` event. |
41
+ | **FusionModules** | Type alias describing every built-in module descriptor (context, event, HTTP, MSAL, services, service-discovery, telemetry) plus any additional custom modules. |
42
+ | **Fusion** | The root runtime object returned by `init`. Contains the `modules` map with all live module instances. |
43
+
44
+ ## API surface
45
+
46
+ | Export | Kind | Purpose |
47
+ |---|---|---|
48
+ | `FrameworkConfigurator` | class | Configure modules before initialization |
49
+ | `FusionConfigurator` | alias | _Deprecated_ — use `FrameworkConfigurator` |
50
+ | `init` / `default` | function | Bootstrap the framework from a configurator |
51
+ | `FusionModules` | type | Built-in + custom module descriptor union |
52
+ | `FusionModulesInstance` | type | Resolved instance map after initialization |
53
+ | `Fusion` | interface | Root object exposed on `window.Fusion` |
54
+ | `FusionRenderFn` | type | Callback signature for mounting an application into a DOM element |
55
+
56
+ ## Common patterns
57
+
58
+ ### Configure a named HTTP client
59
+
60
+ ```typescript
61
+ configurator.configureHttpClient('my-api', {
62
+ baseUri: 'https://api.example.com',
63
+ defaultHeaders: { 'X-Custom': 'value' },
64
+ });
65
+ ```
66
+
67
+ ### Optional authentication
68
+
69
+ ```typescript
70
+ // Pass `false` as second argument to make auth optional
71
+ configurator.configureMsal(msalConfig, false);
72
+ ```
73
+
74
+ ### Extend with custom modules
75
+
76
+ ```typescript
77
+ import { FrameworkConfigurator, init } from '@equinor/fusion-framework';
78
+ import myCustomModule from './my-custom-module';
79
+
80
+ const configurator = new FrameworkConfigurator<[typeof myCustomModule]>();
81
+ configurator.addConfig({ module: myCustomModule, configure: (b) => { /* … */ } });
82
+ const fusion = await init(configurator);
83
+ ```
84
+
85
+ ## Built-in modules
86
+
87
+ The framework ships with the following modules enabled by default:
88
+
89
+ - **`@equinor/fusion-framework-module-event`** — cross-module event bus
90
+ - **`@equinor/fusion-framework-module-msal`** — MSAL / Azure AD authentication
91
+ - **`@equinor/fusion-framework-module-http`** — HTTP client factory and named clients
92
+ - **`@equinor/fusion-framework-module-service-discovery`** — runtime service endpoint resolution
93
+ - **`@equinor/fusion-framework-module-services`** — typed service clients
94
+ - **`@equinor/fusion-framework-module-context`** — application / project context selection
95
+ - **`@equinor/fusion-framework-module-telemetry`** — telemetry, logging, and metadata
96
+
97
+ ## Further reading
98
+
99
+ 📚 [Full documentation](https://equinor.github.io/fusion-framework/)
6
100
 
@@ -8,9 +8,37 @@ import services from '@equinor/fusion-framework-module-services';
8
8
  import telemetry, { enableTelemetry } from '@equinor/fusion-framework-module-telemetry';
9
9
  import { version } from './version.js';
10
10
  /**
11
- * Module configurator for Framework modules
12
- * @template TModules - Addition modules
13
- * @template TRef - usually undefined, optional references
11
+ * Configurator that registers and wires the core Fusion Framework modules.
12
+ *
13
+ * Extend `FrameworkConfigurator` to declare which modules (authentication,
14
+ * HTTP, service-discovery, telemetry, context, …) the framework instance
15
+ * should contain and how each module is configured before the framework
16
+ * starts.
17
+ *
18
+ * Typical workflow:
19
+ * 1. Create a `FrameworkConfigurator` instance.
20
+ * 2. Call configuration helpers such as {@link configureMsal},
21
+ * {@link configureHttp}, {@link configureHttpClient}, and
22
+ * {@link configureServiceDiscovery}.
23
+ * 3. Pass the configurator to {@link init} to bootstrap the framework.
24
+ *
25
+ * @template TModules - Additional module descriptors to merge with the
26
+ * built-in Fusion modules.
27
+ * @template TRef - Optional reference object forwarded to module
28
+ * initialization (e.g. a parent framework instance).
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * import { FrameworkConfigurator, init } from '@equinor/fusion-framework';
33
+ *
34
+ * const configurator = new FrameworkConfigurator();
35
+ * configurator.configureMsal({ clientId: 'my-client-id', authority: '…' });
36
+ * configurator.configureServiceDiscovery({
37
+ * client: { baseUri: 'https://service-registry.example.com' },
38
+ * });
39
+ *
40
+ * const fusion = await init(configurator);
41
+ * ```
14
42
  */
15
43
  export class FrameworkConfigurator extends ModulesConfigurator {
16
44
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"FrameworkConfigurator.js","sourceRoot":"","sources":["../../src/FrameworkConfigurator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAEvF,OAAO,KAAK,MAAM,wCAAwC,CAAC;AAE3D,OAAO,IAAI,EAAE,EACX,mBAAmB,EACnB,aAAa,GAEd,MAAM,uCAAuC,CAAC;AAG/C,OAAO,IAA2B,MAAM,uCAAuC,CAAC;AAEhF,OAAO,OAAO,MAAM,0CAA0C,CAAC;AAE/D,OAAO,KAAK,MAAM,oDAAoD,CAAC;AACvE,OAAO,QAAQ,MAAM,2CAA2C,CAAC;AACjE,OAAO,SAAS,EAAE,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAC;AAIxF,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC;;;;GAIG;AACH,MAAM,OAAO,qBAIX,SAAQ,mBAAkD;IAC1D;;;OAGG;IACH,MAAM,CAAU,SAAS,GAAW,uBAAuB,CAAC;IAE5D;;;;;;;;;;;;OAYG;IACH;QACE,KAAK,CAAC,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC;QAEhE,wBAAwB;QACxB,eAAe,CAAC,IAAI,EAAE;YACpB,SAAS,EAAE,CAAC,OAAO,EAAE,EAAE;gBACrB,OAAO,CAAC,WAAW,CAAC;oBAClB,MAAM,EAAE;wBACN,IAAI,EAAE,qBAAqB;wBA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CAAC"}
package/dist/esm/index.js CHANGED
@@ -1,6 +1,18 @@
1
+ /**
2
+ * Entry point for `@equinor/fusion-framework` — the core initialization
3
+ * package of Fusion Framework.
4
+ *
5
+ * @remarks
6
+ * Re-exports the {@link FrameworkConfigurator} (used to configure framework
7
+ * modules before initialization), the {@link init} function (used to
8
+ * bootstrap the framework), and all public type aliases that describe
9
+ * the resulting module graph.
10
+ *
11
+ * @packageDocumentation
12
+ */
1
13
  export { FrameworkConfigurator,
2
14
  /**
3
- * @deprecated use FrameworkConfigurator
15
+ * @deprecated Use {@link FrameworkConfigurator} instead.
4
16
  */
5
17
  FrameworkConfigurator as FusionConfigurator, } from './FrameworkConfigurator';
6
18
  export { default, init } from './init';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAeA,OAAO,EACL,qBAAqB;AACrB;;GAEG;AACH,qBAAqB,IAAI,kBAAkB,GAC5C,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAsBH,OAAO,EACL,qBAAqB;AACrB;;GAEG;AACH,qBAAqB,IAAI,kBAAkB,GAC5C,MAAM,yBAAyB,CAAC;AAIjC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC"}
package/dist/esm/init.js CHANGED
@@ -1,17 +1,43 @@
1
1
  /**
2
+ * Initialize Fusion Framework from a fully-configured
3
+ * {@link FrameworkConfigurator}.
2
4
  *
3
- * @template TModules addition modules
4
- * @template TRef optional reference
5
+ * This is the main bootstrap entry point. It resolves all module
6
+ * configurations, instantiates every registered module, assigns the
7
+ * resulting {@link Fusion} object to `window.Fusion`, and dispatches
8
+ * the `onFrameworkLoaded` event.
5
9
  *
6
- * @param configurator config builder instance
7
- * @param ref optional references
8
- * @returns instance of framework modules
10
+ * @template TModules - Additional module descriptors beyond the built-in
11
+ * Fusion modules.
12
+ * @template TRef - Reference object forwarded to modules during
13
+ * initialization (e.g. a parent framework instance).
14
+ *
15
+ * @param configurator - A {@link FrameworkConfigurator} that has been set up
16
+ * with the desired module configurations (MSAL, HTTP, service discovery,
17
+ * etc.).
18
+ * @param ref - Optional reference object passed through to each module's
19
+ * initializer, typically used when an application framework is initialized
20
+ * within an outer host framework.
21
+ * @returns A promise that resolves to the initialized {@link Fusion}
22
+ * instance containing all configured module instances.
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * import { FrameworkConfigurator, init } from '@equinor/fusion-framework';
27
+ *
28
+ * const configurator = new FrameworkConfigurator();
29
+ * configurator.configureMsal({ clientId: '…', authority: '…' });
30
+ *
31
+ * const fusion = await init(configurator);
32
+ * console.log(fusion.modules); // all instantiated modules
33
+ * ```
9
34
  */
10
35
  export const init = async (configurator, ref) => {
11
36
  const modules = await configurator.initialize(ref);
12
37
  const fusion = {
13
38
  modules,
14
39
  };
40
+ // Expose globally so portal shells and widgets can access the running instance
15
41
  window.Fusion = fusion;
16
42
  modules.event.dispatchEvent('onFrameworkLoaded', { detail: fusion });
17
43
  return fusion;
@@ -1 +1 @@
1
- {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/init.ts"],"names":[],"mappings":"AAKA;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EACvB,YAA6C,EAC7C,GAAU,EACiB,EAAE;IAC7B,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,UAAU,CAAgB,GAAG,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG;QACb,OAAO;KACR,CAAC;IACF,MAAM,CAAC,MAAM,GAAG,MAA2B,CAAC;IAC5C,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAErE,OAAO,MAAqC,CAAC;AAC/C,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
1
+ {"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/init.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,KAAK,EACvB,YAA6C,EAC7C,GAAU,EACiB,EAAE;IAC7B,MAAM,OAAO,GAAG,MAAM,YAAY,CAAC,UAAU,CAAgB,GAAG,CAAC,CAAC;IAClE,MAAM,MAAM,GAAG;QACb,OAAO;KACR,CAAC;IACF,+EAA+E;IAC/E,MAAM,CAAC,MAAM,GAAG,MAA2B,CAAC;IAC5C,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAErE,OAAO,MAAqC,CAAC;AAC/C,CAAC,CAAC;AAEF,eAAe,IAAI,CAAC"}
@@ -1,3 +1,3 @@
1
1
  // Generated by genversion.
2
- export const version = '7.4.14-next.0';
2
+ export const version = '8.0.0';
3
3
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,eAAe,CAAC"}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}