@coana-tech/cli 14.12.27 → 14.12.28

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
@@ -208148,22 +208148,27 @@ var import_picomatch3 = __toESM(require_picomatch2(), 1);
208148
208148
  var import_semver3 = __toESM(require_semver2(), 1);
208149
208149
  import assert6 from "node:assert";
208150
208150
  import { readFile as readFile18 } from "node:fs/promises";
208151
+ import { existsSync as existsSync12 } from "node:fs";
208151
208152
  var CargoSocketUpgradeManager = class {
208152
208153
  constructor(rootDir) {
208153
208154
  this.rootDir = rootDir;
208154
208155
  }
208155
208156
  cargoTomlMatcher = (0, import_picomatch3.default)("Cargo.toml");
208157
+ cargoLockMatcher = (0, import_picomatch3.default)("Cargo.lock");
208156
208158
  async applySocketArtifactUpgrades(_manifestFiles, upgrades, artifacts, rangeStyle) {
208157
208159
  const tomlPatches = await this.collectCargoTomlPatches(upgrades, artifacts, rangeStyle);
208158
208160
  const lockPatches = await this.collectCargoLockPatches(upgrades, artifacts);
208159
208161
  const successfulPatches = extractSuccessfulPatches(tomlPatches.concat(lockPatches));
208160
208162
  await applySocketPatchResults("RUST", this.rootDir, successfulPatches);
208161
- await asyncForEach(i(successfulPatches.map((p3) => dirname9(p3.patch.file))), async (dir) => {
208162
- const success = await execAndLogOnFailure(cmdt`cargo fetch`, resolve19(this.rootDir, dir));
208163
- if (!success) {
208164
- throw Error(`Could not update checksums with cargo fetch in directory ${dir || "."}`);
208163
+ await asyncForEach(
208164
+ i(successfulPatches.map((p3) => p3.patch.file)).filter((file) => this.cargoLockMatcher(basename5(file))),
208165
+ async (lockFile) => {
208166
+ const success = await execAndLogOnFailure(cmdt`cargo fetch`, dirname9(resolve19(this.rootDir, lockFile)));
208167
+ if (!success) {
208168
+ throw Error(`Could not update checksums in ${lockFile}`);
208169
+ }
208165
208170
  }
208166
- });
208171
+ );
208167
208172
  }
208168
208173
  /**
208169
208174
  * Collect patches for Cargo.toml files (direct dependencies only)
@@ -208174,10 +208179,8 @@ var CargoSocketUpgradeManager = class {
208174
208179
  assert6(artifact.name);
208175
208180
  assert6(artifact.version);
208176
208181
  const directManifestFiles = i(artifact.manifestFiles?.map((ref) => ref.file) ?? []);
208177
- return asyncFlatMap(
208178
- directManifestFiles.filter((manifestFile) => {
208179
- return this.cargoTomlMatcher(basename5(manifestFile));
208180
- }),
208182
+ return await asyncFlatMap(
208183
+ directManifestFiles.filter((manifestFile) => this.cargoTomlMatcher(basename5(manifestFile))),
208181
208184
  async (manifestFile) => this.handleCargoToml(manifestFile, upgrade, artifact, rangeStyle)
208182
208185
  );
208183
208186
  });
@@ -208198,10 +208201,8 @@ var CargoSocketUpgradeManager = class {
208198
208201
  )
208199
208202
  );
208200
208203
  return asyncFlatMap(
208201
- ancestorManifestFiles.filter((manifestFile) => {
208202
- return this.cargoTomlMatcher(basename5(manifestFile));
208203
- }),
208204
- async (tomlFile) => this.handleCargoLock(join13(dirname9(tomlFile), "Cargo.lock"), upgrade, artifact)
208204
+ ancestorManifestFiles.filter((manifestFile) => this.cargoTomlMatcher(basename5(manifestFile))).map((tomlFile) => join13(dirname9(tomlFile), "Cargo.lock")).filter((lockFile) => existsSync12(resolve19(this.rootDir, lockFile))),
208205
+ async (lockFile) => this.handleCargoLock(lockFile, upgrade, artifact)
208205
208206
  );
208206
208207
  });
208207
208208
  }
@@ -208343,7 +208344,7 @@ var CargoSocketUpgradeManager = class {
208343
208344
  */
208344
208345
  createNewVersionString(currentVersion, newVersion, rangeStyle) {
208345
208346
  if (rangeStyle === "pin") {
208346
- return newVersion;
208347
+ return `=${newVersion}`;
208347
208348
  } else {
208348
208349
  const specifierMatch = currentVersion.match(/^([^\d]*)/);
208349
208350
  const specifier = specifierMatch ? specifierMatch[1] : "^";
@@ -208465,7 +208466,7 @@ async function applySocketUpgrades(ecosystem, rootDir, manifestFiles, upgrades,
208465
208466
 
208466
208467
  // dist/cli-apply-fix.js
208467
208468
  var import_lodash12 = __toESM(require_lodash(), 1);
208468
- import { existsSync as existsSync16 } from "fs";
208469
+ import { existsSync as existsSync17 } from "fs";
208469
208470
 
208470
208471
  // ../other-modules-communicator/src/other-modules-communicator.ts
208471
208472
  import { execFileSync } from "child_process";
@@ -208482,7 +208483,7 @@ import { fileURLToPath as fileURLToPath3 } from "node:url";
208482
208483
  // ../utils/dist/file-utils.js
208483
208484
  var import_lodash5 = __toESM(require_lodash(), 1);
208484
208485
  var import_micromatch = __toESM(require_micromatch(), 1);
208485
- import { existsSync as existsSync12 } from "fs";
208486
+ import { existsSync as existsSync13 } from "fs";
208486
208487
  import { access as access2, cp, readdir as readdir3, stat as stat2 } from "fs/promises";
208487
208488
  import { basename as basename6, join as join14, relative as relative11, resolve as resolve20 } from "path";
208488
208489
  var { uniq } = import_lodash5.default;
@@ -209227,7 +209228,7 @@ async function detectVariantMaven(projectDir) {
209227
209228
  }
209228
209229
 
209229
209230
  // ../docker-management/src/maven/gradle-version-detector.ts
209230
- import { existsSync as existsSync13 } from "fs";
209231
+ import { existsSync as existsSync14 } from "fs";
209231
209232
  import { join as join17 } from "path";
209232
209233
  import { readFile as readFile20 } from "fs/promises";
209233
209234
  async function detectVariantGradle(projectDir) {
@@ -209235,7 +209236,7 @@ async function detectVariantGradle(projectDir) {
209235
209236
  }
209236
209237
  async function detect(projectDir) {
209237
209238
  const gradleWrapperPropertiesPath = join17(projectDir, "gradle", "wrapper", "gradle-wrapper.properties");
209238
- const gradleWrapperProperties = existsSync13(gradleWrapperPropertiesPath) ? (await readFile20(gradleWrapperPropertiesPath, "utf-8")).split("\n").map((line) => line.trim()).filter((line) => !line.startsWith("#")).filter((line) => line) : void 0;
209239
+ const gradleWrapperProperties = existsSync14(gradleWrapperPropertiesPath) ? (await readFile20(gradleWrapperPropertiesPath, "utf-8")).split("\n").map((line) => line.trim()).filter((line) => !line.startsWith("#")).filter((line) => line) : void 0;
209239
209240
  if (!gradleWrapperProperties) return void 0;
209240
209241
  const distributionUrlRegex = /.*gradle-(\d+(\.\d+(\.\d+)?)?)/;
209241
209242
  for (const prop2 of gradleWrapperProperties) {
@@ -209249,7 +209250,7 @@ async function detect(projectDir) {
209249
209250
  }
209250
209251
 
209251
209252
  // ../docker-management/src/maven/sbt-version-detector.ts
209252
- import { existsSync as existsSync14 } from "fs";
209253
+ import { existsSync as existsSync15 } from "fs";
209253
209254
  import { join as join18 } from "path";
209254
209255
  import { readFile as readFile21 } from "fs/promises";
209255
209256
  async function detectVariantSbt(projectDir) {
@@ -209257,7 +209258,7 @@ async function detectVariantSbt(projectDir) {
209257
209258
  }
209258
209259
  async function detect2(projectDir) {
209259
209260
  const sbtBuildPropertiesPath = join18(projectDir, "project", "build.properties");
209260
- const sbtBuildProperties = existsSync14(sbtBuildPropertiesPath) ? (await readFile21(sbtBuildPropertiesPath, "utf-8")).split("\n").map((line) => line.trim()).filter((line) => !line.startsWith("#")).filter((line) => line) : void 0;
209261
+ const sbtBuildProperties = existsSync15(sbtBuildPropertiesPath) ? (await readFile21(sbtBuildPropertiesPath, "utf-8")).split("\n").map((line) => line.trim()).filter((line) => !line.startsWith("#")).filter((line) => line) : void 0;
209261
209262
  if (!sbtBuildProperties) return void 0;
209262
209263
  for (const prop2 of sbtBuildProperties) {
209263
209264
  const [key, value] = prop2.split("=");
@@ -209378,7 +209379,7 @@ import { join as join21, posix as posix2, relative as relative13, sep as sep3 }
209378
209379
  // ../utils/src/file-utils.ts
209379
209380
  var import_lodash8 = __toESM(require_lodash(), 1);
209380
209381
  var import_micromatch2 = __toESM(require_micromatch(), 1);
209381
- import { existsSync as existsSync15 } from "fs";
209382
+ import { existsSync as existsSync16 } from "fs";
209382
209383
  import { access as access3, cp as cp2, readdir as readdir4, stat as stat3 } from "fs/promises";
209383
209384
  import { basename as basename7, join as join19, relative as relative12, resolve as resolve22 } from "path";
209384
209385
  var { uniq: uniq2 } = import_lodash8.default;
@@ -210520,7 +210521,7 @@ async function verifyFixes(fixes, otherModulesCommunicator, rootPath) {
210520
210521
  if (pathsForEachFixIdData.length !== new Set(pathsForEachFixIdData).size) {
210521
210522
  throw new Error("Multiple fix IDs found for the same subproject, workspace and ecosystem");
210522
210523
  }
210523
- const subprojectsNotFound = uniq3(fixes.filter(({ vulnerabilityInstance: v }) => !existsSync16(resolve24(rootPath, v.subprojectPath))).map(({ vulnerabilityInstance: v }) => `${v.subprojectPath}:${v.ecosystem}`));
210524
+ const subprojectsNotFound = uniq3(fixes.filter(({ vulnerabilityInstance: v }) => !existsSync17(resolve24(rootPath, v.subprojectPath))).map(({ vulnerabilityInstance: v }) => `${v.subprojectPath}:${v.ecosystem}`));
210524
210525
  if (subprojectsNotFound.length > 0) {
210525
210526
  throw new Error(`Cannot find the following subprojects: ${subprojectsNotFound.join(", ")}`);
210526
210527
  }
@@ -211326,12 +211327,12 @@ import { readdir as readdir6 } from "fs/promises";
211326
211327
  import { join as join24, relative as relative14, resolve as resolve27 } from "path";
211327
211328
 
211328
211329
  // ../project-management/src/project-management/ecosystem-management/ecosystem-specs.ts
211329
- import { existsSync as existsSync18 } from "fs";
211330
+ import { existsSync as existsSync19 } from "fs";
211330
211331
  import { readdir as readdir5, readFile as readFile25 } from "fs/promises";
211331
211332
  import { join as join23, sep as sep4 } from "path";
211332
211333
 
211333
211334
  // ../utils/src/pip-utils.ts
211334
- import { existsSync as existsSync17 } from "fs";
211335
+ import { existsSync as existsSync18 } from "fs";
211335
211336
  import { readFile as readFile24 } from "fs/promises";
211336
211337
  import { resolve as resolve26 } from "path";
211337
211338
  import util4 from "util";
@@ -211429,7 +211430,7 @@ function getEcosystemSpecs(ecosystems) {
211429
211430
  }
211430
211431
  function packageManagerIfPackageJSONExistsAndValid(packageManager) {
211431
211432
  return async (projectDir) => {
211432
- if (!existsSync18(join23(projectDir, "package.json"))) return void 0;
211433
+ if (!existsSync19(join23(projectDir, "package.json"))) return void 0;
211433
211434
  const packageJSONPath = join23(projectDir, "package.json");
211434
211435
  try {
211435
211436
  JSON.parse(await readFile25(packageJSONPath, "utf-8"));
@@ -212117,16 +212118,16 @@ function isVulnChainWithParentsMap(v) {
212117
212118
  var DEFAULT_REPORT_FILENAME_BASE = "coana-report";
212118
212119
 
212119
212120
  // dist/internal/exclude-dirs-from-configuration-files.js
212120
- import { existsSync as existsSync19 } from "fs";
212121
+ import { existsSync as existsSync20 } from "fs";
212121
212122
  import { readFile as readFile26 } from "fs/promises";
212122
212123
  import { basename as basename8, resolve as resolve29 } from "path";
212123
212124
  var import_yaml2 = __toESM(require_dist11(), 1);
212124
212125
  async function inferExcludeDirsFromConfigurationFiles(rootWorkingDir) {
212125
212126
  const socketYmlConfigFile = resolve29(rootWorkingDir, "socket.yml");
212126
- if (existsSync19(socketYmlConfigFile))
212127
+ if (existsSync20(socketYmlConfigFile))
212127
212128
  return inferExcludeDirsFromSocketConfig(socketYmlConfigFile);
212128
212129
  const socketYamlConfigFile = resolve29(rootWorkingDir, "socket.yaml");
212129
- if (existsSync19(socketYamlConfigFile))
212130
+ if (existsSync20(socketYamlConfigFile))
212130
212131
  return inferExcludeDirsFromSocketConfig(socketYamlConfigFile);
212131
212132
  return void 0;
212132
212133
  }
@@ -226222,7 +226223,7 @@ var { root: root2 } = static_exports;
226222
226223
 
226223
226224
  // ../utils/src/maven-utils.ts
226224
226225
  var import_lodash14 = __toESM(require_lodash(), 1);
226225
- import { existsSync as existsSync20, readdirSync as readdirSync4, statSync as statSync3 } from "fs";
226226
+ import { existsSync as existsSync21, readdirSync as readdirSync4, statSync as statSync3 } from "fs";
226226
226227
  import { join as join26 } from "path";
226227
226228
  var { memoize: memoize3 } = import_lodash14.default;
226228
226229
  var memoizedParseShellArgs = memoize3(parseShellArgs);
@@ -227594,7 +227595,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
227594
227595
  }
227595
227596
 
227596
227597
  // dist/version.js
227597
- var version2 = "14.12.27";
227598
+ var version2 = "14.12.28";
227598
227599
 
227599
227600
  // dist/cli-core.js
227600
227601
  var { mapValues, omit, partition, pick } = import_lodash15.default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coana-tech/cli",
3
- "version": "14.12.27",
3
+ "version": "14.12.28",
4
4
  "description": "Coana CLI",
5
5
  "type": "module",
6
6
  "bin": {