Skip to content

Commit 9b411a0

Browse files
merge branch
2 parents 4c32dfc + 17a1797 commit 9b411a0

21 files changed

+56
-57
lines changed

src/cli/domain/get-mocked-plugins.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const defaultRegister = (
4545
};
4646

4747
const registerStaticMocks = (
48-
mocks: Dictionary<string>,
48+
mocks: Record<string, string>,
4949
logger: Logger
5050
): PluginMock[] =>
5151
_.map(mocks, (mockedValue, pluginName) => {
@@ -62,7 +62,7 @@ const registerStaticMocks = (
6262

6363
const registerDynamicMocks = (
6464
ocJsonLocation: string,
65-
mocks: Dictionary<string>,
65+
mocks: Record<string, string>,
6666
logger: Logger
6767
) =>
6868
_.map(mocks, (source, pluginName) => {

src/cli/domain/handle-dependencies/get-compiler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function getCompiler(options: {
99
compilerDep: string;
1010
componentPath: string;
1111
logger: Logger;
12-
pkg: { devDependencies: Dictionary<string> };
12+
pkg: { devDependencies: Record<string, string> };
1313
}): Promise<Template> {
1414
const { compilerDep, componentPath, logger, pkg } = options;
1515
const compilerPath = path.join(componentPath, 'node_modules', compilerDep);

src/cli/domain/handle-dependencies/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ export default async function handleDependencies(options: {
2828
}> {
2929
const { components, logger, useComponentDependencies } = options;
3030

31-
const dependencies: Dictionary<string> = {};
32-
const addDependencies = (componentDependencies?: Dictionary<string>) =>
31+
const dependencies: Record<string, string> = {};
32+
const addDependencies = (componentDependencies?: Record<string, string>) =>
3333
Object.entries(componentDependencies || {}).forEach(
3434
([dependency, version]) => {
3535
dependencies[dependency] = version;
3636
}
3737
);
3838

39-
const templates: Dictionary<Template> = {};
39+
const templates: Record<string, Template> = {};
4040
const addTemplate = (templateName: string, template: Template) => {
4141
templates[templateName] = template;
4242
};
@@ -63,7 +63,7 @@ export default async function handleDependencies(options: {
6363
compilerDep,
6464
componentPath,
6565
logger,
66-
pkg: pkg as { devDependencies: Dictionary<string> }
66+
pkg: pkg as { devDependencies: Record<string, string> }
6767
});
6868
Object.assign(options, { compiler });
6969
addTemplate(template, compiler);

src/cli/domain/handle-dependencies/install-missing-dependencies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import strings from '../../../resources/index';
66
import { Logger } from '../../logger';
77

88
export default async function installMissingDependencies(options: {
9-
dependencies: Dictionary<string>;
9+
dependencies: Record<string, string>;
1010
logger: Logger;
1111
}): Promise<void> {
1212
const { dependencies, logger } = options;

src/cli/domain/handle-dependencies/link-missing-dependencies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Logger } from '../../logger';
77

88
export default async function linkMissingDependencies(options: {
99
componentPath: string;
10-
dependencies: Dictionary<string>;
10+
dependencies: Record<string, string>;
1111
logger: Logger;
1212
}): Promise<void> {
1313
const { componentPath, dependencies, logger } = options;

src/cli/domain/handle-dependencies/require-template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ interface Template {
1717
verbose: boolean;
1818
production: boolean | undefined;
1919
},
20-
cb: Callback<Component>
20+
cb: (err: Error | null, data: Component) => void
2121
) => void;
2222
}
2323

src/cli/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ type Command = {
6161
cmd: string;
6262
};
6363
options?: any;
64-
commands?: Dictionary<Command>;
64+
commands?: Record<string, Command>;
6565
};
6666

6767
function processCommand(

src/globals.d.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,10 @@ declare module 'require-package-name' {
5858
export = requirePackageName;
5959
}
6060
declare module 'getport' {
61-
function getPort(start: number, cb: Callback): void;
61+
function getPort(
62+
start: number,
63+
cb: (err: unknown, data: number) => void
64+
): void;
6265

6366
export = getPort;
6467
}
@@ -80,15 +83,15 @@ declare module 'minimal-request' {
8083
method?: string;
8184
body?: unknown;
8285
url: string;
83-
headers?: Dictionary<string | null | undefined | string[]>;
86+
headers?: Record<string, string | null | undefined | string[]>;
8487
json?: boolean;
8588
},
8689
cb: (
8790
err: Error | number | null,
8891
body: T,
8992
details: {
9093
response: {
91-
headers: Dictionary<string>;
94+
headers: Record<string, string>;
9295
};
9396
}
9497
) => void
@@ -98,10 +101,3 @@ declare module 'minimal-request' {
98101

99102
export = request;
100103
}
101-
102-
declare type Callback<T = undefined, E = Error> = (
103-
err: E | null,
104-
data: T
105-
) => void;
106-
107-
declare type Dictionary<T> = Record<string, T>;

src/registry/domain/authentication.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const basicAuthentication: Authentication<{
3535
}
3636
};
3737

38-
const builtin: Dictionary<Authentication> = {
38+
const builtin: Record<string, Authentication> = {
3939
basic: basicAuthentication
4040
};
4141

src/registry/domain/components-cache/components-list.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function componentsList(conf: Config, cdn: StorageAdapter) {
1212
getFromJson: (): Promise<ComponentsList> => cdn.getJson(filePath(), true),
1313

1414
getFromDirectories: async (): Promise<ComponentsList> => {
15-
const componentsInfo: Dictionary<string[]> = {};
15+
const componentsInfo: Record<string, string[]> = {};
1616

1717
const getVersionsForComponent = async (
1818
componentName: string

0 commit comments

Comments
 (0)