@chidchanun/bcp 0.1.23 → 0.1.25

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/docs/README.md CHANGED
@@ -1,321 +1,292 @@
1
1
  # BCP Framework Documentation Source
2
2
 
3
- This directory is the documentation source of truth for the BCP Framework documentation website.
3
+ The `docs/` directory is the documentation source of truth for BCP Framework and is intentionally organized so it can be consumed later by the **`bcp-docs-web`** documentation website.
4
4
 
5
- The recommended documentation website project name is `bcp-docs`.
5
+ > **Documentation target:** BCP Framework `0.1.25`
6
+ >
7
+ > The documentation target can be newer than the version currently published to npm. Unreleased behavior must be labeled as a development target until release validation and publication are complete.
6
8
 
7
- > Documentation target: BCP Framework `0.1.23`
9
+ ## Documentation goals
8
10
 
9
- ## Purpose
11
+ The documentation source should make it possible to build `bcp-docs-web` without duplicating framework knowledge into a second repository.
10
12
 
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.
13
+ The expected relationship is:
14
+
15
+ ```text
16
+ BCP Framework source/tests
17
+
18
+ docs/
19
+
20
+ bcp-docs-web
21
+ ```
22
+
23
+ Framework source and tests remain authoritative for behavior. Markdown under `docs/` is the authored documentation layer. The future website should primarily render, organize and search this source instead of becoming a separate source of truth.
24
+
25
+ ## Content update rule
12
26
 
13
27
  When framework behavior changes:
