@chidchanun/bcp 0.1.22 → 0.1.24
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 +241 -640
- package/docs/README.md +114 -337
- package/docs/auth-route-guards.md +14 -0
- package/docs/developer-tools.md +83 -12
- package/docs/development-logging.md +234 -6
- package/docs/file-upload.md +280 -0
- package/docs/releases/0.1.22.md +66 -1
- package/docs/releases/0.1.23.md +131 -0
- package/docs/releases/0.1.24.md +166 -0
- package/package.json +3 -2
- package/packages/bundler/src/server-production-actions.ts +15 -0
- package/packages/bundler/src/server-production-guards.ts +15 -0
- package/packages/cli/bin/bcp.mjs +111 -0
- package/packages/client/src/form.tsx +20 -13
- package/packages/client/src/server.ts +31 -0
- package/packages/server/src/dev-hmr.ts +131 -9
- package/packages/server/src/dev-route-graph.ts +91 -0
- package/packages/server/src/logger.ts +474 -0
- package/packages/server/src/middleware-dev-server.ts +217 -9
- package/packages/server/src/upload.ts +556 -0
package/docs/README.md
CHANGED
|
@@ -1,310 +1,161 @@
|
|
|
1
1
|
# BCP Framework Documentation Source
|
|
2
2
|
|
|
3
|
-
This directory is the documentation source of truth for the BCP Framework documentation website.
|
|
3
|
+
This directory is the documentation source of truth for the BCP Framework documentation website (`bcp-docs`).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
> Documentation target: BCP Framework `0.1.24`
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
## Purpose
|
|
10
|
-
|
|
11
|
-
The `bcp-docs` website should turn the Markdown files in this directory into a structured developer documentation experience without duplicating framework behavior in a separate source of truth.
|
|
12
|
-
|
|
13
|
-
When framework behavior changes:
|
|
14
|
-
|
|
15
|
-
1. update the framework source and tests,
|
|
16
|
-
2. update the relevant file in `docs/`,
|
|
17
|
-
3. update the release note in `docs/releases/`,
|
|
18
|
-
4. then publish or synchronize the content to `bcp-docs`.
|
|
19
|
-
|
|
20
|
-
The website should not invent API behavior that is not documented or tested in the framework repository.
|
|
7
|
+
When framework behavior changes, update framework source/tests first, then the matching file under `docs/`, then the release note under `docs/releases/`.
|
|
21
8
|
|
|
22
9
|
## Recommended website navigation
|
|
23
10
|
|
|
24
11
|
### Getting Started
|
|
25
12
|
|
|
26
|
-
|
|
|
13
|
+
| Route | Source | Purpose |
|
|
27
14
|
| --- | --- | --- |
|
|
28
15
|
| `/docs/getting-started` | `getting-started.md` | Create and run a BCP application |
|
|
29
16
|
| `/docs/configuration` | `configuration.md` | Framework configuration |
|
|
30
|
-
| `/docs/application-modules` | `application-modules.md` | Client/server
|
|
31
|
-
| `/docs/deployment` | `deployment.md` | Production
|
|
32
|
-
| `/docs/updating` | `updating.md` |
|
|
17
|
+
| `/docs/application-modules` | `application-modules.md` | Client/server boundaries |
|
|
18
|
+
| `/docs/deployment` | `deployment.md` | Production deployment |
|
|
19
|
+
| `/docs/updating` | `updating.md` | Framework upgrades |
|
|
33
20
|
|
|
34
21
|
### Routing and Data
|
|
35
22
|
|
|
36
|
-
|
|
|
23
|
+
| Route | Source | Purpose |
|
|
37
24
|
| --- | --- | --- |
|
|
38
25
|
| `/docs/routing` | `routing.md` | File-based routing |
|
|
39
26
|
| `/docs/server-data-loaders` | `server-data-loaders.md` | Server-side page data |
|
|
40
|
-
| `/docs/route-guards` | `route-guards.md` | Scoped
|
|
41
|
-
| `/docs/form-actions` | `form-actions.md` | Server mutations
|
|
42
|
-
| `/docs/server-request-apis` | `server-request-apis.md` | Request
|
|
43
|
-
| `/docs/validation` | `validation.md` | Typed
|
|
44
|
-
| `/docs/error-handling` | `error-handling.md` | Structured HTTP errors
|
|
27
|
+
| `/docs/route-guards` | `route-guards.md` | Scoped route authorization |
|
|
28
|
+
| `/docs/form-actions` | `form-actions.md` | Server mutations/forms |
|
|
29
|
+
| `/docs/server-request-apis` | `server-request-apis.md` | Request/cookie/response APIs |
|
|
30
|
+
| `/docs/validation` | `validation.md` | Typed validation |
|
|
31
|
+
| `/docs/error-handling` | `error-handling.md` | Structured HTTP errors |
|
|
32
|
+
| `/docs/file-upload` | `file-upload.md` | Multipart parsing, validation and local file storage |
|
|
45
33
|
|
|
46
34
|
### Authentication
|
|
47
35
|
|
|
48
|
-
|
|
|
36
|
+
| Route | Source | Purpose |
|
|
49
37
|
| --- | --- | --- |
|
|
50
|
-
| `/docs/authentication` | `authentication.md` | Authentication Core
|
|
51
|
-
| `/docs/auth-route-guards` | `auth-route-guards.md` |
|
|
52
|
-
| `/docs/session-auth` | `session-auth.md` |
|
|
38
|
+
| `/docs/authentication` | `authentication.md` | Authentication Core |
|
|
39
|
+
| `/docs/auth-route-guards` | `auth-route-guards.md` | Auth-aware guards |
|
|
40
|
+
| `/docs/session-auth` | `session-auth.md` | JWT cookie sessions |
|
|
53
41
|
|
|
54
42
|
### Database
|
|
55
43
|
|
|
56
|
-
|
|
|
44
|
+
| Route | Source | Purpose |
|
|
57
45
|
| --- | --- | --- |
|
|
58
|
-
| `/docs/database` | `database.md` |
|
|
59
|
-
| `/docs/database-migrations` | `database-migrations.md` | Migration CLI and
|
|
46
|
+
| `/docs/database` | `database.md` | MySQL database primitives |
|
|
47
|
+
| `/docs/database-migrations` | `database-migrations.md` | Migration CLI and files |
|
|
60
48
|
|
|
61
49
|
### Runtime and Infrastructure
|
|
62
50
|
|
|
63
|
-
|
|
|
51
|
+
| Route | Source | Purpose |
|
|
64
52
|
| --- | --- | --- |
|
|
65
|
-
| `/docs/middleware` | `middleware.md` | Middleware System v2
|
|
66
|
-
| `/docs/hydration` | `hydration.md` | SSR/client
|
|
67
|
-
| `/docs/developer-tools` | `developer-tools.md` | `
|
|
68
|
-
| `/docs/
|
|
69
|
-
| `/docs/
|
|
70
|
-
| `/docs/
|
|
71
|
-
|
|
72
|
-
### Releases
|
|
73
|
-
|
|
74
|
-
Use the files under `docs/releases/` for release pages.
|
|
75
|
-
|
|
76
|
-
Recommended route format:
|
|
77
|
-
|
|
78
|
-
```text
|
|
79
|
-
/releases/0.1.20
|
|
80
|
-
/releases/0.1.21
|
|
81
|
-
/releases/0.1.22
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
The newest release should also be available from `/releases`.
|
|
85
|
-
|
|
86
|
-
## Homepage content for bcp-docs
|
|
87
|
-
|
|
88
|
-
The documentation homepage should describe BCP as a React full-stack framework and highlight the currently implemented capabilities.
|
|
53
|
+
| `/docs/middleware` | `middleware.md` | Middleware System v2 |
|
|
54
|
+
| `/docs/hydration` | `hydration.md` | SSR/client hydration parity |
|
|
55
|
+
| `/docs/developer-tools` | `developer-tools.md` | `doctor` / `inspect` diagnostics |
|
|
56
|
+
| `/docs/development-logging` | `development-logging.md` | Structured logging and observability |
|
|
57
|
+
| `/docs/caching` | `caching.md` | Cache/revalidation |
|
|
58
|
+
| `/docs/security` | `security.md` | Security defaults and body limits |
|
|
89
59
|
|
|
90
|
-
|
|
60
|
+
## Current capability groups
|
|
91
61
|
|
|
92
62
|
### Application
|
|
93
63
|
|
|
94
|
-
-
|
|
95
|
-
-
|
|
64
|
+
- React SSR and hydration
|
|
65
|
+
- file-based page/API routing
|
|
66
|
+
- dynamic/catch-all routes
|
|
67
|
+
- layouts and metadata
|
|
96
68
|
- SPA navigation
|
|
97
|
-
-
|
|
98
|
-
-
|
|
99
|
-
-
|
|
100
|
-
- Client islands / partial hydration
|
|
101
|
-
- Deterministic development hydration across server/client transform pipelines
|
|
102
|
-
- LF/CRLF-safe development source handling
|
|
103
|
-
|
|
104
|
-
### Server data and mutations
|
|
105
|
-
|
|
106
|
-
- Server data loaders
|
|
107
|
-
- Route guards
|
|
108
|
-
- Form actions
|
|
109
|
-
- Request-scoped server APIs
|
|
110
|
-
- Cookies and redirects
|
|
111
|
-
- `bcp/validation`
|
|
112
|
-
- Typed form/API validation
|
|
113
|
-
- Field and form error output
|
|
114
|
-
- `bcp/error`
|
|
115
|
-
- Structured HTTP error responses
|
|
116
|
-
- Safe unknown-error fallback responses
|
|
69
|
+
- loaders, guards and form actions
|
|
70
|
+
- client islands / partial hydration
|
|
71
|
+
- Fast Refresh and deterministic development hydration
|
|
117
72
|
|
|
118
|
-
###
|
|
119
|
-
|
|
120
|
-
- `bcp/database`
|
|
121
|
-
- Lazy MySQL connection pool
|
|
122
|
-
- Queries and prepared execution
|
|
123
|
-
- Transactions
|
|
124
|
-
- Database migrations
|
|
125
|
-
- Migration status and rollback
|
|
126
|
-
|
|
127
|
-
### Authentication
|
|
73
|
+
### Server
|
|
128
74
|
|
|
129
|
-
-
|
|
130
|
-
-
|
|
131
|
-
-
|
|
132
|
-
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
-
|
|
75
|
+
- request-scoped server APIs
|
|
76
|
+
- cookies and redirects
|
|
77
|
+
- JWT sessions and authentication
|
|
78
|
+
- Middleware System v2
|
|
79
|
+
- typed validation and structured errors
|
|
80
|
+
- structured logging with request identity
|
|
81
|
+
- multipart file uploads and local filesystem persistence
|
|
136
82
|
|
|
137
|
-
###
|
|
83
|
+
### Database
|
|
138
84
|
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
142
|
-
-
|
|
143
|
-
- Shared request context state
|
|
144
|
-
- Matchers
|
|
145
|
-
- Rewrite and redirect
|
|
146
|
-
- Backward-compatible Middleware v1 handlers
|
|
85
|
+
- `bcp/database`
|
|
86
|
+
- MySQL pool/query helpers
|
|
87
|
+
- transactions
|
|
88
|
+
- migrations/status/rollback
|
|
147
89
|
|
|
148
|
-
###
|
|
90
|
+
### Developer Experience
|
|
149
91
|
|
|
150
92
|
- `create-bcp-app`
|
|
151
|
-
- Interactive project setup
|
|
152
|
-
- Tailwind preset
|
|
153
|
-
- Database/auth presets
|
|
154
93
|
- `bcp update`
|
|
155
|
-
- `bcp doctor`
|
|
156
|
-
- `bcp inspect`
|
|
157
|
-
-
|
|
158
|
-
-
|
|
159
|
-
-
|
|
160
|
-
- Critical CSS
|
|
161
|
-
- Cache/revalidation
|
|
162
|
-
- Security defaults
|
|
163
|
-
- Unit/integration/E2E/package smoke testing in the framework repository
|
|
164
|
-
|
|
165
|
-
## Suggested homepage hero
|
|
166
|
-
|
|
167
|
-
Suggested content, not a required exact copy:
|
|
168
|
-
|
|
169
|
-
```text
|
|
170
|
-
BCP Framework
|
|
171
|
-
A React full-stack framework for building server-rendered applications with routing,
|
|
172
|
-
data loading, server mutations, authentication, databases, validation, structured errors,
|
|
173
|
-
middleware and production tooling.
|
|
174
|
-
```
|
|
175
|
-
|
|
176
|
-
Primary actions:
|
|
177
|
-
|
|
178
|
-
```text
|
|
179
|
-
Get Started
|
|
180
|
-
Read the Docs
|
|
181
|
-
View on GitHub
|
|
182
|
-
```
|
|
183
|
-
|
|
184
|
-
The website may display the current release version from project metadata instead of hard-coding it in multiple UI files.
|
|
185
|
-
|
|
186
|
-
## Suggested documentation sidebar
|
|
187
|
-
|
|
188
|
-
```text
|
|
189
|
-
Getting Started
|
|
190
|
-
Introduction
|
|
191
|
-
Installation
|
|
192
|
-
Project Structure
|
|
193
|
-
Configuration
|
|
194
|
-
Updating
|
|
195
|
-
|
|
196
|
-
Core
|
|
197
|
-
Routing
|
|
198
|
-
Application Modules
|
|
199
|
-
Server Request APIs
|
|
200
|
-
Server Data Loaders
|
|
201
|
-
Route Guards
|
|
202
|
-
Form Actions
|
|
203
|
-
Validation
|
|
204
|
-
Error Handling
|
|
205
|
-
|
|
206
|
-
Authentication
|
|
207
|
-
Authentication Core
|
|
208
|
-
Auth Route Guards
|
|
209
|
-
JWT Sessions
|
|
210
|
-
|
|
211
|
-
Database
|
|
212
|
-
Database
|
|
213
|
-
Migrations
|
|
214
|
-
|
|
215
|
-
Runtime
|
|
216
|
-
Middleware
|
|
217
|
-
Hydration
|
|
218
|
-
Developer Tools
|
|
219
|
-
Caching
|
|
220
|
-
Security
|
|
221
|
-
|
|
222
|
-
Production
|
|
223
|
-
Deployment
|
|
224
|
-
Development Logging
|
|
225
|
-
|
|
226
|
-
Releases
|
|
227
|
-
0.1.22
|
|
228
|
-
0.1.21
|
|
229
|
-
0.1.20
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
## Suggested documentation page layout
|
|
233
|
-
|
|
234
|
-
Each documentation page should support:
|
|
235
|
-
|
|
236
|
-
- title
|
|
237
|
-
- short summary
|
|
238
|
-
- previous/next page navigation
|
|
239
|
-
- table of contents generated from headings
|
|
240
|
-
- syntax-highlighted code blocks
|
|
241
|
-
- copy-code button
|
|
242
|
-
- deep links to headings
|
|
243
|
-
- responsive sidebar
|
|
244
|
-
- mobile navigation
|
|
245
|
-
- light/dark appearance
|
|
246
|
-
- framework version label
|
|
247
|
-
- link to the corresponding source Markdown file in GitHub
|
|
248
|
-
|
|
249
|
-
Optional later additions:
|
|
94
|
+
- `bcp doctor`
|
|
95
|
+
- `bcp inspect`
|
|
96
|
+
- `bcp-framework` Windows-safe CLI alias
|
|
97
|
+
- standalone production build
|
|
98
|
+
- release/package smoke checks
|
|
250
99
|
|
|
251
|
-
|
|
252
|
-
- version selector
|
|
253
|
-
- API symbol index
|
|
254
|
-
- interactive examples
|
|
255
|
-
- edit-on-GitHub links
|
|
100
|
+
## BCP 0.1.24 documentation priorities
|
|
256
101
|
|
|
257
|
-
|
|
102
|
+
### File Upload
|
|
258
103
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
Preferred:
|
|
104
|
+
BCP 0.1.24 exposes upload helpers through the server-only `bcp/server` entrypoint:
|
|
262
105
|
|
|
263
106
|
```ts
|
|
264
107
|
import {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
108
|
+
parseMultipartFormData,
|
|
109
|
+
getUploadedFile,
|
|
110
|
+
requireUploadedFile,
|
|
111
|
+
validateUploadedFile,
|
|
112
|
+
saveUploadedFile,
|
|
113
|
+
sanitizeUploadFileName,
|
|
114
|
+
UploadError,
|
|
115
|
+
} from "bcp/server";
|
|
116
|
+
```
|
|
268
117
|
|
|
269
|
-
|
|
270
|
-
db,
|
|
271
|
-
} from "bcp/database";
|
|
118
|
+
Documentation must make the following boundaries clear:
|
|
272
119
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
120
|
+
- `server.bodyLimit` / `BCP_BODY_LIMIT` is the outer request-size limit enforced by the security gateway.
|
|
121
|
+
- multipart and individual file limits can be stricter than the global body limit.
|
|
122
|
+
- MIME type and extension are metadata checks, not file-signature verification.
|
|
123
|
+
- default storage names are UUID based.
|
|
124
|
+
- existing files are not overwritten unless explicitly requested.
|
|
125
|
+
- saved metadata includes SHA-256 checksum.
|
|
126
|
+
- local filesystem storage is the initial foundation; distributed/object storage requires a later adapter layer.
|
|
277
127
|
|
|
278
|
-
|
|
279
|
-
badRequest,
|
|
280
|
-
unauthorized,
|
|
281
|
-
} from "bcp/error";
|
|
128
|
+
See `file-upload.md`.
|
|
282
129
|
|
|
283
|
-
|
|
284
|
-
type MiddlewarePipelineHandler,
|
|
285
|
-
} from "bcp/middleware";
|
|
286
|
-
```
|
|
130
|
+
### Dev route/client bundle synchronization
|
|
287
131
|
|
|
288
|
-
|
|
132
|
+
0.1.24 also fixes a development-only graph drift that could produce:
|
|
289
133
|
|
|
290
134
|
```text
|
|
291
|
-
|
|
292
|
-
packages/client/src/...
|
|
135
|
+
Client bundle was not found for route "/docs/[...slug]".
|
|
293
136
|
```
|
|
294
137
|
|
|
295
|
-
|
|
138
|
+
The dev gateway now compares the actual page route topology and refreshes the internal client bundler when pathname/page/layout structure changes. Users should no longer need to manually delete `.bcp-framework` to recover a missing route bundle.
|
|
139
|
+
|
|
140
|
+
### Logging & Observability
|
|
141
|
+
|
|
142
|
+
0.1.23 introduced:
|
|
296
143
|
|
|
297
|
-
|
|
144
|
+
- `logger` / `createLogger()`
|
|
145
|
+
- request-scoped `requestLogger()`
|
|
146
|
+
- log levels and JSON format
|
|
147
|
+
- `X-Request-Id` helpers
|
|
148
|
+
- structured development request/SSR timing
|
|
298
149
|
|
|
299
|
-
|
|
150
|
+
See `development-logging.md`.
|
|
300
151
|
|
|
301
|
-
|
|
302
|
-
- documentation target version
|
|
303
|
-
- unreleased/main documentation if it is shown
|
|
152
|
+
### Developer Tools
|
|
304
153
|
|
|
305
|
-
|
|
154
|
+
0.1.22 introduced `bcp doctor` and `bcp inspect`, JSON reports, duplicate React diagnostics and duplicate BCP-install protection.
|
|
306
155
|
|
|
307
|
-
|
|
156
|
+
See `developer-tools.md`.
|
|
157
|
+
|
|
158
|
+
## Commands
|
|
308
159
|
|
|
309
160
|
```bash
|
|
310
161
|
bcp dev
|
|
@@ -324,107 +175,31 @@ bcp db status
|
|
|
324
175
|
bcp db rollback
|
|
325
176
|
```
|
|
326
177
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
```bash
|
|
330
|
-
npx create-bcp-app@latest my-app
|
|
331
|
-
```
|
|
332
|
-
|
|
333
|
-
## Middleware v2 documentation priority
|
|
178
|
+
On Windows systems where SQL Server owns `bcp.exe`, direct shell commands can use:
|
|
334
179
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
```text
|
|
340
|
-
v1 next() = return a pass-through instruction
|
|
341
|
-
v2 await next() = execute downstream middleware/application and receive Response
|
|
180
|
+
```powershell
|
|
181
|
+
bcp-framework doctor
|
|
182
|
+
bcp-framework inspect
|
|
183
|
+
bcp-framework dev
|
|
342
184
|
```
|
|
343
185
|
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
See `middleware.md` for the full API and examples.
|
|
347
|
-
|
|
348
|
-
## Validation documentation priority
|
|
349
|
-
|
|
350
|
-
BCP 0.1.19 introduced the public `bcp/validation` entrypoint. The docs website should show validation in both form-action and API-route examples.
|
|
351
|
-
|
|
352
|
-
Important concepts to surface:
|
|
353
|
-
|
|
354
|
-
- `v.object`, `v.string`, `v.number`, `v.boolean`, `v.array`
|
|
355
|
-
- FormData coercion with `validateFormData()`
|
|
356
|
-
- `success/data` versus `issues/fieldErrors/formErrors`
|
|
357
|
-
- object fields are stripped unless `allowUnknown: true`
|
|
358
|
-
- `refine()` for custom application rules
|
|
359
|
-
- no external validation dependency is required
|
|
186
|
+
## Releases
|
|
360
187
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
## Error Handling documentation priority
|
|
364
|
-
|
|
365
|
-
BCP 0.1.20 introduced the public `bcp/error` entrypoint and a standard HTTP error envelope.
|
|
366
|
-
|
|
367
|
-
The docs website should clearly distinguish:
|
|
188
|
+
Recommended release routes:
|
|
368
189
|
|
|
369
190
|
```text
|
|
370
|
-
|
|
371
|
-
|
|
191
|
+
/releases/0.1.24
|
|
192
|
+
/releases/0.1.23
|
|
193
|
+
/releases/0.1.22
|
|
194
|
+
/releases/0.1.21
|
|
195
|
+
/releases/0.1.20
|
|
372
196
|
```
|
|
373
197
|
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
- `HttpError` and `createHttpError()`
|
|
377
|
-
- `errorResponse()` for any 4xx/5xx status
|
|
378
|
-
- `toErrorResponse()` for safe catch boundaries
|
|
379
|
-
- `badRequest()`, `unauthorized()`, `forbidden()`, `conflict()` and other convenience helpers
|
|
380
|
-
- standard `{ error: { status, code, message, details? } }` payload
|
|
381
|
-
- error responses default to `Cache-Control: no-store`
|
|
382
|
-
- unknown exceptions become a generic 500 response without exposing the original exception message
|
|
383
|
-
- normal field validation still belongs to `bcp/validation`
|
|
384
|
-
|
|
385
|
-
See `error-handling.md` for the complete API and examples.
|
|
386
|
-
|
|
387
|
-
## Hydration documentation priority
|
|
388
|
-
|
|
389
|
-
BCP 0.1.20 added line-ending normalization for the development React Refresh path. That removed the Windows `CRLF` versus `LF` mismatch, but a second issue remained when Babel compiled multiline quoted JSX attributes and collapsed their whitespace differently from SSR.
|
|
390
|
-
|
|
391
|
-
BCP 0.1.21 completes this fix by keeping Babel responsible for TypeScript removal and React Refresh instrumentation while leaving JSX untransformed. esbuild then performs the development JSX transform with the development JSX runtime enabled.
|
|
198
|
+
Do not present unreleased `main` behavior as already available from npm. The website should distinguish the stable npm version from the documentation target when they differ.
|
|
392
199
|
|
|
393
|
-
|
|
200
|
+
## Release workflow
|
|
394
201
|
|
|
395
|
-
|
|
396
|
-
- multiline template-literal JSX expressions are supported,
|
|
397
|
-
- developers should not need to rewrite multiline `className` values as one-line strings to avoid framework hydration warnings,
|
|
398
|
-
- `CRLF` and standalone `CR` source line endings are normalized to `LF` before development instrumentation,
|
|
399
|
-
- React Refresh instrumentation must not change the semantic value of JSX attributes,
|
|
400
|
-
- the framework fix does not suppress genuine hydration mismatches caused by random values, locale differences, browser-only initial branches, changing external data or invalid HTML,
|
|
401
|
-
- `suppressHydrationWarning` is not a general-purpose solution.
|
|
402
|
-
|
|
403
|
-
See `hydration.md` for the full explanation, transform pipeline and troubleshooting steps.
|
|
404
|
-
|
|
405
|
-
## Developer Tools documentation priority
|
|
406
|
-
|
|
407
|
-
BCP 0.1.22 adds `bcp doctor` and `bcp inspect` as the first dedicated developer-diagnostics commands.
|
|
408
|
-
|
|
409
|
-
The docs website should surface:
|
|
410
|
-
|
|
411
|
-
- PASS/WARN/FAIL health checks,
|
|
412
|
-
- non-zero exit codes for blocking doctor failures,
|
|
413
|
-
- React / React DOM version and package-root parity,
|
|
414
|
-
- config and development environment inspection,
|
|
415
|
-
- page/API route summaries,
|
|
416
|
-
- `--json` output for CI and automation,
|
|
417
|
-
- the recommendation to verify local releases from packed `.tgz` artifacts rather than linked staging directories.
|
|
418
|
-
|
|
419
|
-
See `developer-tools.md` for the full command reference.
|
|
420
|
-
|
|
421
|
-
## Release roadmap
|
|
422
|
-
|
|
423
|
-
`0.1.22` is the Developer Tools milestone. The next planned milestone is `0.1.23` — Logging & Observability, followed by File Upload and the remaining pre-0.2 foundation milestones unless they are regrouped.
|
|
424
|
-
|
|
425
|
-
## Release workflow for documentation
|
|
426
|
-
|
|
427
|
-
Before publishing a new BCP release:
|
|
202
|
+
Before publishing a BCP release:
|
|
428
203
|
|
|
429
204
|
```bash
|
|
430
205
|
npm run typecheck
|
|
@@ -432,6 +207,8 @@ npm run test:unit
|
|
|
432
207
|
npm run rc:check
|
|
433
208
|
```
|
|
434
209
|
|
|
435
|
-
|
|
210
|
+
The framework repository remains authoritative for API behavior. `bcp-docs` is the presentation layer for this source content.
|
|
211
|
+
|
|
212
|
+
## Next milestone
|
|
436
213
|
|
|
437
|
-
|
|
214
|
+
After 0.1.24, the planned follow-up is `0.1.25` for upload/storage adapters and production file-delivery hardening unless roadmap priorities are regrouped.
|
|
@@ -211,6 +211,20 @@ export function guard() {
|
|
|
211
211
|
}
|
|
212
212
|
```
|
|
213
213
|
|
|
214
|
+
## Standalone production behavior
|
|
215
|
+
|
|
216
|
+
BCP 0.1.24 keeps `bcp/auth` inside the same production guard runtime graph as `runWithRequestContext()`. This guarantees that `requireAuth()`, `requireRole()`, `auth()`, `getSession()` and `cookies()` observe the active request after `bcp build`, rather than resolving through a second framework request-context instance.
|
|
217
|
+
|
|
218
|
+
This fixes the production-only failure:
|
|
219
|
+
|
|
220
|
+
```text
|
|
221
|
+
BCP Framework: server request APIs can only be used while handling a request.
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
No application guard changes are required. Continue importing authentication helpers from `bcp/auth` normally.
|
|
225
|
+
|
|
226
|
+
The production form-action bundle applies the same runtime unification because route guards may execute before an action.
|
|
227
|
+
|
|
214
228
|
## Security boundary
|
|
215
229
|
|
|
216
230
|
`bcp/auth` is server-only. BCP blocks it from page/client graphs and maps its browser export to the server-only runtime guard. Authentication and authorization checks should stay in guards, loaders, actions, API routes, or other server modules.
|