nativescript 8.8.0 → 8.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/test-deps-versions-generated.json +1 -1
- package/lib/android-tools-info.js +12 -0
- package/lib/base-package-manager.js +11 -1
- package/lib/bootstrap.js +5 -1
- package/lib/bun-package-manager.js +17 -1
- package/lib/color.js +3 -0
- package/lib/commands/add-platform.js +1 -0
- package/lib/commands/apple-login.js +1 -0
- package/lib/commands/appstore-list.js +1 -0
- package/lib/commands/appstore-upload.js +4 -0
- package/lib/commands/build.js +3 -2
- package/lib/commands/clean.js +22 -1
- package/lib/commands/command-base.js +1 -0
- package/lib/commands/config.js +3 -0
- package/lib/commands/create-project.js +6 -0
- package/lib/commands/debug.js +6 -1
- package/lib/commands/deploy.js +3 -2
- package/lib/commands/embedding/embed.js +7 -0
- package/lib/commands/extensibility/install-extension.js +1 -0
- package/lib/commands/extensibility/list-extensions.js +1 -0
- package/lib/commands/extensibility/uninstall-extension.js +1 -0
- package/lib/commands/fonts.js +1 -0
- package/lib/commands/generate-assets.js +1 -0
- package/lib/commands/generate-help.js +1 -0
- package/lib/commands/generate.js +12 -2
- package/lib/commands/info.js +1 -0
- package/lib/commands/install.js +1 -0
- package/lib/commands/list-platforms.js +1 -0
- package/lib/commands/migrate.js +1 -0
- package/lib/commands/native-add.js +5 -0
- package/lib/commands/platform-clean.js +1 -0
- package/lib/commands/plugin/add-plugin.js +1 -0
- package/lib/commands/plugin/build-plugin.js +1 -0
- package/lib/commands/plugin/create-plugin.js +5 -0
- package/lib/commands/plugin/list-plugins.js +1 -0
- package/lib/commands/plugin/remove-plugin.js +2 -0
- package/lib/commands/plugin/update-plugin.js +1 -0
- package/lib/commands/post-install.js +6 -0
- package/lib/commands/prepare.js +4 -3
- package/lib/commands/preview.js +2 -0
- package/lib/commands/remove-platform.js +1 -0
- package/lib/commands/resources/resources-update.js +2 -0
- package/lib/commands/run.js +1 -0
- package/lib/commands/setup.js +1 -0
- package/lib/commands/start.js +1 -0
- package/lib/commands/test-init.js +4 -0
- package/lib/commands/test.js +9 -2
- package/lib/commands/typings.js +2 -1
- package/lib/commands/update-platform.js +5 -0
- package/lib/commands/update.js +2 -0
- package/lib/common/bootstrap.js +1 -0
- package/lib/common/child-process.js +3 -0
- package/lib/common/codeGeneration/code-entity.js +1 -0
- package/lib/common/codeGeneration/code-printer.js +1 -0
- package/lib/common/command-params.js +1 -0
- package/lib/common/commands/analytics.js +3 -0
- package/lib/common/commands/autocompletion.js +3 -0
- package/lib/common/commands/device/device-log-stream.js +1 -0
- package/lib/common/commands/device/get-file.js +2 -0
- package/lib/common/commands/device/list-applications.js +1 -0
- package/lib/common/commands/device/list-devices.js +3 -0
- package/lib/common/commands/device/list-files.js +2 -0
- package/lib/common/commands/device/put-file.js +2 -0
- package/lib/common/commands/device/run-application.js +1 -0
- package/lib/common/commands/device/stop-application.js +1 -0
- package/lib/common/commands/device/uninstall-application.js +1 -0
- package/lib/common/commands/doctor.js +3 -2
- package/lib/common/commands/generate-messages.js +1 -0
- package/lib/common/commands/help.js +1 -0
- package/lib/common/commands/package-manager-get.js +1 -0
- package/lib/common/commands/package-manager-set.js +1 -0
- package/lib/common/commands/post-install.js +1 -0
- package/lib/common/commands/preuninstall.js +11 -2
- package/lib/common/commands/proxy/proxy-base.js +4 -0
- package/lib/common/commands/proxy/proxy-clear.js +1 -0
- package/lib/common/commands/proxy/proxy-get.js +1 -0
- package/lib/common/commands/proxy/proxy-set.js +1 -0
- package/lib/common/common-lib.js +1 -0
- package/lib/common/constants.js +11 -0
- package/lib/common/decorators.js +48 -0
- package/lib/common/dispatchers.js +10 -1
- package/lib/common/errors.js +13 -3
- package/lib/common/file-system.js +13 -2
- package/lib/common/header.js +3 -0
- package/lib/common/helpers.js +89 -3
- package/lib/common/host-info.js +4 -0
- package/lib/common/http-client.js +20 -0
- package/lib/common/logger/appenders/cli-appender.js +4 -0
- package/lib/common/logger/appenders/emit-appender.js +4 -0
- package/lib/common/logger/layouts/cli-layout.js +1 -0
- package/lib/common/logger/logger.js +5 -0
- package/lib/common/messages/messages.js +6 -0
- package/lib/common/mobile/android/android-application-manager.js +20 -1
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -0
- package/lib/common/mobile/android/android-debug-bridge.js +6 -0
- package/lib/common/mobile/android/android-device-file-system.js +4 -0
- package/lib/common/mobile/android/android-device-hash-service.js +3 -0
- package/lib/common/mobile/android/android-device.js +8 -0
- package/lib/common/mobile/android/android-emulator-services.js +2 -1
- package/lib/common/mobile/android/android-ini-file-parser.js +9 -0
- package/lib/common/mobile/android/android-log-filter.js +4 -0
- package/lib/common/mobile/android/android-virtual-device-service.js +30 -1
- package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
- package/lib/common/mobile/android/genymotion/genymotion-service.js +5 -0
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
- package/lib/common/mobile/android/logcat-helper.js +13 -0
- package/lib/common/mobile/application-manager-base.js +6 -0
- package/lib/common/mobile/device-emitter.js +4 -0
- package/lib/common/mobile/device-log-emitter.js +1 -0
- package/lib/common/mobile/device-log-provider-base.js +1 -0
- package/lib/common/mobile/device-log-provider.js +23 -0
- package/lib/common/mobile/device-platforms-constants.js +1 -0
- package/lib/common/mobile/emulator-helper.js +4 -0
- package/lib/common/mobile/ios/device/ios-application-manager.js +3 -0
- package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -0
- package/lib/common/mobile/ios/device/ios-device-operations.js +4 -0
- package/lib/common/mobile/ios/device/ios-device.js +4 -0
- package/lib/common/mobile/ios/ios-device-base.js +1 -0
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +2 -0
- package/lib/common/mobile/ios/ios-log-filter.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +4 -0
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +6 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +5 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +1 -0
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +1 -0
- package/lib/common/mobile/local-to-device-path-data-factory.js +1 -0
- package/lib/common/mobile/log-filter.js +2 -0
- package/lib/common/mobile/logging-levels.js +1 -0
- package/lib/common/mobile/mobile-core/android-device-discovery.js +2 -0
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +3 -0
- package/lib/common/mobile/mobile-core/android-process-service.js +32 -0
- package/lib/common/mobile/mobile-core/device-discovery.js +1 -0
- package/lib/common/mobile/mobile-core/devices-service.js +69 -0
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +2 -0
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
- package/lib/common/mobile/mobile-helper.js +1 -0
- package/lib/common/mobile/wp8/wp8-emulator-services.js +1 -0
- package/lib/common/opener.js +1 -0
- package/lib/common/os-info.js +1 -0
- package/lib/common/plist-parser.js +1 -0
- package/lib/common/project-helper.js +1 -0
- package/lib/common/prompter.js +9 -1
- package/lib/common/queue.js +1 -0
- package/lib/common/resource-loader.js +1 -0
- package/lib/common/services/auto-completion-service.js +13 -1
- package/lib/common/services/cancellation.js +2 -1
- package/lib/common/services/commands-service.js +17 -6
- package/lib/common/services/help-service.js +11 -3
- package/lib/common/services/hooks-service.js +13 -0
- package/lib/common/services/ios-notification-service.js +1 -0
- package/lib/common/services/json-file-settings-service.js +6 -0
- package/lib/common/services/lock-service.js +6 -0
- package/lib/common/services/message-contract-generator.js +1 -0
- package/lib/common/services/messages-service.js +1 -0
- package/lib/common/services/micro-templating-service.js +6 -0
- package/lib/common/services/net-service.js +3 -0
- package/lib/common/services/project-files-manager.js +5 -0
- package/lib/common/services/project-files-provider-base.js +1 -0
- package/lib/common/services/proxy-service.js +1 -0
- package/lib/common/services/qr.js +1 -0
- package/lib/common/services/settings-service.js +1 -0
- package/lib/common/services/xcode-select-service.js +1 -0
- package/lib/common/utils.js +1 -0
- package/lib/common/validators/project-name-validator.js +1 -0
- package/lib/common/validators/validation-result.js +1 -0
- package/lib/common/verify-node-version.js +8 -1
- package/lib/common/yok.js +32 -11
- package/lib/config.js +22 -1
- package/lib/constants-provider.js +1 -0
- package/lib/constants.js +53 -0
- package/lib/controllers/build-controller.js +4 -3
- package/lib/controllers/debug-controller.js +8 -3
- package/lib/controllers/deploy-controller.js +1 -0
- package/lib/controllers/migrate-controller.js +91 -3
- package/lib/controllers/platform-controller.js +9 -1
- package/lib/controllers/prepare-controller.js +17 -4
- package/lib/controllers/run-controller.js +17 -1
- package/lib/controllers/update-controller-base.js +1 -0
- package/lib/controllers/update-controller.js +11 -0
- package/lib/data/build-data.js +1 -0
- package/lib/data/controller-data-base.js +1 -0
- package/lib/data/debug-data.js +1 -0
- package/lib/data/platform-data.js +1 -0
- package/lib/data/prepare-data.js +1 -0
- package/lib/data/run-data.js +1 -0
- package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
- package/lib/detached-processes/cleanup-process.js +18 -14
- package/lib/detached-processes/file-log-service.js +2 -1
- package/lib/device-path-provider.js +1 -0
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +7 -0
- package/lib/device-sockets/ios/notification.js +3 -0
- package/lib/device-sockets/ios/socket-request-executor.js +3 -0
- package/lib/helpers/android-bundle-validator-helper.js +2 -1
- package/lib/helpers/deploy-command-helper.js +1 -0
- package/lib/helpers/key-command-helper.js +4 -2
- package/lib/helpers/livesync-command-helper.js +4 -1
- package/lib/helpers/network-connectivity-validator.js +1 -0
- package/lib/helpers/options-track-helper.js +3 -2
- package/lib/helpers/package-path-helper.js +1 -0
- package/lib/helpers/platform-command-helper.js +7 -2
- package/lib/helpers/version-validator-helper.js +1 -0
- package/lib/key-commands/bootstrap.js +3 -2
- package/lib/key-commands/index.js +5 -4
- package/lib/nativescript-cli-lib-bootstrap.js +4 -0
- package/lib/nativescript-cli-lib.js +1 -0
- package/lib/nativescript-cli.js +10 -1
- package/lib/node/pbxproj-dom-xcode.js +1 -0
- package/lib/node/xcode.js +1 -0
- package/lib/node-package-manager.js +11 -1
- package/lib/options.js +143 -118
- package/lib/package-installation-manager.js +8 -1
- package/lib/package-manager.js +2 -0
- package/lib/platform-command-param.js +1 -0
- package/lib/pnpm-package-manager.js +4 -1
- package/lib/project-data.js +12 -0
- package/lib/providers/project-files-provider.js +1 -0
- package/lib/resolvers/livesync-service-resolver.js +1 -0
- package/lib/services/analytics/analytics-broker-process.js +10 -6
- package/lib/services/analytics/analytics-broker.js +2 -1
- package/lib/services/analytics/analytics-service.js +29 -25
- package/lib/services/analytics/google-analytics-provider.js +13 -12
- package/lib/services/analytics-settings-service.js +5 -0
- package/lib/services/android/android-bundle-tool-service.js +1 -0
- package/lib/services/android/gradle-build-args-service.js +3 -0
- package/lib/services/android/gradle-build-service.js +1 -0
- package/lib/services/android/gradle-command-service.js +6 -1
- package/lib/services/android-device-debug-service.js +6 -0
- package/lib/services/android-plugin-build-service.js +33 -1
- package/lib/services/android-project-service.js +71 -4
- package/lib/services/android-resources-migration-service.js +7 -0
- package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
- package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
- package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
- package/lib/services/assets-generation/assets-generation-service.js +16 -5
- package/lib/services/build-artifacts-service.js +2 -1
- package/lib/services/build-data-service.js +1 -0
- package/lib/services/build-info-file-service.js +1 -0
- package/lib/services/cleanup-service.js +13 -9
- package/lib/services/cocoapods-platform-manager.js +9 -0
- package/lib/services/cocoapods-service.js +21 -1
- package/lib/services/debug-data-service.js +1 -0
- package/lib/services/debug-service-base.js +7 -0
- package/lib/services/device/device-install-app-service.js +2 -1
- package/lib/services/doctor-service.js +21 -6
- package/lib/services/extensibility-service.js +8 -0
- package/lib/services/files-hash-service.js +1 -0
- package/lib/services/hmr-status-service.js +2 -0
- package/lib/services/info-service.js +1 -0
- package/lib/services/initialize-service.js +5 -1
- package/lib/services/ios/export-options-plist-service.js +4 -0
- package/lib/services/ios/ios-signing-service.js +4 -0
- package/lib/services/ios/spm-service.js +9 -0
- package/lib/services/ios/xcodebuild-args-service.js +9 -0
- package/lib/services/ios/xcodebuild-command-service.js +1 -0
- package/lib/services/ios/xcodebuild-service.js +1 -0
- package/lib/services/ios-debugger-port-service.js +1 -0
- package/lib/services/ios-device-debug-service.js +1 -0
- package/lib/services/ios-entitlements-service.js +1 -0
- package/lib/services/ios-extensions-service.js +1 -0
- package/lib/services/ios-log-filter.js +20 -0
- package/lib/services/ios-native-target-service.js +6 -4
- package/lib/services/ios-project-service.js +94 -2
- package/lib/services/ios-provision-service.js +3 -0
- package/lib/services/ios-watch-app-service.js +1 -0
- package/lib/services/ip-service.js +2 -0
- package/lib/services/itmstransporter-service.js +1 -0
- package/lib/services/karma-execution.js +2 -0
- package/lib/services/livesync/android-device-livesync-service-base.js +1 -0
- package/lib/services/livesync/android-device-livesync-service.js +2 -0
- package/lib/services/livesync/android-device-livesync-sockets-service.js +3 -0
- package/lib/services/livesync/android-livesync-service.js +1 -0
- package/lib/services/livesync/android-livesync-tool.js +4 -0
- package/lib/services/livesync/device-livesync-service-base.js +2 -0
- package/lib/services/livesync/ios-device-livesync-service.js +7 -0
- package/lib/services/livesync/ios-livesync-service.js +2 -0
- package/lib/services/livesync/livesync-socket.js +1 -0
- package/lib/services/livesync/platform-livesync-service-base.js +5 -0
- package/lib/services/livesync-process-data-service.js +1 -0
- package/lib/services/log-parser-service.js +1 -0
- package/lib/services/log-source-map-service.js +15 -0
- package/lib/services/marking-mode-service.js +8 -5
- package/lib/services/metadata-filtering-service.js +1 -0
- package/lib/services/npm-config-service.js +4 -0
- package/lib/services/pacote-service.js +7 -0
- package/lib/services/performance-service.js +3 -1
- package/lib/services/platform/add-platform-service.js +49 -2
- package/lib/services/platform/platform-validation-service.js +1 -0
- package/lib/services/platform/prepare-native-platform-service.js +5 -2
- package/lib/services/platform-environment-requirements.js +8 -3
- package/lib/services/platform-project-service-base.js +1 -0
- package/lib/services/platforms-data-service.js +1 -0
- package/lib/services/plugins-service.js +20 -2
- package/lib/services/prepare-data-service.js +1 -0
- package/lib/services/project-backup-service.js +4 -0
- package/lib/services/project-changes-service.js +14 -3
- package/lib/services/project-cleanup-service.js +2 -0
- package/lib/services/project-config-service.js +22 -2
- package/lib/services/project-data-service.js +36 -7
- package/lib/services/project-name-service.js +1 -0
- package/lib/services/project-service.js +10 -0
- package/lib/services/project-templates-service.js +3 -2
- package/lib/services/qr-code-terminal-service.js +1 -0
- package/lib/services/require-service.js +1 -0
- package/lib/services/start-service.js +1 -0
- package/lib/services/temp-service.js +1 -0
- package/lib/services/terminal-spinner-service.js +2 -0
- package/lib/services/test-execution-service.js +9 -2
- package/lib/services/test-initialization-service.js +4 -0
- package/lib/services/timeline-profiler-service.js +1 -0
- package/lib/services/user-settings-service.js +1 -0
- package/lib/services/versions-service.js +6 -4
- package/lib/services/watch-ignore-list-service.js +1 -0
- package/lib/services/webpack/webpack-compiler-service.js +42 -1
- package/lib/services/xcconfig-service.js +2 -0
- package/lib/services/xcproj-service.js +1 -0
- package/lib/shared-event-bus.js +6 -0
- package/lib/sys-info.js +2 -1
- package/lib/tools/config-manipulation/config-transformer.js +12 -0
- package/lib/tools/node-modules/node-modules-builder.js +1 -0
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
- package/lib/yarn-package-manager.js +1 -0
- package/lib/yarn2-package-manager.js +3 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +15 -0
- package/node_modules/rimraf/CHANGELOG.md +65 -0
- package/node_modules/stringify-package/CHANGELOG.md +16 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"@jsdevtools/coverage-istanbul-loader":"3.0.5","karma":"6.4.
|
|
1
|
+
{"@jsdevtools/coverage-istanbul-loader":"3.0.5","karma":"6.4.4","karma-coverage":"2.2.1","karma-nativescript-launcher":"0.4.0","mocha":"10.7.3","karma-mocha":"2.0.1","karma-chai":"0.1.0","karma-jasmine":"4.0.2","karma-qunit":"4.2.0","@types/karma-chai":"0.1.6","@types/mocha":"10.0.7","@types/jasmine":"5.1.4","@types/qunit":"2.19.10","nyc":"17.0.0"}
|
|
@@ -84,6 +84,8 @@ class AndroidToolsInfo {
|
|
|
84
84
|
return doctor_1.androidToolsInfo.getPathToAdbFromAndroidHome();
|
|
85
85
|
}
|
|
86
86
|
catch (err) {
|
|
87
|
+
// adb does not exist, so ANDROID_HOME is not set correctly
|
|
88
|
+
// try getting default adb path (included in CLI package)
|
|
87
89
|
this.$logger.trace(`Error while executing '${path.join(doctor_1.androidToolsInfo.androidHome, "platform-tools", "adb")} help'. Error is: ${err.message}`);
|
|
88
90
|
}
|
|
89
91
|
return null;
|
|
@@ -98,6 +100,14 @@ class AndroidToolsInfo {
|
|
|
98
100
|
shouldGenerateTypings() {
|
|
99
101
|
return this.$options.androidTypings;
|
|
100
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* Prints messages on the screen. In case the showWarningsAsErrors flag is set to true, warnings are shown, else - errors.
|
|
105
|
+
* Uses logger.warn for warnings and errors.failWithoutHelp when erros must be shown.
|
|
106
|
+
* In case additional details must be shown as info message, use the second parameter.
|
|
107
|
+
* NOTE: The additional information will not be printed when showWarningsAsErrors flag is set.
|
|
108
|
+
* @param {string} msg The message that will be shown as warning or error.
|
|
109
|
+
* @return {void}
|
|
110
|
+
*/
|
|
101
111
|
printMessage(msg, showWarningsAsErrors) {
|
|
102
112
|
if (showWarningsAsErrors) {
|
|
103
113
|
this.$errors.fail(msg);
|
|
@@ -117,6 +127,7 @@ class AndroidToolsInfo {
|
|
|
117
127
|
}
|
|
118
128
|
return latestCompileSdk;
|
|
119
129
|
}
|
|
130
|
+
// TODO check if still needed
|
|
120
131
|
getTargetSdk(compileSdk) {
|
|
121
132
|
const targetSdk = this.$options.sdk
|
|
122
133
|
? parseInt(this.$options.sdk)
|
|
@@ -133,3 +144,4 @@ __decorate([
|
|
|
133
144
|
], AndroidToolsInfo.prototype, "validateAndroidHomeEnvVariable", null);
|
|
134
145
|
exports.AndroidToolsInfo = AndroidToolsInfo;
|
|
135
146
|
yok_1.injector.register("androidToolsInfo", AndroidToolsInfo);
|
|
147
|
+
//# sourceMappingURL=android-tools-info.js.map
|
|
@@ -28,6 +28,8 @@ class BasePackageManager {
|
|
|
28
28
|
}
|
|
29
29
|
try {
|
|
30
30
|
const viewResult = yield this.view(packageName, { name: true });
|
|
31
|
+
// `npm view nonExistingPackageName` will return `nativescript`
|
|
32
|
+
// if executed in the root dir of the CLI (npm 6.4.1)
|
|
31
33
|
const packageNameRegex = new RegExp(packageName, "i");
|
|
32
34
|
const isProperResult = packageNameRegex.test(viewResult);
|
|
33
35
|
return isProperResult;
|
|
@@ -39,6 +41,8 @@ class BasePackageManager {
|
|
|
39
41
|
}
|
|
40
42
|
getPackageNameParts(fullPackageName) {
|
|
41
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
// support <reserved_name>@<version> syntax, for example typescript@1.0.0
|
|
45
|
+
// support <scoped_package_name>@<version> syntax, for example @nativescript/vue-template@1.0.0
|
|
42
46
|
const lastIndexOfAtSign = fullPackageName.lastIndexOf("@");
|
|
43
47
|
let version = "";
|
|
44
48
|
let templateName = "";
|
|
@@ -70,11 +74,16 @@ class BasePackageManager {
|
|
|
70
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
71
75
|
const npmExecutable = this.getPackageManagerExecutableName();
|
|
72
76
|
const stdioValue = (0, helpers_1.isInteractive)() ? "inherit" : "pipe";
|
|
73
|
-
|
|
77
|
+
const sanitizedNpmExecutable = this.$hostInfo.isWindows
|
|
78
|
+
? (0, helpers_1.quoteString)(npmExecutable)
|
|
79
|
+
: npmExecutable;
|
|
80
|
+
yield this.$childProcess.spawnFromEvent(sanitizedNpmExecutable, params, "close", {
|
|
74
81
|
cwd: opts.cwd,
|
|
75
82
|
stdio: stdioValue,
|
|
76
83
|
shell: this.$hostInfo.isWindows,
|
|
77
84
|
});
|
|
85
|
+
// Whenever calling "npm install" or "yarn add" without any arguments (hence installing all dependencies) no output is emitted on stdout
|
|
86
|
+
// Luckily, whenever you call "npm install" or "yarn add" to install all dependencies chances are you won't need the name/version of the package you're installing because there is none.
|
|
78
87
|
const { isInstallingAllDependencies } = opts;
|
|
79
88
|
if (isInstallingAllDependencies) {
|
|
80
89
|
return null;
|
|
@@ -127,3 +136,4 @@ class BasePackageManager {
|
|
|
127
136
|
}
|
|
128
137
|
}
|
|
129
138
|
exports.BasePackageManager = BasePackageManager;
|
|
139
|
+
//# sourceMappingURL=base-package-manager.js.map
|
package/lib/bootstrap.js
CHANGED
|
@@ -5,6 +5,7 @@ require("./common/bootstrap");
|
|
|
5
5
|
yok_1.injector.requirePublicClass("logger", "./common/logger/logger");
|
|
6
6
|
yok_1.injector.require("config", "./config");
|
|
7
7
|
yok_1.injector.require("options", "./options");
|
|
8
|
+
// note: order above is important!
|
|
8
9
|
yok_1.injector.requirePublicClass("constants", "./constants-provider");
|
|
9
10
|
yok_1.injector.require("projectData", "./project-data");
|
|
10
11
|
yok_1.injector.requirePublic("projectDataService", "./services/project-data-service");
|
|
@@ -99,6 +100,8 @@ yok_1.injector.requireCommand("dev-test|android", "./commands/test");
|
|
|
99
100
|
yok_1.injector.requireCommand("dev-test|ios", "./commands/test");
|
|
100
101
|
yok_1.injector.requireCommand("test|android", "./commands/test");
|
|
101
102
|
yok_1.injector.requireCommand("test|ios", "./commands/test");
|
|
103
|
+
// injector.requireCommand("test|vision", "./commands/test");
|
|
104
|
+
// injector.requireCommand("test|visionos", "./commands/test");
|
|
102
105
|
yok_1.injector.requireCommand("test|init", "./commands/test-init");
|
|
103
106
|
yok_1.injector.requireCommand("dev-generate-help", "./commands/generate-help");
|
|
104
107
|
yok_1.injector.requireCommand("appstore|*list", "./commands/appstore-list");
|
|
@@ -149,7 +152,7 @@ yok_1.injector.require("LiveSyncSocket", "./services/livesync/livesync-socket");
|
|
|
149
152
|
yok_1.injector.requirePublicClass("androidLivesyncTool", "./services/livesync/android-livesync-tool");
|
|
150
153
|
yok_1.injector.require("androidLiveSyncService", "./services/livesync/android-livesync-service");
|
|
151
154
|
yok_1.injector.require("iOSLiveSyncService", "./services/livesync/ios-livesync-service");
|
|
152
|
-
yok_1.injector.require("usbLiveSyncService", "./services/livesync/livesync-service");
|
|
155
|
+
yok_1.injector.require("usbLiveSyncService", "./services/livesync/livesync-service"); // The name is used in https://github.com/NativeScript/nativescript-dev-typescript
|
|
153
156
|
yok_1.injector.requirePublic("sysInfo", "./sys-info");
|
|
154
157
|
yok_1.injector.require("iOSNotificationService", "./services/ios-notification-service");
|
|
155
158
|
yok_1.injector.require("appDebugSocketProxyFactory", "./device-sockets/ios/app-debug-socket-proxy-factory");
|
|
@@ -209,3 +212,4 @@ yok_1.injector.requireCommand([
|
|
|
209
212
|
"native|add|objective-c",
|
|
210
213
|
], "./commands/native-add");
|
|
211
214
|
require("./key-commands/bootstrap");
|
|
215
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -40,6 +40,9 @@ class BunPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
40
40
|
const packageJsonPath = path.join(pathToSave, "package.json");
|
|
41
41
|
const jsonContentBefore = this.$fs.readJson(packageJsonPath);
|
|
42
42
|
const flags = this.getFlagsString(config, true);
|
|
43
|
+
// TODO: Confirm desired behavior. The npm version uses --legacy-peer-deps
|
|
44
|
+
// by default, we could use `--no-peer` for Bun if similar is needed; the
|
|
45
|
+
// pnpm version uses `--shamefully-hoist`, but Bun has no similar flag.
|
|
43
46
|
let params = ["install", "--legacy-peer-deps"];
|
|
44
47
|
const isInstallingAllDependencies = packageName === pathToSave;
|
|
45
48
|
if (!isInstallingAllDependencies) {
|
|
@@ -52,6 +55,7 @@ class BunPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
52
55
|
return result;
|
|
53
56
|
}
|
|
54
57
|
catch (err) {
|
|
58
|
+
// Revert package.json contents to preserve valid state
|
|
55
59
|
this.$fs.writeJson(packageJsonPath, jsonContentBefore);
|
|
56
60
|
throw err;
|
|
57
61
|
}
|
|
@@ -65,9 +69,10 @@ class BunPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
65
69
|
});
|
|
66
70
|
});
|
|
67
71
|
}
|
|
72
|
+
// Bun does not have a `view` command; use npm.
|
|
68
73
|
view(packageName, config) {
|
|
69
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
70
|
-
const wrappedConfig = _.extend({}, config, { json: true });
|
|
75
|
+
const wrappedConfig = _.extend({}, config, { json: true }); // always require view response as JSON
|
|
71
76
|
const flags = this.getFlagsString(wrappedConfig, false);
|
|
72
77
|
let viewResult;
|
|
73
78
|
try {
|
|
@@ -84,6 +89,7 @@ class BunPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
84
89
|
}
|
|
85
90
|
});
|
|
86
91
|
}
|
|
92
|
+
// Bun does not have a `search` command; use npm.
|
|
87
93
|
search(filter, config) {
|
|
88
94
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
95
|
const flags = this.getFlagsString(config, false);
|
|
@@ -92,11 +98,20 @@ class BunPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
92
98
|
}
|
|
93
99
|
searchNpms(keyword) {
|
|
94
100
|
return __awaiter(this, void 0, void 0, function* () {
|
|
101
|
+
// Bugs with npms.io:
|
|
102
|
+
// 1. API returns no results when a valid package name contains @ or /
|
|
103
|
+
// even if using encodeURIComponent().
|
|
104
|
+
// 2. npms.io's API no longer returns updated results; see
|
|
105
|
+
// https://github.com/npms-io/npms-api/issues/112. Better to switch to
|
|
106
|
+
// https://registry.npmjs.org/<query>
|
|
95
107
|
const httpRequestResult = yield this.$httpClient.httpRequest(`https://api.npms.io/v2/search?q=keywords:${keyword}`);
|
|
96
108
|
const result = JSON.parse(httpRequestResult.body);
|
|
97
109
|
return result;
|
|
98
110
|
});
|
|
99
111
|
}
|
|
112
|
+
// Bun does not have a command analogous to `npm config get registry`; Bun
|
|
113
|
+
// uses `bunfig.toml` to define custom registries.
|
|
114
|
+
// - TODO: read `bunfig.toml`, if it exists, and return the registry URL.
|
|
100
115
|
getRegistryPackageData(packageName) {
|
|
101
116
|
return __awaiter(this, void 0, void 0, function* () {
|
|
102
117
|
const registry = yield this.$childProcess.exec(`npm config get registry`);
|
|
@@ -133,3 +148,4 @@ __decorate([
|
|
|
133
148
|
], BunPackageManager.prototype, "getCachePath", null);
|
|
134
149
|
exports.BunPackageManager = BunPackageManager;
|
|
135
150
|
yok_1.injector.register("bun", BunPackageManager);
|
|
151
|
+
//# sourceMappingURL=bun-package-manager.js.map
|
package/lib/color.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.color = exports.stripColors = void 0;
|
|
4
|
+
// using chalk as some of our other dependencies are already using it...
|
|
5
|
+
// exporting from here so we can easily refactor to a different color library if needed
|
|
4
6
|
const ansi = require("ansi-colors");
|
|
5
7
|
const chalk = require("chalk");
|
|
6
8
|
function stripColors(formatStr) {
|
|
@@ -8,3 +10,4 @@ function stripColors(formatStr) {
|
|
|
8
10
|
}
|
|
9
11
|
exports.stripColors = stripColors;
|
|
10
12
|
exports.color = chalk;
|
|
13
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -63,9 +63,12 @@ class PublishIOS {
|
|
|
63
63
|
this.$options.release = true;
|
|
64
64
|
if (!ipaFilePath) {
|
|
65
65
|
const platform = this.$devicePlatformsConstants.iOS.toLowerCase();
|
|
66
|
+
// No .ipa path provided, build .ipa on out own.
|
|
66
67
|
if (mobileProvisionIdentifier) {
|
|
68
|
+
// This is not very correct as if we build multiple targets we will try to sign all of them using the signing identity here.
|
|
67
69
|
this.$logger.info("Building .ipa with the selected mobile provision and/or certificate. " +
|
|
68
70
|
mobileProvisionIdentifier);
|
|
71
|
+
// As we need to build the package for device
|
|
69
72
|
this.$options.forDevice = true;
|
|
70
73
|
this.$options.provision = mobileProvisionIdentifier;
|
|
71
74
|
const buildData = new build_data_1.IOSBuildData(this.$projectData.projectDir, platform, Object.assign(Object.assign({}, this.$options.argv), { watch: false }));
|
|
@@ -104,3 +107,4 @@ class PublishIOS {
|
|
|
104
107
|
}
|
|
105
108
|
exports.PublishIOS = PublishIOS;
|
|
106
109
|
yok_1.injector.registerCommand(["publish|ios", "appstore|upload"], PublishIOS);
|
|
110
|
+
//# sourceMappingURL=appstore-upload.js.map
|
package/lib/commands/build.js
CHANGED
|
@@ -24,11 +24,11 @@ class BuildCommandBase extends command_base_1.ValidatePlatformCommandBase {
|
|
|
24
24
|
this.$logger = $logger;
|
|
25
25
|
this.dashedOptions = {
|
|
26
26
|
watch: {
|
|
27
|
-
type: "boolean"
|
|
27
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
28
28
|
default: false,
|
|
29
29
|
hasSensitiveValue: false,
|
|
30
30
|
},
|
|
31
|
-
hmr: { type: "boolean"
|
|
31
|
+
hmr: { type: "boolean" /* OptionType.Boolean */, default: false, hasSensitiveValue: false },
|
|
32
32
|
};
|
|
33
33
|
this.$projectData.initializeProjectData();
|
|
34
34
|
}
|
|
@@ -159,3 +159,4 @@ class BuildVisionOsCommand extends BuildIosCommand {
|
|
|
159
159
|
exports.BuildVisionOsCommand = BuildVisionOsCommand;
|
|
160
160
|
yok_1.injector.registerCommand("build|vision", BuildVisionOsCommand);
|
|
161
161
|
yok_1.injector.registerCommand("build|visionos", BuildVisionOsCommand);
|
|
162
|
+
//# sourceMappingURL=build.js.map
|
package/lib/commands/clean.js
CHANGED
|
@@ -26,6 +26,18 @@ function bytesToHumanReadable(bytes) {
|
|
|
26
26
|
}
|
|
27
27
|
return `${bytes.toFixed(2)} ${units[unit]}`;
|
|
28
28
|
}
|
|
29
|
+
/**
|
|
30
|
+
* A helper function to map an array of values to promises with a concurrency limit.
|
|
31
|
+
* The mapper function should return a promise. It will be called for each value in the values array.
|
|
32
|
+
* The concurrency limit is the number of promises that can be running at the same time.
|
|
33
|
+
*
|
|
34
|
+
* This function will return a promise that resolves when all values have been mapped.
|
|
35
|
+
*
|
|
36
|
+
* @param values A static array of values to map to promises
|
|
37
|
+
* @param mapper A function that maps a value to a promise
|
|
38
|
+
* @param concurrency The number of promises that can be running at the same time
|
|
39
|
+
* @returns Promise<void>
|
|
40
|
+
*/
|
|
29
41
|
function promiseMap(values, mapper, concurrency = 10) {
|
|
30
42
|
let index = 0;
|
|
31
43
|
let pending = 0;
|
|
@@ -84,6 +96,7 @@ class CleanCommand {
|
|
|
84
96
|
try {
|
|
85
97
|
const overridePathsToClean = this.$projectConfigService.getValue("cli.pathsToClean");
|
|
86
98
|
const additionalPaths = this.$projectConfigService.getValue("cli.additionalPathsToClean");
|
|
99
|
+
// allow overriding default paths to clean
|
|
87
100
|
if (Array.isArray(overridePathsToClean)) {
|
|
88
101
|
pathsToClean = overridePathsToClean;
|
|
89
102
|
}
|
|
@@ -92,6 +105,7 @@ class CleanCommand {
|
|
|
92
105
|
}
|
|
93
106
|
}
|
|
94
107
|
catch (err) {
|
|
108
|
+
// ignore
|
|
95
109
|
}
|
|
96
110
|
const res = yield this.$projectCleanupService.clean(pathsToClean, {
|
|
97
111
|
dryRun: isDryRun,
|
|
@@ -117,6 +131,7 @@ class CleanCommand {
|
|
|
117
131
|
cleanMultipleProjects(spinner) {
|
|
118
132
|
return __awaiter(this, void 0, void 0, function* () {
|
|
119
133
|
if (!(0, helpers_1.isInteractive)() || this.$options.json) {
|
|
134
|
+
// interactive terminal is required, and we can't output json in an interactive command.
|
|
120
135
|
this.$logger.warn("No project found in the current directory.");
|
|
121
136
|
return;
|
|
122
137
|
}
|
|
@@ -132,6 +147,7 @@ class CleanCommand {
|
|
|
132
147
|
const current = color_1.color.grey(`${computed}/${paths.length}`);
|
|
133
148
|
spinner.start(`Gathering cleanable sizes. This may take a while... ${current}`);
|
|
134
149
|
};
|
|
150
|
+
// update the progress initially
|
|
135
151
|
updateProgress();
|
|
136
152
|
const projects = new Map();
|
|
137
153
|
yield promiseMap(paths, (p) => {
|
|
@@ -149,8 +165,10 @@ class CleanCommand {
|
|
|
149
165
|
})
|
|
150
166
|
.then((size) => {
|
|
151
167
|
if (size > 0 || size === -1) {
|
|
168
|
+
// only store size if it's larger than 0 or -1 (error while getting size)
|
|
152
169
|
projects.set(p, size);
|
|
153
170
|
}
|
|
171
|
+
// update the progress after each processed project
|
|
154
172
|
computed++;
|
|
155
173
|
updateProgress();
|
|
156
174
|
});
|
|
@@ -175,7 +193,7 @@ class CleanCommand {
|
|
|
175
193
|
value: p,
|
|
176
194
|
};
|
|
177
195
|
}), true, {
|
|
178
|
-
optionsPerPage: process.stdout.rows - 6,
|
|
196
|
+
optionsPerPage: process.stdout.rows - 6, // 6 lines are taken up by the instructions
|
|
179
197
|
});
|
|
180
198
|
this.$logger.clearScreen();
|
|
181
199
|
spinner.warn(`This will run "${color_1.color.yellow(`ns clean`)}" in all the selected projects and ${color_1.color.red.bold("delete files from your system")}!`);
|
|
@@ -224,6 +242,7 @@ class CleanCommand {
|
|
|
224
242
|
let nsDirs = [];
|
|
225
243
|
const getFiles = (dir) => __awaiter(this, void 0, void 0, function* () {
|
|
226
244
|
if (dir.includes("node_modules")) {
|
|
245
|
+
// skip traversing node_modules
|
|
227
246
|
return;
|
|
228
247
|
}
|
|
229
248
|
const dirents = yield (0, promises_1.readdir)(dir, { withFileTypes: true }).catch((err) => {
|
|
@@ -234,6 +253,7 @@ class CleanCommand {
|
|
|
234
253
|
ent.name.includes("nativescript.config.js"));
|
|
235
254
|
if (hasNSConfig) {
|
|
236
255
|
nsDirs.push(dir);
|
|
256
|
+
// found a NativeScript project, stop traversing
|
|
237
257
|
return;
|
|
238
258
|
}
|
|
239
259
|
yield Promise.all(dirents.map((dirent) => {
|
|
@@ -250,3 +270,4 @@ class CleanCommand {
|
|
|
250
270
|
}
|
|
251
271
|
exports.CleanCommand = CleanCommand;
|
|
252
272
|
yok_1.injector.registerCommand("clean", CleanCommand);
|
|
273
|
+
//# sourceMappingURL=clean.js.map
|
package/lib/commands/config.js
CHANGED
|
@@ -61,6 +61,7 @@ class ConfigGetCommand {
|
|
|
61
61
|
this.$logger.info(current);
|
|
62
62
|
}
|
|
63
63
|
catch (err) {
|
|
64
|
+
// ignore
|
|
64
65
|
}
|
|
65
66
|
});
|
|
66
67
|
}
|
|
@@ -119,6 +120,7 @@ class ConfigSetCommand {
|
|
|
119
120
|
return JSON.parse(v);
|
|
120
121
|
}
|
|
121
122
|
catch (e) {
|
|
123
|
+
// just treat it as a string
|
|
122
124
|
return `${v}`;
|
|
123
125
|
}
|
|
124
126
|
}
|
|
@@ -127,3 +129,4 @@ exports.ConfigSetCommand = ConfigSetCommand;
|
|
|
127
129
|
yok_1.injector.registerCommand("config|*list", ConfigListCommand);
|
|
128
130
|
yok_1.injector.registerCommand("config|get", ConfigGetCommand);
|
|
129
131
|
yok_1.injector.registerCommand("config|set", ConfigSetCommand);
|
|
132
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -115,6 +115,7 @@ class CreateProjectCommand {
|
|
|
115
115
|
template: selectedTemplate,
|
|
116
116
|
appId: this.$options.appid,
|
|
117
117
|
pathToProject: this.$options.path,
|
|
118
|
+
// its already validated above
|
|
118
119
|
force: true,
|
|
119
120
|
ignoreScripts: this.$options.ignoreScripts,
|
|
120
121
|
});
|
|
@@ -412,6 +413,10 @@ can skip this prompt next time using the --template option, or the --ng, --react
|
|
|
412
413
|
`For more options consult the docs or run ${color_1.color.green("ns --help")}`,
|
|
413
414
|
"",
|
|
414
415
|
].join("\n"));
|
|
416
|
+
// todo: add back ns preview
|
|
417
|
+
// this.$logger.printMarkdown(
|
|
418
|
+
// `After that you can preview it on device by executing \`$ ns preview\``
|
|
419
|
+
// );
|
|
415
420
|
});
|
|
416
421
|
}
|
|
417
422
|
}
|
|
@@ -429,3 +434,4 @@ CreateProjectCommand.TabsTemplateKey = "Tabs";
|
|
|
429
434
|
CreateProjectCommand.TabsTemplateDescription = "An app with pre-built pages that uses tabs for navigation";
|
|
430
435
|
exports.CreateProjectCommand = CreateProjectCommand;
|
|
431
436
|
yok_1.injector.registerCommand("create", CreateProjectCommand);
|
|
437
|
+
//# sourceMappingURL=create-project.js.map
|
package/lib/commands/debug.js
CHANGED
|
@@ -106,6 +106,10 @@ class DebugIOSCommand {
|
|
|
106
106
|
this.allowedParameters = [];
|
|
107
107
|
this.platform = this.$devicePlatformsConstants.iOS;
|
|
108
108
|
this.$projectData.initializeProjectData();
|
|
109
|
+
// Do not dispose ios-device-lib, so the process will remain alive and the debug application (NativeScript Inspector or Chrome DevTools) will be able to connect to the socket.
|
|
110
|
+
// In case we dispose ios-device-lib, the socket will be closed and the code will fail when the debug application tries to read/send data to device socket.
|
|
111
|
+
// That's why the `$ tns debug ios --justlaunch` command will not release the terminal.
|
|
112
|
+
// In case we do not set it to false, the dispose will be called once the command finishes its execution, which will prevent the debugging.
|
|
109
113
|
$iosDeviceOperations.setShouldDispose(false);
|
|
110
114
|
$iOSSimulatorLogProvider.setShouldDispose(false);
|
|
111
115
|
}
|
|
@@ -124,7 +128,7 @@ class DebugIOSCommand {
|
|
|
124
128
|
if (this.$options.inspector) {
|
|
125
129
|
const macOSWarning = yield this.$sysInfo.getMacOSWarningMessage();
|
|
126
130
|
if (macOSWarning &&
|
|
127
|
-
macOSWarning.severity === "high") {
|
|
131
|
+
macOSWarning.severity === "high" /* SystemWarningsSeverity.high */) {
|
|
128
132
|
this.$errors.fail(`You cannot use NativeScript Inspector on this OS. To use it, please update your OS.`);
|
|
129
133
|
}
|
|
130
134
|
}
|
|
@@ -189,3 +193,4 @@ __decorate([
|
|
|
189
193
|
], DebugAndroidCommand.prototype, "debugPlatformCommand", null);
|
|
190
194
|
exports.DebugAndroidCommand = DebugAndroidCommand;
|
|
191
195
|
yok_1.injector.registerCommand("debug|android", DebugAndroidCommand);
|
|
196
|
+
//# sourceMappingURL=debug.js.map
|
package/lib/commands/deploy.js
CHANGED
|
@@ -25,11 +25,11 @@ class DeployOnDeviceCommand extends command_base_1.ValidatePlatformCommandBase {
|
|
|
25
25
|
this.allowedParameters = [];
|
|
26
26
|
this.dashedOptions = {
|
|
27
27
|
watch: {
|
|
28
|
-
type: "boolean"
|
|
28
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
29
29
|
default: false,
|
|
30
30
|
hasSensitiveValue: false,
|
|
31
31
|
},
|
|
32
|
-
hmr: { type: "boolean"
|
|
32
|
+
hmr: { type: "boolean" /* OptionType.Boolean */, default: false, hasSensitiveValue: false },
|
|
33
33
|
};
|
|
34
34
|
this.$projectData.initializeProjectData();
|
|
35
35
|
}
|
|
@@ -76,3 +76,4 @@ class DeployOnDeviceCommand extends command_base_1.ValidatePlatformCommandBase {
|
|
|
76
76
|
}
|
|
77
77
|
exports.DeployOnDeviceCommand = DeployOnDeviceCommand;
|
|
78
78
|
yok_1.injector.registerCommand("deploy", DeployOnDeviceCommand);
|
|
79
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -31,6 +31,7 @@ class EmbedCommand extends prepare_1.PrepareCommand {
|
|
|
31
31
|
}
|
|
32
32
|
resolveHostProjectPath(hostProjectPath) {
|
|
33
33
|
if (hostProjectPath.charAt(0) === ".") {
|
|
34
|
+
// resolve relative to the project dir
|
|
34
35
|
const projectDir = this.$projectData.projectDir;
|
|
35
36
|
return (0, path_1.resolve)(projectDir, hostProjectPath);
|
|
36
37
|
}
|
|
@@ -63,7 +64,11 @@ class EmbedCommand extends prepare_1.PrepareCommand {
|
|
|
63
64
|
if (!canSuperExecute) {
|
|
64
65
|
return false;
|
|
65
66
|
}
|
|
67
|
+
// args[0] is the platform
|
|
68
|
+
// args[1] is the path to the host project
|
|
69
|
+
// args[2] is the host project module name
|
|
66
70
|
const platform = args[0].toLowerCase();
|
|
71
|
+
// also allow these to be set in the nativescript.config.ts
|
|
67
72
|
if (!args[1]) {
|
|
68
73
|
const hostProjectPath = this.getEmbedConfigForKey("hostProjectPath", platform);
|
|
69
74
|
if (hostProjectPath) {
|
|
@@ -84,8 +89,10 @@ class EmbedCommand extends prepare_1.PrepareCommand {
|
|
|
84
89
|
});
|
|
85
90
|
}
|
|
86
91
|
getEmbedConfigForKey(key, platform) {
|
|
92
|
+
// get the embed.<platform>.<key> value, or fallback to embed.<key> value
|
|
87
93
|
return this.$projectConfigService.getValue(`embed.${platform}.${key}`, this.$projectConfigService.getValue(`embed.${key}`));
|
|
88
94
|
}
|
|
89
95
|
}
|
|
90
96
|
exports.EmbedCommand = EmbedCommand;
|
|
91
97
|
yok_1.injector.registerCommand("embed", EmbedCommand);
|
|
98
|
+
//# sourceMappingURL=embed.js.map
|
package/lib/commands/fonts.js
CHANGED
|
@@ -69,3 +69,4 @@ class GenerateSplashScreensCommand extends GenerateCommandBase {
|
|
|
69
69
|
}
|
|
70
70
|
exports.GenerateSplashScreensCommand = GenerateSplashScreensCommand;
|
|
71
71
|
yok_1.injector.registerCommand("resources|generate|splashes", GenerateSplashScreensCommand);
|
|
72
|
+
//# sourceMappingURL=generate-assets.js.map
|
package/lib/commands/generate.js
CHANGED
|
@@ -58,16 +58,25 @@ class GenerateCommand {
|
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
exports.GenerateCommand = GenerateCommand;
|
|
61
|
+
/**
|
|
62
|
+
* Converts an array of command line arguments to options for the executed schematic.
|
|
63
|
+
* @param rawArgs The command line arguments. They should be in the format 'key=value' for strings or 'key' for booleans.
|
|
64
|
+
*/
|
|
61
65
|
function parseSchematicSettings(rawArgs) {
|
|
62
66
|
const [optionStrings, args] = partition(rawArgs, (item) => item.includes("="));
|
|
63
67
|
const options = optionStrings
|
|
64
|
-
.map((o) => o.split("="))
|
|
65
|
-
.map(([key, ...value]) => [key, value.join("=")])
|
|
68
|
+
.map((o) => o.split("=")) // split to key and value pairs
|
|
69
|
+
.map(([key, ...value]) => [key, value.join("=")]) // concat the value arrays if there are multiple = signs
|
|
66
70
|
.reduce((obj, [key, value]) => {
|
|
67
71
|
return Object.assign(Object.assign({}, obj), { [key]: value });
|
|
68
72
|
}, {});
|
|
69
73
|
return { options, args };
|
|
70
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Splits an array into two groups based on a predicate.
|
|
77
|
+
* @param array The array to split.
|
|
78
|
+
* @param predicate The condition to be used for splitting.
|
|
79
|
+
*/
|
|
71
80
|
function partition(array, predicate) {
|
|
72
81
|
return array.reduce(([pass, fail], item) => {
|
|
73
82
|
return predicate(item)
|
|
@@ -76,3 +85,4 @@ function partition(array, predicate) {
|
|
|
76
85
|
}, [[], []]);
|
|
77
86
|
}
|
|
78
87
|
yok_1.injector.registerCommand("generate", GenerateCommand);
|
|
88
|
+
//# sourceMappingURL=generate.js.map
|
package/lib/commands/info.js
CHANGED
package/lib/commands/install.js
CHANGED
package/lib/commands/migrate.js
CHANGED
|
@@ -194,6 +194,7 @@ class NativeAddObjectiveCCommand extends NativeAddSingleCommand {
|
|
|
194
194
|
const classFilePath = path.join(iosSourceBase, `${className}.m`);
|
|
195
195
|
const headerFilePath = path.join(iosSourceBase, `${className}.h`);
|
|
196
196
|
if (this.generateObjectiveCFiles(className, classFilePath, headerFilePath)) {
|
|
197
|
+
// Modify/Generate moduleMap
|
|
197
198
|
this.generateOrUpdateModuleMap(`${className}.h`, path.join(iosSourceBase, "module.modulemap"));
|
|
198
199
|
}
|
|
199
200
|
}
|
|
@@ -206,7 +207,9 @@ class NativeAddObjectiveCCommand extends NativeAddSingleCommand {
|
|
|
206
207
|
}
|
|
207
208
|
const headerDeclaration = `header "${headerPath}"`;
|
|
208
209
|
if (moduleMapContent.includes(`module ${moduleName}`)) {
|
|
210
|
+
// Module declaration already exists in the module map
|
|
209
211
|
if (moduleMapContent.includes(headerDeclaration)) {
|
|
212
|
+
// Header is already present in the module map
|
|
210
213
|
this.$logger.warn(`Header '${headerFileName}' is already added to the module map.`);
|
|
211
214
|
return;
|
|
212
215
|
}
|
|
@@ -214,6 +217,7 @@ class NativeAddObjectiveCCommand extends NativeAddSingleCommand {
|
|
|
214
217
|
fs.writeFileSync(moduleMapPath, updatedModuleMapContent);
|
|
215
218
|
}
|
|
216
219
|
else {
|
|
220
|
+
// Module declaration does not exist in the module map
|
|
217
221
|
const moduleDeclaration = `module ${moduleName} {${os_1.EOL} ${headerDeclaration}${os_1.EOL} export *${os_1.EOL}}`;
|
|
218
222
|
moduleMapContent += `${os_1.EOL}${os_1.EOL}${moduleDeclaration}`;
|
|
219
223
|
fs.writeFileSync(moduleMapPath, moduleMapContent);
|
|
@@ -298,3 +302,4 @@ yok_1.injector.registerCommand(["native|add|java"], NativeAddJavaCommand);
|
|
|
298
302
|
yok_1.injector.registerCommand(["native|add|kotlin"], NativeAddKotlinCommand);
|
|
299
303
|
yok_1.injector.registerCommand(["native|add|swift"], NativeAddSwiftCommand);
|
|
300
304
|
yok_1.injector.registerCommand(["native|add|objective-c"], NativeAddObjectiveCCommand);
|
|
305
|
+
//# sourceMappingURL=native-add.js.map
|