Skip to content
This repository was archived by the owner on Jan 18, 2023. It is now read-only.

Commit a0799ca

Browse files
author
German Lebedev
committed
Hotfix: tsc
1 parent ec2da3d commit a0799ca

File tree

13 files changed

+21
-49
lines changed

13 files changed

+21
-49
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@
88
node_modules
99
/.idea/
1010
.vscode
11+
coverage
12+
.idea

.idea/cli.iml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/misc.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

.idea/modules.xml

Lines changed: 0 additions & 8 deletions
This file was deleted.

.idea/vcs.xml

Lines changed: 0 additions & 6 deletions
This file was deleted.

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "codestore-cli",
33
"description": "Command Line Interface of code.store. Add services, deploy, debug, perform all operations from your terminal.",
4-
"version": "1.2.2",
4+
"version": "1.2.3",
55
"bin": {
66
"codestore": "./bin/run",
77
"cs": "./bin/run"
@@ -25,6 +25,7 @@
2525
"cli-ux": "^5.4.5",
2626
"completion": "^1.0.1",
2727
"cross-fetch": "^3.0.4",
28+
"enquirer": "^2.3.5",
2829
"express": "^4.17.1",
2930
"graphql": "^14.6.0",
3031
"inquirer": "^7.1.0",
@@ -44,13 +45,10 @@
4445
},
4546
"devDependencies": {
4647
"@oclif/dev-cli": "^1.22.2",
47-
"@oclif/test": "^1.2.5",
48-
"@types/chai": "^4.2.10",
4948
"@types/node": "^10.17.17",
5049
"@typescript-eslint/eslint-plugin": "^2.22.0",
5150
"@typescript-eslint/parser": "^2.26.0",
5251
"aws-sdk": "^2.656.0",
53-
"chai": "^4.2.0",
5452
"eslint": "^6.8.0",
5553
"eslint-config-airbnb-typescript": "^7.0.0",
5654
"eslint-plugin-import": "^2.20.1",

src/commands/service/logs.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import Aliases from '../../common/constants/aliases';
88
import { FETCH_INTERVAL, NUMBER_OF_LINES } from '../../common/constants/logs';
99

1010
export default class Logs extends Command {
11-
logs: ILog[] = [];
11+
public logs: ILog[] = [];
1212

13-
static description = 'Print the logs for your services.';
13+
public static description = 'Print the logs for your services.';
1414

15-
static aliases = [Aliases.LOGS];
15+
public static aliases = [Aliases.LOGS];
1616

17-
static flags = {
17+
public static flags = {
1818
follow: flags.boolean({
1919
char: 'f',
2020
description: 'Specify if the logs should be streamed.',
@@ -40,23 +40,23 @@ export default class Logs extends Command {
4040
}),
4141
};
4242

43-
async fetch(query: IQueryLog): Promise<Array<ILog>> {
43+
public async fetch(query: IQueryLog): Promise<Array<ILog>> {
4444
const logs = await this.codestore.Logs.list(query);
4545
return logs.reverse();
4646
}
4747

48-
async updateLogs(query: IQueryLog) {
48+
public async updateLogs(query: IQueryLog): Promise<void> {
4949
this.logs = await this.fetch(query);
5050
}
5151

52-
render(noHeader: boolean) {
52+
public render(noHeader: boolean): void {
5353
this.renderTable(this.logs.map((log) => ({
5454
time: bold.white(log.time),
5555
message: bold.cyan(log.message.trim()),
5656
})), { time: {}, message: {} }, { 'no-truncate': true, 'no-header': noHeader });
5757
}
5858

59-
async execute() {
59+
public async execute(): Promise<void> {
6060
const { flags: { follow, ...query } } = this.parse(Logs);
6161

6262
if (!query.serviceId && !query.projectId) {
@@ -75,8 +75,8 @@ export default class Logs extends Command {
7575

7676
if (follow) {
7777
setInterval(async () => {
78-
if (this.logs.length) { // @ts-ignore
79-
query.sinceTime = new Date(this.logs[this.logs.length - 1].time);
78+
if (this.logs.length) {
79+
(query as any).sinceTime = new Date(this.logs[this.logs.length - 1].time);
8080
}
8181
await this.updateLogs(query);
8282
this.render(true);

src/common/promisified-fs.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {
22
writeFile, unlink, readdir, readFile, access, stat,
33
} from 'fs';
44
import { promisify } from 'util';
5-
import * as rimraf from 'rimraf';
5+
import rimraf from 'rimraf';
66

77
export default class PromisifiedFs {
88
public static rimraf = promisify(rimraf);

src/lib/webAuthHelper/openBrowser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as open from 'open';
1+
import open from 'open';
22
import { ChildProcess } from 'child_process';
33

44
const authLink = 'https://api.codestore.dev/authentication-service/authorize?cli=true';

src/lib/webAuthHelper/server.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import * as Express from 'express';
2-
import { Request, Response } from 'express';
1+
import Express, { Request, Response } from 'express';
32
import { createServer } from 'http';
43
import authEmitter from './emitter';
54

0 commit comments

Comments
 (0)