14
28
 
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`.
29
+ 1. Update framework source.
30
+ 2. Add or update regression tests.
31
+ 3. Update the matching documentation file under `docs/`.
32
+ 4. Update the release note under `docs/releases/` when the change belongs to a release milestone.
33
+ 5. Only present the feature as published after release validation and npm publication complete.
19
34
 
20
- The website should not invent API behavior that is not documented or tested in the framework repository.
35
+ ## Recommended `bcp-docs-web` navigation
21
36
 
22
- ## Recommended website navigation
37
+ The website should use these top-level groups:
38
+
39
+ ```text
40
+ Getting Started
41
+ Routing & Data
42
+ Authentication
43
+ Database
44
+ Runtime & Infrastructure
45
+ API Reference
46
+ Releases
47
+ ```
23
48
 
24
49
  ### Getting Started
25
50
 
26
- | Website route | Source file | Description |
51
+ | Website route | Markdown source | Purpose |
27
52
  | --- | --- | --- |
28
53
  | `/docs/getting-started` | `getting-started.md` | Create and run a BCP application |
29
- | `/docs/configuration` | `configuration.md` | Framework configuration |
30
- | `/docs/application-modules` | `application-modules.md` | Client/server module boundaries |
31
- | `/docs/deployment` | `deployment.md` | Production and deployment guidance |
32
- | `/docs/updating` | `updating.md` | Upgrade an existing BCP project |
54
+ | `/docs/configuration` | `configuration.md` | Framework configuration and environment behavior |
55
+ | `/docs/application-modules` | `application-modules.md` | Client/server boundaries and module rules |
56
+ | `/docs/deployment` | `deployment.md` | Standalone production deployment |
57
+ | `/docs/updating` | `updating.md` | Framework upgrade workflow |
33
58
 
34
- ### Routing and Data
59
+ ### Routing & Data
35
60
 
36
- | Website route | Source file | Description |
61
+ | Website route | Markdown source | Purpose |
37
62
  | --- | --- | --- |
38
- | `/docs/routing` | `routing.md` | File-based routing |
63
+ | `/docs/routing` | `routing.md` | File-based page/API routing |
39
64
  | `/docs/server-data-loaders` | `server-data-loaders.md` | Server-side page data |
40
- | `/docs/route-guards` | `route-guards.md` | Scoped page authorization |
65
+ | `/docs/route-guards` | `route-guards.md` | Scoped route authorization |
41
66
  | `/docs/form-actions` | `form-actions.md` | Server mutations and forms |
42
- | `/docs/server-request-apis` | `server-request-apis.md` | Request, cookie, redirect and response APIs |
43
- | `/docs/validation` | `validation.md` | Typed form/API validation and field errors |
44
- | `/docs/error-handling` | `error-handling.md` | Structured HTTP errors and standard error responses |
67
+ | `/docs/server-request-apis` | `server-request-apis.md` | Request/cookie/response APIs |
68
+ | `/docs/validation` | `validation.md` | Typed validation |
69
+ | `/docs/error-handling` | `error-handling.md` | Structured HTTP errors |
70
+ | `/docs/file-upload` | `file-upload.md` | Multipart parsing and upload validation |
71
+ | `/docs/storage` | `storage.md` | Storage adapters and production file delivery |
45
72
 
46
73
  ### Authentication
47
74
 
48
- | Website route | Source file | Description |
75
+ | Website route | Markdown source | Purpose |
49
76
  | --- | --- | --- |
50
- | `/docs/authentication` | `authentication.md` | Authentication Core and `bcp/auth` |
51
- | `/docs/auth-route-guards` | `auth-route-guards.md` | `requireAuth`, `requireRole` and guard integration |
52
- | `/docs/session-auth` | `session-auth.md` | Low-level JWT cookie sessions |
77
+ | `/docs/authentication` | `authentication.md` | Authentication Core |
78
+ | `/docs/auth-route-guards` | `auth-route-guards.md` | Auth-aware route guards |
79
+ | `/docs/session-auth` | `session-auth.md` | JWT cookie sessions |
53
80
 
54
81
  ### Database
55
82
 
56
- | Website route | Source file | Description |
83
+ | Website route | Markdown source | Purpose |
57
84
  | --- | --- | --- |
58
- | `/docs/database` | `database.md` | `bcp/database`, MySQL and transactions |
85
+ | `/docs/database` | `database.md` | MySQL database primitives |
59
86
  | `/docs/database-migrations` | `database-migrations.md` | Migration CLI and migration files |
60
87
 
61
- ### Runtime and Infrastructure
88
+ ### Runtime & Infrastructure
62
89
 
63
- | Website route | Source file | Description |
90
+ | Website route | Markdown source | Purpose |
64
91
  | --- | --- | --- |
65
- | `/docs/middleware` | `middleware.md` | Middleware System v2 and v1 compatibility |
66
- | `/docs/hydration` | `hydration.md` | SSR/client transform parity, deterministic rendering and Windows line endings |
67
- | `/docs/developer-tools` | `developer-tools.md` | `bcp doctor`, `bcp inspect` and JSON diagnostics |
68
- | `/docs/development-logging` | `development-logging.md` | Structured logging, request identity and development observability |
92
+ | `/docs/middleware` | `middleware.md` | Middleware System v2 |
93
+ | `/docs/hydration` | `hydration.md` | SSR/client hydration parity |
94
+ | `/docs/developer-tools` | `developer-tools.md` | `doctor` and `inspect` diagnostics |
95
+ | `/docs/development-logging` | `development-logging.md` | Structured logging and observability |
69
96
  | `/docs/caching` | `caching.md` | Cache and revalidation |
70
- | `/docs/security` | `security.md` | Framework security defaults |
97
+ | `/docs/security` | `security.md` | Security defaults and request body limits |
71
98
 
72
- ### Releases
99
+ ## API Reference grouping
73
100
 
74
- Use the files under `docs/releases/` for release pages.
101
+ `bcp-docs-web` can derive an API-reference navigation layer from the authored guides.
75
102
 
76
- Recommended route format:
103
+ Recommended entrypoint groups:
77
104
 
78
105
  ```text
