@vibgrate/cli 1.0.74 → 1.0.76

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.
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  baselineCommand,
3
3
  runBaseline
4
- } from "./chunk-6X2BYLQ3.js";
5
- import "./chunk-6666OEOV.js";
4
+ } from "./chunk-CCU77BBA.js";
5
+ import "./chunk-S5HZOJPF.js";
6
6
  import "./chunk-JQHUH6A3.js";
7
7
  export {
8
8
  baselineCommand,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  runScan
3
- } from "./chunk-6666OEOV.js";
3
+ } from "./chunk-S5HZOJPF.js";
4
4
  import {
5
5
  writeJsonFile
6
6
  } from "./chunk-JQHUH6A3.js";
@@ -1882,6 +1882,40 @@ async function scanNodeProjects(rootDir, npmCache, cache, projectScanTimeout) {
1882
1882
  const packageJsonFiles = cache ? await cache.findPackageJsonFiles(rootDir) : await findPackageJsonFiles(rootDir);
1883
1883
  const results = [];
1884
1884
  const packageNameToPath = /* @__PURE__ */ new Map();
1885
+ let detectedPackageManager;
1886
+ try {
1887
+ const _pathExists = cache ? (p) => cache.pathExists(p) : pathExists;
1888
+ const rootPkgPath = path4.join(rootDir, "package.json");
1889
+ if (await _pathExists(rootPkgPath)) {
1890
+ try {
1891
+ const rootPkg = cache ? await cache.readJsonFile(rootPkgPath) : await readJsonFile(rootPkgPath);
1892
+ if (rootPkg.packageManager) {
1893
+ const pm = rootPkg.packageManager.split("@")[0]?.toLowerCase();
1894
+ if (pm && ["pnpm", "yarn", "npm", "bun"].includes(pm)) {
1895
+ detectedPackageManager = pm;
1896
+ }
1897
+ }
1898
+ } catch {
1899
+ }
1900
+ }
1901
+ if (!detectedPackageManager) {
1902
+ if (await _pathExists(path4.join(rootDir, "pnpm-workspace.yaml"))) {
1903
+ detectedPackageManager = "pnpm";
1904
+ }
1905
+ }
1906
+ if (!detectedPackageManager) {
1907
+ if (await _pathExists(path4.join(rootDir, "pnpm-lock.yaml"))) {
1908
+ detectedPackageManager = "pnpm";
1909
+ } else if (await _pathExists(path4.join(rootDir, "yarn.lock"))) {
1910
+ detectedPackageManager = "yarn";
1911
+ } else if (await _pathExists(path4.join(rootDir, "package-lock.json"))) {
1912
+ detectedPackageManager = "npm";
1913
+ } else if (await _pathExists(path4.join(rootDir, "bun.lockb"))) {
1914
+ detectedPackageManager = "bun";
1915
+ }
1916
+ }
1917
+ } catch {
1918
+ }
1885
1919
  const STUCK_TIMEOUT_MS = projectScanTimeout ?? cache?.projectScanTimeout ?? 18e4;
1886
1920
  const cores = typeof os2.availableParallelism === "function" ? os2.availableParallelism() : os2.cpus().length || 4;
1887
1921
  const projectConcurrency = Math.max(2, Math.min(16, cores * 2));
@@ -1948,6 +1982,9 @@ async function scanNodeProjects(rootDir, npmCache, cache, projectScanTimeout) {
1948
1982
  if (workspaceRefs.length > 0) {
1949
1983
  project.projectReferences = workspaceRefs;
1950
1984
  }
1985
+ if (detectedPackageManager) {
1986
+ project.packageManager = detectedPackageManager;
1987
+ }
1951
1988
  }
1952
1989
  return results;
1953
1990
  }
@@ -8599,11 +8636,28 @@ async function scanBuildDeploy(rootDir, cache) {
8599
8636
  for (const [file, manager] of Object.entries(lockfileMap)) {
8600
8637
  if (await _pathExists(path24.join(rootDir, file))) managers.add(manager);
8601
8638
  }
8639
+ let rootPkg = null;
8640
+ const rootPkgPath = path24.join(rootDir, "package.json");
8641
+ if (await _pathExists(rootPkgPath)) {
8642
+ try {
8643
+ rootPkg = cache ? await cache.readJsonFile(rootPkgPath) : await readJsonFile(rootPkgPath);
8644
+ } catch {
8645
+ }
8646
+ }
8647
+ if (rootPkg?.packageManager) {
8648
+ const pm = rootPkg.packageManager.split("@")[0]?.toLowerCase();
8649
+ if (pm && ["pnpm", "yarn", "npm", "bun"].includes(pm)) {
8650
+ managers.add(pm);
8651
+ }
8652
+ }
8602
8653
  result.packageManagers = [...managers].sort();
8603
8654
  const monoTools = /* @__PURE__ */ new Set();
8604
8655
  for (const [file, tool] of Object.entries(MONOREPO_FILES)) {
8605
8656
  if (await _pathExists(path24.join(rootDir, file))) monoTools.add(tool);
8606
8657
  }
8658
+ if (rootPkg?.workspaces) {
8659
+ monoTools.add(managers.has("yarn") ? "yarn-workspaces" : "npm-workspaces");
8660
+ }
8607
8661
  result.monorepoTools = [...monoTools].sort();
8608
8662
  return result;
8609
8663
  }
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  baselineCommand
4
- } from "./chunk-6X2BYLQ3.js";
4
+ } from "./chunk-CCU77BBA.js";
5
5
  import {
6
6
  VERSION,
7
7
  dsnCommand,
@@ -10,7 +10,7 @@ import {
10
10
  pushCommand,
11
11
  scanCommand,
12
12
  writeDefaultConfig
13
- } from "./chunk-6666OEOV.js";
13
+ } from "./chunk-S5HZOJPF.js";
14
14
  import {
15
15
  ensureDir,
16
16
  pathExists,
@@ -39,7 +39,7 @@ var initCommand = new Command("init").description("Initialize vibgrate in a proj
39
39
  console.log(chalk.green("\u2714") + ` Created ${chalk.bold("vibgrate.config.ts")}`);
40
40
  }
41
41
  if (opts.baseline) {
42
- const { runBaseline } = await import("./baseline-WYKVNIRH.js");
42
+ const { runBaseline } = await import("./baseline-ZFMJMB7S.js");
43
43
  await runBaseline(rootDir);
44
44
  }
45
45
  console.log("");
package/dist/index.d.ts CHANGED
@@ -39,6 +39,8 @@ interface ProjectScan {
39
39
  runtimeLatest?: string;
40
40
  runtimeMajorsBehind?: number;
41
41
  targetFramework?: string;
42
+ /** Package manager used for this project (e.g. 'pnpm', 'yarn', 'npm', 'bun') */
43
+ packageManager?: string;
42
44
  frameworks: DetectedFramework[];
43
45
  dependencies: DependencyRow[];
44
46
  dependencyAgeBuckets: {
package/dist/index.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  formatText,
6
6
  generateFindings,
7
7
  runScan
8
- } from "./chunk-6666OEOV.js";
8
+ } from "./chunk-S5HZOJPF.js";
9
9
  import "./chunk-JQHUH6A3.js";
10
10
  export {
11
11
  computeDriftScore,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibgrate/cli",
3
- "version": "1.0.74",
3
+ "version": "1.0.76",
4
4
  "description": "CLI for measuring upgrade drift across Node, .NET, Python & Java projects",
5
5
  "type": "module",
6
6
  "bin": {