Skip to content

Commit fd68fbc

Browse files
Merge pull request #4314 from NativeScript/vladimirov/clean-unused-code
chore: clean unused code
2 parents 5bb46d1 + 092a06b commit fd68fbc

File tree

89 files changed

+229
-4463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+229
-4463
lines changed

lib/bootstrap.ts

-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ $injector.require("logger", "./common/logger");
33
$injector.require("config", "./config");
44
$injector.require("options", "./options");
55
// note: order above is important!
6-
$injector.require("nativescript-cli", "./nativescript-cli");
76

87
$injector.requirePublicClass("constants", "./constants-provider");
98
$injector.require("projectData", "./project-data");
@@ -86,10 +85,6 @@ $injector.requireCommand("package-manager|set", "./commands/package-manager-set"
8685
$injector.requireCommand("package-manager|get", "./commands/package-manager-get");
8786

8887
$injector.require("packageInstallationManager", "./package-installation-manager");
89-
$injector.require("dynamicHelpProvider", "./dynamic-help-provider");
90-
$injector.require("mobilePlatformsCapabilities", "./mobile-platforms-capabilities");
91-
$injector.require("commandsServiceProvider", "./providers/commands-service-provider");
92-
$injector.require("AppDataProvider", "./providers/device-app-data-provider");
9388

9489
$injector.require("deviceLogProvider", "./common/mobile/device-log-provider");
9590
$injector.require("projectFilesProvider", "./providers/project-files-provider");

lib/common/README.md

-134
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/appbuilder/appbuilder-bootstrap.ts

-14
This file was deleted.

0 commit comments

Comments
 (0)