@rigstate/cli 0.6.3 → 0.6.8

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.
@@ -36,27 +36,50 @@ export function createFileWatcher(watchPath: string): FileWatcher {
36
36
  const absolutePath = path.resolve(process.cwd(), watchPath);
37
37
 
38
38
  watcher = chokidar.watch(absolutePath, {
39
- ignored: (path) => {
40
- // Always ignore node_modules
41
- if (path.includes('node_modules')) return true;
42
- if (path.includes('.git')) return true;
43
- if (path.includes('.next')) return true;
44
- if (path.includes('dist')) return true;
45
- if (path.includes('build')) return true;
46
- if (path.includes('.rigstate')) return true;
47
- if (path.includes('coverage')) return true;
39
+ ignored: (absolutePath) => {
40
+ // Get relative path for cleaner matching
41
+ const relPath = path.relative(process.cwd(), absolutePath);
42
+
43
+ // Common directories to ignore (exact matches on path segments)
44
+ const ignoredDirs = new Set([
45
+ 'node_modules',
46
+ '.git',
47
+ '.next',
48
+ '.turbo',
49
+ 'dist',
50
+ 'build',
51
+ '.rigstate',
52
+ 'coverage',
53
+ '.DS_Store',
54
+ 'tmp',
55
+ 'temp',
56
+ 'vendor',
57
+ '.cache',
58
+ 'public' // Usually static assets, not code
59
+ ]);
60
+
61
+ // Check if any segment of the path matches an ignored directory
62
+ const segments = relPath.split(path.sep);
63
+ if (segments.some(s => ignoredDirs.has(s))) {
64
+ return true;
65
+ }
66
+
67
+ // Ignore dotfiles (except .env maybe, but for now safe to ignore secret/config files)
68
+ // Actually, let's keep .cursorrules and similar if needed, but generally ignore hidden
69
+ // if (path.basename(absolutePath).startsWith('.') && !segments.some(s => s === '.cursor')) return true;
70
+
48
71
  return false;
49
72
  },
50
73
  persistent: true,
51
74
  ignoreInitial: true,
52
- depth: 15,
75
+ ignorePermissionErrors: true, // Don't crash on EPERM
76
+ depth: 20,
53
77
  awaitWriteFinish: {
54
- stabilityThreshold: 200,
78
+ stabilityThreshold: 300,
55
79
  pollInterval: 100
56
80
  },
57
- usePolling: false, // Use native events when possible
58
- interval: 300,
59
- binaryInterval: 1000
81
+ usePolling: false,
82
+ atomic: true // Handle atomic writes (like vim/saving) better
60
83
  });
61
84
 
62
85
  watcher.on('change', (filePath: string) => {
package/src/index.ts CHANGED
@@ -23,6 +23,8 @@ import { createOverrideCommand } from './commands/override.js';
23
23
  import { checkVersion } from './utils/version.js';
24
24
  import dotenv from 'dotenv';
25
25
 
26
+ import { createIdeaCommand } from './commands/idea.js';
27
+
26
28
  // Load environment variables
27
29
  dotenv.config();
28
30
 
@@ -52,6 +54,7 @@ program.addCommand(createMcpCommand());
52
54
  program.addCommand(createNexusCommand());
53
55
  program.addCommand(createSyncRulesCommand());
54
56
  program.addCommand(createOverrideCommand());
57
+ program.addCommand(createIdeaCommand());
55
58
 
56
59
  program.hook('preAction', async () => {
57
60
  await checkVersion();