Skip to content

Commit 2168c55

Browse files
committed
Rename nativescript to nativeScript
1 parent 9940fdd commit 2168c55

6 files changed

+23
-23
lines changed

lib/bootstrap.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ $injector.require("terminalSpinnerService", "./services/terminal-spinner-service
160160

161161
$injector.require('playgroundService', './services/playground-service');
162162
$injector.require("platformEnvironmentRequirements", "./services/platform-environment-requirements");
163-
$injector.require("nativescriptCloudExtensionService", "./services/nativescript-cloud-extension-service");
163+
$injector.require("nativeScriptCloudExtensionService", "./services/nativescript-cloud-extension-service");
164164

165165
$injector.requireCommand("resources|generate|icons", "./commands/generate-assets");
166166
$injector.requireCommand("resources|generate|splashes", "./commands/generate-assets");

lib/commands/setup.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ $injector.registerCommand("setup|*", SetupCommand);
1212
export class CloudSetupCommand implements ICommand {
1313
public allowedParameters: ICommandParameter[] = [];
1414

15-
constructor(private $nativescriptCloudExtensionService: INativescriptCloudExtensionService) { }
15+
constructor(private $nativeScriptCloudExtensionService: INativeScriptCloudExtensionService) { }
1616

1717
public execute(args: string[]): Promise<any> {
18-
return this.$nativescriptCloudExtensionService.install();
18+
return this.$nativeScriptCloudExtensionService.install();
1919
}
2020
}
2121
$injector.registerCommand(["setup|cloud", "cloud|setup"], CloudSetupCommand);

lib/declarations.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ interface IBundleValidatorHelper {
788788
validate(): void;
789789
}
790790

791-
interface INativescriptCloudExtensionService {
791+
interface INativeScriptCloudExtensionService {
792792
/**
793793
* Installs nativescript-cloud extension
794794
* @return {Promise<IExtensionData>} returns the extension data

lib/services/nativescript-cloud-extension-service.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import * as constants from "../constants";
22
import * as semver from "semver";
33

4-
export class NativescriptCloudExtensionService implements INativescriptCloudExtensionService {
4+
export class NativeScriptCloudExtensionService implements INativeScriptCloudExtensionService {
55
constructor(private $extensibilityService: IExtensibilityService,
66
private $logger: ILogger,
77
private $npmInstallationManager: INpmInstallationManager) { }
@@ -32,4 +32,4 @@ export class NativescriptCloudExtensionService implements INativescriptCloudExte
3232
return _.find(this.$extensibilityService.getInstalledExtensionsData(), extensionData => extensionData.extensionName === constants.NATIVESCRIPT_CLOUD_EXTENSION_NAME);
3333
}
3434
}
35-
$injector.register("nativescriptCloudExtensionService", NativescriptCloudExtensionService);
35+
$injector.register("nativeScriptCloudExtensionService", NativeScriptCloudExtensionService);

lib/services/platform-environment-requirements.ts

+6-6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ
77
private $doctorService: IDoctorService,
88
private $errors: IErrors,
99
private $logger: ILogger,
10-
private $nativescriptCloudExtensionService: INativescriptCloudExtensionService,
10+
private $nativeScriptCloudExtensionService: INativeScriptCloudExtensionService,
1111
private $prompter: IPrompter,
1212
private $staticConfig: IStaticConfig) { }
1313

@@ -52,7 +52,7 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ
5252
return true;
5353
}
5454

55-
if (this.$nativescriptCloudExtensionService.isInstalled()) {
55+
if (this.$nativeScriptCloudExtensionService.isInstalled()) {
5656
this.processManuallySetup(platform);
5757
} else {
5858
const option = await this.$prompter.promptForChoice(PlatformEnvironmentRequirements.NOT_CONFIGURED_ENV_AFTER_SETUP_SCRIPT_MESSAGE, [
@@ -91,7 +91,7 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ
9191
}
9292

9393
private processCloudBuildsCore(platform: string): Promise<IExtensionData> {
94-
return this.$nativescriptCloudExtensionService.install();
94+
return this.$nativeScriptCloudExtensionService.install();
9595
}
9696

9797
private getCloudBuildsMessage(platform: string): string {
@@ -132,7 +132,7 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ
132132
}
133133

134134
private getNonInteractiveConsoleMessage(platform: string) {
135-
return this.$nativescriptCloudExtensionService.isInstalled() ?
135+
return this.$nativeScriptCloudExtensionService.isInstalled() ?
136136
this.buildMultilineMessage([
137137
`${PlatformEnvironmentRequirements.MISSING_LOCAL_SETUP_MESSAGE} ${PlatformEnvironmentRequirements.CHOOSE_OPTIONS_MESSAGE}`,
138138
PlatformEnvironmentRequirements.RUN_TNS_SETUP_MESSAGE,
@@ -150,7 +150,7 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ
150150
private getInteractiveConsoleMessage(platform: string) {
151151
const message = `The ${constants.NATIVESCRIPT_CLOUD_EXTENSION_NAME} extension is installed and you can ${_.lowerFirst(this.getCloudBuildsMessage(platform))}`;
152152

153-
return this.$nativescriptCloudExtensionService.isInstalled() ?
153+
return this.$nativeScriptCloudExtensionService.isInstalled() ?
154154
this.buildMultilineMessage([
155155
`${message.bold}`,
156156
`${PlatformEnvironmentRequirements.MISSING_LOCAL_SETUP_MESSAGE} ${PlatformEnvironmentRequirements.CHOOSE_OPTIONS_MESSAGE}`,
@@ -167,7 +167,7 @@ export class PlatformEnvironmentRequirements implements IPlatformEnvironmentRequ
167167
}
168168

169169
private promptForChoice(): Promise<string> {
170-
const choices = this.$nativescriptCloudExtensionService.isInstalled() ? [
170+
const choices = this.$nativeScriptCloudExtensionService.isInstalled() ? [
171171
PlatformEnvironmentRequirements.LOCAL_SETUP_OPTION_NAME,
172172
PlatformEnvironmentRequirements.MANUALLY_SETUP_OPTION_NAME,
173173
] : [

test/services/platform-environment-requirements.ts

+11-11
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe("platformEnvironmentRequirements ", () => {
5959
};
6060
}
6161

62-
function mockNativescriptCloudExtensionService(data: {isInstalled: boolean}) {
62+
function mockNativeScriptCloudExtensionService(data: {isInstalled: boolean}) {
6363
const nativescriptCloudExtensionService = testInjector.resolve("nativescriptCloudExtensionService");
6464
nativescriptCloudExtensionService.isInstalled = () => data.isInstalled;
6565
nativescriptCloudExtensionService.install = () => { isExtensionInstallCalled = true; };
@@ -87,7 +87,7 @@ describe("platformEnvironmentRequirements ", () => {
8787
it("should show prompt when environment is not configured and nativescript-cloud extension is not installed", async () => {
8888
mockDoctorService({ canExecuteLocalBuild: false });
8989
mockPrompter({ firstCallOptionName: PlatformEnvironmentRequirements.CLOUD_SETUP_OPTION_NAME });
90-
mockNativescriptCloudExtensionService({ isInstalled: false });
90+
mockNativeScriptCloudExtensionService({ isInstalled: false });
9191

9292
await assert.isRejected(platformEnvironmentRequirements.checkEnvironmentRequirements(platform));
9393
assert.isTrue(promptForChoiceData.length === 1);
@@ -98,7 +98,7 @@ describe("platformEnvironmentRequirements ", () => {
9898
it("should show prompt when environment is not configured and nativescript-cloud extension is installed", async () => {
9999
mockDoctorService({ canExecuteLocalBuild: false });
100100
mockPrompter({ firstCallOptionName: PlatformEnvironmentRequirements.CLOUD_SETUP_OPTION_NAME });
101-
mockNativescriptCloudExtensionService({ isInstalled: true });
101+
mockNativeScriptCloudExtensionService({ isInstalled: true });
102102

103103
await assert.isRejected(platformEnvironmentRequirements.checkEnvironmentRequirements(platform));
104104
assert.isTrue(promptForChoiceData.length === 1);
@@ -123,7 +123,7 @@ describe("platformEnvironmentRequirements ", () => {
123123
doctorService.canExecuteLocalBuild = () => false;
124124
doctorService.runSetupScript = async () => { doctorService.canExecuteLocalBuild = () => true; };
125125

126-
mockNativescriptCloudExtensionService({ isInstalled: null });
126+
mockNativeScriptCloudExtensionService({ isInstalled: null });
127127

128128
assert.isTrue(await platformEnvironmentRequirements.checkEnvironmentRequirements(platform));
129129
});
@@ -132,14 +132,14 @@ describe("platformEnvironmentRequirements ", () => {
132132
it("should setup manually when cloud extension is installed", async () => {
133133
mockDoctorService( { canExecuteLocalBuild: false, mockSetupScript: true });
134134
mockPrompter({ firstCallOptionName: PlatformEnvironmentRequirements.LOCAL_SETUP_OPTION_NAME, secondCallOptionName: PlatformEnvironmentRequirements.MANUALLY_SETUP_OPTION_NAME });
135-
mockNativescriptCloudExtensionService({ isInstalled: true });
135+
mockNativeScriptCloudExtensionService({ isInstalled: true });
136136

137137
await assert.isRejected(platformEnvironmentRequirements.checkEnvironmentRequirements(platform), manuallySetupErrorMessage);
138138
});
139139
describe("and cloud extension is not installed", () => {
140140
beforeEach(() => {
141141
mockDoctorService({ canExecuteLocalBuild: false, mockSetupScript: true });
142-
mockNativescriptCloudExtensionService({ isInstalled: false });
142+
mockNativeScriptCloudExtensionService({ isInstalled: false });
143143
});
144144
it("should list 2 posibile options to select", async () => {
145145
mockPrompter({ firstCallOptionName: PlatformEnvironmentRequirements.LOCAL_SETUP_OPTION_NAME });
@@ -168,7 +168,7 @@ describe("platformEnvironmentRequirements ", () => {
168168
});
169169

170170
it("should install nativescript-cloud extension when it is not installed", async () => {
171-
mockNativescriptCloudExtensionService({ isInstalled: false });
171+
mockNativeScriptCloudExtensionService({ isInstalled: false });
172172
await assert.isRejected(platformEnvironmentRequirements.checkEnvironmentRequirements(platform), cloudBuildsErrorMessage);
173173
assert.isTrue(isExtensionInstallCalled);
174174
});
@@ -181,11 +181,11 @@ describe("platformEnvironmentRequirements ", () => {
181181
});
182182

183183
it("should fail when nativescript-cloud extension is installed", async () => {
184-
mockNativescriptCloudExtensionService({ isInstalled: true });
184+
mockNativeScriptCloudExtensionService({ isInstalled: true });
185185
await assert.isRejected(platformEnvironmentRequirements.checkEnvironmentRequirements(platform), manuallySetupErrorMessage);
186186
});
187187
it("should fail when nativescript-cloud extension is not installed", async () => {
188-
mockNativescriptCloudExtensionService({ isInstalled: false });
188+
mockNativeScriptCloudExtensionService({ isInstalled: false });
189189
await assert.isRejected(platformEnvironmentRequirements.checkEnvironmentRequirements(platform), manuallySetupErrorMessage);
190190
});
191191
});
@@ -198,11 +198,11 @@ describe("platformEnvironmentRequirements ", () => {
198198
});
199199

200200
it("should fail when nativescript-cloud extension is installed", async () => {
201-
mockNativescriptCloudExtensionService({ isInstalled: true });
201+
mockNativeScriptCloudExtensionService({ isInstalled: true });
202202
await assert.isRejected(platformEnvironmentRequirements.checkEnvironmentRequirements(platform), nonInteractiveConsoleMessageWhenExtensionIsInstalled);
203203
});
204204
it("should fail when nativescript-cloud extension is not installed", async () => {
205-
mockNativescriptCloudExtensionService({ isInstalled: false });
205+
mockNativeScriptCloudExtensionService({ isInstalled: false });
206206
await assert.isRejected(platformEnvironmentRequirements.checkEnvironmentRequirements(platform), nonInteractiveConsoleMessageWhenExtensionIsNotInstalled);
207207
});
208208
});

0 commit comments

Comments
 (0)