@westbayberry/dg 1.3.2 → 1.3.3

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.mjs +21 -46
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -42578,24 +42578,6 @@ var init_lockfile = __esm({
42578
42578
  });
42579
42579
 
42580
42580
  // src/commands/wrapper-shared.ts
42581
- import { spawn as spawn2 } from "node:child_process";
42582
- function spawnTrimmed(bin, args, env3) {
42583
- return new Promise((resolve3) => {
42584
- const child = spawn2(bin, args, { stdio: ["inherit", "pipe", "pipe"], shell: false, env: { ...env3, FORCE_COLOR: "1" } });
42585
- let buf = "";
42586
- const onData = (c) => {
42587
- buf += c.toString();
42588
- };
42589
- child.stdout?.on("data", onData);
42590
- child.stderr?.on("data", onData);
42591
- child.on("error", () => resolve3(1));
42592
- child.on("close", (code) => {
42593
- const lines = buf.split("\n").filter((l) => l.replace(ANSI_RE, "").trim() !== "");
42594
- if (lines.length) process.stdout.write(lines.join("\n") + "\n");
42595
- resolve3(code ?? 1);
42596
- });
42597
- });
42598
- }
42599
42581
  function injectIgnoreScripts(args, opts) {
42600
42582
  if (!opts.isNpmFamily) return args;
42601
42583
  if (!(opts.strict || opts.dgNoScripts)) return args;
@@ -42633,11 +42615,10 @@ function stripDgFlags(args) {
42633
42615
  }
42634
42616
  return { filtered, dgForce, dgNoScripts };
42635
42617
  }
