@chidchanun/bcp 0.1.23 → 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 +113 -368
- package/docs/auth-route-guards.md +14 -0
- package/docs/developer-tools.md +45 -22
- package/docs/file-upload.md +280 -0
- package/docs/releases/0.1.24.md +166 -0
- package/package.json +1 -1
- package/packages/bundler/src/server-production-actions.ts +15 -0
- package/packages/bundler/src/server-production-guards.ts +15 -0
- package/packages/client/src/server.ts +16 -0
- package/packages/server/src/dev-route-graph.ts +91 -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,321 +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/development-logging` | `development-logging.md` | Structured logging
|
|
69
|
-
| `/docs/caching` | `caching.md` | Cache
|
|
70
|
-
| `/docs/security` | `security.md` |
|
|
71
|
-
|
|
72
|
-
### Releases
|
|
73
|
-
|
|
74
|
-
Use the files under `docs/releases/` for release pages.
|
|
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 |
|
|
75
59
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
```text
|
|
79
|
-
/releases/0.1.21
|
|
80
|
-
/releases/0.1.22
|
|
81
|
-
/releases/0.1.23
|
|
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.
|
|
89
|
-
|
|
90
|
-
Recommended feature groups:
|
|
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
|
|
117
|
-
|
|
118
|
-
### Database
|
|
69
|
+
- loaders, guards and form actions
|
|
70
|
+
- client islands / partial hydration
|
|
71
|
+
- Fast Refresh and deterministic development hydration
|
|
119
72
|
|
|
120
|
-
|
|
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
|
-
- JSON developer-tool output for CI/automation
|
|
158
|
-
- Duplicate React and duplicate BCP installation diagnostics
|
|
94
|
+
- `bcp doctor`
|
|
95
|
+
- `bcp inspect`
|
|
159
96
|
- `bcp-framework` Windows-safe CLI alias
|
|
160
|
-
-
|
|
161
|
-
-
|
|
162
|
-
- Pretty and JSON log formats
|
|
163
|
-
- Configurable log levels
|
|
164
|
-
- Structured development HTTP/SSR timing events
|
|
165
|
-
- Standalone production builds
|
|
166
|
-
- Critical CSS
|
|
167
|
-
- Cache/revalidation
|
|
168
|
-
- Security defaults
|
|
169
|
-
- Unit/integration/E2E/package smoke testing in the framework repository
|
|
170
|
-
|
|
171
|
-
## Suggested homepage hero
|
|
172
|
-
|
|
173
|
-
Suggested content, not a required exact copy:
|
|
174
|
-
|
|
175
|
-
```text
|
|
176
|
-
BCP Framework
|
|
177
|
-
A React full-stack framework for building server-rendered applications with routing,
|
|
178
|
-
data loading, server mutations, authentication, databases, validation, structured errors,
|
|
179
|
-
middleware, observability and production tooling.
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
Primary actions:
|
|
183
|
-
|
|
184
|
-
```text
|
|
185
|
-
Get Started
|
|
186
|
-
Read the Docs
|
|
187
|
-
View on GitHub
|
|
188
|
-
```
|
|
189
|
-
|
|
190
|
-
The website may display the current release version from project metadata instead of hard-coding it in multiple UI files.
|
|
191
|
-
|
|
192
|
-
## Suggested documentation sidebar
|
|
97
|
+
- standalone production build
|
|
98
|
+
- release/package smoke checks
|
|
193
99
|
|
|
194
|
-
|
|
195
|
-
Getting Started
|
|
196
|
-
Introduction
|
|
197
|
-
Installation
|
|
198
|
-
Project Structure
|
|
199
|
-
Configuration
|
|
200
|
-
Updating
|
|
201
|
-
|
|
202
|
-
Core
|
|
203
|
-
Routing
|
|
204
|
-
Application Modules
|
|
205
|
-
Server Request APIs
|
|
206
|
-
Server Data Loaders
|
|
207
|
-
Route Guards
|
|
208
|
-
Form Actions
|
|
209
|
-
Validation
|
|
210
|
-
Error Handling
|
|
211
|
-
|
|
212
|
-
Authentication
|
|
213
|
-
Authentication Core
|
|
214
|
-
Auth Route Guards
|
|
215
|
-
JWT Sessions
|
|
216
|
-
|
|
217
|
-
Database
|
|
218
|
-
Database
|
|
219
|
-
Migrations
|
|
220
|
-
|
|
221
|
-
Runtime
|
|
222
|
-
Middleware
|
|
223
|
-
Hydration
|
|
224
|
-
Developer Tools
|
|
225
|
-
Logging & Observability
|
|
226
|
-
Caching
|
|
227
|
-
Security
|
|
228
|
-
|
|
229
|
-
Production
|
|
230
|
-
Deployment
|
|
231
|
-
|
|
232
|
-
Releases
|
|
233
|
-
0.1.23
|
|
234
|
-
0.1.22
|
|
235
|
-
0.1.21
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
## Suggested documentation page layout
|
|
239
|
-
|
|
240
|
-
Each documentation page should support:
|
|
241
|
-
|
|
242
|
-
- title
|
|
243
|
-
- short summary
|
|
244
|
-
- previous/next page navigation
|
|
245
|
-
- table of contents generated from headings
|
|
246
|
-
- syntax-highlighted code blocks
|
|
247
|
-
- copy-code button
|
|
248
|
-
- deep links to headings
|
|
249
|
-
- responsive sidebar
|
|
250
|
-
- mobile navigation
|
|
251
|
-
- light/dark appearance
|
|
252
|
-
- framework version label
|
|
253
|
-
- link to the corresponding source Markdown file in GitHub
|
|
254
|
-
|
|
255
|
-
Optional later additions:
|
|
100
|
+
## BCP 0.1.24 documentation priorities
|
|
256
101
|
|
|
257
|
-
|
|
258
|
-
- version selector
|
|
259
|
-
- API symbol index
|
|
260
|
-
- interactive examples
|
|
261
|
-
- edit-on-GitHub links
|
|
102
|
+
### File Upload
|
|
262
103
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
Examples should use the public package entrypoints that application developers actually install.
|
|
266
|
-
|
|
267
|
-
Preferred:
|
|
104
|
+
BCP 0.1.24 exposes upload helpers through the server-only `bcp/server` entrypoint:
|
|
268
105
|
|
|
269
106
|
```ts
|
|
270
107
|
import {
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
108
|
+
parseMultipartFormData,
|
|
109
|
+
getUploadedFile,
|
|
110
|
+
requireUploadedFile,
|
|
111
|
+
validateUploadedFile,
|
|
112
|
+
saveUploadedFile,
|
|
113
|
+
sanitizeUploadFileName,
|
|
114
|
+
UploadError,
|
|
115
|
+
} from "bcp/server";
|
|
116
|
+
```
|
|
278
117
|
|
|
279
|
-
|
|
280
|
-
v,
|
|
281
|
-
validateFormData,
|
|
282
|
-
} from "bcp/validation";
|
|
118
|
+
Documentation must make the following boundaries clear:
|
|
283
119
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
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.
|
|
288
127
|
|
|
289
|
-
|
|
290
|
-
logger,
|
|
291
|
-
requestLogger,
|
|
292
|
-
} from "bcp/server";
|
|
128
|
+
See `file-upload.md`.
|
|
293
129
|
|
|
294
|
-
|
|
295
|
-
type MiddlewarePipelineHandler,
|
|
296
|
-
} from "bcp/middleware";
|
|
297
|
-
```
|
|
130
|
+
### Dev route/client bundle synchronization
|
|
298
131
|
|
|
299
|
-
|
|
132
|
+
0.1.24 also fixes a development-only graph drift that could produce:
|
|
300
133
|
|
|
301
134
|
```text
|
|
302
|
-
|
|
303
|
-
packages/client/src/...
|
|
135
|
+
Client bundle was not found for route "/docs/[...slug]".
|
|
304
136
|
```
|
|
305
137
|
|
|
306
|
-
|
|
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
|
|
307
141
|
|
|
308
|
-
|
|
142
|
+
0.1.23 introduced:
|
|
309
143
|
|
|
310
|
-
|
|
144
|
+
- `logger` / `createLogger()`
|
|
145
|
+
- request-scoped `requestLogger()`
|
|
146
|
+
- log levels and JSON format
|
|
147
|
+
- `X-Request-Id` helpers
|
|
148
|
+
- structured development request/SSR timing
|
|
311
149
|
|
|
312
|
-
-
|
|
313
|
-
- documentation target version
|
|
314
|
-
- unreleased/main documentation if it is shown
|
|
150
|
+
See `development-logging.md`.
|
|
315
151
|
|
|
316
|
-
|
|
152
|
+
### Developer Tools
|
|
317
153
|
|
|
318
|
-
|
|
154
|
+
0.1.22 introduced `bcp doctor` and `bcp inspect`, JSON reports, duplicate React diagnostics and duplicate BCP-install protection.
|
|
155
|
+
|
|
156
|
+
See `developer-tools.md`.
|
|
157
|
+
|
|
158
|
+
## Commands
|
|
319
159
|
|
|
320
160
|
```bash
|
|
321
161
|
bcp dev
|
|
@@ -335,128 +175,31 @@ bcp db status
|
|
|
335
175
|
bcp db rollback
|
|
336
176
|
```
|
|
337
177
|
|
|
338
|
-
On Windows systems where
|
|
339
|
-
|
|
340
|
-
Project creation:
|
|
178
|
+
On Windows systems where SQL Server owns `bcp.exe`, direct shell commands can use:
|
|
341
179
|
|
|
342
|
-
```
|
|
343
|
-
|
|
180
|
+
```powershell
|
|
181
|
+
bcp-framework doctor
|
|
182
|
+
bcp-framework inspect
|
|
183
|
+
bcp-framework dev
|
|
344
184
|
```
|
|
345
185
|
|
|
346
|
-
##
|
|
347
|
-
|
|
348
|
-
BCP 0.1.18 introduced a meaningful middleware architecture change, so the `bcp-docs` website should make the distinction between v1 and v2 clear.
|
|
349
|
-
|
|
350
|
-
The middleware page should prominently explain:
|
|
351
|
-
|
|
352
|
-
```text
|
|
353
|
-
v1 next() = return a pass-through instruction
|
|
354
|
-
v2 await next() = execute downstream middleware/application and receive Response
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
Existing v1 code remains supported, so migration documentation should describe v2 as an additive upgrade rather than a mandatory rewrite.
|
|
358
|
-
|
|
359
|
-
See `middleware.md` for the full API and examples.
|
|
360
|
-
|
|
361
|
-
## Validation documentation priority
|
|
362
|
-
|
|
363
|
-
BCP 0.1.19 introduced the public `bcp/validation` entrypoint. The docs website should show validation in both form-action and API-route examples.
|
|
364
|
-
|
|
365
|
-
Important concepts to surface:
|
|
366
|
-
|
|
367
|
-
- `v.object`, `v.string`, `v.number`, `v.boolean`, `v.array`
|
|
368
|
-
- FormData coercion with `validateFormData()`
|
|
369
|
-
- `success/data` versus `issues/fieldErrors/formErrors`
|
|
370
|
-
- object fields are stripped unless `allowUnknown: true`
|
|
371
|
-
- `refine()` for custom application rules
|
|
372
|
-
- no external validation dependency is required
|
|
373
|
-
|
|
374
|
-
See `validation.md` for the complete API and examples.
|
|
375
|
-
|
|
376
|
-
## Error Handling documentation priority
|
|
377
|
-
|
|
378
|
-
BCP 0.1.20 introduced the public `bcp/error` entrypoint and a standard HTTP error envelope.
|
|
186
|
+
## Releases
|
|
379
187
|
|
|
380
|
-
|
|
188
|
+
Recommended release routes:
|
|
381
189
|
|
|
382
190
|
```text
|
|
383
|
-
|
|
384
|
-
|
|
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
|
|
385
196
|
```
|
|
386
197
|
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
- `HttpError` and `createHttpError()`
|
|
390
|
-
- `errorResponse()` for any 4xx/5xx status
|
|
391
|
-
- `toErrorResponse()` for safe catch boundaries
|
|
392
|
-
- `badRequest()`, `unauthorized()`, `forbidden()`, `conflict()` and other convenience helpers
|
|
393
|
-
- standard `{ error: { status, code, message, details? } }` payload
|
|
394
|
-
- error responses default to `Cache-Control: no-store`
|
|
395
|
-
- unknown exceptions become a generic 500 response without exposing the original exception message
|
|
396
|
-
- normal field validation still belongs to `bcp/validation`
|
|
397
|
-
|
|
398
|
-
See `error-handling.md` for the complete API and examples.
|
|
399
|
-
|
|
400
|
-
## Hydration documentation priority
|
|
401
|
-
|
|
402
|
-
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.
|
|
403
|
-
|
|
404
|
-
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.
|
|
405
|
-
|
|
406
|
-
The docs website should make these points clear:
|
|
407
|
-
|
|
408
|
-
- multiline quoted JSX attributes are supported,
|
|
409
|
-
- multiline template-literal JSX expressions are supported,
|
|
410
|
-
- developers should not need to rewrite multiline `className` values as one-line strings to avoid framework hydration warnings,
|
|
411
|
-
- `CRLF` and standalone `CR` source line endings are normalized to `LF` before development instrumentation,
|
|
412
|
-
- React Refresh instrumentation must not change the semantic value of JSX attributes,
|
|
413
|
-
- 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,
|
|
414
|
-
- `suppressHydrationWarning` is not a general-purpose solution.
|
|
415
|
-
|
|
416
|
-
See `hydration.md` for the full explanation, transform pipeline and troubleshooting steps.
|
|
417
|
-
|
|
418
|
-
## Developer Tools documentation priority
|
|
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.
|
|
419
199
|
|
|
420
|
-
|
|
200
|
+
## Release workflow
|
|
421
201
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
- PASS/WARN/FAIL health checks,
|
|
425
|
-
- non-zero exit codes for blocking doctor failures,
|
|
426
|
-
- React / React DOM version and package-root parity,
|
|
427
|
-
- duplicate `bcp` / `@chidchanun/bcp` installation detection,
|
|
428
|
-
- config and development environment inspection,
|
|
429
|
-
- page/API route summaries,
|
|
430
|
-
- `--json` output for CI and automation,
|
|
431
|
-
- the recommendation to verify local releases from packed `.tgz` artifacts installed under the existing `bcp` dependency key rather than linked staging directories.
|
|
432
|
-
|
|
433
|
-
See `developer-tools.md` for the full command reference.
|
|
434
|
-
|
|
435
|
-
## Logging and observability documentation priority
|
|
436
|
-
|
|
437
|
-
BCP 0.1.23 adds the structured logging foundation through `bcp/server`.
|
|
438
|
-
|
|
439
|
-
The docs website should surface:
|
|
440
|
-
|
|
441
|
-
- `logger.debug/info/warn/error`,
|
|
442
|
-
- `createLogger()` and child loggers,
|
|
443
|
-
- `requestLogger()` and its request ID/method/path bindings,
|
|
444
|
-
- `attachRequestId()` for `X-Request-Id` response propagation,
|
|
445
|
-
- `BCP_LOG_LEVEL`,
|
|
446
|
-
- `BCP_LOG_FORMAT=pretty|json`,
|
|
447
|
-
- JSON-safe `Error`, `bigint` and circular value handling,
|
|
448
|
-
- structured `http.request`, `module.import` and `ssr.render` development events,
|
|
449
|
-
- the existing dev noise filter for framework-internal requests.
|
|
450
|
-
|
|
451
|
-
See `development-logging.md` for the complete API and examples.
|
|
452
|
-
|
|
453
|
-
## Release roadmap
|
|
454
|
-
|
|
455
|
-
`0.1.23` is the Logging & Observability milestone. The next planned milestone is `0.1.24` — File Upload foundation, followed by Background Jobs, Testing Utilities, Production Build Hardening and Plugin Architecture unless milestones are regrouped.
|
|
456
|
-
|
|
457
|
-
## Release workflow for documentation
|
|
458
|
-
|
|
459
|
-
Before publishing a new BCP release:
|
|
202
|
+
Before publishing a BCP release:
|
|
460
203
|
|
|
461
204
|
```bash
|
|
462
205
|
npm run typecheck
|
|
@@ -464,6 +207,8 @@ npm run test:unit
|
|
|
464
207
|
npm run rc:check
|
|
465
208
|
```
|
|
466
209
|
|
|
467
|
-
|
|
210
|
+
The framework repository remains authoritative for API behavior. `bcp-docs` is the presentation layer for this source content.
|
|
211
|
+
|
|
212
|
+
## Next milestone
|
|
468
213
|
|
|
469
|
-
|
|
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.
|