@chidchanun/bcp 0.1.25 → 0.1.27

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,16 +1,12 @@
1
1
  # BCP Framework Documentation Source
2
2
 
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.
3
+ The `docs/` directory is the documentation source of truth for BCP Framework and is intentionally organized for the future **`bcp-docs-web`** website.
4
4
 
5
- > **Documentation target:** BCP Framework `0.1.25`
5
+ > **Documentation target:** BCP Framework `0.1.27`
6
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.
7
+ > **Release state:** unreleased development target. Do not label `0.1.27` as published until RC validation and npm publication complete.
8
8
 
9
- ## Documentation goals
10
-
11
- The documentation source should make it possible to build `bcp-docs-web` without duplicating framework knowledge into a second repository.
12
-
13
- The expected relationship is:
9
+ ## Documentation flow
14
10
 
15
11
  ```text
16
12
  BCP Framework source/tests
@@ -20,28 +16,27 @@ BCP Framework source/tests
20
16
  bcp-docs-web
21
17
  ```
22
18
 
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.
19
+ Framework source and tests are authoritative for behavior. Markdown under `docs/` is the authored documentation layer. `bcp-docs-web` should render, organize and search these sources instead of becoming a competing source of truth.
24
20
 
25
- ## Content update rule
21
+ ## Update rule
26
22
 
27
23
  When framework behavior changes:
28
24
 
29
25
  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.
26
+ 2. Add/update regression tests.
27
+ 3. Update the matching file under `docs/`.
28
+ 4. Update `docs/releases/<version>.md`.
29
+ 5. Change release state to published only after npm publication succeeds.
34
30
 
35
31
  ## Recommended `bcp-docs-web` navigation
36
32
 
37
- The website should use these top-level groups:
38
-
39
33
  ```text
40
34
  Getting Started
41
35
  Routing & Data
42
36
  Authentication
43
37
  Database
44
38
  Runtime & Infrastructure
39
+ Storage & Uploads
45
40
  API Reference
46
41
  Releases
47
42
  ```
@@ -51,10 +46,10 @@ Releases
51
46
  | Website route | Markdown source | Purpose |
52
47
  | --- | --- | --- |
53
48
  | `/docs/getting-started` | `getting-started.md` | Create and run a BCP application |
54
- | `/docs/configuration` | `configuration.md` | Framework configuration and environment behavior |
55
- | `/docs/application-modules` | `application-modules.md` | Client/server boundaries and module rules |
49
+ | `/docs/configuration` | `configuration.md` | Framework configuration/environment |
50
+ | `/docs/application-modules` | `application-modules.md` | Client/server boundaries |
56
51
  | `/docs/deployment` | `deployment.md` | Standalone production deployment |
57
- | `/docs/updating` | `updating.md` | Framework upgrade workflow |
52
+ | `/docs/updating` | `updating.md` | Framework upgrades |
58
53
 
59
54
  ### Routing & Data
60
55
 
@@ -63,12 +58,10 @@ Releases
63
58
  | `/docs/routing` | `routing.md` | File-based page/API routing |
64
59
  | `/docs/server-data-loaders` | `server-data-loaders.md` | Server-side page data |
65
60
  | `/docs/route-guards` | `route-guards.md` | Scoped route authorization |
66
- | `/docs/form-actions` | `form-actions.md` | Server mutations and forms |
61
+ | `/docs/form-actions` | `form-actions.md` | Server mutations/forms |
67
62
  | `/docs/server-request-apis` | `server-request-apis.md` | Request/cookie/response APIs |
68
63
  | `/docs/validation` | `validation.md` | Typed validation |
