Initial Commit

* Implements Select package.json and parse dependencies
* Implements Bun API to handle package Analysis
* Implements NPM Registry API handlers
* Analyze the cross dependencies between packages
* Implements loading NodeJS versions with search (inclusing LTS)
* Error handling
* Implements Report option to get higher infor about the dependencies
* Implements Upgrade command builder
This commit is contained in:
2026-04-14 22:27:06 +05:30
commit 0e561a3fc8
32 changed files with 3285 additions and 0 deletions

31
src/lib/npm_registry.ts Normal file
View File

@@ -0,0 +1,31 @@
const API_BASE_URL = "https://registry.npmjs.org/";
export async function getPackageDetails(packageName: string) {
const packageUrl = `${API_BASE_URL}${packageName}`;
return fetch(packageUrl)
.then(res => {
if (res.status === 404) {
return {
name: packageName,
error: "not-found",
isPrivatePackage: true,
message: "Package not found in npm registry - may be a private package"
};
}
if (!res.ok) {
return {
name: packageName,
error: "fetch-error",
message: `Failed to fetch package (Status: ${res.status})`
};
}
return res.json();
}).catch(error => {
console.error(`Error fetching package ${packageName}:`, error);
return {
name: packageName,
error: "network-error",
message: error.message || "Network error while fetching package"
};
});
}