brakit 0.9.1 → 0.9.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/dist/api.js CHANGED
@@ -2241,7 +2241,7 @@ var AnalysisEngine = class {
2241
2241
  };
2242
2242
 
2243
2243
  // src/index.ts
2244
- var VERSION = "0.9.1";
2244
+ var VERSION = "0.9.2";
2245
2245
  export {
2246
2246
  AdapterRegistry,
2247
2247
  AnalysisEngine,
@@ -138,7 +138,7 @@ var init_features = __esm({
138
138
  MAX_TIMELINE_EVENTS = 20;
139
139
  MAX_RESOLVED_DISPLAY = 5;
140
140
  ENRICHMENT_SEVERITY_FILTER = ["critical", "warning"];
141
- MCP_SERVER_VERSION = "0.9.1";
141
+ MCP_SERVER_VERSION = "0.9.2";
142
142
  RECOVERY_WINDOW_MS = 5 * 60 * 1e3;
143
143
  PORT_MIN = 1;
144
144
  PORT_MAX = 65535;
@@ -1063,7 +1063,7 @@ import { defineCommand } from "citty";
1063
1063
  import { resolve as resolve3, join as join3, dirname } from "path";
1064
1064
  import { readFile as readFile4, writeFile as writeFile3 } from "fs/promises";
1065
1065
  import { execSync } from "child_process";
1066
- import { existsSync as existsSync5 } from "fs";
1066
+ import { existsSync as existsSync5, readFileSync as readFileSync3 } from "fs";
1067
1067
  import pc from "picocolors";
1068
1068
 
1069
1069
  // src/store/issue-store.ts
@@ -1812,7 +1812,7 @@ init_constants();
1812
1812
  init_endpoint();
1813
1813
 
1814
1814
  // src/index.ts
1815
- var VERSION = "0.9.1";
1815
+ var VERSION = "0.9.2";
1816
1816
 
1817
1817
  // src/cli/commands/install.ts
1818
1818
  init_constants();
@@ -1915,6 +1915,14 @@ var install_default = defineCommand({
1915
1915
  }
1916
1916
  process.exit(1);
1917
1917
  }
1918
+ const firstNode = nodeProjects[0];
1919
+ if (isFrontendOnly(firstNode.dir)) {
1920
+ console.log(pc.yellow(" \u26A0 This looks like a frontend-only app (React, Vue, etc.)."));
1921
+ console.log(pc.dim(" Brakit instruments your backend server, not the browser."));
1922
+ console.log(pc.dim(" Install brakit in your backend project instead (Express, Fastify, Next.js, etc.)."));
1923
+ console.log();
1924
+ process.exit(1);
1925
+ }
1918
1926
  for (const p of nodeProjects) {
1919
1927
  const node = p.node;
1920
1928
  const suffix = p.relDir === "." ? "" : ` in ${p.relDir}`;
@@ -1951,9 +1959,8 @@ var install_default = defineCommand({
1951
1959
  }
1952
1960
  }
1953
1961
  console.log();
1954
- const port = nodeProjects[0].node?.defaultPort ?? 3e3;
1955
1962
  console.log(pc.dim(" Start your app and visit:"));
1956
- console.log(pc.bold(` http://localhost:${port}/__brakit`));
1963
+ console.log(pc.bold(" http://localhost:<your-port>/__brakit"));
1957
1964
  if (pythonProjects.length > 0) {
1958
1965
  const pyLabel = pythonProjects.map((p) => p.relDir).join(", ");
1959
1966
  console.log();
@@ -2105,6 +2112,20 @@ function findGitRoot(startDir) {
2105
2112
  dir = parent;
2106
2113
  }
2107
2114
  }
2115
+ var FRONTEND_ONLY_DEPS = ["react", "vue", "svelte", "@angular/core", "solid-js", "preact"];
2116
+ var SERVER_DEPS = ["express", "fastify", "hono", "koa", "nest", "next", "@remix-run/dev", "nuxt", "astro"];
2117
+ function isFrontendOnly(rootDir) {
2118
+ try {
2119
+ const raw = readFileSync3(join3(rootDir, "package.json"), "utf-8");
2120
+ const pkg = JSON.parse(raw);
2121
+ const allDeps = { ...pkg.dependencies, ...pkg.devDependencies };
2122
+ const hasFrontend = FRONTEND_ONLY_DEPS.some((d) => d in allDeps);
2123
+ const hasServer = SERVER_DEPS.some((d) => d in allDeps);
2124
+ return hasFrontend && !hasServer;
2125
+ } catch {
2126
+ return false;
2127
+ }
2128
+ }
2108
2129
  function printManualInstructions(framework) {
2109
2130
  console.log(pc.yellow(" \u26A0 Could not auto-detect entry file."));
2110
2131
  console.log();
@@ -2140,7 +2161,7 @@ import { spawn } from "child_process";
2140
2161
  init_features();
2141
2162
  import { homedir as homedir2, platform } from "os";
2142
2163
  import { join as join4 } from "path";
2143
- import { existsSync as existsSync6, readFileSync as readFileSync3, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "fs";
2164
+ import { existsSync as existsSync6, readFileSync as readFileSync4, writeFileSync as writeFileSync3, mkdirSync as mkdirSync3 } from "fs";
2144
2165
  import { randomUUID as randomUUID2 } from "crypto";
2145
2166
  var IS_WINDOWS = platform() === "win32";
2146
2167
  var CONFIG_DIR = join4(homedir2(), ".brakit");
@@ -2148,7 +2169,7 @@ var CONFIG_PATH = join4(CONFIG_DIR, "config.json");
2148
2169
  function readConfig() {
2149
2170
  try {
2150
2171
  if (!existsSync6(CONFIG_PATH)) return null;
2151
- return JSON.parse(readFileSync3(CONFIG_PATH, "utf-8"));
2172
+ return JSON.parse(readFileSync4(CONFIG_PATH, "utf-8"));
2152
2173
  } catch {
2153
2174
  return null;
2154
2175
  }
@@ -51,7 +51,7 @@ var MAX_DISCOVERY_DEPTH = 5;
51
51
  var MAX_TIMELINE_EVENTS = 20;
52
52
  var MAX_RESOLVED_DISPLAY = 5;
53
53
  var ENRICHMENT_SEVERITY_FILTER = ["critical", "warning"];
54
- var MCP_SERVER_VERSION = "0.9.1";
54
+ var MCP_SERVER_VERSION = "0.9.2";
55
55
  var RECOVERY_WINDOW_MS = 5 * 60 * 1e3;
56
56
  var PORT_MIN = 1;
57
57
  var PORT_MAX = 65535;
@@ -3956,7 +3956,7 @@ var init_src = __esm({
3956
3956
  init_engine();
3957
3957
  init_insights2();
3958
3958
  init_insights();
3959
- VERSION = "0.9.1";
3959
+ VERSION = "0.9.2";
3960
3960
  }
3961
3961
  });
3962
3962
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "brakit",
3
- "version": "0.9.1",
3
+ "version": "0.9.2",
4
4
  "description": "See what your API is really doing. Security scanning, N+1 detection, duplicate calls, DB queries — one command, zero config.",
5
5
  "type": "module",
6
6
  "bin": {