69
64
  | `/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 |
72
65
 
73
66
  ### Authentication
74
67
 
@@ -83,7 +76,7 @@ Releases
83
76
  | Website route | Markdown source | Purpose |
84
77
  | --- | --- | --- |
85
78
  | `/docs/database` | `database.md` | MySQL database primitives |
86
- | `/docs/database-migrations` | `database-migrations.md` | Migration CLI and migration files |
79
+ | `/docs/database-migrations` | `database-migrations.md` | Migration CLI/files |
87
80
 
88
81
  ### Runtime & Infrastructure
89
82
 
@@ -91,14 +84,21 @@ Releases
91
84
  | --- | --- | --- |
92
85
  | `/docs/middleware` | `middleware.md` | Middleware System v2 |
93
86
  | `/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 |
96
- | `/docs/caching` | `caching.md` | Cache and revalidation |
97
- | `/docs/security` | `security.md` | Security defaults and request body limits |
87
+ | `/docs/developer-tools` | `developer-tools.md` | `doctor` / `inspect` |
88
+ | `/docs/development-logging` | `development-logging.md` | Logging/observability |
89
+ | `/docs/caching` | `caching.md` | Cache/revalidation |
90
+ | `/docs/security` | `security.md` | Security/body limits |
98
91
 
99
- ## API Reference grouping
92
+ ### Storage & Uploads
93
+
94
+ | Website route | Markdown source | Purpose |
95
+ | --- | --- | --- |
96
+ | `/docs/file-upload` | `file-upload.md` | Buffered + streaming multipart uploads |
97
+ | `/docs/storage` | `storage.md` | StorageAdapter, streaming and file delivery |
98
+ | `/docs/storage-ecosystem` | `storage-ecosystem.md` | Listing, copy/move, metadata, bulk delete, signed URLs |
99
+ | `/docs/s3-storage` | `s3-storage.md` | S3/R2/MinIO adapter and direct object access |
100
100
 
101
- `bcp-docs-web` can derive an API-reference navigation layer from the authored guides.
101
+ ## API Reference ownership
102
102
 
103
103
  Recommended entrypoint groups:
104
104
 
@@ -114,14 +114,10 @@ bcp/config
114
114
  bcp/middleware
115
115
  ```
116
116
 
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.
118
-
119
- Suggested ownership:
120
-
121
117
  | Entrypoint | Primary guide |
122
118
  | --- | --- |
123
119
  | `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` |
120
+ | `bcp/server` | `server-request-apis.md`, `file-upload.md`, `storage.md`, `storage-ecosystem.md`, `s3-storage.md`, `development-logging.md` |
125
121
  | `bcp/auth` | `authentication.md`, `auth-route-guards.md` |
126
122
  | `bcp/database` | `database.md`, `database-migrations.md` |
127
123
  | `bcp/validation` | `validation.md` |
@@ -134,48 +130,47 @@ Suggested ownership:
134
130
 
135
131
  ### Application
136
132
 
137
- - React SSR and hydration
133
+ - React SSR/hydration
138
134
  - file-based page/API routing
139
- - dynamic routes
140
- - catch-all and optional catch-all routes
141
- - route groups
142
- - layouts and metadata
135
+ - static/dynamic/catch-all/optional-catch-all routes
136
+ - route groups/layouts/metadata
143
137
  - SPA navigation
144
- - server data loaders
145
- - route guards
146
- - form actions
138
+ - loaders/guards/form actions
147
139
  - client islands / partial hydration
148
140
  - Fast Refresh
149
- - deterministic development hydration
150
141
 
151
142
  ### Server
152
143
 
153
- - request-scoped server APIs
154
- - request IDs
155
- - cookies and redirects
156
- - JWT sessions
157
- - authentication helpers
144
+ - request-scoped APIs/cookies/redirects/request IDs
145
+ - JWT sessions/authentication
158
146
  - Middleware System v2
159
- - typed validation
160
- - structured errors
147
+ - validation/structured errors
161
148
  - 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
149
+ - response caching/security gateway
150
+
151
+ ### Storage & Uploads
152
+
153
+ - buffered multipart `FormData` upload APIs
154
+ - production streaming multipart upload (`storeMultipartFile()`)
155
+ - backward-compatible `StorageAdapter` contract
156
+ - local filesystem storage
157
+ - S3/R2/MinIO-compatible storage
158
+ - streaming reads/writes and byte ranges
159
+ - ETag/Last-Modified file delivery
160
+ - upload/storage limits and abort cleanup
161
+ - object listing with cursors
162
+ - native/fallback copy and move
163
+ - portable user metadata
164
+ - bulk deletion
165
+ - S3 presigned read/write URLs
168
166
 
169
167
  ### Database
170
168
 
171
169
  - `bcp/database`
172
170
  - lazy MySQL pool
173
- - prepared execution
174
- - query helpers
171
+ - prepared execution/query helpers
175
172
  - transactions
176
- - migrations
177
- - migration status
178
- - rollback
173
+ - migrations/status/rollback
179
174
 
180
175
  ### Developer Experience
181
176
 
@@ -183,108 +178,70 @@ Suggested ownership:
183
178
  - `bcp update`
184
179
  - `bcp doctor`
185
180
  - `bcp inspect`
186
- - route inspection
187
- - `bcp-framework` Windows-safe CLI alias
181
+ - Windows-safe `bcp-framework` alias
188
182
  - standalone production build
189
- - unit/integration/E2E/package tests
190
- - release/package smoke checks
183
+ - unit/integration/E2E/package/RC checks
191
184
 
192
- ## BCP 0.1.25 documentation focus
185
+ ## BCP 0.1.27 documentation focus
193
186
 
194
- ### Storage adapters
187
+ ### Storage ecosystem
195
188
 
196
- BCP `0.1.25` introduces the first application-facing storage abstraction through `bcp/server`:
189
+ New generic helpers include:
197
190
 
198
191
  ```ts
