spfn 0.3.0-beta.6 → 0.3.0-beta.8

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
@@ -145,9 +145,15 @@ no pre-build needed.
145
145
  | `-p, --port <port>` | SPFN server port (sets `SPFN_PORT`) | `spfn.config.js` `ports.server`, then `8790` |
146
146
  | `-H, --host <host>` | SPFN server host (sets `SPFN_HOST`) | `spfn.config.js` `host`, then `localhost` |
147
147
  | `--allow-pending-migrations` | Start even when migrations are pending (they are listed as a warning) | off |
148
+ | `--no-agent-files` | Do not write the SPFN instruction block into `AGENTS.md` (same as `SPFN_AGENT_FILES=0`) | writes on |
148
149
 
149
150
  Note: hot reload is **off by default** — pass `--watch` to restart on file changes.
150
151
 
152
+ On startup `spfn dev` refreshes a marked block of SPFN conventions in the project's
153
+ `AGENTS.md` (creating the file, and a `CLAUDE.md` that references it, when absent) so
154
+ coding agents read the right idioms. Only the marked region is rewritten, and only when
155
+ its content actually changed.
156
+
151
157
  Pending migrations stop the boot — see [Database](#spfn-db) for what the refusal looks
152
158
  like and how to override it.
153
159
 
@@ -697,11 +703,25 @@ docker-compose.yml # Postgres + Redis (dev)
697
703
  docker-compose.production.yml
698
704
  Dockerfile, .dockerignore
699
705
  next.config.ts # patched when auth is enabled: /_auth/:path* rewrite → SPFN API
700
- .env.example # committed reference — every key, placeholder values
706
+ .env.local.example # committed reference — Next.js keys, placeholder values
707
+ .env.server.example # committed reference — backend keys, placeholder values
701
708
  .env.local # generated, gitignored (values loaded by Next.js)
702
709
  .env.server # generated, gitignored (server secrets: DB, cache)
703
710
  ```
704
711
 
712
+ The reference is split by consumer, never combined, and a key's file follows who
713
+ reads it rather than whether it is secret:
714
+
715
+ - `.env.local` / `.env.local.example` — the Next.js process (server routes, proxy,
716
+ SSR) and, through `NEXT_PUBLIC_*`, the browser: `SPFN_API_URL`, `SPFN_APP_URL`,
717
+ `SPFN_AUTH_SESSION_SECRET`, `SPFN_AUTH_SESSION_TTL`, `SPFN_AUTH_CSRF`.
718
+ - `.env.server` / `.env.server.example` — the SPFN backend only, never loaded by
719
+ Next.js: `NODE_ENV`, `SPFN_LOG_LEVEL`, `DATABASE_URL`, `CACHE_URL`, `DB_POOL_*`,
720
+ and every OAuth, token, and admin secret.
721
+
722
+ So the session secret is secret and still lives in `.env.local` — the Next.js proxy
723
+ verifies cookies with it — while `DATABASE_URL` never appears there at all.
724
+
705
725
  Full mode overlays the Prototype-to-Production baseline:
706
726
 
707
727
  ```
@@ -720,7 +740,7 @@ next.config.ts # /_auth/* callback rewrite
720
740
 
721
741
  The full RPC proxy imports the auth interceptor and merges `authRouteMap`. Internal auth
722
742
  keys are generated with cryptographic randomness in ignored local env files;
723
- `.env.example` contains placeholders only. Add only the provider keys you use, then run
743
+ `.env.local.example` and `.env.server.example` contain placeholders only. Add only the provider keys you use, then run
724
744
  `pnpm spfn db migrate`.
725
745
 
726
746
  Operating the app is [`spfn ops`](#spfn-ops), not a dashboard: the starter