Skip to content

Commit 956c6d1

Browse files
chore: remove typeScriptService
`typeScriptService` was required in the past for `Proton` product (Universal AppBuilder Desktop Client). As this product does not exist anymore, we do not need this service.
1 parent 8e4634f commit 956c6d1

File tree

4 files changed

+0
-423
lines changed

4 files changed

+0
-423
lines changed

lib/common/README.md

Lines changed: 0 additions & 134 deletions
Original file line numberDiff line numberDiff line change
@@ -979,140 +979,6 @@ require("mobile-cli-lib").npmService.uninstall("D:\\test\\project", "lodash")
979979
});
980980
```
981981

982-
### Module typeScriptService
983-
> Stability: 1 - Could be changed due to some new requirments.
984-
985-
This module is used to transpile TypeScript files.
986-
987-
The following types are used:
988-
```TypeScript
989-
interface ITypeScriptCompilerOptions {
990-
/**
991-
* Specify the codepage to use when opening source files.
992-
*/
993-
codePage?: number;
994-
995-
/**
996-
* Generates corresponding .d.ts file.
997-
*/
998-
declaration?: boolean;
999-
1000-
/**
1001-
* Specifies the location where debugger should locate map files instead of generated locations.
1002-
*/
1003-
mapRoot?: string;
1004-
1005-
/**
1006-
* Specify module code generation: 'commonjs' or 'amd'.
1007-
*/
1008-
module?: string;
1009-
1010-
/**
1011-
* Warn on expressions and declarations with an implied 'any' type.
1012-
*/
1013-
noImplicitAny?: boolean;
1014-
1015-
/**
1016-
* Concatenate and emit output to single file.
1017-
*/
1018-
outFile?: string;
1019-
1020-
/**
1021-
* Redirect output structure to the directory.
1022-
*/
1023-
outDir?: string;
1024-
1025-
/**
1026-
* Do not emit comments to output.
1027-
*/
1028-
removeComments?: boolean;
1029-
1030-
/**
1031-
* Generates corresponding .map file.
1032-
*/
1033-
sourceMap?: boolean;
1034-
1035-
/**
1036-
* Specifies the location where debugger should locate TypeScript files instead of source locations.
1037-
*/
1038-
sourceRoot?: string;
1039-
1040-
/**
1041-
* Specify ECMAScript target version: 'ES3' (default), or 'ES5'.
1042-
*/
1043-
target?: string;
1044-
1045-
/**
1046-
* Do not emit outputs if any errors were reported.
1047-
*/
1048-
noEmitOnError?: boolean;
1049-
1050-
[key: string]: any;
1051-
}
1052-
1053-
/**
1054-
* Describes the options for transpiling TypeScript files.
1055-
*/
1056-
interface ITypeScriptTranspileOptions {
1057-
/**
1058-
* Describes the options in tsconfig.json file.
1059-
*/
1060-
compilerOptions?: ITypeScriptCompilerOptions;
1061-
1062-
/**
1063-
* The default options which will be used if there is no tsconfig.json file.
1064-
*/
1065-
defaultCompilerOptions?: ITypeScriptCompilerOptions;
1066-
1067-
/**
1068-
* Path to the default .d.ts files.
1069-
*/
1070-
pathToDefaultDefinitionFiles?: string;
1071-
}
1072-
```
1073-
1074-
* `transpile(projectDir: string, typeScriptFiles?: string[], definitionFiles?: string[], options?: ITypeScriptTranspileOptions): Promise<string>` - Transpiles specified files or all files in the project directory.
1075-
If `options` are not specified the method will search for tsconfig.json file and get them from it.
1076-
If there is no tsconfig.json file the method will use default options.
1077-
If there are no `typeScriptFiles` all the files in the `projectDir` will be transpiled.
1078-
The returned result is the output of the TypeScript compiler.
1079-
1080-
Sample usage:
1081-
```JavaScript
1082-
// Transpile only 2 files.
1083-
var projectDir = "D:\\test\\project";
1084-
var filesToTranspile = [path.join(projectDir,"app","components", "homeView", "homeView.ts"),
1085-
path.join(projectDir,"app","components", "addressView", "addressView.ts")];
1086-
1087-
require("mobile-cli-lib").typeScriptService.transpile(projectDir, filesToTranspile)
1088-
.then(function(result) {
1089-
console.log("TypeScript compiler result: ", result);
1090-
}).catch(function(err) {
1091-
console.log("Error while transpiling files: ", err);
1092-
});
1093-
```
1094-
1095-
Sample result if there are no errors will be:
1096-
```JSON
1097-
""
1098-
```
1099-
1100-
Sample result with errors will be:
1101-
```JSON
1102-
"app/components/homeView/homeView.ts(19,1): error TS2304: Cannot find name 'a'.
1103-
app/components/homeView/homeView.ts(20,1): error TS2304: Cannot find name 'b'."
1104-
```
1105-
1106-
```JavaScript
1107-
// Transpile all files in project.
1108-
require("mobile-cli-lib").typeScriptService.transpile("D:\\test\\project")
1109-
.then(function(result) {
1110-
console.log("TypeScript compiler result: ", result);
1111-
}).catch(function(err) {
1112-
console.log("Error while transpiling files: ", err);
1113-
});
1114-
```
1115-
1116982
Technical details
1117983
==
1118984

lib/common/bootstrap.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@ $injector.require("iOSSimulatorLogProvider", "./mobile/ios/simulator/ios-simulat
7575

7676
$injector.require("localToDevicePathDataFactory", "./mobile/local-to-device-path-data-factory");
7777

78-
$injector.requirePublic("typeScriptService", "./services/typescript-service");
79-
8078
$injector.requirePublic("devicesService", "./mobile/mobile-core/devices-service");
8179
$injector.requirePublic("androidProcessService", "./mobile/mobile-core/android-process-service");
8280
$injector.require("projectNameValidator", "./validators/project-name-validator");

lib/common/declarations.d.ts

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -827,42 +827,6 @@ interface IHook {
827827
fullPath: string;
828828
}
829829

830-
/**
831-
* Describes TypeScript compilation methods.
832-
*/
833-
interface ITypeScriptService {
834-
/**
835-
* Transpiles specified files or all files in the project directory. The default passed options are overriden by the ones in tsconfig.json file. The options from tsconfig.json file are overriden by the passed compiler options.
836-
* @param {string} projectDir: Specifies the directory of the project.
837-
* @param {string[]} typeScriptFiles @optional The files that will be compiled.
838-
* @param {string[]} definitionFiles @optional The definition files used for compilation.
839-
* @param {ITypeScriptTranspileOptions} options @optional The transpilation options.
840-
* @return {Promise<void>}
841-
*/
842-
transpile(projectDir: string, typeScriptFiles?: string[], definitionFiles?: string[], options?: ITypeScriptTranspileOptions): Promise<void>;
843-
844-
/**
845-
* Returns new object, containing all TypeScript and all TypeScript definition files.
846-
* @param {string} projectDir The directory of the project which contains TypeScript files.
847-
* @return {ITypeScriptFiles} all TypeScript and all TypeScript definition files.
848-
*/
849-
getTypeScriptFilesData(projectDir: string): ITypeScriptFiles
850-
851-
/**
852-
* Checks if the project language is TypeScript by enumerating all files and checking if there are at least one TypeScript file (.ts), that is not definition file(.d.ts)
853-
* @param {string} projectDir The directory of the project.
854-
* @return {boolean} true when the project contains .ts files and false otherwise.
855-
*/
856-
isTypeScriptProject(projectDir: string): boolean;
857-
858-
/**
859-
* Checks if the file is TypeScript file.
860-
* @param {string} file The file name.
861-
* @return {boolean} true when the file is TypeScript file.
862-
*/
863-
isTypeScriptFile(file: string): boolean;
864-
}
865-
866830
interface IDynamicHelpService {
867831
/**
868832
* Checks if current project's framework is one of the specified as arguments.

0 commit comments

Comments
 (0)