79
- /releases/0.1.21
80
- /releases/0.1.22
81
- /releases/0.1.23
106
+ bcp
107
+ bcp/server
108
+ bcp/auth
109
+ bcp/database
110
+ bcp/validation
111
+ bcp/error
112
+ bcp/cache
113
+ bcp/config
114
+ bcp/middleware
82
115
  ```
83
116
 
84
- The newest release should also be available from `/releases`.
117
+ The first version of the website does not need generated TypeDoc-style reference pages. It can begin by linking APIs to the guide that owns them, then add generated symbol-level reference later if useful.
85
118
 
86
- ## Homepage content for bcp-docs
119
+ Suggested ownership:
87
120
 
88
- The documentation homepage should describe BCP as a React full-stack framework and highlight the currently implemented capabilities.
121
+ | Entrypoint | Primary guide |
122
+ | --- | --- |
123
+ | `bcp` | `routing.md`, `server-data-loaders.md`, `form-actions.md` |
124
+ | `bcp/server` | `server-request-apis.md`, `file-upload.md`, `storage.md`, `development-logging.md` |
125
+ | `bcp/auth` | `authentication.md`, `auth-route-guards.md` |
126
+ | `bcp/database` | `database.md`, `database-migrations.md` |
127
+ | `bcp/validation` | `validation.md` |
128
+ | `bcp/error` | `error-handling.md` |
129
+ | `bcp/cache` | `caching.md` |
130
+ | `bcp/config` | `configuration.md` |
131
+ | `bcp/middleware` | `middleware.md` |
89
132
 
90
- Recommended feature groups:
133
+ ## Current capability groups
91
134
 
92
135
  ### Application
93
136
 
94
- - File-based routing
95
- - React SSR
137
+ - React SSR and hydration
138
+ - file-based page/API routing
139
+ - dynamic routes
140
+ - catch-all and optional catch-all routes
141
+ - route groups
142
+ - layouts and metadata
96
143
  - SPA navigation
97
- - Persistent layouts
98
- - Loading and error UI
99
- - API routes
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
144
+ - server data loaders
145
+ - route guards
146
+ - form actions
147
+ - client islands / partial hydration
148
+ - Fast Refresh
149
+ - deterministic development hydration
150
+
151
+ ### Server
152
+
153
+ - request-scoped server APIs
154
+ - request IDs
155
+ - cookies and redirects
156
+ - JWT sessions
157
+ - authentication helpers
158
+ - Middleware System v2
159
+ - typed validation
160
+ - structured errors
161
+ - structured logging
162
+ - multipart file uploads
163
+ - upload validation
164
+ - storage adapter contract
165
+ - local filesystem storage adapter
166
+ - production file delivery
167
+ - validators and byte ranges
117
168
 
118
169
  ### Database
119
170
 
120
171
  - `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
172
+ - lazy MySQL pool
173
+ - prepared execution
174
+ - query helpers
175
+ - transactions
176
+ - migrations
177
+ - migration status
178
+ - rollback
128
179
 
129
- - `bcp/auth`
130
- - JWT cookie sessions
131
- - Typed users and session data
132
- - Session rotation
133
- - `requireAuth()`
134
- - `requireRole()`
135
- - Auth-aware route guards
136
-
137
- ### Middleware
138
-
139
- - Middleware System v2
140
- - Middleware chains
141
- - Real `await next()` downstream execution
142
- - Before/after response interception
143
- - Shared request context state
144
- - Matchers
145
- - Rewrite and redirect
146
- - Backward-compatible Middleware v1 handlers
147
-
148
- ### Production and DX
180
+ ### Developer Experience
149
181
 
150
182
  - `create-bcp-app`
151
- - Interactive project setup
152
- - Tailwind preset
153
- - Database/auth presets
154
183
  - `bcp update`
155
- - `bcp doctor` project/runtime diagnostics
156
- - `bcp inspect` environment/config/route inspection
157
- - JSON developer-tool output for CI/automation
158
- - Duplicate React and duplicate BCP installation diagnostics
184
+ - `bcp doctor`
185
+ - `bcp inspect`
186
+ - route inspection
159
187
  - `bcp-framework` Windows-safe CLI alias
160
- - Structured server logger
161
- - Request-scoped loggers with request identity
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
188
+ - standalone production build
189
+ - unit/integration/E2E/package tests
190
+ - release/package smoke checks
172
191
 
173
- Suggested content, not a required exact copy:
192
+ ## BCP 0.1.25 documentation focus
174
193
 
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
- ```
194
+ ### Storage adapters
181
195
 
182
- Primary actions:
196
+ BCP `0.1.25` introduces the first application-facing storage abstraction through `bcp/server`:
183
197
 
184
- ```text
185
- Get Started
186
- Read the Docs
187
- View on GitHub
198
+ ```ts
199
+ import {
200
+ createLocalStorage,
201
+ createStorageResponse,
202
+ normalizeStorageKey,
203
+ StorageError,
204
+ storeUploadedFile,
205
+ } from "bcp/server";
188
206
  ```
189
207
 
