nativescript 9.0.4-dev.0 → 9.0.4-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +2 -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 +1 -6
- package/lib/commands/deploy.js +2 -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 +3 -4
- 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 +2 -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 +1 -20
- 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 +2 -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 +0 -11
- package/lib/common/decorators.js +0 -48
- package/lib/common/dispatchers.js +1 -10
- package/lib/common/errors.js +3 -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 -1
- 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/auto-completion-service.js +1 -13
- package/lib/common/services/cancellation.js +1 -2
- package/lib/common/services/commands-service.js +6 -17
- package/lib/common/services/help-service.js +3 -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 +1 -8
- package/lib/common/yok.js +11 -32
- package/lib/config.js +1 -22
- package/lib/constants-provider.js +0 -1
- package/lib/constants.js +0 -53
- 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 +1 -9
- package/lib/controllers/prepare-controller.js +4 -17
- package/lib/controllers/run-controller.js +1 -17
- 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/detached-processes/cleanup-js-subprocess.js +2 -8
- package/lib/detached-processes/cleanup-process.js +14 -18
- package/lib/detached-processes/file-log-service.js +1 -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 +2 -4
- package/lib/helpers/livesync-command-helper.js +1 -4
- package/lib/helpers/network-connectivity-validator.js +0 -1
- package/lib/helpers/options-track-helper.js +2 -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 +2 -3
- package/lib/key-commands/index.js +4 -5
- package/lib/nativescript-cli-lib-bootstrap.js +0 -4
- package/lib/nativescript-cli-lib.js +0 -1
- package/lib/nativescript-cli.js +1 -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 +119 -144
- 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 +6 -10
- package/lib/services/analytics/analytics-broker.js +1 -2
- package/lib/services/analytics/analytics-service.js +25 -29
- package/lib/services/analytics/google-analytics-provider.js +12 -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 +5 -10
- 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 -68
- package/lib/services/bundler/bundler.js +0 -1
- package/lib/services/cleanup-service.js +9 -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 +1 -5
- package/lib/services/ios/export-options-plist-service.js +0 -4
- package/lib/services/ios/ios-signing-service.js +10 -7
- package/lib/services/ios/spm-service.js +0 -18
- package/lib/services/ios/xcodebuild-args-service.js +0 -11
- package/lib/services/ios/xcodebuild-command-service.js +0 -1
- 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 +4 -6
- package/lib/services/ios-project-service.js +1 -100
- package/lib/services/ios-provision-service.js +0 -3
- package/lib/services/ios-watch-app-service.js +0 -1
- 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 -2
- 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 +5 -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 +1 -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 +2 -5
- package/lib/services/platform-environment-requirements.js +3 -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 +2 -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 +4 -6
- package/lib/services/watch-ignore-list-service.js +0 -1
- package/lib/services/xcconfig-service.js +0 -2
- package/lib/services/xcproj-service.js +0 -1
- package/lib/shared-event-bus.js +0 -6
- package/lib/sys-info.js +1 -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 +1 -1
|
@@ -41,7 +41,7 @@ class PerformanceService {
|
|
|
41
41
|
trackAnalyticsData(methodInfo, executionTime) {
|
|
42
42
|
this.$analyticsService
|
|
43
43
|
.trackEventActionInGoogleAnalytics({
|
|
44
|
-
action: "Performance"
|
|
44
|
+
action: "Performance",
|
|
45
45
|
additionalData: methodInfo,
|
|
46
46
|
value: executionTime,
|
|
47
47
|
})
|
|
@@ -71,7 +71,6 @@ class PerformanceService {
|
|
|
71
71
|
this.$logger.info(PerformanceService.LOG_MESSAGE_TEMPLATE, methodInfo, executionTime);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
//removes any injected members of the arguments and excludes the options object even if it was renamed
|
|
75
74
|
getJsonSanitizer() {
|
|
76
75
|
const seen = new WeakSet();
|
|
77
76
|
seen.add(this.$options);
|
|
@@ -91,4 +90,3 @@ PerformanceService.LOG_MESSAGE_TEMPLATE = `Execution of method "%s" took %s ms.`
|
|
|
91
90
|
PerformanceService.FAIL_LOG_MESSAGE_TEMPLATE = `Failed to log pefromance data in file for method %s.`;
|
|
92
91
|
PerformanceService.MIN_NODE_PERFORMANCE_MODULE_VERSION = "8.5.0";
|
|
93
92
|
yok_1.injector.register("performanceService", PerformanceService);
|
|
94
|
-
//# sourceMappingURL=performance-service.js.map
|
|
@@ -12,11 +12,7 @@ const constants_1 = require("../../constants");
|
|
|
12
12
|
const decorators_1 = require("../../common/decorators");
|
|
13
13
|
const yok_1 = require("../../common/yok");
|
|
14
14
|
class AddPlatformService {
|
|
15
|
-
constructor($fs, $logger, $options,
|
|
16
|
-
// private $pacoteService: IPacoteService,
|
|
17
|
-
// private $projectDataService: IProjectDataService,
|
|
18
|
-
$packageManager, $terminalSpinnerService, $analyticsService // private $tempService: ITempService
|
|
19
|
-
) {
|
|
15
|
+
constructor($fs, $logger, $options, $packageManager, $terminalSpinnerService, $analyticsService) {
|
|
20
16
|
this.$fs = $fs;
|
|
21
17
|
this.$logger = $logger;
|
|
22
18
|
this.$options = $options;
|
|
@@ -29,13 +25,9 @@ class AddPlatformService {
|
|
|
29
25
|
const spinner = this.$terminalSpinnerService.createSpinner();
|
|
30
26
|
try {
|
|
31
27
|
spinner.start();
|
|
32
|
-
// const frameworkDirPath = addPlatformData.frameworkPath ?
|
|
33
|
-
// await this.extractPackage(packageToInstall)
|
|
34
|
-
// : await this.installPackage(projectData.projectDir, packageToInstall);
|
|
35
28
|
const frameworkDirPath = await this.installPackage(projectData.projectDir, packageToInstall);
|
|
36
29
|
const frameworkPackageJsonContent = this.$fs.readJson(path.join(frameworkDirPath, "..", "package.json"));
|
|
37
30
|
const frameworkVersion = frameworkPackageJsonContent.version;
|
|
38
|
-
// await this.setPlatformVersion(platformData, projectData, frameworkVersion);
|
|
39
31
|
await this.trackPlatformVersion(frameworkVersion, platformData);
|
|
40
32
|
if (!addPlatformData.nativePrepare ||
|
|
41
33
|
!addPlatformData.nativePrepare.skipNativePrepare) {
|
|
@@ -55,21 +47,9 @@ class AddPlatformService {
|
|
|
55
47
|
async setPlatformVersion(platformData, projectData, frameworkVersion) {
|
|
56
48
|
await this.installPackage(projectData.projectDir, `${platformData.frameworkPackageName}@${frameworkVersion}`);
|
|
57
49
|
}
|
|
58
|
-
// private async extractPackage(pkg: string): Promise<string> {
|
|
59
|
-
// const downloadedPackagePath = await this.$tempService.mkdirSync(
|
|
60
|
-
// "runtimeDir"
|
|
61
|
-
// );
|
|
62
|
-
// await this.$pacoteService.extractPackage(pkg, downloadedPackagePath);
|
|
63
|
-
// const frameworkDir = path.join(
|
|
64
|
-
// downloadedPackagePath,
|
|
65
|
-
// PROJECT_FRAMEWORK_FOLDER_NAME
|
|
66
|
-
// );
|
|
67
|
-
// return path.resolve(frameworkDir);
|
|
68
|
-
// }
|
|
69
50
|
async installPackage(projectDir, packageName) {
|
|
70
51
|
const frameworkDir = this.resolveFrameworkDir(projectDir, packageName);
|
|
71
52
|
if (frameworkDir && this.$fs.exists(frameworkDir)) {
|
|
72
|
-
// don't install if it's already installed
|
|
73
53
|
return frameworkDir;
|
|
74
54
|
}
|
|
75
55
|
const installedPackage = await this.$packageManager.install(packageName, projectDir, {
|
|
@@ -85,30 +65,6 @@ class AddPlatformService {
|
|
|
85
65
|
}
|
|
86
66
|
resolveFrameworkDir(projectDir, packageName) {
|
|
87
67
|
try {
|
|
88
|
-
// strip version info if present <package>@1.2.3-rc.0 -> <package>
|
|
89
|
-
// tested cases:
|
|
90
|
-
// @nativescript/ios
|
|
91
|
-
// @nativescript/ios@1
|
|
92
|
-
// @nativescript/ios@1.2
|
|
93
|
-
// @nativescript/ios@1.2.3
|
|
94
|
-
// @nativescript/ios@1.2.3-
|
|
95
|
-
// @nativescript/ios@1.2.3-rc
|
|
96
|
-
// @nativescript/ios@1.2.3-rc.
|
|
97
|
-
// @nativescript/ios@1.2.3-rc.0
|
|
98
|
-
// @nativescript/ios@rc
|
|
99
|
-
// @nativescript/ios@^7.0.0
|
|
100
|
-
// @nativescript/ios@~7.0.0
|
|
101
|
-
// tns-ios
|
|
102
|
-
// tns-ios@1
|
|
103
|
-
// tns-ios@1.2
|
|
104
|
-
// tns-ios@1.2.3
|
|
105
|
-
// tns-ios@1.2.3-
|
|
106
|
-
// tns-ios@1.2.3-rc
|
|
107
|
-
// tns-ios@1.2.3-rc.
|
|
108
|
-
// tns-ios@1.2.3-rc.0
|
|
109
|
-
// tns-ios@rc
|
|
110
|
-
// tns-ios@^7.0.0
|
|
111
|
-
// tns-ios@~7.0.0
|
|
112
68
|
packageName = packageName.replace(/(.+)@.+$/g, "$1");
|
|
113
69
|
const frameworkDir = require
|
|
114
70
|
.resolve(`${packageName}/package.json`, {
|
|
@@ -126,10 +82,8 @@ class AddPlatformService {
|
|
|
126
82
|
}
|
|
127
83
|
async addNativePlatform(platformData, projectData, frameworkDirPath, frameworkVersion) {
|
|
128
84
|
var _a;
|
|
129
|
-
// here we should use ios OR android
|
|
130
85
|
const platformDir = (_a = this.$options.hostProjectPath) !== null && _a !== void 0 ? _a : path.join(projectData.platformsDir, platformData.normalizedPlatformName.toLowerCase());
|
|
131
86
|
this.$fs.deleteDirectory(platformDir);
|
|
132
|
-
//if iosHost - dont create project
|
|
133
87
|
await platformData.platformProjectService.createProject(path.resolve(frameworkDirPath), frameworkVersion, projectData);
|
|
134
88
|
platformData.platformProjectService.ensureConfigurationFileInAppResources(projectData);
|
|
135
89
|
await platformData.platformProjectService.interpolateData(projectData);
|
|
@@ -137,7 +91,7 @@ class AddPlatformService {
|
|
|
137
91
|
}
|
|
138
92
|
async trackPlatformVersion(frameworkVersion, platformData) {
|
|
139
93
|
await this.$analyticsService.trackEventActionInGoogleAnalytics({
|
|
140
|
-
action: "Add Platform"
|
|
94
|
+
action: "Add Platform",
|
|
141
95
|
additionalData: `${platformData.platformNameLowerCase}${constants_1.AnalyticsEventLabelDelimiter}${frameworkVersion}`,
|
|
142
96
|
});
|
|
143
97
|
}
|
|
@@ -147,4 +101,3 @@ __decorate([
|
|
|
147
101
|
(0, decorators_1.performanceLog)()
|
|
148
102
|
], AddPlatformService.prototype, "addNativePlatform", null);
|
|
149
103
|
yok_1.injector.register("addPlatformService", AddPlatformService);
|
|
150
|
-
//# sourceMappingURL=add-platform-service.js.map
|
|
@@ -49,19 +49,17 @@ class PrepareNativePlatformService {
|
|
|
49
49
|
this.$metadataFilteringService.generateMetadataFilters(projectData, platformData.platformNameLowerCase);
|
|
50
50
|
}
|
|
51
51
|
platformData.platformProjectService.interpolateConfigurationFile(projectData);
|
|
52
|
-
await this.$projectChangesService.setNativePlatformStatus(platformData, projectData, { nativePlatformStatus: "3"
|
|
52
|
+
await this.$projectChangesService.setNativePlatformStatus(platformData, projectData, { nativePlatformStatus: "3" });
|
|
53
53
|
return hasChanges;
|
|
54
54
|
}
|
|
55
55
|
async cleanProject(platformData, options) {
|
|
56
|
-
// android build artifacts need to be cleaned up
|
|
57
|
-
// when switching between debug, release and webpack builds
|
|
58
56
|
if (platformData.platformNameLowerCase !== "android") {
|
|
59
57
|
return;
|
|
60
58
|
}
|
|
61
59
|
const previousPrepareInfo = this.$projectChangesService.getPrepareInfo(platformData);
|
|
62
60
|
if (!previousPrepareInfo ||
|
|
63
61
|
previousPrepareInfo.nativePlatformStatus !==
|
|
64
|
-
"3"
|
|
62
|
+
"3") {
|
|
65
63
|
return;
|
|
66
64
|
}
|
|
67
65
|
const { release: previousWasRelease } = previousPrepareInfo;
|
|
@@ -77,4 +75,3 @@ __decorate([
|
|
|
77
75
|
(0, helpers_1.hook)("prepareNativeApp")
|
|
78
76
|
], PrepareNativePlatformService.prototype, "prepareNativePlatform", null);
|
|
79
77
|
yok_1.injector.register("prepareNativePlatformService", PrepareNativePlatformService);
|
|
80
|
-
//# sourceMappingURL=prepare-native-platform-service.js.map
|
|
@@ -11,9 +11,7 @@ const helpers_1 = require("../common/helpers");
|
|
|
11
11
|
const os_1 = require("os");
|
|
12
12
|
const yok_1 = require("../common/yok");
|
|
13
13
|
class PlatformEnvironmentRequirements {
|
|
14
|
-
constructor($doctorService, $errors, $analyticsService,
|
|
15
|
-
// @ts-ignore - required by the hook helper!
|
|
16
|
-
$injector) {
|
|
14
|
+
constructor($doctorService, $errors, $analyticsService, $injector) {
|
|
17
15
|
this.$doctorService = $doctorService;
|
|
18
16
|
this.$errors = $errors;
|
|
19
17
|
this.$analyticsService = $analyticsService;
|
|
@@ -24,7 +22,7 @@ class PlatformEnvironmentRequirements {
|
|
|
24
22
|
const selectedOption = null;
|
|
25
23
|
if (process.env.NS_SKIP_ENV_CHECK) {
|
|
26
24
|
await this.$analyticsService.trackEventActionInGoogleAnalytics({
|
|
27
|
-
action: "Check Environment Requirements"
|
|
25
|
+
action: "Check Environment Requirements",
|
|
28
26
|
additionalData: "Skipped: NS_SKIP_ENV_CHECK is set",
|
|
29
27
|
});
|
|
30
28
|
return {
|
|
@@ -39,9 +37,8 @@ class PlatformEnvironmentRequirements {
|
|
|
39
37
|
forceCheck: input.forceCheck,
|
|
40
38
|
});
|
|
41
39
|
if (!canExecute) {
|
|
42
|
-
// if (!isInteractive()) {
|
|
43
40
|
await this.$analyticsService.trackEventActionInGoogleAnalytics({
|
|
44
|
-
action: "Check Environment Requirements"
|
|
41
|
+
action: "Check Environment Requirements",
|
|
45
42
|
additionalData: "Non-interactive terminal, unable to execute local builds.",
|
|
46
43
|
});
|
|
47
44
|
this.fail(this.getNonInteractiveConsoleMessage(platform));
|
|
@@ -61,7 +58,6 @@ class PlatformEnvironmentRequirements {
|
|
|
61
58
|
].join(os_1.EOL);
|
|
62
59
|
}
|
|
63
60
|
getEnvVerificationMessage(platform) {
|
|
64
|
-
// map process.platform to OS name used in docs
|
|
65
61
|
const os = {
|
|
66
62
|
linux: "linux",
|
|
67
63
|
win32: "windows",
|
|
@@ -80,4 +76,3 @@ __decorate([
|
|
|
80
76
|
(0, helpers_1.hook)("checkEnvironment")
|
|
81
77
|
], PlatformEnvironmentRequirements.prototype, "checkEnvironmentRequirements", null);
|
|
82
78
|
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
|
};
|
|
@@ -137,9 +136,6 @@ class PluginsService {
|
|
|
137
136
|
paths: [projectData.projectDir],
|
|
138
137
|
});
|
|
139
138
|
if (pathToPackage) {
|
|
140
|
-
// return false if the dependency is installed - we'll filter out boolean values
|
|
141
|
-
// and end up with an array of dep names that are not installed if we end up
|
|
142
|
-
// inside the catch block.
|
|
143
139
|
return false;
|
|
144
140
|
}
|
|
145
141
|
this.$logger.trace(`${dep} is not installed, or couldn't be found`);
|
|
@@ -172,9 +168,6 @@ class PluginsService {
|
|
|
172
168
|
return productionPlugins
|
|
173
169
|
.map((plugin) => this.convertToPluginData(plugin, projectData.projectDir))
|
|
174
170
|
.filter((item, idx, self) => {
|
|
175
|
-
// Filter out duplicates to speed up build times by not building the same dependency
|
|
176
|
-
// multiple times. One possible downside is that if there are different versions
|
|
177
|
-
// of the same native dependency only the first one in the array will be built
|
|
178
171
|
return self.findIndex((p) => p.name === item.name) === idx;
|
|
179
172
|
});
|
|
180
173
|
}
|
|
@@ -206,11 +199,9 @@ class PluginsService {
|
|
|
206
199
|
const dependenciesGroupedByName = _.groupBy(productionDependencies, (p) => p.name);
|
|
207
200
|
_.each(dependenciesGroupedByName, (dependencyOccurrences, dependencyName) => {
|
|
208
201
|
if (dependencyOccurrences.length > 1) {
|
|
209
|
-
// the dependency exists multiple times in node_modules
|
|
210
202
|
const dependencyOccurrencesGroupedByVersion = _.groupBy(dependencyOccurrences, (g) => g.version);
|
|
211
203
|
const versions = _.keys(dependencyOccurrencesGroupedByVersion);
|
|
212
204
|
if (versions.length === 1) {
|
|
213
|
-
// all dependencies with this name have the same version
|
|
214
205
|
this.$logger.trace(`Detected same versions (${_.first(versions)}) of the ${dependencyName} installed at locations: ${_.map(dependencyOccurrences, (d) => d.directory).join(", ")}`);
|
|
215
206
|
}
|
|
216
207
|
else {
|
|
@@ -240,11 +231,9 @@ class PluginsService {
|
|
|
240
231
|
const dependenciesGroupedByFrameworkName = _.groupBy(dependenciesWithFrameworks, (d) => d.frameworkName);
|
|
241
232
|
_.each(dependenciesGroupedByFrameworkName, (dependencyOccurrences, frameworkName) => {
|
|
242
233
|
if (dependencyOccurrences.length > 1) {
|
|
243
|
-
// A framework exists multiple times in node_modules
|
|
244
234
|
const groupedByName = _.groupBy(dependencyOccurrences, (d) => d.name);
|
|
245
235
|
const pluginsNames = _.keys(groupedByName);
|
|
246
236
|
if (pluginsNames.length > 1) {
|
|
247
|
-
// fail - the same framework is installed by different dependencies.
|
|
248
237
|
const locations = dependencyOccurrences.map((d) => d.frameworkLocation);
|
|
249
238
|
let msg = `Detected the framework ${frameworkName} is installed from multiple plugins at locations:\n${locations.join("\n")}\n`;
|
|
250
239
|
msg += this.getHelpMessage(projectDir);
|
|
@@ -254,7 +243,6 @@ class PluginsService {
|
|
|
254
243
|
const dependencyOccurrencesGroupedByVersion = _.groupBy(dependencyOccurrences, (g) => g.version);
|
|
255
244
|
const versions = _.keys(dependencyOccurrencesGroupedByVersion);
|
|
256
245
|
if (versions.length === 1) {
|
|
257
|
-
// all dependencies with this name have the same version
|
|
258
246
|
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(", ")}`);
|
|
259
247
|
const selectedPackage = _.minBy(dependencyOccurrences, (d) => d.depth);
|
|
260
248
|
this.$logger.info(color_1.color.green(`CLI will use only the native code from '${selectedPackage.directory}'.`));
|
|
@@ -306,7 +294,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
306
294
|
pluginData.isPlugin = !!cacheData.nativescript;
|
|
307
295
|
pluginData.pluginPlatformsFolderPath = (platform) => {
|
|
308
296
|
if (this.$mobileHelper.isvisionOSPlatform(platform)) {
|
|
309
|
-
platform = "ios"
|
|
297
|
+
platform = "ios";
|
|
310
298
|
}
|
|
311
299
|
return path.join(pluginData.fullPath, "platforms", platform.toLowerCase());
|
|
312
300
|
};
|
|
@@ -364,7 +352,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
364
352
|
return _.keys(require(packageJsonFilePath).dependencies);
|
|
365
353
|
}
|
|
366
354
|
getNodeModuleData(module, projectDir) {
|
|
367
|
-
// module can be modulePath or moduleName
|
|
368
355
|
if (!this.$fs.exists(module) || path.basename(module) !== "package.json") {
|
|
369
356
|
module = this.getPackageJsonFilePathForModule(module, projectDir);
|
|
370
357
|
}
|
|
@@ -396,7 +383,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
396
383
|
return this.parseNpmCommandResult(npmCommandArguments);
|
|
397
384
|
}
|
|
398
385
|
parseNpmCommandResult(npmCommandResult) {
|
|
399
|
-
return npmCommandResult.split("@")[0];
|
|
386
|
+
return npmCommandResult.split("@")[0];
|
|
400
387
|
}
|
|
401
388
|
async executeForAllInstalledPlatforms(action, projectData) {
|
|
402
389
|
const availablePlatforms = this.$mobileHelper.platformNames.map((p) => p.toLowerCase());
|
|
@@ -411,8 +398,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
411
398
|
}
|
|
412
399
|
getInstalledFrameworkVersion(platform, projectData) {
|
|
413
400
|
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, platform);
|
|
414
|
-
// const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
|
|
415
|
-
// const frameworkData = this.$projectDataService.getNSValue(projectData.projectDir, platformData.frameworkPackageName);
|
|
416
401
|
return runtimePackage.version;
|
|
417
402
|
}
|
|
418
403
|
isPluginDataValidForPlatform(pluginData, platform, projectData) {
|
|
@@ -442,7 +427,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
442
427
|
}
|
|
443
428
|
getAllPluginsNativeHashes(pathToPluginsBuildFile) {
|
|
444
429
|
if (this.$options.hostProjectPath) {
|
|
445
|
-
// TODO: force rebuild plugins for now until we decide where to put .ns-plugins-build-data.json when embedding
|
|
446
430
|
return {};
|
|
447
431
|
}
|
|
448
432
|
let data = {};
|
|
@@ -453,7 +437,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
453
437
|
}
|
|
454
438
|
setPluginNativeHashes(opts) {
|
|
455
439
|
if (this.$options.hostProjectPath) {
|
|
456
|
-
// TODO: force rebuild plugins for now until we decide where to put .ns-plugins-build-data.json when embedding
|
|
457
440
|
return;
|
|
458
441
|
}
|
|
459
442
|
opts.allPluginsNativeHashes[opts.pluginData.name] =
|
|
@@ -474,4 +457,3 @@ PluginsService.LOCK_FILES = [
|
|
|
474
457
|
"pnpm-lock.yaml",
|
|
475
458
|
];
|
|
476
459
|
yok_1.injector.register("pluginsService", PluginsService);
|
|
477
|
-
//# 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
|
-
"3"
|
|
152
|
+
"3") {
|
|
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
|
-
? "2"
|
|
180
|
-
: "1"
|
|
176
|
+
? "2"
|
|
177
|
+
: "1";
|
|
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
|