199
192
  import {
200
- createLocalStorage,
201
- createStorageResponse,
202
- normalizeStorageKey,
203
- StorageError,
204
- storeUploadedFile,
193
+ copyStorageObject,
194
+ createStorageSignedReadUrl,
195
+ createStorageSignedWriteUrl,
196
+ deleteStorageObjects,
197
+ getStorageEcosystemCapabilities,
198
+ getStorageMetadata,
199
+ listStorageObjects,
200
+ moveStorageObject,
201
+ setStorageMetadata,
205
202
  } from "bcp/server";
206
203
  ```
207
204
 
208
- The documentation must make these boundaries clear:
209
-
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.
223
-
224
- See `storage.md`.
225
-
226
- ### File Upload
227
-
228
- BCP `0.1.24` introduced:
229
-
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.
239
-
240
- Those APIs remain supported in `0.1.25`.
241
-
242
- `storeUploadedFile()` is the bridge between a validated multipart `File` and a `StorageAdapter`.
243
-
244
- See:
245
-
246
- - `file-upload.md`
247
- - `storage.md`
248
-
249
- ### Production auth guard stabilization
250
-
251
- The `0.1.24` stabilization cycle unified standalone guard/action authentication imports with the active request-context runtime.
252
-
253
- This prevents production-only failures where APIs such as `cookies()`, `getSession()`, `requireAuth()` or `requireRole()` could see a different request-context instance after bundling.
205
+ Document these boundaries clearly:
254
206
 
255
- ### Development route graph synchronization
207
+ - ecosystem methods are additive and do not invalidate older `StorageAdapter` implementations,
208
+ - listing cursors are opaque,
209
+ - overwrite remains opt-in,
210
+ - move is copy + delete rather than an atomic distributed transaction,
211
+ - application metadata is portable string metadata and not authorization/business state,
212
+ - `bcp_sha256` is reserved for framework checksum metadata,
213
+ - local storage does not emulate signed URLs,
214
+ - S3 direct-transfer URLs are temporary credentials and require application authorization before issuance.
256
215
 
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.
216
+ See `storage-ecosystem.md`.
258
217
 
259
- The development gateway now compares the actual page route graph and refreshes the internal client bundler when pathname/page/layout topology changes.
218
+ ### S3 ecosystem
260
219
 
261
- ### Logging and observability
220
+ `createS3Storage()` keeps the same public constructor and now adds:
262
221
 
263
- BCP `0.1.23` introduced:
264
-
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.
222
+ ```text
223
+ ListObjectsV2
224
+ CopyObject
225
+ DeleteObjects
226
+ presigned GetObject
227
+ presigned PutObject
228
+ application metadata
229
+ ```
273
230
 
274
- See `development-logging.md`.
231
+ See `s3-storage.md`.
275
232
 
276
- ### Developer tools
233
+ ### 0.1.26 foundations remain supported
277
234
 
278
- BCP `0.1.22` introduced:
235
+ The following remain part of the storage stack:
279
236
 
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.
237
+ ```text
238
+ putStorageStream()
239
+ readStorageStream()
240
+ storeMultipartFile()
241
+ createStorageResponse()
242
+ ```
286
243
 
287
- See `developer-tools.md`.
244
+ `0.1.27` builds on these rather than replacing them.
288
245
 
289
246
  ## CLI commands
290
247
 
@@ -306,7 +263,7 @@ bcp db status
306
263
  bcp db rollback
307
264
  ```
