@equinor/fusion-framework-cli 15.2.11 → 15.3.0-next.1

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 (34) hide show
  1. package/CHANGELOG.md +44 -4
  2. package/README.md +9 -0
  3. package/bin/build/bin.mjs +1 -1
  4. package/bin/build/cli.mjs +3 -3
  5. package/dist/esm/lib/utils/assert-object.js +2 -1
  6. package/dist/esm/lib/utils/assert-object.js.map +1 -1
  7. package/dist/esm/version.js +1 -1
  8. package/dist/types/bin/serve-application.d.ts +4 -0
  9. package/dist/types/bin/start-app-dev-server.d.ts +6 -1
  10. package/dist/types/bin/utils/__tests__/fixtures/dev-mocks/foo.mock.d.ts +6 -0
  11. package/dist/types/bin/utils/__tests__/fixtures/dev-mocks/service.mock.d.ts +6 -0
  12. package/dist/types/bin/utils/apply-dev-server-mocks.d.ts +12 -0
  13. package/dist/types/bin/utils/apply-dev-server-mocks.test.d.ts +1 -0
  14. package/dist/types/bin/utils/create-dev-server-config.d.ts +3 -1
  15. package/dist/types/bin/utils/create-dev-server-config.test.d.ts +1 -0
  16. package/dist/types/bin/utils/discover-dev-server-mocks.d.ts +20 -0
  17. package/dist/types/bin/utils/discover-dev-server-mocks.test.d.ts +1 -0
  18. package/dist/types/bin/utils/normalize-dev-server-config.d.ts +2 -0
  19. package/dist/types/cli/commands/app/dev.command.d.ts +4 -1
  20. package/dist/types/cli/commands/app/dev.command.test.d.ts +1 -0
  21. package/dist/types/cli/commands/app/serve.command.d.ts +1 -0
  22. package/dist/types/cli/commands/index.d.ts +5 -3
  23. package/dist/types/cli/commands/portal/dev.command.d.ts +1 -1
  24. package/dist/types/cli/commands/register-optional-mock-server-command.d.ts +13 -0
  25. package/dist/types/cli/commands/register-optional-mock-server-command.test.d.ts +1 -0
  26. package/dist/types/cli/plugins/is-module-not-found-error.d.ts +8 -0
  27. package/dist/types/cli/plugins/is-module-not-found-error.test.d.ts +1 -0
  28. package/dist/types/cli/plugins/resolve-optional-plugin.d.ts +14 -0
  29. package/dist/types/cli/plugins/resolve-optional-plugin.test.d.ts +1 -0
  30. package/dist/types/version.d.ts +1 -1
  31. package/docs/application.md +17 -1
  32. package/docs/dev-server-config.md +132 -112
  33. package/docs/dev-server.md +39 -50
  34. package/package.json +14 -15
package/CHANGELOG.md CHANGED
@@ -1,11 +1,51 @@
1
1
  # Change Log
2
2
 
3
- ## 15.2.11
3
+ ## 15.3.0-next.1
4
4
 
5
- ### Patch Changes
5
+ ### Minor Changes
6
6
 
7
- - @equinor/fusion-framework-dev-portal@11.0.3
8
- - @equinor/fusion-framework-dev-server@2.0.19
7
+ - 09a9bcc: Add a built-in `ffc mock-server` command and a `--mock [endpoint]` flag to `ffc app dev` and
8
+ `ffc app serve`.
9
+
10
+ `ffc mock-server` delegates to `@equinor/fusion-framework-cli-plugin-mock-server` when installed
11
+ and otherwise prints an installation hint. Explicit `mockServerPlugin()` configuration remains
12
+ supported for app-specific defaults without registering the command twice.
13
+
14
+ The `--mock` flag points API service discovery at a local
15
+ mock server (e.g. one started with `ffc mock-server`) without needing a `dev-server.config.ts`
16
+ override — `ffc app dev --mock` defaults to `http://localhost:4010`, or pass an explicit origin
17
+ with `ffc app dev --mock http://localhost:5010`. An existing `dev-server.config.ts` override for
18
+ `api.serviceDiscoveryUrl` still takes precedence.
19
+
20
+ `ffc app serve --mock` applies the same isolated discovery and mock authentication to a built
21
+ application preview. The application must be built first and resolves the `local` environment.
22
+ `ffc app dev --mock` preserves `--env`, which defaults to `local`; explicit `--manifest` and
23
+ `--config` paths remain supported.
24
+
25
+ Normal `ffc app dev` discovers local `<name>.mock.ts` modules and overlays discovery-visible
26
+ definitions onto remote service discovery. In `--mock` mode, discovery comes exclusively from the
27
+ manually started mock server. Local endpoint overrides can be supplied through
28
+ `app.config.local.ts`.
29
+
30
+ `--mock` also enables the in-process MSAL mock (`spa.templateEnv.msal.mock`), so a mocked API
31
+ is usable end-to-end without a real Entra ID sign-in.
32
+
33
+ ### Patch Changes
34
+
35
+ - Updated dependencies [09a9bcc]
36
+ - Updated dependencies [09a9bcc]
37
+ - Updated dependencies [09a9bcc]
38
+ - @equinor/fusion-framework-dev-server@2.1.0-next.2
39
+ - @equinor/fusion-imports@2.0.3-next.1
40
+ - @equinor/fusion-framework-dev-portal@11.0.3-next.1
41
+
42
+ ## 15.2.11-next.0
43
+
44
+ ### Patch Changes
45
+
46
+ - c8008e3: Internal: rebase `next` onto `main`, syncing in already-published stable releases so they carry a `next` pre-release tag.
47
+ - Updated dependencies [c8008e3]
48
+ - @equinor/fusion-framework-dev-portal@11.0.3-next.0
9
49
 
10
50
  ## 15.2.10
11
51
 
package/README.md CHANGED
@@ -180,6 +180,15 @@ export default defineDevServerConfig((env, { base }) => ({
180
180
  }));
181
181
  ```
182
182
 
183
+ ### Local mock services (`mocks/<service>.mock.ts`)
184
+
185
+ Use executable service modules instead of handwritten routes in `dev-server.config.ts`. Install
186
+ `@equinor/fusion-framework-cli-plugin-mock-server`, define each service with `defineService`, and
187
+ run `ffc mock-server` in a separate foreground terminal.
188
+
189
+ See [Develop with mock services](../dev-server/docs/mocking.md) for normal discovery overlays,
190
+ isolated `--mock` development, and discovery modes.
191
+
183
192
  ### CLI plugins (`fusion-cli.config.ts`)
184
193
 
185
194
  ```ts