@equinor/fusion-framework-module-context 9.0.0-next.0 → 9.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 +23 -46
- 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 +10 -10
- package/src/version.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,81 +1,58 @@
|
|
|
1
1
|
# Change Log
|
|
2
2
|
|
|
3
|
-
## 9.0.0
|
|
3
|
+
## 9.0.0
|
|
4
4
|
|
|
5
5
|
### Major Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
|
|
7
|
+
- f663b46: Add `./mock` and `./mock/fixtures` subpaths for seeding context in tests without a real context API.
|
|
8
|
+
|
|
9
9
|
**BREAKING CHANGE:** `ContextModuleConfigurator` now extends `BaseConfigBuilder` (aligning with `module-event`, `module-http`, `module-msal`, and `module-service-discovery`). Its public `createConfig` method now returns `Observable<ContextModuleConfig>` instead of `Promise<ContextModuleConfig>`. Code calling `await configurator.createConfig(init)` directly should switch to `createConfigAsync`, which keeps the previous Promise-based behavior:
|
|
10
|
-
|
|
10
|
+
|
|
11
11
|
```typescript
|
|
12
12
|
// Before
|
|
13
13
|
const config = await configurator.createConfig(init);
|
|
14
14
|
// After
|
|
15
15
|
const config = await configurator.createConfigAsync(init);
|
|
16
16
|
```
|
|
17
|
-
|
|
17
|
+
|
|
18
18
|
No other public export changes as part of this refactor.
|
|
19
|
-
|
|
19
|
+
|
|
20
20
|
`./mock` exports `enableContextMock` and `ContextMockConfigurator` — a `ContextModuleConfigurator` backed by an in-memory pool instead of a real client. Only the data source is substituted; `validateContext`, `resolveContext`, and parent-context propagation all still run through the real `ContextProvider`:
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
```typescript
|
|
23
|
-
import { enableContextMock } from
|
|
24
|
-
|
|
23
|
+
import { enableContextMock } from '@equinor/fusion-framework-module-context/mock';
|
|
24
|
+
|
|
25
25
|
enableContextMock(configurator, (mock) => {
|
|
26
|
-
mock.setCurrentContext({
|
|
27
|
-
id: "my-ctx",
|
|
28
|
-
type: { id: "ProjectMaster" },
|
|
29
|
-
value: {},
|
|
30
|
-
});
|
|
26
|
+
mock.setCurrentContext({ id: 'my-ctx', type: { id: 'ProjectMaster' }, value: {} });
|
|
31
27
|
});
|
|
32
28
|
```
|
|
33
|
-
|
|
29
|
+
|
|
34
30
|
`ContextMockConfigurator` also has `setContexts`, `addContext`, `setRelatedContexts` for the common cases, and `setResolver` as an escape hatch for custom resolution. Seeding an initial context this way overrides `resolveInitialContext` directly, so a test doesn't need a fake navigation module or parent framework instance just to start an app with a known context selected.
|
|
35
|
-
|
|
31
|
+
|
|
36
32
|
`./mock/fixtures` exports `createContextItems` and `createContextItemFactory`, generating realistic `ContextItem`s via an optional `@faker-js/faker` peer dependency — kept on a separate entry point so `enableContextMock` never pulls faker in for tests that don't need it:
|
|
37
|
-
|
|
33
|
+
|
|
38
34
|
```typescript
|
|
39
|
-
import { createContextItems } from
|
|
40
|
-
|
|
41
|
-
const [project] = createContextItems([{ type:
|
|
35
|
+
import { createContextItems } from '@equinor/fusion-framework-module-context/mock/fixtures';
|
|
36
|
+
|
|
37
|
+
const [project] = createContextItems([{ type: 'ProjectMaster' }]);
|
|
42
38
|
```
|
|
43
|
-
|
|
39
|
+
|
|
44
40
|
Also exports `parseContextItem` from the `./utils` subpath (parses a raw API context entity into a `ContextItem`), and reorganizes internal selector/configurator files without changing any existing public export.
|
|
45
41
|
|
|
46
42
|
### Patch Changes
|
|
47
43
|
|
|
48
|
-
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
- 2836e0b: Declare `@equinor/fusion-framework-module-telemetry` as an optional peer dependency.
|
|
57
|
-
|
|
44
|
+
- f663b46: Restructure documentation so the README is an entry point rather than a manual, matching the convention already used by `@equinor/fusion-framework-module` and `@equinor/fusion-framework-module-http`.
|
|
45
|
+
|
|
46
|
+
Long-form content moves into `docs/data-model.md` (the `ContextItem`/`ContextItemType` shape and query/related parameter types), `docs/lifecycle.md` (setting/resolving context, initial-context resolution, parent/child propagation), and `docs/recipes.md` (OData query parameters, path rewriting, accepting a family of related context types, skipping the default initial-context lookup, custom search errors). The README keeps the elevator pitch, a "How it fits together" section on module dependencies, and a documentation table linking to the rest.
|
|
47
|
+
- f663b46: Fix `ContextModule.postInitialize` logging a `console.warn` for the valid "no initial context" case (no context in the path and no parent context). The default `resolveInitialContext` resolver used RxJS `first()` without a default value, so completing with no emissions threw an `EmptyError` that got logged as if resolution had actually failed. `first()` now falls back to `undefined`, so a genuinely empty result completes silently and only real resolution failures are logged.
|
|
48
|
+
- f663b46: Declare `@equinor/fusion-framework-module-telemetry` as an optional peer dependency.
|
|
49
|
+
|
|
58
50
|
The context module imports `TelemetryLevel`/`TelemetryScope` at runtime to report context
|
|
59
51
|
resolution failures when a telemetry module is registered, but telemetry was previously
|
|
60
52
|
undeclared outside of this package's own dev dependencies. A consumer installing only
|
|
61
53
|
`@equinor/fusion-framework-module-context` without telemetry could fail to resolve this
|
|
62
54
|
import at runtime.
|
|
63
55
|
|
|
64
|
-
- 2836e0b: Restructure documentation so the README is an entry point rather than a manual, matching the convention already used by `@equinor/fusion-framework-module` and `@equinor/fusion-framework-module-http`.
|
|
65
|
-
|
|
66
|
-
Long-form content moves into `docs/data-model.md` (the `ContextItem`/`ContextItemType` shape and query/related parameter types), `docs/lifecycle.md` (setting/resolving context, initial-context resolution, parent/child propagation), and `docs/recipes.md` (OData query parameters, path rewriting, accepting a family of related context types, skipping the default initial-context lookup, custom search errors). The README keeps the elevator pitch, a "How it fits together" section on module dependencies, and a documentation table linking to the rest.
|
|
67
|
-
|
|
68
|
-
- 2836e0b: Fix `ContextModule.postInitialize` logging a `console.warn` for the valid "no initial context" case (no context in the path and no parent context). The default `resolveInitialContext` resolver used RxJS `first()` without a default value, so completing with no emissions threw an `EmptyError` that got logged as if resolution had actually failed. `first()` now falls back to `undefined`, so a genuinely empty result completes silently and only real resolution failures are logged.
|
|
69
|
-
- Updated dependencies [e8aae1f]
|
|
70
|
-
- Updated dependencies [2836e0b]
|
|
71
|
-
- Updated dependencies [2836e0b]
|
|
72
|
-
- Updated dependencies [2836e0b]
|
|
73
|
-
- Updated dependencies [2836e0b]
|
|
74
|
-
- Updated dependencies [2836e0b]
|
|
75
|
-
- @equinor/fusion-framework-module@6.1.3-next.0
|
|
76
|
-
- @equinor/fusion-framework-module-telemetry@8.0.0-next.0
|
|
77
|
-
- @equinor/fusion-query@7.0.4-next.0
|
|
78
|
-
|
|
79
56
|
## 8.0.3
|
|
80
57
|
|
|
81
58
|
### Patch Changes
|
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"}
|