create-bcp-app 0.1.25 → 0.1.26

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
@@ -8,6 +8,54 @@ cd my-app
8
8
  npm run dev
9
9
  ```
10
10
 
11
+ ## Project-local BCP CLI
12
+
13
+ `create-bcp-app` installs BCP Framework as a **project-local dependency**. It does not install the framework CLI globally.
14
+
15
+ Generated npm scripts can use `bcp` directly because npm automatically prepends the project's `node_modules/.bin` directory to `PATH` while scripts are running:
16
+
17
+ ```json
18
+ {
19
+ "scripts": {
20
+ "dev": "bcp dev",
21
+ "build": "bcp build",
22
+ "start": "bcp start",
23
+ "routes": "bcp routes",
24
+ "update": "bcp update"
25
+ }
26
+ }
27
+ ```
28
+
29
+ For direct PowerShell usage, invoke the local CLI through `npm exec`:
30
+
31
+ ```powershell
32
+ npm exec -- bcp-framework --version
33
+ npm exec -- bcp-framework doctor
34
+ npm exec -- bcp-framework inspect
35
+ npm exec -- bcp-framework routes
36
+ npm exec -- bcp-framework dev
37
+ npm exec -- bcp-framework build
38
+ ```
39
+
40
+ Typing `bcp-framework` directly in a normal PowerShell session may return `CommandNotFoundException` because PowerShell does not automatically add `node_modules/.bin` to its normal command search path.
41
+
42
+ The Windows command shim can also be executed explicitly:
43
+
44
+ ```powershell
45
+ .\node_modules\.bin\bcp-framework.cmd --version
46
+ ```
47
+
48
+ BCP Framework publishes the `bcp-framework` alias because Microsoft SQL Server can install another Windows executable named `bcp.exe`.
49
+
50
+ Recommended convention:
51
+
52
+ ```text
53
+ Inside npm scripts -> bcp ...
54
+ Direct PowerShell usage -> npm exec -- bcp-framework ...
55
+ ```
56
+
57
+ Using the project-local CLI also keeps the CLI version aligned with the exact BCP Framework dependency installed by the project.
58
+
11
59
  When running interactively, the generator asks:
12
60
 
13
61
  ```text
@@ -53,7 +101,7 @@ After a newer stable BCP release is published, update the project with:
53
101
  npm run update
54
102
  ```
55
103
 
56
- This resolves the npm `latest` release through BCP's updater, updates the exact framework dependency and refreshes the active package-manager lockfile. Use `bcp update --check` to inspect an available update without changing files.
104
+ This resolves the npm `latest` release through BCP's updater, updates the exact framework dependency and refreshes the active package-manager lockfile. Use `bcp update --check` inside an npm script or `npm exec -- bcp-framework update --check` from PowerShell to inspect an available update without changing files.
57
105
 
58
106
  ## Generated optional setup
59
107
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-bcp-app",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "Create a new BCP Framework application.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -10,7 +10,9 @@ npm run dev
10
10
 
11
11
  Open `http://localhost:3000`.
12
12
 
13
- ## Commands
13
+ ## Project commands
14
+
15
+ Generated projects use the project-local BCP Framework CLI through npm scripts:
14
16
 
15
17
  ```bash
16
18
  npm run dev
@@ -18,6 +20,65 @@ npm run routes
18
20
  npm run typecheck
19
21
  npm run build
20
22
  npm start
23
+ npm run update
24
+ ```
25
+
26
+ The generated scripts call commands such as `bcp dev`, `bcp build` and `bcp start`. This works because npm automatically adds the project's `node_modules/.bin` directory to `PATH` while an npm script is running.
27
+
28
+ ## Direct CLI usage
29
+
30
+ BCP Framework is installed as a **project-local dependency**. It is not installed globally by `create-bcp-app`.
31
+
32
+ Because of that, typing this directly in a normal PowerShell session may not work:
33
+
34
+ ```powershell
35
+ bcp-framework doctor
36
+ ```
37
+
38
+ PowerShell does not automatically add `node_modules/.bin` to its normal command search path.
39
+
40
+ Use `npm exec` when you want to invoke the project-local CLI directly:
41
+
42
+ ```powershell
43
+ npm exec -- bcp-framework --version
44
+ npm exec -- bcp-framework doctor
45
+ npm exec -- bcp-framework inspect
46
+ npm exec -- bcp-framework routes
47
+ npm exec -- bcp-framework dev
48
+ npm exec -- bcp-framework build
49
+ ```
50
+
51
+ You can also execute the Windows command shim explicitly:
52
+
53
+ ```powershell
54
+ .\node_modules\.bin\bcp-framework.cmd --version
55
+ ```
56
+
57
+ Using the project-local CLI is recommended because it guarantees that the CLI version matches the BCP Framework version installed by this application.
58
+
59
+ ### Why `bcp-framework` instead of `bcp` in PowerShell?
60
+
61
+ Microsoft SQL Server can install another Windows executable named `bcp.exe`. To avoid that command-name collision, BCP Framework publishes the additional `bcp-framework` alias.
62
+
63
+ Use this convention:
64
+
65
+ ```text
66
+ Inside npm scripts -> bcp ...
67
+ Direct PowerShell usage -> npm exec -- bcp-framework ...
68
+ ```
69
+
70
+ ## Production
71
+
72
+ Create the standalone production build:
73
+
74
+ ```bash
75
+ npm run build
76
+ ```
77
+
78
+ Start it with:
79
+
80
+ ```bash
81
+ npm start
21
82
  ```
22
83
 
23
84
  The production build is written to `.bcp-framework/build` and runs as a standalone Node.js server.