@shakecodeslikecray/whiterose 1.0.1 → 1.0.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/cli/index.js CHANGED
@@ -1,10 +1,11 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync, mkdirSync, writeFileSync, readdirSync, readFileSync, statSync, rmSync, mkdtempSync, realpathSync } from 'fs';
3
- import { join, isAbsolute, resolve, basename, relative, dirname } from 'path';
2
+ import { readFileSync, existsSync, mkdirSync, writeFileSync, readdirSync, statSync, rmSync, mkdtempSync, realpathSync } from 'fs';
3
+ import { join, dirname, isAbsolute, resolve, basename, relative } from 'path';
4
4
  import chalk3 from 'chalk';
5
5
  import * as readline from 'readline';
6
6
  import { Command } from 'commander';
7
7
  import * as p3 from '@clack/prompts';
8
+ import { fileURLToPath } from 'url';
8
9
  import { execa } from 'execa';
9
10
  import { homedir, tmpdir } from 'os';
10
11
  import fg3 from 'fast-glob';
@@ -2934,7 +2935,7 @@ function parseListItems(content) {
2934
2935
  return items;
2935
2936
  }
2936
2937
  function parseFeatureSection(section) {
2937
- const titleMatch = section.match(/###\s+([^\[\n]+)(?:\s*\[([^\]]+)\])?/);
2938
+ const titleMatch = section.match(/###\s+([^[\n]+)(?:\s*\[([^\]]+)\])?/);
2938
2939
  if (!titleMatch) return null;
2939
2940
  const name = titleMatch[1].trim();
2940
2941
  const badge = titleMatch[2]?.trim().toLowerCase();
@@ -5473,7 +5474,7 @@ var Dashboard = ({ bugs, onSelectCategory }) => {
5473
5474
  color: categoryColors[category] || "white"
5474
5475
  });
5475
5476
  }
5476
- useInput((input, key) => {
5477
+ useInput((_input, key) => {
5477
5478
  if (key.upArrow) {
5478
5479
  setSelectedIndex((i) => Math.max(0, i - 1));
5479
5480
  } else if (key.downArrow) {
@@ -6539,7 +6540,7 @@ async function startFixTUI(bugs, config, options, cwd) {
6539
6540
  const handleExit = () => {
6540
6541
  resolve6();
6541
6542
  };
6542
- const { unmount, waitUntilExit } = render(
6543
+ const { waitUntilExit } = render(
6543
6544
  /* @__PURE__ */ jsx(
6544
6545
  App,
6545
6546
  {
@@ -6551,7 +6552,7 @@ async function startFixTUI(bugs, config, options, cwd) {
6551
6552
  }
6552
6553
  )
6553
6554
  );
6554
- waitUntilExit().then(resolve6).catch(reject);
6555
+ waitUntilExit().then(resolve6).catch(() => resolve6());
6555
6556
  });
6556
6557
  }
6557
6558
 
@@ -7002,7 +7003,7 @@ function mapSarifLevel(level) {
7002
7003
  return "medium";
7003
7004
  }
7004
7005
  }
7005
- async function refreshCommand(options) {
7006
+ async function refreshCommand(_options) {
7006
7007
  const cwd = process.cwd();
7007
7008
  const whiterosePath = join(cwd, ".whiterose");
7008
7009
  if (!existsSync(whiterosePath)) {
@@ -7255,6 +7256,9 @@ async function clearCommand(options) {
7255
7256
  }
7256
7257
 
7257
7258
  // src/cli/index.ts
7259
+ var __filename$1 = fileURLToPath(import.meta.url);
7260
+ var __dirname$1 = dirname(__filename$1);
7261
+ var pkg = JSON.parse(readFileSync(join(__dirname$1, "../../package.json"), "utf-8"));
7258
7262
  process.setMaxListeners(50);
7259
7263
  var BANNER = `
7260
7264
  ${chalk3.red("\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557")}
@@ -7267,7 +7271,7 @@ ${chalk3.red(" \u255A\u2550\u2550\u255D\u255A\u2550\u2550\u255D \u255A\u2550\u25
7267
7271
  ${chalk3.dim(` "I've been staring at your code for a long time."`)}
7268
7272
  `;
7269
7273
  var program = new Command();
7270
- program.name("whiterose").description("AI-powered bug hunter that uses your existing LLM subscription").version("0.2.7").hook("preAction", () => {
7274
+ program.name("whiterose").description("AI-powered bug hunter that uses your existing LLM subscription").version(pkg.version).hook("preAction", () => {
7271
7275
  const args = process.argv.slice(2);
7272
7276
  if (!args.includes("--help") && !args.includes("-h") && args.length > 0) {
7273
7277
  console.log(BANNER);