git-slot-machine 1.2.4 → 1.3.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.
- package/CHANGELOG.md +14 -0
- package/dist/index.js +32 -12
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +34 -12
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,20 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.3.0] - 2025-01-16
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
- **Simplified command structure**: Adopted Laravel/Artisan-style `resource:action` pattern
|
|
12
|
+
- `git-slot-machine config set sync-enabled false` → `git-slot-machine sync:disable`
|
|
13
|
+
- `git-slot-machine config set sync-enabled true` → `git-slot-machine sync:enable`
|
|
14
|
+
- Added `git-slot-machine username:set <username>` for easier username changes
|
|
15
|
+
- Kept `config:get` and `config:set` for advanced configuration
|
|
16
|
+
|
|
17
|
+
### Improved
|
|
18
|
+
- More intuitive command structure following industry-standard patterns
|
|
19
|
+
- Shorter, more memorable commands for common operations
|
|
20
|
+
- Better command discoverability with resource-based organization
|
|
21
|
+
|
|
8
22
|
## [1.2.4] - 2025-01-16
|
|
9
23
|
|
|
10
24
|
### Fixed
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
+
import chalk from 'chalk';
|
|
3
4
|
import { playCommand } from './commands/play.js';
|
|
4
5
|
import { spinCommand } from './commands/spin.js';
|
|
5
6
|
import { initCommand } from './commands/init.js';
|
|
@@ -12,7 +13,7 @@ const program = new Command();
|
|
|
12
13
|
program
|
|
13
14
|
.name('git-slot-machine')
|
|
14
15
|
.description('Git commit hash slot machine')
|
|
15
|
-
.version('1.
|
|
16
|
+
.version('1.3.0', '-v, --version', 'Output the current version');
|
|
16
17
|
program
|
|
17
18
|
.command('play')
|
|
18
19
|
.description('Play the slot machine with a git hash')
|
|
@@ -65,27 +66,46 @@ program
|
|
|
65
66
|
.action(async () => {
|
|
66
67
|
await authStatusCommand();
|
|
67
68
|
});
|
|
68
|
-
// Sync
|
|
69
|
+
// Sync commands
|
|
69
70
|
program
|
|
70
71
|
.command('sync')
|
|
71
72
|
.description('Sync balance with API')
|
|
72
73
|
.action(async () => {
|
|
73
74
|
await syncCommand();
|
|
74
75
|
});
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.
|
|
78
|
-
.
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
76
|
+
program
|
|
77
|
+
.command('sync:enable')
|
|
78
|
+
.description('Enable automatic API sync')
|
|
79
|
+
.action(async () => {
|
|
80
|
+
await configSetCommand('sync-enabled', 'true');
|
|
81
|
+
});
|
|
82
|
+
program
|
|
83
|
+
.command('sync:disable')
|
|
84
|
+
.description('Disable automatic API sync')
|
|
85
|
+
.action(async () => {
|
|
86
|
+
await configSetCommand('sync-enabled', 'false');
|
|
87
|
+
});
|
|
88
|
+
// Username commands
|
|
89
|
+
program
|
|
90
|
+
.command('username:set')
|
|
91
|
+
.description('Set GitHub username')
|
|
92
|
+
.argument('<username>', 'Your GitHub username')
|
|
93
|
+
.action(async (username) => {
|
|
94
|
+
const { setGitHubUsername } = await import('./config.js');
|
|
95
|
+
setGitHubUsername(username);
|
|
96
|
+
console.log(chalk.green(`GitHub username set to: ${username}`));
|
|
97
|
+
});
|
|
98
|
+
// Config commands (advanced)
|
|
99
|
+
program
|
|
100
|
+
.command('config:get')
|
|
101
|
+
.description('Get configuration value (advanced)')
|
|
82
102
|
.argument('<key>', 'Configuration key (api-url, sync-enabled, all)')
|
|
83
103
|
.action(async (key) => {
|
|
84
104
|
await configGetCommand(key);
|
|
85
105
|
});
|
|
86
|
-
|
|
87
|
-
.command('set')
|
|
88
|
-
.description('Set configuration value')
|
|
106
|
+
program
|
|
107
|
+
.command('config:set')
|
|
108
|
+
.description('Set configuration value (advanced)')
|
|
89
109
|
.argument('<key>', 'Configuration key (api-url, sync-enabled)')
|
|
90
110
|
.argument('<value>', 'Configuration value')
|
|
91
111
|
.action(async (key, value) => {
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE1E,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,kBAAkB,CAAC;KACxB,WAAW,CAAC,8BAA8B,CAAC;KAC3C,OAAO,CAAC,OAAO,EAAE,eAAe,EAAE,4BAA4B,CAAC,CAAC;AAEnE,OAAO;KACJ,OAAO,CAAC,MAAM,CAAC;KACf,WAAW,CAAC,uCAAuC,CAAC;KACpD,QAAQ,CAAC,QAAQ,EAAE,6BAA6B,CAAC;KACjD,MAAM,CAAC,aAAa,EAAE,oBAAoB,CAAC;KAC3C,MAAM,CAAC,KAAK,EAAE,IAAY,EAAE,OAAY,E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AC;KACrB,WAAW,CAAC,oCAAoC,CAAC;KACjD,QAAQ,CAAC,OAAO,EAAE,gDAAgD,CAAC;KACnE,MAAM,CAAC,KAAK,EAAE,GAAW,EAAE,EAAE;IAC5B,MAAM,gBAAgB,CAAC,GAAG,CAAC,CAAC;AAC9B,CAAC,CAAC,CAAC;AAEL,OAAO;KACJ,OAAO,CAAC,YAAY,CAAC;KACrB,WAAW,CAAC,oCAAoC,CAAC;KACjD,QAAQ,CAAC,OAAO,EAAE,2CAA2C,CAAC;KAC9D,QAAQ,CAAC,SAAS,EAAE,qBAAqB,CAAC;KAC1C,MAAM,CAAC,KAAK,EAAE,GAAW,EAAE,KAAa,EAAE,EAAE;IAC3C,MAAM,gBAAgB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { Command } from 'commander';
|
|
4
|
+
import chalk from 'chalk';
|
|
4
5
|
import { playCommand } from './commands/play.js';
|
|
5
6
|
import { spinCommand } from './commands/spin.js';
|
|
6
7
|
import { initCommand } from './commands/init.js';
|
|
@@ -15,7 +16,7 @@ const program = new Command();
|
|
|
15
16
|
program
|
|
16
17
|
.name('git-slot-machine')
|
|
17
18
|
.description('Git commit hash slot machine')
|
|
18
|
-
.version('1.
|
|
19
|
+
.version('1.3.0', '-v, --version', 'Output the current version');
|
|
19
20
|
|
|
20
21
|
program
|
|
21
22
|
.command('play')
|
|
@@ -77,7 +78,7 @@ program
|
|
|
77
78
|
await authStatusCommand();
|
|
78
79
|
});
|
|
79
80
|
|
|
80
|
-
// Sync
|
|
81
|
+
// Sync commands
|
|
81
82
|
program
|
|
82
83
|
.command('sync')
|
|
83
84
|
.description('Sync balance with API')
|
|
@@ -85,22 +86,43 @@ program
|
|
|
85
86
|
await syncCommand();
|
|
86
87
|
});
|
|
87
88
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
.
|
|
91
|
-
.
|
|
89
|
+
program
|
|
90
|
+
.command('sync:enable')
|
|
91
|
+
.description('Enable automatic API sync')
|
|
92
|
+
.action(async () => {
|
|
93
|
+
await configSetCommand('sync-enabled', 'true');
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
program
|
|
97
|
+
.command('sync:disable')
|
|
98
|
+
.description('Disable automatic API sync')
|
|
99
|
+
.action(async () => {
|
|
100
|
+
await configSetCommand('sync-enabled', 'false');
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
// Username commands
|
|
104
|
+
program
|
|
105
|
+
.command('username:set')
|
|
106
|
+
.description('Set GitHub username')
|
|
107
|
+
.argument('<username>', 'Your GitHub username')
|
|
108
|
+
.action(async (username: string) => {
|
|
109
|
+
const { setGitHubUsername } = await import('./config.js');
|
|
110
|
+
setGitHubUsername(username);
|
|
111
|
+
console.log(chalk.green(`GitHub username set to: ${username}`));
|
|
112
|
+
});
|
|
92
113
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
.
|
|
114
|
+
// Config commands (advanced)
|
|
115
|
+
program
|
|
116
|
+
.command('config:get')
|
|
117
|
+
.description('Get configuration value (advanced)')
|
|
96
118
|
.argument('<key>', 'Configuration key (api-url, sync-enabled, all)')
|
|
97
119
|
.action(async (key: string) => {
|
|
98
120
|
await configGetCommand(key);
|
|
99
121
|
});
|
|
100
122
|
|
|
101
|
-
|
|
102
|
-
.command('set')
|
|
103
|
-
.description('Set configuration value')
|
|
123
|
+
program
|
|
124
|
+
.command('config:set')
|
|
125
|
+
.description('Set configuration value (advanced)')
|
|
104
126
|
.argument('<key>', 'Configuration key (api-url, sync-enabled)')
|
|
105
127
|
.argument('<value>', 'Configuration value')
|
|
106
128
|
.action(async (key: string, value: string) => {
|