@chidchanun/bcp 0.3.0 → 0.3.2
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 +135 -111
- package/docs/README.md +53 -78
- package/docs/api-freeze-snapshot.json +24 -2
- package/docs/api-manifest.json +29 -13
- package/docs/api-reference.md +195 -197
- package/docs/application-platform.md +141 -171
- package/docs/docs-web-manifest.json +9 -5
- package/docs/migration-0.3.md +189 -68
- package/docs/module-system-v2.md +386 -0
- package/docs/platform-contract.md +53 -37
- package/docs/platform-manifest.json +36 -4
- package/docs/releases/0.3.1.md +116 -0
- package/docs/releases/0.3.2.md +125 -0
- package/docs/service-container.md +333 -0
- package/package.json +13 -1
- package/packages/bundler/src/client-boundary.ts +2 -0
- package/packages/client/src/application.mjs +1004 -34
- package/packages/client/src/container.mjs +573 -0
- package/packages/client/src/container.ts +24 -0
- package/packages/client/src/modules.mjs +392 -0
- package/packages/client/src/modules.ts +17 -0
- package/packages/server/src/application.ts +171 -11
- package/packages/server/src/container.ts +970 -0
- package/packages/server/src/modules.ts +682 -0
package/docs/api-reference.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# API Reference
|
|
2
2
|
|
|
3
|
-
BCP Framework exposes supported
|
|
3
|
+
BCP Framework exposes supported APIs through public `bcp/*` package entrypoints. Application code should not import private implementation files under `packages/`.
|
|
4
4
|
|
|
5
|
-
The machine-readable source
|
|
5
|
+
The machine-readable ownership source is `docs/api-manifest.json` and the reviewed package-resolution baseline is `docs/api-freeze-snapshot.json`.
|
|
6
6
|
|
|
7
7
|
## `bcp`
|
|
8
8
|
|
|
@@ -12,13 +12,11 @@ Common exports include `Form`, `Link`, `createIsland`, `navigate`, `notFound` an
|
|
|
12
12
|
|
|
13
13
|
## `bcp/island`
|
|
14
14
|
|
|
15
|
-
Partial-hydration island
|
|
15
|
+
Partial-hydration island creation and loading strategy APIs.
|
|
16
16
|
|
|
17
17
|
## `bcp/cache`
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
Important exports:
|
|
19
|
+
Request/data caching plus Cache Platform v2 adapters, locks, invalidation and metrics.
|
|
22
20
|
|
|
23
21
|
```text
|
|
24
22
|
cache
|
|
@@ -35,47 +33,29 @@ createRedisCacheLockAdapter
|
|
|
35
33
|
createCacheMetrics
|
|
36
34
|
```
|
|
37
35
|
|
|
38
|
-
Public contracts include `CacheAdapter`, `CacheLockAdapter`, `CacheStore`, cache statistics/options and Redis command-client adapter types.
|
|
39
|
-
|
|
40
|
-
Related guides: [Caching](caching.md), [Cache Platform v2](cache-platform-v2.md), [Application Platform](application-platform.md).
|
|
41
|
-
|
|
42
36
|
## `bcp/config`
|
|
43
37
|
|
|
44
|
-
Typed
|
|
45
|
-
|
|
46
|
-
Prepared npm packages resolve the production runtime to compiled `config.mjs`.
|
|
47
|
-
|
|
48
|
-
Related guides: [Configuration](configuration.md), [Environment Validation](environment-validation.md), [Application Platform](application-platform.md).
|
|
38
|
+
Typed framework configuration, environment-schema validation and configuration diagnostics. Prepared packages expose compiled `config.mjs`.
|
|
49
39
|
|
|
50
40
|
## `bcp/validation`
|
|
51
41
|
|
|
52
|
-
Typed
|
|
42
|
+
Typed validators, parse helpers and structured validation errors.
|
|
53
43
|
|
|
54
44
|
## `bcp/error`
|
|
55
45
|
|
|
56
|
-
Structured HTTP error
|
|
46
|
+
Structured HTTP error creation, classification and response helpers.
|
|
57
47
|
|
|
58
48
|
## `bcp/database`
|
|
59
49
|
|
|
60
|
-
Server-only provider-neutral SQL APIs for MySQL, PostgreSQL and SQLite.
|
|
61
|
-
|
|
62
|
-
Core capabilities include query/execute, transactions, lifecycle and migrations.
|
|
63
|
-
|
|
64
|
-
Related guides: [Database](database.md), [Database Migrations](database-migrations.md), [Transactional Outbox & Events](transactional-outbox-events.md), [Application Platform](application-platform.md).
|
|
50
|
+
Server-only provider-neutral SQL APIs for MySQL, PostgreSQL and SQLite, including query/execute, transactions, lifecycle and migrations.
|
|
65
51
|
|
|
66
52
|
## `bcp/auth`
|
|
67
53
|
|
|
68
|
-
Server-only
|
|
69
|
-
|
|
70
|
-
Capabilities include JWT-cookie sessions, optional server-side session stores, revocation, logout-all, idle timeout, role/permission guards, policies, same-origin protection and auth/guest guards.
|
|
71
|
-
|
|
72
|
-
Prepared npm packages resolve the runtime to compiled `auth.mjs`.
|
|
54
|
+
Server-only authentication and authorization APIs including JWT cookie sessions, optional revocable session stores, role/permission guards, policies and auth/guest guards. Prepared packages expose compiled `auth.mjs`.
|
|
73
55
|
|
|
74
56
|
## `bcp/jobs`
|
|
75
57
|
|
|
76
|
-
Server-only background jobs, scheduling and durable
|
|
77
|
-
|
|
78
|
-
Important exports:
|
|
58
|
+
Server-only background jobs, scheduling and durable queue APIs.
|
|
79
59
|
|
|
80
60
|
```text
|
|
81
61
|
createJobQueue
|
|
@@ -88,26 +68,22 @@ nextCronTime
|
|
|
88
68
|
nextScheduleTime
|
|
89
69
|
```
|
|
90
70
|
|
|
91
|
-
Capabilities include delay, retry/backoff,
|
|
92
|
-
|
|
93
|
-
Processing remains at-least-once; non-repeatable external side effects should use application-level idempotency.
|
|
71
|
+
Capabilities include delay, retry/backoff, concurrency, cancellation, visibility leases, heartbeat, stale recovery, DLQ/requeue, cleanup, statistics and recurring schedules.
|
|
94
72
|
|
|
95
73
|
## `bcp/workflow`
|
|
96
74
|
|
|
97
|
-
Server-only
|
|
75
|
+
Server-only persistent workflow orchestration.
|
|
98
76
|
|
|
99
77
|
```text
|
|
100
78
|
createWorkflow
|
|
101
79
|
createMemoryWorkflowStore
|
|
102
80
|
```
|
|
103
81
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
Capabilities include sequential/parallel steps, per-step retry, persisted delays, compensation, run leases and optional execution through `bcp/jobs`.
|
|
82
|
+
Supports sequential/parallel steps, retries, persisted delays, compensation, run leases and optional durable queue execution.
|
|
107
83
|
|
|
108
84
|
## `bcp/events`
|
|
109
85
|
|
|
110
|
-
Server-only
|
|
86
|
+
Server-only transactional outbox and event delivery APIs.
|
|
111
87
|
|
|
112
88
|
```text
|
|
113
89
|
createTransactionalOutbox
|
|
@@ -118,11 +94,9 @@ createOutboxDispatcher
|
|
|
118
94
|
createEventBus
|
|
119
95
|
```
|
|
120
96
|
|
|
121
|
-
SQL outbox storage supports MySQL, PostgreSQL and SQLite. Dispatch supports batched claims, leases, stale recovery, retry/backoff, terminal failure, durable-job handoff and custom publishing.
|
|
122
|
-
|
|
123
97
|
## `bcp/realtime`
|
|
124
98
|
|
|
125
|
-
Server-only
|
|
99
|
+
Server-only channels/rooms, broker delivery, presence, authorization, socket adapters, heartbeat and Server-Sent Events APIs.
|
|
126
100
|
|
|
127
101
|
```text
|
|
128
102
|
createRealtime
|
|
@@ -131,11 +105,11 @@ createMemoryRealtimePresenceStore
|
|
|
131
105
|
createRealtimeSseResponse
|
|
132
106
|
```
|
|
133
107
|
|
|
134
|
-
BCP
|
|
108
|
+
BCP does not require a WebSocket server library; applications adapt providers through `RealtimeSocket`.
|
|
135
109
|
|
|
136
110
|
## `bcp/testing`
|
|
137
111
|
|
|
138
|
-
Server-only framework-native testing utilities
|
|
112
|
+
Server-only framework-native testing utilities without a Jest/Vitest requirement.
|
|
139
113
|
|
|
140
114
|
Important APIs include:
|
|
141
115
|
|
|
@@ -171,24 +145,17 @@ createPluginServiceRegistry
|
|
|
171
145
|
createPluginHookBus
|
|
172
146
|
```
|
|
173
147
|
|
|
174
|
-
|
|
148
|
+
The Plugin Platform service registry remains supported for compatibility. For new typed application dependencies, prefer `bcp/container`.
|
|
175
149
|
|
|
176
150
|
## `bcp/observability`
|
|
177
151
|
|
|
178
|
-
Server-only metrics, health and tracing APIs.
|
|
179
|
-
|
|
180
|
-
Metrics/health APIs:
|
|
152
|
+
Server-only metrics, health and distributed tracing APIs.
|
|
181
153
|
|
|
182
154
|
```text
|
|
183
155
|
createMetricsRegistry
|
|
184
156
|
createMetricsResponse
|
|
185
157
|
createRequestMetricsMiddleware
|
|
186
158
|
createHealthRegistry
|
|
187
|
-
```
|
|
188
|
-
|
|
189
|
-
Observability Platform v3 tracing APIs:
|
|
190
|
-
|
|
191
|
-
```text
|
|
192
159
|
createTracer
|
|
193
160
|
createRequestTracingMiddleware
|
|
194
161
|
createTraceCarrier
|
|
@@ -205,154 +172,189 @@ createTraceMetricsExporter
|
|
|
205
172
|
getTraceLogFields
|
|
206
173
|
```
|
|
207
174
|
|
|
208
|
-
|
|
175
|
+
Prepared packages expose compiled `observability.mjs`.
|
|
209
176
|
|
|
210
|
-
|
|
177
|
+
## `bcp/deployment`
|
|
211
178
|
|
|
212
|
-
|
|
179
|
+
Server-only Deployment Platform lifecycle APIs.
|
|
213
180
|
|
|
214
|
-
|
|
181
|
+
```text
|
|
182
|
+
createDeploymentRuntime
|
|
183
|
+
createDeploymentReadinessResponse
|
|
184
|
+
createDeploymentDiagnosticsResponse
|
|
185
|
+
```
|
|
215
186
|
|
|
216
|
-
|
|
187
|
+
Important types include `DeploymentRuntime`, `DeploymentResource`, `DeploymentReadinessReport`, `DeploymentDiagnosticsReport`, `DeploymentMetadata`, `DeploymentSignalOptions` and `DeploymentShutdownOptions`.
|
|
217
188
|
|
|
218
|
-
|
|
189
|
+
Resources start in registration order and stop in reverse order. Startup failure rolls back already-started resources.
|
|
219
190
|
|
|
220
|
-
|
|
191
|
+
Prepared packages expose compiled `deployment.mjs`.
|
|
221
192
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
createDeploymentReadinessResponse,
|
|
226
|
-
createDeploymentRuntime,
|
|
227
|
-
} from "bcp/deployment";
|
|
228
|
-
```
|
|
193
|
+
## `bcp/container`
|
|
194
|
+
|
|
195
|
+
Server-only Dependency Injection & Service Container APIs introduced in `0.3.1`.
|
|
229
196
|
|
|
230
|
-
|
|
197
|
+
Primary exports:
|
|
231
198
|
|
|
232
199
|
```text
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
DeploymentReadinessItem
|
|
242
|
-
DeploymentDiagnosticsReport
|
|
243
|
-
DeploymentDiagnosticsResource
|
|
244
|
-
DeploymentMetadata
|
|
245
|
-
DeploymentSignalOptions
|
|
246
|
-
DeploymentShutdownOptions
|
|
200
|
+
createServiceToken
|
|
201
|
+
createServiceContainer
|
|
202
|
+
provideValue
|
|
203
|
+
provideFactory
|
|
204
|
+
provideClass
|
|
205
|
+
ServiceNotFoundError
|
|
206
|
+
ServiceResolutionError
|
|
207
|
+
ServiceDisposalError
|
|
247
208
|
```
|
|
248
209
|
|
|
249
|
-
|
|
210
|
+
Important types:
|
|
250
211
|
|
|
251
|
-
```
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
212
|
+
```text
|
|
213
|
+
ServiceToken<T>
|
|
214
|
+
ServiceTokenValue<TToken>
|
|
215
|
+
ServiceDependencyValues<TDependencies>
|
|
216
|
+
ServiceProvider<T>
|
|
217
|
+
ServiceProviderOptions<T>
|
|
218
|
+
ServiceFactoryContext
|
|
219
|
+
ServiceLifetime
|
|
220
|
+
ServiceContainer
|
|
221
|
+
ServiceContainerOptions
|
|
222
|
+
ServiceScope
|
|
223
|
+
ServiceScopeOptions
|
|
224
|
+
ServiceScopeState
|
|
225
|
+
ServiceGraphNode
|
|
257
226
|
```
|
|
258
227
|
|
|
259
|
-
|
|
228
|
+
Create typed tokens:
|
|
260
229
|
|
|
261
230
|
```ts
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
async start() {
|
|
266
|
-
await db.connect();
|
|
267
|
-
},
|
|
268
|
-
|
|
269
|
-
ready() {
|
|
270
|
-
return true;
|
|
271
|
-
},
|
|
231
|
+
import {
|
|
232
|
+
createServiceToken,
|
|
233
|
+
} from "bcp/container";
|
|
272
234
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
});
|
|
235
|
+
const configToken =
|
|
236
|
+
createServiceToken<{
|
|
237
|
+
apiUrl: string;
|
|
238
|
+
}>("config");
|
|
277
239
|
```
|
|
278
240
|
|
|
279
|
-
|
|
241
|
+
Value provider:
|
|
280
242
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
failed
|
|
243
|
+
```ts
|
|
244
|
+
const configProvider =
|
|
245
|
+
provideValue(
|
|
246
|
+
configToken,
|
|
247
|
+
{
|
|
248
|
+
apiUrl: "https://api.example.com",
|
|
249
|
+
}
|
|
250
|
+
);
|
|
290
251
|
```
|
|
291
252
|
|
|
292
|
-
|
|
253
|
+
Typed factory dependencies:
|
|
293
254
|
|
|
294
255
|
```ts
|
|
295
|
-
const
|
|
296
|
-
|
|
256
|
+
const repositoryProvider =
|
|
257
|
+
provideFactory(
|
|
258
|
+
repositoryToken,
|
|
259
|
+
[
|
|
260
|
+
configToken,
|
|
261
|
+
] as const,
|
|
262
|
+
(_context, [config]) =>
|
|
263
|
+
createRepository(
|
|
264
|
+
config.apiUrl
|
|
265
|
+
)
|
|
266
|
+
);
|
|
297
267
|
```
|
|
298
268
|
|
|
299
|
-
|
|
269
|
+
Class provider:
|
|
300
270
|
|
|
301
271
|
```ts
|
|
302
|
-
|
|
303
|
-
|
|
272
|
+
provideClass(
|
|
273
|
+
serviceToken,
|
|
274
|
+
[
|
|
275
|
+
repositoryToken,
|
|
276
|
+
] as const,
|
|
277
|
+
UserService
|
|
304
278
|
);
|
|
305
279
|
```
|
|
306
280
|
|
|
307
|
-
|
|
281
|
+
Supported lifetimes:
|
|
308
282
|
|
|
309
|
-
|
|
283
|
+
```text
|
|
284
|
+
singleton
|
|
285
|
+
scoped
|
|
286
|
+
transient
|
|
287
|
+
```
|
|
288
|
+
|
|
289
|
+
The default is `singleton`.
|
|
290
|
+
|
|
291
|
+
Resolve services:
|
|
310
292
|
|
|
311
293
|
```ts
|
|
312
|
-
const
|
|
313
|
-
|
|
294
|
+
const container =
|
|
295
|
+
createServiceContainer({
|
|
296
|
+
providers: [
|
|
297
|
+
configProvider,
|
|
298
|
+
repositoryProvider,
|
|
299
|
+
],
|
|
300
|
+
});
|
|
301
|
+
|
|
302
|
+
const repository =
|
|
303
|
+
await container.resolve(
|
|
304
|
+
repositoryToken
|
|
305
|
+
);
|
|
314
306
|
```
|
|
315
307
|
|
|
316
|
-
|
|
308
|
+
Optional dependencies:
|
|
317
309
|
|
|
318
310
|
```ts
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
311
|
+
const value =
|
|
312
|
+
await container.optional(
|
|
313
|
+
optionalToken
|
|
314
|
+
);
|
|
322
315
|
```
|
|
323
316
|
|
|
324
|
-
|
|
317
|
+
Child/request scopes:
|
|
325
318
|
|
|
326
|
-
```
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
319
|
+
```ts
|
|
320
|
+
const requestScope =
|
|
321
|
+
container.createScope({
|
|
322
|
+
name: "request:123",
|
|
323
|
+
});
|
|
331
324
|
```
|
|
332
325
|
|
|
333
|
-
|
|
326
|
+
Testing overrides:
|
|
334
327
|
|
|
335
328
|
```ts
|
|
336
|
-
const
|
|
337
|
-
|
|
329
|
+
const testScope =
|
|
330
|
+
container.createScope({
|
|
331
|
+
name: "test",
|
|
332
|
+
overrides: [
|
|
333
|
+
provideValue(
|
|
334
|
+
mailerToken,
|
|
335
|
+
fakeMailer
|
|
336
|
+
),
|
|
337
|
+
],
|
|
338
|
+
});
|
|
338
339
|
```
|
|
339
340
|
|
|
340
|
-
|
|
341
|
+
`graph()` exposes effective provider descriptions, lifetimes, dependencies and override state. Circular dependency paths throw `ServiceResolutionError`.
|
|
341
342
|
|
|
342
|
-
|
|
343
|
+
Providers may define `dispose(value)`. The container disposes children first and resolved services in reverse creation order. Multiple disposal failures are collected in `ServiceDisposalError`.
|
|
343
344
|
|
|
344
|
-
|
|
345
|
-
const unregister =
|
|
346
|
-
deployment.registerShutdownHook();
|
|
347
|
-
```
|
|
345
|
+
Prepared npm contract:
|
|
348
346
|
|
|
349
|
-
|
|
347
|
+
```text
|
|
348
|
+
types -> packages/client/src/container.ts
|
|
349
|
+
default -> packages/client/src/container.mjs
|
|
350
|
+
browser -> packages/client/src/server-only.browser.mjs
|
|
351
|
+
```
|
|
350
352
|
|
|
351
|
-
Related
|
|
353
|
+
Related guide: [Dependency Injection & Service Container](service-container.md).
|
|
352
354
|
|
|
353
355
|
## `bcp/application`
|
|
354
356
|
|
|
355
|
-
Server-only
|
|
357
|
+
Server-only Application Platform composition root.
|
|
356
358
|
|
|
357
359
|
Primary exports:
|
|
358
360
|
|
|
@@ -362,7 +364,7 @@ createApp
|
|
|
362
364
|
ApplicationLifecycleError
|
|
363
365
|
```
|
|
364
366
|
|
|
365
|
-
Important
|
|
367
|
+
Important types:
|
|
366
368
|
|
|
367
369
|
```text
|
|
368
370
|
Application
|
|
@@ -373,80 +375,77 @@ ApplicationConfigSchema
|
|
|
373
375
|
ApplicationConfigParser
|
|
374
376
|
```
|
|
375
377
|
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
```ts
|
|
379
|
-
import {
|
|
380
|
-
createApp,
|
|
381
|
-
} from "bcp/application";
|
|
382
|
-
|
|
383
|
-
const app =
|
|
384
|
-
createApp({
|
|
385
|
-
name: "orders-api",
|
|
386
|
-
version: "1.0.0",
|
|
387
|
-
});
|
|
388
|
-
```
|
|
389
|
-
|
|
390
|
-
The application exposes the existing Plugin and Deployment platform objects:
|
|
378
|
+
`0.3.1` application roots expose both the typed DI container and the legacy Plugin Platform service registry:
|
|
391
379
|
|
|
392
380
|
```text
|
|
381
|
+
app.config
|
|
382
|
+
app.container
|
|
393
383
|
app.services
|
|
394
384
|
app.hooks
|
|
395
385
|
app.plugins
|
|
396
386
|
app.deployment
|
|
397
387
|
```
|
|
398
388
|
|
|
399
|
-
|
|
389
|
+
Define DI providers with the application:
|
|
400
390
|
|
|
401
391
|
```ts
|
|
402
|
-
app
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
392
|
+
const app =
|
|
393
|
+
createApp({
|
|
394
|
+
name: "orders-api",
|
|
395
|
+
providers: [
|
|
396
|
+
configProvider,
|
|
397
|
+
repositoryProvider,
|
|
398
|
+
],
|
|
399
|
+
});
|
|
406
400
|
```
|
|
407
401
|
|
|
408
|
-
|
|
402
|
+
Resolve from lifecycle hooks:
|
|
409
403
|
|
|
410
404
|
```ts
|
|
411
|
-
app
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
405
|
+
const app =
|
|
406
|
+
createApp({
|
|
407
|
+
name: "orders-api",
|
|
408
|
+
providers: [
|
|
409
|
+
repositoryProvider,
|
|
410
|
+
],
|
|
411
|
+
async setup(context) {
|
|
412
|
+
const repository =
|
|
413
|
+
await context.container.resolve(
|
|
414
|
+
repositoryToken
|
|
415
|
+
);
|
|
416
|
+
},
|
|
417
|
+
});
|
|
417
418
|
```
|
|
418
419
|
|
|
419
|
-
|
|
420
|
+
Additional container integration:
|
|
420
421
|
|
|
421
422
|
```text
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
resources start
|
|
425
|
-
application.start
|
|
423
|
+
app.register(provider)
|
|
424
|
+
app.createScope(options)
|
|
426
425
|
```
|
|
427
426
|
|
|
428
|
-
|
|
427
|
+
`register()` follows the application mutation rule and is allowed only before `start()`.
|
|
428
|
+
|
|
429
|
+
Application deployment order:
|
|
429
430
|
|
|
430
431
|
```text
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
application
|
|
432
|
+
bcp:container
|
|
433
|
+
bcp:plugins
|
|
434
|
+
application resources
|
|
435
|
+
bcp:application
|
|
435
436
|
```
|
|
436
437
|
|
|
437
|
-
|
|
438
|
+
Shutdown reverses this order. The container remains active while application resources/plugins stop, then disposes injected services before `application.dispose()` finishes the application lifecycle.
|
|
438
439
|
|
|
439
|
-
|
|
440
|
+
`readiness()` and `diagnostics()` delegate to Deployment Platform. `installSignalHandlers()` and `registerShutdownHook()` perform full application shutdown.
|
|
440
441
|
|
|
441
|
-
Prepared
|
|
442
|
+
Prepared packages expose compiled `application.mjs` and block the entrypoint from browser/page graphs.
|
|
442
443
|
|
|
443
|
-
Related guides: [Application Platform](application-platform.md), [
|
|
444
|
+
Related guides: [Application Platform](application-platform.md), [Service Container](service-container.md), [Migrating to 0.3.x](migration-0.3.md).
|
|
444
445
|
|
|
445
446
|
## `bcp/server`
|
|
446
447
|
|
|
447
|
-
Server request/runtime APIs including request context, cookies, CSRF/same-origin protection, logging, graceful shutdown hooks,
|
|
448
|
-
|
|
449
|
-
Prepared npm packages resolve this runtime to compiled `server.mjs`.
|
|
448
|
+
Server request/runtime APIs including request context, cookies, CSRF/same-origin protection, logging, graceful shutdown hooks, uploads, storage, response helpers and low-level session primitives. Prepared packages expose compiled `server.mjs`.
|
|
450
449
|
|
|
451
450
|
## `bcp/server-only`
|
|
452
451
|
|
|
@@ -458,13 +457,11 @@ import "bcp/server-only";
|
|
|
458
457
|
|
|
459
458
|
## `bcp/middleware`
|
|
460
459
|
|
|
461
|
-
Middleware System v2 request/response pipeline types and helpers.
|
|
462
|
-
|
|
463
|
-
Prepared npm packages resolve this runtime to compiled `middleware.mjs`.
|
|
460
|
+
Middleware System v2 request/response pipeline types and helpers. Prepared packages expose compiled `middleware.mjs`.
|
|
464
461
|
|
|
465
462
|
## Prepared server runtime map
|
|
466
463
|
|
|
467
|
-
For `0.3.
|
|
464
|
+
For `0.3.1`, prepared npm packages use compiled ESM runtime defaults for:
|
|
468
465
|
|
|
469
466
|
```text
|
|
470
467
|
bcp/cache -> cache.mjs
|
|
@@ -479,15 +476,16 @@ bcp/testing -> testing.mjs
|
|
|
479
476
|
bcp/plugins -> plugins.mjs
|
|
480
477
|
bcp/observability -> observability.mjs
|
|
481
478
|
bcp/deployment -> deployment.mjs
|
|
479
|
+
bcp/container -> container.mjs
|
|
482
480
|
bcp/application -> application.mjs
|
|
483
481
|
bcp/server -> server.mjs
|
|
484
482
|
bcp/middleware -> middleware.mjs
|
|
485
483
|
```
|
|
486
484
|
|
|
487
|
-
Types remain sourced from
|
|
485
|
+
Types remain sourced from public TypeScript entrypoint files.
|
|
488
486
|
|
|
489
487
|
## Stability
|
|
490
488
|
|
|
491
|
-
Only entrypoints listed in both `docs/platform-manifest.json` and `docs/api-manifest.json` are
|
|
489
|
+
Only entrypoints listed in both `docs/platform-manifest.json` and `docs/api-manifest.json` are supported public platform modules.
|
|
492
490
|
|
|
493
|
-
|
|
491
|
+
`docs/api-freeze-snapshot.json` records the current reviewed package/CLI/API baseline. Internal `packages/*` files remain implementation details unless exposed through a documented public entrypoint.
|