create-egregore 0.7.0 → 0.7.1

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/lib/local.js CHANGED
@@ -491,46 +491,43 @@ async function localFounderFlow(ui) {
491
491
 
492
492
  // 19. Optional invite
493
493
  console.log("");
494
- const inviteAnswer = await ui.prompt("Know someone who'd find this useful? [y/N]:");
495
- if (inviteAnswer && inviteAnswer.toLowerCase() === "y") {
496
- const invUsername = await ui.prompt("GitHub username:");
497
- if (invUsername) {
498
- const invSpin = ui.spinner(`Inviting ${invUsername}...`);
499
- try {
500
- // Add as collaborator to all repos
501
- await addCollaborator(githubToken, githubOrg, repoName, invUsername);
502
- await addCollaborator(githubToken, githubOrg, memoryRepoName, invUsername);
503
- for (const mr of selectedRepos) {
504
- await addCollaborator(githubToken, githubOrg, mr, invUsername).catch(() => {});
505
- }
506
-
507
- // Create person file
508
- const invPersonContent = [
509
- "---",
510
- `name: ${invUsername}`,
511
- `github: ${invUsername}`,
512
- `invited_by: ${user.login}`,
513
- `joined: ${today}`,
514
- "---",
515
- "",
516
- ].join("\n");
517
- const invPersonFile = path.join(memoryDir, "people", `${invUsername}.md`);
518
- if (!fs.existsSync(invPersonFile)) {
519
- fs.writeFileSync(invPersonFile, invPersonContent);
520
- try {
521
- run("git add -A", { cwd: memoryDir });
522
- run(`git commit -m "Invite ${invUsername}"`, { cwd: memoryDir });
523
- run("git push", { cwd: memoryDir });
524
- } catch {}
525
- }
494
+ const invUsername = await ui.prompt("Invite a teammate? Enter their GitHub username (or press Enter to skip):");
495
+ if (invUsername) {
496
+ const invSpin = ui.spinner(`Inviting ${invUsername}...`);
497
+ try {
498
+ // Add as collaborator to all repos
499
+ await addCollaborator(githubToken, githubOrg, repoName, invUsername);
500
+ await addCollaborator(githubToken, githubOrg, memoryRepoName, invUsername);
501
+ for (const mr of selectedRepos) {
502
+ await addCollaborator(githubToken, githubOrg, mr, invUsername).catch(() => {});
503
+ }
526
504
 
527
- invSpin.stop(`Invited ${invUsername}`);
528
- console.log("");
529
- ui.info(`Tell them to run:`);
530
- ui.info(` ${ui.bold(`npx create-egregore join ${githubOrg}/${repoName}`)}`);
531
- } catch (err) {
532
- invSpin.fail(`Could not invite ${invUsername}: ${err.message}`);
505
+ // Create person file
506
+ const invPersonContent = [
507
+ "---",
508
+ `name: ${invUsername}`,
509
+ `github: ${invUsername}`,
510
+ `invited_by: ${user.login}`,
511
+ `joined: ${today}`,
512
+ "---",
513
+ "",
514
+ ].join("\n");
515
+ const invPersonFile = path.join(memoryDir, "people", `${invUsername}.md`);
516
+ if (!fs.existsSync(invPersonFile)) {
517
+ fs.writeFileSync(invPersonFile, invPersonContent);
518
+ try {
519
+ run("git add -A", { cwd: memoryDir });
520
+ run(`git commit -m "Invite ${invUsername}"`, { cwd: memoryDir });
521
+ run("git push", { cwd: memoryDir });
522
+ } catch {}
533
523
  }
524
+
525
+ invSpin.stop(`Invited ${invUsername}`);
526
+ console.log("");
527
+ ui.info(`Tell them to run:`);
528
+ ui.info(` ${ui.bold(`npx create-egregore@latest join ${githubOrg}/${repoName}`)}`);
529
+ } catch (err) {
530
+ invSpin.fail(`Could not invite ${invUsername}: ${err.message}`);
534
531
  }
535
532
  }
536
533
 
package/lib/setup.js CHANGED
@@ -357,7 +357,7 @@ async function installShellAlias(egregoreDir, ui) {
357
357
  if (fs.existsSync(configPath)) {
358
358
  try { slug = JSON.parse(fs.readFileSync(configPath, "utf-8")).slug || ""; } catch {}
359
359
  }
360
- defaultName = slug ? `egregore-${slug}` : "egregore-2";
360
+ defaultName = slug || "egregore-2";
361
361
  }
362
362
 
363
363
  // Ask user (skip prompt in non-interactive mode)
package/lib/ui.js CHANGED
@@ -69,11 +69,11 @@ function spinner(msg) {
69
69
  return {
70
70
  stop(result) {
71
71
  clearInterval(interval);
72
- process.stdout.write(`\r ${GREEN}✓${RESET} ${result || msg}\n`);
72
+ process.stdout.write(`\r\x1b[2K ${GREEN}✓${RESET} ${result || msg}\n`);
73
73
  },
74
74
  fail(result) {
75
75
  clearInterval(interval);
76
- process.stdout.write(`\r ${RED}✗${RESET} ${result || msg}\n`);
76
+ process.stdout.write(`\r\x1b[2K ${RED}✗${RESET} ${result || msg}\n`);
77
77
  },
78
78
  };
79
79
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-egregore",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "Set up Egregore for your team in one command",
5
5
  "license": "MIT",
6
6
  "bin": {