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
package/lib/options.js
CHANGED
|
@@ -23,6 +23,7 @@ class Options {
|
|
|
23
23
|
this.setArgv();
|
|
24
24
|
}
|
|
25
25
|
this.argv.bundle = "webpack";
|
|
26
|
+
// Check if the user has explicitly provide --hmr and --release options from command line
|
|
26
27
|
if (this.initialArgv.release && this.initialArgv.hmr) {
|
|
27
28
|
this.$errors.fail("The options --release and --hmr cannot be used simultaneously.");
|
|
28
29
|
}
|
|
@@ -30,6 +31,8 @@ class Options {
|
|
|
30
31
|
this.argv.hmr = !this.argv.release;
|
|
31
32
|
}
|
|
32
33
|
if (this.argv.debugBrk) {
|
|
34
|
+
// we cannot use HMR along with debug-brk because we have to restart the app
|
|
35
|
+
// on each livesync in order to stop and allow debugging on app start
|
|
33
36
|
this.argv.hmr = false;
|
|
34
37
|
}
|
|
35
38
|
if (this.argv.justlaunch) {
|
|
@@ -47,17 +50,18 @@ class Options {
|
|
|
47
50
|
"timeout",
|
|
48
51
|
"_",
|
|
49
52
|
"$0",
|
|
50
|
-
];
|
|
53
|
+
]; // These options shouldn't be validated
|
|
51
54
|
this.globalOptions = {
|
|
52
|
-
log: { type: "string"
|
|
53
|
-
verbose: { type: "boolean"
|
|
54
|
-
version: { type: "boolean"
|
|
55
|
-
help: { type: "boolean"
|
|
56
|
-
profileDir: { type: "string"
|
|
57
|
-
analyticsClient: { type: "string"
|
|
58
|
-
path: { type: "string"
|
|
59
|
-
config: { type: "string"
|
|
60
|
-
|
|
55
|
+
log: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
56
|
+
verbose: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
57
|
+
version: { type: "boolean" /* OptionType.Boolean */, alias: "v", hasSensitiveValue: false },
|
|
58
|
+
help: { type: "boolean" /* OptionType.Boolean */, alias: "h", hasSensitiveValue: false },
|
|
59
|
+
profileDir: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
60
|
+
analyticsClient: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
61
|
+
path: { type: "string" /* OptionType.String */, alias: "p", hasSensitiveValue: true },
|
|
62
|
+
config: { type: "string" /* OptionType.String */, alias: "c", hasSensitiveValue: true },
|
|
63
|
+
// This will parse all non-hyphenated values as strings.
|
|
64
|
+
_: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
61
65
|
};
|
|
62
66
|
this.options = _.extend({}, this.commonOptions, this.globalOptions);
|
|
63
67
|
this.setArgv();
|
|
@@ -73,162 +77,163 @@ class Options {
|
|
|
73
77
|
}
|
|
74
78
|
get commonOptions() {
|
|
75
79
|
return {
|
|
76
|
-
ipa: { type: "string"
|
|
77
|
-
frameworkPath: { type: "string"
|
|
78
|
-
frameworkName: { type: "string"
|
|
79
|
-
framework: { type: "string"
|
|
80
|
-
frameworkVersion: { type: "string"
|
|
81
|
-
forDevice: { type: "boolean"
|
|
80
|
+
ipa: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
81
|
+
frameworkPath: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
82
|
+
frameworkName: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
83
|
+
framework: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
84
|
+
frameworkVersion: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
85
|
+
forDevice: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
82
86
|
iCloudContainerEnvironment: {
|
|
83
|
-
type: "string"
|
|
87
|
+
type: "string" /* OptionType.String */,
|
|
84
88
|
hasSensitiveValue: false,
|
|
85
89
|
},
|
|
86
|
-
provision: { type: "object"
|
|
90
|
+
provision: { type: "object" /* OptionType.Object */, hasSensitiveValue: true },
|
|
87
91
|
client: {
|
|
88
|
-
type: "boolean"
|
|
92
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
89
93
|
default: true,
|
|
90
94
|
hasSensitiveValue: false,
|
|
91
95
|
},
|
|
92
|
-
env: { type: "object"
|
|
93
|
-
production: { type: "boolean"
|
|
94
|
-
debugTransport: { type: "boolean"
|
|
95
|
-
keyStorePath: { type: "string"
|
|
96
|
-
keyStorePassword: { type: "string"
|
|
97
|
-
keyStoreAlias: { type: "string"
|
|
96
|
+
env: { type: "object" /* OptionType.Object */, hasSensitiveValue: false },
|
|
97
|
+
production: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
98
|
+
debugTransport: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
99
|
+
keyStorePath: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
100
|
+
keyStorePassword: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
101
|
+
keyStoreAlias: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
98
102
|
keyStoreAliasPassword: {
|
|
99
|
-
type: "string"
|
|
103
|
+
type: "string" /* OptionType.String */,
|
|
100
104
|
hasSensitiveValue: true,
|
|
101
105
|
},
|
|
102
|
-
ignoreScripts: { type: "boolean"
|
|
103
|
-
disableNpmInstall: { type: "boolean"
|
|
104
|
-
compileSdk: { type: "number"
|
|
105
|
-
port: { type: "number"
|
|
106
|
-
copyTo: { type: "string"
|
|
107
|
-
js: { type: "boolean"
|
|
108
|
-
javascript: { type: "boolean"
|
|
109
|
-
ng: { type: "boolean"
|
|
110
|
-
angular: { type: "boolean"
|
|
111
|
-
react: { type: "boolean"
|
|
112
|
-
reactjs: { type: "boolean"
|
|
113
|
-
vue: { type: "boolean"
|
|
114
|
-
vuejs: { type: "boolean"
|
|
115
|
-
svelte: { type: "boolean"
|
|
116
|
-
vision: { type: "boolean"
|
|
117
|
-
"vision-ng": { type: "boolean"
|
|
118
|
-
"vision-react": { type: "boolean"
|
|
119
|
-
"vision-solid": { type: "boolean"
|
|
120
|
-
"vision-svelte": { type: "boolean"
|
|
121
|
-
"vision-vue": { type: "boolean"
|
|
122
|
-
tsc: { type: "boolean"
|
|
123
|
-
ts: { type: "boolean"
|
|
124
|
-
typescript: { type: "boolean"
|
|
125
|
-
yarn: { type: "boolean"
|
|
126
|
-
yarn2: { type: "boolean"
|
|
127
|
-
pnpm: { type: "boolean"
|
|
128
|
-
androidTypings: { type: "boolean"
|
|
129
|
-
bundle: { type: "string"
|
|
130
|
-
all: { type: "boolean"
|
|
131
|
-
teamId: { type: "object"
|
|
132
|
-
chrome: { type: "boolean"
|
|
133
|
-
inspector: { type: "boolean"
|
|
134
|
-
clean: { type: "boolean"
|
|
106
|
+
ignoreScripts: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
107
|
+
disableNpmInstall: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
108
|
+
compileSdk: { type: "number" /* OptionType.Number */, hasSensitiveValue: false },
|
|
109
|
+
port: { type: "number" /* OptionType.Number */, hasSensitiveValue: false },
|
|
110
|
+
copyTo: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
111
|
+
js: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
112
|
+
javascript: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
113
|
+
ng: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
114
|
+
angular: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
115
|
+
react: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
116
|
+
reactjs: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
117
|
+
vue: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
118
|
+
vuejs: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
119
|
+
svelte: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
120
|
+
vision: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
121
|
+
"vision-ng": { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
122
|
+
"vision-react": { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
123
|
+
"vision-solid": { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
124
|
+
"vision-svelte": { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
125
|
+
"vision-vue": { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
126
|
+
tsc: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
127
|
+
ts: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
128
|
+
typescript: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
129
|
+
yarn: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
130
|
+
yarn2: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
131
|
+
pnpm: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
132
|
+
androidTypings: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
133
|
+
bundle: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
134
|
+
all: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
135
|
+
teamId: { type: "object" /* OptionType.Object */, hasSensitiveValue: true },
|
|
136
|
+
chrome: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
137
|
+
inspector: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
138
|
+
clean: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
135
139
|
watch: {
|
|
136
|
-
type: "boolean"
|
|
140
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
137
141
|
default: true,
|
|
138
142
|
hasSensitiveValue: false,
|
|
139
143
|
},
|
|
140
|
-
background: { type: "string"
|
|
141
|
-
username: { type: "string"
|
|
142
|
-
pluginName: { type: "string"
|
|
144
|
+
background: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
145
|
+
username: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
146
|
+
pluginName: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
143
147
|
includeTypeScriptDemo: {
|
|
144
|
-
type: "string"
|
|
148
|
+
type: "string" /* OptionType.String */,
|
|
145
149
|
hasSensitiveValue: false,
|
|
146
150
|
},
|
|
147
|
-
includeAngularDemo: { type: "string"
|
|
151
|
+
includeAngularDemo: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
148
152
|
hmr: {
|
|
149
|
-
type: "boolean"
|
|
153
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
150
154
|
hasSensitiveValue: false,
|
|
151
155
|
default: true,
|
|
152
156
|
},
|
|
153
157
|
collection: {
|
|
154
|
-
type: "string"
|
|
158
|
+
type: "string" /* OptionType.String */,
|
|
155
159
|
alias: "c",
|
|
156
160
|
hasSensitiveValue: false,
|
|
157
161
|
},
|
|
158
|
-
json: { type: "boolean"
|
|
159
|
-
avd: { type: "string"
|
|
160
|
-
|
|
162
|
+
json: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
163
|
+
avd: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
164
|
+
// check not used
|
|
165
|
+
config: { type: "array" /* OptionType.Array */, hasSensitiveValue: false },
|
|
161
166
|
insecure: {
|
|
162
|
-
type: "boolean"
|
|
167
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
163
168
|
alias: "k",
|
|
164
169
|
hasSensitiveValue: false,
|
|
165
170
|
},
|
|
166
|
-
debug: { type: "boolean"
|
|
167
|
-
timeout: { type: "string"
|
|
168
|
-
device: { type: "string"
|
|
169
|
-
availableDevices: { type: "boolean"
|
|
170
|
-
appid: { type: "string"
|
|
171
|
-
geny: { type: "string"
|
|
172
|
-
debugBrk: { type: "boolean"
|
|
173
|
-
debugPort: { type: "number"
|
|
174
|
-
start: { type: "boolean"
|
|
175
|
-
stop: { type: "boolean"
|
|
176
|
-
ddi: { type: "string"
|
|
177
|
-
justlaunch: { type: "boolean"
|
|
178
|
-
file: { type: "string"
|
|
179
|
-
force: { type: "boolean"
|
|
180
|
-
emulator: { type: "boolean"
|
|
181
|
-
simulator: { type: "boolean"
|
|
182
|
-
sdk: { type: "string"
|
|
183
|
-
template: { type: "string"
|
|
184
|
-
certificate: { type: "string"
|
|
185
|
-
certificatePassword: { type: "string"
|
|
171
|
+
debug: { type: "boolean" /* OptionType.Boolean */, alias: "d", hasSensitiveValue: false },
|
|
172
|
+
timeout: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
173
|
+
device: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
174
|
+
availableDevices: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
175
|
+
appid: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
176
|
+
geny: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
177
|
+
debugBrk: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
178
|
+
debugPort: { type: "number" /* OptionType.Number */, hasSensitiveValue: false },
|
|
179
|
+
start: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
180
|
+
stop: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
181
|
+
ddi: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
182
|
+
justlaunch: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
183
|
+
file: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
184
|
+
force: { type: "boolean" /* OptionType.Boolean */, alias: "f", hasSensitiveValue: false },
|
|
185
|
+
emulator: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
186
|
+
simulator: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
187
|
+
sdk: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
188
|
+
template: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
189
|
+
certificate: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
190
|
+
certificatePassword: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
186
191
|
release: {
|
|
187
|
-
type: "boolean"
|
|
192
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
188
193
|
alias: "r",
|
|
189
194
|
hasSensitiveValue: false,
|
|
190
195
|
},
|
|
191
|
-
markingMode: { type: "boolean"
|
|
192
|
-
var: { type: "object"
|
|
193
|
-
default: { type: "boolean"
|
|
194
|
-
count: { type: "number"
|
|
195
|
-
analyticsLogFile: { type: "string"
|
|
196
|
-
disableAnalytics: { type: "boolean"
|
|
197
|
-
cleanupLogFile: { type: "string"
|
|
196
|
+
markingMode: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
197
|
+
var: { type: "object" /* OptionType.Object */, hasSensitiveValue: true },
|
|
198
|
+
default: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
199
|
+
count: { type: "number" /* OptionType.Number */, hasSensitiveValue: false },
|
|
200
|
+
analyticsLogFile: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
201
|
+
disableAnalytics: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
202
|
+
cleanupLogFile: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
198
203
|
hooks: {
|
|
199
|
-
type: "boolean"
|
|
204
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
200
205
|
default: true,
|
|
201
206
|
hasSensitiveValue: false,
|
|
202
207
|
},
|
|
203
208
|
link: {
|
|
204
|
-
type: "boolean"
|
|
209
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
205
210
|
default: false,
|
|
206
211
|
hasSensitiveValue: false,
|
|
207
212
|
},
|
|
208
|
-
gradlePath: { type: "string"
|
|
209
|
-
gradleArgs: { type: "string"
|
|
210
|
-
hostProjectPath: { type: "string"
|
|
213
|
+
gradlePath: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
214
|
+
gradleArgs: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
215
|
+
hostProjectPath: { type: "string" /* OptionType.String */, hasSensitiveValue: false },
|
|
211
216
|
hostProjectModuleName: {
|
|
212
|
-
type: "string"
|
|
217
|
+
type: "string" /* OptionType.String */,
|
|
213
218
|
hasSensitiveValue: false,
|
|
214
219
|
default: constants_1.APP_FOLDER_NAME,
|
|
215
220
|
},
|
|
216
|
-
aab: { type: "boolean"
|
|
217
|
-
performance: { type: "object"
|
|
221
|
+
aab: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
222
|
+
performance: { type: "object" /* OptionType.Object */, hasSensitiveValue: true },
|
|
218
223
|
appleApplicationSpecificPassword: {
|
|
219
|
-
type: "string"
|
|
224
|
+
type: "string" /* OptionType.String */,
|
|
220
225
|
hasSensitiveValue: true,
|
|
221
226
|
},
|
|
222
|
-
appleSessionBase64: { type: "string"
|
|
223
|
-
jar: { type: "string"
|
|
224
|
-
aar: { type: "string"
|
|
225
|
-
filter: { type: "string"
|
|
227
|
+
appleSessionBase64: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
228
|
+
jar: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
229
|
+
aar: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
230
|
+
filter: { type: "string" /* OptionType.String */, hasSensitiveValue: true },
|
|
226
231
|
git: {
|
|
227
|
-
type: "boolean"
|
|
232
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
228
233
|
hasSensitiveValue: false,
|
|
229
234
|
default: true,
|
|
230
235
|
},
|
|
231
|
-
dryRun: { type: "boolean"
|
|
236
|
+
dryRun: { type: "boolean" /* OptionType.Boolean */, hasSensitiveValue: false },
|
|
232
237
|
};
|
|
233
238
|
}
|
|
234
239
|
get optionNames() {
|
|
@@ -246,6 +251,7 @@ class Options {
|
|
|
246
251
|
parsed[optionName] = this.getOptionValue(optionName);
|
|
247
252
|
}
|
|
248
253
|
_.each(parsed, (value, originalOptionName) => {
|
|
254
|
+
// when this.options are passed to yargs, it returns all of them and the ones that are not part of process.argv are set to undefined.
|
|
249
255
|
if (value === undefined) {
|
|
250
256
|
return;
|
|
251
257
|
}
|
|
@@ -255,14 +261,14 @@ class Options {
|
|
|
255
261
|
this.$errors.failWithHelp(`The option '${originalOptionName}' is not supported.`);
|
|
256
262
|
}
|
|
257
263
|
const optionType = this.getOptionType(optionName), optionValue = parsed[optionName];
|
|
258
|
-
if (_.isArray(optionValue) && optionType !== "array") {
|
|
264
|
+
if (_.isArray(optionValue) && optionType !== "array" /* OptionType.Array */) {
|
|
259
265
|
this.$errors.failWithHelp("The '%s' option requires a single value.", originalOptionName);
|
|
260
266
|
}
|
|
261
|
-
else if (optionType === "string" &&
|
|
267
|
+
else if (optionType === "string" /* OptionType.String */ &&
|
|
262
268
|
helpers.isNullOrWhitespace(optionValue)) {
|
|
263
269
|
this.$errors.failWithHelp("The option '%s' requires non-empty value.", originalOptionName);
|
|
264
270
|
}
|
|
265
|
-
else if (optionType === "array" &&
|
|
271
|
+
else if (optionType === "array" /* OptionType.Array */ &&
|
|
266
272
|
optionValue.length === 0) {
|
|
267
273
|
this.$errors.failWithHelp(`The option '${originalOptionName}' requires one or more values, separated by a space.`);
|
|
268
274
|
}
|
|
@@ -290,9 +296,16 @@ class Options {
|
|
|
290
296
|
}
|
|
291
297
|
return true;
|
|
292
298
|
}
|
|
299
|
+
// If you pass value with dash, yargs adds it to yargs.argv in two ways:
|
|
300
|
+
// with dash and without dash, replacing first symbol after it with its toUpper equivalent
|
|
301
|
+
// ex, "$ <cli name> emulate android --profile-dir" will add profile-dir to yargs.argv as profile-dir and profileDir
|
|
302
|
+
// IMPORTANT: In your code, it is better to use the value without dashes (profileDir in the example).
|
|
303
|
+
// This way your code will work in case "$ <cli name> emulate android --profile-dir" or "$ <cli name> emulate android --profileDir" is used by user.
|
|
293
304
|
getNonDashedOptionName(optionName) {
|
|
294
305
|
const matchUpperCaseLetters = optionName.match(Options.NONDASHED_OPTION_REGEX);
|
|
295
306
|
if (matchUpperCaseLetters) {
|
|
307
|
+
// get here if option with upperCase letter is specified, for example profileDir
|
|
308
|
+
// check if in knownOptions we have its kebabCase presentation
|
|
296
309
|
const secondaryOptionName = matchUpperCaseLetters[1] +
|
|
297
310
|
matchUpperCaseLetters[2].toUpperCase() +
|
|
298
311
|
matchUpperCaseLetters[3] || "";
|
|
@@ -321,15 +334,18 @@ class Options {
|
|
|
321
334
|
const args = argv._.slice(1);
|
|
322
335
|
const commands = yok_1.injector
|
|
323
336
|
.getRegisteredCommandsNames(false)
|
|
324
|
-
.filter((c) => c != "/?");
|
|
337
|
+
.filter((c) => c != "/?"); // remove the /? command, looks weird... :D
|
|
325
338
|
const currentDepth = args.length > 0 ? args.length - 1 : 0;
|
|
326
339
|
const current = (_a = current_ !== null && current_ !== void 0 ? current_ : args[currentDepth]) !== null && _a !== void 0 ? _a : "";
|
|
340
|
+
// split all commands into their components ie. "device|list" => ["device", "list"]
|
|
327
341
|
const matchGroups = commands.map((c) => c.split("|"));
|
|
342
|
+
// find all commands that match the current depth and all the previous args
|
|
328
343
|
const possibleMatches = matchGroups.filter((group) => {
|
|
329
344
|
return group.slice(0, currentDepth).every((g, i) => {
|
|
330
345
|
return g === args[i] || args[i].at(0) === "-";
|
|
331
346
|
});
|
|
332
347
|
});
|
|
348
|
+
// filter out duplicates
|
|
333
349
|
const completions = [
|
|
334
350
|
...new Set(possibleMatches
|
|
335
351
|
.map((match) => {
|
|
@@ -337,21 +353,28 @@ class Options {
|
|
|
337
353
|
})
|
|
338
354
|
.filter(Boolean)),
|
|
339
355
|
];
|
|
356
|
+
// autocomplete long -- options
|
|
340
357
|
if (current.startsWith("--")) {
|
|
341
358
|
return this.optionNames.filter((o) => o !== "_").map((o) => `--${o}`);
|
|
342
359
|
}
|
|
360
|
+
// autocomple short - options
|
|
343
361
|
if (current.startsWith("-")) {
|
|
344
362
|
return this.shorthands.map((o) => `-${o}`);
|
|
345
363
|
}
|
|
364
|
+
// autocomplete matched completions
|
|
346
365
|
return completions;
|
|
347
366
|
}));
|
|
348
367
|
this.initialArgv = parsed.argv;
|
|
349
368
|
this.argv = parsed.options(opts).argv;
|
|
369
|
+
// For backwards compatibility
|
|
370
|
+
// Previously profileDir had a default option and calling `this.$options.profileDir` always returned valid result.
|
|
371
|
+
// Now the profileDir should be used from $settingsService, but ensure the `this.$options.profileDir` returns the same value.
|
|
350
372
|
this.$settingsService.setSettings({
|
|
351
373
|
profileDir: this.argv.profileDir,
|
|
352
374
|
});
|
|
353
375
|
this.argv.profileDir = this.argv["profile-dir"] =
|
|
354
376
|
this.$settingsService.getProfileDir();
|
|
377
|
+
// if justlaunch is set, it takes precedence over the --watch flag and the default true value
|
|
355
378
|
if (this.argv.justlaunch) {
|
|
356
379
|
this.argv.watch = false;
|
|
357
380
|
}
|
|
@@ -367,6 +390,7 @@ class Options {
|
|
|
367
390
|
if (this.argv.javascript) {
|
|
368
391
|
this.argv.js = true;
|
|
369
392
|
}
|
|
393
|
+
// alias --simulator to --emulator
|
|
370
394
|
if (this.argv.simulator) {
|
|
371
395
|
this.argv.emulator = this.argv.simulator;
|
|
372
396
|
}
|
|
@@ -391,3 +415,4 @@ Options.DASHED_OPTION_REGEX = /(.+?)([A-Z])(.*)/;
|
|
|
391
415
|
Options.NONDASHED_OPTION_REGEX = /(.+?)[-]([a-zA-Z])(.*)/;
|
|
392
416
|
exports.Options = Options;
|
|
393
417
|
yok_1.injector.register("options", Options);
|
|
418
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -38,6 +38,7 @@ class PackageInstallationManager {
|
|
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
39
|
referenceVersion = referenceVersion || this.$staticConfig.version;
|
|
40
40
|
const isPreReleaseVersion = semver.prerelease(referenceVersion) !== null;
|
|
41
|
+
// if the user has some v.v.v-prerelease-xx.xx pre-release version, include pre-release versions in the search query.
|
|
41
42
|
const compatibleVersionRange = isPreReleaseVersion
|
|
42
43
|
? `~${referenceVersion}`
|
|
43
44
|
: `~${semver.major(referenceVersion)}.${semver.minor(referenceVersion)}.0`;
|
|
@@ -133,13 +134,14 @@ class PackageInstallationManager {
|
|
|
133
134
|
getInspectorFromCache(inspectorNpmPackageName, projectDir) {
|
|
134
135
|
return __awaiter(this, void 0, void 0, function* () {
|
|
135
136
|
const inspectorPath = path.join(projectDir, constants.NODE_MODULES_FOLDER_NAME, inspectorNpmPackageName);
|
|
137
|
+
// local installation takes precedence over cache
|
|
136
138
|
if (this.inspectorAlreadyInstalled(inspectorPath)) {
|
|
137
139
|
return inspectorPath;
|
|
138
140
|
}
|
|
139
141
|
const cachePath = this.getInspectorCachePath();
|
|
140
142
|
this.prepareCacheDir(cachePath);
|
|
141
143
|
const pathToPackageInCache = path.join(cachePath, constants.NODE_MODULES_FOLDER_NAME, inspectorNpmPackageName);
|
|
142
|
-
const iOSFrameworkNSValue = this.$projectDataService.getRuntimePackage(projectDir, "ios");
|
|
144
|
+
const iOSFrameworkNSValue = this.$projectDataService.getRuntimePackage(projectDir, "ios" /* constants.PlatformTypes.ios */);
|
|
143
145
|
const version = yield this.getLatestCompatibleVersion(inspectorNpmPackageName, iOSFrameworkNSValue.version);
|
|
144
146
|
let shouldInstall = !this.$fs.exists(pathToPackageInCache);
|
|
145
147
|
if (!shouldInstall) {
|
|
@@ -205,6 +207,10 @@ class PackageInstallationManager {
|
|
|
205
207
|
return yield this.$packageManager.install(packageName, pathToSave, npmOptions);
|
|
206
208
|
});
|
|
207
209
|
}
|
|
210
|
+
/**
|
|
211
|
+
* This function must not be used with packageName being a URL or local file,
|
|
212
|
+
* because npm view doens't work with those
|
|
213
|
+
*/
|
|
208
214
|
getVersion(packageName, version) {
|
|
209
215
|
var _a;
|
|
210
216
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -219,3 +225,4 @@ class PackageInstallationManager {
|
|
|
219
225
|
}
|
|
220
226
|
exports.PackageInstallationManager = PackageInstallationManager;
|
|
221
227
|
yok_1.injector.register("packageInstallationManager", PackageInstallationManager);
|
|
228
|
+
//# sourceMappingURL=package-installation-manager.js.map
|
package/lib/package-manager.js
CHANGED
|
@@ -114,6 +114,7 @@ class PackageManager {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
catch (err) {
|
|
117
|
+
// ignore error, but log info
|
|
117
118
|
this.$logger.trace("Tried to read cli.packageManager from project config and failed. Error is: ", err);
|
|
118
119
|
}
|
|
119
120
|
if (pm === constants_1.PackageManagers.yarn || this.$options.yarn) {
|
|
@@ -182,3 +183,4 @@ __decorate([
|
|
|
182
183
|
], PackageManager.prototype, "getCachePath", null);
|
|
183
184
|
exports.PackageManager = PackageManager;
|
|
184
185
|
yok_1.injector.register("packageManager", PackageManager);
|
|
186
|
+
//# sourceMappingURL=package-manager.js.map
|
|
@@ -34,13 +34,14 @@ class PnpmPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
34
34
|
if (config.disableNpmInstall) {
|
|
35
35
|
return;
|
|
36
36
|
}
|
|
37
|
-
delete config.dev;
|
|
37
|
+
delete config.dev; // temporary fix for unsupported yarn flag
|
|
38
38
|
if (config.ignoreScripts) {
|
|
39
39
|
config["ignore-scripts"] = true;
|
|
40
40
|
}
|
|
41
41
|
const packageJsonPath = path.join(pathToSave, "package.json");
|
|
42
42
|
const jsonContentBefore = this.$fs.readJson(packageJsonPath);
|
|
43
43
|
const flags = this.getFlagsString(config, true);
|
|
44
|
+
// With pnpm we need to install as "flat" or some imports wont be found
|
|
44
45
|
let params = ["i", "--shamefully-hoist"];
|
|
45
46
|
const isInstallingAllDependencies = packageName === pathToSave;
|
|
46
47
|
if (!isInstallingAllDependencies) {
|
|
@@ -59,6 +60,7 @@ class PnpmPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
59
60
|
});
|
|
60
61
|
}
|
|
61
62
|
uninstall(packageName, config, cwd) {
|
|
63
|
+
// pnpm does not want save option in remove. It saves it by default
|
|
62
64
|
delete config["save"];
|
|
63
65
|
const flags = this.getFlagsString(config, false);
|
|
64
66
|
return this.$childProcess.exec(`pnpm remove ${packageName} ${flags}`, {
|
|
@@ -134,3 +136,4 @@ __decorate([
|
|
|
134
136
|
], PnpmPackageManager.prototype, "getCachePath", null);
|
|
135
137
|
exports.PnpmPackageManager = PnpmPackageManager;
|
|
136
138
|
yok_1.injector.register("pnpm", PnpmPackageManager);
|
|
139
|
+
//# sourceMappingURL=pnpm-package-manager.js.map
|
package/lib/project-data.js
CHANGED
|
@@ -19,6 +19,7 @@ class ProjectData {
|
|
|
19
19
|
this.warnProjectId();
|
|
20
20
|
return this.projectIdentifiers.ios;
|
|
21
21
|
}
|
|
22
|
+
//just in case hook/extension modifies it.
|
|
22
23
|
set projectId(identifier) {
|
|
23
24
|
this.warnProjectId();
|
|
24
25
|
this.projectIdentifiers.ios = identifier;
|
|
@@ -44,6 +45,7 @@ class ProjectData {
|
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
47
|
projectDir = projectDir || this.$projectHelper.projectDir;
|
|
48
|
+
// If no project found, projectDir should be null
|
|
47
49
|
if (projectDir) {
|
|
48
50
|
const projectFilePath = this.getProjectFilePath(projectDir);
|
|
49
51
|
if (this.$fs.exists(projectFilePath)) {
|
|
@@ -110,6 +112,7 @@ class ProjectData {
|
|
|
110
112
|
errorInvalidProject(projectDir) {
|
|
111
113
|
const currentDir = path.resolve(".");
|
|
112
114
|
this.$logger.trace(`Unable to find project. projectDir: ${projectDir}, options.path: ${this.$options.path}, ${currentDir}`);
|
|
115
|
+
// This is the case when no project file found
|
|
113
116
|
this.$errors.fail("No project found at or above '%s' and neither was a --path specified.", projectDir || this.$options.path || currentDir);
|
|
114
117
|
}
|
|
115
118
|
getProjectFilePath(projectDir) {
|
|
@@ -125,6 +128,10 @@ class ProjectData {
|
|
|
125
128
|
return this.nsConfig[constants.CONFIG_NS_APP_RESOURCES_ENTRY];
|
|
126
129
|
}
|
|
127
130
|
return constants.APP_RESOURCES_FOLDER_NAME;
|
|
131
|
+
// return path.join(
|
|
132
|
+
// this.getAppDirectoryRelativePath(),
|
|
133
|
+
// constants.APP_RESOURCES_FOLDER_NAME
|
|
134
|
+
// );
|
|
128
135
|
}
|
|
129
136
|
getAppDirectoryPath(projectDir) {
|
|
130
137
|
const appRelativePath = this.getAppDirectoryRelativePath();
|
|
@@ -138,6 +145,7 @@ class ProjectData {
|
|
|
138
145
|
return constants.SRC_DIR;
|
|
139
146
|
}
|
|
140
147
|
else {
|
|
148
|
+
// legacy project setup often uses app folder
|
|
141
149
|
return constants.APP_FOLDER_NAME;
|
|
142
150
|
}
|
|
143
151
|
}
|
|
@@ -194,6 +202,9 @@ class ProjectData {
|
|
|
194
202
|
this.$logger.warn("[WARNING]: IProjectData.projectId is deprecated. Please use IProjectData.projectIdentifiers[platform].");
|
|
195
203
|
}
|
|
196
204
|
}
|
|
205
|
+
/**
|
|
206
|
+
* NOTE: Order of the elements is important as the TypeScript dependencies are commonly included in Angular project as well.
|
|
207
|
+
*/
|
|
197
208
|
ProjectData.PROJECT_TYPES = [
|
|
198
209
|
{
|
|
199
210
|
type: constants.ProjectTypes.JsFlavorName,
|
|
@@ -232,3 +243,4 @@ __decorate([
|
|
|
232
243
|
], ProjectData.prototype, "warnProjectId", null);
|
|
233
244
|
exports.ProjectData = ProjectData;
|
|
234
245
|
yok_1.injector.register("projectData", ProjectData, true);
|
|
246
|
+
//# sourceMappingURL=project-data.js.map
|
|
@@ -44,3 +44,4 @@ class ProjectFilesProvider extends project_files_provider_base_1.ProjectFilesPro
|
|
|
44
44
|
ProjectFilesProvider.INTERNAL_NONPROJECT_FILES = ["**/*.ts"];
|
|
45
45
|
exports.ProjectFilesProvider = ProjectFilesProvider;
|
|
46
46
|
yok_1.injector.register("projectFilesProvider", ProjectFilesProvider);
|
|
47
|
+
//# sourceMappingURL=project-files-provider.js.map
|
|
@@ -9,6 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
// NOTE: This file is used to track data in a separate process.
|
|
13
|
+
// The instances here are not shared with the ones in main CLI process.
|
|
12
14
|
const fs = require("fs");
|
|
13
15
|
const analytics_broker_1 = require("./analytics-broker");
|
|
14
16
|
const file_log_service_1 = require("../../detached-processes/file-log-service");
|
|
@@ -18,6 +20,7 @@ if (!pathToBootstrap || !fs.existsSync(pathToBootstrap)) {
|
|
|
18
20
|
throw new Error("Invalid path to bootstrap.");
|
|
19
21
|
}
|
|
20
22
|
const logFile = process.argv[3];
|
|
23
|
+
// After requiring the bootstrap we can use $injector
|
|
21
24
|
require(pathToBootstrap);
|
|
22
25
|
const analyticsLoggingService = yok_1.injector.resolve(file_log_service_1.FileLogService, { logFile });
|
|
23
26
|
analyticsLoggingService.logData({ message: "Initializing AnalyticsBroker." });
|
|
@@ -47,15 +50,15 @@ process.on("message", (data) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
47
50
|
analyticsLoggingService.logData({
|
|
48
51
|
message: `analytics-broker-process received message of type: ${JSON.stringify(data)}`,
|
|
49
52
|
});
|
|
50
|
-
if (data.type === "FinishTracking") {
|
|
53
|
+
if (data.type === "FinishTracking" /* TrackingTypes.FinishTracking */) {
|
|
51
54
|
yield finishTracking();
|
|
52
55
|
if (process.connected) {
|
|
53
56
|
analyticsLoggingService.logData({
|
|
54
|
-
message: `analytics-broker-process will send ${"ProcessFinishedTasks"} message`,
|
|
57
|
+
message: `analytics-broker-process will send ${"ProcessFinishedTasks" /* DetachedProcessMessages.ProcessFinishedTasks */} message`,
|
|
55
58
|
});
|
|
56
|
-
process.send("ProcessFinishedTasks"
|
|
59
|
+
process.send("ProcessFinishedTasks" /* DetachedProcessMessages.ProcessFinishedTasks */, () => {
|
|
57
60
|
analyticsLoggingService.logData({
|
|
58
|
-
message: `analytics-broker-process sent ${"ProcessFinishedTasks"} message and will exit gracefully now`,
|
|
61
|
+
message: `analytics-broker-process sent ${"ProcessFinishedTasks" /* DetachedProcessMessages.ProcessFinishedTasks */} message and will exit gracefully now`,
|
|
59
62
|
});
|
|
60
63
|
killCurrentProcessGracefully();
|
|
61
64
|
});
|
|
@@ -72,6 +75,7 @@ process.on("disconnect", () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
72
75
|
killCurrentProcessGracefully();
|
|
73
76
|
}));
|
|
74
77
|
analyticsLoggingService.logData({
|
|
75
|
-
message: `analytics-broker-process will send ${"ProcessReadyToReceive"} message`,
|
|
78
|
+
message: `analytics-broker-process will send ${"ProcessReadyToReceive" /* DetachedProcessMessages.ProcessReadyToReceive */} message`,
|
|
76
79
|
});
|
|
77
|
-
process.send("ProcessReadyToReceive");
|
|
80
|
+
process.send("ProcessReadyToReceive" /* DetachedProcessMessages.ProcessReadyToReceive */);
|
|
81
|
+
//# sourceMappingURL=analytics-broker-process.js.map
|