308
265
 
309
- On Windows systems where Microsoft SQL Server owns `bcp.exe`, direct project-local commands should prefer:
266
+ On Windows, direct project-local commands should prefer:
310
267
 
311
268
  ```powershell
312
269
  npm exec -- bcp-framework doctor
@@ -315,9 +272,9 @@ npm exec -- bcp-framework dev
315
272
  npm exec -- bcp-framework build
316
273
  ```
317
274
 
318
- Inside npm scripts, `bcp` remains safe because npm prepends `node_modules/.bin` to `PATH`.
275
+ Inside npm scripts, `bcp` is safe because npm prepends `node_modules/.bin` to `PATH`.
319
276
 
320
- ## Release documentation
277
+ ## Releases
321
278
 
322
279
  Release notes live under:
323
280
 
@@ -325,18 +282,18 @@ Release notes live under:
325
282
  docs/releases/
326
283
  ```
327
284
 
328
- Recommended website release routes:
285
+ Recommended routes:
329
286
 
330
287
  ```text
288
+ /releases/0.1.27
289
+ /releases/0.1.26
331
290
  /releases/0.1.25
332
291
  /releases/0.1.24
333
292
  /releases/0.1.23
334
293
  /releases/0.1.22
335
- /releases/0.1.21
336
- /releases/0.1.20
337
294
  ```
338
295
 
339
- The website should display a clear release state for each version:
296
+ Use one of these release states:
340
297
 
341
298
  ```text
342
299
  published
@@ -344,11 +301,9 @@ release candidate
344
301
  unreleased development target
345
302
  ```
346
303
 
347
- Do not infer publication state only from the existence of a Markdown release note.
304
+ The existence of a release note alone does not mean the npm version is published.
348
305
 
349
- ## Suggested `bcp-docs-web` content model
350
-
351
- A future website can represent each Markdown page with metadata similar to:
306
+ ## Suggested website model
352
307
 
353
308
  ```ts
