nativescript 9.1.0-alpha.15 → 9.1.0-alpha.16
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/docs/build-jekyll-md.sh +1 -1
- package/docs/man_pages/config/config-set.md +2 -0
- package/lib/android-tools-info.js +0 -12
- package/lib/base-package-manager.js +0 -7
- package/lib/bootstrap.js +1 -5
- package/lib/bun-package-manager.js +1 -14
- package/lib/color.js +0 -4
- package/lib/commands/add-platform.js +0 -1
- package/lib/commands/apple-login.js +0 -1
- package/lib/commands/appstore-list.js +0 -1
- package/lib/commands/appstore-upload.js +0 -3
- package/lib/commands/build.js +3 -3
- package/lib/commands/clean.js +1 -22
- package/lib/commands/command-base.js +0 -1
- package/lib/commands/config.js +0 -5
- package/lib/commands/create-project.js +0 -6
- package/lib/commands/debug.js +2 -6
- package/lib/commands/deploy.js +3 -3
- package/lib/commands/embedding/embed.js +0 -7
- package/lib/commands/extensibility/install-extension.js +0 -1
- package/lib/commands/extensibility/list-extensions.js +0 -1
- package/lib/commands/extensibility/uninstall-extension.js +0 -1
- package/lib/commands/fonts.js +0 -1
- package/lib/commands/generate-assets.js +0 -1
- package/lib/commands/generate-help.js +0 -1
- package/lib/commands/generate.js +1 -48
- package/lib/commands/hooks/common.js +1 -2
- package/lib/commands/hooks/hooks-lock.js +0 -1
- package/lib/commands/hooks/hooks.js +0 -1
- package/lib/commands/info.js +0 -1
- package/lib/commands/install.js +0 -1
- package/lib/commands/list-platforms.js +0 -1
- package/lib/commands/migrate.js +0 -1
- package/lib/commands/native-add.js +0 -5
- package/lib/commands/platform-clean.js +0 -1
- package/lib/commands/plugin/add-plugin.js +0 -1
- package/lib/commands/plugin/build-plugin.js +0 -1
- package/lib/commands/plugin/create-plugin.js +0 -5
- package/lib/commands/plugin/list-plugins.js +0 -1
- package/lib/commands/plugin/remove-plugin.js +0 -2
- package/lib/commands/plugin/update-plugin.js +0 -1
- package/lib/commands/post-install.js +0 -6
- package/lib/commands/prepare.js +5 -5
- package/lib/commands/preview.js +0 -2
- package/lib/commands/remove-platform.js +0 -1
- package/lib/commands/resources/resources-update.js +0 -2
- package/lib/commands/run.js +0 -1
- package/lib/commands/setup.js +0 -1
- package/lib/commands/start.js +0 -1
- package/lib/commands/test-init.js +0 -4
- package/lib/commands/test.js +3 -9
- package/lib/commands/typings.js +1 -2
- package/lib/commands/update-platform.js +0 -5
- package/lib/commands/update.js +0 -2
- package/lib/commands/widget.js +0 -18
- package/lib/common/bootstrap.js +0 -1
- package/lib/common/child-process.js +0 -3
- package/lib/common/codeGeneration/code-entity.js +0 -1
- package/lib/common/codeGeneration/code-printer.js +0 -1
- package/lib/common/command-params.js +0 -1
- package/lib/common/commands/analytics.js +0 -3
- package/lib/common/commands/autocompletion.js +0 -3
- package/lib/common/commands/device/device-log-stream.js +0 -1
- package/lib/common/commands/device/get-file.js +0 -2
- package/lib/common/commands/device/list-applications.js +0 -1
- package/lib/common/commands/device/list-devices.js +0 -3
- package/lib/common/commands/device/list-files.js +0 -2
- package/lib/common/commands/device/put-file.js +0 -2
- package/lib/common/commands/device/run-application.js +0 -1
- package/lib/common/commands/device/stop-application.js +0 -1
- package/lib/common/commands/device/uninstall-application.js +0 -1
- package/lib/common/commands/doctor.js +3 -3
- package/lib/common/commands/generate-messages.js +0 -1
- package/lib/common/commands/help.js +0 -1
- package/lib/common/commands/package-manager-get.js +0 -1
- package/lib/common/commands/package-manager-set.js +0 -1
- package/lib/common/commands/post-install.js +0 -1
- package/lib/common/commands/preuninstall.js +2 -11
- package/lib/common/commands/proxy/proxy-base.js +0 -4
- package/lib/common/commands/proxy/proxy-clear.js +0 -1
- package/lib/common/commands/proxy/proxy-get.js +0 -1
- package/lib/common/commands/proxy/proxy-set.js +0 -1
- package/lib/common/common-lib.js +0 -1
- package/lib/common/constants.js +14 -12
- package/lib/common/declarations.d.ts +37 -117
- package/lib/common/decorators.js +0 -48
- package/lib/common/definitions/key-commands.js +8 -0
- package/lib/common/dispatchers.js +1 -10
- package/lib/common/enums.js +42 -0
- package/lib/common/errors.js +4 -13
- package/lib/common/file-system.js +2 -13
- package/lib/common/header.js +0 -3
- package/lib/common/helpers.js +3 -89
- package/lib/common/host-info.js +0 -4
- package/lib/common/http-client.js +0 -20
- package/lib/common/logger/appenders/cli-appender.js +0 -4
- package/lib/common/logger/appenders/emit-appender.js +0 -4
- package/lib/common/logger/layouts/cli-layout.js +0 -1
- package/lib/common/logger/logger.js +0 -5
- package/lib/common/messages/messages.js +0 -6
- package/lib/common/mobile/android/android-application-manager.js +1 -20
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
- package/lib/common/mobile/android/android-debug-bridge.js +0 -6
- package/lib/common/mobile/android/android-device-file-system.js +0 -4
- package/lib/common/mobile/android/android-device-hash-service.js +0 -3
- package/lib/common/mobile/android/android-device.js +0 -8
- package/lib/common/mobile/android/android-emulator-services.js +1 -2
- package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
- package/lib/common/mobile/android/android-log-filter.js +0 -4
- package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
- package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
- package/lib/common/mobile/android/genymotion/genymotion-service.js +1 -6
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
- package/lib/common/mobile/android/logcat-helper.js +0 -13
- package/lib/common/mobile/application-manager-base.js +0 -6
- package/lib/common/mobile/device-emitter.js +0 -4
- package/lib/common/mobile/device-log-emitter.js +0 -1
- package/lib/common/mobile/device-log-provider-base.js +0 -1
- package/lib/common/mobile/device-log-provider.js +0 -23
- package/lib/common/mobile/device-platforms-constants.js +0 -1
- package/lib/common/mobile/emulator-helper.js +0 -3
- package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
- package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -9
- package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
- package/lib/common/mobile/ios/device/ios-device.js +0 -4
- package/lib/common/mobile/ios/ios-device-base.js +0 -1
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
- package/lib/common/mobile/ios/ios-log-filter.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
- package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
- package/lib/common/mobile/log-filter.js +0 -2
- package/lib/common/mobile/logging-levels.js +0 -1
- package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
- package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
- package/lib/common/mobile/mobile-core/devices-service.js +0 -69
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-helper.js +0 -1
- package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
- package/lib/common/opener.js +0 -1
- package/lib/common/os-info.js +0 -1
- package/lib/common/plist-parser.js +0 -1
- package/lib/common/project-helper.js +0 -1
- package/lib/common/prompter.js +1 -9
- package/lib/common/queue.js +0 -1
- package/lib/common/resource-loader.js +0 -1
- package/lib/common/services/analytics/google-analytics-custom-dimensions.js +13 -0
- package/lib/common/services/auto-completion-service.js +1 -13
- package/lib/common/services/cancellation.js +2 -2
- package/lib/common/services/commands-service.js +8 -17
- package/lib/common/services/help-service.js +4 -11
- package/lib/common/services/hooks-service.js +0 -13
- package/lib/common/services/ios-notification-service.js +0 -1
- package/lib/common/services/json-file-settings-service.js +0 -6
- package/lib/common/services/lock-service.js +0 -6
- package/lib/common/services/message-contract-generator.js +0 -1
- package/lib/common/services/messages-service.js +0 -1
- package/lib/common/services/micro-templating-service.js +0 -6
- package/lib/common/services/net-service.js +0 -3
- package/lib/common/services/project-files-manager.js +0 -5
- package/lib/common/services/project-files-provider-base.js +0 -1
- package/lib/common/services/proxy-service.js +0 -1
- package/lib/common/services/qr.js +0 -1
- package/lib/common/services/settings-service.js +0 -1
- package/lib/common/services/xcode-select-service.js +0 -1
- package/lib/common/utils.js +0 -1
- package/lib/common/validators/project-name-validator.js +0 -1
- package/lib/common/validators/validation-result.js +0 -1
- package/lib/common/verify-node-version.js +2 -8
- package/lib/common/yok.js +12 -32
- package/lib/config.js +1 -22
- package/lib/constants-provider.js +0 -1
- package/lib/constants.js +54 -58
- package/lib/controllers/build-controller.js +3 -4
- package/lib/controllers/debug-controller.js +3 -8
- package/lib/controllers/deploy-controller.js +0 -1
- package/lib/controllers/migrate-controller.js +4 -90
- package/lib/controllers/platform-controller.js +2 -9
- package/lib/controllers/prepare-controller.js +8 -24
- package/lib/controllers/run-controller.js +1 -81
- package/lib/controllers/update-controller-base.js +0 -1
- package/lib/controllers/update-controller.js +0 -11
- package/lib/data/build-data.js +0 -1
- package/lib/data/controller-data-base.js +0 -1
- package/lib/data/debug-data.js +0 -1
- package/lib/data/platform-data.js +0 -1
- package/lib/data/prepare-data.js +0 -1
- package/lib/data/run-data.js +0 -1
- package/lib/definitions/project.d.ts +1 -6
- package/lib/definitions/system-warnings.js +8 -0
- package/lib/detached-processes/cleanup-js-subprocess.js +3 -8
- package/lib/detached-processes/cleanup-process.js +15 -18
- package/lib/detached-processes/detached-process-enums.js +24 -0
- package/lib/detached-processes/file-log-service.js +2 -2
- package/lib/device-path-provider.js +0 -1
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
- package/lib/device-sockets/ios/notification.js +0 -3
- package/lib/device-sockets/ios/socket-request-executor.js +0 -3
- package/lib/helpers/android-bundle-validator-helper.js +1 -2
- package/lib/helpers/deploy-command-helper.js +0 -1
- package/lib/helpers/key-command-helper.js +3 -4
- package/lib/helpers/livesync-command-helper.js +2 -4
- package/lib/helpers/network-connectivity-validator.js +0 -1
- package/lib/helpers/options-track-helper.js +4 -3
- package/lib/helpers/package-path-helper.js +0 -1
- package/lib/helpers/platform-command-helper.js +2 -7
- package/lib/helpers/version-validator-helper.js +0 -1
- package/lib/key-commands/bootstrap.js +3 -3
- package/lib/key-commands/index.js +5 -5
- package/lib/nativescript-cli-lib-bootstrap.js +0 -4
- package/lib/nativescript-cli-lib.js +0 -1
- package/lib/nativescript-cli.js +2 -11
- package/lib/node/pbxproj-dom-xcode.js +0 -1
- package/lib/node/xcode.js +0 -1
- package/lib/node-package-manager.js +1 -11
- package/lib/options.js +121 -145
- package/lib/package-installation-manager.js +1 -8
- package/lib/package-manager.js +0 -2
- package/lib/platform-command-param.js +0 -1
- package/lib/pnpm-package-manager.js +1 -4
- package/lib/project-data.js +0 -12
- package/lib/providers/project-files-provider.js +0 -1
- package/lib/resolvers/livesync-service-resolver.js +0 -1
- package/lib/services/analytics/analytics-broker-process.js +8 -10
- package/lib/services/analytics/analytics-broker.js +2 -2
- package/lib/services/analytics/analytics-service.js +29 -29
- package/lib/services/analytics/google-analytics-provider.js +16 -13
- package/lib/services/analytics-settings-service.js +0 -5
- package/lib/services/android/android-bundle-tool-service.js +0 -1
- package/lib/services/android/gradle-build-args-service.js +0 -3
- package/lib/services/android/gradle-build-service.js +0 -1
- package/lib/services/android/gradle-command-service.js +0 -1
- package/lib/services/android-device-debug-service.js +0 -6
- package/lib/services/android-plugin-build-service.js +2 -31
- package/lib/services/android-project-service.js +4 -71
- package/lib/services/android-resources-migration-service.js +0 -7
- package/lib/services/apple-portal/apple-portal-application-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-session-service.js +4 -6
- package/lib/services/apple-portal/srp/srp-wrapper.js +1 -4
- package/lib/services/assets-generation/assets-generation-service.js +13 -11
- package/lib/services/build-artifacts-service.js +1 -2
- package/lib/services/build-data-service.js +0 -1
- package/lib/services/build-info-file-service.js +0 -1
- package/lib/services/bundler/bundler-compiler-service.js +1 -144
- package/lib/services/bundler/bundler.js +0 -1
- package/lib/services/cleanup-service.js +10 -13
- package/lib/services/cocoapods-platform-manager.js +0 -9
- package/lib/services/cocoapods-service.js +1 -21
- package/lib/services/debug-data-service.js +0 -1
- package/lib/services/debug-service-base.js +0 -7
- package/lib/services/device/device-install-app-service.js +1 -2
- package/lib/services/doctor-service.js +6 -21
- package/lib/services/extensibility-service.js +0 -8
- package/lib/services/files-hash-service.js +0 -1
- package/lib/services/hmr-status-service.js +0 -2
- package/lib/services/info-service.js +0 -1
- package/lib/services/initialize-service.js +2 -5
- package/lib/services/ios/export-options-plist-service.js +0 -4
- package/lib/services/ios/ios-signing-service.js +0 -4
- package/lib/services/ios/spm-service.js +0 -119
- package/lib/services/ios/xcodebuild-args-service.js +0 -29
- package/lib/services/ios/xcodebuild-command-service.js +0 -3
- package/lib/services/ios/xcodebuild-service.js +1 -2
- package/lib/services/ios-debugger-port-service.js +0 -1
- package/lib/services/ios-device-debug-service.js +0 -1
- package/lib/services/ios-entitlements-service.js +0 -1
- package/lib/services/ios-extensions-service.js +0 -1
- package/lib/services/ios-log-filter.js +0 -20
- package/lib/services/ios-native-target-service.js +5 -6
- package/lib/services/ios-project-service.js +7 -133
- package/lib/services/ios-provision-service.js +0 -3
- package/lib/services/ios-watch-app-service.js +10 -60
- package/lib/services/ip-service.js +0 -2
- package/lib/services/itmstransporter-service.js +0 -1
- package/lib/services/karma-execution.js +0 -2
- package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
- package/lib/services/livesync/android-device-livesync-service.js +0 -2
- package/lib/services/livesync/android-device-livesync-sockets-service.js +0 -3
- package/lib/services/livesync/android-livesync-service.js +0 -1
- package/lib/services/livesync/android-livesync-tool.js +0 -4
- package/lib/services/livesync/device-livesync-service-base.js +0 -2
- package/lib/services/livesync/ios-device-livesync-service.js +0 -7
- package/lib/services/livesync/ios-livesync-service.js +0 -55
- package/lib/services/livesync/livesync-socket.js +0 -1
- package/lib/services/livesync/platform-livesync-service-base.js +0 -5
- package/lib/services/livesync-process-data-service.js +0 -1
- package/lib/services/log-parser-service.js +0 -1
- package/lib/services/log-source-map-service.js +0 -15
- package/lib/services/marking-mode-service.js +10 -8
- package/lib/services/metadata-filtering-service.js +0 -1
- package/lib/services/npm-config-service.js +0 -4
- package/lib/services/pacote-service.js +0 -7
- package/lib/services/performance-service.js +2 -3
- package/lib/services/platform/add-platform-service.js +2 -49
- package/lib/services/platform/platform-validation-service.js +0 -1
- package/lib/services/platform/prepare-native-platform-service.js +3 -5
- package/lib/services/platform-environment-requirements.js +4 -8
- package/lib/services/platform-project-service-base.js +0 -1
- package/lib/services/platforms-data-service.js +0 -1
- package/lib/services/plugins-service.js +2 -20
- package/lib/services/prepare-data-service.js +0 -1
- package/lib/services/project-backup-service.js +0 -4
- package/lib/services/project-changes-service.js +3 -14
- package/lib/services/project-cleanup-service.js +0 -2
- package/lib/services/project-config-service.js +2 -21
- package/lib/services/project-data-service.js +7 -36
- package/lib/services/project-name-service.js +0 -1
- package/lib/services/project-service.js +0 -10
- package/lib/services/project-templates-service.js +2 -3
- package/lib/services/qr-code-terminal-service.js +0 -1
- package/lib/services/require-service.js +0 -1
- package/lib/services/start-service.js +0 -1
- package/lib/services/temp-service.js +0 -3
- package/lib/services/terminal-spinner-service.js +0 -2
- package/lib/services/test-execution-service.js +3 -9
- package/lib/services/test-initialization-service.js +0 -4
- package/lib/services/timeline-profiler-service.js +0 -1
- package/lib/services/user-settings-service.js +0 -1
- package/lib/services/versions-service.js +5 -6
- package/lib/services/watch-ignore-list-service.js +0 -1
- package/lib/services/xcconfig-service.js +45 -12
- package/lib/services/xcproj-service.js +0 -1
- package/lib/shared-event-bus.js +0 -6
- package/lib/sys-info.js +2 -2
- package/lib/tools/config-manipulation/config-transformer.js +0 -12
- package/lib/tools/node-modules/node-modules-builder.js +0 -1
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
- package/lib/yarn-package-manager.js +0 -1
- package/lib/yarn2-package-manager.js +0 -3
- package/package.json +7 -18
- package/lib/.d.ts +0 -504
- package/lib/common/definitions/key-commands.d.ts +0 -62
- package/lib/common/services/analytics/google-analytics-custom-dimensions.d.ts +0 -16
- package/lib/definitions/system-warnings.d.ts +0 -4
- package/lib/detached-processes/detached-process-enums.d.ts +0 -70
- package/lib/services/analytics/google-analytics-cross-client-custom-dimensions.d.ts +0 -6
|
@@ -7,13 +7,12 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
7
7
|
};
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.PlatformEnvironmentRequirements = void 0;
|
|
10
|
+
const constants_1 = require("../constants");
|
|
10
11
|
const helpers_1 = require("../common/helpers");
|
|
11
12
|
const os_1 = require("os");
|
|
12
13
|
const yok_1 = require("../common/yok");
|
|
13
14
|
class PlatformEnvironmentRequirements {
|
|
14
|
-
constructor($doctorService, $errors, $analyticsService,
|
|
15
|
-
// @ts-ignore - required by the hook helper!
|
|
16
|
-
$injector) {
|
|
15
|
+
constructor($doctorService, $errors, $analyticsService, $injector) {
|
|
17
16
|
this.$doctorService = $doctorService;
|
|
18
17
|
this.$errors = $errors;
|
|
19
18
|
this.$analyticsService = $analyticsService;
|
|
@@ -24,7 +23,7 @@ class PlatformEnvironmentRequirements {
|
|
|
24
23
|
const selectedOption = null;
|
|
25
24
|
if (process.env.NS_SKIP_ENV_CHECK) {
|
|
26
25
|
await this.$analyticsService.trackEventActionInGoogleAnalytics({
|
|
27
|
-
action:
|
|
26
|
+
action: constants_1.TrackActionNames.CheckEnvironmentRequirements,
|
|
28
27
|
additionalData: "Skipped: NS_SKIP_ENV_CHECK is set",
|
|
29
28
|
});
|
|
30
29
|
return {
|
|
@@ -39,9 +38,8 @@ class PlatformEnvironmentRequirements {
|
|
|
39
38
|
forceCheck: input.forceCheck,
|
|
40
39
|
});
|
|
41
40
|
if (!canExecute) {
|
|
42
|
-
// if (!isInteractive()) {
|
|
43
41
|
await this.$analyticsService.trackEventActionInGoogleAnalytics({
|
|
44
|
-
action:
|
|
42
|
+
action: constants_1.TrackActionNames.CheckEnvironmentRequirements,
|
|
45
43
|
additionalData: "Non-interactive terminal, unable to execute local builds.",
|
|
46
44
|
});
|
|
47
45
|
this.fail(this.getNonInteractiveConsoleMessage(platform));
|
|
@@ -61,7 +59,6 @@ class PlatformEnvironmentRequirements {
|
|
|
61
59
|
].join(os_1.EOL);
|
|
62
60
|
}
|
|
63
61
|
getEnvVerificationMessage(platform) {
|
|
64
|
-
// map process.platform to OS name used in docs
|
|
65
62
|
const os = {
|
|
66
63
|
linux: "linux",
|
|
67
64
|
win32: "windows",
|
|
@@ -80,4 +77,3 @@ __decorate([
|
|
|
80
77
|
(0, helpers_1.hook)("checkEnvironment")
|
|
81
78
|
], PlatformEnvironmentRequirements.prototype, "checkEnvironmentRequirements", null);
|
|
82
79
|
yok_1.injector.register("platformEnvironmentRequirements", PlatformEnvironmentRequirements);
|
|
83
|
-
//# sourceMappingURL=platform-environment-requirements.js.map
|
|
@@ -54,7 +54,6 @@ class PluginsService {
|
|
|
54
54
|
const realNpmPackageJson = this.$fs.readJson(pathToRealNpmPackageJson);
|
|
55
55
|
if (realNpmPackageJson.nativescript) {
|
|
56
56
|
const pluginData = this.convertToPluginData(realNpmPackageJson, projectData.projectDir);
|
|
57
|
-
// Validate
|
|
58
57
|
const action = async (pluginDestinationPath, platform, platformData) => {
|
|
59
58
|
this.isPluginDataValidForPlatform(pluginData, platform, projectData);
|
|
60
59
|
};
|
|
@@ -140,9 +139,6 @@ class PluginsService {
|
|
|
140
139
|
paths: [projectData.projectDir],
|
|
141
140
|
});
|
|
142
141
|
if (pathToPackage) {
|
|
143
|
-
// return false if the dependency is installed - we'll filter out boolean values
|
|
144
|
-
// and end up with an array of dep names that are not installed if we end up
|
|
145
|
-
// inside the catch block.
|
|
146
142
|
return false;
|
|
147
143
|
}
|
|
148
144
|
this.$logger.trace(`${dep} is not installed, or couldn't be found`);
|
|
@@ -175,9 +171,6 @@ class PluginsService {
|
|
|
175
171
|
return productionPlugins
|
|
176
172
|
.map((plugin) => this.convertToPluginData(plugin, projectData.projectDir))
|
|
177
173
|
.filter((item, idx, self) => {
|
|
178
|
-
// Filter out duplicates to speed up build times by not building the same dependency
|
|
179
|
-
// multiple times. One possible downside is that if there are different versions
|
|
180
|
-
// of the same native dependency only the first one in the array will be built
|
|
181
174
|
return self.findIndex((p) => p.name === item.name) === idx;
|
|
182
175
|
});
|
|
183
176
|
}
|
|
@@ -209,11 +202,9 @@ class PluginsService {
|
|
|
209
202
|
const dependenciesGroupedByName = _.groupBy(productionDependencies, (p) => p.name);
|
|
210
203
|
_.each(dependenciesGroupedByName, (dependencyOccurrences, dependencyName) => {
|
|
211
204
|
if (dependencyOccurrences.length > 1) {
|
|
212
|
-
// the dependency exists multiple times in node_modules
|
|
213
205
|
const dependencyOccurrencesGroupedByVersion = _.groupBy(dependencyOccurrences, (g) => g.version);
|
|
214
206
|
const versions = _.keys(dependencyOccurrencesGroupedByVersion);
|
|
215
207
|
if (versions.length === 1) {
|
|
216
|
-
// all dependencies with this name have the same version
|
|
217
208
|
this.$logger.trace(`Detected same versions (${_.first(versions)}) of the ${dependencyName} installed at locations: ${_.map(dependencyOccurrences, (d) => d.directory).join(", ")}`);
|
|
218
209
|
}
|
|
219
210
|
else {
|
|
@@ -243,11 +234,9 @@ class PluginsService {
|
|
|
243
234
|
const dependenciesGroupedByFrameworkName = _.groupBy(dependenciesWithFrameworks, (d) => d.frameworkName);
|
|
244
235
|
_.each(dependenciesGroupedByFrameworkName, (dependencyOccurrences, frameworkName) => {
|
|
245
236
|
if (dependencyOccurrences.length > 1) {
|
|
246
|
-
// A framework exists multiple times in node_modules
|
|
247
237
|
const groupedByName = _.groupBy(dependencyOccurrences, (d) => d.name);
|
|
248
238
|
const pluginsNames = _.keys(groupedByName);
|
|
249
239
|
if (pluginsNames.length > 1) {
|
|
250
|
-
// fail - the same framework is installed by different dependencies.
|
|
251
240
|
const locations = dependencyOccurrences.map((d) => d.frameworkLocation);
|
|
252
241
|
let msg = `Detected the framework ${frameworkName} is installed from multiple plugins at locations:\n${locations.join("\n")}\n`;
|
|
253
242
|
msg += this.getHelpMessage(projectDir);
|
|
@@ -257,7 +246,6 @@ class PluginsService {
|
|
|
257
246
|
const dependencyOccurrencesGroupedByVersion = _.groupBy(dependencyOccurrences, (g) => g.version);
|
|
258
247
|
const versions = _.keys(dependencyOccurrencesGroupedByVersion);
|
|
259
248
|
if (versions.length === 1) {
|
|
260
|
-
// all dependencies with this name have the same version
|
|
261
249
|
this.$logger.warn(`Detected the framework ${frameworkName} is installed multiple times from the same versions of plugin (${_.first(versions)}) at locations: ${_.map(dependencyOccurrences, (d) => d.directory).join(", ")}`);
|
|
262
250
|
const selectedPackage = _.minBy(dependencyOccurrences, (d) => d.depth);
|
|
263
251
|
this.$logger.info(color_1.color.green(`CLI will use only the native code from '${selectedPackage.directory}'.`));
|
|
@@ -309,7 +297,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
309
297
|
pluginData.isPlugin = !!cacheData.nativescript;
|
|
310
298
|
pluginData.pluginPlatformsFolderPath = (platform) => {
|
|
311
299
|
if (this.$mobileHelper.isvisionOSPlatform(platform)) {
|
|
312
|
-
platform =
|
|
300
|
+
platform = constants.PlatformTypes.ios;
|
|
313
301
|
}
|
|
314
302
|
return path.join(pluginData.fullPath, "platforms", platform.toLowerCase());
|
|
315
303
|
};
|
|
@@ -367,7 +355,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
367
355
|
return _.keys(require(packageJsonFilePath).dependencies);
|
|
368
356
|
}
|
|
369
357
|
getNodeModuleData(module, projectDir) {
|
|
370
|
-
// module can be modulePath or moduleName
|
|
371
358
|
if (!this.$fs.exists(module) || path.basename(module) !== "package.json") {
|
|
372
359
|
const resolvedPath = this.getPackageJsonFilePathForModule(module, projectDir);
|
|
373
360
|
if (!resolvedPath) {
|
|
@@ -404,7 +391,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
404
391
|
return this.parseNpmCommandResult(npmCommandArguments);
|
|
405
392
|
}
|
|
406
393
|
parseNpmCommandResult(npmCommandResult) {
|
|
407
|
-
return npmCommandResult.split("@")[0];
|
|
394
|
+
return npmCommandResult.split("@")[0];
|
|
408
395
|
}
|
|
409
396
|
async executeForAllInstalledPlatforms(action, projectData) {
|
|
410
397
|
const availablePlatforms = this.$mobileHelper.platformNames.map((p) => p.toLowerCase());
|
|
@@ -419,8 +406,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
419
406
|
}
|
|
420
407
|
getInstalledFrameworkVersion(platform, projectData) {
|
|
421
408
|
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, platform);
|
|
422
|
-
// const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
|
|
423
|
-
// const frameworkData = this.$projectDataService.getNSValue(projectData.projectDir, platformData.frameworkPackageName);
|
|
424
409
|
return runtimePackage.version;
|
|
425
410
|
}
|
|
426
411
|
isPluginDataValidForPlatform(pluginData, platform, projectData) {
|
|
@@ -450,7 +435,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
450
435
|
}
|
|
451
436
|
getAllPluginsNativeHashes(pathToPluginsBuildFile) {
|
|
452
437
|
if (this.$options.hostProjectPath) {
|
|
453
|
-
// TODO: force rebuild plugins for now until we decide where to put .ns-plugins-build-data.json when embedding
|
|
454
438
|
return {};
|
|
455
439
|
}
|
|
456
440
|
let data = {};
|
|
@@ -461,7 +445,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
461
445
|
}
|
|
462
446
|
setPluginNativeHashes(opts) {
|
|
463
447
|
if (this.$options.hostProjectPath) {
|
|
464
|
-
// TODO: force rebuild plugins for now until we decide where to put .ns-plugins-build-data.json when embedding
|
|
465
448
|
return;
|
|
466
449
|
}
|
|
467
450
|
opts.allPluginsNativeHashes[opts.pluginData.name] =
|
|
@@ -482,4 +465,3 @@ PluginsService.LOCK_FILES = [
|
|
|
482
465
|
"pnpm-lock.yaml",
|
|
483
466
|
];
|
|
484
467
|
yok_1.injector.register("pluginsService", PluginsService);
|
|
485
|
-
//# sourceMappingURL=plugins-service.js.map
|
|
@@ -47,7 +47,6 @@ ProjectBackupService.Backup = class Backup {
|
|
|
47
47
|
backedUpPaths.push(pathToBackup);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
// create backup.json
|
|
51
50
|
this.$super.$fs.writeJson(path.resolve(this.backupDir, "_backup.json"), {
|
|
52
51
|
name: this.name,
|
|
53
52
|
paths: backedUpPaths,
|
|
@@ -68,7 +67,6 @@ ProjectBackupService.Backup = class Backup {
|
|
|
68
67
|
}
|
|
69
68
|
}
|
|
70
69
|
this.$super.$logger.trace(backupData);
|
|
71
|
-
// restore files
|
|
72
70
|
return this;
|
|
73
71
|
}
|
|
74
72
|
isUpToDate() {
|
|
@@ -78,7 +76,6 @@ ProjectBackupService.Backup = class Backup {
|
|
|
78
76
|
}
|
|
79
77
|
for (const pathToBackup of backupData.paths) {
|
|
80
78
|
const sourcePath = path.resolve(this.backupDir, pathToBackup);
|
|
81
|
-
// if any of the files don't exist the backup is not up-to-date
|
|
82
79
|
if (!this.$super.$fs.exists(sourcePath)) {
|
|
83
80
|
return false;
|
|
84
81
|
}
|
|
@@ -115,4 +112,3 @@ ProjectBackupService.Backup = class Backup {
|
|
|
115
112
|
}
|
|
116
113
|
};
|
|
117
114
|
yok_1.injector.register("projectBackupService", ProjectBackupService);
|
|
118
|
-
//# sourceMappingURL=project-backup-service.js.map
|
|
@@ -64,7 +64,6 @@ class ProjectChangesService {
|
|
|
64
64
|
this._prepareInfo.projectFileHash = this.getProjectFileStrippedHash(projectData.projectDir, platformData);
|
|
65
65
|
this._changesInfo.nativeChanged = this.isProjectFileChanged(projectData.projectDir, platformData);
|
|
66
66
|
}
|
|
67
|
-
// If this causes too much rebuilds of the plugins or uncecessary builds for Android, move overrideCocoapods to prepareInfo.
|
|
68
67
|
this._changesInfo.nsConfigChanged = this.filesChanged([
|
|
69
68
|
path.join(projectData.projectDir, constants_1.CONFIG_FILE_NAME_JS),
|
|
70
69
|
path.join(projectData.projectDir, constants_1.CONFIG_FILE_NAME_TS),
|
|
@@ -122,7 +121,6 @@ class ProjectChangesService {
|
|
|
122
121
|
}
|
|
123
122
|
getPrepareInfo(platformData) {
|
|
124
123
|
if (this.$options.hostProjectPath) {
|
|
125
|
-
// TODO: always prepare for now until we decide where to keep the .nsprepareinfo file when embedding
|
|
126
124
|
return null;
|
|
127
125
|
}
|
|
128
126
|
const prepareInfoFilePath = this.getPrepareInfoFilePath(platformData);
|
|
@@ -142,7 +140,6 @@ class ProjectChangesService {
|
|
|
142
140
|
await this.ensurePrepareInfo(platformData, projectData, prepareData);
|
|
143
141
|
}
|
|
144
142
|
if (this.$options.hostProjectPath) {
|
|
145
|
-
// TODO: do not save for now until we decide where to keep the .nsprepareinfo file when embedding
|
|
146
143
|
return null;
|
|
147
144
|
}
|
|
148
145
|
const prepareInfoFilePath = this.getPrepareInfoFilePath(platformData);
|
|
@@ -152,7 +149,7 @@ class ProjectChangesService {
|
|
|
152
149
|
this._prepareInfo = this._prepareInfo || this.getPrepareInfo(platformData);
|
|
153
150
|
if (this._prepareInfo &&
|
|
154
151
|
addedPlatform.nativePlatformStatus ===
|
|
155
|
-
|
|
152
|
+
constants_1.NativePlatformStatus.alreadyPrepared) {
|
|
156
153
|
this._prepareInfo.nativePlatformStatus =
|
|
157
154
|
addedPlatform.nativePlatformStatus;
|
|
158
155
|
}
|
|
@@ -176,8 +173,8 @@ class ProjectChangesService {
|
|
|
176
173
|
return false;
|
|
177
174
|
}
|
|
178
175
|
const nativePlatformStatus = !prepareData.nativePrepare || !prepareData.nativePrepare.skipNativePrepare
|
|
179
|
-
?
|
|
180
|
-
:
|
|
176
|
+
? constants_1.NativePlatformStatus.requiresPrepare
|
|
177
|
+
: constants_1.NativePlatformStatus.requiresPlatformAdd;
|
|
181
178
|
this._prepareInfo = {
|
|
182
179
|
time: "",
|
|
183
180
|
nativePlatformStatus,
|
|
@@ -200,13 +197,6 @@ class ProjectChangesService {
|
|
|
200
197
|
const projectFileContents = this.$fs.readJson(projectFilePath);
|
|
201
198
|
const relevantProperties = ["dependencies"];
|
|
202
199
|
const projectFileStrippedContents = _.pick(projectFileContents, relevantProperties);
|
|
203
|
-
// _(this.$devicePlatformsConstants)
|
|
204
|
-
// .keys()
|
|
205
|
-
// .map(k => k.toLowerCase())
|
|
206
|
-
// .difference([platformData.platformNameLowerCase])
|
|
207
|
-
// .each(otherPlatform => {
|
|
208
|
-
// delete projectFileContents.nativescript[`tns-${otherPlatform}`];
|
|
209
|
-
// });
|
|
210
200
|
return (0, helpers_1.getHash)(JSON.stringify(projectFileStrippedContents));
|
|
211
201
|
}
|
|
212
202
|
isProjectFileChanged(projectDir, platformData) {
|
|
@@ -272,4 +262,3 @@ __decorate([
|
|
|
272
262
|
(0, helpers_1.hook)("checkForChanges")
|
|
273
263
|
], ProjectChangesService.prototype, "checkForChanges", null);
|
|
274
264
|
yok_1.injector.register("projectChangesService", ProjectChangesService);
|
|
275
|
-
//# sourceMappingURL=project-changes-service.js.map
|
|
@@ -28,7 +28,6 @@ class ProjectCleanupService {
|
|
|
28
28
|
success = success && cleanRes.ok;
|
|
29
29
|
}
|
|
30
30
|
if (!(options === null || options === void 0 ? void 0 : options.silent)) {
|
|
31
|
-
// required to print an empty line for the spinner to not replace the last status... (probably a bug in the spinners)
|
|
32
31
|
console.log();
|
|
33
32
|
}
|
|
34
33
|
if (stats) {
|
|
@@ -88,4 +87,3 @@ class ProjectCleanupService {
|
|
|
88
87
|
}
|
|
89
88
|
exports.ProjectCleanupService = ProjectCleanupService;
|
|
90
89
|
yok_1.injector.register("projectCleanupService", ProjectCleanupService);
|
|
91
|
-
//# sourceMappingURL=project-cleanup-service.js.map
|
|
@@ -35,7 +35,6 @@ class ProjectConfigService {
|
|
|
35
35
|
return (this.forceUsingLegacyConfig = force);
|
|
36
36
|
}
|
|
37
37
|
requireFromString(src, filename) {
|
|
38
|
-
// @ts-ignore
|
|
39
38
|
const m = new module.constructor();
|
|
40
39
|
m.paths = module.paths;
|
|
41
40
|
m._compile(src, filename);
|
|
@@ -58,7 +57,6 @@ export default {
|
|
|
58
57
|
} as NativeScriptConfig;`.trim();
|
|
59
58
|
}
|
|
60
59
|
warnUsingLegacyNSConfig() {
|
|
61
|
-
// todo: remove hack
|
|
62
60
|
const isMigrate = _.get(this.$options, "argv._[0]") === "migrate";
|
|
63
61
|
if (isMigrate) {
|
|
64
62
|
return;
|
|
@@ -67,7 +65,6 @@ export default {
|
|
|
67
65
|
}
|
|
68
66
|
detectProjectConfigs(projectDir) {
|
|
69
67
|
var _a;
|
|
70
|
-
// allow overriding config name with env variable or --config (or -c)
|
|
71
68
|
let configName = (_a = process.env.NATIVESCRIPT_CONFIG_NAME) !== null && _a !== void 0 ? _a : this.$options.config;
|
|
72
69
|
if (configName === "false") {
|
|
73
70
|
configName = false;
|
|
@@ -97,7 +94,6 @@ export default {
|
|
|
97
94
|
const existingConfigs = possibleConfigPaths.filter((path) => {
|
|
98
95
|
return this.$fs.exists(path);
|
|
99
96
|
});
|
|
100
|
-
// push the first possible config into the "existing" list
|
|
101
97
|
const hasExistingConfig = !!existingConfigs.length;
|
|
102
98
|
if (!hasExistingConfig) {
|
|
103
99
|
this.$logger.trace(`No config file found - falling back to ${possibleConfigPaths[0]}.`);
|
|
@@ -192,8 +188,6 @@ export default {
|
|
|
192
188
|
this.$fs.writeFile(configFilePath, await (0, prettier_1.format)(newContent, {
|
|
193
189
|
...prettierOptions,
|
|
194
190
|
parser: "typescript",
|
|
195
|
-
// note: we don't use plugins here, since we are only formatting ts files, and they are supported by default
|
|
196
|
-
// and this also causes issues with certain plugins, like prettier-plugin-tailwindcss.
|
|
197
191
|
plugins: [],
|
|
198
192
|
}));
|
|
199
193
|
}
|
|
@@ -201,11 +195,9 @@ export default {
|
|
|
201
195
|
this.$logger.error(`Failed to update config.` + error);
|
|
202
196
|
}
|
|
203
197
|
finally {
|
|
204
|
-
// verify config is updated correctly
|
|
205
198
|
if (!Array.isArray(this.getValue(key)) && this.getValue(key) !== value) {
|
|
206
199
|
this.$logger.error(`${os_1.EOL}Failed to update ${hasTSConfig ? constants_1.CONFIG_FILE_NAME_TS : constants_1.CONFIG_FILE_NAME_JS}.${os_1.EOL}`);
|
|
207
200
|
this.$logger.printMarkdown(`Please manually update \`${hasTSConfig ? constants_1.CONFIG_FILE_NAME_TS : constants_1.CONFIG_FILE_NAME_JS}\` and set \`${key}\` to \`${value}\`.${os_1.EOL}`);
|
|
208
|
-
// restore original content
|
|
209
201
|
this.$fs.writeFile(configFilePath, configContent);
|
|
210
202
|
return false;
|
|
211
203
|
}
|
|
@@ -234,11 +226,9 @@ export default {
|
|
|
234
226
|
? this.$fs.readJson(info.NSConfigPath)
|
|
235
227
|
: {};
|
|
236
228
|
try {
|
|
237
|
-
// injecting here to avoid circular dependency
|
|
238
229
|
const projectData = this.$injector.resolve("projectData");
|
|
239
230
|
const embeddedPackageJsonPath = path.resolve(this.projectHelper.projectDir, projectData.getAppDirectoryRelativePath(), constants.PACKAGE_JSON_FILE_NAME);
|
|
240
231
|
const embeddedPackageJson = this.$fs.readJson(embeddedPackageJsonPath);
|
|
241
|
-
// filter only the supported keys
|
|
242
232
|
additionalData.push(_.pick(embeddedPackageJson, [
|
|
243
233
|
"android",
|
|
244
234
|
"ios",
|
|
@@ -250,11 +240,9 @@ export default {
|
|
|
250
240
|
}
|
|
251
241
|
catch (err) {
|
|
252
242
|
this.$logger.trace("failed to add embedded package.json data to config", err);
|
|
253
|
-
// ignore if the file doesn't exist
|
|
254
243
|
}
|
|
255
244
|
try {
|
|
256
245
|
const packageJson = this.$fs.readJson(path.join(this.projectHelper.projectDir, "package.json"));
|
|
257
|
-
// add app id to additionalData for backwards compatibility
|
|
258
246
|
if (!NSConfig.id &&
|
|
259
247
|
packageJson &&
|
|
260
248
|
packageJson.nativescript &&
|
|
@@ -278,10 +266,8 @@ export default {
|
|
|
278
266
|
}
|
|
279
267
|
catch (err) {
|
|
280
268
|
this.$logger.trace("failed to read package.json data for config", err);
|
|
281
|
-
// ignore if the file doesn't exist
|
|
282
269
|
}
|
|
283
270
|
return _.defaultsDeep({}, ...additionalData, NSConfig);
|
|
284
|
-
// return Object.assign({}, ...additionalData, NSConfig);
|
|
285
271
|
}
|
|
286
272
|
async writeLegacyNSConfigIfNeeded(projectDir, runtimePackage) {
|
|
287
273
|
const { usingNSConfig } = this.detectProjectConfigs(projectDir);
|
|
@@ -290,8 +276,6 @@ export default {
|
|
|
290
276
|
}
|
|
291
277
|
if (runtimePackage.version &&
|
|
292
278
|
semver.gte(semver.coerce(runtimePackage.version), "7.0.0-rc.5")) {
|
|
293
|
-
// runtimes >= 7.0.0-rc.5 support passing appPath and appResourcesPath through gradle project flags
|
|
294
|
-
// so writing an nsconfig is not necessary.
|
|
295
279
|
return;
|
|
296
280
|
}
|
|
297
281
|
const runtimePackageDisplay = `${runtimePackage.name}${runtimePackage.version ? " v" + runtimePackage.version : ""}`;
|
|
@@ -308,10 +292,8 @@ You may add \`nsconfig.json\` to \`.gitignore\` as the CLI will regenerate it as
|
|
|
308
292
|
appPath: this.getValue("appPath"),
|
|
309
293
|
appResourcesPath: this.getValue("appResourcesPath"),
|
|
310
294
|
});
|
|
311
|
-
// mark the file for cleanup after the CLI exits
|
|
312
295
|
await this.$cleanupService.addCleanupDeleteAction(nsConfigPath);
|
|
313
296
|
}
|
|
314
|
-
// todo: move into config manipulation
|
|
315
297
|
flattenObjectToPaths(obj, basePath) {
|
|
316
298
|
const toPath = (key) => [basePath, key].filter(Boolean).join(".");
|
|
317
299
|
return Object.keys(obj).reduce((all, key) => {
|
|
@@ -320,7 +302,7 @@ You may add \`nsconfig.json\` to \`.gitignore\` as the CLI will regenerate it as
|
|
|
320
302
|
...all,
|
|
321
303
|
{
|
|
322
304
|
key: toPath(key),
|
|
323
|
-
value: obj[key],
|
|
305
|
+
value: obj[key],
|
|
324
306
|
},
|
|
325
307
|
];
|
|
326
308
|
}
|
|
@@ -339,7 +321,7 @@ You may add \`nsconfig.json\` to \`.gitignore\` as the CLI will regenerate it as
|
|
|
339
321
|
}
|
|
340
322
|
exports.ProjectConfigService = ProjectConfigService;
|
|
341
323
|
__decorate([
|
|
342
|
-
(0, decorators_1.cache)()
|
|
324
|
+
(0, decorators_1.cache)()
|
|
343
325
|
], ProjectConfigService.prototype, "warnUsingLegacyNSConfig", null);
|
|
344
326
|
__decorate([
|
|
345
327
|
(0, decorators_1.exported)("projectConfigService")
|
|
@@ -351,4 +333,3 @@ __decorate([
|
|
|
351
333
|
(0, decorators_1.exported)("projectConfigService")
|
|
352
334
|
], ProjectConfigService.prototype, "setValue", null);
|
|
353
335
|
yok_1.injector.register("projectConfigService", ProjectConfigService);
|
|
354
|
-
//# sourceMappingURL=project-config-service.js.map
|
|
@@ -28,14 +28,12 @@ class ProjectDataService {
|
|
|
28
28
|
this.$injector = $injector;
|
|
29
29
|
this.projectDataCache = {};
|
|
30
30
|
try {
|
|
31
|
-
// add the ProjectData of the default projectDir to the projectData cache
|
|
32
31
|
const projectData = this.$injector.resolve("projectData");
|
|
33
32
|
projectData.initializeProjectData();
|
|
34
33
|
this.defaultProjectDir = projectData.projectDir;
|
|
35
34
|
this.projectDataCache[this.defaultProjectDir] = projectData;
|
|
36
35
|
}
|
|
37
36
|
catch (e) {
|
|
38
|
-
// the CLI is required as a lib from a non-project folder
|
|
39
37
|
}
|
|
40
38
|
}
|
|
41
39
|
get $pluginsService() {
|
|
@@ -64,8 +62,6 @@ class ProjectDataService {
|
|
|
64
62
|
delete projectFileInfo.projectData[ProjectDataService.DEPENDENCIES_KEY_NAME][dependencyName];
|
|
65
63
|
this.$fs.writeJson(projectFileInfo.projectFilePath, projectFileInfo.projectData);
|
|
66
64
|
}
|
|
67
|
-
// TODO: Add tests
|
|
68
|
-
// TODO: Remove $projectData and replace it with $projectDataService.getProjectData
|
|
69
65
|
getProjectData(projectDir) {
|
|
70
66
|
projectDir = projectDir || this.defaultProjectDir;
|
|
71
67
|
this.projectDataCache[projectDir] =
|
|
@@ -117,10 +113,6 @@ class ProjectDataService {
|
|
|
117
113
|
this.$logger.trace(`"${propertyName}" property successfully removed.`);
|
|
118
114
|
}
|
|
119
115
|
async getAndroidAssetsStructure(opts) {
|
|
120
|
-
// TODO: Use image-size package to get the width and height of an image.
|
|
121
|
-
// TODO: Parse the splash_screen.xml in nodpi directory and get from it the names of the background and center image.
|
|
122
|
-
// TODO: Parse the AndroidManifest.xml to get the name of the icon.
|
|
123
|
-
// This way we'll not use the image-definitions.json and the method will return the real android structure.
|
|
124
116
|
const projectDir = opts.projectDir;
|
|
125
117
|
const projectData = this.getProjectData(projectDir);
|
|
126
118
|
const pathToAndroidDir = path.join(projectData.appResourcesDirectoryPath, this.$devicePlatformsConstants.Android);
|
|
@@ -134,7 +126,6 @@ class ProjectDataService {
|
|
|
134
126
|
useLegacy = !manifest.includes(`android:icon="@mipmap/ic_launcher"`);
|
|
135
127
|
}
|
|
136
128
|
catch (err) {
|
|
137
|
-
// ignore
|
|
138
129
|
}
|
|
139
130
|
const content = this.getImageDefinitions()[useLegacy ? "android_legacy" : "android"];
|
|
140
131
|
return {
|
|
@@ -158,8 +149,6 @@ class ProjectDataService {
|
|
|
158
149
|
}
|
|
159
150
|
if (fstat.isDirectory()) {
|
|
160
151
|
if (filePath === pathToProjectNodeModules) {
|
|
161
|
-
// we do not want to get the files from node_modules directory of the project.
|
|
162
|
-
// We'll get here only when you have nativescript.config with appDirectoryPath set to "."
|
|
163
152
|
return false;
|
|
164
153
|
}
|
|
165
154
|
return true;
|
|
@@ -174,9 +163,6 @@ class ProjectDataService {
|
|
|
174
163
|
}
|
|
175
164
|
}
|
|
176
165
|
updateNsConfigValue(projectDir, updateObject, propertiesToRemove) {
|
|
177
|
-
// todo: figure out a way to update js/ts configs
|
|
178
|
-
// most likely needs an ast parser/writer
|
|
179
|
-
// should be delegated to the config service
|
|
180
166
|
const nsConfigPath = path.join(projectDir, constants.CONFIG_FILE_NAME_JS);
|
|
181
167
|
const currentNsConfig = this.getNsConfig(nsConfigPath);
|
|
182
168
|
let newNsConfig = currentNsConfig;
|
|
@@ -217,14 +203,10 @@ class ProjectDataService {
|
|
|
217
203
|
const imageDefinitions = this.getImageDefinitions().ios;
|
|
218
204
|
_.each(content && content.images, (image) => {
|
|
219
205
|
let foundMatchingDefinition = false;
|
|
220
|
-
// In some cases the image may not be available, it will just be described.
|
|
221
|
-
// When this happens, the filename will be empty.
|
|
222
|
-
// So we'll keep the path empty as well.
|
|
223
206
|
if (image.filename) {
|
|
224
207
|
image.path = path.join(dirPath, image.filename);
|
|
225
208
|
}
|
|
226
209
|
if (image.size) {
|
|
227
|
-
// size is basically <width>x<height>
|
|
228
210
|
const [width, height] = image.size
|
|
229
211
|
.toString()
|
|
230
212
|
.split(constants_1.AssetConstants.sizeDelimiter);
|
|
@@ -233,7 +215,6 @@ class ProjectDataService {
|
|
|
233
215
|
image.height = +height;
|
|
234
216
|
}
|
|
235
217
|
}
|
|
236
|
-
// Find the image size based on the hardcoded values in the image-definitions.json
|
|
237
218
|
_.each(imageDefinitions, (assetSubGroup) => {
|
|
238
219
|
const assetItem = _.find(assetSubGroup, (assetElement) => assetElement.filename === image.filename &&
|
|
239
220
|
path.basename(assetElement.directory) === path.basename(dirPath));
|
|
@@ -253,7 +234,6 @@ class ProjectDataService {
|
|
|
253
234
|
image.scale = image.scale || assetItem.scale;
|
|
254
235
|
image.rgba = assetItem.rgba;
|
|
255
236
|
finalContent.images.push(image);
|
|
256
|
-
// break each
|
|
257
237
|
return false;
|
|
258
238
|
}
|
|
259
239
|
});
|
|
@@ -356,16 +336,13 @@ class ProjectDataService {
|
|
|
356
336
|
getRuntimePackage(projectDir, platform) {
|
|
357
337
|
platform = platform.toLowerCase();
|
|
358
338
|
const packageJson = this.$fs.readJson(path.join(projectDir, constants.PACKAGE_JSON_FILE_NAME));
|
|
359
|
-
const runtimeName = platform ===
|
|
339
|
+
const runtimeName = platform === constants_1.PlatformTypes.android
|
|
360
340
|
? constants.TNS_ANDROID_RUNTIME_NAME
|
|
361
341
|
: constants.TNS_IOS_RUNTIME_NAME;
|
|
362
342
|
if (packageJson &&
|
|
363
343
|
packageJson.nativescript &&
|
|
364
344
|
packageJson.nativescript[runtimeName] &&
|
|
365
345
|
packageJson.nativescript[runtimeName].version) {
|
|
366
|
-
// if we have a nativescript key with a runtime version in package.json
|
|
367
|
-
// that means we are dealing with a legacy project, and should respect
|
|
368
|
-
// that information
|
|
369
346
|
return {
|
|
370
347
|
name: runtimeName,
|
|
371
348
|
version: packageJson.nativescript[runtimeName].version,
|
|
@@ -379,17 +356,17 @@ class ProjectDataService {
|
|
|
379
356
|
.getDependenciesFromPackageJson(projectDir)
|
|
380
357
|
.devDependencies.find((d) => {
|
|
381
358
|
var _a, _b, _c, _d;
|
|
382
|
-
if (platform ===
|
|
359
|
+
if (platform === constants.PlatformTypes.ios) {
|
|
383
360
|
const packageName = ((_b = (_a = this.$projectData.nsConfig) === null || _a === void 0 ? void 0 : _a.ios) === null || _b === void 0 ? void 0 : _b.runtimePackageName) ||
|
|
384
361
|
constants.SCOPED_IOS_RUNTIME_NAME;
|
|
385
362
|
return [packageName, constants.TNS_IOS_RUNTIME_NAME].includes(d.name);
|
|
386
363
|
}
|
|
387
|
-
else if (platform ===
|
|
364
|
+
else if (platform === constants.PlatformTypes.android) {
|
|
388
365
|
const packageName = ((_d = (_c = this.$projectData.nsConfig) === null || _c === void 0 ? void 0 : _c.android) === null || _d === void 0 ? void 0 : _d.runtimePackageName) ||
|
|
389
366
|
constants.SCOPED_ANDROID_RUNTIME_NAME;
|
|
390
367
|
return [packageName, constants.TNS_ANDROID_RUNTIME_NAME].includes(d.name);
|
|
391
368
|
}
|
|
392
|
-
else if (platform ===
|
|
369
|
+
else if (platform === constants.PlatformTypes.visionos) {
|
|
393
370
|
return d.name === constants.SCOPED_VISIONOS_RUNTIME_NAME;
|
|
394
371
|
}
|
|
395
372
|
});
|
|
@@ -397,14 +374,12 @@ class ProjectDataService {
|
|
|
397
374
|
const coerced = semver.coerce(runtimePackage.version);
|
|
398
375
|
const isRange = !!coerced && coerced.version !== runtimePackage.version;
|
|
399
376
|
const isTag = !coerced;
|
|
400
|
-
// in case we are using a local tgz for the runtime or a range like ~8.0.0, ^8.0.0 etc. or a tag like JSC
|
|
401
377
|
if (runtimePackage.version.includes("tgz") || isRange || isTag) {
|
|
402
378
|
try {
|
|
403
379
|
const runtimePackageJsonPath = (0, package_path_helper_1.resolvePackageJSONPath)(runtimePackage.name, {
|
|
404
380
|
paths: [projectDir],
|
|
405
381
|
});
|
|
406
382
|
if (!runtimePackageJsonPath) {
|
|
407
|
-
// caught below
|
|
408
383
|
throw new Error("Runtime package.json not found.");
|
|
409
384
|
}
|
|
410
385
|
runtimePackage.version = this.$fs.readJson(runtimePackageJsonPath).version;
|
|
@@ -421,23 +396,22 @@ class ProjectDataService {
|
|
|
421
396
|
}
|
|
422
397
|
return runtimePackage;
|
|
423
398
|
}
|
|
424
|
-
// default to the scoped runtimes
|
|
425
399
|
this.$logger.trace("Could not find an installed runtime, falling back to default runtimes");
|
|
426
|
-
if (platform ===
|
|
400
|
+
if (platform === constants.PlatformTypes.ios) {
|
|
427
401
|
return {
|
|
428
402
|
name: ((_b = (_a = this.$projectData.nsConfig) === null || _a === void 0 ? void 0 : _a.ios) === null || _b === void 0 ? void 0 : _b.runtimePackageName) ||
|
|
429
403
|
constants.SCOPED_IOS_RUNTIME_NAME,
|
|
430
404
|
version: null,
|
|
431
405
|
};
|
|
432
406
|
}
|
|
433
|
-
else if (platform ===
|
|
407
|
+
else if (platform === constants.PlatformTypes.android) {
|
|
434
408
|
return {
|
|
435
409
|
name: ((_d = (_c = this.$projectData.nsConfig) === null || _c === void 0 ? void 0 : _c.android) === null || _d === void 0 ? void 0 : _d.runtimePackageName) ||
|
|
436
410
|
constants.SCOPED_ANDROID_RUNTIME_NAME,
|
|
437
411
|
version: null,
|
|
438
412
|
};
|
|
439
413
|
}
|
|
440
|
-
else if (platform ===
|
|
414
|
+
else if (platform === constants.PlatformTypes.visionos) {
|
|
441
415
|
return {
|
|
442
416
|
name: constants.SCOPED_VISIONOS_RUNTIME_NAME,
|
|
443
417
|
version: null,
|
|
@@ -472,11 +446,9 @@ __decorate([
|
|
|
472
446
|
return projectDir + ":" + platform;
|
|
473
447
|
},
|
|
474
448
|
shouldCache(result) {
|
|
475
|
-
// don't cache coerced versions
|
|
476
449
|
if (result._coerced) {
|
|
477
450
|
return false;
|
|
478
451
|
}
|
|
479
|
-
// only cache if version is defined
|
|
480
452
|
return !!result.version;
|
|
481
453
|
},
|
|
482
454
|
})
|
|
@@ -485,4 +457,3 @@ __decorate([
|
|
|
485
457
|
(0, decorators_1.exported)("projectDataService")
|
|
486
458
|
], ProjectDataService.prototype, "getNsConfigDefaultContent", null);
|
|
487
459
|
yok_1.injector.register("projectDataService", ProjectDataService);
|
|
488
|
-
//# sourceMappingURL=project-data-service.js.map
|