@salifbiaye/create-boutique 0.3.2 → 0.3.3
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/cli/dist/create.js +14 -1
- package/package.json +1 -1
package/cli/dist/create.js
CHANGED
|
@@ -90,6 +90,18 @@ async function ask(a, dirName, yes) {
|
|
|
90
90
|
}
|
|
91
91
|
const stripePk = a.stripePk ?? (cancelled(await p.text({ message: "Clé Stripe publique (vide = paiement manuel)", placeholder: "pk_test_…", defaultValue: "" })) || undefined);
|
|
92
92
|
const stripeSk = stripePk ? (a.stripeSk ?? (cancelled(await p.password({ message: "Clé Stripe secrète" })) || undefined)) : a.stripeSk;
|
|
93
|
+
// E-mails clients (confirmation, expédition, mot de passe oublié…) via Resend ; vide = aucun e-mail envoyé.
|
|
94
|
+
const resendKey = a.resendKey ??
|
|
95
|
+
(cancelled(await p.password({ message: "Clé API Resend (vide = aucun e-mail envoyé)", validate: (v) => (!v || v.startsWith("re_") ? undefined : "une clé Resend commence par re_") })) ||
|
|
96
|
+
undefined);
|
|
97
|
+
const emailFrom = resendKey
|
|
98
|
+
? (a.emailFrom ??
|
|
99
|
+
cancelled(await p.text({
|
|
100
|
+
message: "Adresse d'expédition des e-mails (domaine vérifié chez Resend ; test : onboarding@resend.dev)",
|
|
101
|
+
placeholder: "commandes@votredomaine.com",
|
|
102
|
+
validate: (v) => (z.email().safeParse(v).success ? undefined : "adresse e-mail invalide"),
|
|
103
|
+
})))
|
|
104
|
+
: a.emailFrom;
|
|
93
105
|
const exists = (kind) => (v) => {
|
|
94
106
|
if (!v?.trim())
|
|
95
107
|
return undefined;
|
|
@@ -100,7 +112,7 @@ async function ask(a, dirName, yes) {
|
|
|
100
112
|
};
|
|
101
113
|
const products = a.products ?? (cancelled(await p.text({ message: "Fichier produits (CSV, optionnel)", defaultValue: "", validate: exists("file") })).trim() || undefined);
|
|
102
114
|
const images = a.images ?? (cancelled(await p.text({ message: "Dossier images (optionnel)", defaultValue: "", validate: exists("dir") })).trim() || undefined);
|
|
103
|
-
return { ...a, name, email, currency, country, language, themes: chosen, boutiques: extra, stripePk, stripeSk, products, images };
|
|
115
|
+
return { ...a, name, email, currency, country, language, themes: chosen, boutiques: extra, stripePk, stripeSk, resendKey, emailFrom, products, images };
|
|
104
116
|
}
|
|
105
117
|
export async function create(dir, input, opts) {
|
|
106
118
|
const target = path.resolve(dir);
|
|
@@ -163,6 +175,7 @@ export async function create(dir, input, opts) {
|
|
|
163
175
|
`${"Backend / admin".padEnd(width + 16)}→ http://localhost:${proj.apiPort}/app`,
|
|
164
176
|
`Devise ${a.currency.toUpperCase()} · pays ${a.country.toUpperCase()} · langue ${a.language}`,
|
|
165
177
|
`Paiement : ${a.stripeSk ? "Stripe + manuel" : "manuel (Stripe : non configuré)"}`,
|
|
178
|
+
`E-mails : ${a.resendKey ? `Resend, depuis ${a.emailFrom ?? "(adresse manquante)"}` : "désactivés (pas de clé Resend)"}`,
|
|
166
179
|
`Catalogue : ${a.products ?? "aucun (à ajouter dans l'admin)"}`,
|
|
167
180
|
];
|
|
168
181
|
if (opts.yes)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salifbiaye/create-boutique",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Usine à Boutiques : génère un projet complet (backend Medusa + une boutique Next.js par campagne) prêt pour docker compose",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": { "type": "git", "url": "git+https://github.com/salifbiaye/create-boutique.git" },
|