190
- The website may display the current release version from project metadata instead of hard-coding it in multiple UI files.
208
+ The documentation must make these boundaries clear:
191
209
 
192
- ## Suggested documentation sidebar
210
+ - `StorageAdapter` is the application-facing contract.
211
+ - `createLocalStorage()` is the built-in adapter in this milestone.
212
+ - storage keys are logical relative paths, not operating-system paths.
213
+ - absolute paths and traversal segments are rejected.
214
+ - overwrite is opt-in.
215
+ - local metadata persists content type and SHA-256 identity.
216
+ - `createStorageResponse()` supports `GET` and `HEAD`.
217
+ - validators include ETag and Last-Modified behavior.
218
+ - single byte ranges are supported.
219
+ - multiple ranges are intentionally unsupported in `0.1.25` and return `416`.
220
+ - the default cache policy is private/revalidate.
221
+ - public caching must be explicit.
222
+ - storage keys do not replace authentication or authorization.
193
223
 
194
- ```text
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
- ```
224
+ See `storage.md`.
237
225
 
238
- ## Suggested documentation page layout
226
+ ### File Upload
239
227
 
240
- Each documentation page should support:
228
+ BCP `0.1.24` introduced:
241
229
 
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
230
+ - multipart parsing,
231
+ - request/file size limits,
232
+ - MIME allowlists,
233
+ - extension allowlists,
234
+ - required/optional file fields,
235
+ - safe local file names,
236
+ - traversal protection,
237
+ - overwrite protection,
238
+ - SHA-256 metadata.
254
239
 
255
- Optional later additions:
240
+ Those APIs remain supported in `0.1.25`.
256
241
 
257
- - documentation search
258
- - version selector
259
- - API symbol index
260
- - interactive examples
261
- - edit-on-GitHub links
242
+ `storeUploadedFile()` is the bridge between a validated multipart `File` and a `StorageAdapter`.
262
243
 
263
- ## Code examples
244
+ See:
264
245
 
265
- Examples should use the public package entrypoints that application developers actually install.
246
+ - `file-upload.md`
247
+ - `storage.md`
266
248
 
267
- Preferred:
249
+ ### Production auth guard stabilization
268
250
 
269
- ```ts
270
- import {
271
- auth,
272
- requireAuth,
273
- } from "bcp/auth";
251
+ The `0.1.24` stabilization cycle unified standalone guard/action authentication imports with the active request-context runtime.
274
252
 
275
- import {
276
- db,
277
- } from "bcp/database";
253
+ This prevents production-only failures where APIs such as `cookies()`, `getSession()`, `requireAuth()` or `requireRole()` could see a different request-context instance after bundling.
278
254
 
279
- import {
280
- v,
281
- validateFormData,
282
- } from "bcp/validation";
255
+ ### Development route graph synchronization
283
256
 
284
- import {
285
- badRequest,
286
- unauthorized,
287
- } from "bcp/error";
257
+ The `0.1.24` stabilization cycle also fixed a development graph drift where the route scanner could see a new route while the incremental client bundle graph still represented the previous topology.
288
258
 
289
- import {
290
- logger,
291
- requestLogger,
292
- } from "bcp/server";
259
+ The development gateway now compares the actual page route graph and refreshes the internal client bundler when pathname/page/layout topology changes.
293
260
 
294
- import {
295
- type MiddlewarePipelineHandler,
296
- } from "bcp/middleware";
297
- ```
261
+ ### Logging and observability
298
262
 
299
- Avoid documenting internal monorepo imports such as:
263
+ BCP `0.1.23` introduced:
300
264
 
301
- ```text
302
- packages/server/src/...
303
- packages/client/src/...
304
- ```
265
+ - `logger`,
266
+ - `createLogger()`,
267
+ - request-scoped `requestLogger()`,
268
+ - log levels,
269
+ - pretty/JSON formats,
270
+ - request IDs,
271
+ - structured development request logging,
272
+ - SSR/import debug timing.
305
273
 
306
- unless a page is explicitly explaining framework internals.
274
+ See `development-logging.md`.
307
275
 
308
- ## Version labels
276
+ ### Developer tools
309
277
 
310
- The website should distinguish:
278
+ BCP `0.1.22` introduced:
311
279
 
