@shipindays/shipindays 0.1.13 → 0.1.14

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/index.js CHANGED
@@ -42,12 +42,26 @@ const EMAIL_PROVIDERS = {
42
42
  },
43
43
  };
44
44
 
45
+ // Add to your CLI constants
46
+ const PAYMENT_PROVIDERS = {
47
+ stripe: {
48
+ label: "Stripe",
49
+ hint: "Subscriptions + One-time payments via Stripe Checkout",
50
+ },
51
+ dodopayments: {
52
+ label: "Dodo Payments",
53
+ hint: "Merchant of Record — simplifies global tax/compliance",
54
+ },
55
+ };
56
+
45
57
  const ENV_VARS = {
46
58
  base: {
47
59
  "# App": [
48
60
  "NEXT_PUBLIC_APP_URL=http://localhost:3000",
49
61
  ],
50
62
  },
63
+
64
+ // auth env's
51
65
  auth: {
52
66
  supabase: {
53
67
  "# Supabase (supabase.com → project → settings → API)": [
@@ -65,12 +79,10 @@ const ENV_VARS = {
65
79
  "AUTH_GOOGLE_ID=",
66
80
  "AUTH_GOOGLE_SECRET=",
67
81
  ],
68
- "# OAuth — GitHub (github.com → Settings → Developer settings → OAuth Apps)": [
69
- "AUTH_GITHUB_ID=",
70
- "AUTH_GITHUB_SECRET=",
71
- ],
72
82
  },
73
83
  },
84
+
85
+ // emails env's
74
86
  email: {
75
87
  resend: {
76
88
  "# Resend (resend.com → API Keys)": [
@@ -83,6 +95,33 @@ const ENV_VARS = {
83
95
  "MAILGUN_DOMAIN=",
84
96
  ],
85
97
  },
98
+
99
+ // payments env's
100
+ payments: {
101
+ stripe: {
102
+ "# Stripe (dashboard.stripe.com → Developers → API keys)": [
103
+ "STRIPE_SECRET_KEY=",
104
+ "STRIPE_WEBHOOK_SECRET=",
105
+ "NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY=",
106
+ ],
107
+ "# Stripe Pricing (Create products in Stripe dashboard)": [
108
+ "NEXT_PUBLIC_STRIPE_PRICE_ID_BASIC=",
109
+ "NEXT_PUBLIC_STRIPE_PRICE_ID_PRO=",
110
+ ],
111
+ },
112
+
113
+ dodopayments: {
114
+ "# Dodo Payments (app.dodopayments.com → Developers → API Keys)": [
115
+ "DODO_PAYMENTS_API_KEY=",
116
+ "DODO_PAYMENTS_WEBHOOK_KEY=",
117
+ ],
118
+ "# Dodo Pricing (Create products in Dodo dashboard)": [
119
+ "NEXT_PUBLIC_DODO_PRICE_ID_BASIC=",
120
+ "NEXT_PUBLIC_DODO_PRICE_ID_PRO=",
121
+ ],
122
+ },
123
+ },
124
+
86
125
  },
87
126
  };
88
127
 
@@ -322,7 +361,14 @@ async function main() {
322
361
  });
323
362
  if (p.isCancel(emailProvider)) { p.cancel("Cancelled."); process.exit(0); }
324
363
 
325
- const choices = { auth: authProvider, email: emailProvider };
364
+ const paymentProvider = await p.select({
365
+ message: "Payment provider",
366
+ options: Object.entries(PAYMENT_PROVIDERS).map(([value, { label, hint }]) => ({
367
+ value, label, hint,
368
+ })),
369
+ });
370
+
371
+ const choices = { auth: authProvider, email: emailProvider, payment: paymentProvider };
326
372
 
327
373
  // 4. Git + install preferences
328
374
  const initGit = await p.confirm({
@@ -361,6 +407,12 @@ async function main() {
361
407
  await mergePackageJson(targetPath, "email", choices.email);
362
408
  spin.stop(`Email: ${choices.email} ✓`);
363
409
 
410
+ // 7. Inject payment block
411
+ spin.start(`Injecting payments: ${choices.payments}...`);
412
+ await injectBlock("payments", choices.payments, targetPath);
413
+ await mergePackageJson(targetPath, "payments", choices.payments);
414
+ spin.stop(`Payments: ${choices.payments} ✓`);
415
+
364
416
  // 8. Write .env.example
365
417
  spin.start("Writing .env.example...");
366
418
  await fs.outputFile(path.join(targetPath, ".env.example"), buildEnvExample(choices));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shipindays/shipindays",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Open source CLI to scaffold a Next.js SaaS. Pick your auth, email, and payments wired up and ready to ship.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "dodopayments": "^latest"
4
+ }
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "dependencies": {
3
+ "stripe": "^14.21.0"
4
+ }
5
+ }