create-bcp-app 0.2.3 → 0.2.4

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 CHANGED
@@ -19,6 +19,7 @@ Generated npm scripts use `bcp` because npm places `node_modules/.bin` on the sc
19
19
  "scripts": {
20
20
  "dev": "bcp dev",
21
21
  "build": "bcp build",
22
+ "package": "bcp package",
22
23
  "start": "bcp start",
23
24
  "routes": "bcp routes",
24
25
  "generate": "bcp generate",
@@ -27,6 +28,16 @@ Generated npm scripts use `bcp` because npm places `node_modules/.bin` on the sc
27
28
  }
28
29
  ```
29
30
 
31
+ When Tailwind CSS is selected, the generated packaging script preserves the production CSS step:
32
+
33
+ ```json
34
+ {
35
+ "scripts": {
36
+ "package": "npm run css:build:prod && bcp package"
37
+ }
38
+ }
39
+ ```
40
+
30
41
  For direct PowerShell usage, prefer the collision-free local alias:
31
42
 
32
43
  ```powershell
@@ -37,6 +48,7 @@ npm exec -- bcp-framework generate page dashboard/users
37
48
  npm exec -- bcp-framework routes
38
49
  npm exec -- bcp-framework dev
39
50
  npm exec -- bcp-framework build
51
+ npm exec -- bcp-framework package
40
52
  ```
41
53
 
42
54
  Microsoft SQL Server can install another Windows executable named `bcp.exe`, so `bcp-framework` is the recommended interactive Windows command name.
@@ -65,7 +77,7 @@ Select storage provider:
65
77
 
66
78
  Equivalent non-interactive flags are available for CI/scaffolding automation.
67
79
 
68
- ## Generated project metadata — 0.1.29
80
+ ## Generated project metadata
69
81
 
70
82
  New projects include:
71
83
 
@@ -80,10 +92,10 @@ Example:
80
92
  "schemaVersion": 1,
81
93
  "framework": "bcp",
82
94
  "projectName": "my-app",
83
- "frameworkPackage": "npm:@chidchanun/bcp@0.1.29",
95
+ "frameworkPackage": "npm:@chidchanun/bcp@0.2.4",
84
96
  "createdWith": {
85
97
  "package": "create-bcp-app",
86
- "version": "0.1.29"
98
+ "version": "0.2.4"
87
99
  },
88
100
  "packageManager": "npm",
89
101
  "presets": {
@@ -95,22 +107,10 @@ Example:
95
107
  }
96
108
  ```
97
109
 
98
- This manifest records scaffold identity only. It is intended for:
99
-
100
- - `bcp doctor`,
101
- - `bcp inspect`,
102
- - upgrade/migration tooling,
103
- - project-aware documentation,
104
- - `bcp-docs-web` examples/tooling.
105
-
106
- It must not contain secrets. Never put database passwords, AWS/R2 credentials, JWT/session secrets or tokens in `bcp.project.json`.
110
+ This manifest records scaffold identity only. It is intended for framework diagnostics, update/migration tooling and project-aware documentation. It must not contain secrets.
107
111
 
108
112
  The file should normally be committed to source control.
109
113
 
110
- Existing projects created before `0.1.29` remain valid without it.
111
-
112
- Read more: `docs/project-metadata.md` in the BCP Framework repository.
113
-
114
114
  ## Generated application defaults
115
115
 
116
116
  Generated applications include the project-root `@/` alias and TypeScript settings compatible with the BCP bundler.
@@ -135,12 +135,12 @@ npm exec -- bcp-framework update --check
135
135
 
136
136
  When Tailwind is enabled, the project includes:
137
137
 
138
- - `tailwindcss`,
139
- - `@tailwindcss/cli`,
140
- - `concurrently`,
141
- - `app/globals.css`,
142
- - `/bcp.css` stylesheet setup,
143
- - starter utility classes.
138
+ - `tailwindcss`
139
+ - `@tailwindcss/cli`
140
+ - `concurrently`
141
+ - `app/globals.css`
142
+ - `/bcp.css` stylesheet setup
143
+ - starter utility classes
144
144
 
145
145
  Generated commands include:
146
146
 
@@ -150,7 +150,7 @@ npm run css:watch
150
150
  npm run css:build:prod
