Skip to content
This repository was archived by the owner on Feb 2, 2021. It is now read-only.

Commit f325d78

Browse files
Merge pull request #1079 from telerik/vladimirov/clean-deps
fix(deps): Remove dependencies that we do not use
2 parents d5b8319 + a860d8d commit f325d78

10 files changed

+46
-519
lines changed

bootstrap.ts

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ $injector.require("childProcess", "./child-process");
2828
$injector.require("prompter", "./prompter");
2929
$injector.require("projectHelper", "./project-helper");
3030
$injector.require("pluginVariablesHelper", "./plugin-variables-helper");
31-
$injector.require("propertiesParser", "./properties-parser");
3231
$injector.require("progressIndicator", "./progress-indicator");
3332

3433
$injector.requireCommand(["help", "/?"], "./commands/help");

declarations.d.ts

+4-11
Original file line numberDiff line numberDiff line change
@@ -658,13 +658,6 @@ interface IProjectHelper extends IProjectDir {
658658
sanitizeName(appName: string): string;
659659
}
660660

661-
interface IPropertiesParser {
662-
parse(text: string): any;
663-
createEditor(filePath: string): Promise<any>;
664-
saveEditor(): Promise<void>;
665-
read(filePath: string): Promise<any>;
666-
}
667-
668661
interface IDictionary<T> {
669662
[key: string]: T
670663
}
@@ -770,11 +763,11 @@ interface IAnalyticsSettingsService {
770763
getPlaygroundInfo(projectDir?: string): Promise<IPlaygroundInfo>;
771764
}
772765

773-
/**
766+
/**
774767
* Designed for getting information for projects that are exported from playground.
775768
*/
776769
interface IPlaygroundService {
777-
/**
770+
/**
778771
* Gets information for projects that are exported from playground
779772
* @return {Promise<IPlaygroundInfo>} collected info
780773
* @param projectDir Project directory path
@@ -785,7 +778,7 @@ interface IPlaygroundService {
785778
* Describes information about project that is exported from playground.
786779
*/
787780
interface IPlaygroundInfo {
788-
/**
781+
/**
789782
* The unique client identifier
790783
*/
791784
id: string;
@@ -1347,7 +1340,7 @@ interface IDoctorService {
13471340
* @returns {Promise<void>}
13481341
*/
13491342
printWarnings(configOptions?: { trackResult: boolean }): Promise<void>;
1350-
/**
1343+
/**
13511344
* Runs the setup script on host machine
13521345
* @returns {Promise<ISpawnResult>}
13531346
*/

definitions/bufferpack.d.ts

-62
This file was deleted.

definitions/filesize.d.ts

-14
This file was deleted.

definitions/progress-stream.d.ts

-22
This file was deleted.

definitions/properties-parser.d.ts

-12
This file was deleted.

helpers.ts

+42-43
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,6 @@ import { ReadStream } from "tty";
55
import { Configurations } from "./constants";
66
import { EventEmitter } from "events";
77
import * as crypto from "crypto";
8-
import progress = require("progress-stream");
9-
import filesize = require("filesize");
10-
import * as util from "util";
118

129
const Table = require("cli-table");
1310

@@ -36,46 +33,48 @@ export function regExpEscape(input: string): string {
3633
return input.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&");
3734
}
3835

39-
export function trackDownloadProgress(destinationStream: NodeJS.WritableStream, url: string): NodeJS.ReadableStream {
40-
// \r for carriage return doesn't work on windows in node for some reason so we have to use it's hex representation \x1B[0G
41-
let lastMessageSize = 0;
42-
const carriageReturn = "\x1B[0G";
43-
let timeElapsed = 0;
44-
45-
const isInteractiveTerminal = isInteractive();
46-
const progressStream = progress({ time: 1000 }, (progress: any) => {
47-
timeElapsed = progress.runtime;
48-
49-
if (timeElapsed >= 1) {
50-
if (isInteractiveTerminal) {
51-
this.$logger.write("%s%s", carriageReturn, Array(lastMessageSize + 1).join(" "));
52-
53-
const message = util.format("%sDownload progress ... %s | %s | %s/s",
54-
carriageReturn,
55-
Math.floor(progress.percentage) + "%",
56-
filesize(progress.transferred),
57-
filesize(progress.speed));
58-
59-
this.$logger.write(message);
60-
lastMessageSize = message.length;
61-
}
62-
}
63-
});
64-
65-
progressStream.on("finish", () => {
66-
if (timeElapsed >= 1) {
67-
const msg = `Download of ${url} completed.`;
68-
if (isInteractiveTerminal) {
69-
this.$logger.out("%s%s%s%s", carriageReturn, Array(lastMessageSize + 1).join(" "), carriageReturn, msg);
70-
} else {
71-
this.$logger.out(msg);
72-
}
73-
}
74-
});
75-
76-
progressStream.pipe(destinationStream);
77-
return progressStream;
78-
}
36+
// This function is a state of Art and that's why it has not been deleted.
37+
// However, its code uses some dependencies that are not used anywhere else, so the code is commented, as we decided to remove those dependencies.
38+
// export function trackDownloadProgress(destinationStream: NodeJS.WritableStream, url: string): NodeJS.ReadableStream {
39+
// // \r for carriage return doesn't work on windows in node for some reason so we have to use it's hex representation \x1B[0G
40+
// let lastMessageSize = 0;
41+
// const carriageReturn = "\x1B[0G";
42+
// let timeElapsed = 0;
43+
44+
// const isInteractiveTerminal = isInteractive();
45+
// const progressStream = progress({ time: 1000 }, (progress: any) => {
46+
// timeElapsed = progress.runtime;
47+
48+
// if (timeElapsed >= 1) {
49+
// if (isInteractiveTerminal) {
50+
// this.$logger.write("%s%s", carriageReturn, Array(lastMessageSize + 1).join(" "));
51+
52+
// const message = util.format("%sDownload progress ... %s | %s | %s/s",
53+
// carriageReturn,
54+
// Math.floor(progress.percentage) + "%",
55+
// filesize(progress.transferred),
56+
// filesize(progress.speed));
57+
58+
// this.$logger.write(message);
59+
// lastMessageSize = message.length;
60+
// }
61+
// }
62+
// });
63+
64+
// progressStream.on("finish", () => {
65+
// if (timeElapsed >= 1) {
66+
// const msg = `Download of ${url} completed.`;
67+
// if (isInteractiveTerminal) {
68+
// this.$logger.out("%s%s%s%s", carriageReturn, Array(lastMessageSize + 1).join(" "), carriageReturn, msg);
69+
// } else {
70+
// this.$logger.out(msg);
71+
// }
72+
// }
73+
// });
74+
75+
// progressStream.pipe(destinationStream);
76+
// return progressStream;
77+
// }
7978

8079
export function isAllowedFinalFile(item: string): RegExpMatchArray {
8180
return item.match(/.*\.aar/) ||

0 commit comments

Comments
 (0)