354
309
  interface DocPage {
@@ -364,94 +319,89 @@ interface DocPage {
364
319
  }
365
320
  ```
366
321
 
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.
322
+ The first `bcp-docs-web` implementation can keep this mapping in a route manifest and consume Markdown directly.
368
323
 
369
324
  ## Suggested website features
370
325
 
371
- The first useful version of `bcp-docs-web` should prioritize:
372
-
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.
326
+ 1. Sidebar navigation from this source map.
327
+ 2. Markdown rendering + syntax highlighting.
328
+ 3. Previous/next navigation.
329
+ 4. Version/release-state banner.
330
+ 5. Release pages.
331
+ 6. Full-text search.
379
332
  7. Copy buttons for code blocks.
380
333
  8. Mobile navigation.
381
- 9. Direct GitHub source/edit links.
334
+ 9. GitHub source/edit links.
382
335
 
383
- Later additions can include:
336
+ Later:
384
337
 
385
- - generated API symbol reference,
386
- - versioned documentation snapshots,
387
- - interactive examples,
388
- - framework playgrounds,
338
+ - generated symbol reference,
339
+ - versioned snapshots,
340
+ - interactive examples/playgrounds,
389
341
  - release comparison pages.
390
342
 
391
343
  ## Source conventions
392
344
 
393
- For documentation intended for the website:
394
-
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.
404
-
405
- ## Stable vs development documentation
406
-
407
- `main` can contain documentation for the next release before npm publication.
408
-
409
- Therefore the website must distinguish:
410
-
411
- ```text
412
- Documentation target != necessarily current npm stable version
413
- ```
414
-
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.
345
+ - one H1 per page,
346
+ - stable heading hierarchy,
347
+ - fenced code blocks with language tags,
348
+ - relative links between docs,
349
+ - exact public API names,
350
+ - clear stable/RC/roadmap labels,
351
+ - security limitations next to affected APIs,
352
+ - runnable examples where possible,
353
+ - no private/internal modules presented as public API.
416
354
 
417
355
  ## Release validation
418
356
 
419
- Before publishing a framework release:
357
+ Before publishing:
420
358
 
421
359
  ```bash
422
360
  npm run typecheck
423
361
  npm run test:unit
362
+ npm run test:integration
424
363
  npm run test:e2e
425
364
  npm run test:package
426
365
  npm run rc:check
427
366
  ```
428
367
 
429
- Release validation should include packed-package smoke verification and representative production application testing.
368
+ For `0.1.27`, package validation must also confirm the staged artifact includes:
430
369
 
431
- ## Documentation QA checklist
370
+ ```text
371
+ @aws-sdk/client-s3
372
+ @aws-sdk/lib-storage
373
+ @aws-sdk/s3-request-presigner
374
+ busboy
375
+ ```
432
376
 
433
- Before a docs release or website sync:
377
+ and the ecosystem runtime/public exports.
378
+
379
+ ## Documentation QA checklist
434
380
 
435
- - all linked Markdown files exist,
381
+ - linked Markdown files exist,
436
382
  - 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,
383
+ - version/release states are current,
384
+ - Windows direct CLI examples use `npm exec -- bcp-framework`,
385
+ - upload/storage/auth security caveats are present,
441
386
  - route names match the current router,
442
387
  - release notes match the framework version,
443
- - no generated `.bcp-framework` paths are presented as user-authored source files.
388
+ - S3 credentials are never shown as public browser variables,
389
+ - signed URLs are documented as temporary credentials,
390
+ - roadmap APIs are not presented as published guarantees.
444
391
 
445
- ## Roadmap
392
+ ## Next direction after 0.1.27
446
393
 
447
- After `0.1.25`, the current planned framework direction is:
394
+ Planned `0.1.28 Production Hardening` focus:
448
395
 
449
- 1. S3-compatible / cloud storage integration.
450
- 2. Production upload streaming.
451
- 3. Broader storage adapter ecosystem.
452
- 4. Additional production hardening.
396
+ - graceful HTTP shutdown and active-request draining,
397
+ - database/S3 resource cleanup,
398
+ - trusted proxy and forwarded-header handling,
399
+ - timeout controls,
400
+ - security hardening,
401
+ - Docker/standalone runtime regression coverage,
402
+ - startup/runtime dependency diagnostics.
453
403
 
454
- These are roadmap items, not published API guarantees.
404
+ These remain roadmap items until their source/tests land.
455
405
 
456
406
  ## Repository authority
457
407
 
@@ -465,4 +415,4 @@ docs
465
415
  release notes
466
416
  ```
467
417
 
468
- `bcp-docs-web` should be treated as the presentation/search/navigation layer for this content rather than a competing documentation source.
418
+ `bcp-docs-web` is the presentation/search/navigation layer for this content.