42636
- var ANSI_RE, DG_VALUE_FLAGS, DG_BOOLEAN_FLAGS;
42618
+ var DG_VALUE_FLAGS, DG_BOOLEAN_FLAGS;
42637
42619
  var init_wrapper_shared = __esm({
42638
42620
  "src/commands/wrapper-shared.ts"() {
42639
42621
  "use strict";
42640
- ANSI_RE = /\x1b\[[0-9;]*m/g;
42641
42622
  DG_VALUE_FLAGS = /* @__PURE__ */ new Set([
42642
42623
  "--mode",
42643
42624
  "--api-url",
@@ -42665,7 +42646,7 @@ var init_wrapper_shared = __esm({
42665
42646
  });
42666
42647
 
42667
42648
  // src/commands/npm-wrapper.ts
42668
- import { spawn as spawn3 } from "node:child_process";
42649
+ import { spawn as spawn2 } from "node:child_process";
42669
42650
  import { readFileSync as readFileSync9, existsSync as existsSync12, mkdtempSync, writeFileSync as writeFileSync8, rmSync } from "node:fs";
42670
42651
  import { join as join7 } from "node:path";
42671
42652
  import { tmpdir } from "node:os";
@@ -42756,7 +42737,7 @@ async function resolveVersion(spec) {
42756
42737
  return null;
42757
42738
  }
42758
42739
  return new Promise((resolve3) => {
42759
- const child = spawn3(realNpmBinary(), ["view", spec, "version", "--json"], {
42740
+ const child = spawn2(realNpmBinary(), ["view", spec, "version", "--json"], {
42760
42741
  stdio: ["pipe", "pipe", "pipe"],
42761
42742
  env: shimSentinelEnv()
42762
42743
  });
@@ -42832,12 +42813,9 @@ async function resolvePackages(specs) {
42832
42813
  return { resolved, failed };
42833
42814
  }
42834
42815
  function runNpm(args, opts) {
42835
- if (opts?.trim) {
42836
- return spawnTrimmed(realNpmBinary(), args, shimSentinelEnv());
42837
- }
42838
42816
  return new Promise((resolve3) => {
42839
42817
  const stdio = opts?.stdoutToStderr ? ["inherit", "pipe", "inherit"] : ["inherit", "inherit", "inherit"];
42840
- const child = spawn3(realNpmBinary(), args, { stdio, shell: false, env: shimSentinelEnv() });
42818
+ const child = spawn2(realNpmBinary(), args, { stdio, shell: false, env: shimSentinelEnv() });
42841
42819
  if (opts?.stdoutToStderr && child.stdout) {
42842
42820
  child.stdout.on("data", (chunk) => {
42843
42821
  process.stderr.write(chunk);
@@ -42857,7 +42835,7 @@ async function resolveTreeNpm(specs) {
42857
42835
  try {
42858
42836
  writeFileSync8(join7(dir, "package.json"), '{"name":"_dg_resolve","version":"1.0.0","private":true}');
42859
42837
  const stdout = await new Promise((resolve3) => {
42860
- const child = spawn3(
42838
+ const child = spawn2(
42861
42839
  realNpmBinary(),
42862
42840
  [
42863
42841
  "install",
@@ -43017,7 +42995,7 @@ var init_npm_wrapper = __esm({
43017
42995
  });
43018
42996
 
43019
42997
  // src/commands/pip-wrapper.ts
43020
- import { spawn as spawn4 } from "node:child_process";
42998
+ import { spawn as spawn3 } from "node:child_process";
43021
42999
  import { existsSync as existsSync13 } from "node:fs";
43022
43000
  function parsePipArgs(args) {
43023
43001
  const { filtered, dgForce, dgNoScripts } = stripDgFlags(args);
@@ -43218,7 +43196,7 @@ async function detectPipBinary() {
43218
43196
  try {
43219
43197
  const parts = cmd.split(" ");
43220
43198
  const code = await new Promise((resolve3) => {
43221
- const child = spawn4(parts[0], [...parts.slice(1), "--version"], {
43199
+ const child = spawn3(parts[0], [...parts.slice(1), "--version"], {
43222
43200
  stdio: ["pipe", "pipe", "pipe"],
43223
43201
  timeout: 5e3,
43224
43202
  env: shimSentinelEnv2()
@@ -43237,12 +43215,9 @@ async function detectPipBinary() {
43237
43215
  async function runPip(args, opts) {
43238
43216
  const pipCmd = await detectPipBinary();
43239
43217
  const parts = pipCmd.split(" ");
43240
- if (opts?.trim) {
43241
- return spawnTrimmed(parts[0], [...parts.slice(1), ...args], shimSentinelEnv2());
43242
- }
43243
43218
  return new Promise((resolve3) => {
43244
43219
  const stdio = opts?.stdoutToStderr ? ["inherit", "pipe", "inherit"] : ["inherit", "inherit", "inherit"];
43245
- const child = spawn4(parts[0], [...parts.slice(1), ...args], { stdio, shell: false, env: shimSentinelEnv2() });
43220
+ const child = spawn3(parts[0], [...parts.slice(1), ...args], { stdio, shell: false, env: shimSentinelEnv2() });
43246
43221
  if (opts?.stdoutToStderr && child.stdout) {
43247
43222
  child.stdout.on("data", (chunk) => {
43248
43223
  process.stderr.write(chunk);
@@ -43257,7 +43232,7 @@ async function pipVersion() {
43257
43232
  const pipCmd = await detectPipBinary();
43258
43233
  const parts = pipCmd.split(" ");
43259
43234
  return await new Promise((resolve3) => {
43260
- const child = spawn4(parts[0], [...parts.slice(1), "--version"], {
43235
+ const child = spawn3(parts[0], [...parts.slice(1), "--version"], {
43261
43236
  stdio: ["pipe", "pipe", "pipe"],
43262
43237
  timeout: 5e3,
43263
43238
  env: shimSentinelEnv2()
@@ -43315,7 +43290,7 @@ async function resolveTreePip(specs) {
43315
43290
  const pipCmd = await detectPipBinary();
43316
43291
  const parts = pipCmd.split(" ");
43317
43292
  const runDryRun = (extraFlags) => new Promise((resolve3) => {
43318
- const child = spawn4(
43293
+ const child = spawn3(
43319
43294
  parts[0],
43320
43295
  [
43321
43296
  ...parts.slice(1),
@@ -48751,7 +48726,7 @@ __export(publish_check_exports, {
48751
48726
  scanPayload: () => scanPayload,
48752
48727
  summarize: () => summarize
48753
48728
  });
48754
- import { spawn as spawn5 } from "node:child_process";
48729
+ import { spawn as spawn4 } from "node:child_process";
48755
48730
  import { readFileSync as readFileSync13, existsSync as existsSync19, readdirSync as readdirSync3 } from "node:fs";
48756
48731
  import { join as join12, basename as basename2 } from "node:path";
48757
48732
  import { createGunzip } from "node:zlib";
@@ -48763,7 +48738,7 @@ function sanitizeSnippet(s, max = 40) {
48763
48738
  }
48764
48739
  async function npmPackDryRun(cwd2 = process.cwd()) {
48765
48740
  return new Promise((resolve3) => {
48766
- const child = spawn5("npm", ["pack", "--dry-run", "--json"], {
48741
+ const child = spawn4("npm", ["pack", "--dry-run", "--json"], {
48767
48742
  cwd: cwd2,
48768
48743
  stdio: ["ignore", "pipe", "pipe"]
48769
48744
  });
@@ -52000,7 +51975,7 @@ var init_useWrapperBase = __esm({
52000
51975
  resolvePackages,
52001
51976
  resolveTree: resolveTreeNpm,
52002
51977
  callAnalyze: callAnalyzeAPI,
52003
- runInstall: (args) => runNpm(args, { trim: true }),
51978
+ runInstall: runNpm,
52004
51979
  inferSpecsFromContext: () => readBareInstallPackages(process.cwd()),
52005
51980
  ecosystem: "npm"
52006
51981
  };
@@ -52009,7 +51984,7 @@ var init_useWrapperBase = __esm({
52009
51984
  resolvePackages: resolvePackages2,
52010
51985
  resolveTree: resolveTreePip,
52011
51986
  callAnalyze: callPyPIAnalyzeAPI,
52012
- runInstall: (args) => runPip(args, { trim: true }),
51987
+ runInstall: runPip,
52013
51988
  inferSpecsFromContext: (parsed) => {
52014
51989
  const file = parsed.requirementsFile;
52015
51990
  return file ? parseRequirementsFile(file) : [];
@@ -52434,7 +52409,7 @@ var init_WrapperApp = __esm({
52434
52409
  case "declined":
52435
52410
  return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { children: state.line });
52436
52411
  // The verdict line is Ink's final frame; it stays on screen after unmount and
52437
- // the installer's (trimmed) output is printed under it by bin.ts.
52412
+ // the installer's native output is printed under it by bin.ts.
52438
52413
  case "installing":
52439
52414
  return state.line ? /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Text, { children: state.line }) : null;
52440
52415
  case "done":
@@ -52476,7 +52451,7 @@ __export(conda_wrapper_exports, {
52476
52451
  adapter: () => adapter,
52477
52452
  runStaticConda: () => runStaticConda
52478
52453
  });
52479
- import { spawn as spawn6 } from "node:child_process";
52454
+ import { spawn as spawn5 } from "node:child_process";
52480
52455
  function parseCondaArgs(args) {
52481
52456
  const { filtered, dgForce, dgNoScripts } = stripDgFlags(args);
52482
52457
  const command = filtered[0] ?? "";
@@ -52530,7 +52505,7 @@ async function runStaticConda(args, ecosystem, config) {
52530
52505
  return 127;
52531
52506
  }
52532
52507
  return await new Promise((resolve3) => {
52533
- const child = spawn6(real, parsed.rawArgs, { stdio: "inherit", env: childInstallEnv() });
52508
+ const child = spawn5(real, parsed.rawArgs, { stdio: "inherit", env: childInstallEnv() });
52534
52509
  child.on("close", (code) => resolve3(code ?? 1));
52535
52510
  child.on("error", () => resolve3(1));
52536
52511
  });
@@ -53063,7 +53038,7 @@ var wrapper_factory_exports = {};
53063
53038
  __export(wrapper_factory_exports, {
53064
53039
  runEcosystemWrapper: () => runEcosystemWrapper
53065
53040
  });
53066
- import { spawn as spawn7 } from "node:child_process";
53041
+ import { spawn as spawn6 } from "node:child_process";
53067
53042
  function shimSentinelEnv3() {
53068
53043
  return childInstallEnv();
53069
53044
  }
@@ -53075,7 +53050,7 @@ async function spawnRealBinary(adapter7, args) {
53075
53050
  return 127;
53076
53051
  }
53077
53052
  return await new Promise((resolve3) => {
53078
- const child = spawn7(real, args, { stdio: "inherit", env: shimSentinelEnv3() });
53053
+ const child = spawn6(real, args, { stdio: "inherit", env: shimSentinelEnv3() });
53079
53054
  child.on("close", (code) => resolve3(code ?? 1));
53080
53055
  child.on("error", () => resolve3(1));
53081
53056
  });
@@ -53886,9 +53861,9 @@ async function handleWrapInternal(argv) {
53886
53861
  const { isReadonlySubcommand: isReadonlySubcommand2 } = await Promise.resolve().then(() => (init_readonly(), readonly_exports));
53887
53862
  const ecoTyped = ecosystem;
53888
53863
  const spawnReal = async (real, args) => {
53889
- const { spawn: spawn8 } = await import("node:child_process");
53864
+ const { spawn: spawn7 } = await import("node:child_process");
53890
53865
  const { childInstallEnv: childInstallEnv2 } = await Promise.resolve().then(() => (init_install(), install_exports));
53891
- const child = spawn8(real, args, { stdio: "inherit", env: childInstallEnv2() });
53866
+ const child = spawn7(real, args, { stdio: "inherit", env: childInstallEnv2() });
53892
53867
  return await new Promise((resolve3) => {
53893
53868
  child.on("close", (code) => resolve3(code ?? 1));
53894
53869
  child.on("error", () => resolve3(1));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@westbayberry/dg",
3
- "version": "1.3.2",
3
+ "version": "1.3.3",
4
4
  "type": "module",
5
5
  "description": "Supply chain security scanner for npm and Python dependencies",
6
6
  "bin": {