nativescript 8.5.3 → 8.5.4-dev.1
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/config.json +0 -5
- package/lib/.d.ts +2 -37
- package/lib/bootstrap.js +1 -12
- package/lib/color.js +5 -0
- package/lib/commands/build.js +2 -6
- package/lib/commands/clean.js +11 -10
- package/lib/commands/config.js +6 -5
- package/lib/commands/create-project.js +12 -11
- package/lib/commands/debug.js +10 -11
- package/lib/commands/plugin/list-plugins.js +3 -2
- package/lib/commands/post-install.js +3 -5
- package/lib/commands/preview.js +4 -3
- package/lib/commands/run.js +17 -19
- package/lib/commands/test-init.js +14 -15
- package/lib/commands/test.js +0 -3
- package/lib/commands/update.js +1 -1
- package/lib/common/bootstrap.js +0 -1
- package/lib/common/child-process.js +3 -3
- package/lib/common/codeGeneration/code-printer.js +1 -1
- package/lib/common/commands/device/device-log-stream.js +1 -1
- package/lib/common/commands/device/list-devices.js +7 -8
- package/lib/common/commands/generate-messages.js +1 -1
- package/lib/common/constants.js +11 -11
- package/lib/common/declarations.d.ts +1 -53
- package/lib/common/definitions/commands-service.d.ts +0 -1
- package/lib/common/definitions/commands.d.ts +0 -1
- package/lib/common/definitions/google-analytics.d.ts +0 -5
- package/lib/common/dispatchers.js +4 -7
- package/lib/common/file-system.js +18 -22
- package/lib/common/host-info.js +4 -4
- package/lib/common/http-client.js +2 -2
- package/lib/common/logger/layouts/cli-layout.js +6 -2
- package/lib/common/logger/logger.js +7 -7
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -1
- package/lib/common/mobile/android/android-log-filter.js +5 -5
- package/lib/common/mobile/android/android-virtual-device-service.js +2 -2
- package/lib/common/mobile/android/genymotion/genymotion-service.js +2 -2
- package/lib/common/mobile/android/logcat-helper.js +1 -1
- package/lib/common/mobile/device-log-provider.js +8 -8
- package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +1 -1
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -1
- package/lib/common/mobile/mobile-helper.js +1 -1
- package/lib/common/mobile/wp8/wp8-emulator-services.js +4 -4
- package/lib/common/opener.js +5 -1
- package/lib/common/plist-parser.js +3 -3
- package/lib/common/project-helper.js +2 -2
- package/lib/common/services/analytics/google-analytics-custom-dimensions.d.ts +7 -7
- package/lib/common/services/auto-completion-service.js +2 -2
- package/lib/common/services/commands-service.js +5 -114
- package/lib/common/services/help-service.js +16 -16
- package/lib/common/services/hooks-service.js +2 -1
- package/lib/common/services/json-file-settings-service.js +3 -3
- package/lib/common/services/lock-service.js +5 -5
- package/lib/common/services/messages-service.js +6 -6
- package/lib/common/services/net-service.js +1 -1
- package/lib/common/services/project-files-manager.js +2 -2
- package/lib/common/services/settings-service.js +2 -2
- package/lib/common/validators/project-name-validator.js +1 -1
- package/lib/common/validators/validation-result.js +1 -1
- package/lib/common/verify-node-version.js +2 -2
- package/lib/config.js +3 -8
- package/lib/constants.js +18 -32
- package/lib/controllers/build-controller.js +5 -5
- package/lib/controllers/debug-controller.js +2 -2
- package/lib/controllers/migrate-controller.js +21 -20
- package/lib/controllers/update-controller.js +5 -4
- package/lib/declarations.d.ts +0 -24
- package/lib/definitions/build.d.ts +1 -1
- package/lib/definitions/livesync.d.ts +0 -10
- package/lib/definitions/project.d.ts +0 -6
- package/lib/definitions/xcode.d.ts +1 -1
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +15 -4
- package/lib/device-sockets/ios/notification.js +1 -1
- package/lib/helpers/android-bundle-validator-helper.js +1 -1
- package/lib/helpers/network-connectivity-validator.js +1 -1
- package/lib/helpers/options-track-helper.js +1 -1
- package/lib/nativescript-cli.js +8 -10
- package/lib/options.js +61 -21
- package/lib/package-installation-manager.js +5 -4
- package/lib/project-data.js +9 -10
- package/lib/providers/project-files-provider.js +3 -3
- package/lib/services/analytics/analytics-broker-process.js +0 -3
- package/lib/services/analytics/analytics-broker.js +5 -5
- package/lib/services/analytics/analytics-service.js +0 -4
- package/lib/services/analytics/analytics.d.ts +1 -8
- package/lib/services/analytics/google-analytics-provider.js +1 -21
- package/lib/services/analytics-settings-service.js +3 -11
- package/lib/services/android-device-debug-service.js +3 -3
- package/lib/services/android-plugin-build-service.js +3 -3
- package/lib/services/android-resources-migration-service.js +1 -1
- package/lib/services/assets-generation/assets-generation-service.js +5 -5
- package/lib/services/{build-artefacts-service.js → build-artifacts-service.js} +4 -4
- package/lib/services/cocoapods-service.js +1 -1
- package/lib/services/device/device-install-app-service.js +3 -3
- package/lib/services/doctor-service.js +10 -9
- package/lib/services/extensibility-service.js +8 -8
- package/lib/services/ios-entitlements-service.js +1 -1
- package/lib/services/ios-project-service.js +5 -5
- package/lib/services/ios-provision-service.js +7 -7
- package/lib/services/ios-watch-app-service.js +1 -1
- package/lib/services/ip-service.js +2 -4
- package/lib/services/itmstransporter-service.js +2 -2
- package/lib/services/livesync/android-device-livesync-sockets-service.js +1 -1
- package/lib/services/livesync/android-livesync-tool.js +5 -5
- package/lib/services/livesync/ios-device-livesync-service.js +2 -2
- package/lib/services/livesync/platform-livesync-service-base.js +2 -1
- package/lib/services/log-parser-service.js +1 -5
- package/lib/services/log-source-map-service.js +10 -7
- package/lib/services/npm-config-service.js +23 -9
- package/lib/services/performance-service.js +3 -3
- package/lib/services/platform-environment-requirements.js +1 -1
- package/lib/services/plugins-service.js +19 -19
- package/lib/services/project-backup-service.js +4 -3
- package/lib/services/project-cleanup-service.js +4 -3
- package/lib/services/test-execution-service.js +2 -2
- package/lib/services/timeline-profiler-service.js +4 -1
- package/lib/services/user-settings-service.js +4 -4
- package/lib/tools/config-manipulation/config-transformer.js +3 -3
- package/lib/tools/node-modules/node-modules-builder.js +1 -1
- package/node_modules/@npmcli/move-file/LICENSE.md +22 -0
- package/node_modules/@npmcli/move-file/README.md +69 -0
- package/node_modules/@npmcli/move-file/lib/index.js +185 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +15 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/LICENSE +21 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/bin/cmd.js +68 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/index.js +31 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/find-made.js +29 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/mkdirp-manual.js +64 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/mkdirp-native.js +39 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/opts-arg.js +23 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/path-arg.js +29 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/use-native.js +10 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/package.json +44 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/readme.markdown +266 -0
- package/node_modules/@npmcli/move-file/package.json +47 -0
- package/node_modules/balanced-match/.npmignore +5 -0
- package/node_modules/balanced-match/LICENSE.md +21 -0
- package/node_modules/balanced-match/README.md +91 -0
- package/node_modules/balanced-match/index.js +59 -0
- package/node_modules/balanced-match/package.json +49 -0
- package/node_modules/brace-expansion/LICENSE +21 -0
- package/node_modules/brace-expansion/README.md +129 -0
- package/node_modules/brace-expansion/index.js +201 -0
- package/node_modules/brace-expansion/package.json +47 -0
- package/node_modules/concat-map/.travis.yml +4 -0
- package/node_modules/concat-map/LICENSE +18 -0
- package/node_modules/concat-map/README.markdown +62 -0
- package/node_modules/concat-map/example/map.js +6 -0
- package/node_modules/concat-map/index.js +13 -0
- package/node_modules/concat-map/package.json +43 -0
- package/node_modules/concat-map/test/map.js +39 -0
- package/node_modules/fs.realpath/LICENSE +43 -0
- package/node_modules/fs.realpath/README.md +33 -0
- package/node_modules/fs.realpath/index.js +66 -0
- package/node_modules/fs.realpath/old.js +303 -0
- package/node_modules/fs.realpath/package.json +26 -0
- package/node_modules/inflight/LICENSE +15 -0
- package/node_modules/inflight/README.md +37 -0
- package/node_modules/inflight/inflight.js +54 -0
- package/node_modules/inflight/package.json +29 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +33 -0
- package/node_modules/path-is-absolute/index.js +20 -0
- package/node_modules/path-is-absolute/license +21 -0
- package/node_modules/path-is-absolute/package.json +43 -0
- package/node_modules/path-is-absolute/readme.md +59 -0
- package/node_modules/rimraf/CHANGELOG.md +65 -0
- package/node_modules/rimraf/LICENSE +15 -0
- package/node_modules/rimraf/README.md +101 -0
- package/node_modules/rimraf/bin.js +68 -0
- package/node_modules/rimraf/node_modules/glob/LICENSE +21 -0
- package/node_modules/rimraf/node_modules/glob/README.md +378 -0
- package/node_modules/rimraf/node_modules/glob/common.js +238 -0
- package/node_modules/rimraf/node_modules/glob/glob.js +790 -0
- package/node_modules/rimraf/node_modules/glob/package.json +55 -0
- package/node_modules/rimraf/node_modules/glob/sync.js +486 -0
- package/node_modules/rimraf/node_modules/minimatch/LICENSE +15 -0
- package/node_modules/rimraf/node_modules/minimatch/README.md +230 -0
- package/node_modules/rimraf/node_modules/minimatch/minimatch.js +947 -0
- package/node_modules/rimraf/node_modules/minimatch/package.json +33 -0
- package/node_modules/rimraf/package.json +32 -0
- package/node_modules/rimraf/rimraf.js +360 -0
- package/node_modules/stringify-package/CHANGELOG.md +16 -0
- package/node_modules/stringify-package/LICENSE +13 -0
- package/node_modules/stringify-package/README.md +55 -0
- package/node_modules/stringify-package/index.js +18 -0
- package/node_modules/stringify-package/package.json +38 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +29 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/package.json +88 -89
- package/lib/common/definitions/byline.d.ts +0 -4
- package/lib/common/definitions/colors.d.ts +0 -24
- package/lib/common/definitions/marked.d.ts +0 -125
- package/lib/common/definitions/open.d.ts +0 -5
- package/lib/common/definitions/osenv.d.ts +0 -4
- package/lib/common/definitions/plist.d.ts +0 -7
- package/lib/common/definitions/rimraf.d.ts +0 -9
- package/lib/common/definitions/shelljs.d.ts +0 -583
- package/lib/common/definitions/simple-plist.d.ts +0 -7
- package/lib/common/definitions/xmlhttprequest.d.ts +0 -29
- package/lib/controllers/company-insights-controller.js +0 -78
- package/lib/controllers/preview-app-controller.js +0 -251
- package/lib/definitions/company-insights-controller.d.ts +0 -59
- package/lib/definitions/email-validator.d.ts +0 -8
- package/lib/definitions/libnpmconfig.d.ts +0 -3
- package/lib/definitions/npm.d.ts +0 -12
- package/lib/definitions/preview-app-livesync.d.ts +0 -116
- package/lib/services/livesync/playground/devices/preview-devices-service.js +0 -67
- package/lib/services/livesync/playground/preview-app-constants.js +0 -23
- package/lib/services/livesync/playground/preview-app-files-service.js +0 -83
- package/lib/services/livesync/playground/preview-app-log-provider.js +0 -14
- package/lib/services/livesync/playground/preview-app-plugins-service.js +0 -134
- package/lib/services/livesync/playground/preview-qr-code-service.js +0 -109
- package/lib/services/livesync/playground/preview-schema-service.js +0 -57
- package/lib/services/livesync/playground/preview-sdk-service.js +0 -112
- package/lib/services/playground-service.js +0 -65
- package/lib/xml-validator.js +0 -47
|
@@ -24,7 +24,14 @@ const decorators_1 = require("../common/decorators");
|
|
|
24
24
|
const constants_1 = require("../constants");
|
|
25
25
|
const doctor_1 = require("@nativescript/doctor");
|
|
26
26
|
const yok_1 = require("../common/yok");
|
|
27
|
+
const color_1 = require("../color");
|
|
27
28
|
class DoctorService {
|
|
29
|
+
get jsonFileSettingsPath() {
|
|
30
|
+
return path.join(this.$settingsService.getProfileDir(), "doctor-cache.json");
|
|
31
|
+
}
|
|
32
|
+
get $jsonFileSettingsService() {
|
|
33
|
+
return this.$injector.resolve("jsonFileSettingsService", { jsonFileSettingsPath: this.jsonFileSettingsPath });
|
|
34
|
+
}
|
|
28
35
|
constructor($analyticsService, $hostInfo, $logger, $childProcess, $injector, $projectDataService, $fs, $terminalSpinnerService, $versionsService, $settingsService) {
|
|
29
36
|
this.$analyticsService = $analyticsService;
|
|
30
37
|
this.$hostInfo = $hostInfo;
|
|
@@ -37,12 +44,6 @@ class DoctorService {
|
|
|
37
44
|
this.$versionsService = $versionsService;
|
|
38
45
|
this.$settingsService = $settingsService;
|
|
39
46
|
}
|
|
40
|
-
get jsonFileSettingsPath() {
|
|
41
|
-
return path.join(this.$settingsService.getProfileDir(), "doctor-cache.json");
|
|
42
|
-
}
|
|
43
|
-
get $jsonFileSettingsService() {
|
|
44
|
-
return this.$injector.resolve("jsonFileSettingsService", { jsonFileSettingsPath: this.jsonFileSettingsPath });
|
|
45
|
-
}
|
|
46
47
|
printWarnings(configOptions) {
|
|
47
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
48
49
|
configOptions = configOptions || {};
|
|
@@ -67,7 +68,7 @@ class DoctorService {
|
|
|
67
68
|
this.$fs.deleteFile(this.jsonFileSettingsPath);
|
|
68
69
|
}
|
|
69
70
|
else {
|
|
70
|
-
this.$logger.info("No issues were detected."
|
|
71
|
+
this.$logger.info(color_1.color.bold("No issues were detected."));
|
|
71
72
|
yield this.$jsonFileSettingsService.saveSetting(this.getKeyForConfiguration(getInfosData), infos);
|
|
72
73
|
this.printInfosCore(infos);
|
|
73
74
|
}
|
|
@@ -215,7 +216,7 @@ class DoctorService {
|
|
|
215
216
|
infos.map((info) => {
|
|
216
217
|
let message = info.message;
|
|
217
218
|
if (info.type === doctor_1.constants.WARNING_TYPE_NAME) {
|
|
218
|
-
message = `WARNING: ${info.message
|
|
219
|
+
message = `WARNING: ${color_1.color.yellow(info.message)} ${os_1.EOL} ${info.additionalInformation} ${os_1.EOL}`;
|
|
219
220
|
}
|
|
220
221
|
this.$logger.info(message);
|
|
221
222
|
});
|
|
@@ -231,7 +232,7 @@ class DoctorService {
|
|
|
231
232
|
.filter((info) => info.type === doctor_1.constants.WARNING_TYPE_NAME)
|
|
232
233
|
.map((info) => {
|
|
233
234
|
const spinner = this.$terminalSpinnerService.createSpinner();
|
|
234
|
-
spinner.text = `${info.message
|
|
235
|
+
spinner.text = `${color_1.color.yellow(info.message)} ${os_1.EOL} ${info.additionalInformation} ${os_1.EOL}`;
|
|
235
236
|
spinner.fail();
|
|
236
237
|
});
|
|
237
238
|
}
|
|
@@ -23,14 +23,6 @@ const constants = require("../constants");
|
|
|
23
23
|
const helpers_1 = require("../common/helpers");
|
|
24
24
|
const yok_1 = require("../common/yok");
|
|
25
25
|
class ExtensibilityService {
|
|
26
|
-
constructor($fs, $logger, $packageManager, $settingsService, $requireService) {
|
|
27
|
-
this.$fs = $fs;
|
|
28
|
-
this.$logger = $logger;
|
|
29
|
-
this.$packageManager = $packageManager;
|
|
30
|
-
this.$settingsService = $settingsService;
|
|
31
|
-
this.$requireService = $requireService;
|
|
32
|
-
this.customPathToExtensions = null;
|
|
33
|
-
}
|
|
34
26
|
get pathToPackageJson() {
|
|
35
27
|
return path.join(this.pathToExtensions, constants.PACKAGE_JSON_FILE_NAME);
|
|
36
28
|
}
|
|
@@ -41,6 +33,14 @@ class ExtensibilityService {
|
|
|
41
33
|
set pathToExtensions(pathToExtensions) {
|
|
42
34
|
this.customPathToExtensions = pathToExtensions;
|
|
43
35
|
}
|
|
36
|
+
constructor($fs, $logger, $packageManager, $settingsService, $requireService) {
|
|
37
|
+
this.$fs = $fs;
|
|
38
|
+
this.$logger = $logger;
|
|
39
|
+
this.$packageManager = $packageManager;
|
|
40
|
+
this.$settingsService = $settingsService;
|
|
41
|
+
this.$requireService = $requireService;
|
|
42
|
+
this.customPathToExtensions = null;
|
|
43
|
+
}
|
|
44
44
|
installExtension(extensionName) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
this.$logger.trace(`Start installation of extension '${extensionName}'.`);
|
|
@@ -70,6 +70,6 @@ class IOSEntitlementsService {
|
|
|
70
70
|
return this.$pluginsService.getAllInstalledPlugins(projectData);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
exports.IOSEntitlementsService = IOSEntitlementsService;
|
|
74
73
|
IOSEntitlementsService.DefaultEntitlementsName = "app.entitlements";
|
|
74
|
+
exports.IOSEntitlementsService = IOSEntitlementsService;
|
|
75
75
|
yok_1.injector.register("iOSEntitlementsService", IOSEntitlementsService);
|
|
@@ -192,15 +192,15 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
|
|
|
192
192
|
const xcschemeFilePath = path.join(xcschemeDirPath, IOSProjectService.IOS_PROJECT_NAME_PLACEHOLDER +
|
|
193
193
|
constants_2.IosProjectConstants.XcodeSchemeExtName);
|
|
194
194
|
if (this.$fs.exists(xcschemeFilePath)) {
|
|
195
|
-
this.$logger.
|
|
196
|
-
this.$logger.
|
|
195
|
+
this.$logger.trace("Found shared scheme at xcschemeFilePath, renaming to match project name.");
|
|
196
|
+
this.$logger.trace("Checkpoint 0");
|
|
197
197
|
this.replaceFileContent(xcschemeFilePath, projectData);
|
|
198
|
-
this.$logger.
|
|
198
|
+
this.$logger.trace("Checkpoint 1");
|
|
199
199
|
this.replaceFileName(constants_2.IosProjectConstants.XcodeSchemeExtName, xcschemeDirPath, projectData);
|
|
200
|
-
this.$logger.
|
|
200
|
+
this.$logger.trace("Checkpoint 2");
|
|
201
201
|
}
|
|
202
202
|
else {
|
|
203
|
-
this.$logger.
|
|
203
|
+
this.$logger.trace("Copying xcscheme from template not found at " + xcschemeFilePath);
|
|
204
204
|
}
|
|
205
205
|
this.replaceFileName(constants_2.IosProjectConstants.XcodeProjExtName, this.getPlatformData(projectData).projectRoot, projectData);
|
|
206
206
|
const pbxprojFilePath = this.getPbxProjPath(projectData);
|
|
@@ -42,10 +42,10 @@ class IOSProvisionService {
|
|
|
42
42
|
return __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
const match = (yield this.queryProvisioningProfilesAndDevices(projectId))
|
|
44
44
|
.match;
|
|
45
|
-
return (match.
|
|
46
|
-
match.
|
|
47
|
-
match.
|
|
48
|
-
match.
|
|
45
|
+
return (match.eligible.find((prov) => prov.UUID === uuidOrName) ||
|
|
46
|
+
match.eligible.find((prov) => prov.Name === uuidOrName) ||
|
|
47
|
+
match.nonEligible.find((prov) => prov.UUID === uuidOrName) ||
|
|
48
|
+
match.nonEligible.find((prov) => prov.Name === uuidOrName));
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
listProvisions(projectId) {
|
|
@@ -99,12 +99,12 @@ class IOSProvisionService {
|
|
|
99
99
|
]);
|
|
100
100
|
table.push([prov.Entitlements["application-identifier"], "", "", ""]);
|
|
101
101
|
}
|
|
102
|
-
match.
|
|
102
|
+
match.eligible.forEach((prov) => pushProvision(prov));
|
|
103
103
|
this.$logger.info(table.toString());
|
|
104
104
|
this.$logger.info();
|
|
105
105
|
this.$logger.info("There are also " +
|
|
106
|
-
match.
|
|
107
|
-
" non-
|
|
106
|
+
match.nonEligible.length +
|
|
107
|
+
" non-eligible provisioning profiles.");
|
|
108
108
|
this.$logger.info();
|
|
109
109
|
});
|
|
110
110
|
}
|
|
@@ -70,7 +70,7 @@ class IOSWatchAppService {
|
|
|
70
70
|
project.addToHeaderSearchPaths(targetPath, target.pbxNativeTarget.productName);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
exports.IOSWatchAppService = IOSWatchAppService;
|
|
74
73
|
IOSWatchAppService.WATCH_APP_IDENTIFIER = "watchkitapp";
|
|
75
74
|
IOSWatchAppService.WACTCH_EXTENSION_IDENTIFIER = "watchkitextension";
|
|
75
|
+
exports.IOSWatchAppService = IOSWatchAppService;
|
|
76
76
|
yok_1.injector.register("iOSWatchAppService", IOSWatchAppService);
|
|
@@ -19,15 +19,13 @@ exports.IPService = void 0;
|
|
|
19
19
|
const decorators_1 = require("../common/decorators");
|
|
20
20
|
const yok_1 = require("../common/yok");
|
|
21
21
|
class IPService {
|
|
22
|
-
constructor($
|
|
23
|
-
this.$config = $config;
|
|
22
|
+
constructor($httpClient, $logger) {
|
|
24
23
|
this.$httpClient = $httpClient;
|
|
25
24
|
this.$logger = $logger;
|
|
26
25
|
}
|
|
27
26
|
getCurrentIPv4Address() {
|
|
28
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
-
const ipAddress = (yield this.getIPAddressFromServiceReturningJSONWithIPProperty(
|
|
30
|
-
(yield this.getIPAddressFromServiceReturningJSONWithIPProperty("https://api.myip.com")) ||
|
|
28
|
+
const ipAddress = (yield this.getIPAddressFromServiceReturningJSONWithIPProperty("https://api.myip.com")) ||
|
|
31
29
|
(yield this.getIPAddressFromIpifyOrgAPI()) ||
|
|
32
30
|
null;
|
|
33
31
|
return ipAddress;
|
|
@@ -151,8 +151,8 @@ class ITMSTransporterService {
|
|
|
151
151
|
yield this.$fs.unzip(ipaFilePath, destinationDir);
|
|
152
152
|
const payloadDir = path.join(destinationDir, "Payload");
|
|
153
153
|
let allFiles = this.$fs.readDirectory(payloadDir);
|
|
154
|
-
this.$logger.
|
|
155
|
-
allFiles.forEach((f) => this.$logger.
|
|
154
|
+
this.$logger.trace("ITMSTransporter .ipa Payload files:");
|
|
155
|
+
allFiles.forEach((f) => this.$logger.trace(" - " + f));
|
|
156
156
|
allFiles = allFiles.filter((f) => path.extname(f).toLowerCase() === ".app");
|
|
157
157
|
if (allFiles.length > 1) {
|
|
158
158
|
this.$errors.fail("In the .ipa the ITMSTransporter is uploading there is more than one .app file. We don't know which one to upload.");
|
|
@@ -193,6 +193,6 @@ class AndroidDeviceSocketsLiveSyncService extends android_device_livesync_servic
|
|
|
193
193
|
});
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
|
-
exports.AndroidDeviceSocketsLiveSyncService = AndroidDeviceSocketsLiveSyncService;
|
|
197
196
|
AndroidDeviceSocketsLiveSyncService.STATUS_UPDATE_INTERVAL = 10000;
|
|
198
197
|
AndroidDeviceSocketsLiveSyncService.MINIMAL_VERSION_LONG_LIVING_CONNECTION = "0.2.0";
|
|
198
|
+
exports.AndroidDeviceSocketsLiveSyncService = AndroidDeviceSocketsLiveSyncService;
|
|
@@ -14,6 +14,7 @@ const path = require("path");
|
|
|
14
14
|
const _ = require("lodash");
|
|
15
15
|
const crypto = require("crypto");
|
|
16
16
|
const yok_1 = require("../../common/yok");
|
|
17
|
+
const color_1 = require("../../color");
|
|
17
18
|
const PROTOCOL_VERSION_LENGTH_SIZE = 1;
|
|
18
19
|
const PROTOCOL_OPERATION_LENGTH_SIZE = 1;
|
|
19
20
|
const SIZE_BYTE_LENGTH = 1;
|
|
@@ -279,13 +280,12 @@ class AndroidLivesyncTool {
|
|
|
279
280
|
const applicationPid = yield this.$androidProcessService.getAppProcessId(configuration.deviceIdentifier, configuration.appIdentifier);
|
|
280
281
|
if (!applicationPid) {
|
|
281
282
|
this.$logger.trace("In Android LiveSync tool, lastKnownError is: ", lastKnownError);
|
|
282
|
-
this.$logger.info(`Application ${configuration.appIdentifier} is not running on device ${configuration.deviceIdentifier}.`
|
|
283
|
-
|
|
284
|
-
this.$logger.info(`This issue may be caused by:
|
|
283
|
+
this.$logger.info(color_1.color.yellow(`Application ${configuration.appIdentifier} is not running on device ${configuration.deviceIdentifier}.`));
|
|
284
|
+
this.$logger.info(color_1.color.cyan(`This issue may be caused by:
|
|
285
285
|
* crash at startup (try \`tns debug android --debug-brk\` to check why it crashes)
|
|
286
286
|
* different application identifier in your package.json and in your gradle files (check your identifier in \`package.json\` and in all *.gradle files in your App_Resources directory)
|
|
287
287
|
* device is locked
|
|
288
|
-
* manual closing of the application
|
|
288
|
+
* manual closing of the application`));
|
|
289
289
|
reject(new Error(`Application ${configuration.appIdentifier} is not running`));
|
|
290
290
|
}
|
|
291
291
|
else {
|
|
@@ -410,7 +410,6 @@ class AndroidLivesyncTool {
|
|
|
410
410
|
});
|
|
411
411
|
}
|
|
412
412
|
}
|
|
413
|
-
exports.AndroidLivesyncTool = AndroidLivesyncTool;
|
|
414
413
|
AndroidLivesyncTool.DELETE_FILE_OPERATION = 7;
|
|
415
414
|
AndroidLivesyncTool.CREATE_FILE_OPERATION = 8;
|
|
416
415
|
AndroidLivesyncTool.DO_SYNC_OPERATION = 9;
|
|
@@ -424,4 +423,5 @@ AndroidLivesyncTool.APP_PLATFORMS_PATH_MISSING_ERROR = 'You need to provide "app
|
|
|
424
423
|
AndroidLivesyncTool.SOCKET_CONNECTION_ALREADY_EXISTS_ERROR = "Socket connection already exists.";
|
|
425
424
|
AndroidLivesyncTool.SOCKET_CONNECTION_TIMED_OUT_ERROR = "Socket connection timed out.";
|
|
426
425
|
AndroidLivesyncTool.NO_SOCKET_CONNECTION_AVAILABLE_ERROR = "No socket connection available.";
|
|
426
|
+
exports.AndroidLivesyncTool = AndroidLivesyncTool;
|
|
427
427
|
yok_1.injector.register("androidLivesyncTool", AndroidLivesyncTool);
|
|
@@ -17,7 +17,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.IOSDeviceLiveSyncService = void 0;
|
|
19
19
|
const constants = require("../../constants");
|
|
20
|
-
const
|
|
20
|
+
const minimatch_1 = require("minimatch");
|
|
21
21
|
const _ = require("lodash");
|
|
22
22
|
const device_livesync_service_base_1 = require("./device-livesync-service-base");
|
|
23
23
|
const decorators_1 = require("../../common/decorators");
|
|
@@ -94,7 +94,7 @@ class IOSDeviceLiveSyncService extends device_livesync_service_base_1.DeviceLive
|
|
|
94
94
|
let didRefresh = true;
|
|
95
95
|
const localToDevicePaths = liveSyncInfo.modifiedFilesData;
|
|
96
96
|
let scriptRelatedFiles = [];
|
|
97
|
-
constants.LIVESYNC_EXCLUDED_FILE_PATTERNS.forEach((pattern) => (scriptRelatedFiles = _.concat(scriptRelatedFiles, localToDevicePaths.filter((file) => minimatch(file.getDevicePath(), pattern, { nocase: true })))));
|
|
97
|
+
constants.LIVESYNC_EXCLUDED_FILE_PATTERNS.forEach((pattern) => (scriptRelatedFiles = _.concat(scriptRelatedFiles, localToDevicePaths.filter((file) => (0, minimatch_1.minimatch)(file.getDevicePath(), pattern, { nocase: true })))));
|
|
98
98
|
const scriptFiles = _.filter(localToDevicePaths, (localToDevicePath) => _.endsWith(localToDevicePath.getDevicePath(), ".js"));
|
|
99
99
|
const otherFiles = _.difference(localToDevicePaths, _.concat(scriptFiles, scriptRelatedFiles));
|
|
100
100
|
try {
|
|
@@ -22,6 +22,7 @@ const _ = require("lodash");
|
|
|
22
22
|
const constants_1 = require("../../constants");
|
|
23
23
|
const helpers_1 = require("../../common/helpers");
|
|
24
24
|
const decorators_1 = require("../../common/decorators");
|
|
25
|
+
const color_1 = require("../../color");
|
|
25
26
|
class PlatformLiveSyncServiceBase {
|
|
26
27
|
constructor($fs, $logger, $platformsDataService, $projectFilesManager, $devicePathProvider) {
|
|
27
28
|
this.$fs = $fs;
|
|
@@ -165,7 +166,7 @@ class PlatformLiveSyncServiceBase {
|
|
|
165
166
|
logFilesSyncInformation(localToDevicePaths, message, action, deviceIdentifier) {
|
|
166
167
|
if (localToDevicePaths && localToDevicePaths.length < 10) {
|
|
167
168
|
_.each(localToDevicePaths, (file) => {
|
|
168
|
-
action.call(this.$logger, util.format(message, path.basename(file.getLocalPath())
|
|
169
|
+
action.call(this.$logger, util.format(message, color_1.color.yellow(path.basename(file.getLocalPath()))), deviceIdentifier);
|
|
169
170
|
});
|
|
170
171
|
}
|
|
171
172
|
else {
|
|
@@ -13,11 +13,10 @@ const events_1 = require("events");
|
|
|
13
13
|
const _ = require("lodash");
|
|
14
14
|
const yok_1 = require("../common/yok");
|
|
15
15
|
class LogParserService extends events_1.EventEmitter {
|
|
16
|
-
constructor($deviceLogProvider, $errors
|
|
16
|
+
constructor($deviceLogProvider, $errors) {
|
|
17
17
|
super();
|
|
18
18
|
this.$deviceLogProvider = $deviceLogProvider;
|
|
19
19
|
this.$errors = $errors;
|
|
20
|
-
this.$previewAppLogProvider = $previewAppLogProvider;
|
|
21
20
|
this.parseRules = {};
|
|
22
21
|
}
|
|
23
22
|
addParseRule(rule) {
|
|
@@ -29,9 +28,6 @@ class LogParserService extends events_1.EventEmitter {
|
|
|
29
28
|
}
|
|
30
29
|
startParsingLogCore() {
|
|
31
30
|
this.$deviceLogProvider.on(constants_1.DEVICE_LOG_EVENT_NAME, this.processDeviceLogResponse.bind(this));
|
|
32
|
-
this.$previewAppLogProvider.on(constants_1.DEVICE_LOG_EVENT_NAME, (deviceId, message) => {
|
|
33
|
-
this.processDeviceLogResponse(message, deviceId);
|
|
34
|
-
});
|
|
35
31
|
}
|
|
36
32
|
processDeviceLogResponse(message, deviceIdentifier, devicePlatform) {
|
|
37
33
|
const lines = message.split("\n");
|
|
@@ -20,6 +20,9 @@ const helpers_1 = require("../common/helpers");
|
|
|
20
20
|
const constants_1 = require("../constants");
|
|
21
21
|
const yok_1 = require("../common/yok");
|
|
22
22
|
class LogSourceMapService {
|
|
23
|
+
get $platformsDataService() {
|
|
24
|
+
return this.$injector.resolve("platformsDataService");
|
|
25
|
+
}
|
|
23
26
|
constructor($fs, $projectDataService, $injector, $devicePlatformsConstants, $logger) {
|
|
24
27
|
this.$fs = $fs;
|
|
25
28
|
this.$projectDataService = $projectDataService;
|
|
@@ -31,9 +34,6 @@ class LogSourceMapService {
|
|
|
31
34
|
this.getProjectData = _.memoize(this.$projectDataService.getProjectData.bind(this.$projectDataService));
|
|
32
35
|
this.getRuntimeVersion = _.memoize(this.getRuntimeVersionCore, (...args) => args.join(LogSourceMapService.MEMOIZE_FUNCTION_RANDOM_KEY_FOR_JOIN));
|
|
33
36
|
}
|
|
34
|
-
get $platformsDataService() {
|
|
35
|
-
return this.$injector.resolve("platformsDataService");
|
|
36
|
-
}
|
|
37
37
|
setSourceMapConsumerForFile(filePath) {
|
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
39
|
try {
|
|
@@ -42,7 +42,9 @@ class LogSourceMapService {
|
|
|
42
42
|
let sourceMapRaw;
|
|
43
43
|
const source = this.$fs.readText(filePath);
|
|
44
44
|
if (this.$fs.exists(mapFile)) {
|
|
45
|
-
sourceMapRaw = sourceMapConverter.fromMapFileSource(source,
|
|
45
|
+
sourceMapRaw = sourceMapConverter.fromMapFileSource(source, (filename) => {
|
|
46
|
+
return this.$fs.readText(path.join(path.dirname(filePath), filename));
|
|
47
|
+
});
|
|
46
48
|
}
|
|
47
49
|
else {
|
|
48
50
|
sourceMapRaw = sourceMapConverter.fromSource(source);
|
|
@@ -87,7 +89,7 @@ class LogSourceMapService {
|
|
|
87
89
|
outputData +=
|
|
88
90
|
firstPart +
|
|
89
91
|
rawLine
|
|
90
|
-
.
|
|
92
|
+
.substring(lastIndexOfFile)
|
|
91
93
|
.replace(/file:\/\/\/.+?:\d+:\d+/, `${LogSourceMapService.FILE_PREFIX_REPLACEMENT}${sourceFile}:${line}:${column}`) +
|
|
92
94
|
"\n";
|
|
93
95
|
}
|
|
@@ -142,7 +144,8 @@ class LogSourceMapService {
|
|
|
142
144
|
name: platformSpecificName,
|
|
143
145
|
});
|
|
144
146
|
if (this.$fs.exists(path.join(projectData.projectDir, platformSpecificFile))) {
|
|
145
|
-
this.originalFilesLocationCache[sourceFile] =
|
|
147
|
+
this.originalFilesLocationCache[sourceFile] =
|
|
148
|
+
platformSpecificFile;
|
|
146
149
|
}
|
|
147
150
|
else {
|
|
148
151
|
this.originalFilesLocationCache[sourceFile] = sourceFile;
|
|
@@ -221,8 +224,8 @@ class LogSourceMapService {
|
|
|
221
224
|
}
|
|
222
225
|
}
|
|
223
226
|
}
|
|
224
|
-
exports.LogSourceMapService = LogSourceMapService;
|
|
225
227
|
LogSourceMapService.FILE_PREFIX = "file:///";
|
|
226
228
|
LogSourceMapService.FILE_PREFIX_REPLACEMENT = "file: ";
|
|
227
229
|
LogSourceMapService.MEMOIZE_FUNCTION_RANDOM_KEY_FOR_JOIN = "__some_random_value__";
|
|
230
|
+
exports.LogSourceMapService = LogSourceMapService;
|
|
228
231
|
yok_1.injector.register("logSourceMapService", LogSourceMapService);
|
|
@@ -1,25 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
2
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
9
|
exports.NpmConfigService = void 0;
|
|
4
|
-
const npmconfig = require("libnpmconfig");
|
|
5
10
|
const yok_1 = require("../common/yok");
|
|
11
|
+
const child_process_1 = require("child_process");
|
|
12
|
+
const decorators_1 = require("../common/decorators");
|
|
6
13
|
class NpmConfigService {
|
|
7
14
|
constructor() {
|
|
8
15
|
this.config = {};
|
|
9
|
-
this.readConfig();
|
|
10
16
|
}
|
|
11
17
|
getConfig() {
|
|
18
|
+
this.readConfig();
|
|
12
19
|
return this.config;
|
|
13
20
|
}
|
|
14
21
|
readConfig() {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
+
try {
|
|
23
|
+
const res = (0, child_process_1.execSync)("npm config list --json --global");
|
|
24
|
+
const data = JSON.parse(res.toString());
|
|
25
|
+
Object.entries(data).forEach(([key, value]) => {
|
|
26
|
+
this.config[key] =
|
|
27
|
+
typeof value !== "string"
|
|
28
|
+
? value
|
|
29
|
+
: value.replace(/\${([^}]+)}/, (_, envVar) => process.env[envVar]);
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
catch (e) { }
|
|
22
33
|
}
|
|
23
34
|
}
|
|
35
|
+
__decorate([
|
|
36
|
+
(0, decorators_1.cache)()
|
|
37
|
+
], NpmConfigService.prototype, "readConfig", null);
|
|
24
38
|
exports.NpmConfigService = NpmConfigService;
|
|
25
39
|
yok_1.injector.register("npmConfigService", NpmConfigService);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PerformanceService = void 0;
|
|
4
|
-
const
|
|
4
|
+
const os_1 = require("os");
|
|
5
5
|
const helpers_1 = require("../common/helpers");
|
|
6
6
|
const semver = require("semver");
|
|
7
7
|
const _ = require("lodash");
|
|
@@ -64,7 +64,7 @@ class PerformanceService {
|
|
|
64
64
|
methodArgs: JSON.parse(methodArgs),
|
|
65
65
|
};
|
|
66
66
|
try {
|
|
67
|
-
this.$fs.appendFile(filePath, `${JSON.stringify(info)}${EOL}`);
|
|
67
|
+
this.$fs.appendFile(filePath, `${JSON.stringify(info)}${os_1.EOL}`);
|
|
68
68
|
}
|
|
69
69
|
catch (e) {
|
|
70
70
|
this.$logger.trace(PerformanceService.FAIL_LOG_MESSAGE_TEMPLATE, methodInfo);
|
|
@@ -85,8 +85,8 @@ class PerformanceService {
|
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
exports.PerformanceService = PerformanceService;
|
|
89
88
|
PerformanceService.LOG_MESSAGE_TEMPLATE = `Execution of method "%s" took %s ms.`;
|
|
90
89
|
PerformanceService.FAIL_LOG_MESSAGE_TEMPLATE = `Failed to log pefromance data in file for method %s.`;
|
|
91
90
|
PerformanceService.MIN_NODE_PERFORMANCE_MODULE_VERSION = "8.5.0";
|
|
91
|
+
exports.PerformanceService = PerformanceService;
|
|
92
92
|
yok_1.injector.register("performanceService", PerformanceService);
|
|
@@ -74,7 +74,7 @@ class PlatformEnvironmentRequirements {
|
|
|
74
74
|
win32: "windows",
|
|
75
75
|
darwin: "macos",
|
|
76
76
|
}[process.platform];
|
|
77
|
-
const anchor = platform ? `#${os}-${platform.toLowerCase()}` :
|
|
77
|
+
const anchor = platform ? `#${os}-${platform.toLowerCase()}` : "";
|
|
78
78
|
return (`Verify that your environment is configured according to the system requirements described at\n` +
|
|
79
79
|
`https://docs.nativescript.org/environment-setup.html${anchor}.`);
|
|
80
80
|
}
|
|
@@ -17,7 +17,22 @@ const constants = require("../constants");
|
|
|
17
17
|
const _ = require("lodash");
|
|
18
18
|
const yok_1 = require("../common/yok");
|
|
19
19
|
const package_path_helper_1 = require("../helpers/package-path-helper");
|
|
20
|
+
const color_1 = require("../color");
|
|
20
21
|
class PluginsService {
|
|
22
|
+
get $platformsDataService() {
|
|
23
|
+
return this.$injector.resolve("platformsDataService");
|
|
24
|
+
}
|
|
25
|
+
get $projectDataService() {
|
|
26
|
+
return this.$injector.resolve("projectDataService");
|
|
27
|
+
}
|
|
28
|
+
get npmInstallOptions() {
|
|
29
|
+
return _.merge({
|
|
30
|
+
disableNpmInstall: this.$options.disableNpmInstall,
|
|
31
|
+
frameworkPath: this.$options.frameworkPath,
|
|
32
|
+
ignoreScripts: this.$options.ignoreScripts,
|
|
33
|
+
path: this.$options.path,
|
|
34
|
+
}, PluginsService.NPM_CONFIG);
|
|
35
|
+
}
|
|
21
36
|
constructor($packageManager, $fs, $options, $logger, $errors, $filesHashService, $injector, $mobileHelper, $nodeModulesDependenciesBuilder) {
|
|
22
37
|
this.$packageManager = $packageManager;
|
|
23
38
|
this.$fs = $fs;
|
|
@@ -36,20 +51,6 @@ class PluginsService {
|
|
|
36
51
|
return key;
|
|
37
52
|
});
|
|
38
53
|
}
|
|
39
|
-
get $platformsDataService() {
|
|
40
|
-
return this.$injector.resolve("platformsDataService");
|
|
41
|
-
}
|
|
42
|
-
get $projectDataService() {
|
|
43
|
-
return this.$injector.resolve("projectDataService");
|
|
44
|
-
}
|
|
45
|
-
get npmInstallOptions() {
|
|
46
|
-
return _.merge({
|
|
47
|
-
disableNpmInstall: this.$options.disableNpmInstall,
|
|
48
|
-
frameworkPath: this.$options.frameworkPath,
|
|
49
|
-
ignoreScripts: this.$options.ignoreScripts,
|
|
50
|
-
path: this.$options.path,
|
|
51
|
-
}, PluginsService.NPM_CONFIG);
|
|
52
|
-
}
|
|
53
54
|
add(plugin, projectData) {
|
|
54
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
55
56
|
yield this.ensure(projectData);
|
|
@@ -219,10 +220,10 @@ class PluginsService {
|
|
|
219
220
|
const dependencyOccurrencesGroupedByVersion = _.groupBy(dependencyOccurrences, (g) => g.version);
|
|
220
221
|
const versions = _.keys(dependencyOccurrencesGroupedByVersion);
|
|
221
222
|
if (versions.length === 1) {
|
|
222
|
-
this.$logger.
|
|
223
|
+
this.$logger.trace(`Detected same versions (${_.first(versions)}) of the ${dependencyName} installed at locations: ${_.map(dependencyOccurrences, (d) => d.directory).join(", ")}`);
|
|
223
224
|
}
|
|
224
225
|
else {
|
|
225
|
-
this.$logger.
|
|
226
|
+
this.$logger.trace(`Detected different versions of the ${dependencyName} installed at locations: ${_.map(dependencyOccurrences, (d) => d.directory).join(", ")}\nThis can cause build failures.`);
|
|
226
227
|
}
|
|
227
228
|
}
|
|
228
229
|
});
|
|
@@ -258,8 +259,7 @@ class PluginsService {
|
|
|
258
259
|
if (versions.length === 1) {
|
|
259
260
|
this.$logger.warn(`Detected the framework ${frameworkName} is installed multiple times from the same versions of plugin (${_.first(versions)}) at locations: ${_.map(dependencyOccurrences, (d) => d.directory).join(", ")}`);
|
|
260
261
|
const selectedPackage = _.minBy(dependencyOccurrences, (d) => d.depth);
|
|
261
|
-
this.$logger.info(`CLI will use only the native code from '${selectedPackage.directory}'.`
|
|
262
|
-
.green);
|
|
262
|
+
this.$logger.info(color_1.color.green(`CLI will use only the native code from '${selectedPackage.directory}'.`));
|
|
263
263
|
_.each(dependencyOccurrences, (dependency) => {
|
|
264
264
|
if (dependency !== selectedPackage) {
|
|
265
265
|
productionDependencies.splice(productionDependencies.indexOf(dependency), 1);
|
|
@@ -449,7 +449,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
449
449
|
this.$fs.writeJson(opts.pathToPluginsBuildFile, opts.allPluginsNativeHashes);
|
|
450
450
|
}
|
|
451
451
|
}
|
|
452
|
-
exports.PluginsService = PluginsService;
|
|
453
452
|
PluginsService.INSTALL_COMMAND_NAME = "install";
|
|
454
453
|
PluginsService.UNINSTALL_COMMAND_NAME = "uninstall";
|
|
455
454
|
PluginsService.NPM_CONFIG = {
|
|
@@ -461,4 +460,5 @@ PluginsService.LOCK_FILES = [
|
|
|
461
460
|
"yarn.lock",
|
|
462
461
|
"pnpm-lock.yaml",
|
|
463
462
|
];
|
|
463
|
+
exports.PluginsService = PluginsService;
|
|
464
464
|
yok_1.injector.register("pluginsService", PluginsService);
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ProjectBackupService = void 0;
|
|
4
4
|
const yok_1 = require("../common/yok");
|
|
5
5
|
const path = require("path");
|
|
6
|
+
const color_1 = require("../color");
|
|
6
7
|
class ProjectBackupService {
|
|
7
8
|
constructor($fs, $logger, $projectHelper) {
|
|
8
9
|
this.$fs = $fs;
|
|
@@ -21,7 +22,6 @@ class ProjectBackupService {
|
|
|
21
22
|
return backup.restore();
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
exports.ProjectBackupService = ProjectBackupService;
|
|
25
25
|
ProjectBackupService.Backup = class Backup {
|
|
26
26
|
constructor($super, name, pathsToBackup = [], basePath = $super.$projectHelper.projectDir) {
|
|
27
27
|
this.$super = $super;
|
|
@@ -41,7 +41,7 @@ ProjectBackupService.Backup = class Backup {
|
|
|
41
41
|
const sourcePath = path.resolve(this.basePath, pathToBackup);
|
|
42
42
|
const targetPath = path.resolve(this.backupDir, pathToBackup);
|
|
43
43
|
if (this.$super.$fs.exists(sourcePath)) {
|
|
44
|
-
this.$super.$logger.trace(`BACKING UP ${
|
|
44
|
+
this.$super.$logger.trace(`BACKING UP ${color_1.color.cyan(sourcePath)} -> ${color_1.color.green(targetPath)}`);
|
|
45
45
|
this.$super.$fs.copyFile(sourcePath, targetPath);
|
|
46
46
|
backedUpPaths.push(pathToBackup);
|
|
47
47
|
}
|
|
@@ -60,7 +60,7 @@ ProjectBackupService.Backup = class Backup {
|
|
|
60
60
|
for (const pathToBackup of backupData.paths) {
|
|
61
61
|
const sourcePath = path.resolve(this.backupDir, pathToBackup);
|
|
62
62
|
const targetPath = path.resolve(this.basePath, pathToBackup);
|
|
63
|
-
this.$super.$logger.trace(`RESTORING ${
|
|
63
|
+
this.$super.$logger.trace(`RESTORING ${color_1.color.green(sourcePath)} -> ${color_1.color.cyan(targetPath)}`);
|
|
64
64
|
if (this.$super.$fs.exists(sourcePath)) {
|
|
65
65
|
this.$super.$fs.copyFile(sourcePath, targetPath);
|
|
66
66
|
}
|
|
@@ -110,4 +110,5 @@ ProjectBackupService.Backup = class Backup {
|
|
|
110
110
|
return this.$super.$fs.readJson(backupJSONPath);
|
|
111
111
|
}
|
|
112
112
|
};
|
|
113
|
+
exports.ProjectBackupService = ProjectBackupService;
|
|
113
114
|
yok_1.injector.register("projectBackupService", ProjectBackupService);
|
|
@@ -12,6 +12,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
12
12
|
exports.ProjectCleanupService = void 0;
|
|
13
13
|
const yok_1 = require("../common/yok");
|
|
14
14
|
const path = require("path");
|
|
15
|
+
const color_1 = require("../color");
|
|
15
16
|
class ProjectCleanupService {
|
|
16
17
|
constructor($fs, $logger, $projectHelper, $terminalSpinnerService) {
|
|
17
18
|
this.$fs = $fs;
|
|
@@ -49,7 +50,7 @@ class ProjectCleanupService {
|
|
|
49
50
|
var _a;
|
|
50
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
51
52
|
const dryRun = (_a = options === null || options === void 0 ? void 0 : options.dryRun) !== null && _a !== void 0 ? _a : false;
|
|
52
|
-
const logPrefix = dryRun ? "(dry run) "
|
|
53
|
+
const logPrefix = dryRun ? color_1.color.grey("(dry run) ") : "";
|
|
53
54
|
this.spinner.clear();
|
|
54
55
|
let fileType;
|
|
55
56
|
if (!pathToClean || pathToClean.trim().length === 0) {
|
|
@@ -57,7 +58,7 @@ class ProjectCleanupService {
|
|
|
57
58
|
return { ok: true };
|
|
58
59
|
}
|
|
59
60
|
const filePath = path.resolve(this.$projectHelper.projectDir, pathToClean);
|
|
60
|
-
const displayPath = `${path.relative(this.$projectHelper.projectDir, filePath)}
|
|
61
|
+
const displayPath = color_1.color.yellow(`${path.relative(this.$projectHelper.projectDir, filePath)}`);
|
|
61
62
|
this.$logger.trace(`${logPrefix}Trying to clean '${filePath}'`);
|
|
62
63
|
if (this.$fs.exists(filePath)) {
|
|
63
64
|
const stat = this.$fs.getFsStats(filePath);
|
|
@@ -80,7 +81,7 @@ class ProjectCleanupService {
|
|
|
80
81
|
this.spinner.succeed(`${logPrefix}Cleaned ${fileType} ${displayPath}`);
|
|
81
82
|
}
|
|
82
83
|
else {
|
|
83
|
-
const message = `Failed to Clean ${fileType}
|
|
84
|
+
const message = color_1.color.red(`Failed to Clean ${fileType}`);
|
|
84
85
|
this.spinner.fail(`${logPrefix}${message} ${displayPath}`);
|
|
85
86
|
}
|
|
86
87
|
if (options === null || options === void 0 ? void 0 : options.stats) {
|
|
@@ -144,11 +144,11 @@ class TestExecutionService {
|
|
|
144
144
|
karmaConfig.debugBrk = this.$options.debugBrk;
|
|
145
145
|
karmaConfig.appPath = projectData.getAppDirectoryRelativePath();
|
|
146
146
|
karmaConfig.platform = platform.toLowerCase();
|
|
147
|
-
this.$logger.
|
|
147
|
+
this.$logger.trace(JSON.stringify(karmaConfig, null, 4));
|
|
148
148
|
return karmaConfig;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
exports.TestExecutionService = TestExecutionService;
|
|
152
151
|
TestExecutionService.CONFIG_FILE_NAME = `node_modules/${constants.TEST_RUNNER_NAME}/config.js`;
|
|
153
152
|
TestExecutionService.SOCKETIO_JS_FILE_NAME = `node_modules/${constants.TEST_RUNNER_NAME}/socket.io.js`;
|
|
153
|
+
exports.TestExecutionService = TestExecutionService;
|
|
154
154
|
yok_1.injector.register("testExecutionService", TestExecutionService);
|
|
@@ -11,6 +11,7 @@ const decorators_1 = require("../common/decorators");
|
|
|
11
11
|
const yok_1 = require("../common/yok");
|
|
12
12
|
const path = require("path");
|
|
13
13
|
const nativescript_cli_1 = require("../nativescript-cli");
|
|
14
|
+
const color_1 = require("../color");
|
|
14
15
|
const TIMELINE_LOG_RE = /Timeline:\s*(\d*.?\d*ms:\s*)?([^\:]*\:)?(.*)\((\d*.?\d*)ms\.?\s*-\s*(\d*.\d*)ms\.?\)/;
|
|
15
16
|
var ChromeTraceEventPhase;
|
|
16
17
|
(function (ChromeTraceEventPhase) {
|
|
@@ -85,8 +86,10 @@ class TimelineProfilerService {
|
|
|
85
86
|
this.timelines.forEach((deviceTimeline, deviceIdentifier) => {
|
|
86
87
|
const deviceTimelineFileName = `timeline-${deviceIdentifier}.json`;
|
|
87
88
|
this.$fs.writeJson(path.resolve(process.cwd(), deviceTimelineFileName), deviceTimeline.timeline);
|
|
88
|
-
this.$logger.info(`Timeline data for device ${deviceIdentifier} written to ${deviceTimelineFileName}`);
|
|
89
|
+
this.$logger.info(`Timeline data for device ${color_1.color.cyan(deviceIdentifier)} written to ${color_1.color.green(deviceTimelineFileName)}`);
|
|
89
90
|
});
|
|
91
|
+
this.$logger.info(color_1.color.green("\n\nTo view the timeline data, open the following URL in Chrome, and load the json file:"));
|
|
92
|
+
this.$logger.info(color_1.color.green("devtools://devtools/bundled/inspector.html?panel=timeline\n\n"));
|
|
90
93
|
process.exit();
|
|
91
94
|
}
|
|
92
95
|
}
|