Skip to content

Commit

Permalink
chore: clean up ManagerConfig types (#11469)
Browse files Browse the repository at this point in the history
* chore: use ExtractConfig for git-submodules

* chore: drop ManagerConfig from config/types

* chore: remove unused ManagerConfig from manager types
  • Loading branch information
rarkins committed Aug 30, 2021
1 parent 507069d commit 96c4df2
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
11 changes: 3 additions & 8 deletions lib/config/index.ts
@@ -1,21 +1,16 @@
import { logger } from '../logger';
import { get, getLanguageList, getManagerList } from '../manager';
import * as options from './options';
import type {
AllConfig,
ManagerConfig,
RenovateConfig,
RenovateConfigStage,
} from './types';
import type { AllConfig, RenovateConfig, RenovateConfigStage } from './types';
import { mergeChildConfig } from './utils';

export { mergeChildConfig };

export function getManagerConfig(
config: RenovateConfig,
manager: string
): ManagerConfig {
let managerConfig: ManagerConfig = {
): RenovateConfig {
let managerConfig: RenovateConfig = {
...config,
language: null,
manager: null,
Expand Down
5 changes: 0 additions & 5 deletions lib/config/types.ts
Expand Up @@ -375,11 +375,6 @@ export interface PackageRuleInputConfig extends Record<string, unknown> {
packageRules?: (PackageRule & PackageRuleInputConfig)[];
}

export interface ManagerConfig extends RenovateConfig {
language: string;
manager: string;
}

export interface MigratedConfig {
isMigrated: boolean;
migratedConfig: RenovateConfig;
Expand Down
4 changes: 2 additions & 2 deletions lib/manager/git-submodules/extract.ts
Expand Up @@ -5,7 +5,7 @@ import { getGlobalConfig } from '../../config/global';
import * as datasourceGitRefs from '../../datasource/git-refs';
import { logger } from '../../logger';
import { getHttpUrl, getRemoteUrlWithToken } from '../../util/git/url';
import type { ManagerConfig, PackageFile } from '../types';
import type { ExtractConfig, PackageFile } from '../types';
import { GitModule } from './types';

async function getUrl(
Expand Down Expand Up @@ -86,7 +86,7 @@ async function getModules(
export default async function extractPackageFile(
_content: string,
fileName: string,
config: ManagerConfig
config: ExtractConfig
): Promise<PackageFile | null> {
const { localDir } = getGlobalConfig();
const git = Git(localDir);
Expand Down
8 changes: 2 additions & 6 deletions lib/manager/types.ts
Expand Up @@ -9,10 +9,6 @@ import type { File } from '../util/git';

export type Result<T> = T | Promise<T>;

export interface ManagerConfig {
registryUrls?: string[];
}

export interface ManagerData<T> {
managerData?: T;
}
Expand All @@ -38,7 +34,7 @@ export interface CustomExtractConfig extends ExtractConfig {
versioningTemplate?: string;
}

export interface UpdateArtifactsConfig extends ManagerConfig {
export interface UpdateArtifactsConfig {
isLockFileMaintenance?: boolean;
constraints?: Record<string, string>;
composerIgnorePlatformReqs?: string[];
Expand Down Expand Up @@ -259,7 +255,7 @@ export interface ManagerApi {
}

// TODO: name and properties used by npm manager
export interface PostUpdateConfig extends ManagerConfig, Record<string, any> {
export interface PostUpdateConfig extends Record<string, any> {
updatedPackageFiles?: File[];
postUpdateOptions?: string[];
skipInstalls?: boolean;
Expand Down
6 changes: 3 additions & 3 deletions lib/workers/repository/process/fetch.ts
@@ -1,6 +1,6 @@
import pAll from 'p-all';
import { getManagerConfig, mergeChildConfig } from '../../../config';
import type { ManagerConfig, RenovateConfig } from '../../../config/types';
import type { RenovateConfig } from '../../../config/types';
import { getDefaultConfig } from '../../../datasource';
import { logger } from '../../../logger';
import type { PackageDependency, PackageFile } from '../../../manager/types';
Expand All @@ -11,7 +11,7 @@ import { lookupUpdates } from './lookup';
import type { LookupUpdateConfig } from './lookup/types';

async function fetchDepUpdates(
packageFileConfig: ManagerConfig & PackageFile,
packageFileConfig: RenovateConfig & PackageFile,
indep: PackageDependency
): Promise<PackageDependency> {
let dep = clone(indep);
Expand Down Expand Up @@ -45,7 +45,7 @@ async function fetchDepUpdates(

async function fetchManagerPackagerFileUpdates(
config: RenovateConfig,
managerConfig: ManagerConfig,
managerConfig: RenovateConfig,
pFile: PackageFile
): Promise<void> {
const { packageFile } = pFile;
Expand Down

0 comments on commit 96c4df2

Please sign in to comment.