@donkeylabs/cli 1.1.14 → 1.1.16

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@donkeylabs/cli",
3
- "version": "1.1.14",
3
+ "version": "1.1.16",
4
4
  "type": "module",
5
5
  "description": "CLI for @donkeylabs/server - project scaffolding and code generation",
6
6
  "main": "./src/index.ts",
@@ -33,8 +33,10 @@ NODE_ENV=development
33
33
  # EXTERNAL SERVICES (examples)
34
34
  # =============================================================================
35
35
 
36
- # Email service (e.g., Resend, SendGrid)
36
+ # Email service (Resend)
37
37
  # RESEND_API_KEY=re_xxxxxxxxxxxx
38
+ # EMAIL_FROM=noreply@yourdomain.com
39
+ # PUBLIC_BASE_URL=https://yourdomain.com
38
40
 
39
41
  # Payment processing (e.g., Stripe)
40
42
  # STRIPE_SECRET_KEY=sk_test_xxxxxxxxxxxx
@@ -6,6 +6,7 @@ import { Database } from "bun:sqlite";
6
6
  import { demoPlugin } from "./plugins/demo";
7
7
  import { workflowDemoPlugin } from "./plugins/workflow-demo";
8
8
  import { authPlugin } from "./plugins/auth";
9
+ import { emailPlugin } from "./plugins/email";
9
10
  import demoRoutes from "./routes/demo";
10
11
  import { exampleRouter } from "./routes/example";
11
12
  import { authRouter } from "./routes/auth";
@@ -24,8 +25,48 @@ export const server = new AppServer({
24
25
  },
25
26
  });
26
27
 
27
- // Register plugins
28
- server.registerPlugin(authPlugin); // Auth first - other plugins may depend on it
28
+ // =============================================================================
29
+ // AUTH PLUGIN CONFIGURATION
30
+ // =============================================================================
31
+ // Choose your auth strategy:
32
+ //
33
+ // 1. SESSION (default) - Stateful, stores sessions in database
34
+ // Best for: Web apps, server-rendered pages
35
+ // server.registerPlugin(authPlugin());
36
+ //
37
+ // 2. JWT - Stateless tokens, no database lookup needed
38
+ // Best for: Mobile apps, microservices, APIs
39
+ // server.registerPlugin(authPlugin({
40
+ // strategy: "jwt",
41
+ // jwt: { secret: process.env.JWT_SECRET! },
42
+ // }));
43
+ //
44
+ // 3. REFRESH-TOKEN - Short-lived access + long-lived refresh token
45
+ // Best for: SPAs, mobile apps needing token refresh
46
+ // server.registerPlugin(authPlugin({
47
+ // strategy: "refresh-token",
48
+ // jwt: {
49
+ // secret: process.env.JWT_SECRET!,
50
+ // accessExpiry: "15m",
51
+ // refreshExpiry: "30d",
52
+ // },
53
+ // cookie: { httpOnly: true, secure: true },
54
+ // }));
55
+ //
56
+ // =============================================================================
57
+
58
+ // Using default session strategy for this template
59
+ server.registerPlugin(authPlugin());
60
+
61
+ // Email plugin - supports Resend or console (for development)
62
+ // Configure with process.env.RESEND_API_KEY for production
63
+ server.registerPlugin(emailPlugin({
64
+ provider: process.env.RESEND_API_KEY ? "resend" : "console",
65
+ resend: process.env.RESEND_API_KEY ? { apiKey: process.env.RESEND_API_KEY } : undefined,
66
+ from: process.env.EMAIL_FROM || "noreply@example.com",
67
+ baseUrl: process.env.PUBLIC_BASE_URL || "http://localhost:5173",
68
+ }));
69
+
29
70
  server.registerPlugin(demoPlugin);
30
71
  server.registerPlugin(workflowDemoPlugin);
31
72