@coana-tech/cli 14.12.115 → 14.12.117

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/cli.mjs CHANGED
@@ -30394,12 +30394,12 @@ var require_lodash = __commonJS({
30394
30394
  return result2;
30395
30395
  });
30396
30396
  function omitBy(object, predicate) {
30397
- return pickBy2(object, negate(getIteratee(predicate)));
30397
+ return pickBy3(object, negate(getIteratee(predicate)));
30398
30398
  }
30399
- var pick2 = flatRest(function(object, paths) {
30399
+ var pick = flatRest(function(object, paths) {
30400
30400
  return object == null ? {} : basePick(object, paths);
30401
30401
  });
30402
- function pickBy2(object, predicate) {
30402
+ function pickBy3(object, predicate) {
30403
30403
  if (object == null) {
30404
30404
  return {};
30405
30405
  }
@@ -31074,8 +31074,8 @@ var require_lodash = __commonJS({
31074
31074
  lodash16.partial = partial;
31075
31075
  lodash16.partialRight = partialRight;
31076
31076
  lodash16.partition = partition2;
31077
- lodash16.pick = pick2;
31078
- lodash16.pickBy = pickBy2;
31077
+ lodash16.pick = pick;
31078
+ lodash16.pickBy = pickBy3;
31079
31079
  lodash16.property = property;
31080
31080
  lodash16.propertyOf = propertyOf;
31081
31081
  lodash16.pull = pull;
@@ -68492,7 +68492,7 @@ var require_omit = __commonJS({
68492
68492
  var require_pickBy = __commonJS({
68493
68493
  "../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/pickBy.js"(exports2, module2) {
68494
68494
  var _curry2 = require_curry2();
68495
- var pickBy2 = /* @__PURE__ */ _curry2(function pickBy3(test2, obj) {
68495
+ var pickBy3 = /* @__PURE__ */ _curry2(function pickBy4(test2, obj) {
68496
68496
  var result = {};
68497
68497
  for (var prop2 in obj) {
68498
68498
  if (test2(obj[prop2], prop2, obj)) {
@@ -68501,7 +68501,7 @@ var require_pickBy = __commonJS({
68501
68501
  }
68502
68502
  return result;
68503
68503
  });
68504
- module2.exports = pickBy2;
68504
+ module2.exports = pickBy3;
68505
68505
  }
68506
68506
  });
68507
68507
 
@@ -68509,7 +68509,7 @@ var require_pickBy = __commonJS({
68509
68509
  var require_pick = __commonJS({
68510
68510
  "../../node_modules/.pnpm/@pnpm+ramda@0.28.1/node_modules/@pnpm/ramda/src/pick.js"(exports2, module2) {
68511
68511
  var _curry2 = require_curry2();
68512
- var pick2 = /* @__PURE__ */ _curry2(function pick3(names, obj) {
68512
+ var pick = /* @__PURE__ */ _curry2(function pick2(names, obj) {
68513
68513
  var result = {};
68514
68514
  var idx = 0;
68515
68515
  while (idx < names.length) {
@@ -68520,7 +68520,7 @@ var require_pick = __commonJS({
68520
68520
  }
68521
68521
  return result;
68522
68522
  });
68523
- module2.exports = pick2;
68523
+ module2.exports = pick;
68524
68524
  }
68525
68525
  });
68526
68526
 
@@ -234982,6 +234982,8 @@ var SocketLogServer = class {
234982
234982
  writeStream;
234983
234983
  writeQueue = [];
234984
234984
  isWriting = false;
234985
+ isClosing = false;
234986
+ onDrainCallback = null;
234985
234987
  clients = /* @__PURE__ */ new Map();
234986
234988
  constructor(options) {
234987
234989
  this.socketPath = options.socketPath;
@@ -235040,6 +235042,9 @@ var SocketLogServer = class {
235040
235042
  return message2.type === "handshake";
235041
235043
  }
235042
235044
  writeLog(log2) {
235045
+ if (this.isClosing) {
235046
+ return;
235047
+ }
235043
235048
  const label = log2.label ?? log2.context;
235044
235049
  const formattedLog = `${log2.timestamp} ${label} ${log2.level}: ${log2.message}
235045
235050
  `;
@@ -235052,6 +235057,11 @@ var SocketLogServer = class {
235052
235057
  }
235053
235058
  processWriteQueue() {
235054
235059
  if (this.isWriting || this.writeQueue.length === 0) {
235060
+ if (!this.isWriting && this.writeQueue.length === 0 && this.onDrainCallback) {
235061
+ const callback = this.onDrainCallback;
235062
+ this.onDrainCallback = null;
235063
+ callback();
235064
+ }
235055
235065
  return;
235056
235066
  }
235057
235067
  this.isWriting = true;
@@ -235071,11 +235081,37 @@ var SocketLogServer = class {
235071
235081
  this.onLogReceived(log2);
235072
235082
  }
235073
235083
  }
235084
+ async waitForQueueDrain(timeoutMs = 2e4) {
235085
+ return new Promise((resolve45) => {
235086
+ if (!this.isWriting && this.writeQueue.length === 0) {
235087
+ resolve45();
235088
+ return;
235089
+ }
235090
+ let resolved = false;
235091
+ const timeoutId = setTimeout(() => {
235092
+ if (!resolved) {
235093
+ resolved = true;
235094
+ this.onDrainCallback = null;
235095
+ console.warn(`Log write queue drain timeout after ${timeoutMs}ms, proceeding with close`);
235096
+ resolve45();
235097
+ }
235098
+ }, timeoutMs);
235099
+ this.onDrainCallback = () => {
235100
+ if (!resolved) {
235101
+ resolved = true;
235102
+ clearTimeout(timeoutId);
235103
+ resolve45();
235104
+ }
235105
+ };
235106
+ });
235107
+ }
235074
235108
  async close() {
235075
235109
  for (const client of this.clients.values()) {
235076
235110
  client.socket.destroy();
235077
235111
  }
235078
235112
  this.clients.clear();
235113
+ this.isClosing = true;
235114
+ await this.waitForQueueDrain();
235079
235115
  return new Promise((resolve45, reject) => {
235080
235116
  this.server.close((serverError) => {
235081
235117
  this.writeStream.end(() => {
@@ -250908,10 +250944,10 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
250908
250944
  }
250909
250945
 
250910
250946
  // dist/version.js
250911
- var version3 = "14.12.115";
250947
+ var version3 = "14.12.117";
250912
250948
 
250913
250949
  // dist/cli-core.js
250914
- var { mapValues, omit, partition, pick } = import_lodash15.default;
250950
+ var { mapValues, omit, partition, pickBy: pickBy2 } = import_lodash15.default;
250915
250951
  var bucketedAnalysisTimeoutInSeconds = 60;
250916
250952
  var SEVERITY_ORDER = {
250917
250953
  INFO: 0,
@@ -251156,7 +251192,8 @@ var CliCore = class {
251156
251192
  vulnsWithResults.push(...Object.values(vulnerabilities).flat());
251157
251193
  for (const [workspacePath, workspaceDiagnostics] of Object.entries(diagnostics)) {
251158
251194
  allWorkspaceDiagnostics.push({
251159
- subprojectPath: relative20(this.rootWorkingDirectory, workspacePath) || ".",
251195
+ // the workspace path is the subproject path in socket mode
251196
+ subprojectPath: workspacePath ?? ".",
251160
251197
  workspacePath: ".",
251161
251198
  purl_type: getPurlType(ecosystem),
251162
251199
  diagnostics: workspaceDiagnostics
@@ -251389,18 +251426,19 @@ Subproject: ${subproject}`);
251389
251426
  this.verifyOptions();
251390
251427
  if (!this.options.excludeDirs)
251391
251428
  this.options.excludeDirs = await inferExcludeDirsFromConfigurationFiles(this.rootWorkingDirectory);
251392
- logger.debug("running in debug mode");
251393
- logger.info("using options", JSON.stringify(pick(this.options, [
251394
- "debug",
251395
- "silent",
251396
- "memoryLimit",
251397
- "timeout",
251398
- "analysisTimeout",
251399
- "concurrency",
251400
- "excludeDirs",
251401
- "useUnreachableFromPrecomputation",
251402
- "minSeverity"
251403
- ]), null, 2));
251429
+ logger.info("using options", JSON.stringify(pickBy2(this.options, (value2, key) => {
251430
+ return [
251431
+ "debug",
251432
+ "silent",
251433
+ "memoryLimit",
251434
+ "analysisTimeout",
251435
+ "concurrency",
251436
+ "excludeDirs",
251437
+ "includeDirs",
251438
+ "purlTypes",
251439
+ "minSeverity"
251440
+ ].includes(key) && value2 !== void 0 && value2 !== false;
251441
+ }), null, 2));
251404
251442
  logger.info("available memory: %i MiB", os.freemem() / (1024 * 1024));
251405
251443
  try {
251406
251444
  const limits = await Promise.all([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coana-tech/cli",
3
- "version": "14.12.115",
3
+ "version": "14.12.117",
4
4
  "description": "Coana CLI",
5
5
  "type": "module",
6
6
  "bin": {