Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions examples/no-root-package/apiServer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions examples/no-root-package/apiServer/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "api-server",
"version": "1.0.0",
"dependencies": {
"lodash": "4.17.20"
}
}
294 changes: 294 additions & 0 deletions examples/no-root-package/sessionManager/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions examples/no-root-package/sessionManager/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "session-manager",
"version": "1.0.0",
"dependencies": {
"axios": "1.7.7"
}
}
12 changes: 11 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ import {
FixExecutionResult,
printFixModeSummary,
} from "./utils/fix-runner.js";

import { hasRootLockfile, findNestedLockfiles } from "./parsers/multi-package.js";
import { handleMultiFolderScan } from "./scan/multi-folder-scan.js";
let parsedArgs: ReturnType<typeof parseArgs> | null = null;
try {
parsedArgs = parseArgs(process.argv.slice(2));
Expand Down Expand Up @@ -157,6 +158,14 @@ if (parsedArgs) {

validateOptions(options);

// Multi-folder mode: if no root lockfile and 2+ nested lockfiles exist,
// route to dedicated multi-folder handler instead of single-lockfile scan
const nestedLockfiles = findNestedLockfiles(projectPath, searchDepth);
if (!hasRootLockfile(projectPath) && nestedLockfiles.length >= 2) {
await handleMultiFolderScan({ projectRoot: projectPath, batchSize, options });
return;
}

let advisorySourceLine: string;
let advisoryDbFreshnessLine: string | null = null;
let advisoryDbWarning: string | null = null;
Expand Down Expand Up @@ -220,6 +229,7 @@ if (parsedArgs) {
return;
}

if (!options.json) console.log();
let scanState = await scanProject({
scanInput,
batchSize,
Expand Down
Loading