Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions lib/commands/embedding/embed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class EmbedCommand extends PrepareCommand implements ICommand {

private $logger: ILogger,
private $fs: IFileSystem,
private $projectConfigService: IProjectConfigService
private $projectConfigService: IProjectConfigService,
) {
super(
$options,
Expand All @@ -34,7 +34,7 @@ export class EmbedCommand extends PrepareCommand implements ICommand {
$platformCommandParameter,
$platformsDataService,
$prepareDataService,
$migrateController
$migrateController,
);
}

Expand All @@ -59,8 +59,8 @@ export class EmbedCommand extends PrepareCommand implements ICommand {
hostProjectPath,
)} (resolved to: ${color.styleText(
["yellow", "dim"],
resolvedHostProjectPath
)}) does not exist.`
resolvedHostProjectPath,
)}) does not exist.`,
);
return;
}
Expand Down Expand Up @@ -90,7 +90,7 @@ export class EmbedCommand extends PrepareCommand implements ICommand {
if (!args[1]) {
const hostProjectPath = this.getEmbedConfigForKey(
"hostProjectPath",
platform
platform,
);
if (hostProjectPath) {
args[1] = hostProjectPath;
Expand All @@ -100,7 +100,7 @@ export class EmbedCommand extends PrepareCommand implements ICommand {
if (!args[2]) {
const hostProjectModuleName = this.getEmbedConfigForKey(
"hostProjectModuleName",
platform
platform,
);
if (hostProjectModuleName) {
args[2] = hostProjectModuleName;
Expand All @@ -120,7 +120,7 @@ export class EmbedCommand extends PrepareCommand implements ICommand {
// get the embed.<platform>.<key> value, or fallback to embed.<key> value
return this.$projectConfigService.getValue(
`embed.${platform}.${key}`,
this.$projectConfigService.getValue(`embed.${key}`)
this.$projectConfigService.getValue(`embed.${key}`),
);
}
}
Expand Down
6 changes: 3 additions & 3 deletions lib/commands/post-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export class PostInstallCliCommand implements ICommand {
private $settingsService: ISettingsService,
private $analyticsService: IAnalyticsService,
private $logger: ILogger,
private $hostInfo: IHostInfo
private $hostInfo: IHostInfo,
) {}

public disableAnalytics = true;
Expand All @@ -35,7 +35,7 @@ export class PostInstallCliCommand implements ICommand {
// TODO: Check if this is the correct place, probably we should set this at the end of the command.
await this.$fs.setCurrentUserAsOwner(
this.$settingsService.getProfileDir(),
process.env.SUDO_USER
process.env.SUDO_USER,
);
}
}
Expand Down Expand Up @@ -66,7 +66,7 @@ export class PostInstallCliCommand implements ICommand {

this.$logger.info("");
this.$logger.printMarkdown(
"If you have any questions, check Stack Overflow: `https://stackoverflow.com/questions/tagged/nativescript` and our public Discord channel: `https://nativescript.org/discord`"
"If you have any questions, check Stack Overflow: `https://stackoverflow.com/questions/tagged/nativescript` and our public Discord channel: `https://nativescript.org/discord`",
);
}
}
Expand Down
30 changes: 15 additions & 15 deletions lib/commands/typings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class TypingsCommand implements ICommand {
private $childProcess: IChildProcess,
private $hostInfo: IHostInfo,
private $staticConfig: IStaticConfig,
private $prompter: IPrompter
private $prompter: IPrompter,
) {}

public async execute(args: string[]): Promise<void> {
Expand All @@ -35,15 +35,15 @@ export class TypingsCommand implements ICommand {
if (this.$options.copyTo) {
this.$fs.copyFile(
path.resolve(this.$projectData.projectDir, "typings"),
this.$options.copyTo
this.$options.copyTo,
);
typingsFolder = this.$options.copyTo;
}

if (result !== false) {
this.$logger.info(
"Typings have been generated in the following directory:",
typingsFolder
typingsFolder,
);
}
}
Expand All @@ -56,7 +56,7 @@ export class TypingsCommand implements ICommand {

private async resolveGradleDependencies(target: string) {
const gradleHome = path.resolve(
process.env.GRADLE_USER_HOME ?? path.join(homedir(), `/.gradle`)
process.env.GRADLE_USER_HOME ?? path.join(homedir(), `/.gradle`),
);
const gradleFiles = path.resolve(gradleHome, "caches/modules-2/files-2.1/");

Expand Down Expand Up @@ -92,7 +92,7 @@ export class TypingsCommand implements ICommand {

const choices = await this.$prompter.promptForChoice(
`Select dependencies to generate typings for (${color.greenBright(
target
target,
)})`,
items
.sort((a, b) => {
Expand All @@ -118,7 +118,7 @@ export class TypingsCommand implements ICommand {
true,
{
optionsPerPage: process.stdout.rows - 6, // 6 lines are taken up by the instructions
} as Partial<PromptObject>
} as Partial<PromptObject>,
);

this.$logger.clearScreen();
Expand All @@ -139,7 +139,7 @@ export class TypingsCommand implements ICommand {
} catch (err) {
this.$logger.trace(
`Failed to resolve gradle dependencies for target "${target}"`,
err
err,
);
}
}
Expand All @@ -151,29 +151,29 @@ export class TypingsCommand implements ICommand {
"No .jar or .aar file specified. Please specify at least one of the following:",
" - path to .jar file with --jar <jar>",
" - path to .aar file with --aar <aar>",
].join("\n")
].join("\n"),
);
return false;
}

this.$fs.ensureDirectoryExists(
path.resolve(this.$projectData.projectDir, "typings", "android")
path.resolve(this.$projectData.projectDir, "typings", "android"),
);

const dtsGeneratorPath = path.resolve(
this.$projectData.projectDir,
"platforms",
"android",
"build-tools",
"dts-generator.jar"
"dts-generator.jar",
);
if (!this.$fs.exists(dtsGeneratorPath)) {
this.$logger.warn("No platforms folder found, preparing project now...");
await this.$childProcess.spawnFromEvent(
this.$hostInfo.isWindows ? "ns.cmd" : "ns",
["prepare", "android"],
"exit",
{ stdio: "inherit", shell: this.$hostInfo.isWindows }
{ stdio: "inherit", shell: this.$hostInfo.isWindows },
);
}

Expand Down Expand Up @@ -206,7 +206,7 @@ export class TypingsCommand implements ICommand {
path.resolve(this.$projectData.projectDir, "typings", "android"),
],
"exit",
{ stdio: "inherit" }
{ stdio: "inherit" },
);
}

Expand All @@ -216,7 +216,7 @@ export class TypingsCommand implements ICommand {
}

this.$fs.ensureDirectoryExists(
path.resolve(this.$projectData.projectDir, "typings", "ios")
path.resolve(this.$projectData.projectDir, "typings", "ios"),
);

await this.$childProcess.spawnFromEvent(
Expand All @@ -229,11 +229,11 @@ export class TypingsCommand implements ICommand {
TNS_TYPESCRIPT_DECLARATIONS_PATH: path.resolve(
this.$projectData.projectDir,
"typings",
"ios"
"ios",
),
},
stdio: "inherit",
}
},
);
}
}
Expand Down
4 changes: 2 additions & 2 deletions lib/common/header.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ export function printHeader() {

console.info(" " + color.dim("┌" + "─".repeat(width - 1) + "┐"));
console.info(
" " + header + " ".repeat(width - headerLength) + color.dim("│")
" " + header + " ".repeat(width - headerLength) + color.dim("│"),
);
console.info(
" " + tagLine + " ".repeat(width - tagLineLength) + color.dim("│")
" " + tagLine + " ".repeat(width - tagLineLength) + color.dim("│"),
);
console.info(" " + color.dim("└" + "─".repeat(width - 1) + "┘"));
}
6 changes: 3 additions & 3 deletions lib/helpers/key-command-helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,18 +115,18 @@ export default class KeyCommandHelper implements IKeyCommandHelper {
[
"",
` The CLI is ${color.underline(
`interactive`
`interactive`,
)}, you can press the following keys any time (make sure the terminal has focus).`,
"",
...commandHelp,
"",
].join("\n")
].join("\n"),
);
}

