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.
Files changed (51) hide show
  1. package/CHANGELOG.md +43 -0
  2. package/README.md +8 -0
  3. package/dist/animation/slotMachine.d.ts +1 -1
  4. package/dist/animation/slotMachine.d.ts.map +1 -1
  5. package/dist/animation/slotMachine.js +15 -22
  6. package/dist/animation/slotMachine.js.map +1 -1
  7. package/dist/api.js +11 -19
  8. package/dist/api.js.map +1 -1
  9. package/dist/balance.js +7 -46
  10. package/dist/balance.js.map +1 -1
  11. package/dist/commands/auth.js +40 -48
  12. package/dist/commands/auth.js.map +1 -1
  13. package/dist/commands/balance.js +14 -20
  14. package/dist/commands/balance.js.map +1 -1
  15. package/dist/commands/config.js +19 -26
  16. package/dist/commands/config.js.map +1 -1
  17. package/dist/commands/init.d.ts.map +1 -1
  18. package/dist/commands/init.js +71 -99
  19. package/dist/commands/init.js.map +1 -1
  20. package/dist/commands/play.js +31 -37
  21. package/dist/commands/play.js.map +1 -1
  22. package/dist/commands/spin.js +6 -9
  23. package/dist/commands/spin.js.map +1 -1
  24. package/dist/commands/sync.js +23 -29
  25. package/dist/commands/sync.js.map +1 -1
  26. package/dist/commands/test.js +3 -6
  27. package/dist/commands/test.js.map +1 -1
  28. package/dist/config.js +34 -56
  29. package/dist/config.js.map +1 -1
  30. package/dist/index.js +21 -23
  31. package/dist/index.js.map +1 -1
  32. package/dist/patterns.js +3 -7
  33. package/dist/patterns.js.map +1 -1
  34. package/dist/templates/post-commit.js +1 -4
  35. package/dist/templates/post-commit.js.map +1 -1
  36. package/dist/utils/git.js +7 -12
  37. package/dist/utils/git.js.map +1 -1
  38. package/package.json +2 -1
  39. package/src/animation/slotMachine.ts +1 -1
  40. package/src/api.ts +1 -1
  41. package/src/commands/auth.ts +2 -2
  42. package/src/commands/balance.ts +1 -1
  43. package/src/commands/config.ts +1 -1
  44. package/src/commands/init.ts +19 -7
  45. package/src/commands/play.ts +5 -5
  46. package/src/commands/spin.ts +2 -2
  47. package/src/commands/sync.ts +2 -2
  48. package/src/commands/test.ts +1 -1
  49. package/src/index.ts +8 -8
  50. package/src/patterns.test.ts +1 -1
  51. package/tsconfig.json +2 -1
@@ -5,7 +5,7 @@ import {
5
5
  isSyncEnabled,
6
6
  setSyncEnabled,
7
7
  getConfig
8
- } from '../config';
8
+ } from '../config.js';
9
9
 
10
10
  export async function configGetCommand(key: string): Promise<void> {
11
11
  try {
@@ -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
- console.log(chalk.dim(' • Commit hash (7 and 40 character versions)'));
154
- console.log(chalk.dim(' • Repository URL, owner, and name'));
155
- console.log(chalk.dim(' • GitHub username'));
156
- console.log(chalk.dim(' Pattern type, payout, and balance'));
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'));
@@ -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 {
@@ -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;
@@ -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 {
@@ -1,4 +1,4 @@
1
- import { playCommand } from './play';
1
+ import { playCommand } from './play.js';
2
2
 
3
3
  interface TestOptions {
4
4
  small?: boolean;
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
 
@@ -1,4 +1,4 @@
1
- import { detectPattern, PatternType } from './patterns';
1
+ import { detectPattern, PatternType } from './patterns.js';
2
2
 
3
3
  describe('Pattern Detection', () => {
4
4
  it('detects all same character', () => {
package/tsconfig.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "target": "ES2022",
4
- "module": "commonjs",
4
+ "module": "ES2022",
5
+ "moduleResolution": "node",
5
6
  "lib": ["ES2022"],
6
7
  "outDir": "./dist",
7
8
  "rootDir": "./src",