yggtree 1.4.0 → 1.4.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.
@@ -0,0 +1,187 @@
1
+ import chalk from 'chalk';
2
+ import gradient from 'gradient-string';
3
+ import figlet from 'figlet';
4
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
5
+ export async function bifrostCommand() {
6
+ console.clear();
7
+ process.stdout.write('\x1b[?25l'); // Hide cursor
8
+ // Animated clouds blowing across the sky
9
+ const cloudArt = ' ☁️ ☁️ ☁️ ';
10
+ const skyWidth = 40;
11
+ console.log(chalk.dim('\n The sky darkens...\n'));
12
+ // Print a placeholder for the animated line so we can cursor-up over it
13
+ console.log('');
14
+ for (let i = 0; i < 20; i++) {
15
+ // Shift the clouds by slicing from an ever-changing offset of a repeated string
16
+ const offset = i % cloudArt.length;
17
+ const visibleClouds = (cloudArt.repeat(3)).substring(offset, offset + skyWidth);
18
+ process.stdout.write('\x1b[1A'); // Move cursor up 1 line
19
+ process.stdout.write('\r ' + chalk.gray(visibleClouds) + '\n');
20
+ await sleep(100);
21
+ }
22
+ console.clear();
23
+ // 6-Frame Cutscene: The Bifrost Opening (Bigger & Stronger)
24
+ const bifrostFrames = [
25
+ // Frame 1: Empty sky
26
+ chalk.gray(`
27
+ ☁️ ☁️
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+ `),
39
+ // Frame 2: Small beam of light
40
+ chalk.cyan(`
41
+ ☁️ | ☁️
42
+ |
43
+ |
44
+ |
45
+ |
46
+ |
47
+ |
48
+ |
49
+ |
50
+ |
51
+ v
52
+ `),
53
+ // Frame 3: Wider beam reaching the ground
54
+ gradient.rainbow(`
55
+ ☁️ ||| ☁️
56
+ |||
57
+ |||
58
+ |||
59
+ |||
60
+ |||
61
+ |||
62
+ |||
63
+ |||
64
+ |||
65
+ ---------
66
+ `),
67
+ // Frame 4: Giant beam hitting the ground
68
+ gradient.rainbow(`
69
+ ☁️ ||||||||||| ☁️
70
+ |||||||||||
71
+ |||||||||||
72
+ |||||||||||
73
+ |||||||||||
74
+ |||||||||||
75
+ |||||||||||
76
+ |||||||||||
77
+ |||||||||||
78
+ |||||||||||
79
+ -----------------
80
+ `),
81
+ // Frame 5: MASSIVE beam
82
+ gradient.rainbow(`
83
+ ☁️ ||||||||||||||||||||| ☁️
84
+ |||||||||||||||||||||
85
+ |||||||||||||||||||||
86
+ |||||||||||||||||||||
87
+ |||||||||||||||||||||
88
+ |||||||||||||||||||||
89
+ |||||||||||||||||||||
90
+ |||||||||||||||||||||
91
+ |||||||||||||||||||||
92
+ |||||||||||||||||||||
93
+ ---------------------------
94
+ `),
95
+ // Frame 6: Silhouette of Thor in the massive beam
96
+ gradient.rainbow(`
97
+ ☁️ ||||||||||||||||||||| ☁️
98
+ |||||||||||||||||||||
99
+ |||||||||||||||||||||
100
+ |||||||||||||||||||||
101
+ |||||||||||||||||||||
102
+ |||||||||||||||||||||
103
+ |||||||||||||||||||||
104
+ |||||||||||||||||||||
105
+ |||||||||||||||||||||
106
+ ||||||||| 𖨆 |||||||||
107
+ ---------------------------
108
+ `)
109
+ ];
110
+ // Give the user more time to digest each step of the expanding Bifrost
111
+ const frameDelays = [400, 300, 300, 300, 400, 1000];
112
+ for (let i = 0; i < bifrostFrames.length; i++) {
113
+ console.clear();
114
+ console.log(chalk.bold.italic('\n Opening the Bifrost...\n'));
115
+ console.log(bifrostFrames[i]);
116
+ await sleep(frameDelays[i]); // Custom timing per frame for better impact
117
+ }
118
+ await sleep(200);
119
+ // Lightning Flash
120
+ // We use standard ANSI terminal invert colors to simulate lightning
121
+ process.stdout.write('\x1b[?5h'); // Inverse Video On
122
+ console.log(chalk.yellow.bold('\n\n ⚡ \n ⚡ ⚡\n ⚡\n\n'));
123
+ await sleep(150);
124
+ process.stdout.write('\x1b[?5l'); // Inverse Video Off
125
+ console.clear();
126
+ const frames = [
127
+ chalk.gray.bold(`
128
+ ___________
129
+ | |
130
+ | MJÖLNIR |
131
+ |___________|
132
+ | |
133
+ | |
134
+ _|_|_
135
+ `),
136
+ chalk.gray.bold(`
137
+
138
+ _____________
139
+ ======| MJÖLNIR |
140
+ -------------
141
+
142
+ `),
143
+ chalk.gray.bold(`
144
+ _|_|_
145
+ | |
146
+ | |
147
+ ___________
148
+ | |
149
+ | MJÖLNIR |
150
+ |___________|
151
+ `),
152
+ chalk.gray.bold(`
153
+
154
+ _____________
155
+ | MJÖLNIR |======
156
+ -------------
157
+
158
+ `)
159
+ ];
160
+ // Let the hammer fall down and spin from right to left
161
+ const animationSteps = 15;
162
+ for (let i = 0; i < animationSteps; i++) {
163
+ console.clear();
164
+ console.log('\x1b[?25l'); // Hide cursor
165
+ const yPadding = '\n'.repeat(i);
166
+ const xPaddingLength = Math.max(0, (animationSteps - i) * 6);
167
+ const xPadding = ' '.repeat(xPaddingLength);
168
+ const frame = frames[i % frames.length];
169
+ const paddedFrame = frame.split('\n').map(line => xPadding + line).join('\n');
170
+ console.log(yPadding + paddedFrame);
171
+ await sleep(70);
172
+ }
173
+ // Final pose upright!
174
+ console.clear();
175
+ const finalYPadding = '\n'.repeat(animationSteps);
176
+ console.log(finalYPadding + frames[0]);
177
+ await sleep(200);
178
+ // THOOM text
179
+ const thoomArt = figlet.textSync('THOOM!', {
180
+ font: 'Standard',
181
+ horizontalLayout: 'default',
182
+ verticalLayout: 'default',
183
+ });
184
+ console.log(gradient.fruit(thoomArt));
185
+ console.log(chalk.yellow.bold('\n ⚡ The son of Odin has entered the realm ⚡ \n'));
186
+ console.log('\x1b[?25h'); // Show cursor
187
+ }
@@ -0,0 +1,39 @@
1
+ import chalk from 'chalk';
2
+ const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
3
+ // A collection of legendary quotes (mix of Poetic Edda and developer humor)
4
+ const quotes = [
5
+ "I say thee NAY to unhandled promises!",
6
+ "Even the All-Father tests in production sometimes.",
7
+ "A wise developer commits early, and commits often.",
8
+ "Bugs are just frost giants hiding in your codebase.",
9
+ "May your builds be as swift as Mjölnir's flight.",
10
+ "Do not trust a tree without deep roots, nor code without tests.",
11
+ "Yggdrasil connects all realms; git connects all branches.",
12
+ "A clean working tree is acceptable to the gods.",
13
+ "The Bifrost is open, but did you remember to push?",
14
+ "Verily, thou shalt not force push to main."
15
+ ];
16
+ export async function thorCommand() {
17
+ console.clear();
18
+ const randomQuote = quotes[Math.floor(Math.random() * quotes.length)];
19
+ // Static Thor ASCII art
20
+ const thorArt = `
21
+ / \\
22
+ /___\\
23
+ (o_o) "Hello from Asgard!"
24
+ /|||||\\
25
+ | | | |
26
+ \\=====//
27
+ | |
28
+ | |
29
+ _|_|_
30
+ `;
31
+ console.log(chalk.gray.bold(thorArt));
32
+ // Typewriter effect for the quote
33
+ process.stdout.write(chalk.cyan('Thor says: '));
34
+ for (let i = 0; i < randomQuote.length; i++) {
35
+ process.stdout.write(chalk.bold.yellow(randomQuote.charAt(i)));
36
+ await sleep(30); // Typing speed
37
+ }
38
+ console.log('\n');
39
+ }
package/dist/index.js CHANGED
@@ -18,6 +18,8 @@ import { applyCommand } from './commands/wt/apply.js';
18
18
  import { unapplyCommand } from './commands/wt/unapply.js';