312
- - current stable npm version
313
- - documentation target version
314
- - unreleased/main documentation if it is shown
280
+ - `bcp doctor`,
281
+ - `bcp inspect`,
282
+ - JSON diagnostic output,
283
+ - duplicate React detection,
284
+ - duplicate BCP installation protection,
285
+ - Windows-safe `bcp-framework` CLI alias.
315
286
 
316
- Do not label unreleased `main` behavior as already available from npm until the corresponding package has been published.
287
+ See `developer-tools.md`.
317
288
 
318
- ## Framework commands to document
289
+ ## CLI commands
319
290
 
320
291
  ```bash
321
292
  bcp dev
@@ -335,135 +306,163 @@ bcp db status
335
306
  bcp db rollback
336
307
  ```
337
308
 
338
- On Windows systems where Microsoft SQL Server owns the `bcp` executable name, document the equivalent collision-free commands with `bcp-framework`.
339
-
340
- Project creation:
309
+ On Windows systems where Microsoft SQL Server owns `bcp.exe`, direct project-local commands should prefer:
341
310
 
342
- ```bash
343
- npx create-bcp-app@latest my-app
311
+ ```powershell
312
+ npm exec -- bcp-framework doctor
313
+ npm exec -- bcp-framework inspect
314
+ npm exec -- bcp-framework dev
315
+ npm exec -- bcp-framework build
344
316
  ```
345
317
 
346
- ## Middleware v2 documentation priority
318
+ Inside npm scripts, `bcp` remains safe because npm prepends `node_modules/.bin` to `PATH`.
347
319
 
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.
320
+ ## Release documentation
349
321
 
350
- The middleware page should prominently explain:
322
+ Release notes live under:
351
323
 
352
324
  ```text
353
- v1 next() = return a pass-through instruction
354
- v2 await next() = execute downstream middleware/application and receive Response
325
+ docs/releases/
355
326
  ```
356
327
 
357
- Existing v1 code remains supported, so migration documentation should describe v2 as an additive upgrade rather than a mandatory rewrite.
328
+ Recommended website release routes:
358
329
 
359
- See `middleware.md` for the full API and examples.
330
+ ```text
331
+ /releases/0.1.25
332
+ /releases/0.1.24
333
+ /releases/0.1.23
334
+ /releases/0.1.22
335
+ /releases/0.1.21
336
+ /releases/0.1.20
337
+ ```
360
338
 
361
- ## Validation documentation priority
339
+ The website should display a clear release state for each version:
362
340
 
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.
341
+ ```text
342
+ published
343
+ release candidate
344
+ unreleased development target
345
+ ```
364
346
 
365
- Important concepts to surface:
347
+ Do not infer publication state only from the existence of a Markdown release note.
366
348
 
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
349
+ ## Suggested `bcp-docs-web` content model
373
350
 
374
- See `validation.md` for the complete API and examples.
351
+ A future website can represent each Markdown page with metadata similar to:
375
352
 
376
- ## Error Handling documentation priority
353
+ ```ts
354
+ interface DocPage {
355
+ title: string;
356
+ slug: string;
357
+ section: string;
358
+ sourceFile: string;
359
+ versionTarget?: string;
360
+ releaseState?:
361
+ | "published"
362
+ | "rc"
363
+ | "unreleased";
364
+ }
365
+ ```
377
366
 
378
- BCP 0.1.20 introduced the public `bcp/error` entrypoint and a standard HTTP error envelope.
367
+ The metadata does not need to live in frontmatter immediately. The first implementation can use a route manifest in the docs website and consume Markdown files directly.
379
368
 
380
- The docs website should clearly distinguish:
369
+ ## Suggested website features
381
370
 
382
- ```text
383
- notFound() = activate page 404 UI behavior
384
- notFoundResponse() = return a JSON 404 HTTP response
385
- ```
371
+ The first useful version of `bcp-docs-web` should prioritize:
386
372
 
387
- Important concepts to surface:
373
+ 1. Sidebar navigation generated from the route/source map.
374
+ 2. Markdown rendering with syntax highlighting.
375
+ 3. Previous/next page navigation.
376
+ 4. Version/development-target banner.
377
+ 5. Release note pages.
378
+ 6. Search across Markdown content.
379
+ 7. Copy buttons for code blocks.
380
+ 8. Mobile navigation.
381
+ 9. Direct GitHub source/edit links.
388
382
 
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`
383
+ Later additions can include:
397
384
 
