nativescript 8.8.0 → 8.8.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/test-deps-versions-generated.json +1 -1
- package/lib/android-tools-info.js +12 -0
- package/lib/base-package-manager.js +11 -1
- package/lib/bootstrap.js +5 -1
- package/lib/bun-package-manager.js +17 -1
- package/lib/color.js +3 -0
- package/lib/commands/add-platform.js +1 -0
- package/lib/commands/apple-login.js +1 -0
- package/lib/commands/appstore-list.js +1 -0
- package/lib/commands/appstore-upload.js +4 -0
- package/lib/commands/build.js +3 -2
- package/lib/commands/clean.js +22 -1
- package/lib/commands/command-base.js +1 -0
- package/lib/commands/config.js +3 -0
- package/lib/commands/create-project.js +6 -0
- package/lib/commands/debug.js +6 -1
- package/lib/commands/deploy.js +3 -2
- package/lib/commands/embedding/embed.js +7 -0
- package/lib/commands/extensibility/install-extension.js +1 -0
- package/lib/commands/extensibility/list-extensions.js +1 -0
- package/lib/commands/extensibility/uninstall-extension.js +1 -0
- package/lib/commands/fonts.js +1 -0
- package/lib/commands/generate-assets.js +1 -0
- package/lib/commands/generate-help.js +1 -0
- package/lib/commands/generate.js +12 -2
- package/lib/commands/info.js +1 -0
- package/lib/commands/install.js +1 -0
- package/lib/commands/list-platforms.js +1 -0
- package/lib/commands/migrate.js +1 -0
- package/lib/commands/native-add.js +5 -0
- package/lib/commands/platform-clean.js +1 -0
- package/lib/commands/plugin/add-plugin.js +1 -0
- package/lib/commands/plugin/build-plugin.js +1 -0
- package/lib/commands/plugin/create-plugin.js +5 -0
- package/lib/commands/plugin/list-plugins.js +1 -0
- package/lib/commands/plugin/remove-plugin.js +2 -0
- package/lib/commands/plugin/update-plugin.js +1 -0
- package/lib/commands/post-install.js +6 -0
- package/lib/commands/prepare.js +4 -3
- package/lib/commands/preview.js +2 -0
- package/lib/commands/remove-platform.js +1 -0
- package/lib/commands/resources/resources-update.js +2 -0
- package/lib/commands/run.js +1 -0
- package/lib/commands/setup.js +1 -0
- package/lib/commands/start.js +1 -0
- package/lib/commands/test-init.js +4 -0
- package/lib/commands/test.js +9 -2
- package/lib/commands/typings.js +2 -1
- package/lib/commands/update-platform.js +5 -0
- package/lib/commands/update.js +2 -0
- package/lib/common/bootstrap.js +1 -0
- package/lib/common/child-process.js +3 -0
- package/lib/common/codeGeneration/code-entity.js +1 -0
- package/lib/common/codeGeneration/code-printer.js +1 -0
- package/lib/common/command-params.js +1 -0
- package/lib/common/commands/analytics.js +3 -0
- package/lib/common/commands/autocompletion.js +3 -0
- package/lib/common/commands/device/device-log-stream.js +1 -0
- package/lib/common/commands/device/get-file.js +2 -0
- package/lib/common/commands/device/list-applications.js +1 -0
- package/lib/common/commands/device/list-devices.js +3 -0
- package/lib/common/commands/device/list-files.js +2 -0
- package/lib/common/commands/device/put-file.js +2 -0
- package/lib/common/commands/device/run-application.js +1 -0
- package/lib/common/commands/device/stop-application.js +1 -0
- package/lib/common/commands/device/uninstall-application.js +1 -0
- package/lib/common/commands/doctor.js +3 -2
- package/lib/common/commands/generate-messages.js +1 -0
- package/lib/common/commands/help.js +1 -0
- package/lib/common/commands/package-manager-get.js +1 -0
- package/lib/common/commands/package-manager-set.js +1 -0
- package/lib/common/commands/post-install.js +1 -0
- package/lib/common/commands/preuninstall.js +11 -2
- package/lib/common/commands/proxy/proxy-base.js +4 -0
- package/lib/common/commands/proxy/proxy-clear.js +1 -0
- package/lib/common/commands/proxy/proxy-get.js +1 -0
- package/lib/common/commands/proxy/proxy-set.js +1 -0
- package/lib/common/common-lib.js +1 -0
- package/lib/common/constants.js +11 -0
- package/lib/common/decorators.js +48 -0
- package/lib/common/dispatchers.js +10 -1
- package/lib/common/errors.js +13 -3
- package/lib/common/file-system.js +13 -2
- package/lib/common/header.js +3 -0
- package/lib/common/helpers.js +89 -3
- package/lib/common/host-info.js +4 -0
- package/lib/common/http-client.js +20 -0
- package/lib/common/logger/appenders/cli-appender.js +4 -0
- package/lib/common/logger/appenders/emit-appender.js +4 -0
- package/lib/common/logger/layouts/cli-layout.js +1 -0
- package/lib/common/logger/logger.js +5 -0
- package/lib/common/messages/messages.js +6 -0
- package/lib/common/mobile/android/android-application-manager.js +20 -1
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -0
- package/lib/common/mobile/android/android-debug-bridge.js +6 -0
- package/lib/common/mobile/android/android-device-file-system.js +4 -0
- package/lib/common/mobile/android/android-device-hash-service.js +3 -0
- package/lib/common/mobile/android/android-device.js +8 -0
- package/lib/common/mobile/android/android-emulator-services.js +2 -1
- package/lib/common/mobile/android/android-ini-file-parser.js +9 -0
- package/lib/common/mobile/android/android-log-filter.js +4 -0
- package/lib/common/mobile/android/android-virtual-device-service.js +30 -1
- package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
- package/lib/common/mobile/android/genymotion/genymotion-service.js +5 -0
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
- package/lib/common/mobile/android/logcat-helper.js +13 -0
- package/lib/common/mobile/application-manager-base.js +6 -0
- package/lib/common/mobile/device-emitter.js +4 -0
- package/lib/common/mobile/device-log-emitter.js +1 -0
- package/lib/common/mobile/device-log-provider-base.js +1 -0
- package/lib/common/mobile/device-log-provider.js +23 -0
- package/lib/common/mobile/device-platforms-constants.js +1 -0
- package/lib/common/mobile/emulator-helper.js +4 -0
- package/lib/common/mobile/ios/device/ios-application-manager.js +3 -0
- package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -0
- package/lib/common/mobile/ios/device/ios-device-operations.js +4 -0
- package/lib/common/mobile/ios/device/ios-device.js +4 -0
- package/lib/common/mobile/ios/ios-device-base.js +1 -0
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +2 -0
- package/lib/common/mobile/ios/ios-log-filter.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +4 -0
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +6 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +5 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +1 -0
- package/lib/common/mobile/local-to-device-path-data-factory.js +1 -0
- package/lib/common/mobile/log-filter.js +2 -0
- package/lib/common/mobile/logging-levels.js +1 -0
- package/lib/common/mobile/mobile-core/android-device-discovery.js +2 -0
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +3 -0
- package/lib/common/mobile/mobile-core/android-process-service.js +32 -0
- package/lib/common/mobile/mobile-core/device-discovery.js +1 -0
- package/lib/common/mobile/mobile-core/devices-service.js +69 -0
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +2 -0
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
- package/lib/common/mobile/mobile-helper.js +1 -0
- package/lib/common/mobile/wp8/wp8-emulator-services.js +1 -0
- package/lib/common/opener.js +1 -0
- package/lib/common/os-info.js +1 -0
- package/lib/common/plist-parser.js +1 -0
- package/lib/common/project-helper.js +1 -0
- package/lib/common/prompter.js +9 -1
- package/lib/common/queue.js +1 -0
- package/lib/common/resource-loader.js +1 -0
- package/lib/common/services/auto-completion-service.js +13 -1
- package/lib/common/services/cancellation.js +2 -1
- package/lib/common/services/commands-service.js +17 -6
- package/lib/common/services/help-service.js +11 -3
- package/lib/common/services/hooks-service.js +13 -0
- package/lib/common/services/ios-notification-service.js +1 -0
- package/lib/common/services/json-file-settings-service.js +6 -0
- package/lib/common/services/lock-service.js +6 -0
- package/lib/common/services/message-contract-generator.js +1 -0
- package/lib/common/services/messages-service.js +1 -0
- package/lib/common/services/micro-templating-service.js +6 -0
- package/lib/common/services/net-service.js +3 -0
- package/lib/common/services/project-files-manager.js +5 -0
- package/lib/common/services/project-files-provider-base.js +1 -0
- package/lib/common/services/proxy-service.js +1 -0
- package/lib/common/services/qr.js +1 -0
- package/lib/common/services/settings-service.js +1 -0
- package/lib/common/services/xcode-select-service.js +1 -0
- package/lib/common/utils.js +1 -0
- package/lib/common/validators/project-name-validator.js +1 -0
- package/lib/common/validators/validation-result.js +1 -0
- package/lib/common/verify-node-version.js +8 -1
- package/lib/common/yok.js +32 -11
- package/lib/config.js +22 -1
- package/lib/constants-provider.js +1 -0
- package/lib/constants.js +53 -0
- package/lib/controllers/build-controller.js +4 -3
- package/lib/controllers/debug-controller.js +8 -3
- package/lib/controllers/deploy-controller.js +1 -0
- package/lib/controllers/migrate-controller.js +91 -3
- package/lib/controllers/platform-controller.js +9 -1
- package/lib/controllers/prepare-controller.js +17 -4
- package/lib/controllers/run-controller.js +17 -1
- package/lib/controllers/update-controller-base.js +1 -0
- package/lib/controllers/update-controller.js +11 -0
- package/lib/data/build-data.js +1 -0
- package/lib/data/controller-data-base.js +1 -0
- package/lib/data/debug-data.js +1 -0
- package/lib/data/platform-data.js +1 -0
- package/lib/data/prepare-data.js +1 -0
- package/lib/data/run-data.js +1 -0
- package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
- package/lib/detached-processes/cleanup-process.js +18 -14
- package/lib/detached-processes/file-log-service.js +2 -1
- package/lib/device-path-provider.js +1 -0
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +7 -0
- package/lib/device-sockets/ios/notification.js +3 -0
- package/lib/device-sockets/ios/socket-request-executor.js +3 -0
- package/lib/helpers/android-bundle-validator-helper.js +2 -1
- package/lib/helpers/deploy-command-helper.js +1 -0
- package/lib/helpers/key-command-helper.js +4 -2
- package/lib/helpers/livesync-command-helper.js +4 -1
- package/lib/helpers/network-connectivity-validator.js +1 -0
- package/lib/helpers/options-track-helper.js +3 -2
- package/lib/helpers/package-path-helper.js +1 -0
- package/lib/helpers/platform-command-helper.js +7 -2
- package/lib/helpers/version-validator-helper.js +1 -0
- package/lib/key-commands/bootstrap.js +3 -2
- package/lib/key-commands/index.js +5 -4
- package/lib/nativescript-cli-lib-bootstrap.js +4 -0
- package/lib/nativescript-cli-lib.js +1 -0
- package/lib/nativescript-cli.js +10 -1
- package/lib/node/pbxproj-dom-xcode.js +1 -0
- package/lib/node/xcode.js +1 -0
- package/lib/node-package-manager.js +11 -1
- package/lib/options.js +143 -118
- package/lib/package-installation-manager.js +8 -1
- package/lib/package-manager.js +2 -0
- package/lib/platform-command-param.js +1 -0
- package/lib/pnpm-package-manager.js +4 -1
- package/lib/project-data.js +12 -0
- package/lib/providers/project-files-provider.js +1 -0
- package/lib/resolvers/livesync-service-resolver.js +1 -0
- package/lib/services/analytics/analytics-broker-process.js +10 -6
- package/lib/services/analytics/analytics-broker.js +2 -1
- package/lib/services/analytics/analytics-service.js +29 -25
- package/lib/services/analytics/google-analytics-provider.js +13 -12
- package/lib/services/analytics-settings-service.js +5 -0
- package/lib/services/android/android-bundle-tool-service.js +1 -0
- package/lib/services/android/gradle-build-args-service.js +3 -0
- package/lib/services/android/gradle-build-service.js +1 -0
- package/lib/services/android/gradle-command-service.js +6 -1
- package/lib/services/android-device-debug-service.js +6 -0
- package/lib/services/android-plugin-build-service.js +33 -1
- package/lib/services/android-project-service.js +71 -4
- package/lib/services/android-resources-migration-service.js +7 -0
- package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
- package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
- package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
- package/lib/services/assets-generation/assets-generation-service.js +16 -5
- package/lib/services/build-artifacts-service.js +2 -1
- package/lib/services/build-data-service.js +1 -0
- package/lib/services/build-info-file-service.js +1 -0
- package/lib/services/cleanup-service.js +13 -9
- package/lib/services/cocoapods-platform-manager.js +9 -0
- package/lib/services/cocoapods-service.js +21 -1
- package/lib/services/debug-data-service.js +1 -0
- package/lib/services/debug-service-base.js +7 -0
- package/lib/services/device/device-install-app-service.js +2 -1
- package/lib/services/doctor-service.js +21 -6
- package/lib/services/extensibility-service.js +8 -0
- package/lib/services/files-hash-service.js +1 -0
- package/lib/services/hmr-status-service.js +2 -0
- package/lib/services/info-service.js +1 -0
- package/lib/services/initialize-service.js +5 -1
- package/lib/services/ios/export-options-plist-service.js +4 -0
- package/lib/services/ios/ios-signing-service.js +4 -0
- package/lib/services/ios/spm-service.js +9 -0
- package/lib/services/ios/xcodebuild-args-service.js +9 -0
- package/lib/services/ios/xcodebuild-command-service.js +1 -0
- package/lib/services/ios/xcodebuild-service.js +1 -0
- package/lib/services/ios-debugger-port-service.js +1 -0
- package/lib/services/ios-device-debug-service.js +1 -0
- package/lib/services/ios-entitlements-service.js +1 -0
- package/lib/services/ios-extensions-service.js +1 -0
- package/lib/services/ios-log-filter.js +20 -0
- package/lib/services/ios-native-target-service.js +6 -4
- package/lib/services/ios-project-service.js +94 -2
- package/lib/services/ios-provision-service.js +3 -0
- package/lib/services/ios-watch-app-service.js +1 -0
- package/lib/services/ip-service.js +2 -0
- package/lib/services/itmstransporter-service.js +1 -0
- package/lib/services/karma-execution.js +2 -0
- package/lib/services/livesync/android-device-livesync-service-base.js +1 -0
- package/lib/services/livesync/android-device-livesync-service.js +2 -0
- package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -0
- package/lib/services/livesync/android-livesync-service.js +1 -0
- package/lib/services/livesync/android-livesync-tool.js +4 -0
- package/lib/services/livesync/device-livesync-service-base.js +2 -0
- package/lib/services/livesync/ios-device-livesync-service.js +7 -0
- package/lib/services/livesync/ios-livesync-service.js +2 -0
- package/lib/services/livesync/livesync-socket.js +1 -0
- package/lib/services/livesync/platform-livesync-service-base.js +5 -0
- package/lib/services/livesync-process-data-service.js +1 -0
- package/lib/services/log-parser-service.js +1 -0
- package/lib/services/log-source-map-service.js +15 -0
- package/lib/services/marking-mode-service.js +8 -5
- package/lib/services/metadata-filtering-service.js +1 -0
- package/lib/services/npm-config-service.js +4 -0
- package/lib/services/pacote-service.js +7 -0
- package/lib/services/performance-service.js +3 -1
- package/lib/services/platform/add-platform-service.js +49 -2
- package/lib/services/platform/platform-validation-service.js +1 -0
- package/lib/services/platform/prepare-native-platform-service.js +5 -2
- package/lib/services/platform-environment-requirements.js +8 -3
- package/lib/services/platform-project-service-base.js +1 -0
- package/lib/services/platforms-data-service.js +1 -0
- package/lib/services/plugins-service.js +20 -2
- package/lib/services/prepare-data-service.js +1 -0
- package/lib/services/project-backup-service.js +4 -0
- package/lib/services/project-changes-service.js +14 -3
- package/lib/services/project-cleanup-service.js +2 -0
- package/lib/services/project-config-service.js +22 -2
- package/lib/services/project-data-service.js +36 -7
- package/lib/services/project-name-service.js +1 -0
- package/lib/services/project-service.js +10 -0
- package/lib/services/project-templates-service.js +3 -2
- package/lib/services/qr-code-terminal-service.js +1 -0
- package/lib/services/require-service.js +1 -0
- package/lib/services/start-service.js +1 -0
- package/lib/services/temp-service.js +1 -0
- package/lib/services/terminal-spinner-service.js +2 -0
- package/lib/services/test-execution-service.js +9 -2
- package/lib/services/test-initialization-service.js +4 -0
- package/lib/services/timeline-profiler-service.js +1 -0
- package/lib/services/user-settings-service.js +1 -0
- package/lib/services/versions-service.js +6 -4
- package/lib/services/watch-ignore-list-service.js +1 -0
- package/lib/services/webpack/webpack-compiler-service.js +42 -1
- package/lib/services/xcconfig-service.js +2 -0
- package/lib/services/xcproj-service.js +1 -0
- package/lib/shared-event-bus.js +6 -0
- package/lib/sys-info.js +2 -1
- package/lib/tools/config-manipulation/config-transformer.js +12 -0
- package/lib/tools/node-modules/node-modules-builder.js +1 -0
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
- package/lib/yarn-package-manager.js +1 -0
- package/lib/yarn2-package-manager.js +3 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +15 -0
- package/node_modules/rimraf/CHANGELOG.md +65 -0
- package/node_modules/stringify-package/CHANGELOG.md +16 -0
- package/package.json +2 -2
|
@@ -32,6 +32,7 @@ class IOSDeviceDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
32
32
|
return;
|
|
33
33
|
}
|
|
34
34
|
if (this.$mobileHelper.isvisionOSPlatform(options.platform)) {
|
|
35
|
+
// look for ios devices - same logic.
|
|
35
36
|
options.platform = this.$devicePlatformsConstants.iOS;
|
|
36
37
|
}
|
|
37
38
|
yield this.$iosDeviceOperations.startLookingForDevices((deviceInfo) => {
|
|
@@ -61,3 +62,4 @@ class IOSDeviceDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
61
62
|
}
|
|
62
63
|
exports.IOSDeviceDiscovery = IOSDeviceDiscovery;
|
|
63
64
|
yok_1.injector.register("iOSDeviceDiscovery", IOSDeviceDiscovery);
|
|
65
|
+
//# sourceMappingURL=ios-device-discovery.js.map
|
|
@@ -40,12 +40,14 @@ class IOSSimulatorDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
41
|
if (this.$hostInfo.isDarwin) {
|
|
42
42
|
const currentSimulators = yield this.$iOSSimResolver.iOSSim.getRunningSimulators();
|
|
43
|
+
// Remove old simulators
|
|
43
44
|
_(this.cachedSimulators)
|
|
44
45
|
.reject((s) => _.some(currentSimulators, (simulator) => simulator &&
|
|
45
46
|
s &&
|
|
46
47
|
simulator.id === s.id &&
|
|
47
48
|
simulator.state === s.state))
|
|
48
49
|
.each((s) => this.deleteAndRemoveDevice(s));
|
|
50
|
+
// Add new simulators
|
|
49
51
|
_(currentSimulators)
|
|
50
52
|
.reject((s) => _.some(this.cachedSimulators, (simulator) => simulator &&
|
|
51
53
|
s &&
|
|
@@ -107,3 +109,4 @@ class IOSSimulatorDiscovery extends device_discovery_1.DeviceDiscovery {
|
|
|
107
109
|
}
|
|
108
110
|
exports.IOSSimulatorDiscovery = IOSSimulatorDiscovery;
|
|
109
111
|
yok_1.injector.register("iOSSimulatorDiscovery", IOSSimulatorDiscovery);
|
|
112
|
+
//# sourceMappingURL=ios-simulator-discovery.js.map
|
|
@@ -80,3 +80,4 @@ class Wp8EmulatorServices {
|
|
|
80
80
|
Wp8EmulatorServices.WP8_LAUNCHER = "XapDeployCmd.exe";
|
|
81
81
|
Wp8EmulatorServices.WP8_LAUNCHER_PATH = "Microsoft SDKs\\Windows Phone\\v8.0\\Tools\\XAP Deployment";
|
|
82
82
|
yok_1.injector.register("wp8EmulatorServices", Wp8EmulatorServices);
|
|
83
|
+
//# sourceMappingURL=wp8-emulator-services.js.map
|
package/lib/common/opener.js
CHANGED
package/lib/common/os-info.js
CHANGED
package/lib/common/prompter.js
CHANGED
|
@@ -36,6 +36,7 @@ class Prompter {
|
|
|
36
36
|
else {
|
|
37
37
|
const result = {};
|
|
38
38
|
_.each(questions, (s) => {
|
|
39
|
+
// Curly brackets needed because s.default() may return false and break the loop
|
|
39
40
|
result[s.name] = s.default();
|
|
40
41
|
});
|
|
41
42
|
return result;
|
|
@@ -137,7 +138,9 @@ class Prompter {
|
|
|
137
138
|
}
|
|
138
139
|
muteStdout() {
|
|
139
140
|
if (helpers.isInteractive()) {
|
|
140
|
-
process.stdin.setRawMode(true);
|
|
141
|
+
process.stdin.setRawMode(true); // After setting rawMode to true, Ctrl+C doesn't work for non node.js events loop i.e device log command
|
|
142
|
+
// We need to create mute-stream and to pass it as output to ctrlcReader
|
|
143
|
+
// This will prevent the prompter to show the user's text twice on the console
|
|
141
144
|
this.muteStreamInstance = new MuteStream();
|
|
142
145
|
this.muteStreamInstance.pipe(process.stdout);
|
|
143
146
|
this.muteStreamInstance.mute();
|
|
@@ -146,6 +149,7 @@ class Prompter {
|
|
|
146
149
|
output: this.muteStreamInstance,
|
|
147
150
|
});
|
|
148
151
|
this.ctrlcReader.on("SIGINT", () => {
|
|
152
|
+
// enable terminal cursor
|
|
149
153
|
process.stdout.write("\x1B[?25h");
|
|
150
154
|
process.exit();
|
|
151
155
|
});
|
|
@@ -155,6 +159,7 @@ class Prompter {
|
|
|
155
159
|
if (helpers.isInteractive()) {
|
|
156
160
|
process.stdin.setRawMode(false);
|
|
157
161
|
if (this.muteStreamInstance) {
|
|
162
|
+
// We need to clean the event listeners from the process.stdout because the MuteStream.pipe function calls the pipe function of the Node js Stream which adds event listeners and this can cause memory leak if we display more than ~10 prompts.
|
|
158
163
|
this.cleanEventListeners(process.stdout);
|
|
159
164
|
this.muteStreamInstance.unmute();
|
|
160
165
|
this.muteStreamInstance = null;
|
|
@@ -163,6 +168,8 @@ class Prompter {
|
|
|
163
168
|
}
|
|
164
169
|
}
|
|
165
170
|
cleanEventListeners(stream) {
|
|
171
|
+
// The events names and listeners names can be found here https://github.com/nodejs/node/blob/master/lib/stream.js
|
|
172
|
+
// Which event cause memory leak can be tested with stream.listeners("event-name") and if the listeners count keeps increasing with each prompt we need to remove the listener.
|
|
166
173
|
const memoryLeakEvents = [
|
|
167
174
|
{
|
|
168
175
|
eventName: "close",
|
|
@@ -189,3 +196,4 @@ class Prompter {
|
|
|
189
196
|
}
|
|
190
197
|
exports.Prompter = Prompter;
|
|
191
198
|
yok_1.injector.register("prompter", Prompter);
|
|
199
|
+
//# sourceMappingURL=prompter.js.map
|
package/lib/common/queue.js
CHANGED
|
@@ -36,12 +36,15 @@ class AutoCompletionService {
|
|
|
36
36
|
get shellProfiles() {
|
|
37
37
|
return [
|
|
38
38
|
this.getHomePath(".bashrc"),
|
|
39
|
-
this.getHomePath(".zshrc"),
|
|
39
|
+
this.getHomePath(".zshrc"), // zsh - http://www.acm.uiuc.edu/workshops/zsh/startup_files.html
|
|
40
40
|
];
|
|
41
41
|
}
|
|
42
42
|
get cliRunCommandsFile() {
|
|
43
43
|
let cliRunCommandsFile = this.getHomePath(util.format(".%src", this.$staticConfig.CLIENT_NAME.toLowerCase()));
|
|
44
44
|
if (this.$hostInfo.isWindows) {
|
|
45
|
+
// on Windows bash, file is incorrectly written as C:\Users\<username>, which leads to errors when trying to execute the script:
|
|
46
|
+
// $ source ~/.bashrc
|
|
47
|
+
// sh.exe": C:Usersusername.appbuilderrc: No such file or directory
|
|
45
48
|
cliRunCommandsFile = cliRunCommandsFile.replace(/\\/g, "/");
|
|
46
49
|
}
|
|
47
50
|
return cliRunCommandsFile;
|
|
@@ -56,7 +59,9 @@ class AutoCompletionService {
|
|
|
56
59
|
return new RegExp(util.format("%s[\\s\\S]*%s", AutoCompletionService.GENERATED_TABTAB_COMPLETION_START, AutoCompletionService.GENERATED_TABTAB_COMPLETION_END));
|
|
57
60
|
}
|
|
58
61
|
removeObsoleteAutoCompletion() {
|
|
62
|
+
// In previous releases we were writing directly in .bash_profile, .bashrc, .zshrc and .profile - remove this old code
|
|
59
63
|
const shellProfilesToBeCleared = this.shellProfiles;
|
|
64
|
+
// Add .profile only here as we do not want new autocompletion in this file, but we have to remove our old code from it.
|
|
60
65
|
shellProfilesToBeCleared.push(this.getHomePath(".profile"));
|
|
61
66
|
shellProfilesToBeCleared.forEach((file) => {
|
|
62
67
|
try {
|
|
@@ -109,6 +114,7 @@ class AutoCompletionService {
|
|
|
109
114
|
this.isNewAutoCompletionEnabledInFile(filePath) ||
|
|
110
115
|
this.isObsoleteAutoCompletionEnabledInFile(filePath);
|
|
111
116
|
if (!result) {
|
|
117
|
+
// break each
|
|
112
118
|
return false;
|
|
113
119
|
}
|
|
114
120
|
});
|
|
@@ -136,6 +142,7 @@ class AutoCompletionService {
|
|
|
136
142
|
_.each(this.shellProfiles, (shellProfile) => {
|
|
137
143
|
result = this.isObsoleteAutoCompletionEnabledInFile(shellProfile);
|
|
138
144
|
if (!result) {
|
|
145
|
+
// break each
|
|
139
146
|
return false;
|
|
140
147
|
}
|
|
141
148
|
});
|
|
@@ -174,6 +181,8 @@ class AutoCompletionService {
|
|
|
174
181
|
}
|
|
175
182
|
catch (err) {
|
|
176
183
|
this.$logger.info("Unable to update %s. Command-line completion might not work.", fileName);
|
|
184
|
+
// When npm is installed with sudo, in some cases the installation cannot write to shell profiles
|
|
185
|
+
// Advise the user how to enable autocompletion after the installation is completed.
|
|
177
186
|
if ((err.code === "EPERM" || err.code === "EACCES") &&
|
|
178
187
|
!this.$hostInfo.isWindows &&
|
|
179
188
|
process.env.SUDO_USER) {
|
|
@@ -194,6 +203,7 @@ class AutoCompletionService {
|
|
|
194
203
|
}
|
|
195
204
|
}
|
|
196
205
|
catch (err) {
|
|
206
|
+
// If file does not exist, autocompletion was not working for it, so ignore this error.
|
|
197
207
|
if (err.code !== "ENOENT") {
|
|
198
208
|
this.$logger.info("Failed to update %s. Auto-completion may still work or work incorrectly. ", fileName);
|
|
199
209
|
this.$logger.info(err);
|
|
@@ -226,6 +236,7 @@ class AutoCompletionService {
|
|
|
226
236
|
this.$fs.writeFile(filePath, newText);
|
|
227
237
|
}
|
|
228
238
|
}
|
|
239
|
+
// The generated seems to be inconsistent in it's start/end markers so adding our own.
|
|
229
240
|
this.$fs.appendFile(filePath, `\n${AutoCompletionService.GENERATED_TABTAB_COMPLETION_START}\n`);
|
|
230
241
|
yield this.$childProcess.exec(`"${process.argv[0]}" "${pathToExecutableFile}" completion_generate_script >> "${filePath}"`);
|
|
231
242
|
this.$fs.appendFile(filePath, this.completionAliasDefinition);
|
|
@@ -263,3 +274,4 @@ __decorate([
|
|
|
263
274
|
], AutoCompletionService.prototype, "completionShellScriptContent", null);
|
|
264
275
|
exports.AutoCompletionService = AutoCompletionService;
|
|
265
276
|
yok_1.injector.register("autoCompletionService", AutoCompletionService);
|
|
277
|
+
//# sourceMappingURL=auto-completion-service.js.map
|
|
@@ -38,7 +38,7 @@ class CancellationService {
|
|
|
38
38
|
.watch(triggerFile, { ignoreInitial: true })
|
|
39
39
|
.on("unlink", (filePath) => {
|
|
40
40
|
this.$logger.info(`Exiting process as the file ${filePath} has been deleted. Probably reinstalling CLI while there's a working instance.`);
|
|
41
|
-
process.exit(132);
|
|
41
|
+
process.exit(132 /* ErrorCodes.DELETED_KILL_FILE */);
|
|
42
42
|
});
|
|
43
43
|
if (watcher) {
|
|
44
44
|
this.watches[name] = watcher;
|
|
@@ -65,3 +65,4 @@ class CancellationService {
|
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
yok_1.injector.register("cancellation", CancellationService);
|
|
68
|
+
//# sourceMappingURL=cancellation.js.map
|
|
@@ -48,11 +48,11 @@ class CommandsService {
|
|
|
48
48
|
if (!this.$staticConfig.disableAnalytics &&
|
|
49
49
|
!command.disableAnalytics &&
|
|
50
50
|
!this.$options.disableAnalytics) {
|
|
51
|
-
const analyticsService = this.$injector.resolve("analyticsService");
|
|
51
|
+
const analyticsService = this.$injector.resolve("analyticsService"); // This should be resolved here due to cyclic dependency
|
|
52
52
|
yield analyticsService.checkConsent();
|
|
53
53
|
const beautifiedCommandName = this.beautifyCommandName(commandName).replace(/\|/g, " ");
|
|
54
54
|
const googleAnalyticsPageData = {
|
|
55
|
-
googleAnalyticsDataType: "pageview"
|
|
55
|
+
googleAnalyticsDataType: "pageview" /* GoogleAnalyticsDataType.Page */,
|
|
56
56
|
path: beautifiedCommandName,
|
|
57
57
|
title: beautifiedCommandName,
|
|
58
58
|
};
|
|
@@ -62,10 +62,11 @@ class CommandsService {
|
|
|
62
62
|
const shouldExecuteHooks = !this.$staticConfig.disableCommandHooks &&
|
|
63
63
|
(command.enableHooks === undefined || command.enableHooks === true);
|
|
64
64
|
if (shouldExecuteHooks) {
|
|
65
|
+
// Handle correctly hierarchical commands
|
|
65
66
|
const hierarchicalCommandName = this.$injector.buildHierarchicalCommand(commandName, commandArguments);
|
|
66
67
|
if (hierarchicalCommandName) {
|
|
67
|
-
commandName = helpers.stringReplaceAll(hierarchicalCommandName.commandName, "|*"
|
|
68
|
-
commandName = helpers.stringReplaceAll(commandName, "|"
|
|
68
|
+
commandName = helpers.stringReplaceAll(hierarchicalCommandName.commandName, "|*" /* CommandsDelimiters.DefaultHierarchicalCommand */, "-" /* CommandsDelimiters.HooksCommand */);
|
|
69
|
+
commandName = helpers.stringReplaceAll(commandName, "|" /* CommandsDelimiters.HierarchicalCommand */, "-" /* CommandsDelimiters.HooksCommand */);
|
|
69
70
|
}
|
|
70
71
|
yield this.$hooksService.executeBeforeHooks(commandName);
|
|
71
72
|
}
|
|
@@ -116,6 +117,7 @@ class CommandsService {
|
|
|
116
117
|
yield this.executeCommandAction(commandName, commandArguments, this.executeCommandUnchecked);
|
|
117
118
|
}
|
|
118
119
|
else {
|
|
120
|
+
// If canExecuteCommand returns false, the command cannot be executed or there's no such command at all.
|
|
119
121
|
const command = this.$injector.resolveCommand(commandName);
|
|
120
122
|
if (command) {
|
|
121
123
|
let commandWithArgs = commandName;
|
|
@@ -133,12 +135,15 @@ class CommandsService {
|
|
|
133
135
|
const command = this.$injector.resolveCommand(commandName);
|
|
134
136
|
const beautifiedName = helpers.stringReplaceAll(commandName, "|", " ");
|
|
135
137
|
if (command) {
|
|
138
|
+
// Verify command is enabled
|
|
136
139
|
if (command.isDisabled) {
|
|
137
140
|
this.$errors.fail("This command is not applicable to your environment.");
|
|
138
141
|
}
|
|
142
|
+
// If command wants to handle canExecute logic on its own.
|
|
139
143
|
if (command.canExecute) {
|
|
140
144
|
return yield command.canExecute(commandArguments);
|
|
141
145
|
}
|
|
146
|
+
// First part of hierarchical commands should be validated in specific way.
|
|
142
147
|
if (yield this.$injector.isValidHierarchicalCommand(commandName, commandArguments)) {
|
|
143
148
|
return true;
|
|
144
149
|
}
|
|
@@ -150,8 +155,8 @@ class CommandsService {
|
|
|
150
155
|
}
|
|
151
156
|
const commandInfo = {
|
|
152
157
|
inputStrings: [commandName, ...commandArguments],
|
|
153
|
-
commandDelimiter: "|"
|
|
154
|
-
defaultCommandDelimiter: "|*"
|
|
158
|
+
commandDelimiter: "|" /* CommandsDelimiters.HierarchicalCommand */,
|
|
159
|
+
defaultCommandDelimiter: "|*" /* CommandsDelimiters.DefaultHierarchicalCommand */,
|
|
155
160
|
};
|
|
156
161
|
const extensionData = yield this.$extensibilityService.getExtensionNameWhereCommandIsRegistered(commandInfo);
|
|
157
162
|
if (extensionData) {
|
|
@@ -169,11 +174,13 @@ class CommandsService {
|
|
|
169
174
|
return __awaiter(this, void 0, void 0, function* () {
|
|
170
175
|
const commandArgsHelper = new CommandArgumentsValidationHelper(true, commandArguments);
|
|
171
176
|
if (mandatoryParams.length > 0) {
|
|
177
|
+
// If command has more mandatory params than the passed ones, we shouldn't execute it
|
|
172
178
|
if (mandatoryParams.length > commandArguments.length) {
|
|
173
179
|
const customErrorMessages = _.map(mandatoryParams, (mp) => mp.errorMessage);
|
|
174
180
|
customErrorMessages.splice(0, 0, "You need to provide all the required parameters.");
|
|
175
181
|
this.$errors.failWithHelp(customErrorMessages.join(os_1.EOL));
|
|
176
182
|
}
|
|
183
|
+
// If we reach here, the commandArguments are at least as much as mandatoryParams. Now we should verify that we have each of them.
|
|
177
184
|
for (let mandatoryParamIndex = 0; mandatoryParamIndex < mandatoryParams.length; ++mandatoryParamIndex) {
|
|
178
185
|
const mandatoryParam = mandatoryParams[mandatoryParamIndex];
|
|
179
186
|
let argument = null;
|
|
@@ -202,12 +209,14 @@ class CommandsService {
|
|
|
202
209
|
if (!commandArgsHelper.isValid) {
|
|
203
210
|
return false;
|
|
204
211
|
}
|
|
212
|
+
// Command doesn't have any allowedParameters
|
|
205
213
|
if (!command.allowedParameters || command.allowedParameters.length === 0) {
|
|
206
214
|
if (commandArguments.length > 0) {
|
|
207
215
|
this.$errors.failWithHelp("This command doesn't accept parameters.");
|
|
208
216
|
}
|
|
209
217
|
}
|
|
210
218
|
else {
|
|
219
|
+
// Exclude mandatory params, we've already checked them
|
|
211
220
|
const unverifiedAllowedParams = command.allowedParameters.filter((param) => !param.mandatory);
|
|
212
221
|
for (let remainingArgsIndex = 0; remainingArgsIndex < commandArgsHelper.remainingArguments.length; ++remainingArgsIndex) {
|
|
213
222
|
const argument = commandArgsHelper.remainingArguments[remainingArgsIndex];
|
|
@@ -221,6 +230,7 @@ class CommandsService {
|
|
|
221
230
|
}
|
|
222
231
|
if (parameter) {
|
|
223
232
|
const index = unverifiedAllowedParams.indexOf(parameter);
|
|
233
|
+
// Remove the matched parameter from unverifiedAllowedParams collection, so it will not be used to verify another argument.
|
|
224
234
|
unverifiedAllowedParams.splice(index, 1);
|
|
225
235
|
}
|
|
226
236
|
else {
|
|
@@ -266,3 +276,4 @@ class CommandsService {
|
|
|
266
276
|
}
|
|
267
277
|
exports.CommandsService = CommandsService;
|
|
268
278
|
yok_1.injector.register("commandsService", CommandsService);
|
|
279
|
+
//# sourceMappingURL=commands-service.js.map
|
|
@@ -52,6 +52,7 @@ class HelpService {
|
|
|
52
52
|
this.$logger.trace("Opening help for command '%s'. FileName is '%s'.", commandName, htmlPage);
|
|
53
53
|
this.$fs.ensureDirectoryExists(this.pathToHtmlPages);
|
|
54
54
|
if (!this.tryOpeningSelectedPage(htmlPage)) {
|
|
55
|
+
// HTML pages may have been skipped on post-install, lets generate them.
|
|
55
56
|
this.$logger.trace("Required HTML file '%s' is missing. Let's try generating HTML files and see if we'll find it.", htmlPage);
|
|
56
57
|
yield this.generateHtmlPages();
|
|
57
58
|
if (!this.tryOpeningSelectedPage(htmlPage)) {
|
|
@@ -113,6 +114,11 @@ class HelpService {
|
|
|
113
114
|
this.$logger.printMarkdown(help);
|
|
114
115
|
});
|
|
115
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Gets the help content for a specific command that should be shown on the terminal.
|
|
119
|
+
* @param {string} commandName Name of the command for which to read the help.
|
|
120
|
+
* @returns {Promise<string>} Help content of the command parsed with all terminal rules applied (stripped content that should be shown only for html help).
|
|
121
|
+
*/
|
|
116
122
|
getCommandLineHelpForCommand(commandData) {
|
|
117
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
124
|
const helpText = yield this.readMdFileForCommand(commandData);
|
|
@@ -126,6 +132,7 @@ class HelpService {
|
|
|
126
132
|
return commandLineHelp;
|
|
127
133
|
});
|
|
128
134
|
}
|
|
135
|
+
// This method should return Promise in order to generate all html pages simultaneously.
|
|
129
136
|
createHtmlPage(htmlPageGenerationData) {
|
|
130
137
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
138
|
const { basicHtmlPage, pathToMdFile, pathToMdPages, pathToHtmlPages, extensionName, } = htmlPageGenerationData;
|
|
@@ -177,8 +184,8 @@ class HelpService {
|
|
|
177
184
|
const commandName = commandData.commandName;
|
|
178
185
|
const commandInfo = {
|
|
179
186
|
inputStrings: [commandName, ...commandData.commandArguments],
|
|
180
|
-
commandDelimiter: "|"
|
|
181
|
-
defaultCommandDelimiter: "|*"
|
|
187
|
+
commandDelimiter: "|" /* CommandsDelimiters.HierarchicalCommand */,
|
|
188
|
+
defaultCommandDelimiter: "|*" /* CommandsDelimiters.DefaultHierarchicalCommand */,
|
|
182
189
|
};
|
|
183
190
|
const extensionData = yield this.$extensibilityService.getExtensionNameWhereCommandIsRegistered(commandInfo);
|
|
184
191
|
if (extensionData) {
|
|
@@ -247,6 +254,7 @@ HelpService.RELATIVE_PATH_TO_INDEX_REGEX = /@RELATIVE_PATH_TO_INDEX@/g;
|
|
|
247
254
|
HelpService.EXTENSION_NAME_REGEX = /@EXTENSION_NAME@/g;
|
|
248
255
|
HelpService.MARKDOWN_LINK_REGEX = /\[([\w \-\`\<\>\*\:\\]+?)\]\([\s\S]+?\)/g;
|
|
249
256
|
HelpService.SPAN_REGEX = /([\s\S]*?)(?:\r?\n)?<span.*?>([\s\S]*?)<\/span>(?:\r?\n)*/g;
|
|
250
|
-
HelpService.NEW_LINE_REGEX = /<\/?\s*?br\s*?\/?>/g;
|
|
257
|
+
HelpService.NEW_LINE_REGEX = /<\/?\s*?br\s*?\/?>/g; // <br>, <br > <br/> <br />
|
|
251
258
|
exports.HelpService = HelpService;
|
|
252
259
|
yok_1.injector.register("helpService", HelpService);
|
|
260
|
+
//# sourceMappingURL=help-service.js.map
|
|
@@ -61,6 +61,7 @@ class HooksService {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
static formatHookName(commandName) {
|
|
64
|
+
// Remove everything after | (including the pipe)
|
|
64
65
|
return commandName.replace(/\|[\s\S]*$/, "");
|
|
65
66
|
}
|
|
66
67
|
executeBeforeHooks(commandName, hookArguments) {
|
|
@@ -129,6 +130,11 @@ class HooksService {
|
|
|
129
130
|
this.$logger.warn(`${hook.fullPath} will NOT be executed because it has invalid arguments - ${color_1.color.grey(invalidArguments.join(", "))}.`);
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
133
|
+
// HACK for backwards compatibility:
|
|
134
|
+
// In case $projectData wasn't resolved by the time we got here (most likely we got here without running a command but through a service directly)
|
|
135
|
+
// then it is probably passed as a hookArg
|
|
136
|
+
// if that is the case then pass it directly to the hook instead of trying to resolve $projectData via injector
|
|
137
|
+
// This helps make hooks stateless
|
|
132
138
|
const projectDataHookArg = hookArguments["hookArgs"] && hookArguments["hookArgs"]["projectData"];
|
|
133
139
|
if (projectDataHookArg) {
|
|
134
140
|
hookArguments["projectData"] = hookArguments["$projectData"] = projectDataHookArg;
|
|
@@ -146,6 +152,7 @@ class HooksService {
|
|
|
146
152
|
this.$logger.warn(err.message || err);
|
|
147
153
|
}
|
|
148
154
|
else {
|
|
155
|
+
// Print the actual error with its callstack, so it is easy to find out which hooks is causing troubles.
|
|
149
156
|
this.$logger.error(err);
|
|
150
157
|
throw err || new Error(`Failed to execute hook: ${hook.fullPath}.`);
|
|
151
158
|
}
|
|
@@ -251,6 +258,7 @@ class HooksService {
|
|
|
251
258
|
interpreter = sheBangMatch[1];
|
|
252
259
|
}
|
|
253
260
|
if (interpreter) {
|
|
261
|
+
// Likewise, make /usr/bin/bash work like "bash".
|
|
254
262
|
shMatch = interpreter.match(/bin\/((?:ba)?sh)$/);
|
|
255
263
|
}
|
|
256
264
|
if (shMatch) {
|
|
@@ -291,6 +299,7 @@ class HooksService {
|
|
|
291
299
|
}
|
|
292
300
|
validateHookArguments(hookConstructor, hookFullPath) {
|
|
293
301
|
const invalidArguments = [];
|
|
302
|
+
// We need to annotate the hook in order to have the arguments of the constructor.
|
|
294
303
|
(0, helpers_1.annotate)(hookConstructor);
|
|
295
304
|
_.each(hookConstructor.$inject.args, (argument) => {
|
|
296
305
|
try {
|
|
@@ -310,9 +319,13 @@ HooksService.HOOKS_DIRECTORY_NAME = "hooks";
|
|
|
310
319
|
__decorate([
|
|
311
320
|
(0, decorators_1.memoize)({
|
|
312
321
|
shouldCache() {
|
|
322
|
+
// only cache if we have hooks directories, the only case to
|
|
323
|
+
// not have hooks directories is when the project dir is
|
|
324
|
+
// not set yet, ie. when creating a project.
|
|
313
325
|
return !!this.hooksDirectories.length;
|
|
314
326
|
},
|
|
315
327
|
})
|
|
316
328
|
], HooksService.prototype, "initialize", null);
|
|
317
329
|
exports.HooksService = HooksService;
|
|
318
330
|
yok_1.injector.register("hooksService", HooksService);
|
|
331
|
+
//# sourceMappingURL=hooks-service.js.map
|
|
@@ -35,6 +35,8 @@ class JsonFileSettingsService {
|
|
|
35
35
|
const dataToReturn = data.modifiedByCacheMechanism ? data.value : data;
|
|
36
36
|
if (cacheOpts && cacheOpts.cacheTimeout) {
|
|
37
37
|
if (!data.modifiedByCacheMechanism) {
|
|
38
|
+
// If data has no cache, but we want to check the timeout, consider the data as outdated.
|
|
39
|
+
// this should be a really rare case
|
|
38
40
|
return null;
|
|
39
41
|
}
|
|
40
42
|
const currentTime = Date.now();
|
|
@@ -100,6 +102,8 @@ class JsonFileSettingsService {
|
|
|
100
102
|
if (!this.$fs.exists(this.jsonSettingsFilePath)) {
|
|
101
103
|
const unexistingDirs = this.getUnexistingDirectories(this.jsonSettingsFilePath);
|
|
102
104
|
this.$fs.writeFile(this.jsonSettingsFilePath, null);
|
|
105
|
+
// when running under 'sudo' we create the <path to home dir>/.local/share/.nativescript-cli dir with root as owner
|
|
106
|
+
// and other Applications cannot access this directory anymore. (bower/heroku/etc)
|
|
103
107
|
if (process.env.SUDO_USER) {
|
|
104
108
|
for (const dir of unexistingDirs) {
|
|
105
109
|
yield this.$fs.setCurrentUserAsOwner(dir, process.env.SUDO_USER);
|
|
@@ -120,6 +124,7 @@ class JsonFileSettingsService {
|
|
|
120
124
|
const unexistingDirs = [];
|
|
121
125
|
let currentDir = path.join(filePath, "..");
|
|
122
126
|
while (true) {
|
|
127
|
+
// this directory won't be created.
|
|
123
128
|
if (this.$fs.exists(currentDir)) {
|
|
124
129
|
break;
|
|
125
130
|
}
|
|
@@ -131,3 +136,4 @@ class JsonFileSettingsService {
|
|
|
131
136
|
}
|
|
132
137
|
exports.JsonFileSettingsService = JsonFileSettingsService;
|
|
133
138
|
yok_1.injector.register("jsonFileSettingsService", JsonFileSettingsService, false);
|
|
139
|
+
//# sourceMappingURL=json-file-settings-service.js.map
|
|
@@ -31,6 +31,7 @@ class LockService {
|
|
|
31
31
|
}
|
|
32
32
|
get defaultLockParams() {
|
|
33
33
|
const lockParams = {
|
|
34
|
+
// https://www.npmjs.com/package/retry#retrytimeoutsoptions
|
|
34
35
|
retriesObj: { retries: 13, minTimeout: 100, maxTimeout: 1000, factor: 2 },
|
|
35
36
|
stale: 10 * 1000,
|
|
36
37
|
realpath: false,
|
|
@@ -89,6 +90,8 @@ class LockService {
|
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
92
|
getPathsForCleanupAction(lockPath) {
|
|
93
|
+
// The proper-lockfile creates directory with the passed name and `.lock` at the end.
|
|
94
|
+
// Ensure we will take care of it as well.
|
|
92
95
|
return [lockPath, `${lockPath}.lock`];
|
|
93
96
|
}
|
|
94
97
|
getLockFileSettings(filePath, fileOpts) {
|
|
@@ -104,6 +107,7 @@ class LockService {
|
|
|
104
107
|
fileOpts.retriesObj.retries = fileOpts.retries;
|
|
105
108
|
}
|
|
106
109
|
if (fileOpts.retryWait) {
|
|
110
|
+
// backwards compatibility
|
|
107
111
|
fileOpts.retriesObj.minTimeout = fileOpts.retriesObj.maxTimeout =
|
|
108
112
|
fileOpts.retryWait;
|
|
109
113
|
}
|
|
@@ -126,4 +130,6 @@ __decorate([
|
|
|
126
130
|
], LockService.prototype, "defaultLockFilePath", null);
|
|
127
131
|
exports.LockService = LockService;
|
|
128
132
|
yok_1.injector.register("lockService", LockService);
|
|
133
|
+
// backwards compatibility
|
|
129
134
|
yok_1.injector.register("lockfile", LockService);
|
|
135
|
+
//# sourceMappingURL=lock-service.js.map
|
|
@@ -18,12 +18,16 @@ const _ = require("lodash");
|
|
|
18
18
|
class MicroTemplateService {
|
|
19
19
|
constructor($injector) {
|
|
20
20
|
this.$injector = $injector;
|
|
21
|
+
// Injector's dynamicCallRegex doesn't have 'g' option, which we need here.
|
|
22
|
+
// Use ( ) in order to use $1 to get whole expression later
|
|
21
23
|
this.dynamicCallRegex = new RegExp(util.format("(%s)", this.$injector.dynamicCallRegex.source), "g");
|
|
22
24
|
}
|
|
23
25
|
parseContent(data, options) {
|
|
24
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
27
|
const localVariables = this.getLocalVariables(options);
|
|
26
28
|
const compiledTemplate = _.template(data.replace(this.dynamicCallRegex, 'this.$injector.getDynamicCallData("$1")'));
|
|
29
|
+
// When debugging parsing, uncomment the line below:
|
|
30
|
+
// console.log(compiledTemplate.source);
|
|
27
31
|
return yield compiledTemplate.apply(this, [localVariables]);
|
|
28
32
|
});
|
|
29
33
|
}
|
|
@@ -33,6 +37,7 @@ class MicroTemplateService {
|
|
|
33
37
|
}
|
|
34
38
|
getLocalVariables(options) {
|
|
35
39
|
const isHtml = options.isHtml;
|
|
40
|
+
// in html help we want to show all help. Only CONSOLE specific help(wrapped in if(isConsole) ) must be omitted
|
|
36
41
|
const localVariables = {
|
|
37
42
|
constants,
|
|
38
43
|
};
|
|
@@ -47,3 +52,4 @@ class MicroTemplateService {
|
|
|
47
52
|
}
|
|
48
53
|
exports.MicroTemplateService = MicroTemplateService;
|
|
49
54
|
yok_1.injector.register("microTemplateService", MicroTemplateService);
|
|
55
|
+
//# sourceMappingURL=micro-templating-service.js.map
|
|
@@ -24,6 +24,7 @@ class Net {
|
|
|
24
24
|
getFreePort() {
|
|
25
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
const server = net.createServer((sock) => {
|
|
27
|
+
/* empty - noone will connect here */
|
|
27
28
|
});
|
|
28
29
|
return new Promise((resolve, reject) => {
|
|
29
30
|
let isResolved = false;
|
|
@@ -57,6 +58,7 @@ class Net {
|
|
|
57
58
|
});
|
|
58
59
|
server.once("close", () => {
|
|
59
60
|
if (!isResolved) {
|
|
61
|
+
// "close" will be emitted right after "error"
|
|
60
62
|
isResolved = true;
|
|
61
63
|
resolve(true);
|
|
62
64
|
}
|
|
@@ -135,3 +137,4 @@ class Net {
|
|
|
135
137
|
Net.DEFAULT_INTERVAL = 1000;
|
|
136
138
|
exports.Net = Net;
|
|
137
139
|
yok_1.injector.register("net", Net);
|
|
140
|
+
//# sourceMappingURL=net-service.js.map
|
|
@@ -66,6 +66,7 @@ class ProjectFilesManager {
|
|
|
66
66
|
this.processPlatformSpecificFilesCore(platform, files, projectFilesConfig);
|
|
67
67
|
}
|
|
68
68
|
processPlatformSpecificFilesCore(platform, files, projectFilesConfig) {
|
|
69
|
+
// Renames the files that have `platform` as substring and removes the files from other platform
|
|
69
70
|
_.each(files, (filePath) => {
|
|
70
71
|
const projectFileInfo = this.$projectFilesProvider.getProjectFileInfo(filePath, platform, projectFilesConfig);
|
|
71
72
|
if (!projectFileInfo.shouldIncludeFile) {
|
|
@@ -73,6 +74,7 @@ class ProjectFilesManager {
|
|
|
73
74
|
}
|
|
74
75
|
else if (projectFileInfo.onDeviceFileName) {
|
|
75
76
|
const onDeviceFilePath = path.join(path.dirname(filePath), projectFileInfo.onDeviceFileName);
|
|
77
|
+
// Fix .js.map entries
|
|
76
78
|
const extension = path.extname(projectFileInfo.onDeviceFileName);
|
|
77
79
|
if (onDeviceFilePath !== filePath) {
|
|
78
80
|
if (extension === ".js" || extension === ".map") {
|
|
@@ -86,6 +88,8 @@ class ProjectFilesManager {
|
|
|
86
88
|
fileContent = fileContent.replace(new RegExp(oldName, "g"), newName);
|
|
87
89
|
this.$fs.writeFile(filePath, fileContent);
|
|
88
90
|
}
|
|
91
|
+
// Rename the file
|
|
92
|
+
// this.$fs.rename is not called as it is error prone on some systems with slower hard drives and rigorous antivirus software
|
|
89
93
|
this.$fs.writeFile(onDeviceFilePath, this.$fs.readText(filePath));
|
|
90
94
|
this.$fs.deleteFile(filePath);
|
|
91
95
|
}
|
|
@@ -98,3 +102,4 @@ class ProjectFilesManager {
|
|
|
98
102
|
}
|
|
99
103
|
exports.ProjectFilesManager = ProjectFilesManager;
|
|
100
104
|
yok_1.injector.register("projectFilesManager", ProjectFilesManager);
|
|
105
|
+
//# sourceMappingURL=project-files-manager.js.map
|
package/lib/common/utils.js
CHANGED
|
@@ -86,3 +86,4 @@ ProjectNameValidator.INVALID_FILENAMES = [
|
|
|
86
86
|
ProjectNameValidator.INVALID_EXTENSIONS = [];
|
|
87
87
|
exports.ProjectNameValidator = ProjectNameValidator;
|
|
88
88
|
yok_1.injector.register("projectNameValidator", ProjectNameValidator);
|
|
89
|
+
//# sourceMappingURL=project-name-validator.js.map
|