feat: add install catalog and project config autodetection

This commit is contained in:
Affaan Mustafa
2026-03-24 03:53:45 -07:00
parent cc60bf6b65
commit b4296c7095
11 changed files with 496 additions and 6 deletions

View File

@@ -47,6 +47,12 @@ function resolveInstallConfigPath(configPath, options = {}) {
: path.normalize(path.join(cwd, configPath));
}
function findDefaultInstallConfigPath(options = {}) {
const cwd = options.cwd || process.cwd();
const candidatePath = path.join(cwd, DEFAULT_INSTALL_CONFIG);
return fs.existsSync(candidatePath) ? candidatePath : null;
}
function loadInstallConfig(configPath, options = {}) {
const resolvedPath = resolveInstallConfigPath(configPath, options);
@@ -77,6 +83,7 @@ function loadInstallConfig(configPath, options = {}) {
module.exports = {
DEFAULT_INSTALL_CONFIG,
findDefaultInstallConfigPath,
loadInstallConfig,
resolveInstallConfigPath,
};