@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.
@@ -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.16",
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.ts"
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.ts"
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.ts"
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.ts"
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.ts"
117
+ "default": "./packages/server/src/middleware.mjs"
113
118
  },
114
119
  "./package.json": "./package.json"
115
120
  },
@@ -35,6 +35,7 @@ const SERVER_ONLY_IMPORTS =
35
35
  "bcp/testing",
36
36
  "bcp/plugins",
37
37
  "bcp/observability",
38
+ "bcp/deployment",
38
39
  ]);
39
40
 
40
41
  export function validateClientBoundaries(