git-slot-machine 1.1.0 → 1.1.2
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 +43 -0
- package/README.md +8 -0
- package/dist/animation/slotMachine.d.ts +1 -1
- package/dist/animation/slotMachine.d.ts.map +1 -1
- package/dist/animation/slotMachine.js +15 -22
- package/dist/animation/slotMachine.js.map +1 -1
- package/dist/api.js +11 -19
- package/dist/api.js.map +1 -1
- package/dist/balance.js +7 -46
- package/dist/balance.js.map +1 -1
- package/dist/commands/auth.js +40 -48
- package/dist/commands/auth.js.map +1 -1
- package/dist/commands/balance.js +14 -20
- package/dist/commands/balance.js.map +1 -1
- package/dist/commands/config.js +19 -26
- package/dist/commands/config.js.map +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +71 -99
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/play.js +31 -37
- package/dist/commands/play.js.map +1 -1
- package/dist/commands/spin.js +6 -9
- package/dist/commands/spin.js.map +1 -1
- package/dist/commands/sync.js +23 -29
- package/dist/commands/sync.js.map +1 -1
- package/dist/commands/test.js +3 -6
- package/dist/commands/test.js.map +1 -1
- package/dist/config.js +34 -56
- package/dist/config.js.map +1 -1
- package/dist/index.js +21 -23
- package/dist/index.js.map +1 -1
- package/dist/patterns.js +3 -7
- package/dist/patterns.js.map +1 -1
- package/dist/templates/post-commit.js +1 -4
- package/dist/templates/post-commit.js.map +1 -1
- package/dist/utils/git.js +7 -12
- package/dist/utils/git.js.map +1 -1
- package/package.json +2 -1
- package/src/animation/slotMachine.ts +1 -1
- package/src/api.ts +1 -1
- package/src/commands/auth.ts +2 -2
- package/src/commands/balance.ts +1 -1
- package/src/commands/config.ts +1 -1
- package/src/commands/init.ts +19 -7
- package/src/commands/play.ts +5 -5
- package/src/commands/spin.ts +2 -2
- package/src/commands/sync.ts +2 -2
- package/src/commands/test.ts +1 -1
- package/src/index.ts +8 -8
- package/src/patterns.test.ts +1 -1
- package/tsconfig.json +2 -1
package/src/commands/config.ts
CHANGED
package/src/commands/init.ts
CHANGED
|
@@ -2,9 +2,9 @@ import * as fs from 'fs';
|
|
|
2
2
|
import * as path from 'path';
|
|
3
3
|
import * as readline from 'readline';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
|
-
import { isGitRepo } from '../utils/git';
|
|
6
|
-
import { POST_COMMIT_HOOK } from '../templates/post-commit';
|
|
7
|
-
import { getRepoInfo, setGitHubUsername, getGitHubUsername, setPrivateRepo } from '../config';
|
|
5
|
+
import { isGitRepo } from '../utils/git.js';
|
|
6
|
+
import { POST_COMMIT_HOOK } from '../templates/post-commit.js';
|
|
7
|
+
import { getRepoInfo, setGitHubUsername, getGitHubUsername, setPrivateRepo } from '../config.js';
|
|
8
8
|
|
|
9
9
|
async function isRepoPublic(owner: string, repo: string): Promise<boolean | null> {
|
|
10
10
|
try {
|
|
@@ -150,10 +150,22 @@ export async function initCommand(): Promise<void> {
|
|
|
150
150
|
console.log(chalk.dim(` git-slot-machine auth login ${repoInfo?.owner || 'your-github-username'}`));
|
|
151
151
|
console.log();
|
|
152
152
|
console.log(chalk.yellow('What gets sent to the server:'));
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
|
|
154
|
+
if (usePrivacyMode) {
|
|
155
|
+
// Privacy mode - show what is NOT sent
|
|
156
|
+
console.log(chalk.green(' ✓ Commit hash (7 and 40 character versions)'));
|
|
157
|
+
console.log(chalk.red(' ✗ Repository URL, owner, and name'));
|
|
158
|
+
console.log(chalk.dim(' (Sent as "private/private" instead)'));
|
|
159
|
+
console.log(chalk.green(' ✓ GitHub username'));
|
|
160
|
+
console.log(chalk.green(' ✓ Pattern type, payout, and balance'));
|
|
161
|
+
} else {
|
|
162
|
+
// Public mode - everything is sent
|
|
163
|
+
console.log(chalk.green(' ✓ Commit hash (7 and 40 character versions)'));
|
|
164
|
+
console.log(chalk.green(' ✓ Repository URL, owner, and name'));
|
|
165
|
+
console.log(chalk.green(' ✓ GitHub username'));
|
|
166
|
+
console.log(chalk.green(' ✓ Pattern type, payout, and balance'));
|
|
167
|
+
}
|
|
168
|
+
|
|
157
169
|
console.log();
|
|
158
170
|
console.log(chalk.dim('You can disable API sync anytime:'));
|
|
159
171
|
console.log(chalk.dim(' git-slot-machine config set sync-enabled false'));
|
package/src/commands/play.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { detectPattern } from '../patterns';
|
|
2
|
-
import { animateSlotMachine, animateSmallMode } from '../animation/slotMachine';
|
|
3
|
-
import { getBalance, updateBalance, setBalance } from '../balance';
|
|
4
|
-
import { sendPlayToAPI } from '../api';
|
|
5
|
-
import { getRepoInfo, getGitHubUsername } from '../config';
|
|
1
|
+
import { detectPattern } from '../patterns.js';
|
|
2
|
+
import { animateSlotMachine, animateSmallMode } from '../animation/slotMachine.js';
|
|
3
|
+
import { getBalance, updateBalance, setBalance } from '../balance.js';
|
|
4
|
+
import { sendPlayToAPI } from '../api.js';
|
|
5
|
+
import { getRepoInfo, getGitHubUsername } from '../config.js';
|
|
6
6
|
import chalk from 'chalk';
|
|
7
7
|
|
|
8
8
|
interface PlayOptions {
|
package/src/commands/spin.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getCurrentCommitHash, getCurrentCommitFullHash } from '../utils/git';
|
|
2
|
-
import { playCommand } from './play';
|
|
1
|
+
import { getCurrentCommitHash, getCurrentCommitFullHash } from '../utils/git.js';
|
|
2
|
+
import { playCommand } from './play.js';
|
|
3
3
|
|
|
4
4
|
interface SpinOptions {
|
|
5
5
|
small?: boolean;
|
package/src/commands/sync.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { getBalance as getApiBalance } from '../api';
|
|
3
|
-
import { getBalance as getLocalBalance } from '../balance';
|
|
2
|
+
import { getBalance as getApiBalance } from '../api.js';
|
|
3
|
+
import { getBalance as getLocalBalance } from '../balance.js';
|
|
4
4
|
|
|
5
5
|
export async function syncCommand(): Promise<void> {
|
|
6
6
|
try {
|
package/src/commands/test.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
import { Command } from 'commander';
|
|
4
|
-
import { playCommand } from './commands/play';
|
|
5
|
-
import { spinCommand } from './commands/spin';
|
|
6
|
-
import { initCommand } from './commands/init';
|
|
7
|
-
import { balanceCommand } from './commands/balance';
|
|
8
|
-
import { testCommand } from './commands/test';
|
|
9
|
-
import { authLoginCommand, authLogoutCommand, authStatusCommand } from './commands/auth';
|
|
10
|
-
import { syncCommand } from './commands/sync';
|
|
11
|
-
import { configGetCommand, configSetCommand } from './commands/config';
|
|
4
|
+
import { playCommand } from './commands/play.js';
|
|
5
|
+
import { spinCommand } from './commands/spin.js';
|
|
6
|
+
import { initCommand } from './commands/init.js';
|
|
7
|
+
import { balanceCommand } from './commands/balance.js';
|
|
8
|
+
import { testCommand } from './commands/test.js';
|
|
9
|
+
import { authLoginCommand, authLogoutCommand, authStatusCommand } from './commands/auth.js';
|
|
10
|
+
import { syncCommand } from './commands/sync.js';
|
|
11
|
+
import { configGetCommand, configSetCommand } from './commands/config.js';
|
|
12
12
|
|
|
13
13
|
const program = new Command();
|
|
14
14
|
|
package/src/patterns.test.ts
CHANGED