@chidchanun/bcp 0.1.28 → 0.2.0
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 +220 -256
- package/docs/README.md +257 -241
- package/docs/developer-tools.md +175 -78
- package/docs/docs-web-manifest.json +97 -0
- package/docs/generators.md +149 -0
- package/docs/migration-0.2.md +173 -0
- package/docs/platform-contract.md +159 -0
- package/docs/platform-manifest.json +75 -0
- package/docs/project-metadata.md +112 -0
- package/docs/releases/0.1.29.md +170 -0
- package/docs/releases/0.2.0.md +146 -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
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# BCP Framework 0.2.0
|
|
2
|
+
|
|
3
|
+
> **Milestone:** Framework Platform
|
|
4
|
+
>
|
|
5
|
+
> **Release state:** unreleased development target. Do not mark this version as published until local validation, RC checks, tagging and npm publication complete.
|
|
6
|
+
|
|
7
|
+
BCP Framework `0.2.0` establishes an explicit platform baseline for the public package surface, runtime target, CLI families and documentation metadata built across the `0.1.x` releases.
|
|
8
|
+
|
|
9
|
+
## Highlights
|
|
10
|
+
|
|
11
|
+
### Framework platform manifest
|
|
12
|
+
|
|
13
|
+
New machine-readable source:
|
|
14
|
+
|
|
15
|
+
```text
|
|
16
|
+
docs/platform-manifest.json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
It records:
|
|
20
|
+
|
|
21
|
+
- framework version/release state,
|
|
22
|
+
- minimum Node.js and React baseline,
|
|
23
|
+
- standalone production build target,
|
|
24
|
+
- public application entrypoints,
|
|
25
|
+
- CLI command families,
|
|
26
|
+
- capability groups,
|
|
27
|
+
- storage-provider families,
|
|
28
|
+
- previous-baseline compatibility intent,
|
|
29
|
+
- documentation contract files.
|
|
30
|
+
|
|
31
|
+
The manifest is intended for tooling and `bcp-docs-web`; framework source and tests remain authoritative for runtime behavior.
|
|
32
|
+
|
|
33
|
+
### Public entrypoint contract
|
|
34
|
+
|
|
35
|
+
The platform baseline explicitly recognizes:
|
|
36
|
+
|
|
37
|
+
```text
|
|
38
|
+
bcp
|
|
39
|
+
bcp/island
|
|
40
|
+
bcp/cache
|
|
41
|
+
bcp/config
|
|
42
|
+
bcp/validation
|
|
43
|
+
bcp/error
|
|
44
|
+
bcp/database
|
|
45
|
+
bcp/auth
|
|
46
|
+
bcp/server
|
|
47
|
+
bcp/server-only
|
|
48
|
+
bcp/middleware
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
A new package-stage smoke check validates that prepared npm artifacts preserve the required exports before release.
|
|
52
|
+
|
|
53
|
+
### Package/release consistency
|
|
54
|
+
|
|
55
|
+
The `0.2.0` package validation adds checks for:
|
|
56
|
+
|
|
57
|
+
- framework/create-app version parity,
|
|
58
|
+
- required public exports,
|
|
59
|
+
- `bcp` and `bcp-framework` executable aliases,
|
|
60
|
+
- minimum Node.js engine declaration,
|
|
61
|
+
- inclusion of the platform manifest/contract/migration guide/release notes,
|
|
62
|
+
- docs-web version target consistency.
|
|
63
|
+
|
|
64
|
+
This validation runs in addition to existing runtime, storage, hardening and Developer Experience smoke tests.
|
|
65
|
+
|
|
66
|
+
### Migration guide
|
|
67
|
+
|
|
68
|
+
New guide:
|
|
69
|
+
|
|
70
|
+
```text
|
|
71
|
+
docs/migration-0.2.md
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The `0.2.0` milestone does not intentionally remove public entrypoints from the `0.1.29` baseline. Existing applications should still run normal upgrade validation because BCP remains pre-1.0.
|
|
75
|
+
|
|
76
|
+
### Docs-web platform source
|
|
77
|
+
|
|
78
|
+
`bcp-docs-web` now has two explicit machine-readable framework sources:
|
|
79
|
+
|
|
80
|
+
```text
|
|
81
|
+
docs/docs-web-manifest.json
|
|
82
|
+
-> navigation/routes/Markdown sources
|
|
83
|
+
|
|
84
|
+
docs/platform-manifest.json
|
|
85
|
+
-> version/runtime/public-entrypoint/capability contract
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
The docs-web navigation includes the platform contract and `0.2.0` migration guide.
|
|
89
|
+
|
|
90
|
+
## Runtime/build target
|
|
91
|
+
|
|
92
|
+
The supported production output remains:
|
|
93
|
+
|
|
94
|
+
```text
|
|
95
|
+
.bcp-framework/build/
|
|
96
|
+
├─ client/
|
|
97
|
+
├─ public/
|
|
98
|
+
└─ server/
|
|
99
|
+
└─ server.mjs
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
`0.2.0` does not yet add native `.exe`, desktop or mobile build targets.
|
|
103
|
+
|
|
104
|
+
## Compatibility
|
|
105
|
+
|
|
106
|
+
Compatibility goal from `0.1.29`:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
intentional public-entrypoint removals: none
|
|
110
|
+
standalone runtime model change: none
|
|
111
|
+
create-bcp-app project model change: none required
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Projects should still run:
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
bcp doctor
|
|
118
|
+
npm run typecheck
|
|
119
|
+
npm run build
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
before production deployment after the upgrade.
|
|
123
|
+
|
|
124
|
+
## Documentation
|
|
125
|
+
|
|
126
|
+
New/updated platform documents:
|
|
127
|
+
|
|
128
|
+
- `docs/platform-manifest.json`
|
|
129
|
+
- `docs/platform-contract.md`
|
|
130
|
+
- `docs/migration-0.2.md`
|
|
131
|
+
- `docs/docs-web-manifest.json`
|
|
132
|
+
- `docs/README.md`
|
|
133
|
+
- root `README.md`
|
|
134
|
+
|
|
135
|
+
## Validation required before release
|
|
136
|
+
|
|
137
|
+
```bash
|
|
138
|
+
npm run typecheck
|
|
139
|
+
npm run test:unit
|
|
140
|
+
npm run test:integration
|
|
141
|
+
npm run test:package
|
|
142
|
+
npm run test:e2e
|
|
143
|
+
npm run rc:check
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Do not tag or publish `v0.2.0` until these pass against the final release commit.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chidchanun/bcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "BCP Framework - a React full-stack framework with file-based routing, SSR, APIs, middleware, islands, caching and standalone production builds.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
package/packages/cli/src/args.ts
CHANGED
|
@@ -8,6 +8,7 @@ export type CliCommand =
|
|
|
8
8
|
| "routes"
|
|
9
9
|
| "update"
|
|
10
10
|
| "db"
|
|
11
|
+
| "generate"
|
|
11
12
|
| "doctor"
|
|
12
13
|
| "inspect"
|
|
13
14
|
| "help"
|
|
@@ -20,6 +21,13 @@ export type DatabaseCliAction =
|
|
|
20
21
|
| "create"
|
|
21
22
|
| "help";
|
|
22
23
|
|
|
24
|
+
export type GenerateCliKind =
|
|
25
|
+
| "page"
|
|
26
|
+
| "api"
|
|
27
|
+
| "middleware"
|
|
28
|
+
| "migration"
|
|
29
|
+
| "help";
|
|
30
|
+
|
|
23
31
|
export interface CliOptions {
|
|
24
32
|
command: CliCommand;
|
|
25
33
|
|
|
@@ -37,9 +45,15 @@ export interface CliOptions {
|
|
|
37
45
|
|
|
38
46
|
json?: boolean;
|
|
39
47
|
|
|
48
|
+
force?: boolean;
|
|
49
|
+
|
|
40
50
|
dbAction?: DatabaseCliAction;
|
|
41
51
|
|
|
42
52
|
dbMigrationName?: string;
|
|
53
|
+
|
|
54
|
+
generateKind?: GenerateCliKind;
|
|
55
|
+
|
|
56
|
+
generateName?: string;
|
|
43
57
|
}
|
|
44
58
|
|
|
45
59
|
export function parseCliArgs(
|
|
@@ -68,12 +82,21 @@ export function parseCliArgs(
|
|
|
68
82
|
let json =
|
|
69
83
|
false;
|
|
70
84
|
|
|
85
|
+
let force =
|
|
86
|
+
false;
|
|
87
|
+
|
|
71
88
|
let dbAction:
|
|
72
89
|
DatabaseCliAction | undefined;
|
|
73
90
|
|
|
74
91
|
let dbMigrationName:
|
|
75
92
|
string | undefined;
|
|
76
93
|
|
|
94
|
+
let generateKind:
|
|
95
|
+
GenerateCliKind | undefined;
|
|
96
|
+
|
|
97
|
+
let generateName:
|
|
98
|
+
string | undefined;
|
|
99
|
+
|
|
77
100
|
let commandSet = false;
|
|
78
101
|
|
|
79
102
|
for (
|
|
@@ -92,6 +115,11 @@ export function parseCliArgs(
|
|
|
92
115
|
command === "db"
|
|
93
116
|
) {
|
|
94
117
|
dbAction = "help";
|
|
118
|
+
} else if (
|
|
119
|
+
commandSet &&
|
|
120
|
+
command === "generate"
|
|
121
|
+
) {
|
|
122
|
+
generateKind = "help";
|
|
95
123
|
} else {
|
|
96
124
|
command = "help";
|
|
97
125
|
}
|
|
@@ -224,6 +252,14 @@ export function parseCliArgs(
|
|
|
224
252
|
continue;
|
|
225
253
|
}
|
|
226
254
|
|
|
255
|
+
if (
|
|
256
|
+
argument === "--force"
|
|
257
|
+
) {
|
|
258
|
+
force =
|
|
259
|
+
true;
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
|
|
227
263
|
if (
|
|
228
264
|
argument.startsWith("-")
|
|
229
265
|
) {
|
|
@@ -299,6 +335,45 @@ export function parseCliArgs(
|
|
|
299
335
|
);
|
|
300
336
|
}
|
|
301
337
|
|
|
338
|
+
if (
|
|
339
|
+
commandSet &&
|
|
340
|
+
command === "generate"
|
|
341
|
+
) {
|
|
342
|
+
if (
|
|
343
|
+
generateKind === undefined
|
|
344
|
+
) {
|
|
345
|
+
if (
|
|
346
|
+
argument === "page" ||
|
|
347
|
+
argument === "api" ||
|
|
348
|
+
argument === "middleware" ||
|
|
349
|
+
argument === "migration" ||
|
|
350
|
+
argument === "help"
|
|
351
|
+
) {
|
|
352
|
+
generateKind =
|
|
353
|
+
argument;
|
|
354
|
+
continue;
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
throw new Error(
|
|
358
|
+
`Unknown generator: ${argument}`
|
|
359
|
+
);
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
if (
|
|
363
|
+
generateKind !== "middleware" &&
|
|
364
|
+
generateKind !== "help" &&
|
|
365
|
+
generateName === undefined
|
|
366
|
+
) {
|
|
367
|
+
generateName =
|
|
368
|
+
argument;
|
|
369
|
+
continue;
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
throw new Error(
|
|
373
|
+
`Unexpected argument: ${argument}`
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
302
377
|
if (commandSet) {
|
|
303
378
|
throw new Error(
|
|
304
379
|
`Unexpected argument: ${argument}`
|
|
@@ -312,6 +387,7 @@ export function parseCliArgs(
|
|
|
312
387
|
argument === "routes" ||
|
|
313
388
|
argument === "update" ||
|
|
314
389
|
argument === "db" ||
|
|
390
|
+
argument === "generate" ||
|
|
315
391
|
argument === "doctor" ||
|
|
316
392
|
argument === "inspect" ||
|
|
317
393
|
argument === "help" ||
|
|
@@ -349,6 +425,15 @@ export function parseCliArgs(
|
|
|
349
425
|
);
|
|
350
426
|
}
|
|
351
427
|
|
|
428
|
+
if (
|
|
429
|
+
force &&
|
|
430
|
+
command !== "generate"
|
|
431
|
+
) {
|
|
432
|
+
throw new Error(
|
|
433
|
+
"Option --force is only valid with `bcp generate`."
|
|
434
|
+
);
|
|
435
|
+
}
|
|
436
|
+
|
|
352
437
|
return {
|
|
353
438
|
command,
|
|
354
439
|
rootDirectory,
|
|
@@ -362,12 +447,23 @@ export function parseCliArgs(
|
|
|
362
447
|
json: true,
|
|
363
448
|
}
|
|
364
449
|
: {}),
|
|
450
|
+
...(force
|
|
451
|
+
? {
|
|
452
|
+
force: true,
|
|
453
|
+
}
|
|
454
|
+
: {}),
|
|
365
455
|
...(command === "db"
|
|
366
456
|
? {
|
|
367
457
|
dbAction,
|
|
368
458
|
dbMigrationName,
|
|
369
459
|
}
|
|
370
460
|
: {}),
|
|
461
|
+
...(command === "generate"
|
|
462
|
+
? {
|
|
463
|
+
generateKind,
|
|
464
|
+
generateName,
|
|
465
|
+
}
|
|
466
|
+
: {}),
|
|
371
467
|
};
|
|
372
468
|
}
|
|
373
469
|
|