spfn 0.3.0-beta.10 → 0.3.0-beta.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 +3 -2
- package/dist/index.js +15 -6
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ pnpm dlx spfn@beta <command>
|
|
|
24
24
|
Or add it as a project dependency (`spfn init`/`spfn create` do this for you), then
|
|
25
25
|
call it via `pnpm spfn <command>` / `npm run spfn:<script>`.
|
|
26
26
|
|
|
27
|
-
Requirements: Node.js 20+ in both modes, Next.js 16.
|
|
27
|
+
Requirements: Node.js 20+ in both modes, Next.js 16.3.3+ (App Router, `src/` dir),
|
|
28
28
|
PostgreSQL 14+ (Redis optional). Next.js 15
|
|
29
29
|
is not supported — see [the root README](../../README.md#what-do-i-need-installed).
|
|
30
30
|
|
|
@@ -806,7 +806,8 @@ next.config.ts # /_auth/* callback rewrite
|
|
|
806
806
|
.env.server # auth keyring (gitignored)
|
|
807
807
|
```
|
|
808
808
|
|
|
809
|
-
The full RPC proxy imports the auth interceptor
|
|
809
|
+
The full RPC proxy imports the auth interceptor; it merges no route map, because the
|
|
810
|
+
generated one already carries the routes of the packages `.packages()` mounts. Internal auth
|
|
810
811
|
keys are generated with cryptographic randomness in ignored local env files;
|
|
811
812
|
`.env.local.example` and `.env.server.example` contain placeholders only. Add only the provider keys you use, then run
|
|
812
813
|
`pnpm spfn db migrate`.
|
package/dist/index.js
CHANGED
|
@@ -606,9 +606,7 @@ async function setupApiProxy(cwd, includeAuth) {
|
|
|
606
606
|
}
|
|
607
607
|
ensureDirSync3(rpcDir);
|
|
608
608
|
const authImports = includeAuth ? `import '@spfn/auth/nextjs/api';
|
|
609
|
-
import { authRouteMap } from '@spfn/auth';
|
|
610
609
|
` : "";
|
|
611
|
-
const proxyRouteMap = includeAuth ? "{ ...routeMap, ...authRouteMap }" : "routeMap";
|
|
612
610
|
const routeContent = `/**
|
|
613
611
|
* SPFN RPC Proxy
|
|
614
612
|
*
|
|
@@ -625,7 +623,7 @@ import { authRouteMap } from '@spfn/auth';
|
|
|
625
623
|
${authImports}import { routeMap } from '@/generated/route-map';
|
|
626
624
|
import { createRpcProxy } from '@spfn/core/nextjs/server';
|
|
627
625
|
|
|
628
|
-
export const { GET, POST } = createRpcProxy({ routeMap
|
|
626
|
+
export const { GET, POST } = createRpcProxy({ routeMap });
|
|
629
627
|
`;
|
|
630
628
|
writeFileSync2(rpcRoutePath, routeContent);
|
|
631
629
|
const relativePath = rpcRoutePath.replace(cwd + "/", "");
|
|
@@ -951,7 +949,7 @@ import { dirname as dirname2, join as join10 } from "path";
|
|
|
951
949
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
952
950
|
function getCliVersion() {
|
|
953
951
|
if (true) {
|
|
954
|
-
return "0.3.0-beta.
|
|
952
|
+
return "0.3.0-beta.12";
|
|
955
953
|
}
|
|
956
954
|
return fromPackageJson ?? (fromPackageJson = readPackageVersion());
|
|
957
955
|
}
|
|
@@ -3206,9 +3204,20 @@ async function runGenerators() {
|
|
|
3206
3204
|
const orchestrator = new CodegenOrchestrator({
|
|
3207
3205
|
generators,
|
|
3208
3206
|
cwd,
|
|
3209
|
-
debug: true
|
|
3207
|
+
debug: true,
|
|
3208
|
+
// A generator that refuses — a router that will not load, a duplicate
|
|
3209
|
+
// route name — has to reach the exit code. Printing a green check over
|
|
3210
|
+
// a logged failure leaves the stale output on disk and tells the
|
|
3211
|
+
// developer who just added a route that the map now names it.
|
|
3212
|
+
throwOnError: true
|
|
3210
3213
|
});
|
|
3211
|
-
|
|
3214
|
+
try {
|
|
3215
|
+
await orchestrator.generateAll();
|
|
3216
|
+
} catch (error) {
|
|
3217
|
+
logger.error(error instanceof Error ? error.message : String(error));
|
|
3218
|
+
console.log("\n" + chalk9.red.bold("\u2717 Code generation failed"));
|
|
3219
|
+
process.exit(1);
|
|
3220
|
+
}
|
|
3212
3221
|
console.log("\n" + chalk9.green.bold("\u2713 Code generation completed"));
|
|
3213
3222
|
}
|
|
3214
3223
|
var codegenCommand = new Command8("codegen").description("Code generation management");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "spfn",
|
|
3
|
-
"version": "0.3.0-beta.
|
|
3
|
+
"version": "0.3.0-beta.12",
|
|
4
4
|
"description": "Scaffold a full-stack TypeScript backend onto a Next.js app built with an AI coding agent: auth, database, typed routes and codegen, one fixed vertical slice per feature",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"@types/pg": "^8.10.9",
|
|
93
93
|
"@types/prompts": "^2.4.9",
|
|
94
94
|
"concurrently": "^9.2.1",
|
|
95
|
-
"hono": "^4.
|
|
95
|
+
"hono": "^4.13.5",
|
|
96
96
|
"tsx": "^4.20.6",
|
|
97
97
|
"typescript": "^5.3.3",
|
|
98
98
|
"vitest": "^4.0.6"
|