@chidchanun/bcp 0.2.13 → 0.2.15
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 +224 -99
- package/docs/README.md +40 -35
- package/docs/api-manifest.json +26 -10
- package/docs/api-reference.md +173 -29
- package/docs/docs-web-manifest.json +8 -4
- package/docs/platform-manifest.json +33 -4
- package/docs/plugin-module-platform.md +391 -0
- package/docs/releases/0.2.14.md +241 -0
- package/docs/releases/0.2.15.md +118 -0
- package/docs/testing-platform.md +602 -0
- package/package.json +11 -1
- package/packages/bundler/src/client-boundary.ts +2 -0
- package/packages/client/src/plugins.mjs +811 -0
- package/packages/client/src/plugins.ts +26 -0
- package/packages/client/src/realtime.mjs +67 -30
- package/packages/client/src/testing.mjs +2357 -0
- package/packages/client/src/testing.ts +52 -0
- package/packages/server/src/plugins.ts +1225 -0
- package/packages/server/src/realtime.ts +95 -41
- package/packages/server/src/testing-page.ts +274 -0
- package/packages/server/src/testing.ts +1884 -0
package/docs/api-manifest.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"framework": "bcp",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.15",
|
|
5
5
|
"releaseState": "unreleased",
|
|
6
6
|
"coverage": "public-entrypoints",
|
|
7
7
|
"entrypoints": [
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"environment": "universal",
|
|
12
12
|
"route": "/docs/api-reference#bcp",
|
|
13
13
|
"summary": "React application APIs for routing, links, forms, loader/guard data, islands, metadata and route error handling.",
|
|
14
|
-
"guides": ["/docs/routing", "/docs/server-data-loaders", "/docs/route-guards", "/docs/form-actions"]
|
|
14
|
+
"guides": ["/docs/routing", "/docs/server-data-loaders", "/docs/route-guards", "/docs/form-actions", "/docs/testing-platform"]
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"package": "bcp/island",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"environment": "server",
|
|
60
60
|
"route": "/docs/api-reference#bcp-database",
|
|
61
61
|
"summary": "Provider-neutral MySQL, PostgreSQL and SQLite query, transaction, lifecycle and migration primitives.",
|
|
62
|
-
"guides": ["/docs/database", "/docs/database-migrations", "/docs/transactional-outbox-events"]
|
|
62
|
+
"guides": ["/docs/database", "/docs/database-migrations", "/docs/transactional-outbox-events", "/docs/testing-platform"]
|
|
63
63
|
},
|
|
64
64
|
{
|
|
65
65
|
"package": "bcp/auth",
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"environment": "server",
|
|
68
68
|
"route": "/docs/api-reference#bcp-auth",
|
|
69
69
|
"summary": "Authentication Platform v2 plus permission checks, authorization policies and auth/guest/role/permission route guards.",
|
|
70
|
-
"guides": ["/docs/authentication", "/docs/auth-session-store", "/docs/auth-route-guards", "/docs/authorization-security", "/docs/session-auth"]
|
|
70
|
+
"guides": ["/docs/authentication", "/docs/auth-session-store", "/docs/auth-route-guards", "/docs/authorization-security", "/docs/session-auth", "/docs/testing-platform"]
|
|
71
71
|
},
|
|
72
72
|
{
|
|
73
73
|
"package": "bcp/jobs",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"environment": "server",
|
|
76
76
|
"route": "/docs/api-reference#bcp-jobs",
|
|
77
77
|
"summary": "Background queues and schedules with visibility leases, heartbeats, stale recovery, DLQ maintenance and Redis-compatible durable adapters.",
|
|
78
|
-
"guides": ["/docs/background-jobs", "/docs/job-scheduling", "/docs/durable-jobs", "/docs/transactional-outbox-events", "/docs/realtime-platform", "/docs/observability"]
|
|
78
|
+
"guides": ["/docs/background-jobs", "/docs/job-scheduling", "/docs/durable-jobs", "/docs/transactional-outbox-events", "/docs/realtime-platform", "/docs/testing-platform", "/docs/observability"]
|
|
79
79
|
},
|
|
80
80
|
{
|
|
81
81
|
"package": "bcp/workflow",
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
"environment": "server",
|
|
84
84
|
"route": "/docs/api-reference#bcp-workflow",
|
|
85
85
|
"summary": "Persistent workflow orchestration with sequential and parallel steps, retries, delays, compensation, run leases and optional durable queue execution.",
|
|
86
|
-
"guides": ["/docs/workflow-orchestration", "/docs/durable-jobs", "/docs/realtime-platform", "/docs/observability"]
|
|
86
|
+
"guides": ["/docs/workflow-orchestration", "/docs/durable-jobs", "/docs/realtime-platform", "/docs/testing-platform", "/docs/observability"]
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
"package": "bcp/events",
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
"environment": "server",
|
|
92
92
|
"route": "/docs/api-reference#bcp-events",
|
|
93
93
|
"summary": "Transactional outbox and event delivery APIs with SQL persistence, dispatcher leases, retries, stale recovery, queue handoff and in-process event bus delivery.",
|
|
94
|
-
"guides": ["/docs/transactional-outbox-events", "/docs/database", "/docs/durable-jobs", "/docs/realtime-platform", "/docs/observability"]
|
|
94
|
+
"guides": ["/docs/transactional-outbox-events", "/docs/database", "/docs/durable-jobs", "/docs/realtime-platform", "/docs/testing-platform", "/docs/observability"]
|
|
95
95
|
},
|
|
96
96
|
{
|
|
97
97
|
"package": "bcp/realtime",
|
|
@@ -99,7 +99,23 @@
|
|
|
99
99
|
"environment": "server",
|
|
100
100
|
"route": "/docs/api-reference#bcp-realtime",
|
|
101
101
|
"summary": "Realtime channels, cross-hub broker delivery, presence, channel authorization, WebSocket adapter integration, heartbeat handling and built-in Server-Sent Events responses.",
|
|
102
|
-
"guides": ["/docs/realtime-platform", "/docs/authentication", "/docs/observability"]
|
|
102
|
+
"guides": ["/docs/realtime-platform", "/docs/authentication", "/docs/testing-platform", "/docs/observability"]
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
"package": "bcp/testing",
|
|
106
|
+
"source": "packages/client/src/testing.ts",
|
|
107
|
+
"environment": "server",
|
|
108
|
+
"route": "/docs/api-reference#bcp-testing",
|
|
109
|
+
"summary": "Framework-native testing utilities for Request/Response handlers, signed auth sessions, rollback transactions, page/server execution, middleware, jobs, workflows, outbox delivery, realtime sockets and SSE.",
|
|
110
|
+
"guides": ["/docs/testing-platform", "/docs/authentication", "/docs/database", "/docs/durable-jobs", "/docs/workflow-orchestration", "/docs/transactional-outbox-events", "/docs/realtime-platform"]
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"package": "bcp/plugins",
|
|
114
|
+
"source": "packages/client/src/plugins.ts",
|
|
115
|
+
"environment": "server",
|
|
116
|
+
"route": "/docs/api-reference#bcp-plugins",
|
|
117
|
+
"summary": "Plugin and module composition with dependency ordering, lifecycle hooks, typed config parsing, shared services and asynchronous extension hooks.",
|
|
118
|
+
"guides": ["/docs/plugin-module-platform", "/docs/configuration", "/docs/testing-platform", "/docs/observability"]
|
|
103
119
|
},
|
|
104
120
|
{
|
|
105
121
|
"package": "bcp/observability",
|
|
@@ -115,7 +131,7 @@
|
|
|
115
131
|
"environment": "server",
|
|
116
132
|
"route": "/docs/api-reference#bcp-server",
|
|
117
133
|
"summary": "Request context, cookies, CSRF/same-origin protection, logging, production hardening, upload, storage, response and session APIs.",
|
|
118
|
-
"guides": ["/docs/server-request-apis", "/docs/authorization-security", "/docs/file-upload", "/docs/storage", "/docs/storage-ecosystem", "/docs/production-hardening"]
|
|
134
|
+
"guides": ["/docs/server-request-apis", "/docs/authorization-security", "/docs/file-upload", "/docs/storage", "/docs/storage-ecosystem", "/docs/production-hardening", "/docs/testing-platform"]
|
|
119
135
|
},
|
|
120
136
|
{
|
|
121
137
|
"package": "bcp/server-only",
|
|
@@ -131,7 +147,7 @@
|
|
|
131
147
|
"environment": "server",
|
|
132
148
|
"route": "/docs/api-reference#bcp-middleware",
|
|
133
149
|
"summary": "Middleware System v2 request/response pipeline types and helpers.",
|
|
134
|
-
"guides": ["/docs/middleware"]
|
|
150
|
+
"guides": ["/docs/middleware", "/docs/testing-platform"]
|
|
135
151
|
}
|
|
136
152
|
]
|
|
137
153
|
}
|
package/docs/api-reference.md
CHANGED
|
@@ -10,7 +10,7 @@ Universal React application APIs.
|
|
|
10
10
|
|
|
11
11
|
Common exports include `Form`, `Link`, `createIsland`, `navigate`, `notFound`, loader/action/guard hooks and router/navigation APIs.
|
|
12
12
|
|
|
13
|
-
Related guides: [Routing](routing.md), [Server Data Loaders](server-data-loaders.md), [Route Guards](route-guards.md), [Form Actions](form-actions.md).
|
|
13
|
+
Related guides: [Routing](routing.md), [Server Data Loaders](server-data-loaders.md), [Route Guards](route-guards.md), [Form Actions](form-actions.md), [Testing Platform](testing-platform.md).
|
|
14
14
|
|
|
15
15
|
## `bcp/island`
|
|
16
16
|
|
|
@@ -54,7 +54,7 @@ Server-only Database Platform v2 APIs.
|
|
|
54
54
|
|
|
55
55
|
Built-in SQL providers are MySQL, PostgreSQL and SQLite. `BcpDatabase` instances expose lazy query/execute/transaction operations plus explicit `connect()`, `disconnect()` and backward-compatible `close()` lifecycle methods.
|
|
56
56
|
|
|
57
|
-
Related guides: [Database](database.md), [Database Migrations](database-migrations.md), [Transactional Outbox & Events](transactional-outbox-events.md).
|
|
57
|
+
Related guides: [Database](database.md), [Database Migrations](database-migrations.md), [Transactional Outbox & Events](transactional-outbox-events.md), [Testing Platform](testing-platform.md).
|
|
58
58
|
|
|
59
59
|
## `bcp/auth`
|
|
60
60
|
|
|
@@ -62,7 +62,7 @@ Server-only authentication and authorization APIs.
|
|
|
62
62
|
|
|
63
63
|
The default authentication mode remains stateless signed JWT-cookie authentication. Applications may opt into server-side session stores, revocation, logout-all, idle timeout, role/permission guards and resource-aware authorization policies.
|
|
64
64
|
|
|
65
|
-
Related guides: [Authentication](authentication.md), [Auth Session Stores](auth-session-store.md), [Auth Route Guards](auth-route-guards.md), [Authorization & Security v2](authorization-security.md), [JWT Sessions](session-auth.md).
|
|
65
|
+
Related guides: [Authentication](authentication.md), [Auth Session Stores](auth-session-store.md), [Auth Route Guards](auth-route-guards.md), [Authorization & Security v2](authorization-security.md), [JWT Sessions](session-auth.md), [Testing Platform](testing-platform.md).
|
|
66
66
|
|
|
67
67
|
## `bcp/jobs`
|
|
68
68
|
|
|
@@ -78,7 +78,7 @@ BCP does not install a Redis library and does not create the connection. Applica
|
|
|
78
78
|
|
|
79
79
|
The processing model is at-least-once. Handlers that perform non-idempotent external side effects should use application-level idempotency protection.
|
|
80
80
|
|
|
81
|
-
Related guides: [Background Jobs Platform](background-jobs.md), [Job Scheduling Platform](job-scheduling.md), [Durable Jobs Platform](durable-jobs.md), [Transactional Outbox & Events](transactional-outbox-events.md), [Realtime Platform](realtime-platform.md), [Observability Platform v2](observability.md).
|
|
81
|
+
Related guides: [Background Jobs Platform](background-jobs.md), [Job Scheduling Platform](job-scheduling.md), [Durable Jobs Platform](durable-jobs.md), [Transactional Outbox & Events](transactional-outbox-events.md), [Realtime Platform](realtime-platform.md), [Testing Platform](testing-platform.md), [Observability Platform v2](observability.md).
|
|
82
82
|
|
|
83
83
|
## `bcp/workflow`
|
|
84
84
|
|
|
@@ -111,7 +111,7 @@ When an existing `BackgroundJobQueue` is supplied, workflow execution and delay
|
|
|
111
111
|
|
|
112
112
|
`WorkflowStore.claim()` / `release()` form the run-level lease boundary for multi-instance stores.
|
|
113
113
|
|
|
114
|
-
Related guides: [Workflow Orchestration](workflow-orchestration.md), [Durable Jobs Platform](durable-jobs.md), [Realtime Platform](realtime-platform.md), [Observability Platform v2](observability.md).
|
|
114
|
+
Related guides: [Workflow Orchestration](workflow-orchestration.md), [Durable Jobs Platform](durable-jobs.md), [Realtime Platform](realtime-platform.md), [Testing Platform](testing-platform.md), [Observability Platform v2](observability.md).
|
|
115
115
|
|
|
116
116
|
## `bcp/events`
|
|
117
117
|
|
|
@@ -136,7 +136,7 @@ import {
|
|
|
136
136
|
|
|
137
137
|
Delivery is at-least-once; consumers should use idempotency controls for non-repeatable side effects.
|
|
138
138
|
|
|
139
|
-
Related guides: [Transactional Outbox & Events](transactional-outbox-events.md), [Database](database.md), [Durable Jobs Platform](durable-jobs.md), [Realtime Platform](realtime-platform.md), [Observability Platform v2](observability.md).
|
|
139
|
+
Related guides: [Transactional Outbox & Events](transactional-outbox-events.md), [Database](database.md), [Durable Jobs Platform](durable-jobs.md), [Realtime Platform](realtime-platform.md), [Testing Platform](testing-platform.md), [Observability Platform v2](observability.md).
|
|
140
140
|
|
|
141
141
|
## `bcp/realtime`
|
|
142
142
|
|
|
@@ -168,47 +168,191 @@ import {
|
|
|
168
168
|
} from "bcp/realtime";
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
### Hub and channels
|
|
172
|
-
|
|
173
171
|
`createRealtime()` creates a server-side hub. Connections can `join()`, `leave()`, `emit()`, `send()`, `touch()` and `disconnect()`.
|
|
174
172
|
|
|
175
|
-
`hub
|
|
173
|
+
`RealtimeBroker` is the cross-hub pub/sub boundary and `RealtimePresenceStore` is the channel-presence boundary. Built-in memory implementations are intended for tests/single-process use; shared deployments can supply provider adapters.
|
|
176
174
|
|
|
177
|
-
|
|
175
|
+
`RealtimeOptions.authenticate` can resolve identity from a Request/connection payload, while `authorizeChannel` runs before channel membership is accepted.
|
|
178
176
|
|
|
179
|
-
|
|
177
|
+
BCP does not install a WebSocket provider. `RealtimeSocket` defines the minimal transport surface consumed by `hub.attachSocket()`.
|
|
180
178
|
|
|
181
|
-
|
|
179
|
+
`hub.sse()` and `createRealtimeSseResponse()` expose Web-standard Server-Sent Events responses with abort, filtering, retry hint and keep-alive options.
|
|
182
180
|
|
|
183
|
-
|
|
181
|
+
Realtime delivery is transient. Use database/outbox/jobs/workflows for durable state and refetch durable state/history after reconnect when catch-up is required.
|
|
184
182
|
|
|
185
|
-
|
|
183
|
+
Related guides: [Realtime Platform](realtime-platform.md), [Authentication](authentication.md), [Testing Platform](testing-platform.md), [Observability Platform v2](observability.md).
|
|
186
184
|
|
|
187
|
-
|
|
185
|
+
## `bcp/testing`
|
|
188
186
|
|
|
189
|
-
|
|
187
|
+
Server-only Testing Platform APIs added in `0.2.14`.
|
|
190
188
|
|
|
191
|
-
|
|
189
|
+
```ts
|
|
190
|
+
import {
|
|
191
|
+
createFakeClock,
|
|
192
|
+
createJobTestHarness,
|
|
193
|
+
createOutboxTestHarness,
|
|
194
|
+
createRealtimeTestHarness,
|
|
195
|
+
createRealtimeTestSocket,
|
|
196
|
+
createRouteTestHandler,
|
|
197
|
+
createSequenceIdFactory,
|
|
198
|
+
createTestApp,
|
|
199
|
+
createTestAuthSession,
|
|
200
|
+
createTestFormData,
|
|
201
|
+
createWorkflowTestHarness,
|
|
202
|
+
expectResponse,
|
|
203
|
+
readSseEvents,
|
|
204
|
+
runTestMiddleware,
|
|
205
|
+
runTestPageAction,
|
|
206
|
+
runTestPageGuards,
|
|
207
|
+
runTestPageLoader,
|
|
208
|
+
withTestTransaction,
|
|
209
|
+
type CreateTestAuthSessionOptions,
|
|
210
|
+
type FakeClock,
|
|
211
|
+
type JobTestHarness,
|
|
212
|
+
type OutboxTestHarness,
|
|
213
|
+
type ParsedSseEvent,
|
|
214
|
+
type RealtimeTestConnection,
|
|
215
|
+
type RealtimeTestHarness,
|
|
216
|
+
type RealtimeTestSocket,
|
|
217
|
+
type TestApp,
|
|
218
|
+
type TestAppOptions,
|
|
219
|
+
type TestAuthSession,
|
|
220
|
+
type TestPageActionOptions,
|
|
221
|
+
type TestPageContextOptions,
|
|
222
|
+
type TestPageGuardOptions,
|
|
223
|
+
type TestRequestHandler,
|
|
224
|
+
type TestRequestOptions,
|
|
225
|
+
type TestResponseExpectation,
|
|
226
|
+
type TestRouteFunction,
|
|
227
|
+
type TestRouteHandlerOptions,
|
|
228
|
+
type TestRouteMethod,
|
|
229
|
+
type TestRouteModule,
|
|
230
|
+
type TestTransactionDatabase,
|
|
231
|
+
type WorkflowTestHarness,
|
|
232
|
+
} from "bcp/testing";
|
|
233
|
+
```
|
|
192
234
|
|
|
193
|
-
###
|
|
235
|
+
### Request application harness
|
|
194
236
|
|
|
195
|
-
|
|
237
|
+
`createTestApp()` runs a Web-standard `Request -> Response` handler with convenience methods for GET/POST/PUT/PATCH/DELETE, JSON bodies, mutable default headers and an in-memory cookie jar that consumes `Set-Cookie` responses.
|
|
196
238
|
|
|
197
|
-
|
|
239
|
+
### API route module testing
|
|
198
240
|
|
|
199
|
-
|
|
241
|
+
`createRouteTestHandler()` adapts BCP-style method exports (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD`, `OPTIONS`) to a Request handler. Missing methods return 405 with an `Allow` header.
|
|
200
242
|
|
|
201
|
-
|
|
243
|
+
Return values are normalized for tests: Response is preserved, strings become text Responses, null/undefined become 204, and other values become JSON.
|
|
202
244
|
|
|
203
|
-
|
|
245
|
+
### Page loader, guard and form action testing
|
|
204
246
|
|
|
205
|
-
|
|
247
|
+
`runTestPageGuards()` executes one or more guards through the production `executePageGuardFunctions()` path. Guard data is chained in order and redirect/other Response short-circuits are preserved.
|
|
206
248
|
|
|
207
|
-
`
|
|
249
|
+
`runTestPageLoader()` invokes the production `executePageLoaderFunction()` path with test params, URL/search params and optional guard data. The returned value is the normal `PageLoaderExecution` contract.
|
|
208
250
|
|
|
209
|
-
|
|
251
|
+
`runTestPageAction()` invokes the production `executePageActionFunction()` path, including action-name/method validation, guard data, FormData and Response/data handling.
|
|
252
|
+
|
|
253
|
+
`createTestFormData()` creates a FormData object from string/Blob fields and supports repeated values.
|
|
254
|
+
|
|
255
|
+
### Response assertions
|
|
256
|
+
|
|
257
|
+
`expectResponse()` exposes lightweight runner-neutral assertions:
|
|
258
|
+
|
|
259
|
+
```text
|
|
260
|
+
status()
|
|
261
|
+
header()
|
|
262
|
+
text()
|
|
263
|
+
json()
|
|
264
|
+
jsonMatches()
|
|
265
|
+
```
|
|
266
|
+
|
|
267
|
+
BCP does not require Jest/Vitest assertion APIs.
|
|
268
|
+
|
|
269
|
+
### Auth testing
|
|
270
|
+
|
|
271
|
+
`createTestAuthSession()` uses the production `createSessionToken()` implementation, including HS256 signature, issuer/audience and expiration semantics. It can also register the matching server-side record in an `AuthSessionStore`.
|
|
272
|
+
|
|
273
|
+
This allows route/auth tests to use a real BCP session cookie instead of introducing a test-only identity header.
|
|
274
|
+
|
|
275
|
+
### Database rollback testing
|
|
276
|
+
|
|
277
|
+
`withTestTransaction()` executes a callback in a real BCP database transaction and deliberately rejects the transaction with an internal rollback sentinel after the test callback succeeds. The callback result is returned to the test while the transaction is rolled back.
|
|
278
|
+
|
|
279
|
+
Application callback errors remain unchanged and are not swallowed.
|
|
280
|
+
|
|
281
|
+
### Middleware testing
|
|
282
|
+
|
|
283
|
+
`runTestMiddleware()` invokes the actual Middleware System v2 onion pipeline through `executeMiddlewarePipeline()` and supports a custom downstream Request handler.
|
|
284
|
+
|
|
285
|
+
### Deterministic utilities
|
|
286
|
+
|
|
287
|
+
`createFakeClock()` exposes `now()`, `set()`, `advance()` and `reset()` for time-sensitive queues/workflows/schedulers.
|
|
288
|
+
|
|
289
|
+
`createSequenceIdFactory()` creates deterministic IDs for stable assertions.
|
|
290
|
+
|
|
291
|
+
### Infrastructure harnesses
|
|
292
|
+
|
|
293
|
+
`createJobTestHarness()` drains currently eligible work through the real `BackgroundJobQueue.processNext()` API and exposes record/count assertions.
|
|
294
|
+
|
|
295
|
+
`createWorkflowTestHarness()` can start/run workflows until terminal or waiting state and optionally force persisted delays to resume.
|
|
296
|
+
|
|
297
|
+
`createOutboxTestHarness()` dispatches through the actual `OutboxDispatcher` and exposes event/state/statistics helpers.
|
|
298
|
+
|
|
299
|
+
`createRealtimeTestSocket()` implements the `RealtimeSocket` adapter contract entirely in memory. `createRealtimeTestHarness()` connects that socket to a real `RealtimeHub` and can assert server-sent channel events.
|
|
300
|
+
|
|
301
|
+
`readSseEvents()` reads event-stream Responses, ignores comment/retry frames and JSON-decodes `data:` payloads when possible.
|
|
302
|
+
|
|
303
|
+
### Runner neutrality and boundary
|
|
304
|
+
|
|
305
|
+
`bcp/testing` has no dependency on Jest or Vitest. BCP's own suite uses Node `node:test`, but the helpers can be called from another runner.
|
|
306
|
+
|
|
307
|
+
The package is server-only; the client boundary validator rejects `bcp/testing` from pages/client islands.
|
|
308
|
+
|
|
309
|
+
Related guides: [Testing Platform](testing-platform.md), [Authentication](authentication.md), [Database](database.md), [Durable Jobs](durable-jobs.md), [Workflow Orchestration](workflow-orchestration.md), [Transactional Outbox & Events](transactional-outbox-events.md), [Realtime Platform](realtime-platform.md).
|
|
310
|
+
|
|
311
|
+
## `bcp/plugins`
|
|
312
|
+
|
|
313
|
+
Server-only Plugin & Module Platform APIs added in `0.2.15`.
|
|
314
|
+
|
|
315
|
+
```ts
|
|
316
|
+
import {
|
|
317
|
+
createPluginHookBus,
|
|
318
|
+
createPluginHost,
|
|
319
|
+
createPluginServiceRegistry,
|
|
320
|
+
defineModule,
|
|
321
|
+
definePlugin,
|
|
322
|
+
PluginDependencyError,
|
|
323
|
+
PluginLifecycleError,
|
|
324
|
+
type PluginConfigParser,
|
|
325
|
+
type PluginConfigSchema,
|
|
326
|
+
type PluginContext,
|
|
327
|
+
type PluginDefinition,
|
|
328
|
+
type PluginHookBus,
|
|
329
|
+
type PluginHookHandler,
|
|
330
|
+
type PluginHost,
|
|
331
|
+
type PluginHostOptions,
|
|
332
|
+
type PluginHostView,
|
|
333
|
+
type PluginModule,
|
|
334
|
+
type PluginRecord,
|
|
335
|
+
type PluginServiceKey,
|
|
336
|
+
type PluginServiceRegistry,
|
|
337
|
+
type PluginState,
|
|
338
|
+
} from "bcp/plugins";
|
|
339
|
+
```
|
|
340
|
+
|
|
341
|
+
`createPluginHost()` resolves required and optional plugin dependencies and starts plugins in topological order. `stop()` and `close()` shut them down/dispose them in reverse dependency order.
|
|
342
|
+
|
|
343
|
+
`defineModule()` groups reusable plugin definitions while preserving one global host dependency graph.
|
|
344
|
+
|
|
345
|
+
Plugin configuration can be parsed with a schema/parser during setup. Values from `PluginHostOptions.configs` override plugin-local defaults before parsing.
|
|
346
|
+
|
|
347
|
+
`PluginServiceRegistry` provides shared string/Symbol-keyed services. `PluginHookBus` provides awaited, in-process extension hooks in registration order.
|
|
348
|
+
|
|
349
|
+
Missing dependencies and dependency cycles throw `PluginDependencyError`. Setup/start failures surface `PluginLifecycleError`; startup failures roll back plugins that already started in the current transition.
|
|
350
|
+
|
|
351
|
+
`host.plugin()` and `host.plugins()` expose inspectable lifecycle records.
|
|
352
|
+
|
|
353
|
+
`bcp/plugins` is server-only and is rejected from page/client bundles.
|
|
210
354
|
|
|
211
|
-
Related guides: [
|
|
355
|
+
Related guides: [Plugin & Module Platform](plugin-module-platform.md), [Configuration](configuration.md), [Testing Platform](testing-platform.md), [Observability Platform v2](observability.md).
|
|
212
356
|
|
|
213
357
|
## `bcp/observability`
|
|
214
358
|
|
|
@@ -220,7 +364,7 @@ Related guides: [Observability Platform v2](observability.md), [Logging](develop
|
|
|
220
364
|
|
|
221
365
|
Server request/runtime APIs including request context, cookies, CSRF and same-origin protection, logging, graceful shutdown hooks, multipart upload helpers, storage adapters, file delivery, response helpers and low-level session primitives.
|
|
222
366
|
|
|
223
|
-
Related guides: [Server Request APIs](server-request-apis.md), [Authorization & Security v2](authorization-security.md), [File Upload](file-upload.md), [Storage](storage.md), [Storage Ecosystem](storage-ecosystem.md), [Production Hardening](production-hardening.md).
|
|
367
|
+
Related guides: [Server Request APIs](server-request-apis.md), [Authorization & Security v2](authorization-security.md), [File Upload](file-upload.md), [Storage](storage.md), [Storage Ecosystem](storage-ecosystem.md), [Production Hardening](production-hardening.md), [Testing Platform](testing-platform.md).
|
|
224
368
|
|
|
225
369
|
## `bcp/server-only`
|
|
226
370
|
|
|
@@ -236,7 +380,7 @@ Related guide: [Application Modules](application-modules.md).
|
|
|
236
380
|
|
|
237
381
|
Middleware System v2 APIs and types.
|
|
238
382
|
|
|
239
|
-
Related
|
|
383
|
+
Related guides: [Middleware](middleware.md), [Testing Platform](testing-platform.md).
|
|
240
384
|
|
|
241
385
|
## Stability
|
|
242
386
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"framework": "bcp",
|
|
4
|
-
"versionTarget": "0.2.
|
|
4
|
+
"versionTarget": "0.2.15",
|
|
5
5
|
"releaseState": "unreleased",
|
|
6
6
|
"sections": [
|
|
7
7
|
{
|
|
@@ -88,10 +88,12 @@
|
|
|
88
88
|
{
|
|
89
89
|
"id": "developer-experience",
|
|
90
90
|
"title": "Developer Experience",
|
|
91
|
-
"description": "Project generators, diagnostics, project metadata and framework maintenance tooling.",
|
|
91
|
+
"description": "Project generators, diagnostics, testing, plugin composition, project metadata and framework maintenance tooling.",
|
|
92
92
|
"pages": [
|
|
93
93
|
{ "route": "/docs/generators", "source": "generators.md", "title": "Project Generators" },
|
|
94
|
-
{ "route": "/docs/developer-tools", "source": "developer-tools.md", "title": "Doctor & Inspect" }
|
|
94
|
+
{ "route": "/docs/developer-tools", "source": "developer-tools.md", "title": "Doctor & Inspect" },
|
|
95
|
+
{ "route": "/docs/testing-platform", "source": "testing-platform.md", "title": "Testing Platform" },
|
|
96
|
+
{ "route": "/docs/plugin-module-platform", "source": "plugin-module-platform.md", "title": "Plugin & Module Platform" }
|
|
95
97
|
]
|
|
96
98
|
},
|
|
97
99
|
{
|
|
@@ -114,7 +116,9 @@
|
|
|
114
116
|
}
|
|
115
117
|
],
|
|
116
118
|
"releases": [
|
|
117
|
-
{ "route": "/releases/0.2.
|
|
119
|
+
{ "route": "/releases/0.2.15", "source": "releases/0.2.15.md", "version": "0.2.15", "state": "unreleased" },
|
|
120
|
+
{ "route": "/releases/0.2.14", "source": "releases/0.2.14.md", "version": "0.2.14" },
|
|
121
|
+
{ "route": "/releases/0.2.13", "source": "releases/0.2.13.md", "version": "0.2.13" },
|
|
118
122
|
{ "route": "/releases/0.2.12", "source": "releases/0.2.12.md", "version": "0.2.12" },
|
|
119
123
|
{ "route": "/releases/0.2.11", "source": "releases/0.2.11.md", "version": "0.2.11" },
|
|
120
124
|
{ "route": "/releases/0.2.10", "source": "releases/0.2.10.md", "version": "0.2.10" },
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
3
|
"framework": "bcp",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.15",
|
|
5
5
|
"releaseState": "unreleased",
|
|
6
|
-
"baseline": "
|
|
6
|
+
"baseline": "plugin-module-platform",
|
|
7
7
|
"runtime": {
|
|
8
8
|
"node": ">=24.11.0",
|
|
9
9
|
"react": "19",
|
|
@@ -23,6 +23,8 @@
|
|
|
23
23
|
"bcp/workflow",
|
|
24
24
|
"bcp/events",
|
|
25
25
|
"bcp/realtime",
|
|
26
|
+
"bcp/testing",
|
|
27
|
+
"bcp/plugins",
|
|
26
28
|
"bcp/observability",
|
|
27
29
|
"bcp/server",
|
|
28
30
|
"bcp/server-only",
|
|
@@ -121,6 +123,31 @@
|
|
|
121
123
|
"realtimeServerSentEvents": true,
|
|
122
124
|
"realtimeHeartbeats": true,
|
|
123
125
|
"realtimeCrossHubBroadcast": true,
|
|
126
|
+
"testingPlatform": true,
|
|
127
|
+
"testRequestHarness": true,
|
|
128
|
+
"testRouteHandlers": true,
|
|
129
|
+
"testPageLoaders": true,
|
|
130
|
+
"testPageGuards": true,
|
|
131
|
+
"testFormActions": true,
|
|
132
|
+
"testResponseAssertions": true,
|
|
133
|
+
"testAuthSessions": true,
|
|
134
|
+
"testTransactionRollback": true,
|
|
135
|
+
"testMiddlewarePipeline": true,
|
|
136
|
+
"testJobHarness": true,
|
|
137
|
+
"testWorkflowHarness": true,
|
|
138
|
+
"testOutboxHarness": true,
|
|
139
|
+
"testRealtimeSocket": true,
|
|
140
|
+
"testSseReader": true,
|
|
141
|
+
"deterministicTestClock": true,
|
|
142
|
+
"pluginModulePlatform": true,
|
|
143
|
+
"pluginDefinitions": true,
|
|
144
|
+
"pluginModules": true,
|
|
145
|
+
"pluginDependencyOrdering": true,
|
|
146
|
+
"pluginLifecycleHooks": true,
|
|
147
|
+
"pluginConfigSchemas": true,
|
|
148
|
+
"pluginServiceRegistry": true,
|
|
149
|
+
"pluginHookBus": true,
|
|
150
|
+
"pluginLifecycleRollback": true,
|
|
124
151
|
"databaseMigrations": true,
|
|
125
152
|
"databaseAdapterContract": true,
|
|
126
153
|
"databasePostgresql": true,
|
|
@@ -160,7 +187,7 @@
|
|
|
160
187
|
"s3-compatible"
|
|
161
188
|
],
|
|
162
189
|
"compatibility": {
|
|
163
|
-
"previousBaseline": "0.2.
|
|
190
|
+
"previousBaseline": "0.2.14",
|
|
164
191
|
"intentionalBreakingChangesFromPreviousBaseline": false,
|
|
165
192
|
"migrationGuide": "migration-0.2.md"
|
|
166
193
|
},
|
|
@@ -183,7 +210,9 @@
|
|
|
183
210
|
"workflowOrchestration": "workflow-orchestration.md",
|
|
184
211
|
"transactionalOutboxEvents": "transactional-outbox-events.md",
|
|
185
212
|
"realtimePlatform": "realtime-platform.md",
|
|
213
|
+
"testingPlatform": "testing-platform.md",
|
|
214
|
+
"pluginModulePlatform": "plugin-module-platform.md",
|
|
186
215
|
"migrationGuide": "migration-0.2.md",
|
|
187
|
-
"releaseNotes": "releases/0.2.
|
|
216
|
+
"releaseNotes": "releases/0.2.15.md"
|
|
188
217
|
}
|
|
189
218
|
}
|