@equinor/fusion-framework 8.1.0-next.1 → 8.1.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 +91 -173
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +9 -9
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,201 +1,119 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 8.1.0
|
|
4
|
-
|
|
5
|
-
### Patch Changes
|
|
6
|
-
|
|
7
|
-
- @equinor/fusion-framework-module-telemetry@8.0.0-next.1
|
|
8
|
-
|
|
9
|
-
## 8.1.0-next.0
|
|
3
|
+
## 8.1.0
|
|
10
4
|
|
|
11
5
|
### Minor Changes
|
|
12
6
|
|
|
13
|
-
-
|
|
14
|
-
|
|
7
|
+
- f663b46: Restructure documentation so each README is an entry point rather than a manual.
|
|
8
|
+
|
|
15
9
|
Long-form content moved into per-package `docs/` folders, matching the convention already used by `@equinor/fusion-framework-module` and `@equinor/fusion-framework-module-http`. Each README now keeps the elevator pitch, the shortest working example and a documentation table linking to the rest.
|
|
16
|
-
|
|
10
|
+
|
|
17
11
|
- **msal** — `docs/api-reference.md`, `docs/auth-code-flow.md`, `docs/testing.md`, `docs/version-management.md`, `docs/migration-v2-to-v4.md`, `docs/troubleshooting.md`. The README also gained the top-level heading it was missing.
|
|
18
12
|
- **service-discovery** — `docs/configuration.md`, `docs/testing.md`, `docs/session-overrides.md`, `docs/api-reference.md`.
|
|
19
13
|
- **framework** — `docs/testing-choosing-a-layer.md`, `docs/testing.md`, `docs/testing-design.md`, `docs/testing-extending.md`, `docs/testing-api.md`.
|
|
20
|
-
|
|
14
|
+
|
|
21
15
|
Both module READMEs now document their `/mock` entry point, which was previously undocumented, and state that spying on an individual call is the test runner's job rather than something these packages provide.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
16
|
+
- f663b46: Add a `./mock` entry point for initializing the framework in a test.
|
|
17
|
+
|
|
25
18
|
```typescript
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
import { mockFramework } from '@equinor/fusion-framework/mock';
|
|
20
|
+
|
|
21
|
+
const fusion = await mockFramework((configurator) => {
|
|
22
|
+
configurator.msal.setAccount({ name: 'Ada Lovelace' });
|
|
23
|
+
configurator.serviceDiscovery.setBaseUri('http://localhost:6669');
|
|
24
|
+
configurator.serviceDiscovery.addService({ key: 'my-api' });
|
|
31
25
|
});
|
|
32
|
-
|
|
33
|
-
const fusion = await init(configurator);
|
|
34
26
|
```
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
`
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
27
|
+
|
|
28
|
+
`mockFramework` runs the real configure → initialize pipeline with the real built-in modules and
|
|
29
|
+
substitutes only the boundaries that leave the process. It takes a single callback receiving a
|
|
30
|
+
`FrameworkMockConfigurator`, which **is** a `FrameworkConfigurator`, so every `enableX` helper an
|
|
31
|
+
application already uses — including its own — accepts it unchanged.
|
|
32
|
+
|
|
33
|
+
`FrameworkMockConfigurator` exposes an accessor per module whose test boundary is mocked, all
|
|
34
|
+
reachable synchronously via a new `_pin`/`_getConfig` primitive any module (built-in or
|
|
35
|
+
application-defined) can reuse:
|
|
36
|
+
|
|
44
37
|
```typescript
|
|
45
38
|
class AppMockConfigurator extends FrameworkMockConfigurator<[InvoiceModule]> {
|
|
46
39
|
constructor() {
|
|
47
40
|
super();
|
|
48
41
|
this._pin(invoiceMockModule);
|
|
49
42
|
}
|
|
50
|
-
|
|
51
43
|
get invoices(): InvoiceMockConfigurator {
|
|
52
|
-
return this._getConfig(
|
|
44
|
+
return this._getConfig('invoices');
|
|
53
45
|
}
|
|
54
46
|
}
|
|
55
47
|
```
|
|
56
|
-
|
|
57
|
-
`
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
```typescript
|
|
89
|
-
const fusion = await mockFramework((configurator) => {
|
|
90
|
-
configurator.msal.setAccount({ name: "Ada Lovelace" });
|
|
91
|
-
configurator.serviceDiscovery.setBaseUri("http://localhost:6669");
|
|
92
|
-
configurator.serviceDiscovery.addService({ key: "my-api" });
|
|
93
|
-
});
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
Because it is a real configurator, every `enableX` helper an application already uses accepts it unchanged — including the ones a team writes for their own modules. Those modules can be passed as a type argument so they are typed on the configurator _and_ on the resulting `fusion.modules` without a cast:
|
|
97
|
-
|
|
98
|
-
```typescript
|
|
99
|
-
const fusion = await mockFramework<[InvoiceModule]>((configurator) => {
|
|
100
|
-
enableInvoicesMock(configurator, { total: 42 });
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
await fusion.modules.invoices.getInvoice("inv-1"); // typed
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
`FrameworkMockConfigurator` is also exported for tests that need to hold on to the configurator and call `init` themselves.
|
|
107
|
-
|
|
108
|
-
The entry point owns no mock logic. Each module exports its own test double from its own `./mock` entry point, and this one composes the built-in set; an application module follows the same pattern and plugs in without any support from this package. It has no test-runner dependency and provides no mocking API, because replacing an individual call belongs to your test runner.
|
|
109
|
-
|
|
110
|
-
- 2836e0b: `FrameworkMockConfigurator.telemetry` is now backed by `TelemetryMockConfigurator` from `@equinor/fusion-framework-module-telemetry/mock` instead of the real `TelemetryConfigurator` — telemetry tracked through a mocked framework instance no longer reaches Application Insights or any real endpoint:
|
|
111
|
-
|
|
112
|
-
```typescript
|
|
113
|
-
import { filter } from "rxjs";
|
|
114
|
-
|
|
115
|
-
const fusion = await mockFramework();
|
|
116
|
-
|
|
117
|
-
fusion.modules.telemetry.items
|
|
118
|
-
.pipe(filter((item) => item.name === "button-click"))
|
|
119
|
-
.subscribe((item) => {
|
|
120
|
-
// ...
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
fusion.modules.telemetry.trackEvent({ name: "button-click" });
|
|
124
|
-
```
|
|
125
|
-
|
|
126
|
-
A test can register its own adapter alongside the mock's default one, the same way `enableTelemetry` already does:
|
|
127
|
-
|
|
128
|
-
```typescript
|
|
129
|
-
const myAdapter: ITelemetryAdapter = {
|
|
130
|
-
processItem: (item) => forwardSomewhere(item),
|
|
131
|
-
};
|
|
132
|
-
const fusion = await mockFramework((configurator) => {
|
|
133
|
-
configurator.telemetry.setAdapter("my-adapter", myAdapter);
|
|
134
|
-
});
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
This changes the type returned by `.telemetry` from `ITelemetryConfigurator` to `TelemetryMockConfigurator` (which extends the real `TelemetryConfigurator`) — code relying on `.telemetry` being exactly the real configurator should read tracked items back through `.telemetry.adapter` (`getItems`/`waitForItem`) instead of asserting against a real telemetry backend.
|
|
138
|
-
|
|
139
|
-
- 2836e0b: Add a `.http` accessor to `FrameworkMockConfigurator`, backed by the real `IHttpClientConfigurator` — fake a response by registering a short-circuiting middleware through `.http.addMiddleware(...)` instead of swapping the module out:
|
|
140
|
-
|
|
141
|
-
```ts
|
|
142
|
-
const configurator = new FrameworkMockConfigurator();
|
|
143
|
-
configurator.http.addMiddleware(async (uri, init, next) =>
|
|
144
|
-
uri === "https://api.example.com/items"
|
|
145
|
-
? Response.json([{ id: 1 }])
|
|
146
|
-
: next(uri, init),
|
|
147
|
-
);
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
See `@equinor/fusion-framework-module-http`'s `addMiddleware` changeset for the full API.
|
|
151
|
-
|
|
152
|
-
### Patch Changes
|
|
153
|
-
|
|
154
|
-
- e8aae1f: Internal: publish every package on the `next` pre-release tag so the whole framework can be installed as a coherent set.
|
|
155
|
-
|
|
156
|
-
Packages without their own changes are bumped only to receive a `-next.N` version and the `next` dist-tag on npm. Install with:
|
|
157
|
-
|
|
158
|
-
```bash
|
|
159
|
-
pnpm add @equinor/fusion-framework-react-app@next
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
- 2836e0b: `init` no longer throws when no DOM is present.
|
|
163
|
-
|
|
48
|
+
|
|
49
|
+
- `.msal` / `.serviceDiscovery` — unchanged in behavior, now built on `_pin`/`_getConfig` themselves.
|
|
50
|
+
- `.http` — backed by the real `IHttpClientConfigurator`; fake a response with
|
|
51
|
+
`configurator.http.addMiddleware(...)` instead of swapping the module out. See
|
|
52
|
+
`@equinor/fusion-framework-module-http`'s `addMiddleware` changeset for the full API.
|
|
53
|
+
- `.context` — backed by `ContextMockConfigurator` (`@equinor/fusion-framework-module-context/mock`);
|
|
54
|
+
context resolution in tests no longer performs real I/O. **Type change:** `.context` now returns
|
|
55
|
+
`ContextMockConfigurator` (extends `ContextModuleConfigurator`) — seed data with
|
|
56
|
+
`setCurrentContext`/`setContexts`/`addContext`/`setRelatedContexts`/`setResolver` instead of
|
|
57
|
+
configuring a real client.
|
|
58
|
+
- `.telemetry` — backed by `TelemetryMockConfigurator`
|
|
59
|
+
(`@equinor/fusion-framework-module-telemetry/mock`); tracked telemetry no longer reaches
|
|
60
|
+
Application Insights or any real endpoint. **Type change:** `.telemetry` now returns
|
|
61
|
+
`TelemetryMockConfigurator` (extends the real `TelemetryConfigurator`) — read tracked items back
|
|
62
|
+
through `.telemetry.adapter` (`getItems`/`waitForItem`) instead of asserting against a real backend.
|
|
63
|
+
- `.services` — reachable the same way, though it still performs real I/O (no test double yet).
|
|
64
|
+
|
|
65
|
+
`event` is intentionally left out: its `configure` factory reads `ref` to wire event bubbling to a
|
|
66
|
+
parent event provider when `FrameworkMockConfigurator` is hoisted inside a host framework, and
|
|
67
|
+
pinning it would silently disable that bubbling.
|
|
68
|
+
|
|
69
|
+
`docs/testing.md`, `docs/testing-extending.md` and `docs/testing-api.md` describe both mocking
|
|
70
|
+
strategies now available for context and telemetry: the in-memory mock configurators above, and
|
|
71
|
+
mocking the real API/adapter boundary directly for tests that need the full pipeline.
|
|
72
|
+
|
|
73
|
+
The entry point owns no mock logic of its own — each module exports its own test double from its
|
|
74
|
+
own `./mock` entry point, and this one composes the built-in set.
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- f663b46: `init` no longer throws when no DOM is present.
|
|
79
|
+
|
|
164
80
|
The running instance is published as `window.Fusion` for portal shells and widgets. That assignment was unguarded, so initializing the framework anywhere without a `window` — a test runner using the `node` environment, or a server-side render — failed with `ReferenceError: window is not defined`.
|
|
165
|
-
|
|
81
|
+
|
|
166
82
|
The assignment is now skipped when `window` is undefined. Browser behaviour is unchanged.
|
|
167
|
-
|
|
168
|
-
- Updated dependencies [
|
|
169
|
-
- Updated dependencies [
|
|
170
|
-
- Updated dependencies [
|
|
171
|
-
- Updated dependencies [
|
|
172
|
-
- Updated dependencies [
|
|
173
|
-
- Updated dependencies [
|
|
174
|
-
- Updated dependencies [
|
|
175
|
-
- Updated dependencies [
|
|
176
|
-
- Updated dependencies [
|
|
177
|
-
- Updated dependencies [
|
|
178
|
-
- Updated dependencies [
|
|
179
|
-
- Updated dependencies [
|
|
180
|
-
- Updated dependencies [
|
|
181
|
-
- Updated dependencies [
|
|
182
|
-
- Updated dependencies [
|
|
183
|
-
- Updated dependencies [
|
|
184
|
-
- Updated dependencies [
|
|
185
|
-
- Updated dependencies [
|
|
186
|
-
- Updated dependencies [
|
|
187
|
-
-
|
|
188
|
-
-
|
|
189
|
-
-
|
|
190
|
-
-
|
|
191
|
-
- @equinor/fusion-framework-module@
|
|
192
|
-
- @equinor/fusion-framework-module-
|
|
193
|
-
- @equinor/fusion-framework-module
|
|
194
|
-
- @equinor/fusion-framework-module-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
83
|
+
- Updated dependencies [f663b46]
|
|
84
|
+
- Updated dependencies [f663b46]
|
|
85
|
+
- Updated dependencies [f663b46]
|
|
86
|
+
- Updated dependencies [f663b46]
|
|
87
|
+
- Updated dependencies [f663b46]
|
|
88
|
+
- Updated dependencies [f663b46]
|
|
89
|
+
- Updated dependencies [f663b46]
|
|
90
|
+
- Updated dependencies [f663b46]
|
|
91
|
+
- Updated dependencies [f663b46]
|
|
92
|
+
- Updated dependencies [f663b46]
|
|
93
|
+
- Updated dependencies [f663b46]
|
|
94
|
+
- Updated dependencies [f663b46]
|
|
95
|
+
- Updated dependencies [f663b46]
|
|
96
|
+
- Updated dependencies [f663b46]
|
|
97
|
+
- Updated dependencies [f663b46]
|
|
98
|
+
- Updated dependencies [f663b46]
|
|
99
|
+
- Updated dependencies [f663b46]
|
|
100
|
+
- Updated dependencies [f663b46]
|
|
101
|
+
- Updated dependencies [f663b46]
|
|
102
|
+
- Updated dependencies [f663b46]
|
|
103
|
+
- @equinor/fusion-framework-module-service-discovery@10.1.0
|
|
104
|
+
- @equinor/fusion-framework-module-msal@11.0.0
|
|
105
|
+
- @equinor/fusion-framework-module-context@9.0.0
|
|
106
|
+
- @equinor/fusion-framework-module-event@6.1.0
|
|
107
|
+
- @equinor/fusion-framework-module-http@8.1.0
|
|
108
|
+
- @equinor/fusion-framework-module-telemetry@7.1.0
|
|
109
|
+
- @equinor/fusion-framework-module@6.1.3
|
|
110
|
+
- @equinor/fusion-framework-module-services@8.1.1
|
|
111
|
+
|
|
112
|
+
## 8.0.16
|
|
113
|
+
|
|
114
|
+
### Patch Changes
|
|
115
|
+
|
|
116
|
+
- @equinor/fusion-framework-module-telemetry@7.0.3
|
|
199
117
|
|
|
200
118
|
## 8.0.15
|
|
201
119
|
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,2BAA2B;AAC3B,MAAM,CAAC,MAAM,OAAO,GAAG,OAAO,CAAC"}
|