refactor(ngcc): rename Configuration.getConfig()
(#36838)
Strictly this method only returns config for packages. So this commit renames it to `getPackageConfig()`, which frees us up to add other "getXxxxConfig()` methods later. PR Close #36838
This commit is contained in:

committed by
Alex Rickabaugh

parent
9b85b533ff
commit
98931bf9b5
@ -225,7 +225,7 @@ export class DependencyResolver {
|
||||
private filterIgnorableDeepImports(entryPoint: EntryPoint, deepImports: Set<AbsoluteFsPath>):
|
||||
AbsoluteFsPath[] {
|
||||
const version = (entryPoint.packageJson.version || null) as string | null;
|
||||
const packageConfig = this.config.getConfig(entryPoint.package, version);
|
||||
const packageConfig = this.config.getPackageConfig(entryPoint.package, version);
|
||||
const matchers = packageConfig.ignorableDeepImportMatchers || [];
|
||||
return Array.from(deepImports)
|
||||
.filter(deepImport => !matchers.some(matcher => matcher.test(deepImport)));
|
||||
|
@ -177,7 +177,7 @@ export class NgccConfiguration {
|
||||
* @param version The version of the package whose config we want, or `null` if the package's
|
||||
* package.json did not exist or was invalid.
|
||||
*/
|
||||
getConfig(packagePath: AbsoluteFsPath, version: string|null): VersionedPackageConfig {
|
||||
getPackageConfig(packagePath: AbsoluteFsPath, version: string|null): VersionedPackageConfig {
|
||||
const cacheKey = packagePath + (version !== null ? `@${version}` : '');
|
||||
if (this.cache.has(cacheKey)) {
|
||||
return this.cache.get(cacheKey)!;
|
||||
|
@ -121,7 +121,7 @@ export function getEntryPointInfo(
|
||||
const packageJsonPath = resolve(entryPointPath, 'package.json');
|
||||
const packageVersion = getPackageVersion(fs, packageJsonPath);
|
||||
const entryPointConfig =
|
||||
config.getConfig(packagePath, packageVersion).entryPoints[entryPointPath];
|
||||
config.getPackageConfig(packagePath, packageVersion).entryPoints[entryPointPath];
|
||||
const hasConfig = entryPointConfig !== undefined;
|
||||
|
||||
if (!hasConfig && !fs.exists(packageJsonPath)) {
|
||||
|
Reference in New Issue
Block a user