@akylas/nativescript-cli 8.9.4 → 8.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/test-deps-versions-generated.json +10 -10
- package/docs/build-jekyll-md.sh +1 -1
- package/docs/man_pages/config/config-get.md +36 -0
- package/docs/man_pages/config/config-set.md +40 -0
- package/docs/man_pages/config/config.md +39 -0
- package/docs/man_pages/project/hooks/hooks.md +35 -0
- package/docs/man_pages/start.md +1 -0
- package/lib/.d.ts +8 -3
- package/lib/bootstrap.js +3 -1
- package/lib/color.js +38 -7
- package/lib/commands/build.js +18 -2
- package/lib/commands/clean.js +1 -2
- package/lib/commands/config.js +1 -1
- package/lib/commands/embedding/embed.js +1 -1
- package/lib/commands/hooks/common.js +79 -0
- package/lib/commands/hooks/hooks-lock.js +100 -0
- package/lib/commands/hooks/hooks.js +71 -0
- package/lib/commands/post-install.js +2 -2
- package/lib/commands/typings.js +29 -18
- package/lib/common/definitions/extensibility.d.ts +2 -2
- package/lib/common/definitions/mobile.d.ts +72 -72
- package/lib/common/header.js +3 -3
- package/lib/common/logger/layouts/cli-layout.js +1 -1
- package/lib/common/logger/logger.js +3 -3
- package/lib/common/mobile/android/android-device.js +1 -1
- package/lib/common/mobile/android/android-emulator-services.js +8 -6
- package/lib/common/mobile/device-log-provider.js +3 -4
- package/lib/common/project-helper.js +15 -2
- package/lib/common/verify-node-version.js +1 -1
- package/lib/constants.js +7 -4
- package/lib/controllers/migrate-controller.js +3 -4
- package/lib/controllers/prepare-controller.js +9 -9
- package/lib/controllers/run-controller.js +1 -1
- package/lib/declarations.d.ts +5 -0
- package/lib/definitions/hooks.d.ts +1 -0
- package/lib/definitions/nativescript-dev-xcode.d.ts +25 -1
- package/lib/definitions/project.d.ts +52 -1
- package/lib/definitions/temp-service.d.ts +6 -2
- package/lib/helpers/key-command-helper.js +2 -1
- package/lib/nativescript-cli.js +28 -0
- package/lib/options.js +4 -0
- package/lib/project-data.js +10 -4
- package/lib/services/analytics/analytics-broker-process.js +1 -1
- package/lib/services/analytics-settings-service.js +2 -1
- package/lib/services/android/gradle-build-args-service.js +7 -3
- package/lib/services/android/gradle-build-service.js +4 -1
- package/lib/services/android-project-service.js +12 -10
- package/lib/services/{webpack/webpack-compiler-service.js → bundler/bundler-compiler-service.js} +254 -85
- package/lib/services/bundler/bundler.js +2 -0
- package/lib/services/extensibility-service.js +1 -1
- package/lib/services/ios/spm-service.js +13 -2
- package/lib/services/ios/xcodebuild-args-service.js +7 -5
- package/lib/services/ios-project-service.js +0 -1
- package/lib/services/ios-watch-app-service.js +540 -16
- package/lib/services/livesync/android-livesync-tool.js +3 -1
- package/lib/services/plugins-service.js +1 -0
- package/lib/services/project-changes-service.js +1 -1
- package/lib/services/temp-service.js +16 -4
- package/lib/services/versions-service.js +2 -1
- package/package.json +35 -36
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-app/app/build.gradle +20 -13
- package/vendor/gradle-app/app/gradle.properties +45 -0
- package/vendor/gradle-plugin/build.gradle +7 -6
- package/lib/services/webpack/webpack.d.ts +0 -227
package/lib/commands/typings.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TypingsCommand = void 0;
|
|
4
|
-
const
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
5
|
const os_1 = require("os");
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const color_1 = require("../color");
|
|
@@ -43,24 +43,20 @@ class TypingsCommand {
|
|
|
43
43
|
return true;
|
|
44
44
|
}
|
|
45
45
|
async resolveGradleDependencies(target) {
|
|
46
|
-
var _a;
|
|
46
|
+
var _a, _b;
|
|
47
47
|
const gradleHome = path.resolve((_a = process.env.GRADLE_USER_HOME) !== null && _a !== void 0 ? _a : path.join((0, os_1.homedir)(), `/.gradle`));
|
|
48
|
-
const gradleFiles = path.resolve(gradleHome, "caches/modules-2/files-2.1/");
|
|
48
|
+
const gradleFiles = (_b = this.$options.lookupPath) !== null && _b !== void 0 ? _b : path.resolve(gradleHome, "caches/modules-2/files-2.1/");
|
|
49
49
|
if (!this.$fs.exists(gradleFiles)) {
|
|
50
50
|
this.$logger.warn("No gradle files found");
|
|
51
51
|
return;
|
|
52
52
|
}
|
|
53
53
|
const pattern = `${target.replaceAll(":", "/")}/**/*.{jar,aar}`;
|
|
54
|
-
const
|
|
54
|
+
const items = [];
|
|
55
|
+
for await (const item of (0, promises_1.glob)(pattern, {
|
|
55
56
|
cwd: gradleFiles,
|
|
56
|
-
})
|
|
57
|
-
if (!res || res.length === 0) {
|
|
58
|
-
this.$logger.warn("No files found");
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
61
|
-
const items = res.map((item) => {
|
|
57
|
+
})) {
|
|
62
58
|
const [group, artifact, version, sha1, file] = item.split(path.sep);
|
|
63
|
-
|
|
59
|
+
items.push({
|
|
64
60
|
id: sha1 + version,
|
|
65
61
|
group,
|
|
66
62
|
artifact,
|
|
@@ -68,8 +64,12 @@ class TypingsCommand {
|
|
|
68
64
|
sha1,
|
|
69
65
|
file,
|
|
70
66
|
path: path.resolve(gradleFiles, item),
|
|
71
|
-
};
|
|
72
|
-
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (items.length === 0) {
|
|
70
|
+
this.$logger.warn("No files found");
|
|
71
|
+
return [];
|
|
72
|
+
}
|
|
73
73
|
this.$logger.clearScreen();
|
|
74
74
|
const choices = await this.$prompter.promptForChoice(`Select dependencies to generate typings for (${color_1.color.greenBright(target)})`, items
|
|
75
75
|
.sort((a, b) => {
|
|
@@ -84,7 +84,7 @@ class TypingsCommand {
|
|
|
84
84
|
})
|
|
85
85
|
.map((item) => {
|
|
86
86
|
return {
|
|
87
|
-
title: `${color_1.color.white(item.group)}:${color_1.color.greenBright(item.artifact)}:${color_1.color.yellow(item.version)} - ${color_1.color.cyanBright
|
|
87
|
+
title: `${color_1.color.white(item.group)}:${color_1.color.greenBright(item.artifact)}:${color_1.color.yellow(item.version)} - ${color_1.color.styleText(["cyanBright", "bold"], item.file)}`,
|
|
88
88
|
value: item.id,
|
|
89
89
|
};
|
|
90
90
|
}), true, {
|
|
@@ -96,7 +96,7 @@ class TypingsCommand {
|
|
|
96
96
|
.map((item) => item.path);
|
|
97
97
|
}
|
|
98
98
|
async handleAndroidTypings() {
|
|
99
|
-
var _a;
|
|
99
|
+
var _a, _b;
|
|
100
100
|
const targets = (_a = this.$options.argv._.slice(2)) !== null && _a !== void 0 ? _a : [];
|
|
101
101
|
const paths = [];
|
|
102
102
|
if (targets.length) {
|
|
@@ -118,10 +118,18 @@ class TypingsCommand {
|
|
|
118
118
|
return false;
|
|
119
119
|
}
|
|
120
120
|
this.$fs.ensureDirectoryExists(path.resolve(this.$projectData.projectDir, "typings", "android"));
|
|
121
|
-
const dtsGeneratorPath = path.resolve(this.$projectData.projectDir, this.$projectData.getBuildRelativeDirectoryPath(), "android", "build-tools", "dts-generator.jar");
|
|
121
|
+
const dtsGeneratorPath = (_b = this.$options.dtsGeneratorPath) !== null && _b !== void 0 ? _b : path.resolve(this.$projectData.projectDir, this.$projectData.getBuildRelativeDirectoryPath(), "android", "build-tools", "dts-generator.jar");
|
|
122
122
|
if (!this.$fs.exists(dtsGeneratorPath)) {
|
|
123
|
-
this.$
|
|
124
|
-
|
|
123
|
+
if (this.$options.dtsGeneratorPath) {
|
|
124
|
+
this.$logger.warn([
|
|
125
|
+
`dts-generator.jar not found at ${this.$options.dtsGeneratorPath} used with --dtsGeneratorPath`,
|
|
126
|
+
].join("\n"));
|
|
127
|
+
return false;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
this.$logger.warn("No platforms folder found, preparing project now...");
|
|
131
|
+
await this.$childProcess.spawnFromEvent(this.$hostInfo.isWindows ? "ns.cmd" : "ns", ["prepare", "android"], "exit", { stdio: "inherit", shell: this.$hostInfo.isWindows });
|
|
132
|
+
}
|
|
125
133
|
}
|
|
126
134
|
const asArray = (input) => {
|
|
127
135
|
if (!input) {
|
|
@@ -140,6 +148,9 @@ class TypingsCommand {
|
|
|
140
148
|
await this.$childProcess.spawnFromEvent("java", [
|
|
141
149
|
"-jar",
|
|
142
150
|
dtsGeneratorPath,
|
|
151
|
+
...(this.$options.skipDeclarations ? ["--skip-declarations"] : []),
|
|
152
|
+
...(this.$options.super ? ["-super", this.$options.super] : []),
|
|
153
|
+
"-per-library",
|
|
143
154
|
"-input",
|
|
144
155
|
...inputs,
|
|
145
156
|
"-output",
|
|
@@ -124,7 +124,7 @@ interface IExtensibilityService {
|
|
|
124
124
|
* Gives the name of the extension that contains a required command.
|
|
125
125
|
* The method finds all extensions from npm and checks the command property defined in the nativescript key of the package.json.
|
|
126
126
|
* Based on specified input array, the method tries to find a suitable command that is defined in the extension.
|
|
127
|
-
* @example In case the input is `
|
|
127
|
+
* @example In case the input is `ns execute this command now`, the array will be ["execute", "this", "command", "now"].
|
|
128
128
|
* There may be an extension that defines execute|this as a command. The method will check each extension for the following commands:
|
|
129
129
|
* execute|this|command|now, execute|this|command, execute|this, execute
|
|
130
130
|
* In case it finds any of this commands, the method will return the extension name and the command name.
|
|
@@ -132,7 +132,7 @@ interface IExtensibilityService {
|
|
|
132
132
|
* @returns {IExtensionCommandInfo} Information about the extension and the registered command.
|
|
133
133
|
*/
|
|
134
134
|
getExtensionNameWhereCommandIsRegistered(
|
|
135
|
-
inputOpts: IGetExtensionCommandInfoParams
|
|
135
|
+
inputOpts: IGetExtensionCommandInfoParams,
|
|
136
136
|
): Promise<IExtensionCommandInfo>;
|
|
137
137
|
|
|
138
138
|
/**
|
|
@@ -137,7 +137,7 @@ declare global {
|
|
|
137
137
|
appId: string,
|
|
138
138
|
projectName: string,
|
|
139
139
|
projectDir: string,
|
|
140
|
-
ensureAppStarted?: boolean
|
|
140
|
+
ensureAppStarted?: boolean,
|
|
141
141
|
): Promise<any>;
|
|
142
142
|
destroyDebugSocket(appId: string): Promise<void>;
|
|
143
143
|
openDeviceLogStream(options?: IiOSLogStreamOptions): Promise<void>;
|
|
@@ -152,7 +152,7 @@ declare global {
|
|
|
152
152
|
|
|
153
153
|
interface IAndroidDeviceFileSystem extends IDeviceFileSystem {
|
|
154
154
|
getDeviceHashService(
|
|
155
|
-
appIdentifier: string
|
|
155
|
+
appIdentifier: string,
|
|
156
156
|
): Mobile.IAndroidDeviceHashService;
|
|
157
157
|
}
|
|
158
158
|
|
|
@@ -246,7 +246,7 @@ declare global {
|
|
|
246
246
|
*/
|
|
247
247
|
setProjectNameForDevice(
|
|
248
248
|
deviceIdentifier: string,
|
|
249
|
-
projectName: string
|
|
249
|
+
projectName: string,
|
|
250
250
|
): void;
|
|
251
251
|
|
|
252
252
|
/**
|
|
@@ -256,7 +256,7 @@ declare global {
|
|
|
256
256
|
*/
|
|
257
257
|
setProjectDirForDevice(
|
|
258
258
|
deviceIdentifier: string,
|
|
259
|
-
projectDir: string
|
|
259
|
+
projectDir: string,
|
|
260
260
|
): void;
|
|
261
261
|
}
|
|
262
262
|
|
|
@@ -299,7 +299,7 @@ declare global {
|
|
|
299
299
|
*/
|
|
300
300
|
startLogProcess(
|
|
301
301
|
deviceId: string,
|
|
302
|
-
options?: Mobile.IiOSLogStreamOptions
|
|
302
|
+
options?: Mobile.IiOSLogStreamOptions,
|
|
303
303
|
): Promise<void>;
|
|
304
304
|
}
|
|
305
305
|
|
|
@@ -323,7 +323,7 @@ declare global {
|
|
|
323
323
|
filterData(
|
|
324
324
|
platform: string,
|
|
325
325
|
data: string,
|
|
326
|
-
deviceLogOptions: Mobile.IDeviceLogOptions
|
|
326
|
+
deviceLogOptions: Mobile.IDeviceLogOptions,
|
|
327
327
|
): string;
|
|
328
328
|
}
|
|
329
329
|
|
|
@@ -340,7 +340,7 @@ declare global {
|
|
|
340
340
|
replaceWithOriginalFileLocations(
|
|
341
341
|
platform: string,
|
|
342
342
|
messageData: string,
|
|
343
|
-
loggingOptions: Mobile.IDeviceLogOptions
|
|
343
|
+
loggingOptions: Mobile.IDeviceLogOptions,
|
|
344
344
|
): string;
|
|
345
345
|
}
|
|
346
346
|
|
|
@@ -357,7 +357,7 @@ declare global {
|
|
|
357
357
|
*/
|
|
358
358
|
filterData(
|
|
359
359
|
data: string,
|
|
360
|
-
deviceLogOptions: Mobile.IDeviceLogOptions
|
|
360
|
+
deviceLogOptions: Mobile.IDeviceLogOptions,
|
|
361
361
|
): string;
|
|
362
362
|
}
|
|
363
363
|
|
|
@@ -386,13 +386,13 @@ declare global {
|
|
|
386
386
|
installApplication(
|
|
387
387
|
packageFilePath: string,
|
|
388
388
|
appIdentifier?: string,
|
|
389
|
-
buildData?: IBuildData
|
|
389
|
+
buildData?: IBuildData,
|
|
390
390
|
): Promise<void>;
|
|
391
391
|
uninstallApplication(appIdentifier: string): Promise<void>;
|
|
392
392
|
reinstallApplication(
|
|
393
393
|
appIdentifier: string,
|
|
394
394
|
packageFilePath: string,
|
|
395
|
-
buildData?: IBuildData
|
|
395
|
+
buildData?: IBuildData,
|
|
396
396
|
): Promise<void>;
|
|
397
397
|
startApplication(appData: IStartApplicationData): Promise<void>;
|
|
398
398
|
stopApplication(appData: IApplicationData): Promise<void>;
|
|
@@ -401,7 +401,7 @@ declare global {
|
|
|
401
401
|
tryStartApplication(appData: IApplicationData): Promise<void>;
|
|
402
402
|
getDebuggableApps(): Promise<Mobile.IDeviceApplicationInformation[]>;
|
|
403
403
|
getDebuggableAppViews(
|
|
404
|
-
appIdentifiers: string[]
|
|
404
|
+
appIdentifiers: string[],
|
|
405
405
|
): Promise<IDictionary<Mobile.IDebugWebViewInfo[]>>;
|
|
406
406
|
/**
|
|
407
407
|
* Sets the files transferred on device.
|
|
@@ -438,34 +438,34 @@ declare global {
|
|
|
438
438
|
getFile(
|
|
439
439
|
deviceFilePath: string,
|
|
440
440
|
appIdentifier: string,
|
|
441
|
-
outputFilePath?: string
|
|
441
|
+
outputFilePath?: string,
|
|
442
442
|
): Promise<void>;
|
|
443
443
|
getFileContent(
|
|
444
444
|
deviceFilePath: string,
|
|
445
|
-
appIdentifier: string
|
|
445
|
+
appIdentifier: string,
|
|
446
446
|
): Promise<string>;
|
|
447
447
|
putFile(
|
|
448
448
|
localFilePath: string,
|
|
449
449
|
deviceFilePath: string,
|
|
450
|
-
appIdentifier: string
|
|
450
|
+
appIdentifier: string,
|
|
451
451
|
): Promise<void>;
|
|
452
452
|
deleteFile(deviceFilePath: string, appIdentifier: string): Promise<void>;
|
|
453
453
|
transferFiles(
|
|
454
454
|
deviceAppData: Mobile.IDeviceAppData,
|
|
455
|
-
localToDevicePaths: Mobile.ILocalToDevicePathData[]
|
|
455
|
+
localToDevicePaths: Mobile.ILocalToDevicePathData[],
|
|
456
456
|
): Promise<Mobile.ILocalToDevicePathData[]>;
|
|
457
457
|
transferDirectory(
|
|
458
458
|
deviceAppData: Mobile.IDeviceAppData,
|
|
459
459
|
localToDevicePaths: Mobile.ILocalToDevicePathData[],
|
|
460
|
-
projectFilesPath: string
|
|
460
|
+
projectFilesPath: string,
|
|
461
461
|
): Promise<Mobile.ILocalToDevicePathData[]>;
|
|
462
462
|
transferFile?(
|
|
463
463
|
localFilePath: string,
|
|
464
|
-
deviceFilePath: string
|
|
464
|
+
deviceFilePath: string,
|
|
465
465
|
): Promise<void>;
|
|
466
466
|
createFileOnDevice?(
|
|
467
467
|
deviceFilePath: string,
|
|
468
|
-
fileContent: string
|
|
468
|
+
fileContent: string,
|
|
469
469
|
): Promise<void>;
|
|
470
470
|
/**
|
|
471
471
|
* Updates the hash file on device with the current hashes of files.
|
|
@@ -474,7 +474,7 @@ declare global {
|
|
|
474
474
|
*/
|
|
475
475
|
updateHashesOnDevice(
|
|
476
476
|
hashes: IStringDictionary,
|
|
477
|
-
appIdentifier: string
|
|
477
|
+
appIdentifier: string,
|
|
478
478
|
): Promise<void>;
|
|
479
479
|
}
|
|
480
480
|
|
|
@@ -489,11 +489,11 @@ declare global {
|
|
|
489
489
|
interface IAndroidDebugBridge {
|
|
490
490
|
executeCommand(
|
|
491
491
|
args: string[],
|
|
492
|
-
options?: IAndroidDebugBridgeCommandOptions
|
|
492
|
+
options?: IAndroidDebugBridgeCommandOptions,
|
|
493
493
|
): Promise<any>;
|
|
494
494
|
executeShellCommand(
|
|
495
495
|
args: string[],
|
|
496
|
-
options?: IAndroidDebugBridgeCommandOptions
|
|
496
|
+
options?: IAndroidDebugBridgeCommandOptions,
|
|
497
497
|
): Promise<any>;
|
|
498
498
|
pushFile(localFilePath: string, deviceFilePath: string): Promise<void>;
|
|
499
499
|
removeFile(deviceFilePath: string): Promise<void>;
|
|
@@ -520,7 +520,7 @@ declare global {
|
|
|
520
520
|
interface IDeviceAndroidDebugBridge extends IAndroidDebugBridge {
|
|
521
521
|
sendBroadcastToDevice(
|
|
522
522
|
action: string,
|
|
523
|
-
extras?: IStringDictionary
|
|
523
|
+
extras?: IStringDictionary,
|
|
524
524
|
): Promise<number>;
|
|
525
525
|
}
|
|
526
526
|
|
|
@@ -563,7 +563,7 @@ declare global {
|
|
|
563
563
|
skipEmulatorStart?: boolean;
|
|
564
564
|
/**
|
|
565
565
|
* Currently available only for iOS. Specifies the sdk version of the iOS simulator.
|
|
566
|
-
* In case when `
|
|
566
|
+
* In case when `ns run ios --device "iPhone 6"` command is executed, the user can specify the sdk of the simulator because it is possible to have more than one device with the same name but with different sdk versions.
|
|
567
567
|
*/
|
|
568
568
|
sdk?: string;
|
|
569
569
|
|
|
@@ -593,7 +593,7 @@ declare global {
|
|
|
593
593
|
execute<T>(
|
|
594
594
|
action: (device: Mobile.IDevice) => Promise<T>,
|
|
595
595
|
canExecute?: (dev: Mobile.IDevice) => boolean,
|
|
596
|
-
options?: { allowNoDevices?: boolean }
|
|
596
|
+
options?: { allowNoDevices?: boolean },
|
|
597
597
|
): Promise<IDeviceActionResult<T>[]>;
|
|
598
598
|
|
|
599
599
|
/**
|
|
@@ -628,7 +628,7 @@ declare global {
|
|
|
628
628
|
deviceIdentifiers: string[],
|
|
629
629
|
appIdentifier: string,
|
|
630
630
|
framework: string,
|
|
631
|
-
projectDir: string
|
|
631
|
+
projectDir: string,
|
|
632
632
|
): Promise<IAppInstalledInfo>[];
|
|
633
633
|
setLogLevel(logLevel: string, deviceIdentifier?: string): void;
|
|
634
634
|
deployOnDevices(
|
|
@@ -636,20 +636,20 @@ declare global {
|
|
|
636
636
|
packageFile: string,
|
|
637
637
|
packageName: string,
|
|
638
638
|
framework: string,
|
|
639
|
-
projectDir: string
|
|
639
|
+
projectDir: string,
|
|
640
640
|
): Promise<void>[];
|
|
641
641
|
getDeviceByIdentifier(identifier: string): Mobile.IDevice;
|
|
642
642
|
mapAbstractToTcpPort(
|
|
643
643
|
deviceIdentifier: string,
|
|
644
644
|
appIdentifier: string,
|
|
645
|
-
framework: string
|
|
645
|
+
framework: string,
|
|
646
646
|
): Promise<string>;
|
|
647
647
|
getDebuggableApps(
|
|
648
|
-
deviceIdentifiers: string[]
|
|
648
|
+
deviceIdentifiers: string[],
|
|
649
649
|
): Promise<Mobile.IDeviceApplicationInformation[]>[];
|
|
650
650
|
getDebuggableViews(
|
|
651
651
|
deviceIdentifier: string,
|
|
652
|
-
appIdentifier: string
|
|
652
|
+
appIdentifier: string,
|
|
653
653
|
): Promise<Mobile.IDebugWebViewInfo[]>;
|
|
654
654
|
|
|
655
655
|
/**
|
|
@@ -665,7 +665,7 @@ declare global {
|
|
|
665
665
|
* @returns {Promise<Mobile.IListEmulatorsOutput>} Dictionary with the following format: { ios: { devices: Mobile.IDeviceInfo[], errors: string[] }, android: { devices: Mobile.IDeviceInfo[], errors: string[]}}.
|
|
666
666
|
*/
|
|
667
667
|
getEmulatorImages(
|
|
668
|
-
options?: Mobile.IListEmulatorsOptions
|
|
668
|
+
options?: Mobile.IListEmulatorsOptions,
|
|
669
669
|
): Promise<Mobile.IListEmulatorsOutput>;
|
|
670
670
|
|
|
671
671
|
/**
|
|
@@ -680,11 +680,11 @@ declare global {
|
|
|
680
680
|
* prompts the user for a manual choice or returns the first one for non interactive terminals.
|
|
681
681
|
*/
|
|
682
682
|
pickSingleDevice(
|
|
683
|
-
options: IPickSingleDeviceOptions
|
|
683
|
+
options: IPickSingleDeviceOptions,
|
|
684
684
|
): Promise<Mobile.IDevice>;
|
|
685
685
|
|
|
686
686
|
getPlatformsFromDeviceDescriptors(
|
|
687
|
-
deviceDescriptors: ILiveSyncDeviceDescriptor[]
|
|
687
|
+
deviceDescriptors: ILiveSyncDeviceDescriptor[],
|
|
688
688
|
): string[];
|
|
689
689
|
}
|
|
690
690
|
|
|
@@ -740,7 +740,7 @@ declare global {
|
|
|
740
740
|
mapAbstractToTcpPort(
|
|
741
741
|
deviceIdentifier: string,
|
|
742
742
|
appIdentifier: string,
|
|
743
|
-
framework: string
|
|
743
|
+
framework: string,
|
|
744
744
|
): Promise<string>;
|
|
745
745
|
|
|
746
746
|
/**
|
|
@@ -749,7 +749,7 @@ declare global {
|
|
|
749
749
|
* @return {Mobile.IDeviceApplicationInformation[]} Returns array of applications information for the applications which are available for debugging.
|
|
750
750
|
*/
|
|
751
751
|
getDebuggableApps(
|
|
752
|
-
deviceIdentifier: string
|
|
752
|
+
deviceIdentifier: string,
|
|
753
753
|
): Promise<Mobile.IDeviceApplicationInformation[]>;
|
|
754
754
|
|
|
755
755
|
/**
|
|
@@ -762,7 +762,7 @@ declare global {
|
|
|
762
762
|
getMappedAbstractToTcpPorts(
|
|
763
763
|
deviceIdentifier: string,
|
|
764
764
|
appIdentifiers: string[],
|
|
765
|
-
framework: string
|
|
765
|
+
framework: string,
|
|
766
766
|
): Promise<IDictionary<number>>;
|
|
767
767
|
|
|
768
768
|
/**
|
|
@@ -773,7 +773,7 @@ declare global {
|
|
|
773
773
|
*/
|
|
774
774
|
getAppProcessId(
|
|
775
775
|
deviceIdentifier: string,
|
|
776
|
-
appIdentifier: string
|
|
776
|
+
appIdentifier: string,
|
|
777
777
|
): Promise<string>;
|
|
778
778
|
|
|
779
779
|
/**
|
|
@@ -784,7 +784,7 @@ declare global {
|
|
|
784
784
|
* @returns {number} The TCP port that is used for the forwarding.
|
|
785
785
|
*/
|
|
786
786
|
forwardFreeTcpToAbstractPort(
|
|
787
|
-
portForwardInputData: IPortForwardData
|
|
787
|
+
portForwardInputData: IPortForwardData,
|
|
788
788
|
): Promise<number>;
|
|
789
789
|
}
|
|
790
790
|
|
|
@@ -846,7 +846,7 @@ declare global {
|
|
|
846
846
|
fileName: string,
|
|
847
847
|
localProjectRootPath: string,
|
|
848
848
|
onDeviceFileName: string,
|
|
849
|
-
deviceProjectRootPath: string
|
|
849
|
+
deviceProjectRootPath: string,
|
|
850
850
|
): Mobile.ILocalToDevicePathData;
|
|
851
851
|
}
|
|
852
852
|
|
|
@@ -901,7 +901,7 @@ declare global {
|
|
|
901
901
|
* @returns {Promise<IStartEmulatorOutput>} Starts the emulator and returns the errors if some error occurs.
|
|
902
902
|
*/
|
|
903
903
|
startEmulator(
|
|
904
|
-
options: Mobile.IStartEmulatorOptions
|
|
904
|
+
options: Mobile.IStartEmulatorOptions,
|
|
905
905
|
): Promise<IStartEmulatorOutput>;
|
|
906
906
|
|
|
907
907
|
/**
|
|
@@ -922,7 +922,7 @@ declare global {
|
|
|
922
922
|
* Returns array of all available android emulators - genymotion and native avd emulators and array of errors.
|
|
923
923
|
*/
|
|
924
924
|
getEmulatorImages(
|
|
925
|
-
adbDevicesOutput: string[]
|
|
925
|
+
adbDevicesOutput: string[],
|
|
926
926
|
): Promise<Mobile.IEmulatorImagesOutput>;
|
|
927
927
|
/**
|
|
928
928
|
* Gets all identifiers of all running android emulators.
|
|
@@ -973,7 +973,7 @@ declare global {
|
|
|
973
973
|
* @returns {Promise<IVirtualBoxEnumerateGuestPropertiesOutput>} - Returns a dictionary in the following format: { properties: string; error?: string; }
|
|
974
974
|
*/
|
|
975
975
|
enumerateGuestProperties(
|
|
976
|
-
id: string
|
|
976
|
+
id: string,
|
|
977
977
|
): Promise<IVirtualBoxEnumerateGuestPropertiesOutput>;
|
|
978
978
|
}
|
|
979
979
|
|
|
@@ -1018,7 +1018,7 @@ declare global {
|
|
|
1018
1018
|
*/
|
|
1019
1019
|
parseIniFile(
|
|
1020
1020
|
iniFilePath: string,
|
|
1021
|
-
avdInfo?: Mobile.IAvdInfo
|
|
1021
|
+
avdInfo?: Mobile.IAvdInfo,
|
|
1022
1022
|
): Mobile.IAvdInfo;
|
|
1023
1023
|
}
|
|
1024
1024
|
|
|
@@ -1062,7 +1062,7 @@ declare global {
|
|
|
1062
1062
|
launchApplication(
|
|
1063
1063
|
applicationPath: string,
|
|
1064
1064
|
appIdentifier: string,
|
|
1065
|
-
options: IiOSSimLaunchApplicationOptions
|
|
1065
|
+
options: IiOSSimLaunchApplicationOptions,
|
|
1066
1066
|
): Promise<any>;
|
|
1067
1067
|
printDeviceTypes(): Promise<any>;
|
|
1068
1068
|
sendNotification(notification: string, deviceId: string): Promise<void>;
|
|
@@ -1110,7 +1110,7 @@ declare global {
|
|
|
1110
1110
|
interface IiOSSimulatorService extends IEmulatorPlatformService {
|
|
1111
1111
|
postDarwinNotification(
|
|
1112
1112
|
notification: string,
|
|
1113
|
-
deviceId: string
|
|
1113
|
+
deviceId: string,
|
|
1114
1114
|
): Promise<void>;
|
|
1115
1115
|
|
|
1116
1116
|
/**
|
|
@@ -1212,34 +1212,34 @@ declare global {
|
|
|
1212
1212
|
getDeviceFileContent(
|
|
1213
1213
|
device: Mobile.IDevice,
|
|
1214
1214
|
deviceFilePath: string,
|
|
1215
|
-
projectData: IProjectData
|
|
1215
|
+
projectData: IProjectData,
|
|
1216
1216
|
): Promise<string>;
|
|
1217
1217
|
}
|
|
1218
1218
|
|
|
1219
1219
|
interface IEmulatorHelper {
|
|
1220
1220
|
mapAndroidApiLevelToVersion: IStringDictionary;
|
|
1221
1221
|
getEmulatorsFromAvailableEmulatorsOutput(
|
|
1222
|
-
availableEmulatorsOutput: Mobile.IListEmulatorsOutput
|
|
1222
|
+
availableEmulatorsOutput: Mobile.IListEmulatorsOutput,
|
|
1223
1223
|
): Mobile.IDeviceInfo[];
|
|
1224
1224
|
getErrorsFromAvailableEmulatorsOutput(
|
|
1225
|
-
availableEmulatorsOutput: Mobile.IListEmulatorsOutput
|
|
1225
|
+
availableEmulatorsOutput: Mobile.IListEmulatorsOutput,
|
|
1226
1226
|
): string[];
|
|
1227
1227
|
getEmulatorByImageIdentifier(
|
|
1228
1228
|
imageIdentifier: string,
|
|
1229
|
-
emulators: Mobile.IDeviceInfo[]
|
|
1229
|
+
emulators: Mobile.IDeviceInfo[],
|
|
1230
1230
|
): Mobile.IDeviceInfo;
|
|
1231
1231
|
getEmulatorByIdOrName(
|
|
1232
1232
|
emulatorIdOrName: string,
|
|
1233
|
-
emulators: Mobile.IDeviceInfo[]
|
|
1233
|
+
emulators: Mobile.IDeviceInfo[],
|
|
1234
1234
|
): Mobile.IDeviceInfo;
|
|
1235
1235
|
getEmulatorByStartEmulatorOptions(
|
|
1236
1236
|
options: Mobile.IStartEmulatorOptions,
|
|
1237
|
-
emulators: Mobile.IDeviceInfo[]
|
|
1237
|
+
emulators: Mobile.IDeviceInfo[],
|
|
1238
1238
|
): Mobile.IDeviceInfo;
|
|
1239
1239
|
isEmulatorRunning(emulator: Mobile.IDeviceInfo): boolean;
|
|
1240
1240
|
setRunningAndroidEmulatorProperties(
|
|
1241
1241
|
emulatorId: string,
|
|
1242
|
-
emulator: Mobile.IDeviceInfo
|
|
1242
|
+
emulator: Mobile.IDeviceInfo,
|
|
1243
1243
|
): void;
|
|
1244
1244
|
}
|
|
1245
1245
|
|
|
@@ -1292,13 +1292,13 @@ declare global {
|
|
|
1292
1292
|
* Computes the shasums of localToDevicePaths and updates hash file on device
|
|
1293
1293
|
*/
|
|
1294
1294
|
updateHashes(
|
|
1295
|
-
localToDevicePaths: Mobile.ILocalToDevicePathData[]
|
|
1295
|
+
localToDevicePaths: Mobile.ILocalToDevicePathData[],
|
|
1296
1296
|
): Promise<void>;
|
|
1297
1297
|
/**
|
|
1298
1298
|
* Computes the shasums of localToDevicePaths and removes them from hash file on device
|
|
1299
1299
|
*/
|
|
1300
1300
|
removeHashes(
|
|
1301
|
-
localToDevicePaths: Mobile.ILocalToDevicePathData[]
|
|
1301
|
+
localToDevicePaths: Mobile.ILocalToDevicePathData[],
|
|
1302
1302
|
): Promise<boolean>;
|
|
1303
1303
|
|
|
1304
1304
|
/**
|
|
@@ -1315,7 +1315,7 @@ declare global {
|
|
|
1315
1315
|
*/
|
|
1316
1316
|
generateHashesFromLocalToDevicePaths(
|
|
1317
1317
|
localToDevicePaths: Mobile.ILocalToDevicePathData[],
|
|
1318
|
-
initialShasums?: IStringDictionary
|
|
1318
|
+
initialShasums?: IStringDictionary,
|
|
1319
1319
|
): Promise<IStringDictionary>;
|
|
1320
1320
|
|
|
1321
1321
|
/**
|
|
@@ -1324,7 +1324,7 @@ declare global {
|
|
|
1324
1324
|
* @returns {string[]} DevicePaths of all elements from the input localToDevicePaths.
|
|
1325
1325
|
*/
|
|
1326
1326
|
getDevicePaths(
|
|
1327
|
-
localToDevicePaths: Mobile.ILocalToDevicePathData[]
|
|
1327
|
+
localToDevicePaths: Mobile.ILocalToDevicePathData[],
|
|
1328
1328
|
): string[];
|
|
1329
1329
|
|
|
1330
1330
|
/**
|
|
@@ -1335,7 +1335,7 @@ declare global {
|
|
|
1335
1335
|
*/
|
|
1336
1336
|
getChangedShasums(
|
|
1337
1337
|
oldShasums: IStringDictionary,
|
|
1338
|
-
currentShasums: IStringDictionary
|
|
1338
|
+
currentShasums: IStringDictionary,
|
|
1339
1339
|
): IStringDictionary;
|
|
1340
1340
|
}
|
|
1341
1341
|
|
|
@@ -1377,7 +1377,7 @@ declare global {
|
|
|
1377
1377
|
*/
|
|
1378
1378
|
handleErrors(
|
|
1379
1379
|
errors: IAndroidDebugBridgeError[],
|
|
1380
|
-
treatErrorsAsWarnings?: boolean
|
|
1380
|
+
treatErrorsAsWarnings?: boolean,
|
|
1381
1381
|
): void;
|
|
1382
1382
|
}
|
|
1383
1383
|
|
|
@@ -1407,77 +1407,77 @@ declare global {
|
|
|
1407
1407
|
install(
|
|
1408
1408
|
ipaPath: string,
|
|
1409
1409
|
deviceIdentifiers: string[],
|
|
1410
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1410
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1411
1411
|
): Promise<IOSDeviceResponse>;
|
|
1412
1412
|
|
|
1413
1413
|
uninstall(
|
|
1414
1414
|
appIdentifier: string,
|
|
1415
1415
|
deviceIdentifiers: string[],
|
|
1416
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1416
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1417
1417
|
): Promise<IOSDeviceResponse>;
|
|
1418
1418
|
|
|
1419
1419
|
startLookingForDevices(
|
|
1420
1420
|
deviceFoundCallback: DeviceInfoCallback,
|
|
1421
1421
|
deviceUpdatedCallback: DeviceInfoCallback,
|
|
1422
1422
|
deviceLostCallback: DeviceInfoCallback,
|
|
1423
|
-
options?: Mobile.IDeviceLookingOptions
|
|
1423
|
+
options?: Mobile.IDeviceLookingOptions,
|
|
1424
1424
|
): Promise<void>;
|
|
1425
1425
|
|
|
1426
1426
|
startDeviceLog(deviceIdentifier: string): void;
|
|
1427
1427
|
|
|
1428
1428
|
apps(
|
|
1429
1429
|
deviceIdentifiers: string[],
|
|
1430
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1430
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1431
1431
|
): Promise<IOSDeviceAppInfo>;
|
|
1432
1432
|
|
|
1433
1433
|
listDirectory(
|
|
1434
1434
|
listArray: IOSDeviceLib.IReadOperationData[],
|
|
1435
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1435
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1436
1436
|
): Promise<IOSDeviceMultipleResponse>;
|
|
1437
1437
|
|
|
1438
1438
|
readFiles(
|
|
1439
1439
|
deviceFilePaths: IOSDeviceLib.IReadOperationData[],
|
|
1440
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1440
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1441
1441
|
): Promise<IOSDeviceResponse>;
|
|
1442
1442
|
|
|
1443
1443
|
downloadFiles(
|
|
1444
1444
|
deviceFilePaths: IOSDeviceLib.IFileOperationData[],
|
|
1445
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1445
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1446
1446
|
): Promise<IOSDeviceResponse>;
|
|
1447
1447
|
|
|
1448
1448
|
uploadFiles(
|
|
1449
1449
|
files: IOSDeviceLib.IUploadFilesData[],
|
|
1450
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1450
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1451
1451
|
): Promise<IOSDeviceResponse>;
|
|
1452
1452
|
|
|
1453
1453
|
deleteFiles(
|
|
1454
1454
|
deleteArray: IOSDeviceLib.IDeleteFileData[],
|
|
1455
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1455
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1456
1456
|
): Promise<IOSDeviceResponse>;
|
|
1457
1457
|
|
|
1458
1458
|
start(
|
|
1459
1459
|
startArray: IOSDeviceLib.IIOSApplicationData[],
|
|
1460
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1460
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1461
1461
|
): Promise<IOSDeviceResponse>;
|
|
1462
1462
|
|
|
1463
1463
|
stop(
|
|
1464
1464
|
stopArray: IOSDeviceLib.IIOSApplicationData[],
|
|
1465
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1465
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1466
1466
|
): Promise<IOSDeviceResponse>;
|
|
1467
1467
|
|
|
1468
1468
|
postNotification(
|
|
1469
1469
|
postNotificationArray: IOSDeviceLib.IPostNotificationData[],
|
|
1470
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1470
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1471
1471
|
): Promise<IOSDeviceResponse>;
|
|
1472
1472
|
|
|
1473
1473
|
awaitNotificationResponse(
|
|
1474
1474
|
awaitNotificationResponseArray: IOSDeviceLib.IAwaitNotificatioNResponseData[],
|
|
1475
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1475
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1476
1476
|
): Promise<IOSDeviceResponse>;
|
|
1477
1477
|
|
|
1478
1478
|
connectToPort(
|
|
1479
1479
|
connectToPortArray: IOSDeviceLib.IConnectToPortData[],
|
|
1480
|
-
errorHandler?: DeviceOperationErrorHandler
|
|
1480
|
+
errorHandler?: DeviceOperationErrorHandler,
|
|
1481
1481
|
): Promise<IDictionary<IOSDeviceLib.IConnectToPortResponse[]>>;
|
|
1482
1482
|
|
|
1483
1483
|
setShouldDispose(shouldDispose: boolean): void;
|
|
@@ -1486,7 +1486,7 @@ declare global {
|
|
|
1486
1486
|
type DeviceOperationErrorHandler = (err: IOSDeviceLib.IDeviceError) => void;
|
|
1487
1487
|
|
|
1488
1488
|
type DeviceInfoCallback = (
|
|
1489
|
-
deviceInfo: IOSDeviceLib.IDeviceActionInfo
|
|
1489
|
+
deviceInfo: IOSDeviceLib.IDeviceActionInfo,
|
|
1490
1490
|
) => void;
|
|
1491
1491
|
|
|
1492
1492
|
type IOSDeviceResponse = IDictionary<IOSDeviceLib.IDeviceResponse[]>;
|
package/lib/common/header.js
CHANGED
|
@@ -10,14 +10,14 @@ function printHeader() {
|
|
|
10
10
|
const version = $staticConfig.version;
|
|
11
11
|
const header = [
|
|
12
12
|
color_1.color.dim("│ "),
|
|
13
|
-
color_1.color.cyanBright
|
|
14
|
-
color_1.color.whiteBright
|
|
13
|
+
color_1.color.styleText(["cyanBright", "bold"], "{N} NativeScript "),
|
|
14
|
+
color_1.color.styleText(["whiteBright", "bold"], "CLI"),
|
|
15
15
|
color_1.color.dim(` [v${version}] `),
|
|
16
16
|
].join("");
|
|
17
17
|
const tagLine = [
|
|
18
18
|
color_1.color.dim("│ "),
|
|
19
19
|
color_1.color.dim(" → "),
|
|
20
|
-
color_1.color.whiteBright
|
|
20
|
+
color_1.color.styleText(["whiteBright", "bold"], "Empower JavaScript with native APIs "),
|
|
21
21
|
].join("");
|
|
22
22
|
const headerLength = (0, color_1.stripColors)(header).length;
|
|
23
23
|
const tagLineLength = (0, color_1.stripColors)(tagLine).length;
|
|
@@ -19,7 +19,7 @@ function layout(config) {
|
|
|
19
19
|
return msg;
|
|
20
20
|
}
|
|
21
21
|
if (logEvent.level.isEqualTo(constants_1.LoggerLevel.ERROR)) {
|
|
22
|
-
return color_1.color.red
|
|
22
|
+
return color_1.color.styleText(["red", "bold"], msg);
|
|
23
23
|
}
|
|
24
24
|
if (logEvent.level.isEqualTo(constants_1.LoggerLevel.WARN)) {
|
|
25
25
|
return color_1.color.yellow(msg);
|