@gravitee/gamma-modules-sdk 1.0.0-alpha.3 → 1.0.0-alpha.3-feat-dev-mock-middleware.0e211b0
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/README.md +4 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,7 +33,7 @@ The SDK publishes three entry points:
|
|
|
33
33
|
| ----------------------------------- | ---------------------------- | ------------------------- |
|
|
34
34
|
| `@gravitee/gamma-modules-sdk` | Types + runtime stubs | Remotes (and host barrel) |
|
|
35
35
|
| `@gravitee/gamma-modules-sdk/types` | Interfaces only (no runtime) | Host implementation |
|
|
36
|
-
| `@gravitee/gamma-modules-sdk/
|
|
36
|
+
| `@gravitee/gamma-modules-sdk/mock` | OpenAPI mock middleware | Module dev servers |
|
|
37
37
|
|
|
38
38
|
Remote modules compile and bundle against the stubs. At runtime, the host provides its real implementation as a Module Federation singleton (`additionalShared`), replacing the stubs transparently.
|
|
39
39
|
|
|
@@ -89,12 +89,12 @@ resolve: {
|
|
|
89
89
|
|
|
90
90
|
## Exports
|
|
91
91
|
|
|
92
|
-
###
|
|
92
|
+
### Mock middleware (`/mock`)
|
|
93
93
|
|
|
94
94
|
OpenAPI-based mock middleware for standalone dev mode. Reads OpenAPI specs and serves mock responses from fixture files, so modules can run without a backend.
|
|
95
95
|
|
|
96
96
|
```typescript
|
|
97
|
-
import { createOpenApiMockMiddleware } from '@gravitee/gamma-modules-sdk/
|
|
97
|
+
import { createOpenApiMockMiddleware } from '@gravitee/gamma-modules-sdk/mock';
|
|
98
98
|
|
|
99
99
|
// In rsbuild.config.ts setupMiddlewares:
|
|
100
100
|
createOpenApiMockMiddleware({
|
|
@@ -116,7 +116,7 @@ Fixture files are named after the last path segment in the spec (e.g. `models.js
|
|
|
116
116
|
4. In `rsbuild.config.ts`:
|
|
117
117
|
|
|
118
118
|
```typescript
|
|
119
|
-
import { createOpenApiMockMiddleware } from '@gravitee/gamma-modules-sdk/
|
|
119
|
+
import { createOpenApiMockMiddleware } from '@gravitee/gamma-modules-sdk/mock';
|
|
120
120
|
|
|
121
121
|
export default defineConfig(() => ({
|
|
122
122
|
dev: {
|