@vibgrate/cli 1.0.73 → 1.0.75
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.
|
@@ -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
|
}
|
|
@@ -7249,6 +7286,16 @@ var ScanProgress = class {
|
|
|
7249
7286
|
}
|
|
7250
7287
|
this.render();
|
|
7251
7288
|
}
|
|
7289
|
+
/** Insert a new step before an existing step (used for dynamically discovered items) */
|
|
7290
|
+
insertStepBefore(beforeId, step) {
|
|
7291
|
+
const idx = this.steps.findIndex((s) => s.id === beforeId);
|
|
7292
|
+
const newStep = { ...step, status: "pending", weight: step.weight ?? 1 };
|
|
7293
|
+
if (idx >= 0) {
|
|
7294
|
+
this.steps.splice(idx, 0, newStep);
|
|
7295
|
+
} else {
|
|
7296
|
+
this.steps.push(newStep);
|
|
7297
|
+
}
|
|
7298
|
+
}
|
|
7252
7299
|
/** Mark a step as active (currently running), optionally with expected total */
|
|
7253
7300
|
startStep(id, subTotal) {
|
|
7254
7301
|
const step = this.steps.find((s) => s.id === id);
|
|
@@ -8589,11 +8636,28 @@ async function scanBuildDeploy(rootDir, cache) {
|
|
|
8589
8636
|
for (const [file, manager] of Object.entries(lockfileMap)) {
|
|
8590
8637
|
if (await _pathExists(path24.join(rootDir, file))) managers.add(manager);
|
|
8591
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
|
+
}
|
|
8592
8653
|
result.packageManagers = [...managers].sort();
|
|
8593
8654
|
const monoTools = /* @__PURE__ */ new Set();
|
|
8594
8655
|
for (const [file, tool] of Object.entries(MONOREPO_FILES)) {
|
|
8595
8656
|
if (await _pathExists(path24.join(rootDir, file))) monoTools.add(tool);
|
|
8596
8657
|
}
|
|
8658
|
+
if (rootPkg?.workspaces) {
|
|
8659
|
+
monoTools.add(managers.has("yarn") ? "yarn-workspaces" : "npm-workspaces");
|
|
8660
|
+
}
|
|
8597
8661
|
result.monorepoTools = [...monoTools].sort();
|
|
8598
8662
|
return result;
|
|
8599
8663
|
}
|
|
@@ -11706,21 +11770,6 @@ async function runScan(rootDir, opts) {
|
|
|
11706
11770
|
{ id: "discovery", label: "Discovering workspace", weight: 3 },
|
|
11707
11771
|
{ id: "vcs", label: "Detecting version control" },
|
|
11708
11772
|
{ id: "walk", label: "Indexing files", weight: 8 },
|
|
11709
|
-
{ id: "node", label: "Found Node projects", weight: 4 },
|
|
11710
|
-
{ id: "dotnet", label: "Found .NET projects", weight: 2 },
|
|
11711
|
-
{ id: "python", label: "Found Python projects", weight: 3 },
|
|
11712
|
-
{ id: "java", label: "Found Java projects", weight: 3 },
|
|
11713
|
-
{ id: "ruby", label: "Found Ruby projects", weight: 2 },
|
|
11714
|
-
{ id: "swift", label: "Found Swift projects", weight: 2 },
|
|
11715
|
-
{ id: "go", label: "Found Go projects", weight: 2 },
|
|
11716
|
-
{ id: "rust", label: "Found Rust projects", weight: 2 },
|
|
11717
|
-
{ id: "php", label: "Found PHP projects", weight: 2 },
|
|
11718
|
-
{ id: "dart", label: "Found Dart projects", weight: 2 },
|
|
11719
|
-
{ id: "elixir", label: "Found Elixir projects", weight: 2 },
|
|
11720
|
-
{ id: "docker", label: "Found Docker images", weight: 2 },
|
|
11721
|
-
{ id: "helm", label: "Found Helm charts", weight: 2 },
|
|
11722
|
-
{ id: "terraform", label: "Found Terraform configs", weight: 2 },
|
|
11723
|
-
{ id: "polyglot", label: "Found additional language projects", weight: 2 },
|
|
11724
11773
|
...scanners !== false ? [
|
|
11725
11774
|
...scannerPolicy.platformMatrix && scanners?.platformMatrix?.enabled !== false ? [{ id: "platform", label: "Platform matrix" }] : [],
|
|
11726
11775
|
...scannerPolicy.toolingInventory && scanners?.toolingInventory?.enabled !== false ? [{ id: "tooling", label: "Tooling inventory" }] : [],
|
|
@@ -11792,6 +11841,7 @@ async function runScan(rootDir, opts) {
|
|
|
11792
11841
|
progress.completeStep("walk", `${treeCount.totalFiles.toLocaleString()} files indexed`);
|
|
11793
11842
|
const nodeProjects = await scanNodeProjects(rootDir, npmCache, fileCache, projectScanTimeoutMs);
|
|
11794
11843
|
if (nodeProjects.length > 0) {
|
|
11844
|
+
progress.insertStepBefore("drift", { id: "node", label: "Found Node projects", weight: 4 });
|
|
11795
11845
|
progress.startStep("node");
|
|
11796
11846
|
for (const p of nodeProjects) {
|
|
11797
11847
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11803,6 +11853,7 @@ async function runScan(rootDir, opts) {
|
|
|
11803
11853
|
}
|
|
11804
11854
|
const dotnetProjects = await scanDotnetProjects(rootDir, nugetCache, fileCache, projectScanTimeoutMs);
|
|
11805
11855
|
if (dotnetProjects.length > 0) {
|
|
11856
|
+
progress.insertStepBefore("drift", { id: "dotnet", label: "Found .NET projects", weight: 2 });
|
|
11806
11857
|
progress.startStep("dotnet");
|
|
11807
11858
|
for (const p of dotnetProjects) {
|
|
11808
11859
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11814,6 +11865,7 @@ async function runScan(rootDir, opts) {
|
|
|
11814
11865
|
}
|
|
11815
11866
|
const pythonProjects = await scanPythonProjects(rootDir, pypiCache, fileCache, projectScanTimeoutMs);
|
|
11816
11867
|
if (pythonProjects.length > 0) {
|
|
11868
|
+
progress.insertStepBefore("drift", { id: "python", label: "Found Python projects", weight: 3 });
|
|
11817
11869
|
progress.startStep("python");
|
|
11818
11870
|
for (const p of pythonProjects) {
|
|
11819
11871
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11825,6 +11877,7 @@ async function runScan(rootDir, opts) {
|
|
|
11825
11877
|
}
|
|
11826
11878
|
const javaProjects = await scanJavaProjects(rootDir, mavenCache, fileCache, projectScanTimeoutMs);
|
|
11827
11879
|
if (javaProjects.length > 0) {
|
|
11880
|
+
progress.insertStepBefore("drift", { id: "java", label: "Found Java projects", weight: 3 });
|
|
11828
11881
|
progress.startStep("java");
|
|
11829
11882
|
for (const p of javaProjects) {
|
|
11830
11883
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11836,6 +11889,7 @@ async function runScan(rootDir, opts) {
|
|
|
11836
11889
|
}
|
|
11837
11890
|
const rubyProjects = await scanRubyProjects(rootDir, rubygemsCache, fileCache, projectScanTimeoutMs);
|
|
11838
11891
|
if (rubyProjects.length > 0) {
|
|
11892
|
+
progress.insertStepBefore("drift", { id: "ruby", label: "Found Ruby projects", weight: 2 });
|
|
11839
11893
|
progress.startStep("ruby");
|
|
11840
11894
|
for (const p of rubyProjects) {
|
|
11841
11895
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11847,6 +11901,7 @@ async function runScan(rootDir, opts) {
|
|
|
11847
11901
|
}
|
|
11848
11902
|
const swiftProjects = await scanSwiftProjects(rootDir, swiftCache, fileCache, projectScanTimeoutMs);
|
|
11849
11903
|
if (swiftProjects.length > 0) {
|
|
11904
|
+
progress.insertStepBefore("drift", { id: "swift", label: "Found Swift projects", weight: 2 });
|
|
11850
11905
|
progress.startStep("swift");
|
|
11851
11906
|
for (const p of swiftProjects) {
|
|
11852
11907
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11858,6 +11913,7 @@ async function runScan(rootDir, opts) {
|
|
|
11858
11913
|
}
|
|
11859
11914
|
const goProjects = await scanGoProjects(rootDir, goCache, fileCache, projectScanTimeoutMs);
|
|
11860
11915
|
if (goProjects.length > 0) {
|
|
11916
|
+
progress.insertStepBefore("drift", { id: "go", label: "Found Go projects", weight: 2 });
|
|
11861
11917
|
progress.startStep("go");
|
|
11862
11918
|
for (const p of goProjects) {
|
|
11863
11919
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11869,6 +11925,7 @@ async function runScan(rootDir, opts) {
|
|
|
11869
11925
|
}
|
|
11870
11926
|
const rustProjects = await scanRustProjects(rootDir, cargoCache, fileCache, projectScanTimeoutMs);
|
|
11871
11927
|
if (rustProjects.length > 0) {
|
|
11928
|
+
progress.insertStepBefore("drift", { id: "rust", label: "Found Rust projects", weight: 2 });
|
|
11872
11929
|
progress.startStep("rust");
|
|
11873
11930
|
for (const p of rustProjects) {
|
|
11874
11931
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11880,6 +11937,7 @@ async function runScan(rootDir, opts) {
|
|
|
11880
11937
|
}
|
|
11881
11938
|
const phpProjects = await scanPhpProjects(rootDir, composerCache, fileCache, projectScanTimeoutMs);
|
|
11882
11939
|
if (phpProjects.length > 0) {
|
|
11940
|
+
progress.insertStepBefore("drift", { id: "php", label: "Found PHP projects", weight: 2 });
|
|
11883
11941
|
progress.startStep("php");
|
|
11884
11942
|
for (const p of phpProjects) {
|
|
11885
11943
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11891,6 +11949,7 @@ async function runScan(rootDir, opts) {
|
|
|
11891
11949
|
}
|
|
11892
11950
|
const dartProjects = await scanDartProjects(rootDir, pubCache, fileCache, projectScanTimeoutMs);
|
|
11893
11951
|
if (dartProjects.length > 0) {
|
|
11952
|
+
progress.insertStepBefore("drift", { id: "dart", label: "Found Dart projects", weight: 2 });
|
|
11894
11953
|
progress.startStep("dart");
|
|
11895
11954
|
for (const p of dartProjects) {
|
|
11896
11955
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11902,6 +11961,7 @@ async function runScan(rootDir, opts) {
|
|
|
11902
11961
|
}
|
|
11903
11962
|
const elixirProjects = await scanElixirProjects(rootDir, packageManifest, fileCache, projectScanTimeoutMs, offlineMode);
|
|
11904
11963
|
if (elixirProjects.length > 0) {
|
|
11964
|
+
progress.insertStepBefore("drift", { id: "elixir", label: "Found Elixir projects", weight: 2 });
|
|
11905
11965
|
progress.startStep("elixir");
|
|
11906
11966
|
for (const p of elixirProjects) {
|
|
11907
11967
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11913,6 +11973,7 @@ async function runScan(rootDir, opts) {
|
|
|
11913
11973
|
}
|
|
11914
11974
|
const dockerProjects = await scanDockerProjects(rootDir, packageManifest, fileCache, projectScanTimeoutMs, offlineMode);
|
|
11915
11975
|
if (dockerProjects.length > 0) {
|
|
11976
|
+
progress.insertStepBefore("drift", { id: "docker", label: "Found Docker images", weight: 2 });
|
|
11916
11977
|
progress.startStep("docker");
|
|
11917
11978
|
for (const p of dockerProjects) {
|
|
11918
11979
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11923,6 +11984,7 @@ async function runScan(rootDir, opts) {
|
|
|
11923
11984
|
}
|
|
11924
11985
|
const helmProjects = await scanHelmProjects(rootDir, packageManifest, fileCache, projectScanTimeoutMs, offlineMode);
|
|
11925
11986
|
if (helmProjects.length > 0) {
|
|
11987
|
+
progress.insertStepBefore("drift", { id: "helm", label: "Found Helm charts", weight: 2 });
|
|
11926
11988
|
progress.startStep("helm");
|
|
11927
11989
|
for (const p of helmProjects) {
|
|
11928
11990
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11934,6 +11996,7 @@ async function runScan(rootDir, opts) {
|
|
|
11934
11996
|
}
|
|
11935
11997
|
const terraformProjects = await scanTerraformProjects(rootDir, packageManifest, fileCache, projectScanTimeoutMs, offlineMode);
|
|
11936
11998
|
if (terraformProjects.length > 0) {
|
|
11999
|
+
progress.insertStepBefore("drift", { id: "terraform", label: "Found Terraform configs", weight: 2 });
|
|
11937
12000
|
progress.startStep("terraform");
|
|
11938
12001
|
for (const p of terraformProjects) {
|
|
11939
12002
|
progress.addDependencies(p.dependencies.length);
|
|
@@ -11944,6 +12007,7 @@ async function runScan(rootDir, opts) {
|
|
|
11944
12007
|
}
|
|
11945
12008
|
const polyglotProjects = await scanPolyglotProjects(rootDir, fileCache);
|
|
11946
12009
|
if (polyglotProjects.length > 0) {
|
|
12010
|
+
progress.insertStepBefore("drift", { id: "polyglot", label: "Found additional language projects", weight: 2 });
|
|
11947
12011
|
progress.startStep("polyglot");
|
|
11948
12012
|
for (const p of polyglotProjects) {
|
|
11949
12013
|
progress.addDependencies(p.dependencies.length);
|
package/dist/cli.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
baselineCommand
|
|
4
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
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