business-stack 0.1.11 → 0.1.12

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
@@ -62,7 +62,7 @@ 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`**, Alembic migrations, then **`npm run start`** (Turborepo: Next standalone, compiled gateway, FastAPI). The published tarball ships **pre-built** Next.js and gateway output, so **`npm run build` is skipped** on the installed package. First run can still take several minutes (Python deps + native modules).
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
 
@@ -511,8 +511,8 @@ async function runStart(opts) {
511
511
  const prebuilt = isPrebuiltNpmPackage(stackRoot);
512
512
  logPhase(
513
513
  prebuilt
514
- ? "starting (install → migrate → servers; prebuilt web + gateway)"
515
- : "starting (install → build → migrate → servers)",
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.11");
620
+ .version("0.1.12");
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("--skip-migrate", "Skip alembic upgrade")
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);
@@ -6,7 +6,7 @@
6
6
  "dev": "node -e \"console.error('Development is not included in the npm package; clone the monorepo.'); process.exit(1)\"",
7
7
  "start": "node dist/index.js",
8
8
  "build": "node -e \"process.exit(0)\"",
9
- "migrate": "npx @better-auth/cli@latest migrate --yes"
9
+ "migrate": "npx @better-auth/cli@latest migrate --yes --config ./dist/auth.js"
10
10
  },
11
11
  "dependencies": {
12
12
  "@hono/node-server": "^1.19.9",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "business-stack",
3
- "version": "0.1.11",
3
+ "version": "0.1.12",
4
4
  "description": "Next.js + Hono gateway + FastAPI monorepo",
5
5
  "license": "UNLICENSED",
6
6
  "packageManager": "npm@10.8.2",