151
151
  ```
152
152
 
153
- `npm run build` creates the production stylesheet before the BCP production build.
153
+ `npm run build` and `npm run package` create the production stylesheet before the BCP production build/package flow.
154
154
 
155
155
  ## Database presets
156
156
 
@@ -162,7 +162,7 @@ The database choice adds starter configuration and the matching driver:
162
162
  - MongoDB: `mongodb`
163
163
  - None: no database dependency
164
164
 
165
- For **MySQL**, **PostgreSQL** and **SQLite**, generated `lib/database.ts` exposes the framework database primitives through `bcp/database`. Provider connections are managed behind the Database Platform v2 adapter layer instead of being created directly in the generated application.
165
+ For **MySQL**, **PostgreSQL** and **SQLite**, generated `lib/database.ts` exposes the framework database primitives through `bcp/database`. Provider connections are managed behind Database Platform v2 instead of being created directly in generated application code.
166
166
 
167
167
  Generated MySQL environment variables:
168
168
 
@@ -200,13 +200,7 @@ The generator intentionally does not force an ORM.
200
200
 
201
201
  ## Storage providers
202
202
 
203
- Selecting a storage provider creates:
204
-
205
- ```text
206
- lib/storage.ts
207
- ```
208
-
209
- and adds provider-specific environment settings.
203
+ Selecting a storage provider creates `lib/storage.ts` and adds provider-specific environment settings.
210
204
 
211
205
  ### Local Server
212
206
 
@@ -214,31 +208,12 @@ and adds provider-specific environment settings.
214
208
  npx create-bcp-app my-app --storage local
215
209
  ```
216
210
 
217
- Generated structure:
218
-
219
- ```text
220
- lib/
221
- └─ storage.ts
222
-
223
- storage/
224
- ├─ .gitkeep
225
- └─ README.md
226
- ```
227
-
228
211
  Environment:
229
212
 
230
213
  ```dotenv
231
214
  STORAGE_LOCAL_DIRECTORY=./storage
232
215
  ```
233
216
 
234
- `.gitignore` keeps the visible scaffold while ignoring runtime objects:
235
-
236
- ```gitignore
237
- storage/*
238
- !storage/.gitkeep
239
- !storage/README.md
240
- ```
241
-
242
217
  The generated helper uses `createLocalStorage()`.
243
218
 
244
219
  ### Amazon S3
@@ -276,17 +251,8 @@ R2_SECRET_ACCESS_KEY=
276
251
  R2_PREFIX=
277
252
  ```
278
253
 
279
- The helper configures the S3-compatible adapter with:
280
-
281
- ```text
282
- region: auto
283
- endpoint: https://<account-id>.r2.cloudflarestorage.com
284
- ```
285
-
286
254
  Storage credentials are server-only. Do not expose them through `BCP_PUBLIC_*` variables.
287
255
 
288
- The storage preset is only an initial scaffold; application routes/services can later use another BCP adapter while keeping generic storage APIs.
289
-
290
256
  ## JWT Cookie authentication
291
257
 
292
258
  Selecting `JWT Cookie` creates:
@@ -309,11 +275,45 @@ BCP_SESSION_SECRET=
309
275
 
310
276
  Set this to a cryptographically random secret of at least 32 bytes before real authentication use.
311
277
 
312
- The generated `authenticateCredentials(email, password)` returns `null` until the application connects it to its own user store and password-hash verification. This prevents a fresh project from trusting unverified browser identity data.
278
+ The generated `authenticateCredentials(email, password)` returns `null` until the application connects it to its own user store and password-hash verification.
313
279
 
314
- ## Project generators after creation
280
+ ## Application Packaging 0.2.4+
281
+
282
+ Generated projects include:
283
+
284
+ ```bash
285
+ npm run package
286
+ ```
315
287
 
316
- BCP `0.1.29+` can scaffold additional framework files after the project has been created:
288
+ This runs the BCP `standalone-node` application packaging flow and writes:
289
+
290
+ ```text
291
+ .bcp-framework/package/
292
+ ├─ client/
293
+ ├─ server/
294
+ ├─ public/ # when present
295
+ ├─ package.json
296
+ ├─ package-lock.json # when a safe production lock can be derived
297
+ ├─ bcp.package.json
298
+ ├─ bcp.deployment.json
299
+ ├─ bcp.env.json
300
+ ├─ Dockerfile
301
+ └─ README.md
302
+ ```
303
+
304
+ The deployment package excludes application `devDependencies` and project `.env` values. Supply real secrets through the deployment environment.
305
+
306
+ For a package with a generated production lockfile:
307
+
308
+ ```bash
309
+ cd .bcp-framework/package
310
+ npm ci --omit=dev
311
+ npm start
312
+ ```
313
+
314
+ If the package manifest reports that no lockfile was included, use the install command recorded in `bcp.package.json`.
315
+
316
+ ## Project generators after creation
317
317
 
318
318
  ```bash
