@chidchanun/bcp 0.2.19 → 0.3.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.
- package/README.md +207 -98
- package/docs/README.md +82 -62
- package/docs/api-freeze-snapshot.json +254 -232
- package/docs/api-manifest.json +29 -13
- package/docs/api-reference.md +240 -149
- package/docs/application-platform.md +348 -0
- package/docs/docs-web-manifest.json +10 -5
- package/docs/migration-0.3.md +280 -0
- package/docs/platform-contract.md +68 -23
- package/docs/platform-manifest.json +38 -6
- package/docs/releases/0.3.0.md +129 -0
- package/docs/releases/0.3.1.md +116 -0
- package/docs/service-container.md +333 -0
- package/docs/stability-api-freeze.md +62 -91
- package/package.json +14 -2
- package/packages/bundler/src/client-boundary.ts +2 -0
- package/packages/client/src/application.mjs +2439 -0
- package/packages/client/src/application.ts +12 -0
- package/packages/client/src/container.mjs +573 -0
- package/packages/client/src/container.ts +24 -0
- package/packages/server/src/application.ts +956 -0
- package/packages/server/src/container.ts +970 -0
package/README.md
CHANGED
|
@@ -1,36 +1,34 @@
|
|
|
1
1
|
# BCP Framework
|
|
2
2
|
|
|
3
|
-
BCP Framework is a React full-stack framework for file-based routing, SSR,
|
|
3
|
+
BCP Framework is a React full-stack application framework for file-based routing, SSR, server data, APIs, authentication, SQL databases, jobs, workflows, transactional events, realtime, caching, observability, plugins, dependency injection, deployment lifecycle and standalone Node.js production builds.
|
|
4
4
|
|
|
5
|
-
> **Development target:** `0.
|
|
5
|
+
> **Development target:** `0.3.1 — Dependency Injection & Service Container`
|
|
6
6
|
>
|
|
7
|
-
> `0.
|
|
7
|
+
> `0.3.1` remains unreleased until local validation, RC checks, tagging and npm publication complete.
|
|
8
8
|
|
|
9
9
|
## Current platform
|
|
10
10
|
|
|
11
11
|
| Area | Capability |
|
|
12
12
|
| --- | --- |
|
|
13
|
-
| Application |
|
|
13
|
+
| Application runtime | `defineApp()` / `createApp()`, typed config, DI, plugins/modules, resource lifecycle, readiness and diagnostics |
|
|
14
|
+
| Dependency injection | Typed tokens, value/factory/class providers, singleton/scoped/transient lifetimes, child scopes and test overrides |
|
|
14
15
|
| Routing | Static, dynamic, catch-all, optional catch-all and route groups |
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
| Authentication | JWT cookie sessions,
|
|
16
|
+
| Rendering | React SSR, hydration, layouts, metadata and SPA navigation |
|
|
17
|
+
| Server data | Route loaders, guards, actions and request-scoped server APIs |
|
|
18
|
+
| Authentication | JWT cookie sessions, revocation, logout-all and idle timeout |
|
|
18
19
|
| Authorization | Auth/guest/role/permission guards and resource-aware policies |
|
|
19
|
-
| Security | Same-origin validation and signed CSRF tokens |
|
|
20
|
-
| Middleware | Middleware System v2 with onion execution |
|
|
21
20
|
| Database | MySQL, PostgreSQL and SQLite adapters, transactions, lifecycle and migrations |
|
|
22
|
-
| Jobs | Delay, retries, scheduling, Redis-compatible durable queues, heartbeat,
|
|
21
|
+
| Jobs | Delay, retries, scheduling, Redis-compatible durable queues, heartbeat, recovery and DLQ |
|
|
23
22
|
| Workflows | Sequential/parallel steps, retries, persisted delays, compensation and run leases |
|
|
24
|
-
| Events | Transactional outbox, SQL persistence, dispatcher leases
|
|
25
|
-
| Realtime | Channels
|
|
23
|
+
| Events | Transactional outbox, SQL persistence, dispatcher leases and durable handoff |
|
|
24
|
+
| Realtime | Channels, presence, broker delivery, WebSocket adapter contract, SSE and heartbeat |
|
|
25
|
+
| Plugins | Dependency ordering, lifecycle, config parsing, legacy shared services and async hooks |
|
|
26
|
+
| Cache | Redis-compatible adapters/locks, stampede protection, TTL/tag/path invalidation and metrics |
|
|
27
|
+
| Observability | Prometheus metrics, health/readiness, distributed tracing, W3C context and correlation IDs |
|
|
28
|
+
| Deployment | Resource lifecycle, readiness, diagnostics, runtime identity and graceful shutdown |
|
|
26
29
|
| Testing | Request/route/page/auth/database/middleware/jobs/workflow/outbox/realtime/SSE harnesses |
|
|
27
|
-
|
|
|
28
|
-
|
|
|
29
|
-
| Observability | Prometheus metrics, health/readiness, distributed tracing, W3C trace context and correlation IDs |
|
|
30
|
-
| Deployment | Resource lifecycle, readiness, diagnostics, runtime identity, signal handling and graceful shutdown |
|
|
31
|
-
| Stability | Frozen public/CLI/package contract, compatibility gate and release-readiness report |
|
|
32
|
-
| Production | Standalone Node.js build, compiled server entrypoints, dependency pruning and Docker starter |
|
|
33
|
-
| Documentation | Manifest-driven docs, API/platform metadata and release contracts |
|
|
30
|
+
| Stability | API baseline snapshot, package-export parity and release-readiness gates |
|
|
31
|
+
| Production | Standalone Node.js build, compiled server runtimes, dependency pruning and Docker starter |
|
|
34
32
|
|
|
35
33
|
## Requirements
|
|
36
34
|
|
|
@@ -64,77 +62,204 @@ Generated projects normally use one framework dependency:
|
|
|
64
62
|
}
|
|
65
63
|
```
|
|
66
64
|
|
|
67
|
-
##
|
|
65
|
+
## Dependency Injection & Service Container — 0.3.1
|
|
66
|
+
|
|
67
|
+
`0.3.1` adds the server-only `bcp/container` entrypoint.
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
import {
|
|
71
|
+
createServiceContainer,
|
|
72
|
+
createServiceToken,
|
|
73
|
+
provideFactory,
|
|
74
|
+
provideValue,
|
|
75
|
+
} from "bcp/container";
|
|
76
|
+
|
|
77
|
+
const configToken =
|
|
78
|
+
createServiceToken<{
|
|
79
|
+
apiUrl: string;
|
|
80
|
+
}>("config");
|
|
81
|
+
|
|
82
|
+
const clientToken =
|
|
83
|
+
createServiceToken<{
|
|
84
|
+
apiUrl: string;
|
|
85
|
+
}>("api-client");
|
|
86
|
+
|
|
87
|
+
const container =
|
|
88
|
+
createServiceContainer({
|
|
89
|
+
providers: [
|
|
90
|
+
provideValue(
|
|
91
|
+
configToken,
|
|
92
|
+
{
|
|
93
|
+
apiUrl: "https://api.example.com",
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
provideFactory(
|
|
97
|
+
clientToken,
|
|
98
|
+
[
|
|
99
|
+
configToken,
|
|
100
|
+
] as const,
|
|
101
|
+
(_context, [config]) => ({
|
|
102
|
+
apiUrl: config.apiUrl,
|
|
103
|
+
})
|
|
104
|
+
),
|
|
105
|
+
],
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
const client =
|
|
109
|
+
await container.resolve(
|
|
110
|
+
clientToken
|
|
111
|
+
);
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Supported lifetimes:
|
|
68
115
|
|
|
69
116
|
```text
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
bcp/middleware
|
|
117
|
+
singleton one shared instance
|
|
118
|
+
scoped one instance per child/request scope
|
|
119
|
+
transient a new instance for every resolve
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Testing/request overrides use child scopes:
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
const testScope =
|
|
126
|
+
container.createScope({
|
|
127
|
+
name: "test",
|
|
128
|
+
overrides: [
|
|
129
|
+
provideValue(
|
|
130
|
+
configToken,
|
|
131
|
+
fakeConfig
|
|
132
|
+
),
|
|
133
|
+
],
|
|
134
|
+
});
|
|
89
135
|
```
|
|
90
136
|
|
|
91
|
-
|
|
137
|
+
Resolved disposable services are cleaned up in reverse creation order. Circular dependency graphs fail with `ServiceResolutionError` instead of returning partial objects.
|
|
138
|
+
|
|
139
|
+
Read more: [Dependency Injection & Service Container](docs/service-container.md).
|
|
92
140
|
|
|
93
|
-
##
|
|
141
|
+
## BCP Application Platform — 0.3.x
|
|
94
142
|
|
|
95
|
-
|
|
143
|
+
`bcp/application` is the server-side composition root.
|
|
144
|
+
|
|
145
|
+
```ts
|
|
146
|
+
import {
|
|
147
|
+
createApp,
|
|
148
|
+
} from "bcp/application";
|
|
149
|
+
import {
|
|
150
|
+
createServiceToken,
|
|
151
|
+
provideValue,
|
|
152
|
+
} from "bcp/container";
|
|
153
|
+
|
|
154
|
+
const configToken =
|
|
155
|
+
createServiceToken<{
|
|
156
|
+
region: string;
|
|
157
|
+
}>("config");
|
|
158
|
+
|
|
159
|
+
export const app =
|
|
160
|
+
createApp({
|
|
161
|
+
name: "orders-api",
|
|
162
|
+
version: "1.0.0",
|
|
163
|
+
providers: [
|
|
164
|
+
provideValue(
|
|
165
|
+
configToken,
|
|
166
|
+
{
|
|
167
|
+
region: "ap-southeast-1",
|
|
168
|
+
}
|
|
169
|
+
),
|
|
170
|
+
],
|
|
171
|
+
async setup(context) {
|
|
172
|
+
const config =
|
|
173
|
+
await context.container.resolve(
|
|
174
|
+
configToken
|
|
175
|
+
);
|
|
176
|
+
},
|
|
177
|
+
});
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
The application exposes:
|
|
96
181
|
|
|
97
182
|
```text
|
|
98
|
-
|
|
183
|
+
app.config
|
|
184
|
+
app.container
|
|
185
|
+
app.services
|
|
186
|
+
app.hooks
|
|
187
|
+
app.plugins
|
|
188
|
+
app.deployment
|
|
99
189
|
```
|
|
100
190
|
|
|
101
|
-
|
|
191
|
+
`app.services` remains the Plugin Platform compatibility registry. New typed dependencies should prefer `app.container`.
|
|
102
192
|
|
|
103
|
-
|
|
193
|
+
Applications can register DI providers before start:
|
|
104
194
|
|
|
105
|
-
```
|
|
106
|
-
|
|
195
|
+
```ts
|
|
196
|
+
app.register(provider);
|
|
107
197
|
```
|
|
108
198
|
|
|
109
|
-
|
|
199
|
+
and create request/job/test scopes:
|
|
110
200
|
|
|
111
|
-
```
|
|
112
|
-
|
|
201
|
+
```ts
|
|
202
|
+
const scope =
|
|
203
|
+
app.createScope({
|
|
204
|
+
name: "request:123",
|
|
205
|
+
});
|
|
113
206
|
```
|
|
114
207
|
|
|
115
|
-
|
|
208
|
+
Infrastructure resources still use `app.addResource()`.
|
|
116
209
|
|
|
117
|
-
|
|
118
|
-
|
|
210
|
+
Application startup order:
|
|
211
|
+
|
|
212
|
+
```text
|
|
213
|
+
application.setup()
|
|
214
|
+
↓
|
|
215
|
+
bcp:container
|
|
216
|
+
↓
|
|
217
|
+
plugin setup/start
|
|
218
|
+
↓
|
|
219
|
+
resources start
|
|
220
|
+
↓
|
|
221
|
+
application.start()
|
|
222
|
+
↓
|
|
223
|
+
ready
|
|
119
224
|
```
|
|
120
225
|
|
|
121
|
-
|
|
226
|
+
Shutdown reverses resource dependencies, so injected services remain alive until application resources/plugins have stopped. The container is then disposed, followed by `application.dispose()`.
|
|
122
227
|
|
|
123
|
-
|
|
124
|
-
npm run release:readiness:report
|
|
125
|
-
```
|
|
228
|
+
Read more: [Application Platform](docs/application-platform.md) and [Migrating to 0.3.x](docs/migration-0.3.md).
|
|
126
229
|
|
|
127
|
-
|
|
230
|
+
## Public entrypoints — 0.3.1 baseline
|
|
128
231
|
|
|
129
232
|
```text
|
|
130
|
-
|
|
233
|
+
bcp
|
|
234
|
+
bcp/island
|
|
235
|
+
bcp/cache
|
|
236
|
+
bcp/config
|
|
237
|
+
bcp/validation
|
|
238
|
+
bcp/error
|
|
239
|
+
bcp/database
|
|
240
|
+
bcp/auth
|
|
241
|
+
bcp/jobs
|
|
242
|
+
bcp/workflow
|
|
243
|
+
bcp/events
|
|
244
|
+
bcp/realtime
|
|
245
|
+
bcp/testing
|
|
246
|
+
bcp/plugins
|
|
247
|
+
bcp/observability
|
|
248
|
+
bcp/deployment
|
|
249
|
+
bcp/container
|
|
250
|
+
bcp/application
|
|
251
|
+
bcp/server
|
|
252
|
+
bcp/server-only
|
|
253
|
+
bcp/middleware
|
|
131
254
|
```
|
|
132
255
|
|
|
133
|
-
|
|
256
|
+
Application code should use public entrypoints rather than private `packages/*` files.
|
|
134
257
|
|
|
135
|
-
## Core backend
|
|
258
|
+
## Core backend composition
|
|
136
259
|
|
|
137
260
|
```ts
|
|
261
|
+
import { createApp } from "bcp/application";
|
|
262
|
+
import { createServiceContainer } from "bcp/container";
|
|
138
263
|
import { createCacheStore } from "bcp/cache";
|
|
139
264
|
import { db } from "bcp/database";
|
|
140
265
|
import { createAuth } from "bcp/auth";
|
|
@@ -142,37 +267,12 @@ import { createJobQueue } from "bcp/jobs";
|
|
|
142
267
|
import { createWorkflow } from "bcp/workflow";
|
|
143
268
|
import { createTransactionalOutbox } from "bcp/events";
|
|
144
269
|
import { createRealtime } from "bcp/realtime";
|
|
145
|
-
import { createTestApp } from "bcp/testing";
|
|
146
270
|
import { createPluginHost } from "bcp/plugins";
|
|
147
271
|
import { createTracer } from "bcp/observability";
|
|
148
272
|
import { createDeploymentRuntime } from "bcp/deployment";
|
|
149
273
|
```
|
|
150
274
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
```ts
|
|
154
|
-
import {
|
|
155
|
-
createDeploymentRuntime,
|
|
156
|
-
} from "bcp/deployment";
|
|
157
|
-
|
|
158
|
-
const deployment =
|
|
159
|
-
createDeploymentRuntime({
|
|
160
|
-
serviceName: "orders-api",
|
|
161
|
-
});
|
|
162
|
-
|
|
163
|
-
deployment.addResource({
|
|
164
|
-
name: "database",
|
|
165
|
-
start: () => db.connect(),
|
|
166
|
-
ready: () => db.status === "ready",
|
|
167
|
-
stop: () => db.close(),
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
await deployment.start();
|
|
171
|
-
```
|
|
172
|
-
|
|
173
|
-
Startup follows registration order. Shutdown runs in reverse order. Repeated/concurrent start while active and repeated/concurrent shutdown are covered by the `0.2.19` stability suite.
|
|
174
|
-
|
|
175
|
-
Read more: [Deployment Platform v2](docs/deployment-platform-v2.md)
|
|
275
|
+
These systems remain independently usable. Application Platform coordinates selected instances and the DI container adds typed dependency composition.
|
|
176
276
|
|
|
177
277
|
## Compiled production entrypoints
|
|
178
278
|
|
|
@@ -191,11 +291,13 @@ bcp/testing -> testing.mjs
|
|
|
191
291
|
bcp/plugins -> plugins.mjs
|
|
192
292
|
bcp/observability -> observability.mjs
|
|
193
293
|
bcp/deployment -> deployment.mjs
|
|
294
|
+
bcp/container -> container.mjs
|
|
295
|
+
bcp/application -> application.mjs
|
|
194
296
|
bcp/server -> server.mjs
|
|
195
297
|
bcp/middleware -> middleware.mjs
|
|
196
298
|
```
|
|
197
299
|
|
|
198
|
-
The
|
|
300
|
+
The reviewed prepared export map is recorded in `docs/api-freeze-snapshot.json` and validated by `npm run api:check`.
|
|
199
301
|
|
|
200
302
|
## CLI
|
|
201
303
|
|
|
@@ -230,14 +332,21 @@ bcp generate middleware
|
|
|
230
332
|
bcp generate migration create_users
|
|
231
333
|
```
|
|
232
334
|
|
|
233
|
-
##
|
|
335
|
+
## API baseline and release readiness
|
|
336
|
+
|
|
337
|
+
`0.2.19` froze the `0.2.x` contract. `0.3.0` established the Application Platform baseline. `0.3.1` advances that baseline additively with `bcp/container` and no intentional breaking changes from `0.3.0`.
|
|
234
338
|
|
|
235
339
|
```bash
|
|
236
|
-
npm run
|
|
237
|
-
|
|
340
|
+
npm run api:check
|
|
341
|
+
npm run release:readiness
|
|
342
|
+
npm run release:readiness:report
|
|
238
343
|
```
|
|
239
344
|
|
|
240
|
-
|
|
345
|
+
Regenerate the snapshot only for an intentional reviewed baseline change:
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
npm run api:snapshot
|
|
349
|
+
```
|
|
241
350
|
|
|
242
351
|
## Machine-readable contracts
|
|
243
352
|
|
|
@@ -250,7 +359,7 @@ docs/api-freeze-snapshot.json
|
|
|
250
359
|
|
|
251
360
|
## Release validation
|
|
252
361
|
|
|
253
|
-
Before publishing `0.
|
|
362
|
+
Before publishing `0.3.1`:
|
|
254
363
|
|
|
255
364
|
```bash
|
|
256
365
|
npm run typecheck
|
|
@@ -263,9 +372,7 @@ npm run release:readiness
|
|
|
263
372
|
npm run rc:check
|
|
264
373
|
```
|
|
265
374
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
Do not tag or publish until the exact final release commit passes the complete RC sequence.
|
|
375
|
+
Do not tag or publish until the exact final release commit passes the full RC sequence.
|
|
269
376
|
|
|
270
377
|
## Release history
|
|
271
378
|
|
|
@@ -297,12 +404,14 @@ Do not tag or publish until the exact final release commit passes the complete R
|
|
|
297
404
|
| `0.2.17` | Observability Platform v3 |
|
|
298
405
|
| `0.2.18` | Deployment Platform v2 |
|
|
299
406
|
| `0.2.19` | Stability & API Freeze |
|
|
407
|
+
| `0.3.0` | BCP Application Platform |
|
|
408
|
+
| `0.3.1` | Dependency Injection & Service Container |
|
|
300
409
|
|
|
301
410
|
## Roadmap
|
|
302
411
|
|
|
303
|
-
|
|
412
|
+
The next milestone is **`0.3.2 — Module System v2`**, focused on application-native modules that can compose providers, plugins, routes, middleware, jobs and lifecycle contributions around the `createApp()` composition root.
|
|
304
413
|
|
|
305
|
-
|
|
414
|
+
Later `0.3.x` milestones expand routing/API contracts, repositories, validation/DTOs, SDK generation, identity/authorization, multi-tenancy, developer tooling and build/runtime targets.
|
|
306
415
|
|
|
307
416
|
Native desktop/mobile compilation remains later roadmap work.
|
|
308
417
|
|
package/docs/README.md
CHANGED
|
@@ -2,86 +2,110 @@
|
|
|
2
2
|
|
|
3
3
|
The `docs/` directory is the documentation source of truth for BCP Framework and is organized for **`bcp-docs-web`**.
|
|
4
4
|
|
|
5
|
-
> **Documentation target:** BCP Framework `0.
|
|
5
|
+
> **Documentation target:** BCP Framework `0.3.1 — Dependency Injection & Service Container`
|
|
6
6
|
>
|
|
7
|
-
> **Release state:** unreleased
|
|
7
|
+
> **Release state:** unreleased until the complete RC validation, tagging and npm publication finish.
|
|
8
8
|
|
|
9
9
|
## Documentation architecture
|
|
10
10
|
|
|
11
11
|
```text
|
|
12
12
|
docs/docs-web-manifest.json
|
|
13
|
-
-> website navigation,
|
|
13
|
+
-> website navigation, Markdown sources and release routes
|
|
14
14
|
|
|
15
15
|
docs/platform-manifest.json
|
|
16
16
|
-> framework version, runtime target, public entrypoints and capabilities
|
|
17
17
|
|
|
18
18
|
docs/api-manifest.json
|
|
19
|
-
-> public package
|
|
19
|
+
-> public package ownership and guide mapping
|
|
20
20
|
|
|
21
21
|
docs/api-freeze-snapshot.json
|
|
22
|
-
->
|
|
22
|
+
-> reviewed public/CLI/prepared-package API baseline
|
|
23
23
|
```
|
|
24
24
|
|
|
25
25
|
Framework source and tests remain authoritative for runtime behavior.
|
|
26
26
|
|
|
27
|
-
## Current
|
|
27
|
+
## Current milestones
|
|
28
28
|
|
|
29
29
|
| Version | Milestone |
|
|
30
30
|
| --- | --- |
|
|
31
|
-
| `0.2.0` | Framework Platform |
|
|
32
|
-
| `0.2.1` | Documentation Platform |
|
|
33
|
-
| `0.2.2` | Configuration & Environment v2 |
|
|
34
|
-
| `0.2.3` | Database Platform v2 |
|
|
35
|
-
| `0.2.4` | Application Packaging |
|
|
36
|
-
| `0.2.5` | Authentication Platform v2 |
|
|
37
|
-
| `0.2.6` | Authorization & Security v2 |
|
|
38
|
-
| `0.2.7` | Observability Platform v2 |
|
|
39
|
-
| `0.2.8` | Background Jobs Platform |
|
|
40
|
-
| `0.2.9` | Job Scheduling Platform |
|
|
41
|
-
| `0.2.10` | Durable Jobs Platform |
|
|
42
|
-
| `0.2.11` | Workflow Orchestration |
|
|
43
|
-
| `0.2.12` | Transactional Outbox & Events |
|
|
44
|
-
| `0.2.13` | Realtime Platform |
|
|
45
|
-
| `0.2.14` | Testing Platform |
|
|
46
31
|
| `0.2.15` | Plugin & Module Platform |
|
|
47
32
|
| `0.2.16` | Cache Platform v2 |
|
|
48
33
|
| `0.2.17` | Observability Platform v3 |
|
|
49
34
|
| `0.2.18` | Deployment Platform v2 |
|
|
50
35
|
| `0.2.19` | Stability & API Freeze |
|
|
36
|
+
| `0.3.0` | BCP Application Platform |
|
|
37
|
+
| `0.3.1` | Dependency Injection & Service Container |
|
|
51
38
|
|
|
52
|
-
## 0.
|
|
39
|
+
## 0.3.1 — Dependency Injection & Service Container
|
|
53
40
|
|
|
54
|
-
|
|
41
|
+
New public entrypoint:
|
|
55
42
|
|
|
56
|
-
|
|
43
|
+
```text
|
|
44
|
+
bcp/container
|
|
45
|
+
```
|
|
57
46
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
47
|
+
Primary APIs:
|
|
48
|
+
|
|
49
|
+
```text
|
|
50
|
+
createServiceToken
|
|
51
|
+
createServiceContainer
|
|
52
|
+
provideValue
|
|
53
|
+
provideFactory
|
|
54
|
+
provideClass
|
|
63
55
|
```
|
|
64
56
|
|
|
65
|
-
The
|
|
57
|
+
The container provides typed service tokens, singleton/scoped/transient lifetimes, child scopes, testing overrides, dependency graph diagnostics, circular-dependency detection and reverse-order disposal.
|
|
66
58
|
|
|
67
|
-
|
|
68
|
-
- CLI command names;
|
|
69
|
-
- prepared npm export targets;
|
|
70
|
-
- browser poison boundaries;
|
|
71
|
-
- API source/environment ownership;
|
|
72
|
-
- compatibility with `0.2.18`.
|
|
59
|
+
`bcp/application` now exposes:
|
|
73
60
|
|
|
74
|
-
|
|
61
|
+
```text
|
|
62
|
+
app.container
|
|
63
|
+
app.context.container
|
|
64
|
+
app.register(provider)
|
|
65
|
+
app.createScope(options)
|
|
66
|
+
```
|
|
75
67
|
|
|
76
|
-
New
|
|
68
|
+
The Plugin Platform `services` registry remains available for compatibility. New typed dependency injection should prefer `container`.
|
|
77
69
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
Application lifecycle order is now:
|
|
71
|
+
|
|
72
|
+
```text
|
|
73
|
+
application.setup
|
|
74
|
+
↓
|
|
75
|
+
bcp:container
|
|
76
|
+
↓
|
|
77
|
+
bcp:plugins
|
|
78
|
+
↓
|
|
79
|
+
resources
|
|
80
|
+
↓
|
|
81
|
+
bcp:application
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Shutdown reverses deployment resources so the DI container remains available until application resources and plugins have stopped.
|
|
85
|
+
|
|
86
|
+
Read [Dependency Injection & Service Container](service-container.md), [Application Platform](application-platform.md) and [Migrating to 0.3.x](migration-0.3.md).
|
|
87
|
+
|
|
88
|
+
## API baseline
|
|
89
|
+
|
|
90
|
+
`0.3.1` advances the reviewed `0.3.0` baseline additively by adding `bcp/container`.
|
|
91
|
+
|
|
92
|
+
```text
|
|
93
|
+
previous baseline: 0.3.0
|
|
94
|
+
intentional breaking changes: false
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
Validate:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
npm run api:check
|
|
101
|
+
npm run release:readiness
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
Regenerate `docs/api-freeze-snapshot.json` only for an intentional reviewed platform contract change:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
npm run api:snapshot
|
|
108
|
+
```
|
|
85
109
|
|
|
86
110
|
## Update rule
|
|
87
111
|
|
|
@@ -90,31 +114,27 @@ When framework behavior or public surface changes:
|
|
|
90
114
|
1. Update framework source.
|
|
91
115
|
2. Add/update regression tests.
|
|
92
116
|
3. Update the matching Markdown guide.
|
|
93
|
-
4. Update `platform-manifest.json
|
|
94
|
-
5. Update `api-manifest.json
|
|
95
|
-
6. Update `docs-web-manifest.json
|
|
96
|
-
7. Review
|
|
117
|
+
4. Update `platform-manifest.json`.
|
|
118
|
+
5. Update `api-manifest.json`.
|
|
119
|
+
6. Update `docs-web-manifest.json`.
|
|
120
|
+
7. Review/update the API baseline snapshot when public/package contracts change.
|
|
97
121
|
8. Update `docs/releases/<version>.md`.
|
|
98
|
-
9.
|
|
122
|
+
9. Keep the release state `unreleased` until release completion.
|
|
99
123
|
|
|
100
124
|
## Important docs-web routes
|
|
101
125
|
|
|
102
126
|
| Website route | Markdown source |
|
|
103
127
|
| --- | --- |
|
|
128
|
+
| `/docs/application-platform` | `application-platform.md` |
|
|
129
|
+
| `/docs/service-container` | `service-container.md` |
|
|
130
|
+
| `/docs/migration-0.3` | `migration-0.3.md` |
|
|
104
131
|
| `/docs/stability-api-freeze` | `stability-api-freeze.md` |
|
|
105
132
|
| `/docs/observability-v3` | `observability-v3.md` |
|
|
106
133
|
| `/docs/deployment-platform-v2` | `deployment-platform-v2.md` |
|
|
107
|
-
| `/docs/durable-jobs` | `durable-jobs.md` |
|
|
108
|
-
| `/docs/workflow-orchestration` | `workflow-orchestration.md` |
|
|
109
|
-
| `/docs/transactional-outbox-events` | `transactional-outbox-events.md` |
|
|
110
|
-
| `/docs/realtime-platform` | `realtime-platform.md` |
|
|
111
134
|
| `/docs/testing-platform` | `testing-platform.md` |
|
|
112
135
|
| `/docs/plugin-module-platform` | `plugin-module-platform.md` |
|
|
113
|
-
| `/docs/cache-platform-v2` | `cache-platform-v2.md` |
|
|
114
136
|
| `/docs/api-reference` | `api-reference.md` |
|
|
115
|
-
| `/releases/0.
|
|
116
|
-
|
|
117
|
-
Every route/source pair is validated by unit tests.
|
|
137
|
+
| `/releases/0.3.1` | `releases/0.3.1.md` |
|
|
118
138
|
|
|
119
139
|
## Public entrypoints
|
|
120
140
|
|
|
@@ -135,16 +155,18 @@ bcp/testing
|
|
|
135
155
|
bcp/plugins
|
|
136
156
|
bcp/observability
|
|
137
157
|
bcp/deployment
|
|
158
|
+
bcp/container
|
|
159
|
+
bcp/application
|
|
138
160
|
bcp/server
|
|
139
161
|
bcp/server-only
|
|
140
162
|
bcp/middleware
|
|
141
163
|
```
|
|
142
164
|
|
|
143
|
-
The API
|
|
165
|
+
The API manifest, platform manifest and API snapshot must remain aligned.
|
|
144
166
|
|
|
145
167
|
## Release validation
|
|
146
168
|
|
|
147
|
-
Before publishing `0.
|
|
169
|
+
Before publishing `0.3.1`:
|
|
148
170
|
|
|
149
171
|
```bash
|
|
150
172
|
npm run typecheck
|
|
@@ -157,6 +179,4 @@ npm run release:readiness
|
|
|
157
179
|
npm run rc:check
|
|
158
180
|
```
|
|
159
181
|
|
|
160
|
-
Stability validation covers public/CLI/export parity, prepared-package browser/runtime boundaries, release metadata and deployment lifecycle idempotency in addition to all existing subsystem suites.
|
|
161
|
-
|
|
162
182
|
The final release tag must point to the exact commit that passed the complete RC sequence.
|