@westbayberry/dg 1.0.5 → 1.0.6

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 +26 -71
  2. package/package.json +1 -1
package/dist/index.mjs CHANGED
@@ -3118,7 +3118,7 @@ var require_react_development = __commonJS({
3118
3118
  var dispatcher = resolveDispatcher();
3119
3119
  return dispatcher.useRef(initialValue);
3120
3120
  }
3121
- function useEffect11(create2, deps) {
3121
+ function useEffect12(create2, deps) {
3122
3122
  var dispatcher = resolveDispatcher();
3123
3123
  return dispatcher.useEffect(create2, deps);
3124
3124
  }
@@ -3901,7 +3901,7 @@ var require_react_development = __commonJS({
3901
3901
  exports.useContext = useContext7;
3902
3902
  exports.useDebugValue = useDebugValue;
3903
3903
  exports.useDeferredValue = useDeferredValue;
3904
- exports.useEffect = useEffect11;
3904
+ exports.useEffect = useEffect12;
3905
3905
  exports.useId = useId;
3906
3906
  exports.useImperativeHandle = useImperativeHandle;
3907
3907
  exports.useInsertionEffect = useInsertionEffect;
@@ -4282,47 +4282,6 @@ var init_base = __esm({
4282
4282
  });
4283
4283
 
4284
4284
  // node_modules/ansi-escapes/index.js
4285
- var ansi_escapes_exports = {};
4286
- __export(ansi_escapes_exports, {
4287
- ConEmu: () => ConEmu,
4288
- beep: () => beep,
4289
- beginSynchronizedOutput: () => beginSynchronizedOutput,
4290
- clearScreen: () => clearScreen,
4291
- clearTerminal: () => clearTerminal,
4292
- clearViewport: () => clearViewport,
4293
- cursorBackward: () => cursorBackward,
4294
- cursorDown: () => cursorDown,
4295
- cursorForward: () => cursorForward,
4296
- cursorGetPosition: () => cursorGetPosition,
4297
- cursorHide: () => cursorHide,
4298
- cursorLeft: () => cursorLeft,
4299
- cursorMove: () => cursorMove,
4300
- cursorNextLine: () => cursorNextLine,
4301
- cursorPrevLine: () => cursorPrevLine,
4302
- cursorRestorePosition: () => cursorRestorePosition,
4303
- cursorSavePosition: () => cursorSavePosition,
4304
- cursorShow: () => cursorShow,
4305
- cursorTo: () => cursorTo,
4306
- cursorUp: () => cursorUp,
4307
- default: () => base_exports,
4308
- endSynchronizedOutput: () => endSynchronizedOutput,
4309
- enterAlternativeScreen: () => enterAlternativeScreen,
4310
- eraseDown: () => eraseDown,
4311
- eraseEndLine: () => eraseEndLine,
4312
- eraseLine: () => eraseLine,
4313
- eraseLines: () => eraseLines,
4314
- eraseScreen: () => eraseScreen,
4315
- eraseStartLine: () => eraseStartLine,
4316
- eraseUp: () => eraseUp,
4317
- exitAlternativeScreen: () => exitAlternativeScreen,
4318
- iTerm: () => iTerm,
4319
- image: () => image,
4320
- link: () => link,
4321
- scrollDown: () => scrollDown,
4322
- scrollUp: () => scrollUp,
4323
- setCwd: () => setCwd,
4324
- synchronizedOutput: () => synchronizedOutput
4325
- });
4326
4285
  var init_ansi_escapes = __esm({
4327
4286
  "node_modules/ansi-escapes/index.js"() {
4328
4287
  init_base();
@@ -38843,7 +38802,7 @@ async function callAnalyzeBatch(packages, config) {
38843
38802
  clearTimeout(timeoutId);
38844
38803
  if (response.status === 401) {
38845
38804
  throw new APIError(
38846
- "Invalid API key. Check your --api-key or DG_API_KEY value.\nGet your key at https://westbayberry.com/dashboard",
38805
+ "Invalid API key. Run `dg logout` then `dg login` to re-authenticate.",
38847
38806
  401,
38848
38807
  ""
38849
38808
  );
@@ -38923,7 +38882,7 @@ async function callPyPIBatch(packages, config) {
38923
38882
  clearTimeout(timeoutId);
38924
38883
  if (response.status === 401) {
38925
38884
  throw new APIError(
38926
- "Invalid API key. Check your --api-key or DG_API_KEY value.\nGet your key at https://westbayberry.com/dashboard",
38885
+ "Invalid API key. Run `dg logout` then `dg login` to re-authenticate.",
38927
38886
  401,
38928
38887
  ""
38929
38888
  );
@@ -40759,7 +40718,10 @@ var init_discover = __esm({
40759
40718
  "coverage",
40760
40719
  ".cache",
40761
40720
  ".pytest_cache",
40762
- ".mypy_cache"
40721
+ ".mypy_cache",
40722
+ "validation-results",
40723
+ "test-fixtures",
40724
+ "fixtures"
40763
40725
  ]);
40764
40726
  NPM_LOCKFILES = ["package-lock.json", "yarn.lock", "pnpm-lock.yaml", "npm-shrinkwrap.json"];
40765
40727
  PYTHON_DEPFILES = ["requirements.txt", "Pipfile.lock", "poetry.lock"];
@@ -41054,7 +41016,7 @@ function affectsLine(group) {
41054
41016
  if (names.length <= 5) return names.join(", ");
41055
41017
  return names.slice(0, 5).join(", ") + ` + ${names.length - 5} more`;
41056
41018
  }
41057
- var import_react29, import_chalk10, import_jsx_runtime10, SEVERITY_LABELS3, SEVERITY_COLORS, EVIDENCE_LIMIT2, FIXED_CHROME, InteractiveResultsView, T, FindingsSummary, FindingsDetail;
41019
+ var import_react29, import_chalk10, import_jsx_runtime10, SEVERITY_LABELS3, SEVERITY_COLORS, EVIDENCE_LIMIT2, FIXED_CHROME, MOUSE_ON, MOUSE_OFF, InteractiveResultsView, T, FindingsSummary, FindingsDetail;
41058
41020
  var init_InteractiveResultsView = __esm({
41059
41021
  async "src/ui/components/InteractiveResultsView.tsx"() {
41060
41022
  "use strict";
@@ -41080,12 +41042,21 @@ var init_InteractiveResultsView = __esm({
41080
41042
  };
41081
41043
  EVIDENCE_LIMIT2 = 2;
41082
41044
  FIXED_CHROME = 16;
41045
+ MOUSE_ON = "\x1B[?1000h\x1B[?1003h\x1B[?1006h";
41046
+ MOUSE_OFF = "\x1B[?1006l\x1B[?1003l\x1B[?1000l";
41083
41047
  InteractiveResultsView = ({
41084
41048
  result,
41085
41049
  config,
41086
41050
  durationMs,
41087
41051
  onExit
41088
41052
  }) => {
41053
+ (0, import_react29.useEffect)(() => {
41054
+ if (!process.stdout.isTTY) return;
41055
+ process.stdout.write("\x1B[?1049h" + MOUSE_ON);
41056
+ return () => {
41057
+ process.stdout.write(MOUSE_OFF + "\x1B[?1049l");
41058
+ };
41059
+ }, []);
41089
41060
  const flagged = (0, import_react29.useMemo)(
41090
41061
  () => result.packages.filter((p) => p.score > 0),
41091
41062
  [result.packages]
@@ -41657,7 +41628,6 @@ var USAGE = `
41657
41628
  wrap Show instructions to alias npm to dg
41658
41629
 
41659
41630
  Options:
41660
- --api-key <key> API key (or set DG_API_KEY env var)
41661
41631
  --api-url <url> API base URL (default: https://api.westbayberry.com)
41662
41632
  --mode <mode> block | warn | off (default: warn)
41663
41633
  --block-threshold <n> Score threshold for blocking (default: 70)
@@ -41678,7 +41648,6 @@ var USAGE = `
41678
41648
  Precedence: CLI flags > env vars > .dgrc.json > defaults
41679
41649
 
41680
41650
  Environment Variables:
41681
- DG_API_KEY API key
41682
41651
  DG_API_URL API base URL
41683
41652
  DG_MODE Mode (block/warn/off)
41684
41653
  DG_ALLOWLIST Comma-separated allowlist
@@ -41692,8 +41661,8 @@ var USAGE = `
41692
41661
  3 error \u2014 Internal error (API failure, config error)
41693
41662
 
41694
41663
  Examples:
41695
- DG_API_KEY=dg_live_xxx dg scan
41696
- dg scan --api-key dg_live_xxx --json
41664
+ dg scan
41665
+ dg scan --json
41697
41666
  dg scan --scan-all --mode block
41698
41667
  dg scan --base-lockfile ./main-lockfile.json
41699
41668
  dg npm install express lodash
@@ -41714,7 +41683,6 @@ function parseConfig(argv) {
41714
41683
  const { values, positionals } = parseArgs({
41715
41684
  args: argv.slice(2),
41716
41685
  options: {
41717
- "api-key": { type: "string" },
41718
41686
  "api-url": { type: "string" },
41719
41687
  mode: { type: "string" },
41720
41688
  "block-threshold": { type: "string" },
@@ -41745,15 +41713,10 @@ function parseConfig(argv) {
41745
41713
  const command = positionals[0] ?? "scan";
41746
41714
  const noConfig = values["no-config"];
41747
41715
  const dgrc = noConfig ? {} : loadDgrc();
41748
- if (values["api-key"]) {
41749
- process.stderr.write(
41750
- "Warning: --api-key is deprecated (visible in process list). Use DG_API_KEY env var instead.\n"
41751
- );
41752
- }
41753
- const apiKey = values["api-key"] ?? process.env.DG_API_KEY ?? dgrc.apiKey ?? "";
41716
+ const apiKey = dgrc.apiKey ?? "";
41754
41717
  if (!apiKey) {
41755
41718
  process.stderr.write(
41756
- "Error: API key required. Run `dg login` to authenticate,\nor set the DG_API_KEY environment variable.\nGet your key at https://westbayberry.com/dashboard\n"
41719
+ "Error: Not logged in. Run `dg login` to authenticate.\n"
41757
41720
  );
41758
41721
  process.exit(1);
41759
41722
  }
@@ -41993,18 +41956,10 @@ async function main() {
41993
41956
  process.exit(0);
41994
41957
  }
41995
41958
  const { App: App3 } = await init_App2().then(() => App_exports);
41996
- const { enterAlternativeScreen: enterAlternativeScreen2, exitAlternativeScreen: exitAlternativeScreen2 } = await Promise.resolve().then(() => (init_ansi_escapes(), ansi_escapes_exports));
41997
- const MOUSE_ON = "\x1B[?1000h\x1B[?1003h\x1B[?1006h";
41998
- const MOUSE_OFF = "\x1B[?1006l\x1B[?1003l\x1B[?1000l";
41999
- process.stdout.write(enterAlternativeScreen2 + MOUSE_ON);
42000
- try {
42001
- const { waitUntilExit } = render2(
42002
- React16.createElement(App3, { config })
42003
- );
42004
- await waitUntilExit();
42005
- } finally {
42006
- process.stdout.write(MOUSE_OFF + exitAlternativeScreen2);
42007
- }
41959
+ const { waitUntilExit } = render2(
41960
+ React16.createElement(App3, { config })
41961
+ );
41962
+ await waitUntilExit();
42008
41963
  }
42009
41964
  const updateMsg = await updatePromise;
42010
41965
  if (updateMsg) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@westbayberry/dg",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Supply chain security scanner — scan npm dependencies in any CI or terminal",
5
5
  "bin": {
6
6
  "dependency-guardian": "dist/index.mjs",