19
19
  import { getVersion } from './lib/version.js';
20
20
  import { findSandboxRoot } from './lib/sandbox.js';
21
+ import { bifrostCommand } from './commands/bifrost.js';
22
+ import { thorCommand } from './commands/thor.js';
21
23
  const program = new Command();
22
24
  program
23
25
  .name('yggtree')
@@ -51,6 +53,8 @@ program
51
53
  new inquirer.Separator(),
52
54
  ...realmChoices,
53
55
  new inquirer.Separator(),
56
+ { name: `🌈 Summon the Bifrost ${chalk.dim('(easter egg)')}`, value: 'bifrost' },
57
+ { name: `⚡ Consult Thor ${chalk.dim('(easter egg)')}`, value: 'thor' },
54
58
  { name: `🚪 Leave Yggdrasil ${chalk.dim('(exit)')}`, value: 'exit' },
55
59
  ]
56
60
  : [
@@ -58,6 +62,8 @@ program
58
62
  new inquirer.Separator(),
59
63
  ...sandboxChoices,
60
64
  new inquirer.Separator(),
65
+ { name: `🌈 Summon the Bifrost ${chalk.dim('(easter egg)')}`, value: 'bifrost' },
66
+ { name: `⚡ Consult Thor ${chalk.dim('(easter egg)')}`, value: 'thor' },
61
67
  { name: `🚪 Leave Yggdrasil ${chalk.dim('(exit)')}`, value: 'exit' },
62
68
  ];
63
69
  const { action } = await inquirer.prompt([
@@ -113,6 +119,12 @@ program
113
119
  case 'create-sandbox':
114
120
  await createSandboxCommand({ bootstrap: true });
115
121
  break;
122
+ case 'bifrost':
123
+ await bifrostCommand();
124
+ break;
125
+ case 'thor':
126
+ await thorCommand();
127
+ break;
116
128
  case 'exit':
117
129
  log.info('Bye! 👋');
118
130
  process.exit(0);
@@ -223,4 +235,10 @@ wt.command('apply')
223
235
  wt.command('unapply')
224
236
  .description('Undo applied sandbox changes in origin')
225
237
  .action(unapplyCommand);
238
+ program.command('bifrost')
239
+ .description('Summon the Bifrost (Easter Egg)')
240
+ .action(bifrostCommand);
241
+ program.command('thor')
242
+ .description('Consult the God of Thunder (Easter Egg)')
243
+ .action(thorCommand);
226
244
  program.parse(process.argv);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yggtree",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Interactive CLI for managing git worktrees and configs",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",