@wrongstack/techstack 1.0.5 → 1.0.7

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 (2) hide show
  1. package/dist/index.js +18 -18
  2. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -431,7 +431,7 @@ function stripInlineComment(line, marker = "#") {
431
431
  escaped = false;
432
432
  continue;
433
433
  }
434
- if (character === "\\" && quote === '"') {
434
+ if (character === "\\" && quote !== void 0) {
435
435
  escaped = true;
436
436
  continue;
437
437
  }
@@ -639,7 +639,7 @@ var elixirAdapter = new ElixirAdapter();
639
639
  // src/adapters/go.ts
640
640
  import { readFileSync as readFileSync4 } from "node:fs";
641
641
  function cleanGoVersion(v) {
642
- return v.replace(/^v/i, "");
642
+ return v.replace(/^v/i, "").replace(/\/go\.mod$/i, "");
643
643
  }
644
644
  function parseGoMod(content) {
645
645
  const deps = [];
@@ -648,7 +648,7 @@ function parseGoMod(content) {
648
648
  for (const raw of lines) {
649
649
  const line = raw.trim();
650
650
  if (line === "" || line.startsWith("//")) continue;
651
- if (line.startsWith("require (") && line.endsWith("(")) {
651
+ if (/^require\s*\(/.test(line)) {
652
652
  inRequireBlock = true;
653
653
  continue;
654
654
  }
@@ -682,7 +682,7 @@ function parseGoReplacements(content) {
682
682
  let inBlock = false;
683
683
  for (const raw of content.split("\n")) {
684
684
  const line = raw.trim();
685
- if (line === "replace (") {
685
+ if (/^replace\s*\(/.test(line)) {
686
686
  inBlock = true;
687
687
  continue;
688
688
  }
@@ -2127,7 +2127,7 @@ async function runPipAudit(workspaceRoot2, runner = defaultAuditCommandRunner) {
2127
2127
  function parsePipAuditOutput(result) {
2128
2128
  const advisories = [];
2129
2129
  let detailLines = [];
2130
- if (result.status === 0) {
2130
+ if (result.status === 0 || result.stdout && result.stdout.trim().startsWith("[")) {
2131
2131
  try {
2132
2132
  const json = JSON.parse(result.stdout || "[]");
2133
2133
  for (const entry of json) {
@@ -2162,7 +2162,7 @@ async function runCargoAudit(workspaceRoot2, runner = defaultAuditCommandRunner)
2162
2162
  function parseCargoAuditOutput(result) {
2163
2163
  const advisories = [];
2164
2164
  let detailLines = [];
2165
- if (result.status === 0) {
2165
+ if (result.status === 0 || result.stdout && result.stdout.trim().startsWith("{")) {
2166
2166
  try {
2167
2167
  const json = JSON.parse(result.stdout || "{}");
2168
2168
  const vulnerabilities = json.vulnerabilities;
@@ -2240,7 +2240,7 @@ async function runComposerAudit(workspaceRoot2, runner = defaultAuditCommandRunn
2240
2240
  const result = await runner("composer", ["audit", "--format=json"], workspaceRoot2);
2241
2241
  const advisories = [];
2242
2242
  let detailLines = [];
2243
- if (result.status === 0) {
2243
+ if (result.status === 0 || result.stdout && result.stdout.trim().startsWith("{")) {
2244
2244
  try {
2245
2245
  const json = JSON.parse(result.stdout || "{}");
2246
2246
  const advisoriesJson = json.advisories;
@@ -2277,7 +2277,7 @@ async function runDotnetAudit(workspaceRoot2, runner = defaultAuditCommandRunner
2277
2277
  const result = await runner("dotnet", ["package", "audit", "--format", "json"], workspaceRoot2);
2278
2278
  const advisories = [];
2279
2279
  let detailLines = [];
2280
- if (result.status === 0) {
2280
+ if (result.status === 0 || result.stdout && result.stdout.trim().startsWith("{")) {
2281
2281
  try {
2282
2282
  const json = JSON.parse(result.stdout || "{}");
2283
2283
  const vulnerabilities = json.vulnerabilities;
@@ -2459,10 +2459,12 @@ function requestOnce(options) {
2459
2459
  const maxBodyBytes = options.maxBodyBytes ?? DEFAULT_MAX_BODY_BYTES;
2460
2460
  const callback = (response) => {
2461
2461
  let body = "";
2462
+ let bodyBytes = 0;
2462
2463
  response.setEncoding?.("utf8");
2463
2464
  response.on("data", (chunk) => {
2464
2465
  body += chunk.toString();
2465
- if (body.length > maxBodyBytes) {
2466
+ bodyBytes += Buffer.byteLength(chunk);
2467
+ if (bodyBytes > maxBodyBytes) {
2466
2468
  response.destroy();
2467
2469
  reject(
2468
2470
  new Error(
@@ -4603,15 +4605,13 @@ function diffSnapshots(oldSnapshot, newSnapshot) {
4603
4605
  if (rawOld === rawNew) continue;
4604
4606
  const oldVal = rawOld != null ? String(rawOld) : "";
4605
4607
  const newVal = rawNew != null ? String(rawNew) : "";
4606
- if (oldVal !== newVal) {
4607
- changed.push({
4608
- name: newDep.name,
4609
- ecosystem: newDep.ecosystem,
4610
- field: String(field),
4611
- from: oldVal,
4612
- to: newVal
4613
- });
4614
- }
4608
+ changed.push({
4609
+ name: newDep.name,
4610
+ ecosystem: newDep.ecosystem,
4611
+ field: String(field),
4612
+ from: oldVal,
4613
+ to: newVal
4614
+ });
4615
4615
  }
4616
4616
  }
4617
4617
  for (const [key, oldDep] of oldByKey) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrongstack/techstack",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "license": "MIT",
5
5
  "description": "WrongStack TechStack — cross-language dependency intelligence for the active target project: discover, inventory, enrich, analyze, and report.",
6
6
  "repository": {
@@ -26,9 +26,9 @@
26
26
  "!dist/**/*.map"
27
27
  ],
28
28
  "dependencies": {
29
- "@wrongstack/core": "1.0.5",
30
- "@wrongstack/persistence": "1.0.5",
31
- "@wrongstack/tools": "1.0.5"
29
+ "@wrongstack/core": "1.0.7",
30
+ "@wrongstack/persistence": "1.0.7",
31
+ "@wrongstack/tools": "1.0.7"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^26.2.0",