MCPcopy Create free account
hub / github.com/vercel/vercel / classifyPackages

Function classifyPackages

packages/python-analysis/src/manifest/uv-lock-parser.ts:162–188  ·  view source on GitHub ↗
(
  options: ClassifyPackagesOptions
)

Source from the content-addressed store, hash-verified

160 * at runtime vs. which must be bundled with the deployment.
161 */
162export function classifyPackages(
163 options: ClassifyPackagesOptions
164): PackageClassification {
165 const { lockFile, excludePackages = [] } = options;
166 const privatePackages: string[] = [];
167 const publicPackages: string[] = [];
168 const packageVersions: Record<string, string> = {};
169
170 const excludeSet = new Set(excludePackages.map(normalizePackageName));
171
172 for (const pkg of lockFile.packages) {
173 // Skip excluded packages (e.g., the project's own package)
174 if (excludeSet.has(normalizePackageName(pkg.name))) {
175 continue;
176 }
177
178 packageVersions[pkg.name] = pkg.version;
179
180 if (isPrivatePackageSource(pkg.source)) {
181 privatePackages.push(pkg.name);
182 } else {
183 publicPackages.push(pkg.name);
184 }
185 }
186
187 return { privatePackages, publicPackages, packageVersions };
188}

Callers 2

generateBundleMethod · 0.90

Calls 4

isPrivatePackageSourceFunction · 0.85
normalizePackageNameFunction · 0.70
pushMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected