@rayburst/cli 0.4.10 → 0.4.11

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.
@@ -1977,6 +1977,7 @@ function generateChangeHistoryEntry(diff, trigger, gitCommitHash, newPlanData) {
1977
1977
  import chalk2 from "chalk";
1978
1978
  import * as fs3 from "fs";
1979
1979
  import * as path5 from "path";
1980
+ import chokidar from "chokidar";
1980
1981
  function rayburstPlugin(options = {}) {
1981
1982
  const {
1982
1983
  enabled = process.env.CI !== "true",
@@ -1988,6 +1989,7 @@ function rayburstPlugin(options = {}) {
1988
1989
  let isAnalyzing = false;
1989
1990
  let lastGitState = null;
1990
1991
  let gitPollInterval = null;
1992
+ let fileWatcher = null;
1991
1993
  const checkGitState = (projectPath) => {
1992
1994
  try {
1993
1995
  const gitDir = path5.join(projectPath, ".git");
@@ -2099,7 +2101,7 @@ function rayburstPlugin(options = {}) {
2099
2101
  console.log(chalk2.blue("[Rayburst] Starting code analysis..."));
2100
2102
  await runAnalysis();
2101
2103
  },
2102
- // Hook 3: Watch for changes using Vite's built-in watcher
2104
+ // Hook 3: Watch for changes using dedicated Chokidar watcher
2103
2105
  configureServer(server) {
2104
2106
  if (!enabled) return;
2105
2107
  console.log(chalk2.blue("[Rayburst] Configuring file watcher..."));
@@ -2123,11 +2125,32 @@ function rayburstPlugin(options = {}) {
2123
2125
  runAnalysis(filePath);
2124
2126
  }, debounceMs);
2125
2127
  };
2126
- console.log(chalk2.blue("[Rayburst] Registering watcher event handlers..."));
2127
- server.watcher.on("change", handleFileChange);
2128
- server.watcher.on("add", handleFileChange);
2129
- server.watcher.on("unlink", handleFileChange);
2130
- console.log(chalk2.blue("[Rayburst] File watcher configured successfully"));
2128
+ const srcPath = path5.join(config.root, "src");
2129
+ if (fs3.existsSync(srcPath)) {
2130
+ console.log(chalk2.blue("[Rayburst] Creating dedicated file watcher..."));
2131
+ fileWatcher = chokidar.watch(srcPath, {
2132
+ ignored: [
2133
+ "**/node_modules/**",
2134
+ "**/.rayburst/**",
2135
+ "**/*.test.*",
2136
+ "**/*.spec.*",
2137
+ "**/.git/**"
2138
+ ],
2139
+ persistent: true,
2140
+ ignoreInitial: true,
2141
+ awaitWriteFinish: {
2142
+ stabilityThreshold: 100,
2143
+ pollInterval: 100
2144
+ }
2145
+ });
2146
+ fileWatcher.on("ready", () => {
2147
+ console.log(chalk2.green("[Rayburst] File watcher is ready and monitoring changes"));
2148
+ });
2149
+ fileWatcher.on("change", handleFileChange);
2150
+ fileWatcher.on("add", handleFileChange);
2151
+ fileWatcher.on("unlink", handleFileChange);
2152
+ console.log(chalk2.dim(`[Rayburst] Watching directory: ${srcPath}`));
2153
+ }
2131
2154
  const gitHeadPath = path5.join(config.root, ".git", "HEAD");
2132
2155
  if (fs3.existsSync(gitHeadPath)) {
2133
2156
  server.watcher.add(gitHeadPath);
@@ -2147,9 +2170,9 @@ function rayburstPlugin(options = {}) {
2147
2170
  }, 5e3);
2148
2171
  }
2149
2172
  return () => {
2150
- server.watcher.off("change", handleFileChange);
2151
- server.watcher.off("add", handleFileChange);
2152
- server.watcher.off("unlink", handleFileChange);
2173
+ if (fileWatcher) {
2174
+ fileWatcher.close();
2175
+ }
2153
2176
  if (debounceTimer) {
2154
2177
  clearTimeout(debounceTimer);
2155
2178
  }
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ import {
9
9
  readLocalMeta,
10
10
  writeLocalAnalysis,
11
11
  writeLocalMeta
12
- } from "./chunk-UCHCYCAU.js";
12
+ } from "./chunk-DWQK6WKX.js";
13
13
  export {
14
14
  addGitignoreEntry,
15
15
  analyzeProject,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  rayburstPlugin
3
- } from "./chunk-UCHCYCAU.js";
3
+ } from "./chunk-DWQK6WKX.js";
4
4
  export {
5
5
  rayburstPlugin
6
6
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rayburst/cli",
3
- "version": "0.4.10",
3
+ "version": "0.4.11",
4
4
  "description": "Rayburst - Automatic code analysis for TypeScript/JavaScript projects via Vite plugin",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,6 +44,7 @@
44
44
  "dependencies": {
45
45
  "@rayburst/cli": "^0.4.9",
46
46
  "chalk": "^5.3.0",
47
+ "chokidar": "^3.6.0",
47
48
  "ts-morph": "^21.0.1",
48
49
  "zod": "^4.2.0"
49
50
  },