@titas_mallick/wedding-site-gen 1.0.9 → 1.1.0

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.
Files changed (2) hide show
  1. package/cli.mjs +23 -6
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -209,16 +209,33 @@ NEXT_PUBLIC_CLOUDINARY_UPLOAD_PRESET=wedding
209
209
  // Handle folder renaming for titas/sukanya
210
210
  const appDir = path.join(absoluteTargetDir, 'app');
211
211
 
212
- const groomDir = path.join(appDir, config.groomName.toLowerCase());
213
- const brideDir = path.join(appDir, config.brideName.toLowerCase());
212
+ const groomFolderName = config.groomName.toLowerCase().replace(/[^a-z0-9]/g, '');
213
+ let brideFolderName = config.brideName.toLowerCase().replace(/[^a-z0-9]/g, '');
214
214
 
215
- if (await fs.stat(path.join(appDir, 'titas')).catch(() => null)) {
216
- await fs.rename(path.join(appDir, 'titas'), groomDir);
215
+ // Avoid collision if names are identical
216
+ if (groomFolderName === brideFolderName) {
217
+ brideFolderName = brideFolderName + "_partner";
217
218
  }
218
- if (await fs.stat(path.join(appDir, 'sukanya')).catch(() => null)) {
219
- await fs.rename(path.join(appDir, 'sukanya'), brideDir);
219
+
220
+ const groomDir = path.join(appDir, groomFolderName);
221
+ const brideDir = path.join(appDir, brideFolderName);
222
+
223
+ // Helper for robust rename (Windows fix)
224
+ async function safeRename(oldPath, newPath) {
225
+ if (await fs.stat(oldPath).catch(() => null)) {
226
+ // Check if destination exists
227
+ if (await fs.stat(newPath).catch(() => null)) {
228
+ await fs.rm(newPath, { recursive: true, force: true });
229
+ }
230
+ // Small delay to let OS release handles
231
+ await new Promise(r => setTimeout(r, 100));
232
+ await fs.rename(oldPath, newPath);
233
+ }
220
234
  }
221
235
 
236
+ await safeRename(path.join(appDir, 'titas'), groomDir);
237
+ await safeRename(path.join(appDir, 'sukanya'), brideDir);
238
+
222
239
  console.log(`\nSuccess! Your wedding website is ready in ${targetDir}.`);
223
240
  console.log("\nNext steps:");
224
241
  console.log(`1. cd ${targetDir}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@titas_mallick/wedding-site-gen",
3
- "version": "1.0.9",
3
+ "version": "1.1.0",
4
4
  "description": "A comprehensive AI-powered wedding website generator based on Next.js, Firebase, and Gemini AI.",
5
5
  "keywords": [
6
6
  "wedding",