@chidchanun/bcp 0.2.16 → 0.2.18
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 +150 -408
- package/docs/README.md +36 -38
- package/docs/api-manifest.json +27 -19
- package/docs/api-reference.md +257 -305
- package/docs/deployment-platform-v2.md +449 -0
- package/docs/docs-web-manifest.json +7 -3
- package/docs/observability-v3.md +402 -0
- package/docs/platform-manifest.json +30 -4
- package/docs/releases/0.2.17.md +166 -0
- package/docs/releases/0.2.18.md +136 -0
- package/package.json +11 -6
- package/packages/bundler/src/client-boundary.ts +1 -0
- package/packages/client/src/auth.mjs +1391 -0
- package/packages/client/src/config.mjs +1132 -0
- package/packages/client/src/deployment.mjs +609 -0
- package/packages/client/src/deployment.ts +20 -0
- package/packages/client/src/observability.mjs +1251 -0
- package/packages/client/src/observability.ts +37 -0
- package/packages/client/src/server.mjs +5615 -0
- package/packages/server/src/deployment.ts +936 -0
- package/packages/server/src/middleware.mjs +631 -0
- package/packages/server/src/observability-v3.ts +878 -0
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
# BCP Framework 0.2.18 — Deployment Platform v2
|
|
2
|
+
|
|
3
|
+
Status: **unreleased**
|
|
4
|
+
|
|
5
|
+
`0.2.18` adds a framework-native deployment lifecycle and hardens prepared npm runtime entrypoints for standalone Node production use.
|
|
6
|
+
|
|
7
|
+
## Highlights
|
|
8
|
+
|
|
9
|
+
### New `bcp/deployment` entrypoint
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import {
|
|
13
|
+
createDeploymentRuntime,
|
|
14
|
+
} from "bcp/deployment";
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Deployment runtime provides:
|
|
18
|
+
|
|
19
|
+
- ordered resource startup;
|
|
20
|
+
- reverse-order graceful shutdown;
|
|
21
|
+
- startup rollback;
|
|
22
|
+
- readiness checks;
|
|
23
|
+
- deployment/process diagnostics;
|
|
24
|
+
- deployment/instance/release metadata;
|
|
25
|
+
- `SIGTERM` / `SIGINT` handling;
|
|
26
|
+
- integration with existing BCP shutdown hooks.
|
|
27
|
+
|
|
28
|
+
### Readiness endpoints
|
|
29
|
+
|
|
30
|
+
```ts
|
|
31
|
+
return createDeploymentReadinessResponse(
|
|
32
|
+
deployment
|
|
33
|
+
);
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Ready runtime returns `200`; non-ready/draining/failed runtime returns `503`.
|
|
37
|
+
|
|
38
|
+
### Diagnostics
|
|
39
|
+
|
|
40
|
+
```ts
|
|
41
|
+
return createDeploymentDiagnosticsResponse(
|
|
42
|
+
deployment
|
|
43
|
+
);
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Diagnostics include process/runtime identity, uptime and resource lifecycle state plus optional resource diagnostics.
|
|
47
|
+
|
|
48
|
+
### Runtime identity
|
|
49
|
+
|
|
50
|
+
Supported runtime environment values:
|
|
51
|
+
|
|
52
|
+
```text
|
|
53
|
+
BCP_DEPLOYMENT_ID
|
|
54
|
+
BCP_INSTANCE_ID
|
|
55
|
+
BCP_RELEASE
|
|
56
|
+
NODE_ENV
|
|
57
|
+
BCP_SHUTDOWN_TIMEOUT_MS
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Compiled production entrypoints
|
|
61
|
+
|
|
62
|
+
Prepared framework packages now use compiled ESM runtime files for additional server-side entrypoints:
|
|
63
|
+
|
|
64
|
+
```text
|
|
65
|
+
bcp/config -> config.mjs
|
|
66
|
+
bcp/auth -> auth.mjs
|
|
67
|
+
bcp/deployment -> deployment.mjs
|
|
68
|
+
bcp/server -> server.mjs
|
|
69
|
+
bcp/middleware -> middleware.mjs
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Existing compiled server runtimes such as cache/database/jobs/workflow/events/realtime/testing/plugins/observability remain compiled as before.
|
|
73
|
+
|
|
74
|
+
This closes a packaging gap where several server entrypoints still resolved directly to TypeScript in the published package.
|
|
75
|
+
|
|
76
|
+
## Public API additions
|
|
77
|
+
|
|
78
|
+
```text
|
|
79
|
+
createDeploymentRuntime
|
|
80
|
+
createDeploymentReadinessResponse
|
|
81
|
+
createDeploymentDiagnosticsResponse
|
|
82
|
+
|
|
83
|
+
DeploymentRuntime
|
|
84
|
+
DeploymentRuntimeOptions
|
|
85
|
+
DeploymentRuntimeState
|
|
86
|
+
DeploymentResource
|
|
87
|
+
DeploymentResourceContext
|
|
88
|
+
DeploymentResourceStatus
|
|
89
|
+
DeploymentReadinessResult
|
|
90
|
+
DeploymentReadinessReport
|
|
91
|
+
DeploymentDiagnosticsReport
|
|
92
|
+
DeploymentMetadata
|
|
93
|
+
DeploymentSignalOptions
|
|
94
|
+
DeploymentShutdownOptions
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Lifecycle model
|
|
98
|
+
|
|
99
|
+
```text
|
|
100
|
+
idle
|
|
101
|
+
↓
|
|
102
|
+
starting
|
|
103
|
+
↓
|
|
104
|
+
ready
|
|
105
|
+
↓
|
|
106
|
+
draining
|
|
107
|
+
↓
|
|
108
|
+
stopped
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Failures move the runtime to `failed`.
|
|
112
|
+
|
|
113
|
+
## Compatibility
|
|
114
|
+
|
|
115
|
+
There are no intentional breaking changes from `0.2.17`.
|
|
116
|
+
|
|
117
|
+
Existing production hardening APIs, shutdown hooks, `bcp build`, `bcp package` and application package manifests remain supported.
|
|
118
|
+
|
|
119
|
+
`bcp/deployment` is additive.
|
|
120
|
+
|
|
121
|
+
## Validation
|
|
122
|
+
|
|
123
|
+
Before tagging/publishing:
|
|
124
|
+
|
|
125
|
+
```bash
|
|
126
|
+
npm run typecheck
|
|
127
|
+
npm run test:unit
|
|
128
|
+
npm run test:integration
|
|
129
|
+
npm run test:e2e
|
|
130
|
+
npm run test:package
|
|
131
|
+
npm run rc:check
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
The `0.2.18` package smoke validates the compiled deployment runtime plus compiled config/auth/server/middleware entrypoints from the prepared `.package/bcp` staging directory.
|
|
135
|
+
|
|
136
|
+
Do not tag/publish until the final commit passes the complete RC sequence.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chidchanun/bcp",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.18",
|
|
4
4
|
"description": "BCP Framework - a React full-stack framework with file-based routing, SSR, APIs, middleware, islands, caching and standalone production builds.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"./config": {
|
|
44
44
|
"types": "./packages/client/src/config.ts",
|
|
45
|
-
"default": "./packages/client/src/config.
|
|
45
|
+
"default": "./packages/client/src/config.mjs"
|
|
46
46
|
},
|
|
47
47
|
"./validation": {
|
|
48
48
|
"types": "./packages/client/src/validation.ts",
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
"./auth": {
|
|
61
61
|
"types": "./packages/client/src/auth.ts",
|
|
62
62
|
"browser": "./packages/client/src/server-only.browser.mjs",
|
|
63
|
-
"default": "./packages/client/src/auth.
|
|
63
|
+
"default": "./packages/client/src/auth.mjs"
|
|
64
64
|
},
|
|
65
65
|
"./jobs": {
|
|
66
66
|
"types": "./packages/client/src/jobs.ts",
|
|
@@ -95,12 +95,17 @@
|
|
|
95
95
|
"./observability": {
|
|
96
96
|
"types": "./packages/client/src/observability.ts",
|
|
97
97
|
"browser": "./packages/client/src/server-only.browser.mjs",
|
|
98
|
-
"default": "./packages/client/src/observability.
|
|
98
|
+
"default": "./packages/client/src/observability.mjs"
|
|
99
|
+
},
|
|
100
|
+
"./deployment": {
|
|
101
|
+
"types": "./packages/client/src/deployment.ts",
|
|
102
|
+
"browser": "./packages/client/src/server-only.browser.mjs",
|
|
103
|
+
"default": "./packages/client/src/deployment.mjs"
|
|
99
104
|
},
|
|
100
105
|
"./server": {
|
|
101
106
|
"types": "./packages/client/src/server.ts",
|
|
102
107
|
"browser": "./packages/client/src/server-only.browser.mjs",
|
|
103
|
-
"default": "./packages/client/src/server.
|
|
108
|
+
"default": "./packages/client/src/server.mjs"
|
|
104
109
|
},
|
|
105
110
|
"./server-only": {
|
|
106
111
|
"types": "./packages/client/src/server-only.d.ts",
|
|
@@ -109,7 +114,7 @@
|
|
|
109
114
|
},
|
|
110
115
|
"./middleware": {
|
|
111
116
|
"types": "./packages/server/src/middleware.ts",
|
|
112
|
-
"default": "./packages/server/src/middleware.
|
|
117
|
+
"default": "./packages/server/src/middleware.mjs"
|
|
113
118
|
},
|
|
114
119
|
"./package.json": "./package.json"
|
|
115
120
|
},
|