398
- See `error-handling.md` for the complete API and examples.
385
+ - generated API symbol reference,
386
+ - versioned documentation snapshots,
387
+ - interactive examples,
388
+ - framework playgrounds,
389
+ - release comparison pages.
399
390
 
400
- ## Hydration documentation priority
391
+ ## Source conventions
401
392
 
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.
393
+ For documentation intended for the website:
403
394
 
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.
395
+ - use one H1 per source page,
396
+ - keep heading hierarchy stable,
397
+ - use fenced code blocks with language tags,
398
+ - use relative repository links for other docs,
399
+ - keep API names exactly aligned with public exports,
400
+ - distinguish current behavior from roadmap plans,
401
+ - include security limitations next to the API they affect,
402
+ - prefer runnable examples over pseudo APIs,
403
+ - avoid documenting private/internal modules as public APIs.
405
404
 
406
- The docs website should make these points clear:
405
+ ## Stable vs development documentation
407
406
 
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.
407
+ `main` can contain documentation for the next release before npm publication.
415
408
 
416
- See `hydration.md` for the full explanation, transform pipeline and troubleshooting steps.
409
+ Therefore the website must distinguish:
417
410
 
418
- ## Developer Tools documentation priority
411
+ ```text
412
+ Documentation target != necessarily current npm stable version
413
+ ```
419
414
 
420
- BCP 0.1.22 adds `bcp doctor` and `bcp inspect` as the first dedicated developer-diagnostics commands.
415
+ For example, while `0.1.25` is under release validation, `docs/storage.md` can describe the `0.1.25` development target, but the website should not label it as published until the release is actually available.
421
416
 
422
- The docs website should surface:
417
+ ## Release validation
423
418
 
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.
419
+ Before publishing a framework release:
432
420
 
433
- See `developer-tools.md` for the full command reference.
421
+ ```bash
422
+ npm run typecheck
423
+ npm run test:unit
424
+ npm run test:e2e
425
+ npm run test:package
426
+ npm run rc:check
427
+ ```
434
428
 
435
- ## Logging and observability documentation priority
429
+ Release validation should include packed-package smoke verification and representative production application testing.
436
430
 
437
- BCP 0.1.23 adds the structured logging foundation through `bcp/server`.
431
+ ## Documentation QA checklist
438
432
 
439
- The docs website should surface:
433
+ Before a docs release or website sync:
440
434
 
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.
435
+ - all linked Markdown files exist,
436
+ - examples use public exports,
437
+ - version numbers are current,
438
+ - unreleased features are labeled correctly,
439
+ - Windows CLI instructions use the safe alias where needed,
440
+ - security caveats are present for uploads/storage/authentication,
441
+ - route names match the current router,
442
+ - release notes match the framework version,
443
+ - no generated `.bcp-framework` paths are presented as user-authored source files.
450
444
 
451
- See `development-logging.md` for the complete API and examples.
445
+ ## Roadmap
452
446
 
453
- ## Release roadmap
447
+ After `0.1.25`, the current planned framework direction is:
454
448
 
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.
449
+ 1. S3-compatible / cloud storage integration.
450
+ 2. Production upload streaming.
451
+ 3. Broader storage adapter ecosystem.
452
+ 4. Additional production hardening.
456
453
 
457
- ## Release workflow for documentation
454
+ These are roadmap items, not published API guarantees.
458
455
 
459
- Before publishing a new BCP release:
456
+ ## Repository authority
460
457
 
461
- ```bash
462
- npm run typecheck
463
- npm run test:unit
464
- npm run rc:check
465
- ```
458
+ The framework repository remains authoritative for:
466
459
 
467
- After npm publication, the docs website can update its displayed stable version.
460
+ ```text
461
+ source
462
+ public exports
463
+ tests
464
+ docs
465
+ release notes
466
+ ```
468
467
 
469
- The framework repository remains authoritative for API correctness; `bcp-docs` is the presentation layer for that content.
468
+ `bcp-docs-web` should be treated as the presentation/search/navigation layer for this content rather than a competing documentation source.