nativescript 8.9.1 → 8.9.3-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/test-deps-versions-generated.json +1 -1
- package/lib/android-tools-info.js +0 -12
- package/lib/base-package-manager.js +0 -7
- package/lib/bootstrap.js +1 -5
- package/lib/bun-package-manager.js +1 -17
- package/lib/color.js +0 -3
- 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 -4
- 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/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/definitions/project.d.ts +7 -0
- 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 -10
- 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 +4 -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 -16
- 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/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 +0 -4
- package/lib/services/ios/spm-service.js +0 -11
- package/lib/services/ios/xcodebuild-args-service.js +0 -9
- 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 -91
- 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 -1
- 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/webpack/webpack-compiler-service.js +35 -57
- 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
|
@@ -16,8 +16,7 @@ const constants_1 = require("../../constants");
|
|
|
16
16
|
const yok_1 = require("../../common/yok");
|
|
17
17
|
const package_path_helper_1 = require("../../helpers/package-path-helper");
|
|
18
18
|
class WebpackCompilerService extends events_1.EventEmitter {
|
|
19
|
-
constructor($options, $errors, $childProcess, $fs, $hooksService, $hostInfo, $logger, $mobileHelper, $cleanupService, $packageManager, $packageInstallationManager
|
|
20
|
-
) {
|
|
19
|
+
constructor($options, $errors, $childProcess, $fs, $hooksService, $hostInfo, $logger, $mobileHelper, $cleanupService, $packageManager, $packageInstallationManager, $projectConfigService) {
|
|
21
20
|
super();
|
|
22
21
|
this.$options = $options;
|
|
23
22
|
this.$errors = $errors;
|
|
@@ -30,6 +29,7 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
30
29
|
this.$cleanupService = $cleanupService;
|
|
31
30
|
this.$packageManager = $packageManager;
|
|
32
31
|
this.$packageInstallationManager = $packageInstallationManager;
|
|
32
|
+
this.$projectConfigService = $projectConfigService;
|
|
33
33
|
this.webpackProcesses = {};
|
|
34
34
|
this.expectedHashes = {};
|
|
35
35
|
}
|
|
@@ -51,23 +51,14 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
51
51
|
});
|
|
52
52
|
childProcess.on("message", (message) => {
|
|
53
53
|
this.$logger.trace("Message from webpack", message);
|
|
54
|
-
// if we are on webpack5 - we handle HMR in a slightly different way
|
|
55
54
|
if (typeof message === "object" &&
|
|
56
55
|
"version" in message &&
|
|
57
56
|
"type" in message) {
|
|
58
|
-
// first compilation can be ignored because it will be synced regardless
|
|
59
|
-
// handling it here would trigger 2 syncs
|
|
60
57
|
if (isFirstWebpackWatchCompilation) {
|
|
61
58
|
isFirstWebpackWatchCompilation = false;
|
|
62
59
|
resolve(childProcess);
|
|
63
60
|
return;
|
|
64
61
|
}
|
|
65
|
-
// if ((message as IWebpackMessage).type === "hmr-status") {
|
|
66
|
-
// // we pass message through our event-bus to be handled wherever needed
|
|
67
|
-
// // in this case webpack-hmr-status-service listens for this event
|
|
68
|
-
// this.$sharedEventBus.emit("webpack:hmr-status", message);
|
|
69
|
-
// return;
|
|
70
|
-
// }
|
|
71
62
|
return this.handleHMRMessage(message, platformData, projectData, prepareData);
|
|
72
63
|
}
|
|
73
64
|
if (message === "Webpack compilation complete.") {
|
|
@@ -82,7 +73,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
82
73
|
prepareData.hmr ? message.hash : "";
|
|
83
74
|
return;
|
|
84
75
|
}
|
|
85
|
-
// Persist the previousHash value before calling `this.getUpdatedEmittedFiles` as it will modify the expectedHashes object with the current hash
|
|
86
76
|
const previousHash = this.expectedHashes[platformData.platformNameLowerCase];
|
|
87
77
|
let result;
|
|
88
78
|
if (prepareData.hmr) {
|
|
@@ -107,7 +97,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
107
97
|
platform: platformData.platformNameLowerCase,
|
|
108
98
|
};
|
|
109
99
|
this.$logger.trace("Generated data from webpack message:", data);
|
|
110
|
-
// the hash of the compilation is the same as the previous one and there are only hot updates produced
|
|
111
100
|
if (data.hasOnlyHotUpdateFiles && previousHash === message.hash) {
|
|
112
101
|
return;
|
|
113
102
|
}
|
|
@@ -180,16 +169,20 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
180
169
|
}
|
|
181
170
|
}
|
|
182
171
|
async shouldUsePreserveSymlinksOption() {
|
|
183
|
-
// pnpm does not require symlink (https://github.com/nodejs/node-eps/issues/46#issuecomment-277373566)
|
|
184
|
-
// and it also does not work in some cases.
|
|
185
|
-
// Check https://github.com/NativeScript/nativescript-cli/issues/5259 for more information
|
|
186
172
|
const currentPackageManager = await this.$packageManager.getPackageManagerName();
|
|
187
173
|
const res = currentPackageManager !== constants_1.PackageManagers.pnpm;
|
|
188
174
|
return res;
|
|
189
175
|
}
|
|
190
176
|
async startWebpackProcess(platformData, projectData, prepareData) {
|
|
191
|
-
if (
|
|
192
|
-
this.$
|
|
177
|
+
if (projectData.bundlerConfigPath) {
|
|
178
|
+
if (!this.$fs.exists(projectData.bundlerConfigPath)) {
|
|
179
|
+
this.$errors.fail(`The bundler configuration file ${projectData.bundlerConfigPath} does not exist. Ensure the file exists, or update the path in ${constants_1.CONFIG_FILE_NAME_DISPLAY}.`);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
if (!this.$fs.exists(projectData.webpackConfigPath)) {
|
|
184
|
+
this.$errors.fail(`The webpack configuration file ${projectData.webpackConfigPath} does not exist. Ensure the file exists, or update the path in ${constants_1.CONFIG_FILE_NAME_DISPLAY}.`);
|
|
185
|
+
}
|
|
193
186
|
}
|
|
194
187
|
const envData = this.buildEnvData(platformData.platformNameLowerCase, projectData, prepareData);
|
|
195
188
|
const envParams = await this.buildEnvCommandLineParams(envData, platformData, projectData, prepareData);
|
|
@@ -203,8 +196,8 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
203
196
|
const args = [
|
|
204
197
|
...additionalNodeArgs,
|
|
205
198
|
this.getWebpackExecutablePath(projectData),
|
|
206
|
-
this.
|
|
207
|
-
`--config=${projectData.webpackConfigPath}`,
|
|
199
|
+
this.isModernBundler(projectData) ? `build` : null,
|
|
200
|
+
`--config=${projectData.bundlerConfigPath || projectData.webpackConfigPath}`,
|
|
208
201
|
...envParams,
|
|
209
202
|
].filter(Boolean);
|
|
210
203
|
if (prepareData.watch) {
|
|
@@ -245,28 +238,16 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
245
238
|
});
|
|
246
239
|
envData.verbose = envData.verbose || this.$logger.isVerbose();
|
|
247
240
|
envData.production = envData.production || prepareData.release;
|
|
248
|
-
// add the config file name to the env data so the webpack process can read the
|
|
249
|
-
// correct config file when resolving the CLI lib and the config service
|
|
250
|
-
// we are explicitly setting it to false to force using the defaults
|
|
251
241
|
envData.config =
|
|
252
242
|
(_b = (_a = process.env.NATIVESCRIPT_CONFIG_NAME) !== null && _a !== void 0 ? _a : this.$options.config) !== null && _b !== void 0 ? _b : "false";
|
|
253
|
-
// explicitly set the env variable
|
|
254
243
|
process.env.NATIVESCRIPT_CONFIG_NAME = envData.config;
|
|
255
|
-
// The snapshot generation is wrongly located in the Webpack plugin.
|
|
256
|
-
// It should be moved in the Native Prepare of the CLI or a Gradle task in the Runtime.
|
|
257
|
-
// As a workaround, we skip the mksnapshot, xxd and android-ndk calls based on skipNativePrepare.
|
|
258
|
-
// In this way the plugin will prepare only the snapshot JS entry without any native prepare and
|
|
259
|
-
// we will able to execute cloud builds with snapshot without having any local snapshot or Docker setup.
|
|
260
|
-
// TODO: Remove this flag when we remove the native part from the plugin.
|
|
261
244
|
envData.skipSnapshotTools =
|
|
262
245
|
prepareData.nativePrepare && prepareData.nativePrepare.skipNativePrepare;
|
|
263
|
-
// only set sourceMap if not explicitly set through a flag
|
|
264
246
|
if (typeof ((_c = prepareData === null || prepareData === void 0 ? void 0 : prepareData.env) === null || _c === void 0 ? void 0 : _c.sourceMap) === "undefined") {
|
|
265
247
|
if (!prepareData.release) {
|
|
266
248
|
envData.sourceMap = true;
|
|
267
249
|
}
|
|
268
250
|
}
|
|
269
|
-
// convert string to boolean
|
|
270
251
|
if (envData.sourceMap === "true" || envData.sourceMap === "false") {
|
|
271
252
|
envData.sourceMap = envData.sourceMap === "true";
|
|
272
253
|
}
|
|
@@ -318,15 +299,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
318
299
|
}
|
|
319
300
|
getUpdatedEmittedFiles(allEmittedFiles, chunkFiles, nextHash, platform) {
|
|
320
301
|
const currentHash = this.getCurrentHotUpdateHash(allEmittedFiles);
|
|
321
|
-
// This logic is needed as there are already cases when webpack doesn't emit any files physically.
|
|
322
|
-
// We've set noEmitOnErrors in webpack.config.js based on noEmitOnError from tsconfig.json,
|
|
323
|
-
// so webpack doesn't emit any files when noEmitOnErrors: true is set in webpack.config.js and
|
|
324
|
-
// there is a compilation error in the source code. On the other side, hmr generates new hot-update files
|
|
325
|
-
// on every change and the hash of the next hmr update is written inside hot-update.json file.
|
|
326
|
-
// Although webpack doesn't emit any files, hmr hash is still generated. The hash is generated per compilation no matter
|
|
327
|
-
// if files will be emitted or not. This way, the first successful compilation after fixing the compilation error generates
|
|
328
|
-
// a hash that is not the same as the one expected in the latest emitted hot-update.json file.
|
|
329
|
-
// As a result, the hmr chain is broken and the changes are not applied.
|
|
330
302
|
const isHashValid = nextHash
|
|
331
303
|
? this.expectedHashes[platform] === currentHash
|
|
332
304
|
: true;
|
|
@@ -345,7 +317,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
345
317
|
let hotHash;
|
|
346
318
|
const hotUpdateScripts = emittedFiles.filter((x) => x.endsWith(".hot-update.js"));
|
|
347
319
|
if (hotUpdateScripts && hotUpdateScripts.length) {
|
|
348
|
-
// the hash is the same for each hot update in the current compilation
|
|
349
320
|
const hotUpdateName = hotUpdateScripts[0];
|
|
350
321
|
const matcher = /^(.+)\.(.+)\.hot-update/gm;
|
|
351
322
|
const matches = matcher.exec(hotUpdateName);
|
|
@@ -363,7 +334,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
363
334
|
}
|
|
364
335
|
}
|
|
365
336
|
handleHMRMessage(message, platformData, projectData, prepareData) {
|
|
366
|
-
// handle new webpack hmr packets
|
|
367
337
|
this.$logger.trace("Received message from webpack process:", message);
|
|
368
338
|
if (message.type !== "compilation") {
|
|
369
339
|
return;
|
|
@@ -371,7 +341,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
371
341
|
this.$logger.trace("Webpack build done!");
|
|
372
342
|
const files = message.data.emittedAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, asset));
|
|
373
343
|
const staleFiles = message.data.staleAssets.map((asset) => path.join(platformData.appDestinationDirectoryPath, this.$options.hostProjectModuleName, asset));
|
|
374
|
-
// extract last hash from emitted filenames
|
|
375
344
|
const lastHash = (() => {
|
|
376
345
|
const absoluteFileNameWithLastHash = files.find((fileName) => fileName.endsWith("hot-update.js"));
|
|
377
346
|
if (!absoluteFileNameWithLastHash) {
|
|
@@ -384,7 +353,6 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
384
353
|
}
|
|
385
354
|
})();
|
|
386
355
|
if (!files.length) {
|
|
387
|
-
// ignore compilations if no new files are emitted
|
|
388
356
|
return;
|
|
389
357
|
}
|
|
390
358
|
this.emit(constants_1.WEBPACK_COMPILATION_COMPLETE, {
|
|
@@ -399,8 +367,9 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
399
367
|
});
|
|
400
368
|
}
|
|
401
369
|
getWebpackExecutablePath(projectData) {
|
|
402
|
-
|
|
403
|
-
|
|
370
|
+
const bundler = this.getBundler();
|
|
371
|
+
if (this.isModernBundler(projectData)) {
|
|
372
|
+
const packagePath = (0, package_path_helper_1.resolvePackagePath)(`@nativescript/${bundler}`, {
|
|
404
373
|
paths: [projectData.projectDir],
|
|
405
374
|
});
|
|
406
375
|
if (packagePath) {
|
|
@@ -415,23 +384,32 @@ class WebpackCompilerService extends events_1.EventEmitter {
|
|
|
415
384
|
}
|
|
416
385
|
return path.resolve(packagePath, "bin", "webpack.js");
|
|
417
386
|
}
|
|
418
|
-
|
|
419
|
-
const
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
if (packageJSONPath) {
|
|
423
|
-
const packageData = this.$fs.readJson(packageJSONPath);
|
|
424
|
-
const ver = semver.coerce(packageData.version);
|
|
425
|
-
if (semver.satisfies(ver, ">= 5.0.0")) {
|
|
387
|
+
isModernBundler(projectData) {
|
|
388
|
+
const bundler = this.getBundler();
|
|
389
|
+
switch (bundler) {
|
|
390
|
+
case "rspack":
|
|
426
391
|
return true;
|
|
427
|
-
|
|
392
|
+
default:
|
|
393
|
+
const packageJSONPath = (0, package_path_helper_1.resolvePackageJSONPath)("@nativescript/webpack", {
|
|
394
|
+
paths: [projectData.projectDir],
|
|
395
|
+
});
|
|
396
|
+
if (packageJSONPath) {
|
|
397
|
+
const packageData = this.$fs.readJson(packageJSONPath);
|
|
398
|
+
const ver = semver.coerce(packageData.version);
|
|
399
|
+
if (semver.satisfies(ver, ">= 5.0.0")) {
|
|
400
|
+
return true;
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
break;
|
|
428
404
|
}
|
|
429
405
|
return false;
|
|
430
406
|
}
|
|
407
|
+
getBundler() {
|
|
408
|
+
return this.$projectConfigService.getValue(`bundler`, "webpack");
|
|
409
|
+
}
|
|
431
410
|
}
|
|
432
411
|
exports.WebpackCompilerService = WebpackCompilerService;
|
|
433
412
|
__decorate([
|
|
434
413
|
(0, decorators_1.performanceLog)()
|
|
435
414
|
], WebpackCompilerService.prototype, "startWebpackProcess", null);
|
|
436
415
|
yok_1.injector.register("webpackCompilerService", WebpackCompilerService);
|
|
437
|
-
//# sourceMappingURL=webpack-compiler-service.js.map
|
|
@@ -55,7 +55,6 @@ class XcconfigService {
|
|
|
55
55
|
}
|
|
56
56
|
});
|
|
57
57
|
if (isPropertyParsed) {
|
|
58
|
-
// property can be an empty string, so we don't check for that.
|
|
59
58
|
return property;
|
|
60
59
|
}
|
|
61
60
|
}
|
|
@@ -64,4 +63,3 @@ class XcconfigService {
|
|
|
64
63
|
}
|
|
65
64
|
exports.XcconfigService = XcconfigService;
|
|
66
65
|
yok_1.injector.register("xcconfigService", XcconfigService);
|
|
67
|
-
//# sourceMappingURL=xcconfig-service.js.map
|
package/lib/shared-event-bus.js
CHANGED
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const events_1 = require("events");
|
|
4
4
|
const yok_1 = require("./common/yok");
|
|
5
|
-
/**
|
|
6
|
-
* Event Bus used by different services to emit state changes and
|
|
7
|
-
* allow listening for these state changes without needing a reference
|
|
8
|
-
* to the emitting service.
|
|
9
|
-
*/
|
|
10
5
|
class SharedEventBus extends events_1.EventEmitter {
|
|
11
6
|
}
|
|
12
7
|
yok_1.injector.register("sharedEventBus", SharedEventBus);
|
|
13
|
-
//# sourceMappingURL=shared-event-bus.js.map
|
package/lib/sys-info.js
CHANGED
|
@@ -79,7 +79,7 @@ class SysInfo {
|
|
|
79
79
|
if (macOSVersion && macOSVersion < constants_1.MacOSVersions.HighSierra) {
|
|
80
80
|
return {
|
|
81
81
|
message: (0, util_1.format)(constants_1.MacOSDeprecationStringFormat, macOSVersion),
|
|
82
|
-
severity: "high"
|
|
82
|
+
severity: "high",
|
|
83
83
|
};
|
|
84
84
|
}
|
|
85
85
|
return null;
|
|
@@ -101,4 +101,3 @@ __decorate([
|
|
|
101
101
|
(0, decorators_1.exported)("sysInfo")
|
|
102
102
|
], SysInfo.prototype, "getSupportedNodeVersionRange", null);
|
|
103
103
|
yok_1.injector.register("sysInfo", SysInfo);
|
|
104
|
-
//# sourceMappingURL=sys-info.js.map
|
|
@@ -55,7 +55,6 @@ class ConfigTransformer {
|
|
|
55
55
|
const parts = key.split(".");
|
|
56
56
|
const name = parts.shift();
|
|
57
57
|
const property = this.getProperty(name, parent);
|
|
58
|
-
// no android key, add it to parent to root
|
|
59
58
|
if (!property) {
|
|
60
59
|
return undefined;
|
|
61
60
|
}
|
|
@@ -65,14 +64,11 @@ class ConfigTransformer {
|
|
|
65
64
|
if (!_parent) {
|
|
66
65
|
return undefined;
|
|
67
66
|
}
|
|
68
|
-
// add nonExistent.deep to android: {}
|
|
69
67
|
return this.getProperty(parts.join("."), _parent);
|
|
70
68
|
}
|
|
71
|
-
// if we have a parent, we are reading the property from it
|
|
72
69
|
if (parent) {
|
|
73
70
|
return parent.getProperty(key);
|
|
74
71
|
}
|
|
75
|
-
// otherwise we just read it from the root exports object
|
|
76
72
|
return this.getProperty(key, this.getDefaultExportValue());
|
|
77
73
|
}
|
|
78
74
|
addProperty(key, value, parent = null) {
|
|
@@ -194,22 +190,15 @@ class ConfigTransformer {
|
|
|
194
190
|
}
|
|
195
191
|
this.setInitializerValue(initializer, newValue);
|
|
196
192
|
}
|
|
197
|
-
/**
|
|
198
|
-
* @internal
|
|
199
|
-
*/
|
|
200
193
|
getFullText() {
|
|
201
194
|
return this.config.getFullText();
|
|
202
195
|
}
|
|
203
|
-
/**
|
|
204
|
-
* @internal
|
|
205
|
-
*/
|
|
206
196
|
getValue(key) {
|
|
207
197
|
return this.getPropertyValue(this.getProperty(key));
|
|
208
198
|
}
|
|
209
199
|
setValue(key, value) {
|
|
210
200
|
const property = this.getProperty(key);
|
|
211
201
|
if (!property) {
|
|
212
|
-
// add new property
|
|
213
202
|
this.addProperty(key, value);
|
|
214
203
|
}
|
|
215
204
|
else {
|
|
@@ -219,4 +208,3 @@ class ConfigTransformer {
|
|
|
219
208
|
}
|
|
220
209
|
}
|
|
221
210
|
exports.ConfigTransformer = ConfigTransformer;
|
|
222
|
-
//# sourceMappingURL=config-transformer.js.map
|
|
@@ -56,18 +56,14 @@ class NodeModulesDependenciesBuilder {
|
|
|
56
56
|
let modulePath = (0, resolve_package_path_1.resolvePackagePath)(depDescription.name, {
|
|
57
57
|
paths: [parentModulesPath],
|
|
58
58
|
});
|
|
59
|
-
// perhaps traverse up the tree here?
|
|
60
59
|
if (!modulePath) {
|
|
61
|
-
// fallback to searching in the root path
|
|
62
60
|
modulePath = (0, resolve_package_path_1.resolvePackagePath)(depDescription.name, {
|
|
63
61
|
paths: [rootPath],
|
|
64
62
|
});
|
|
65
63
|
}
|
|
66
|
-
// if we failed to find the module...
|
|
67
64
|
if (!modulePath) {
|
|
68
65
|
return null;
|
|
69
66
|
}
|
|
70
|
-
// if we already resolved this dependency, we return null to avoid a duplicate resolution
|
|
71
67
|
if (resolvedDependencies.some((r) => {
|
|
72
68
|
return r.name === depDescription.name && r.directory === modulePath;
|
|
73
69
|
})) {
|
|
@@ -92,7 +88,6 @@ class NodeModulesDependenciesBuilder {
|
|
|
92
88
|
const packageJsonContents = this.$fs.readJson(packageJsonPath);
|
|
93
89
|
dependency.version = packageJsonContents.version;
|
|
94
90
|
if (!!packageJsonContents.nativescript) {
|
|
95
|
-
// add `nativescript` property, necessary for resolving plugins
|
|
96
91
|
dependency.nativescript = packageJsonContents.nativescript;
|
|
97
92
|
}
|
|
98
93
|
dependency.dependencies = _.keys(packageJsonContents.dependencies);
|
|
@@ -103,4 +98,3 @@ class NodeModulesDependenciesBuilder {
|
|
|
103
98
|
}
|
|
104
99
|
exports.NodeModulesDependenciesBuilder = NodeModulesDependenciesBuilder;
|
|
105
100
|
yok_1.injector.register("nodeModulesDependenciesBuilder", NodeModulesDependenciesBuilder);
|
|
106
|
-
//# sourceMappingURL=node-modules-dependencies-builder.js.map
|
|
@@ -36,8 +36,6 @@ class Yarn2PackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
36
36
|
}
|
|
37
37
|
const packageJsonPath = path.join(pathToSave, "package.json");
|
|
38
38
|
const jsonContentBefore = this.$fs.readJson(packageJsonPath);
|
|
39
|
-
// remove unsupported flags
|
|
40
|
-
// todo: refactor all package managers to map typed flags to the actual flags
|
|
41
39
|
const cleanedConfig = _.omit(config, ["save-dev", "save-exact"]);
|
|
42
40
|
const flags = this.getFlagsString(cleanedConfig, true);
|
|
43
41
|
let params = [];
|
|
@@ -124,4 +122,3 @@ __decorate([
|
|
|
124
122
|
(0, decorators_1.exported)("yarn2")
|
|
125
123
|
], Yarn2PackageManager.prototype, "getCachePath", null);
|
|
126
124
|
yok_1.injector.register("yarn2", Yarn2PackageManager);
|
|
127
|
-
//# sourceMappingURL=yarn2-package-manager.js.map
|
package/package.json
CHANGED