business-stack 0.1.11 → 0.1.13
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 +14 -2
- package/bin/business-stack.cjs +14 -4
- package/frontend/cli/dist/cli.cjs +10000 -0
- package/frontend/cli/package.json +12 -0
- package/gateway/package.json +1 -1
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -62,12 +62,24 @@ npx business-stack start
|
|
|
62
62
|
```
|
|
63
63
|
|
|
64
64
|
- **`setup`** generates secrets, stores them in SQLite (`node_modules/business-stack/gateway/auth.sqlite`, table `stack_secrets`), and writes `gateway/.env`, `frontend/web/.env.local`, and `backend/.env` under that package path. You do not need to create `.env` files by hand.
|
|
65
|
-
- **`start`** runs **`npm install`** (workspaces), **`uv sync`**,
|
|
65
|
+
- **`start`** runs **`npm install`** (workspaces), **`uv sync`**, **Better Auth** migrations on `gateway/auth.sqlite` (`user`, session, etc.), **Alembic** on the backend DB, then **`npm run start`**. The published tarball ships **pre-built** Next.js and gateway JS, so **`npm run build` is skipped**. First run can still take several minutes (Python deps + native modules + `npx` for the auth CLI).
|
|
66
66
|
|
|
67
67
|
Optional flags for `start`: `--skip-install`, `--skip-build`, `--skip-migrate`.
|
|
68
68
|
|
|
69
69
|
**`dev`** (hot reload) is **not** available from the npm package (no app source). Clone the monorepo to develop the stack.
|
|
70
70
|
|
|
71
|
+
### Terminal API client (`bs`)
|
|
72
|
+
|
|
73
|
+
The same install also provides **`bs`** — a **Node** terminal client for auth, chat, ingest, pipeline, etc. (talks to your Next origin, same as the browser). With the stack running:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
bs --help
|
|
77
|
+
bs auth session
|
|
78
|
+
bs backend hello
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Configure the web URL with **`BUSINESS_STACK_WEB_URL`** (or **`NEXT_PUBLIC_AUTH_BASE_URL`** / **`NEXT_PUBLIC_APP_URL`**), default `http://localhost:3000`.
|
|
82
|
+
|
|
71
83
|
### 4. Optional: npm scripts in your `package.json`
|
|
72
84
|
|
|
73
85
|
```json
|
|
@@ -81,7 +93,7 @@ Optional flags for `start`: `--skip-install`, `--skip-build`, `--skip-migrate`.
|
|
|
81
93
|
}
|
|
82
94
|
```
|
|
83
95
|
|
|
84
|
-
After a local install, npm adds `node_modules/.bin/business-stack
|
|
96
|
+
After a local install, npm adds `node_modules/.bin/business-stack` and `node_modules/.bin/bs`.
|
|
85
97
|
|
|
86
98
|
## Global install (optional)
|
|
87
99
|
|
package/bin/business-stack.cjs
CHANGED
|
@@ -511,8 +511,8 @@ async function runStart(opts) {
|
|
|
511
511
|
const prebuilt = isPrebuiltNpmPackage(stackRoot);
|
|
512
512
|
logPhase(
|
|
513
513
|
prebuilt
|
|
514
|
-
? "starting (install →
|
|
515
|
-
: "starting (install → build →
|
|
514
|
+
? "starting (install → DB migrations → servers; prebuilt web + gateway)"
|
|
515
|
+
: "starting (install → build → DB migrations → servers)",
|
|
516
516
|
);
|
|
517
517
|
logPhase(`stack root ${stackRoot}`);
|
|
518
518
|
logPhase(`CLI package v${getCliPackageVersion()} — if there is no output below, run: npm i -g business-stack@latest`);
|
|
@@ -542,6 +542,13 @@ async function runStart(opts) {
|
|
|
542
542
|
logPhase("skip npm run build (prebuilt package)");
|
|
543
543
|
}
|
|
544
544
|
if (!opts.skipMigrate) {
|
|
545
|
+
runCmd(
|
|
546
|
+
"better-auth migrate (gateway SQLite)",
|
|
547
|
+
"npm",
|
|
548
|
+
["run", "migrate"],
|
|
549
|
+
path.join(stackRoot, "gateway"),
|
|
550
|
+
childEnv,
|
|
551
|
+
);
|
|
545
552
|
runCmd(
|
|
546
553
|
"alembic upgrade head",
|
|
547
554
|
"uv",
|
|
@@ -610,7 +617,7 @@ function runDev() {
|
|
|
610
617
|
program
|
|
611
618
|
.name("business-stack")
|
|
612
619
|
.description("Run the business-stack monorepo (Next + Hono gateway + FastAPI)")
|
|
613
|
-
.version("0.1.
|
|
620
|
+
.version("0.1.13");
|
|
614
621
|
|
|
615
622
|
program
|
|
616
623
|
.command("doctor")
|
|
@@ -636,7 +643,10 @@ program
|
|
|
636
643
|
.description("Install deps, build, migrate, run production stack (turbo start)")
|
|
637
644
|
.option("--skip-install", "Skip npm install")
|
|
638
645
|
.option("--skip-build", "Skip turbo build")
|
|
639
|
-
.option(
|
|
646
|
+
.option(
|
|
647
|
+
"--skip-migrate",
|
|
648
|
+
"Skip DB migrations (Better Auth gateway + Alembic backend)",
|
|
649
|
+
)
|
|
640
650
|
.action(async (o) => {
|
|
641
651
|
try {
|
|
642
652
|
await runStart(o);
|