Skip to content

Commit 47e9949

Browse files
Update README.md
Update the README.md and bump the version to 0.2.0 Added new functionalities to the public API: - constants module - getNativeScriptCliVersion method - getXcprojInfo method - isCocoaPodsUpdateRequired method - platforms property in the IWarning interface
1 parent b5c2134 commit 47e9949

File tree

2 files changed

+101
-6
lines changed

2 files changed

+101
-6
lines changed

README.md

Lines changed: 100 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,20 @@ Library that helps identifying if the environment can be used for development of
5050
* Describes warning returned from nativescript-doctor check.
5151
*/
5252
interface IWarning {
53-
/** The warning. */
53+
/** The warning.
54+
* @type {string}
55+
*/
5456
warning: string;
55-
/** Additional information for the warning. */
57+
58+
/** Additional information for the warning.
59+
* @type {string}
60+
*/
5661
additionalInformation: string;
62+
63+
/** The platforms which are affected by this warning.
64+
* @type {string[]}
65+
*/
66+
platforms: string[];
5767
}
5868
```
5969

@@ -108,14 +118,23 @@ Library that helps identifying if the environment can be used for development of
108118
const isCocoaPodsWorkingCorrectly = await sysInfo.isCocoaPodsWorkingCorrectly();
109119
console.log("is cocoapods working correctly: ", isCocoaPodsWorkingCorrectly);
110120

121+
const nativeScriptCliVersion = await sysInfo.getNativeScriptCliVersion();
122+
console.log("{N} CLI version: ", nativeScriptCliVersion);
123+
124+
const xcprojInfo = await sysInfo.getXcprojInfo();
125+
console.log("xcproj info: ", xcprojInfo);
126+
127+
const isCocoaPodsUpdateRequired = await sysInfo.isCocoaPodsUpdateRequired();
128+
console.log("is CocoaPods update required: ", isCocoaPodsUpdateRequired);
129+
111130
const sysInfoData = await sysInfo.getSysInfo();
112131
console.log("sysInfo: ", sysInfoData);
113132
}
114133

115134
main();
116135

117136
```
118-
137+
119138
- Interfaces:
120139
```TypeScript
121140
/**
@@ -138,7 +157,7 @@ Library that helps identifying if the environment can be used for development of
138157
* Returns the currently installed version of Xcode.
139158
* @return {Promise<string>} Returns the currently installed version of Xcode or null if Xcode is not installed or executed on Linux or Windows.
140159
*/
141-
getXCodeVersion(): Promise<string>;
160+
getXcodeVersion(): Promise<string>;
142161

143162
/**
144163
* Returns the currently installed Node.js version.
@@ -156,7 +175,7 @@ Library that helps identifying if the environment can be used for development of
156175
* Returns the xcodeproj gem location.
157176
* @return {Promise<string>} Returns the xcodeproj gem location. If the the xcodeproj gem is not installed it will return null.
158177
*/
159-
getXCodeProjGemLocation(): Promise<string>;
178+
getXcodeprojGemLocation(): Promise<string>;
160179

161180
/**
162181
* Checks if iTunes is installed.
@@ -212,6 +231,24 @@ Library that helps identifying if the environment can be used for development of
212231
*/
213232
isCocoaPodsWorkingCorrectly(): Promise<boolean>;
214233

234+
/**
235+
* Returns the version of the globally installed NativeScript CLI.
236+
* @return {Promise<string>} Returns the version of the globally installed NativeScript CLI.
237+
*/
238+
getNativeScriptCliVersion(): Promise<string>;
239+
240+
/**
241+
* Checks if xcproj is required to build projects and if it is installed.
242+
* @return {Promise<IXcprojInfo>} Returns the collected information aboud xcproj.
243+
*/
244+
getXcprojInfo(): Promise<IXcprojInfo>;
245+
246+
/**
247+
* Checks if the current version of CocoaPods is compatible with the installed Xcode.
248+
* @return {boolean} true if an update us require.
249+
*/
250+
isCocoaPodsUpdateRequired(): Promise<boolean>;
251+
215252
/**
216253
* Returns the whole system information.
217254
* @return {Promise<ISysInfoData>} The system information.
@@ -342,5 +379,63 @@ Library that helps identifying if the environment can be used for development of
342379
* @type {boolean}
343380
*/
344381
isCocoaPodsWorkingCorrectly: boolean;
382+
383+
/**
384+
* NativeScript CLI version string, as returned by `tns --version`.
385+
* @type {string}
386+
*/
387+
nativeScriptCliVersion: string;
388+
389+
/**
390+
* Information about xcproj.
391+
* @type {string}
392+
*/
393+
xcprojInfo: IXcprojInfo
394+
395+
/**
396+
* true if the system requires xcproj to build projects successfully and the CocoaPods version is not compatible with the Xcode.
397+
*/
398+
isCocoaPodsUpdateRequired: boolean;
399+
}
400+
401+
/**
402+
* Describes information about xcproj brew formula.
403+
*/
404+
interface IXcprojInfo {
405+
/**
406+
* Determines whether the system needs xcproj to execute ios builds sucessfully.
407+
*/
408+
shouldUseXcproj: boolean;
409+
410+
/**
411+
* Determines whether xcproj can be called from the command line.
412+
*/
413+
xcprojAvailable: boolean;
414+
}
415+
```
416+
417+
* Module `constants`:
418+
- Usage:
419+
```TypeScript
420+
import { constants } from "nativescript-doctor"
421+
422+
function main() {
423+
for(let constantName in constants) {
424+
console.log(`${constantName}: ${constants[constantName]}`);
425+
}
426+
}
427+
428+
main();
429+
```
430+
431+
- Interfaces:
432+
```TypeScript
433+
/**
434+
* Describes the constants used in the module.
435+
*/
436+
interface IConstants {
437+
ANDROID_PLATFORM_NAME: string;
438+
IOS_PLATFORM_NAME: string;
439+
SUPPORTED_PLATFORMS: string[];
345440
}
346441
```

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nativescript-doctor",
3-
"version": "0.1.0",
3+
"version": "0.2.0",
44
"description": "Library that helps identifying if the environment can be used for development of {N} apps.",
55
"main": "lib/index.js",
66
"types": "./typings/nativescript-doctor.d.ts",

0 commit comments

Comments
 (0)