public attachKeyCommands(
platform: IKeyCommandPlatform,
processType: SupportedProcessType
processType: SupportedProcessType,
) {
this.processType = processType;
this.platform = platform;
Expand Down
8 changes: 4 additions & 4 deletions lib/services/analytics-settings-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class AnalyticsSettingsService implements IAnalyticsSettingsService {
private $staticConfig: IStaticConfig,
private $hostInfo: IHostInfo,
private $osInfo: IOsInfo,
private $logger: ILogger
private $logger: ILogger,
) {}

public async canDoRequest(): Promise<boolean> {
Expand All @@ -33,7 +33,7 @@ class AnalyticsSettingsService implements IAnalyticsSettingsService {
@exported("analyticsSettingsService")
public getClientId(): Promise<string> {
return this.getSettingValueOrDefault(
this.$staticConfig.ANALYTICS_INSTALLATION_ID_SETTING_NAME
this.$staticConfig.ANALYTICS_INSTALLATION_ID_SETTING_NAME,
);
}

Expand All @@ -54,11 +54,11 @@ class AnalyticsSettingsService implements IAnalyticsSettingsService {

public async setUserSessionsCount(
count: number,
projectName: string
projectName: string,
): Promise<void> {
return this.$userSettingsService.saveSetting<number>(
this.getSessionsProjectKey(projectName),
count
count,
);
}

Expand Down
Loading