Skip to content

Commit 822173a

Browse files
chore: rename initService to projectInitService
Rename `initService` to `projectInitService` as the new name has more sense.
1 parent 02d6dfb commit 822173a

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

lib/bootstrap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ $injector.require("xcprojService", "./services/xcproj-service");
109109
$injector.require("versionsService", "./services/versions-service");
110110
$injector.requireCommand("install", "./commands/install");
111111

112-
$injector.require("initService", "./services/init-service");
112+
$injector.require("projectInitService", "./services/project-init-service");
113113
$injector.requireCommand("init", "./commands/init");
114114

115115
$injector.require("infoService", "./services/info-service");

lib/commands/init.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
export class InitCommand implements ICommand {
1+
export class ProjectInitCommand implements ICommand {
22
public allowedParameters: ICommandParameter[] = [];
33
public enableHooks = false;
44

5-
constructor(private $initService: IInitService) { }
5+
constructor(private $projectInitService: IProjectInitService) { }
66

77
public async execute(args: string[]): Promise<void> {
8-
return this.$initService.initialize();
8+
return this.$projectInitService.initialize();
99
}
1010
}
1111

12-
$injector.registerCommand("init", InitCommand);
12+
$injector.registerCommand("init", ProjectInitCommand);

lib/declarations.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -603,7 +603,7 @@ interface IUpdatePlatformOptions extends IPlatformTemplate {
603603
canUpdate: boolean;
604604
}
605605

606-
interface IInitService {
606+
interface IProjectInitService {
607607
initialize(): Promise<void>;
608608
}
609609

lib/services/init-service.ts renamed to lib/services/project-init-service.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import * as helpers from "../common/helpers";
33
import * as path from "path";
44
import * as semver from "semver";
55

6-
export class InitService implements IInitService {
6+
export class ProjectInitService implements IProjectInitService {
77
private static MIN_SUPPORTED_FRAMEWORK_VERSIONS: IStringDictionary = {
88
"tns-ios": "1.1.0",
99
"tns-android": "1.1.0",
@@ -107,7 +107,7 @@ export class InitService implements IInitService {
107107
}
108108

109109
const allVersions: any = await this.$packageManager.view(packageName, { "versions": true });
110-
const versions = _.filter(allVersions, (v: string) => semver.gte(v, InitService.MIN_SUPPORTED_FRAMEWORK_VERSIONS[packageName]));
110+
const versions = _.filter(allVersions, (v: string) => semver.gte(v, ProjectInitService.MIN_SUPPORTED_FRAMEWORK_VERSIONS[packageName]));
111111
if (versions.length === 1) {
112112
this.$logger.info(`Only ${versions[0]} version is available for ${packageName}.`);
113113
return this.buildVersionData(versions[0]);
@@ -121,7 +121,7 @@ export class InitService implements IInitService {
121121
private buildVersionData(version: string): IStringDictionary {
122122
const result: IStringDictionary = {};
123123

124-
result[InitService.VERSION_KEY_NAME] = version;
124+
result[ProjectInitService.VERSION_KEY_NAME] = version;
125125

126126
return result;
127127
}
@@ -130,4 +130,4 @@ export class InitService implements IInitService {
130130
return !helpers.isInteractive() || this.$options.force;
131131
}
132132
}
133-
$injector.register("initService", InitService);
133+
$injector.register("projectInitService", ProjectInitService);

0 commit comments

Comments
 (0)