@jhorst11/wt 2.0.2 → 2.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.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=wt.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wt.d.ts","sourceRoot":"","sources":["../../bin/wt.ts"],"names":[],"mappings":""}
package/dist/bin/wt.js ADDED
@@ -0,0 +1,83 @@
1
+ #!/usr/bin/env node
2
+ import { createRequire } from 'module';
3
+ import { fileURLToPath } from 'url';
4
+ import { dirname, join } from 'path';
5
+ import { program } from 'commander';
6
+ import { mainMenu, createWorktreeFlow, listWorktrees, removeWorktreeFlow, mergeWorktreeFlow, goHome, goToWorktree, } from '../src/commands.js';
7
+ import { spacer, colors } from '../src/ui.js';
8
+ import { setupCommand } from '../src/setup.js';
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+ const require = createRequire(import.meta.url);
12
+ // Resolve package.json relative to project root (one level up from bin/)
13
+ const packagePath = join(__dirname, '..', '..', 'package.json');
14
+ const { version } = require(packagePath);
15
+ program
16
+ .name('wt')
17
+ .description('🌳 Beautiful interactive git worktree manager')
18
+ .version(version)
19
+ .option('--verbose', 'Show full hook command output (default: show command name with spinner only)');
20
+ program
21
+ .command('new', { isDefault: false })
22
+ .description('Create a new worktree interactively')
23
+ .option('--no-hooks', 'Skip post-create hooks')
24
+ .action((args, cmd) => {
25
+ createWorktreeFlow({ verbose: !!cmd.parent?.opts?.()?.verbose, hooks: args.hooks });
26
+ });
27
+ program
28
+ .command('list')
29
+ .alias('ls')
30
+ .description('List all worktrees for the current repo')
31
+ .action(listWorktrees);
32
+ program
33
+ .command('remove')
34
+ .alias('rm')
35
+ .description('Remove a worktree interactively')
36
+ .action((_args, cmd) => {
37
+ removeWorktreeFlow({ verbose: !!cmd.parent?.opts?.()?.verbose });
38
+ });
39
+ program
40
+ .command('merge')
41
+ .description('Merge a worktree branch back to main')
42
+ .action((_args, cmd) => {
43
+ mergeWorktreeFlow({ verbose: !!cmd.parent?.opts?.()?.verbose });
44
+ });
45
+ program
46
+ .command('home')
47
+ .description('Return to the main repository')
48
+ .action(goHome);
49
+ program
50
+ .command('go [name]')
51
+ .alias('jump')
52
+ .description('Jump to a worktree (interactive if no name)')
53
+ .action((name) => {
54
+ goToWorktree(name);
55
+ });
56
+ program
57
+ .command('setup')
58
+ .description('Configure shell integration for directory jumping')
59
+ .action(setupCommand);
60
+ // Default action (no command = interactive menu)
61
+ program.action(async () => {
62
+ await mainMenu();
63
+ });
64
+ // Custom help
65
+ program.on('--help', () => {
66
+ spacer();
67
+ console.log('Examples:');
68
+ console.log(` ${colors.muted('$')} wt ${colors.muted('# Interactive menu')}`);
69
+ console.log(` ${colors.muted('$')} wt new ${colors.muted('# Create new worktree')}`);
70
+ console.log(` ${colors.muted('$')} wt list ${colors.muted('# List all worktrees')}`);
71
+ console.log(` ${colors.muted('$')} wt go feature-x ${colors.muted('# Jump to worktree')}`);
72
+ console.log(` ${colors.muted('$')} wt merge ${colors.muted('# Merge worktree to main')}`);
73
+ console.log(` ${colors.muted('$')} wt home ${colors.muted('# Return to main repo')}`);
74
+ console.log(` ${colors.muted('$')} wt setup ${colors.muted('# Configure shell integration')}`);
75
+ spacer();
76
+ });
77
+ // Handle graceful exit
78
+ process.on('SIGINT', () => {
79
+ console.log('\n');
80
+ process.exit(0);
81
+ });
82
+ program.parse();
83
+ //# sourceMappingURL=wt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wt.js","sourceRoot":"","sources":["../../bin/wt.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAC;AACpC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AACrC,OAAO,EAAE,OAAO,EAA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AAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAClB,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { CommandOptions } from './types.js';
2
+ export declare function mainMenu(): Promise<void>;
3
+ export declare function createWorktreeFlow(options?: CommandOptions): Promise<void>;
4
+ export declare function listWorktrees(): Promise<void>;
5
+ export declare function removeWorktreeFlow(options?: CommandOptions): Promise<void>;
6
+ export declare function mergeWorktreeFlow(options?: CommandOptions): Promise<void>;
7
+ export declare function goHome(): Promise<void>;
8
+ export declare function goToWorktree(name?: string): Promise<void>;
9
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/commands.ts"],"names":[],"mappings":"AA8CA,OAAO,KAAK,EAAE,cAAc,EAAgB,MAAM,YAAY,CAAC;AAuB/D,wBAAsB,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CA+H9C;AAED,wBAAsB,kBAAkB,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2QpF;AAED,wBAAsB,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC,CAyCnD;AAED,wBAAsB,kBAAkB,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CA2KpF;AAED,wBAAsB,iBAAiB,CAAC,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,IAAI,CAAC,CAiQnF;AAED,wBAAsB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAuC5C;AAED,wBAAsB,YAAY,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAgG/D"}