@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.
@@ -0,0 +1,173 @@
1
+ # Migrating to BCP Framework 0.2.0
2
+
3
+ BCP Framework `0.2.0` establishes the Framework Platform baseline while preserving the public application model from `0.1.29`.
4
+
5
+ > **Release state:** unreleased development target until RC validation and npm publication complete.
6
+
7
+ ## Compatibility goal
8
+
9
+ There are no intentional public-entrypoint removals from the `0.1.29` baseline in this milestone.
10
+
11
+ Applications already running on `0.1.29` should normally be able to move to `0.2.0` without rewriting routing, loaders, guards, actions, middleware, storage or authentication code.
12
+
13
+ BCP remains pre-1.0, so every application should still validate the upgrade before production deployment.
14
+
15
+ ## 1. Check the current project
16
+
17
+ From the application root:
18
+
19
+ ```powershell
20
+ npm exec -- bcp-framework doctor
21
+ npm exec -- bcp-framework inspect --json
22
+ ```
23
+
24
+ Resolve blocking `FAIL` results before upgrading, especially duplicate framework dependency declarations or invalid production-hardening settings.
25
+
26
+ ## 2. Check the available framework update
27
+
28
+ ```powershell
29
+ npm exec -- bcp-framework update --check
30
+ ```
31
+
32
+ After `0.2.0` is published, update with:
33
+
34
+ ```powershell
35
+ npm exec -- bcp-framework update 0.2.0
36
+ ```
37
+
38
+ Generated projects can also use:
39
+
40
+ ```powershell
41
+ npm run update -- 0.2.0
42
+ ```
43
+
44
+ ## 3. Keep one framework dependency
45
+
46
+ The recommended project dependency remains:
47
+
48
+ ```json
49
+ {
50
+ "dependencies": {
51
+ "bcp": "npm:@chidchanun/bcp@0.2.0"
52
+ }
53
+ }
54
+ ```
55
+
56
+ Do not keep both `bcp` and a second direct `@chidchanun/bcp` dependency in the same application. Two installed framework copies can produce separate React/framework contexts.
57
+
58
+ ## 4. Preserve server-only boundaries
59
+
60
+ Continue importing public APIs through supported entrypoints such as:
61
+
62
+ ```ts
63
+ import {
64
+ Form,
65
+ } from "bcp";
66
+
67
+ import {
68
+ auth,
69
+ } from "bcp/auth";
70
+
71
+ import {
72
+ db,
73
+ } from "bcp/database";
74
+
75
+ import {
76
+ cookies,
77
+ } from "bcp/server";
78
+ ```
79
+
80
+ Do not migrate application imports to framework-internal `packages/...` paths.
81
+
82
+ The current public entrypoint baseline is listed in `platform-manifest.json` and [Framework Platform Contract](platform-contract.md).
83
+
84
+ ## 5. Validate generated-project metadata
85
+
86
+ Projects created by `create-bcp-app` `0.1.29` or newer may contain:
87
+
88
+ ```text
89
+ bcp.project.json
90
+ ```
91
+
92
+ This file is optional runtime metadata. Older applications do not need to create it manually to run on `0.2.0`.
93
+
94
+ If you choose to add it to an older application, keep it non-secret. Credentials, passwords, access keys, session secrets and tokens do not belong in this file.
95
+
96
+ ## 6. Validate production settings
97
+
98
+ For standalone production, review:
99
+
100
+ ```dotenv
101
+ BCP_REQUEST_TIMEOUT_MS=120000
102
+ BCP_HEADERS_TIMEOUT_MS=66000
103
+ BCP_KEEP_ALIVE_TIMEOUT_MS=65000
104
+ BCP_SHUTDOWN_TIMEOUT_MS=10000
105
+ BCP_TRUST_PROXY=false
106
+ ```
107
+
108
+ Only enable:
109
+
110
+ ```dotenv
111
+ BCP_TRUST_PROXY=true
112
+ ```
113
+
114
+ when the BCP process is reachable only through a trusted reverse proxy/load balancer.
115
+
116
+ ## 7. Rebuild the standalone artifact
117
+
118
+ Do not reuse `.bcp-framework/build` from the previous framework version.
119
+
120
+ Run:
121
+
122
+ ```powershell
123
+ npm run build
124
+ ```
125
+
126
+ Then test:
127
+
128
+ ```powershell
129
+ npm start
130
+ ```
131
+
132
+ The supported `0.2.0` production target remains the standalone Node.js artifact under `.bcp-framework/build/`.
133
+
134
+ ## 8. Application validation checklist
135
+
136
+ Recommended minimum after upgrading:
137
+
138
+ ```powershell
139
+ npm run typecheck
140
+ npm run build
141
+ npm exec -- bcp-framework routes
142
+ npm exec -- bcp-framework doctor
143
+ ```
144
+
145
+ For applications using authentication, storage or database features, also exercise representative login/session, upload/download and database paths before production deployment.
146
+
147
+ ## Local storage projects
148
+
149
+ Projects using the Local Server storage preset should keep the scaffold:
150
+
151
+ ```text
152
+ storage/
153
+ ├─ .gitkeep
154
+ └─ README.md
155
+ ```
156
+
157
+ Runtime storage objects remain ignored by Git.
158
+
159
+ ## Amazon S3 / Cloudflare R2 projects
160
+
161
+ No provider migration is required for the `0.2.0` platform baseline. Existing `createS3Storage()` configurations continue using server-only credentials/environment settings.
162
+
163
+ ## What is not part of this migration
164
+
165
+ `0.2.0` does not introduce native executable compilation, desktop packaging, Android APK output or iOS application output.
166
+
167
+ The supported build model remains:
168
+
169
+ ```text
170
+ BCP application -> bcp build -> standalone Node.js web application
171
+ ```
172
+
173
+ Future build targets can be added after the platform baseline without redefining the existing standalone contract.
@@ -0,0 +1,159 @@
1
+ # Framework Platform Contract
2
+
3
+ BCP Framework `0.2.0` establishes the first explicit framework-platform baseline. The goal is to make public entrypoints, supported runtime targets, CLI capabilities and documentation metadata visible and testable instead of relying on implicit package structure.
4
+
5
+ > **Release state:** unreleased development target until local RC validation, tagging and npm publication complete.
6
+
7
+ ## What the platform contract covers
8
+
9
+ The platform contract is represented by `docs/platform-manifest.json` and release/package smoke tests.
10
+
11
+ It records:
12
+
13
+ - the framework version and release state,
14
+ - the minimum supported Node.js runtime,
15
+ - the supported production build target,
16
+ - public package entrypoints,
17
+ - documented CLI command families,
18
+ - framework capability groups,
19
+ - built-in/scaffolded storage-provider families,
20
+ - compatibility expectations for the previous baseline,
21
+ - documentation files used by `bcp-docs-web`.
22
+
23
+ The manifest is metadata. Framework source, package exports and tests remain authoritative for actual runtime behavior.
24
+
25
+ ## Public entrypoints
26
+
27
+ The `0.2.0` platform baseline recognizes these public application imports:
28
+
29
+ ```text
30
+ bcp
31
+ bcp/island
32
+ bcp/cache
33
+ bcp/config
34
+ bcp/validation
35
+ bcp/error
36
+ bcp/database
37
+ bcp/auth
38
+ bcp/server
39
+ bcp/server-only
40
+ bcp/middleware
41
+ ```
42
+
43
+ Application code should prefer these entrypoints instead of importing internal files under `packages/`.
44
+
45
+ The release package contract smoke test verifies that the prepared npm artifact still exposes these entrypoints. Accidentally removing one from the publish manifest should fail package validation before release.
46
+
47
+ ## CLI baseline
48
+
49
+ The framework-platform CLI baseline includes:
50
+
51
+ ```text
52
+ bcp dev
53
+ bcp build
54
+ bcp start
55
+ bcp routes
56
+ bcp update
57
+ bcp db ...
58
+ bcp generate ...
59
+ bcp doctor
60
+ bcp inspect
61
+ bcp help
62
+ bcp version
63
+ ```
64
+
65
+ The Windows-safe `bcp-framework` executable remains an alias for the same CLI.
66
+
67
+ ## Runtime baseline
68
+
69
+ BCP `0.2.0` continues to target a standalone Node.js web application:
70
+
71
+ ```text
72
+ BCP source application
73
+
74
+ bcp build
75
+
76
+ .bcp-framework/build/
77
+ ├─ client/
78
+ ├─ public/
79
+ └─ server/
80
+ └─ server.mjs
81
+ ```
82
+
83
+ Minimum runtime:
84
+
85
+ ```text
86
+ Node.js >= 24.11.0
87
+ React 19
88
+ ```
89
+
90
+ The platform baseline does not yet promise native `.exe`, mobile or desktop application compilation. Those remain future build-target work rather than part of `0.2.0`.
91
+
92
+ ## Compatibility policy for 0.2.0
93
+
94
+ `0.2.0` is intended to preserve applications that already work on `0.1.29`. This milestone does not intentionally remove public entrypoints or change the current standalone runtime model.
95
+
96
+ Because BCP remains pre-1.0, applications should still validate upgrades through:
97
+
98
+ ```bash
99
+ bcp update --check
100
+ bcp doctor
101
+ npm run typecheck
102
+ npm run build
103
+ ```
104
+
105
+ See [Migrating to 0.2.0](migration-0.2.md).
106
+
107
+ ## Package consistency validation
108
+
109
+ The `0.2.0` release process adds a platform-contract package smoke check. It verifies the staged npm artifact rather than only source files.
110
+
111
+ The check covers:
112
+
113
+ 1. framework version consistency,
114
+ 2. required public package exports,
115
+ 3. both BCP CLI executable aliases,
116
+ 4. minimum Node.js engine declaration,
117
+ 5. inclusion of platform/docs metadata in the packed framework,
118
+ 6. docs-web target/version consistency,
119
+ 7. create-bcp-app version parity with the framework release.
120
+
121
+ This is additive to existing unit, integration, E2E, storage, production-hardening and Developer Experience package smoke checks.
122
+
123
+ ## Docs-web contract
124
+
125
+ `bcp-docs-web` should use two machine-readable files for different purposes:
126
+
127
+ ```text
128
+ docs/docs-web-manifest.json
129
+ -> website sections, routes, source Markdown and release navigation
130
+
131
+ docs/platform-manifest.json
132
+ -> framework version, public entrypoints, runtime target and capability metadata
133
+ ```
134
+
135
+ Do not duplicate the platform entrypoint list in application code when it can be sourced from `platform-manifest.json`.
136
+
137
+ ## Stability labels
138
+
139
+ Documentation should distinguish:
140
+
141
+ - **platform baseline** — public surface covered by the `0.2.0` contract,
142
+ - **supported** — behavior covered by current tests/docs,
143
+ - **experimental/roadmap** — not guaranteed by the current platform manifest,
144
+ - **internal** — not a public application import contract.
145
+
146
+ ## Release validation
147
+
148
+ Before `0.2.0` is tagged or published:
149
+
150
+ ```bash
151
+ npm run typecheck
152
+ npm run test:unit
153
+ npm run test:integration
154
+ npm run test:package
155
+ npm run test:e2e
156
+ npm run rc:check
157
+ ```
158
+
159
+ The release is not considered published until both `@chidchanun/bcp@0.2.0` and `create-bcp-app@0.2.0` are visible from npm.
@@ -0,0 +1,75 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "framework": "bcp",
4
+ "version": "0.2.0",
5
+ "releaseState": "unreleased",
6
+ "baseline": "framework-platform",
7
+ "runtime": {
8
+ "node": ">=24.11.0",
9
+ "react": "19",
10
+ "buildTarget": "standalone-node"
11
+ },
12
+ "publicEntrypoints": [
13
+ "bcp",
14
+ "bcp/island",
15
+ "bcp/cache",
16
+ "bcp/config",
17
+ "bcp/validation",
18
+ "bcp/error",
19
+ "bcp/database",
20
+ "bcp/auth",
21
+ "bcp/server",
22
+ "bcp/server-only",
23
+ "bcp/middleware"
24
+ ],
25
+ "cliCommands": [
26
+ "dev",
27
+ "build",
28
+ "start",
29
+ "routes",
30
+ "update",
31
+ "db",
32
+ "generate",
33
+ "doctor",
34
+ "inspect",
35
+ "help",
36
+ "version"
37
+ ],
38
+ "capabilities": {
39
+ "routing": true,
40
+ "ssr": true,
41
+ "spaNavigation": true,
42
+ "loaders": true,
43
+ "routeGuards": true,
44
+ "formActions": true,
45
+ "middlewareV2": true,
46
+ "jwtCookieSessions": true,
47
+ "databaseMigrations": true,
48
+ "validation": true,
49
+ "structuredErrors": true,
50
+ "logging": true,
51
+ "responseCaching": true,
52
+ "streamingUploads": true,
53
+ "storageEcosystem": true,
54
+ "productionHardening": true,
55
+ "projectGenerators": true,
56
+ "projectDiagnostics": true
57
+ },
58
+ "storageProviders": [
59
+ "local",
60
+ "amazon-s3",
61
+ "cloudflare-r2",
62
+ "s3-compatible"
63
+ ],
64
+ "compatibility": {
65
+ "previousBaseline": "0.1.29",
66
+ "intentionalBreakingChangesFromPreviousBaseline": false,
67
+ "migrationGuide": "migration-0.2.md"
68
+ },
69
+ "documentation": {
70
+ "navigationManifest": "docs-web-manifest.json",
71
+ "platformContract": "platform-contract.md",
72
+ "migrationGuide": "migration-0.2.md",
73
+ "releaseNotes": "releases/0.2.0.md"
74
+ }
75
+ }
@@ -0,0 +1,112 @@
1
+ # Project Metadata
2
+
3
+ BCP Framework `0.1.29` makes generated project presets explicit through `bcp.project.json`.
4
+
5
+ `create-bcp-app` writes this file after applying the selected project options.
6
+
7
+ Example:
8
+
9
+ ```json
10
+ {
11
+ "schemaVersion": 1,
12
+ "framework": "bcp",
13
+ "projectName": "my-app",
14
+ "frameworkPackage": "npm:@chidchanun/bcp@0.1.29",
15
+ "createdWith": {
16
+ "package": "create-bcp-app",
17
+ "version": "0.1.29"
18
+ },
19
+ "packageManager": "npm",
20
+ "presets": {
21
+ "tailwind": true,
22
+ "database": "mysql",
23
+ "auth": "jwt-cookie",
24
+ "storage": "cloudflare-r2"
25
+ }
26
+ }
27
+ ```
28
+
29
+ ## Purpose
30
+
31
+ The metadata file records scaffold choices without requiring later tools to infer them from source code.
32
+
33
+ It is intended for:
34
+
35
+ - `bcp doctor`,
36
+ - `bcp inspect`,
37
+ - project migration/update tooling,
38
+ - documentation tooling,
39
+ - `bcp-docs-web` examples and project-aware guidance,
40
+ - future framework upgrade diagnostics.
41
+
42
+ ## Security boundary
43
+
44
+ `bcp.project.json` must not contain credentials or runtime secrets.
45
+
46
+ It records only non-secret configuration identities such as:
47
+
48
+ ```text
49
+ Tailwind enabled/disabled
50
+ Database preset name
51
+ Auth preset name
52
+ Storage provider name
53
+ Package manager
54
+ Framework package specifier
55
+ create-bcp-app version
56
+ ```
57
+
58
+ Do not add values such as:
59
+
60
+ ```text
61
+ AWS_ACCESS_KEY_ID
62
+ AWS_SECRET_ACCESS_KEY
63
+ R2_ACCESS_KEY_ID
64
+ R2_SECRET_ACCESS_KEY
65
+ DATABASE_URL
66
+ passwords
67
+ JWT secrets
68
+ session tokens
69
+ ```
70
+
71
+ Runtime configuration stays in environment variables and server-only configuration.
72
+
73
+ ## Schema version
74
+
75
+ The initial format uses:
76
+
77
+ ```json
78
+ {
79
+ "schemaVersion": 1
80
+ }
81
+ ```
82
+
83
+ Consumers should check `schemaVersion` before relying on optional metadata fields.
84
+
85
+ Unknown future fields should normally be ignored so newer `create-bcp-app` versions remain compatible with older tooling where practical.
86
+
87
+ ## Storage provider metadata
88
+
89
+ Storage choices currently include:
90
+
91
+ ```text
92
+ none
93
+ local
94
+ amazon-s3
95
+ cloudflare-r2
96
+ ```
97
+
98
+ `bcp inspect` can use the metadata first and fall back to inspecting `lib/storage.ts` for older projects without `bcp.project.json`.
99
+
100
+ ## Existing projects
101
+
102
+ Projects created before `0.1.29` do not need this file to keep running.
103
+
104
+ The metadata file is additive. Doctor/inspect can still infer core project information from `package.json`, lockfiles, routes and generated source where possible.
105
+
106
+ If an older project wants to adopt the file manually, keep the schema minimal and do not invent preset values that are not actually in use.
107
+
108
+ ## Source control
109
+
110
+ `bcp.project.json` should normally be committed to source control because it contains project structure metadata, not secrets.
111
+
112
+ This allows CI and documentation tooling to read the same preset identity as local developer tooling.
@@ -0,0 +1,170 @@
1
+ # BCP Framework 0.1.29
2
+
3
+ > **Milestone:** Developer Experience
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.1.29` focuses on reducing repetitive project setup and making project diagnostics easier to consume locally, in CI and in `bcp-docs-web`.
8
+
9
+ ## Highlights
10
+
11
+ ### Project generators
12
+
13
+ New CLI command:
14
+
15
+ ```bash
16
+ bcp generate <kind>
17
+ ```
18
+
19
+ Supported generators:
20
+
21
+ ```bash
22
+ bcp generate page dashboard/users
23
+ bcp generate api users
24
+ bcp generate middleware
25
+ bcp generate migration create_users
26
+ ```
27
+
28
+ Page, API and middleware generators refuse to replace existing files unless `--force` is explicitly supplied.
29
+
30
+ Migration generation reuses the existing database migration implementation so timestamp/file naming has a single source of truth.
31
+
32
+ ### Doctor / Inspect v2
33
+
34
+ `bcp doctor` now adds project/runtime checks for:
35
+
36
+ - supported dependency lockfiles,
37
+ - duplicate `bcp` / `@chidchanun/bcp` dependency declarations,
38
+ - production hardening environment validity,
39
+ - standalone production build presence,
40
+ - Docker + lockfile reproducibility guidance,
41
+ - configured storage provider detection.
42
+
43
+ `bcp inspect` keeps its previous report fields and adds a `project` section with:
44
+
45
+ ```text
46
+ package manager
47
+ lockfile
48
+ bcp.project.json metadata
49
+ selected create-bcp-app presets
50
+ production build presence
51
+ Dockerfile presence
52
+ framework dependency declarations
53
+ storage provider
54
+ production hardening state
55
+ ```
56
+
57
+ The new fields are additive so existing consumers of the previous JSON fields can continue reading them.
58
+
59
+ ### `bcp.project.json`
60
+
61
+ New projects created by `create-bcp-app` receive a non-secret metadata manifest:
62
+
63
+ ```json
64
+ {
65
+ "schemaVersion": 1,
66
+ "framework": "bcp",
67
+ "projectName": "my-app",
68
+ "createdWith": {
69
+ "package": "create-bcp-app",
70
+ "version": "0.1.29"
71
+ },
72
+ "packageManager": "npm",
73
+ "presets": {
74
+ "tailwind": true,
75
+ "database": "mysql",
76
+ "auth": "jwt-cookie",
77
+ "storage": "local"
78
+ }
79
+ }
80
+ ```
81
+
82
+ The manifest records scaffold identity only. Credentials, passwords, access keys, session secrets and tokens must remain outside this file.
83
+
84
+ Older projects without `bcp.project.json` continue to work. Doctor/inspect fall back to project files where practical.
85
+
86
+ ### Docs-web manifest
87
+
88
+ `docs/docs-web-manifest.json` is now the explicit navigation contract for `bcp-docs-web`.
89
+
90
+ It maps:
91
+
92
+ ```text
93
+ section
94
+ website route
95
+ Markdown source
96
+ title
97
+ release routes
98
+ version target
99
+ release state
100
+ ```
101
+
102
+ The Markdown files under `docs/` remain the authored documentation source of truth. The JSON manifest is navigation/routing metadata, not a competing content source.
103
+
104
+ New authored guides include:
105
+
106
+ - `docs/generators.md`
107
+ - `docs/project-metadata.md`
108
+
109
+ ## Compatibility
110
+
111
+ `0.1.29` is intended to be additive.
112
+
113
+ - Existing page/API routing remains unchanged.
114
+ - Existing database migration commands remain supported.
115
+ - `bcp doctor` retains its existing report structure and adds checks.
116
+ - `bcp inspect` retains its existing fields and adds `project`.
117
+ - Existing projects do not require `bcp.project.json`.
118
+ - `--force` is opt-in and never silently overwrites existing generated files.
119
+
120
+ ## Out of scope
121
+
122
+ The following are not guarantees of `0.1.29`:
123
+
124
+ - generated symbol/API reference documentation,
125
+ - interactive documentation playgrounds,
126
+ - source-code merge behavior for generators,
127
+ - automatic conversion of old projects into `bcp.project.json`,
128
+ - the `0.2.0` API/platform stability baseline.
129
+
130
+ ## Documentation sources
131
+
132
+ Primary documentation for this milestone:
133
+
134
+ ```text
135
+ docs/generators.md
136
+ docs/developer-tools.md
137
+ docs/project-metadata.md
138
+ docs/docs-web-manifest.json
139
+ docs/README.md
140
+ ```
141
+
142
+ ## Validation
143
+
144
+ Before tagging or publishing `0.1.29`, run:
145
+
146
+ ```powershell
147
+ npm run typecheck
148
+ npm run test:unit
149
+ npm run test:integration
150
+ npm run test:package
151
+ npm run test:e2e
152
+ npm run rc:check
153
+ ```
154
+
155
+ The release lockfile must also be synchronized to `0.1.29` before the final tag.
156
+
157
+ Recommended generator smoke checks:
158
+
159
+ ```powershell
160
+ npm exec -- bcp-framework generate page dx-test --root examples/basic-app
161
+ npm exec -- bcp-framework routes --root examples/basic-app
162
+ ```
163
+
164
+ Use a disposable project for destructive `--force` testing.
165
+
166
+ ## Next direction
167
+
168
+ After `0.1.29`, the planned major milestone is **`0.2.0 — Framework Platform`**.
169
+
170
+ The `0.2.0` work should focus on consolidating the existing `0.1.x` surface into a documented platform baseline: API consistency, production stabilization, documentation completeness, migration guidance and compatibility expectations rather than adding unrelated large feature areas.