@chidchanun/bcp 0.1.27 → 0.1.29
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 +158 -82
- package/docs/README.md +162 -104
- package/docs/developer-tools.md +175 -78
- package/docs/docs-web-manifest.json +88 -0
- package/docs/generators.md +149 -0
- package/docs/production-hardening.md +152 -0
- package/docs/project-metadata.md +112 -0
- package/docs/releases/0.1.28.md +134 -0
- package/docs/releases/0.1.29.md +170 -0
- package/package.json +1 -1
- package/packages/cli/src/args.ts +96 -0
- package/packages/cli/src/developer-tools-v2.ts +629 -0
- package/packages/cli/src/developer-tools.ts +115 -0
- package/packages/cli/src/generate.ts +475 -0
- package/packages/cli/src/index.ts +69 -0
- package/packages/client/src/server.ts +9 -0
- package/packages/server/src/hardening-proxy.ts +393 -0
- package/packages/server/src/production-hardening.ts +374 -0
- package/packages/server/src/standalone-production-runtime-v7.ts +299 -0
- package/packages/server/src/standalone-production-server.ts +1 -1
package/docs/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
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 for
|
|
3
|
+
The `docs/` directory is the documentation source of truth for BCP Framework and is intentionally organized for **`bcp-docs-web`**.
|
|
4
4
|
|
|
5
|
-
> **Documentation target:** BCP Framework `0.1.
|
|
5
|
+
> **Documentation target:** BCP Framework `0.1.29`
|
|
6
6
|
>
|
|
7
|
-
> **Release state:** unreleased development target. Do not label `0.1.
|
|
7
|
+
> **Release state:** unreleased development target. Do not label `0.1.29` as published until RC validation, tagging and npm publication complete.
|
|
8
8
|
|
|
9
9
|
## Documentation flow
|
|
10
10
|
|
|
@@ -13,10 +13,45 @@ BCP Framework source/tests
|
|
|
13
13
|
↓
|
|
14
14
|
docs/
|
|
15
15
|
↓
|
|
16
|
+
Markdown content + docs-web manifest
|
|
17
|
+
↓
|
|
16
18
|
bcp-docs-web
|
|
17
19
|
```
|
|
18
20
|
|
|
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
|
|
21
|
+
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 rather than becoming a competing source of truth.
|
|
22
|
+
|
|
23
|
+
## Docs-web navigation contract — 0.1.29
|
|
24
|
+
|
|
25
|
+
`docs/docs-web-manifest.json` is the explicit navigation and route contract for the docs website.
|
|
26
|
+
|
|
27
|
+
It defines:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
schema version
|
|
31
|
+
framework/version target
|
|
32
|
+
release state
|
|
33
|
+
section IDs/titles
|
|
34
|
+
website routes
|
|
35
|
+
Markdown source files
|
|
36
|
+
page titles
|
|
37
|
+
release routes
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Recommended docs-web workflow:
|
|
41
|
+
|
|
42
|
+
```text
|
|
43
|
+
read docs/docs-web-manifest.json
|
|
44
|
+
↓
|
|
45
|
+
generate sidebar + route map
|
|
46
|
+
↓
|
|
47
|
+
load referenced Markdown file
|
|
48
|
+
↓
|
|
49
|
+
render content/search/prev-next
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Do not duplicate this mapping in a second hard-coded sidebar unless the website needs a temporary bootstrap fallback.
|
|
53
|
+
|
|
54
|
+
Markdown remains the content source; the manifest contains navigation metadata only.
|
|
20
55
|
|
|
21
56
|
## Update rule
|
|
22
57
|
|
|
@@ -24,12 +59,15 @@ When framework behavior changes:
|
|
|
24
59
|
|
|
25
60
|
1. Update framework source.
|
|
26
61
|
2. Add/update regression tests.
|
|
27
|
-
3. Update the matching file under `docs/`.
|
|
28
|
-
4. Update `docs/
|
|
29
|
-
5.
|
|
62
|
+
3. Update the matching Markdown file under `docs/`.
|
|
63
|
+
4. Update `docs/docs-web-manifest.json` when routes/navigation change.
|
|
64
|
+
5. Update `docs/releases/<version>.md`.
|
|
65
|
+
6. Change release state to published only after npm publication succeeds.
|
|
30
66
|
|
|
31
67
|
## Recommended `bcp-docs-web` navigation
|
|
32
68
|
|
|
69
|
+
The current manifest groups documentation into:
|
|
70
|
+
|
|
33
71
|
```text
|
|
34
72
|
Getting Started
|
|
35
73
|
Routing & Data
|
|
@@ -37,7 +75,7 @@ Authentication
|
|
|
37
75
|
Database
|
|
38
76
|
Runtime & Infrastructure
|
|
39
77
|
Storage & Uploads
|
|
40
|
-
|
|
78
|
+
Developer Experience
|
|
41
79
|
Releases
|
|
42
80
|
```
|
|
43
81
|
|
|
@@ -48,6 +86,7 @@ Releases
|
|
|
48
86
|
| `/docs/getting-started` | `getting-started.md` | Create and run a BCP application |
|
|
49
87
|
| `/docs/configuration` | `configuration.md` | Framework configuration/environment |
|
|
50
88
|
| `/docs/application-modules` | `application-modules.md` | Client/server boundaries |
|
|
89
|
+
| `/docs/project-metadata` | `project-metadata.md` | `bcp.project.json` schema and security boundary |
|
|
51
90
|
| `/docs/deployment` | `deployment.md` | Standalone production deployment |
|
|
52
91
|
| `/docs/updating` | `updating.md` | Framework upgrades |
|
|
53
92
|
|
|
@@ -84,10 +123,10 @@ Releases
|
|
|
84
123
|
| --- | --- | --- |
|
|
85
124
|
| `/docs/middleware` | `middleware.md` | Middleware System v2 |
|
|
86
125
|
| `/docs/hydration` | `hydration.md` | SSR/client hydration parity |
|
|
87
|
-
| `/docs/developer-tools` | `developer-tools.md` | `doctor` / `inspect` |
|
|
88
126
|
| `/docs/development-logging` | `development-logging.md` | Logging/observability |
|
|
89
127
|
| `/docs/caching` | `caching.md` | Cache/revalidation |
|
|
90
128
|
| `/docs/security` | `security.md` | Security/body limits |
|
|
129
|
+
| `/docs/production-hardening` | `production-hardening.md` | Graceful shutdown, trusted proxy and timeouts |
|
|
91
130
|
|
|
92
131
|
### Storage & Uploads
|
|
93
132
|
|
|
@@ -98,6 +137,13 @@ Releases
|
|
|
98
137
|
| `/docs/storage-ecosystem` | `storage-ecosystem.md` | Listing, copy/move, metadata, bulk delete, signed URLs |
|
|
99
138
|
| `/docs/s3-storage` | `s3-storage.md` | S3/R2/MinIO adapter and direct object access |
|
|
100
139
|
|
|
140
|
+
### Developer Experience
|
|
141
|
+
|
|
142
|
+
| Website route | Markdown source | Purpose |
|
|
143
|
+
| --- | --- | --- |
|
|
144
|
+
| `/docs/generators` | `generators.md` | Page/API/middleware/migration generators |
|
|
145
|
+
| `/docs/developer-tools` | `developer-tools.md` | Doctor/Inspect v2 and diagnostics |
|
|
146
|
+
|
|
101
147
|
## API Reference ownership
|
|
102
148
|
|
|
103
149
|
Recommended entrypoint groups:
|
|
@@ -117,7 +163,7 @@ bcp/middleware
|
|
|
117
163
|
| Entrypoint | Primary guide |
|
|
118
164
|
| --- | --- |
|
|
119
165
|
| `bcp` | `routing.md`, `server-data-loaders.md`, `form-actions.md` |
|
|
120
|
-
| `bcp/server` | `server-request-apis.md`, `file-upload.md`, `storage.md`, `storage-ecosystem.md`, `s3-storage.md`, `development-logging.md` |
|
|
166
|
+
| `bcp/server` | `server-request-apis.md`, `file-upload.md`, `storage.md`, `storage-ecosystem.md`, `s3-storage.md`, `development-logging.md`, `production-hardening.md` |
|
|
121
167
|
| `bcp/auth` | `authentication.md`, `auth-route-guards.md` |
|
|
122
168
|
| `bcp/database` | `database.md`, `database-migrations.md` |
|
|
123
169
|
| `bcp/validation` | `validation.md` |
|
|
@@ -139,7 +185,7 @@ bcp/middleware
|
|
|
139
185
|
- client islands / partial hydration
|
|
140
186
|
- Fast Refresh
|
|
141
187
|
|
|
142
|
-
### Server
|
|
188
|
+
### Server and production runtime
|
|
143
189
|
|
|
144
190
|
- request-scoped APIs/cookies/redirects/request IDs
|
|
145
191
|
- JWT sessions/authentication
|
|
@@ -147,22 +193,28 @@ bcp/middleware
|
|
|
147
193
|
- validation/structured errors
|
|
148
194
|
- structured logging
|
|
149
195
|
- response caching/security gateway
|
|
196
|
+
- production hardening gateway
|
|
197
|
+
- configurable request/header/keep-alive/shutdown timeouts
|
|
198
|
+
- `SIGTERM` / `SIGINT` graceful shutdown
|
|
199
|
+
- application shutdown hooks
|
|
200
|
+
- trusted-proxy forwarding-header controls
|
|
150
201
|
|
|
151
202
|
### Storage & Uploads
|
|
152
203
|
|
|
153
|
-
- buffered multipart
|
|
204
|
+
- buffered multipart upload APIs
|
|
154
205
|
- production streaming multipart upload (`storeMultipartFile()`)
|
|
155
206
|
- backward-compatible `StorageAdapter` contract
|
|
156
207
|
- local filesystem storage
|
|
157
|
-
- S3/R2/MinIO-compatible storage
|
|
208
|
+
- Amazon S3 / Cloudflare R2 / MinIO-compatible storage
|
|
158
209
|
- streaming reads/writes and byte ranges
|
|
159
210
|
- ETag/Last-Modified file delivery
|
|
160
211
|
- upload/storage limits and abort cleanup
|
|
161
212
|
- object listing with cursors
|
|
162
|
-
-
|
|
213
|
+
- copy and move
|
|
163
214
|
- portable user metadata
|
|
164
215
|
- bulk deletion
|
|
165
216
|
- S3 presigned read/write URLs
|
|
217
|
+
- create-app Local Server / Amazon S3 / Cloudflare R2 presets
|
|
166
218
|
|
|
167
219
|
### Database
|
|
168
220
|
|
|
@@ -172,76 +224,61 @@ bcp/middleware
|
|
|
172
224
|
- transactions
|
|
173
225
|
- migrations/status/rollback
|
|
174
226
|
|
|
175
|
-
### Developer Experience
|
|
227
|
+
### Developer Experience — 0.1.29
|
|
176
228
|
|
|
177
229
|
- `create-bcp-app`
|
|
230
|
+
- non-secret `bcp.project.json`
|
|
231
|
+
- `bcp generate page`
|
|
232
|
+
- `bcp generate api`
|
|
233
|
+
- `bcp generate middleware`
|
|
234
|
+
- `bcp generate migration`
|
|
178
235
|
- `bcp update`
|
|
179
|
-
-
|
|
180
|
-
-
|
|
236
|
+
- Doctor/Inspect v2
|
|
237
|
+
- lockfile/package-manager diagnostics
|
|
238
|
+
- duplicate framework declaration checks
|
|
239
|
+
- storage/provider diagnostics
|
|
240
|
+
- production-build/Docker/hardening diagnostics
|
|
181
241
|
- Windows-safe `bcp-framework` alias
|
|
182
|
-
-
|
|
183
|
-
- unit/integration/E2E/package/RC checks
|
|
184
|
-
|
|
185
|
-
## BCP 0.1.27 documentation focus
|
|
242
|
+
- `docs/docs-web-manifest.json`
|
|
186
243
|
|
|
187
|
-
|
|
244
|
+
## BCP 0.1.29 documentation focus
|
|
188
245
|
|
|
189
|
-
|
|
246
|
+
### Project generators
|
|
190
247
|
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
deleteStorageObjects,
|
|
197
|
-
getStorageEcosystemCapabilities,
|
|
198
|
-
getStorageMetadata,
|
|
199
|
-
listStorageObjects,
|
|
200
|
-
moveStorageObject,
|
|
201
|
-
setStorageMetadata,
|
|
202
|
-
} from "bcp/server";
|
|
248
|
+
```bash
|
|
249
|
+
bcp generate page dashboard/users
|
|
250
|
+
bcp generate api users
|
|
251
|
+
bcp generate middleware
|
|
252
|
+
bcp generate migration create_users
|
|
203
253
|
```
|
|
204
254
|
|
|
205
|
-
|
|
255
|
+
Page/API/middleware generation requires `--force` before replacing existing target files.
|
|
256
|
+
|
|
257
|
+
See `generators.md`.
|
|
258
|
+
|
|
259
|
+
### Doctor / Inspect v2
|
|
206
260
|
|
|
207
|
-
-
|
|
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.
|
|
261
|
+
Doctor adds deployment/project-health checks without removing previous checks. Inspect keeps its previous JSON fields and adds a `project` object containing lockfile, package manager, project metadata/presets, build presence, Dockerfile, framework declarations, storage provider and hardening status.
|
|
215
262
|
|
|
216
|
-
See `
|
|
263
|
+
See `developer-tools.md`.
|
|
217
264
|
|
|
218
|
-
###
|
|
265
|
+
### Project metadata
|
|
219
266
|
|
|
220
|
-
`
|
|
267
|
+
New `create-bcp-app` projects receive:
|
|
221
268
|
|
|
222
269
|
```text
|
|
223
|
-
|
|
224
|
-
CopyObject
|
|
225
|
-
DeleteObjects
|
|
226
|
-
presigned GetObject
|
|
227
|
-
presigned PutObject
|
|
228
|
-
application metadata
|
|
270
|
+
bcp.project.json
|
|
229
271
|
```
|
|
230
272
|
|
|
231
|
-
|
|
273
|
+
The file records scaffold choices only and must never contain credentials/secrets.
|
|
232
274
|
|
|
233
|
-
|
|
275
|
+
See `project-metadata.md`.
|
|
234
276
|
|
|
235
|
-
|
|
277
|
+
### Docs-web contract
|
|
236
278
|
|
|
237
|
-
|
|
238
|
-
putStorageStream()
|
|
239
|
-
readStorageStream()
|
|
240
|
-
storeMultipartFile()
|
|
241
|
-
createStorageResponse()
|
|
242
|
-
```
|
|
279
|
+
`docs/docs-web-manifest.json` is intended to be consumed directly by `bcp-docs-web` for navigation and route generation.
|
|
243
280
|
|
|
244
|
-
|
|
281
|
+
The website should still read the Markdown source referenced by each manifest page entry.
|
|
245
282
|
|
|
246
283
|
## CLI commands
|
|
247
284
|
|
|
@@ -250,6 +287,10 @@ bcp dev
|
|
|
250
287
|
bcp routes
|
|
251
288
|
bcp build
|
|
252
289
|
bcp start
|
|
290
|
+
bcp generate page dashboard/users
|
|
291
|
+
bcp generate api users
|
|
292
|
+
bcp generate middleware
|
|
293
|
+
bcp generate migration create_users
|
|
253
294
|
bcp doctor
|
|
254
295
|
bcp doctor --json
|
|
255
296
|
bcp inspect
|
|
@@ -268,6 +309,7 @@ On Windows, direct project-local commands should prefer:
|
|
|
268
309
|
```powershell
|
|
269
310
|
npm exec -- bcp-framework doctor
|
|
270
311
|
npm exec -- bcp-framework inspect
|
|
312
|
+
npm exec -- bcp-framework generate page dashboard/users
|
|
271
313
|
npm exec -- bcp-framework dev
|
|
272
314
|
npm exec -- bcp-framework build
|
|
273
315
|
```
|
|
@@ -282,15 +324,15 @@ Release notes live under:
|
|
|
282
324
|
docs/releases/
|
|
283
325
|
```
|
|
284
326
|
|
|
285
|
-
|
|
327
|
+
The docs-web manifest currently maps:
|
|
286
328
|
|
|
287
329
|
```text
|
|
330
|
+
/releases/0.1.29
|
|
331
|
+
/releases/0.1.28
|
|
288
332
|
/releases/0.1.27
|
|
289
333
|
/releases/0.1.26
|
|
290
334
|
/releases/0.1.25
|
|
291
335
|
/releases/0.1.24
|
|
292
|
-
/releases/0.1.23
|
|
293
|
-
/releases/0.1.22
|
|
294
336
|
```
|
|
295
337
|
|
|
296
338
|
Use one of these release states:
|
|
@@ -303,27 +345,49 @@ unreleased development target
|
|
|
303
345
|
|
|
304
346
|
The existence of a release note alone does not mean the npm version is published.
|
|
305
347
|
|
|
306
|
-
## Suggested
|
|
348
|
+
## Suggested docs-web implementation
|
|
349
|
+
|
|
350
|
+
A simple implementation can model the manifest like:
|
|
307
351
|
|
|
308
352
|
```ts
|
|
309
|
-
interface
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
353
|
+
interface DocsWebManifest {
|
|
354
|
+
schemaVersion: number;
|
|
355
|
+
framework: string;
|
|
356
|
+
versionTarget: string;
|
|
357
|
+
releaseState: string;
|
|
358
|
+
sections: Array<{
|
|
359
|
+
id: string;
|
|
360
|
+
title: string;
|
|
361
|
+
pages: Array<{
|
|
362
|
+
route: string;
|
|
363
|
+
source: string;
|
|
364
|
+
title: string;
|
|
365
|
+
}>;
|
|
366
|
+
}>;
|
|
367
|
+
releases: Array<{
|
|
368
|
+
route: string;
|
|
369
|
+
source: string;
|
|
370
|
+
version: string;
|
|
371
|
+
state?: string;
|
|
372
|
+
}>;
|
|
319
373
|
}
|
|
320
374
|
```
|
|
321
375
|
|
|
322
|
-
|
|
376
|
+
Recommended website behavior:
|
|
377
|
+
|
|
378
|
+
1. Load/validate `docs-web-manifest.json` at build/startup.
|
|
379
|
+
2. Build the sidebar in manifest order.
|
|
380
|
+
3. Resolve each route to its referenced Markdown source.
|
|
381
|
+
4. Generate previous/next links from manifest order.
|
|
382
|
+
5. Index rendered Markdown headings/content for search.
|
|
383
|
+
6. Use `versionTarget` / `releaseState` for the site banner.
|
|
384
|
+
7. Use release entries for the release navigation.
|
|
385
|
+
|
|
386
|
+
Do not expose `bcp.project.json` secrets because the project metadata format is intentionally non-secret; runtime `.env` files should never be ingested into public docs output.
|
|
323
387
|
|
|
324
388
|
## Suggested website features
|
|
325
389
|
|
|
326
|
-
1. Sidebar
|
|
390
|
+
1. Sidebar from `docs-web-manifest.json`.
|
|
327
391
|
2. Markdown rendering + syntax highlighting.
|
|
328
392
|
3. Previous/next navigation.
|
|
329
393
|
4. Version/release-state banner.
|
|
@@ -365,43 +429,36 @@ npm run test:package
|
|
|
365
429
|
npm run rc:check
|
|
366
430
|
```
|
|
367
431
|
|
|
368
|
-
For `0.1.
|
|
369
|
-
|
|
370
|
-
```text
|
|
371
|
-
@aws-sdk/client-s3
|
|
372
|
-
@aws-sdk/lib-storage
|
|
373
|
-
@aws-sdk/s3-request-presigner
|
|
374
|
-
busboy
|
|
375
|
-
```
|
|
432
|
+
For `0.1.29`, validation should cover project generators, Doctor/Inspect v2, create-app project metadata, the existing production hardening runtime and package preparation.
|
|
376
433
|
|
|
377
|
-
|
|
434
|
+
The release lockfile must be synchronized to `0.1.29` before the final tag.
|
|
378
435
|
|
|
379
436
|
## Documentation QA checklist
|
|
380
437
|
|
|
381
|
-
-
|
|
382
|
-
-
|
|
438
|
+
- every manifest Markdown source exists,
|
|
439
|
+
- every manifest route is unique,
|
|
440
|
+
- examples use public exports/CLI commands,
|
|
383
441
|
- version/release states are current,
|
|
384
442
|
- Windows direct CLI examples use `npm exec -- bcp-framework`,
|
|
385
443
|
- upload/storage/auth security caveats are present,
|
|
386
|
-
- route names match the current router,
|
|
387
444
|
- release notes match the framework version,
|
|
388
445
|
- S3 credentials are never shown as public browser variables,
|
|
389
|
-
-
|
|
390
|
-
-
|
|
446
|
+
- project metadata remains non-secret,
|
|
447
|
+
- proxy trust remains documented as opt-in,
|
|
448
|
+
- roadmap APIs are not presented as release guarantees.
|
|
391
449
|
|
|
392
|
-
## Next direction after 0.1.
|
|
450
|
+
## Next direction after 0.1.29
|
|
393
451
|
|
|
394
|
-
Planned
|
|
452
|
+
Planned **`0.2.0 — Framework Platform`** focus:
|
|
395
453
|
|
|
396
|
-
-
|
|
397
|
-
-
|
|
398
|
-
-
|
|
399
|
-
-
|
|
400
|
-
-
|
|
401
|
-
-
|
|
402
|
-
- startup/runtime dependency diagnostics.
|
|
454
|
+
- consolidate public API naming/behavior,
|
|
455
|
+
- document compatibility expectations,
|
|
456
|
+
- stabilize supported production deployment paths,
|
|
457
|
+
- complete docs-web integration and documentation coverage,
|
|
458
|
+
- publish migration guidance for pre-`0.2.0` applications,
|
|
459
|
+
- establish a platform baseline before broader feature expansion.
|
|
403
460
|
|
|
404
|
-
These remain roadmap
|
|
461
|
+
These remain roadmap goals until their source/tests land.
|
|
405
462
|
|
|
406
463
|
## Repository authority
|
|
407
464
|
|
|
@@ -411,7 +468,8 @@ The framework repository remains authoritative for:
|
|
|
411
468
|
source
|
|
412
469
|
public exports
|
|
413
470
|
tests
|
|
414
|
-
docs
|
|
471
|
+
Markdown docs
|
|
472
|
+
docs-web manifest
|
|
415
473
|
release notes
|
|
416
474
|
```
|
|
417
475
|
|