319
319
  npm run generate -- page dashboard/users
@@ -368,5 +368,5 @@ npx create-bcp-app my-app --yes
368
368
  The `--bcp` option is mainly for prerelease/local package verification:
369
369
 
370
370
  ```bash
371
- npx create-bcp-app my-app --bcp file:../chidchanun-bcp-0.2.3.tgz
371
+ npx create-bcp-app my-app --bcp file:../chidchanun-bcp-0.2.4.tgz
372
372
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bcp-app",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Create a new BCP Framework application.",
5
5
  "type": "module",
6
6
  "license": "MIT",
package/src/index.mjs CHANGED
@@ -98,6 +98,8 @@ export async function createBcpApp(
98
98
  "bcp dev",
99
99
  build:
100
100
  "bcp build",
101
+ package:
102
+ "bcp package",
101
103
  start:
102
104
  "bcp start",
103
105
  routes:
@@ -147,6 +149,13 @@ export async function createBcpApp(
147
149
  storage,
148
150
  });
149
151
 
152
+ if (
153
+ selectedOptions.tailwind
154
+ ) {
155
+ packageJson.scripts.package =
156
+ "npm run css:build:prod && bcp package";
157
+ }
158
+
150
159
  configureFrameworkDatabaseEntry(
151
160
  targetDirectory,
152
161
  selectedOptions.database
@@ -20,11 +20,12 @@ npm run routes
20
20
  npm run generate -- page dashboard/users
21
21
  npm run typecheck
22
22
  npm run build
23
+ npm run package
23
24
  npm start
24
25
  npm run update
25
26
  ```
26
27
 
27
- The generated scripts call commands such as `bcp dev`, `bcp generate`, `bcp build` and `bcp start`. npm automatically adds the project's `node_modules/.bin` directory to `PATH` while an npm script is running.
28
+ The generated scripts call commands such as `bcp dev`, `bcp generate`, `bcp build`, `bcp package` and `bcp start`. npm automatically adds the project's `node_modules/.bin` directory to `PATH` while an npm script is running.
28
29
 
29
30
  ## Project metadata
30
31
 
@@ -40,7 +41,7 @@ Commit this file with the project. Do not put passwords, access keys, session se
40
41
 
41
42
  ## Generate framework files
42
43
 
43
- BCP `0.1.29+` can generate common project files:
44
+ BCP can generate common project files:
44
45
 
45
46
  ```bash
46
47
  npm run generate -- page dashboard/users
@@ -80,6 +81,7 @@ npm exec -- bcp-framework generate page dashboard/users
80
81
  npm exec -- bcp-framework routes
81
82
  npm exec -- bcp-framework dev
82
83
  npm exec -- bcp-framework build
84
+ npm exec -- bcp-framework package
83
85
  ```
84
86
 
85
87
  You can also execute the Windows command shim explicitly:
@@ -115,9 +117,9 @@ npm exec -- bcp-framework inspect --json
115
117
 
116
118
  Doctor checks common project/runtime problems while Inspect shows the resolved configuration, routes, dependencies and project metadata BCP sees.
117
119
 
118
- ## Production
120
+ ## Production build
119
121
 
120
- Create the standalone production build:
122
+ Create the raw standalone production build:
121
123
 
122
124
  ```bash
123
125
  npm run build
@@ -130,3 +132,31 @@ npm start
130
132
  ```
131
133
 
132
134
  The production build is written to `.bcp-framework/build` and runs as a standalone Node.js server.
135
+
136
+ ## Deployment package — BCP 0.2.4+
137
+
138
+ Create a fresh production build and deployment-oriented package:
139
+
140
+ ```bash
141
+ npm run package
142
+ ```
143
+
144
+ The output is written to:
145
+
146
+ ```text
147
+ .bcp-framework/package/
148
+ ```
149
+
150
+ It contains the standalone client/server output, a production-only dependency manifest, deployment/environment metadata, file integrity hashes and a starter Dockerfile.
151
+
152
+ BCP intentionally excludes project `.env` files and application `devDependencies` from the deployment package. Provide secrets through your deployment environment.
153
+
154
+ For a package with a generated production lockfile:
155
+
156
+ ```bash
157
+ cd .bcp-framework/package
158
+ npm ci --omit=dev
159
+ npm start
160
+ ```
161
+
162
+ If `bcp.package.json` reports that no lockfile was included, use the install command recorded in that manifest instead.