nativescript 9.0.0-alpha.13 → 9.0.0-alpha.14
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 +2 -2
- package/docs/build-jekyll-md.sh +1 -1
- package/docs/man_pages/config/config-get.md +36 -0
- package/docs/man_pages/config/config-set.md +40 -0
- package/docs/man_pages/config/config.md +39 -0
- package/docs/man_pages/project/hooks/hooks.md +35 -0
- package/docs/man_pages/start.md +1 -0
- package/lib/.d.ts +4 -0
- package/lib/android-tools-info.js +12 -0
- package/lib/base-package-manager.js +7 -0
- package/lib/bootstrap.js +7 -1
- package/lib/bun-package-manager.js +14 -1
- package/lib/color.js +4 -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 +3 -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 +5 -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 +48 -1
- package/lib/commands/hooks/common.js +80 -0
- package/lib/commands/hooks/hooks-lock.js +101 -0
- package/lib/commands/hooks/hooks.js +72 -0
- 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/commands/widget.js +20 -1
- 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/definitions/extensibility.d.ts +2 -2
- package/lib/common/definitions/mobile.d.ts +72 -72
- 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 +26 -0
- package/lib/common/mobile/android/device-android-debug-bridge.js +1 -0
- package/lib/common/mobile/android/genymotion/genymotion-service.js +6 -1
- 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 +3 -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 +90 -4
- 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/definitions/hooks.d.ts +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 +11 -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 +144 -119
- 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 +1 -0
- package/lib/services/android-device-debug-service.js +6 -0
- package/lib/services/android-plugin-build-service.js +31 -2
- 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/apple-portal/srp/srp-wrapper.js +4 -1
- package/lib/services/assets-generation/assets-generation-service.js +10 -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/bundler/bundler-compiler-service.js +88 -17
- package/lib/services/bundler/bundler.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 +9 -1
- 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 +11 -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 +2 -1
- 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 +91 -1
- 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 +21 -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 +21 -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 +3 -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/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/package.json +11 -10
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-plugin/build.gradle +1 -1
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
"karma": "6.4.4",
|
|
4
4
|
"karma-coverage": "2.2.1",
|
|
5
5
|
"karma-nativescript-launcher": "1.0.0",
|
|
6
|
-
"mocha": "11.7.
|
|
6
|
+
"mocha": "11.7.5",
|
|
7
7
|
"karma-mocha": "2.0.1",
|
|
8
8
|
"karma-chai": "0.1.0",
|
|
9
9
|
"karma-jasmine": "4.0.2",
|
|
10
10
|
"karma-qunit": "4.2.1",
|
|
11
11
|
"@types/karma-chai": "0.1.8",
|
|
12
12
|
"@types/mocha": "10.0.10",
|
|
13
|
-
"@types/jasmine": "5.1.
|
|
13
|
+
"@types/jasmine": "5.1.12",
|
|
14
14
|
"@types/qunit": "2.19.13",
|
|
15
15
|
"nyc": "17.1.0"
|
|
16
16
|
}
|
package/docs/build-jekyll-md.sh
CHANGED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<% if (isJekyll) { %>---
|
|
2
|
+
title: ns config get
|
|
3
|
+
position: 2
|
|
4
|
+
---<% } %>
|
|
5
|
+
|
|
6
|
+
# ns config get
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
|
|
10
|
+
Prints the value for a specific key from the project's NativeScript configuration.
|
|
11
|
+
|
|
12
|
+
### Commands
|
|
13
|
+
|
|
14
|
+
Usage | Synopsis
|
|
15
|
+
------|-------
|
|
16
|
+
General | `$ ns config get <key>`
|
|
17
|
+
|
|
18
|
+
### Arguments
|
|
19
|
+
|
|
20
|
+
* `<key>` — The configuration key in dot-notation. Examples: `ios.id`, `android.codeCache`, `bundler`.
|
|
21
|
+
|
|
22
|
+
### Examples
|
|
23
|
+
|
|
24
|
+
* `$ ns config get ios.id`
|
|
25
|
+
* `$ ns config get android.codeCache`
|
|
26
|
+
* `$ ns config get bundler`
|
|
27
|
+
|
|
28
|
+
<% if(isHtml) { %>
|
|
29
|
+
|
|
30
|
+
### Related Commands
|
|
31
|
+
|
|
32
|
+
Command | Description
|
|
33
|
+
----------|----------
|
|
34
|
+
[config](config.html) | Lists all configuration values for the current project.
|
|
35
|
+
[config set](config-set.html) | Sets the value for the specified configuration key.
|
|
36
|
+
<% } %>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<% if (isJekyll) { %>---
|
|
2
|
+
title: ns config set
|
|
3
|
+
position: 3
|
|
4
|
+
---<% } %>
|
|
5
|
+
|
|
6
|
+
# ns config set
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
|
|
10
|
+
Sets the value for a specific key in the project's NativeScript configuration.
|
|
11
|
+
|
|
12
|
+
### Commands
|
|
13
|
+
|
|
14
|
+
Usage | Synopsis
|
|
15
|
+
------|-------
|
|
16
|
+
General | `$ ns config set <key> <value>`
|
|
17
|
+
|
|
18
|
+
### Arguments
|
|
19
|
+
|
|
20
|
+
* `<key>` — The configuration key in dot-notation. Examples: `ios.id`, `android.codeCache`, `bundler`.
|
|
21
|
+
* `<value>` — The value to set. Parsed as JSON when possible (e.g. `true`, `42`, `{ "foo": "bar" }`). Otherwise treated as a string.
|
|
22
|
+
|
|
23
|
+
### Examples
|
|
24
|
+
|
|
25
|
+
* `$ ns config set ios.id org.nativescript.myapp`
|
|
26
|
+
* `$ ns config set android.codeCache true`
|
|
27
|
+
* `$ ns config set bundler vite`
|
|
28
|
+
|
|
29
|
+
### Notes
|
|
30
|
+
|
|
31
|
+
* Setting whole objects is not supported. Update individual keys instead. For example, use:
|
|
32
|
+
`$ ns config set android.codeCache true`
|
|
33
|
+
|
|
34
|
+
### Related Commands
|
|
35
|
+
|
|
36
|
+
Command | Description
|
|
37
|
+
----------|----------
|
|
38
|
+
[config](config.html) | Lists all configuration values for the current project.
|
|
39
|
+
[config get](config-get.html) | Prints the value for the specified configuration key.
|
|
40
|
+
<% } %>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<% if (isJekyll) { %>---
|
|
2
|
+
title: ns config
|
|
3
|
+
position: 1
|
|
4
|
+
---<% } %>
|
|
5
|
+
|
|
6
|
+
# ns config
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
|
|
10
|
+
View and manage your project's NativeScript configuration stored in `nativescript.config.(js|ts)` (or legacy `nsconfig.json`).
|
|
11
|
+
|
|
12
|
+
### Commands
|
|
13
|
+
|
|
14
|
+
Usage | Synopsis
|
|
15
|
+
------|---------
|
|
16
|
+
List all config | `$ ns config`
|
|
17
|
+
Get a value | `$ ns config get <key>`
|
|
18
|
+
Set a value | `$ ns config set <key> <value>`
|
|
19
|
+
|
|
20
|
+
### Examples
|
|
21
|
+
|
|
22
|
+
* `$ ns config` — prints all configuration values.
|
|
23
|
+
* `$ ns config get ios.id` — prints the iOS bundle identifier.
|
|
24
|
+
* `$ ns config set android.codeCache true` — enables Android V8 code cache.
|
|
25
|
+
|
|
26
|
+
### Notes
|
|
27
|
+
|
|
28
|
+
* Keys use dot-notation, for example: `ios.id`, `android.codeCache`, `bundler`.
|
|
29
|
+
* Values are parsed as JSON when possible. Use quotes for strings with spaces.
|
|
30
|
+
|
|
31
|
+
<% if(isHtml) { %>
|
|
32
|
+
|
|
33
|
+
### Related Commands
|
|
34
|
+
|
|
35
|
+
Command | Description
|
|
36
|
+
----------|----------
|
|
37
|
+
[config get](config-get.html) | Prints the value for the specified configuration key.
|
|
38
|
+
[config set](config-set.html) | Sets the value for the specified configuration key.
|
|
39
|
+
<% } %>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<% if (isJekyll) { %>---
|
|
2
|
+
title: ns hooks
|
|
3
|
+
position: 1
|
|
4
|
+
---<% } %>
|
|
5
|
+
|
|
6
|
+
# ns create
|
|
7
|
+
|
|
8
|
+
### Description
|
|
9
|
+
|
|
10
|
+
Manages lifecycle hooks from installed plugins.
|
|
11
|
+
|
|
12
|
+
### Commands
|
|
13
|
+
|
|
14
|
+
Usage | Synopsis
|
|
15
|
+
---------|---------
|
|
16
|
+
Install | `$ ns hooks install`
|
|
17
|
+
List | `$ ns hooks list`
|
|
18
|
+
Lock | `$ ns hooks lock`
|
|
19
|
+
Verify | `$ ns hooks verify`
|
|
20
|
+
|
|
21
|
+
#### Install
|
|
22
|
+
|
|
23
|
+
Installs hooks from each installed plugin dependency.
|
|
24
|
+
|
|
25
|
+
#### List
|
|
26
|
+
|
|
27
|
+
Lists the plugins which have hooks and which scripts they install
|
|
28
|
+
|
|
29
|
+
#### Lock
|
|
30
|
+
|
|
31
|
+
Generates a `hooks-lock.json` containing the hooks that are in the current versions of the plugins.
|
|
32
|
+
|
|
33
|
+
#### Verify
|
|
34
|
+
|
|
35
|
+
Verifies that the hooks contained in the installed plugins match those listed in the `hooks-lock.json` file.
|
package/docs/man_pages/start.md
CHANGED
|
@@ -51,6 +51,7 @@ Command | Description
|
|
|
51
51
|
[plugin](lib-management/plugin.html) | Lets you manage the plugins for your project.
|
|
52
52
|
[open](project/configuration/open.md) | Opens the native project in Xcode/Android Studio.
|
|
53
53
|
[widget ios](project/configuration/widget.md) | Adds a new iOS widget to the project.
|
|
54
|
+
[hooks](project/hooks/hooks.html) | Installs lifecycle hooks from plugins.
|
|
54
55
|
## Publishing Commands
|
|
55
56
|
Command | Description
|
|
56
57
|
---|---
|
package/lib/.d.ts
CHANGED
|
@@ -23,6 +23,9 @@
|
|
|
23
23
|
/// <reference path="commands/generate-assets.ts" />
|
|
24
24
|
/// <reference path="commands/generate-help.ts" />
|
|
25
25
|
/// <reference path="commands/generate.ts" />
|
|
26
|
+
/// <reference path="commands/hooks/common.ts" />
|
|
27
|
+
/// <reference path="commands/hooks/hooks-lock.ts" />
|
|
28
|
+
/// <reference path="commands/hooks/hooks.ts" />
|
|
26
29
|
/// <reference path="commands/info.ts" />
|
|
27
30
|
/// <reference path="commands/install.ts" />
|
|
28
31
|
/// <reference path="commands/list-platforms.ts" />
|
|
@@ -257,6 +260,7 @@
|
|
|
257
260
|
/// <reference path="definitions/files-hash-service.d.ts" />
|
|
258
261
|
/// <reference path="definitions/gradle.d.ts" />
|
|
259
262
|
/// <reference path="definitions/hmr-status-service.d.ts" />
|
|
263
|
+
/// <reference path="definitions/hooks.d.ts" />
|
|
260
264
|
/// <reference path="definitions/initialize-service.d.ts" />
|
|
261
265
|
/// <reference path="definitions/ios-debugger-port-service.d.ts" />
|
|
262
266
|
/// <reference path="definitions/ios.d.ts" />
|
|
@@ -74,6 +74,8 @@ class AndroidToolsInfo {
|
|
|
74
74
|
return doctor_1.androidToolsInfo.getPathToAdbFromAndroidHome();
|
|
75
75
|
}
|
|
76
76
|
catch (err) {
|
|
77
|
+
// adb does not exist, so ANDROID_HOME is not set correctly
|
|
78
|
+
// try getting default adb path (included in CLI package)
|
|
77
79
|
this.$logger.trace(`Error while executing '${path.join(doctor_1.androidToolsInfo.androidHome, "platform-tools", "adb")} help'. Error is: ${err.message}`);
|
|
78
80
|
}
|
|
79
81
|
return null;
|
|
@@ -87,6 +89,14 @@ class AndroidToolsInfo {
|
|
|
87
89
|
shouldGenerateTypings() {
|
|
88
90
|
return this.$options.androidTypings;
|
|
89
91
|
}
|
|
92
|
+
/**
|
|
93
|
+
* Prints messages on the screen. In case the showWarningsAsErrors flag is set to true, warnings are shown, else - errors.
|
|
94
|
+
* Uses logger.warn for warnings and errors.failWithoutHelp when erros must be shown.
|
|
95
|
+
* In case additional details must be shown as info message, use the second parameter.
|
|
96
|
+
* NOTE: The additional information will not be printed when showWarningsAsErrors flag is set.
|
|
97
|
+
* @param {string} msg The message that will be shown as warning or error.
|
|
98
|
+
* @return {void}
|
|
99
|
+
*/
|
|
90
100
|
printMessage(msg, showWarningsAsErrors) {
|
|
91
101
|
if (showWarningsAsErrors) {
|
|
92
102
|
this.$errors.fail(msg);
|
|
@@ -106,6 +116,7 @@ class AndroidToolsInfo {
|
|
|
106
116
|
}
|
|
107
117
|
return latestCompileSdk;
|
|
108
118
|
}
|
|
119
|
+
// TODO check if still needed
|
|
109
120
|
getTargetSdk(compileSdk) {
|
|
110
121
|
const targetSdk = this.$options.sdk
|
|
111
122
|
? parseInt(this.$options.sdk)
|
|
@@ -122,3 +133,4 @@ __decorate([
|
|
|
122
133
|
(0, decorators_1.cache)()
|
|
123
134
|
], AndroidToolsInfo.prototype, "validateAndroidHomeEnvVariable", null);
|
|
124
135
|
yok_1.injector.register("androidToolsInfo", AndroidToolsInfo);
|
|
136
|
+
//# sourceMappingURL=android-tools-info.js.map
|
|
@@ -18,6 +18,8 @@ class BasePackageManager {
|
|
|
18
18
|
}
|
|
19
19
|
try {
|
|
20
20
|
const viewResult = await this.view(packageName, { name: true });
|
|
21
|
+
// `npm view nonExistingPackageName` will return `nativescript`
|
|
22
|
+
// if executed in the root dir of the CLI (npm 6.4.1)
|
|
21
23
|
const packageNameRegex = new RegExp(packageName, "i");
|
|
22
24
|
const isProperResult = packageNameRegex.test(viewResult);
|
|
23
25
|
return isProperResult;
|
|
@@ -27,6 +29,8 @@ class BasePackageManager {
|
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
async getPackageNameParts(fullPackageName) {
|
|
32
|
+
// support <reserved_name>@<version> syntax, for example typescript@1.0.0
|
|
33
|
+
// support <scoped_package_name>@<version> syntax, for example @nativescript/vue-template@1.0.0
|
|
30
34
|
const lastIndexOfAtSign = fullPackageName.lastIndexOf("@");
|
|
31
35
|
let version = "";
|
|
32
36
|
let templateName = "";
|
|
@@ -59,6 +63,8 @@ class BasePackageManager {
|
|
|
59
63
|
stdio: stdioValue,
|
|
60
64
|
shell: this.$hostInfo.isWindows,
|
|
61
65
|
});
|
|
66
|
+
// Whenever calling "npm install" or "yarn add" without any arguments (hence installing all dependencies) no output is emitted on stdout
|
|
67
|
+
// 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.
|
|
62
68
|
const { isInstallingAllDependencies } = opts;
|
|
63
69
|
if (isInstallingAllDependencies) {
|
|
64
70
|
return null;
|
|
@@ -110,3 +116,4 @@ class BasePackageManager {
|
|
|
110
116
|
}
|
|
111
117
|
}
|
|
112
118
|
exports.BasePackageManager = BasePackageManager;
|
|
119
|
+
//# 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");
|
|
@@ -128,6 +131,8 @@ yok_1.injector.requireCommand("plugin|remove", "./commands/plugin/remove-plugin"
|
|
|
128
131
|
yok_1.injector.requireCommand("plugin|update", "./commands/plugin/update-plugin");
|
|
129
132
|
yok_1.injector.requireCommand("plugin|build", "./commands/plugin/build-plugin");
|
|
130
133
|
yok_1.injector.requireCommand("plugin|create", "./commands/plugin/create-plugin");
|
|
134
|
+
yok_1.injector.requireCommand(["hooks|*list", "hooks|install"], "./commands/hooks/hooks");
|
|
135
|
+
yok_1.injector.requireCommand(["hooks|lock", "hooks|verify"], "./commands/hooks/hooks-lock");
|
|
131
136
|
yok_1.injector.require("doctorService", "./services/doctor-service");
|
|
132
137
|
yok_1.injector.require("xcprojService", "./services/xcproj-service");
|
|
133
138
|
yok_1.injector.require("versionsService", "./services/versions-service");
|
|
@@ -149,7 +154,7 @@ yok_1.injector.require("LiveSyncSocket", "./services/livesync/livesync-socket");
|
|
|
149
154
|
yok_1.injector.requirePublicClass("androidLivesyncTool", "./services/livesync/android-livesync-tool");
|
|
150
155
|
yok_1.injector.require("androidLiveSyncService", "./services/livesync/android-livesync-service");
|
|
151
156
|
yok_1.injector.require("iOSLiveSyncService", "./services/livesync/ios-livesync-service");
|
|
152
|
-
yok_1.injector.require("usbLiveSyncService", "./services/livesync/livesync-service");
|
|
157
|
+
yok_1.injector.require("usbLiveSyncService", "./services/livesync/livesync-service"); // The name is used in https://github.com/NativeScript/nativescript-dev-typescript
|
|
153
158
|
yok_1.injector.requirePublic("sysInfo", "./sys-info");
|
|
154
159
|
yok_1.injector.require("iOSNotificationService", "./services/ios-notification-service");
|
|
155
160
|
yok_1.injector.require("appDebugSocketProxyFactory", "./device-sockets/ios/app-debug-socket-proxy-factory");
|
|
@@ -210,3 +215,4 @@ yok_1.injector.requireCommand([
|
|
|
210
215
|
], "./commands/native-add");
|
|
211
216
|
yok_1.injector.requireCommand(["widget", "widget|ios"], "./commands/widget");
|
|
212
217
|
require("./key-commands/bootstrap");
|
|
218
|
+
//# sourceMappingURL=bootstrap.js.map
|
|
@@ -42,6 +42,7 @@ class BunPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
42
42
|
return result;
|
|
43
43
|
}
|
|
44
44
|
catch (err) {
|
|
45
|
+
// Revert package.json contents to preserve valid state
|
|
45
46
|
this.$fs.writeJson(packageJsonPath, jsonContentBefore);
|
|
46
47
|
throw err;
|
|
47
48
|
}
|
|
@@ -52,8 +53,9 @@ class BunPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
52
53
|
cwd,
|
|
53
54
|
});
|
|
54
55
|
}
|
|
56
|
+
// Bun does not have a `view` command; use npm.
|
|
55
57
|
async view(packageName, config) {
|
|
56
|
-
const wrappedConfig = _.extend({}, config, { json: true });
|
|
58
|
+
const wrappedConfig = _.extend({}, config, { json: true }); // always require view response as JSON
|
|
57
59
|
const flags = this.getFlagsString(wrappedConfig, false);
|
|
58
60
|
let viewResult;
|
|
59
61
|
try {
|
|
@@ -69,15 +71,25 @@ class BunPackageManager extends base_package_manager_1.BasePackageManager {
|
|
|
69
71
|
return null;
|
|
70
72
|
}
|
|
71
73
|
}
|
|
74
|
+
// Bun does not have a `search` command; use npm.
|
|
72
75
|
async search(filter, config) {
|
|
73
76
|
const flags = this.getFlagsString(config, false);
|
|
74
77
|
return this.$childProcess.exec(`npm search ${filter.join(" ")} ${flags}`);
|
|
75
78
|
}
|
|
76
79
|
async searchNpms(keyword) {
|
|
80
|
+
// Bugs with npms.io:
|
|
81
|
+
// 1. API returns no results when a valid package name contains @ or /
|
|
82
|
+
// even if using encodeURIComponent().
|
|
83
|
+
// 2. npms.io's API no longer returns updated results; see
|
|
84
|
+
// https://github.com/npms-io/npms-api/issues/112. Better to switch to
|
|
85
|
+
// https://registry.npmjs.org/<query>
|
|
77
86
|
const httpRequestResult = await this.$httpClient.httpRequest(`https://api.npms.io/v2/search?q=keywords:${keyword}`);
|
|
78
87
|
const result = JSON.parse(httpRequestResult.body);
|
|
79
88
|
return result;
|
|
80
89
|
}
|
|
90
|
+
// Bun does not have a command analogous to `npm config get registry`; Bun
|
|
91
|
+
// uses `bunfig.toml` to define custom registries.
|
|
92
|
+
// - TODO: read `bunfig.toml`, if it exists, and return the registry URL.
|
|
81
93
|
async getRegistryPackageData(packageName) {
|
|
82
94
|
const registry = await this.$childProcess.exec(`npm config get registry`);
|
|
83
95
|
const url = registry.trim() + packageName;
|
|
@@ -110,3 +122,4 @@ __decorate([
|
|
|
110
122
|
(0, decorators_1.cache)()
|
|
111
123
|
], BunPackageManager.prototype, "getCachePath", null);
|
|
112
124
|
yok_1.injector.register("bun", BunPackageManager);
|
|
125
|
+
//# sourceMappingURL=bun-package-manager.js.map
|
package/lib/color.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.stripColors = exports.color = void 0;
|
|
4
4
|
const node_util_1 = require("node:util");
|
|
5
|
+
// Create a chalk-like API using the Node.js util.styleText function
|
|
5
6
|
exports.color = {
|
|
6
7
|
reset: (text) => (0, node_util_1.styleText)("reset", text),
|
|
7
8
|
bold: (text) => (0, node_util_1.styleText)("bold", text),
|
|
@@ -11,6 +12,7 @@ exports.color = {
|
|
|
11
12
|
inverse: (text) => (0, node_util_1.styleText)("inverse", text),
|
|
12
13
|
hidden: (text) => (0, node_util_1.styleText)("hidden", text),
|
|
13
14
|
strikethrough: (text) => (0, node_util_1.styleText)("strikethrough", text),
|
|
15
|
+
// Text colors
|
|
14
16
|
black: (text) => (0, node_util_1.styleText)("black", text),
|
|
15
17
|
red: (text) => (0, node_util_1.styleText)("red", text),
|
|
16
18
|
blue: (text) => (0, node_util_1.styleText)("blue", text),
|
|
@@ -21,6 +23,7 @@ exports.color = {
|
|
|
21
23
|
yellow: (text) => (0, node_util_1.styleText)("yellow", text),
|
|
22
24
|
green: (text) => (0, node_util_1.styleText)("green", text),
|
|
23
25
|
grey: (text) => (0, node_util_1.styleText)("grey", text),
|
|
26
|
+
// Background colors
|
|
24
27
|
bgBlack: (text) => (0, node_util_1.styleText)("bgBlack", text),
|
|
25
28
|
bgBlackBright: (text) => (0, node_util_1.styleText)("bgBlackBright", text),
|
|
26
29
|
bgRed: (text) => (0, node_util_1.styleText)("bgRed", text),
|
|
@@ -39,3 +42,4 @@ exports.color = {
|
|
|
39
42
|
};
|
|
40
43
|
const stripColors = (text) => (0, node_util_1.stripVTControlCharacters)(text);
|
|
41
44
|
exports.stripColors = stripColors;
|
|
45
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -52,7 +52,9 @@ class PublishIOS {
|
|
|
52
52
|
this.$options.release = true;
|
|
53
53
|
if (!ipaFilePath) {
|
|
54
54
|
const platform = this.$devicePlatformsConstants.iOS.toLowerCase();
|
|
55
|
+
// No .ipa path provided, build .ipa on out own.
|
|
55
56
|
if (mobileProvisionIdentifier) {
|
|
57
|
+
// This is not very correct as if we build multiple targets we will try to sign all of them using the signing identity here.
|
|
56
58
|
this.$logger.info("Building .ipa with the selected mobile provision and/or certificate. " +
|
|
57
59
|
mobileProvisionIdentifier);
|
|
58
60
|
this.$options.provision = mobileProvisionIdentifier;
|
|
@@ -88,3 +90,4 @@ class PublishIOS {
|
|
|
88
90
|
}
|
|
89
91
|
exports.PublishIOS = PublishIOS;
|
|
90
92
|
yok_1.injector.registerCommand(["publish|ios", "appstore|upload"], PublishIOS);
|
|
93
|
+
//# sourceMappingURL=appstore-upload.js.map
|
package/lib/commands/build.js
CHANGED
|
@@ -15,11 +15,11 @@ class BuildCommandBase extends command_base_1.ValidatePlatformCommandBase {
|
|
|
15
15
|
this.$logger = $logger;
|
|
16
16
|
this.dashedOptions = {
|
|
17
17
|
watch: {
|
|
18
|
-
type: "boolean"
|
|
18
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
19
19
|
default: false,
|
|
20
20
|
hasSensitiveValue: false,
|
|
21
21
|
},
|
|
22
|
-
hmr: { type: "boolean"
|
|
22
|
+
hmr: { type: "boolean" /* OptionType.Boolean */, default: false, hasSensitiveValue: false },
|
|
23
23
|
};
|
|
24
24
|
this.$projectData.initializeProjectData();
|
|
25
25
|
}
|
|
@@ -127,3 +127,4 @@ class BuildVisionOsCommand extends BuildIosCommand {
|
|
|
127
127
|
exports.BuildVisionOsCommand = BuildVisionOsCommand;
|
|
128
128
|
yok_1.injector.registerCommand("build|vision", BuildVisionOsCommand);
|
|
129
129
|
yok_1.injector.registerCommand("build|visionos", BuildVisionOsCommand);
|
|
130
|
+
//# sourceMappingURL=build.js.map
|
package/lib/commands/clean.js
CHANGED
|
@@ -17,6 +17,18 @@ function bytesToHumanReadable(bytes) {
|
|
|
17
17
|
}
|
|
18
18
|
return `${bytes.toFixed(2)} ${units[unit]}`;
|
|
19
19
|
}
|
|
20
|
+
/**
|
|
21
|
+
* A helper function to map an array of values to promises with a concurrency limit.
|
|
22
|
+
* The mapper function should return a promise. It will be called for each value in the values array.
|
|
23
|
+
* The concurrency limit is the number of promises that can be running at the same time.
|
|
24
|
+
*
|
|
25
|
+
* This function will return a promise that resolves when all values have been mapped.
|
|
26
|
+
*
|
|
27
|
+
* @param values A static array of values to map to promises
|
|
28
|
+
* @param mapper A function that maps a value to a promise
|
|
29
|
+
* @param concurrency The number of promises that can be running at the same time
|
|
30
|
+
* @returns Promise<void>
|
|
31
|
+
*/
|
|
20
32
|
function promiseMap(values, mapper, concurrency = 10) {
|
|
21
33
|
let index = 0;
|
|
22
34
|
let pending = 0;
|
|
@@ -73,6 +85,7 @@ class CleanCommand {
|
|
|
73
85
|
try {
|
|
74
86
|
const overridePathsToClean = this.$projectConfigService.getValue("cli.pathsToClean");
|
|
75
87
|
const additionalPaths = this.$projectConfigService.getValue("cli.additionalPathsToClean");
|
|
88
|
+
// allow overriding default paths to clean
|
|
76
89
|
if (Array.isArray(overridePathsToClean)) {
|
|
77
90
|
pathsToClean = overridePathsToClean;
|
|
78
91
|
}
|
|
@@ -81,6 +94,7 @@ class CleanCommand {
|
|
|
81
94
|
}
|
|
82
95
|
}
|
|
83
96
|
catch (err) {
|
|
97
|
+
// ignore
|
|
84
98
|
}
|
|
85
99
|
const res = await this.$projectCleanupService.clean(pathsToClean, {
|
|
86
100
|
dryRun: isDryRun,
|
|
@@ -104,6 +118,7 @@ class CleanCommand {
|
|
|
104
118
|
}
|
|
105
119
|
async cleanMultipleProjects(spinner) {
|
|
106
120
|
if (!(0, helpers_1.isInteractive)() || this.$options.json) {
|
|
121
|
+
// interactive terminal is required, and we can't output json in an interactive command.
|
|
107
122
|
this.$logger.warn("No project found in the current directory.");
|
|
108
123
|
return;
|
|
109
124
|
}
|
|
@@ -119,6 +134,7 @@ class CleanCommand {
|
|
|
119
134
|
const current = color_1.color.grey(`${computed}/${paths.length}`);
|
|
120
135
|
spinner.start(`Gathering cleanable sizes. This may take a while... ${current}`);
|
|
121
136
|
};
|
|
137
|
+
// update the progress initially
|
|
122
138
|
updateProgress();
|
|
123
139
|
const projects = new Map();
|
|
124
140
|
await promiseMap(paths, (p) => {
|
|
@@ -136,8 +152,10 @@ class CleanCommand {
|
|
|
136
152
|
})
|
|
137
153
|
.then((size) => {
|
|
138
154
|
if (size > 0 || size === -1) {
|
|
155
|
+
// only store size if it's larger than 0 or -1 (error while getting size)
|
|
139
156
|
projects.set(p, size);
|
|
140
157
|
}
|
|
158
|
+
// update the progress after each processed project
|
|
141
159
|
computed++;
|
|
142
160
|
updateProgress();
|
|
143
161
|
});
|
|
@@ -162,7 +180,7 @@ class CleanCommand {
|
|
|
162
180
|
value: p,
|
|
163
181
|
};
|
|
164
182
|
}), true, {
|
|
165
|
-
optionsPerPage: process.stdout.rows - 6,
|
|
183
|
+
optionsPerPage: process.stdout.rows - 6, // 6 lines are taken up by the instructions
|
|
166
184
|
});
|
|
167
185
|
this.$logger.clearScreen();
|
|
168
186
|
spinner.warn(`This will run "${color_1.color.yellow(`ns clean`)}" in all the selected projects and ${color_1.color.styleText(["red", "bold"], "delete files from your system")}!`);
|
|
@@ -209,6 +227,7 @@ class CleanCommand {
|
|
|
209
227
|
let nsDirs = [];
|
|
210
228
|
const getFiles = async (dir) => {
|
|
211
229
|
if (dir.includes("node_modules")) {
|
|
230
|
+
// skip traversing node_modules
|
|
212
231
|
return;
|
|
213
232
|
}
|
|
214
233
|
const dirents = await (0, promises_1.readdir)(dir, { withFileTypes: true }).catch((err) => {
|
|
@@ -219,6 +238,7 @@ class CleanCommand {
|
|
|
219
238
|
ent.name.includes("nativescript.config.js"));
|
|
220
239
|
if (hasNSConfig) {
|
|
221
240
|
nsDirs.push(dir);
|
|
241
|
+
// found a NativeScript project, stop traversing
|
|
222
242
|
return;
|
|
223
243
|
}
|
|
224
244
|
await Promise.all(dirents.map((dirent) => {
|
|
@@ -234,3 +254,4 @@ class CleanCommand {
|
|
|
234
254
|
}
|
|
235
255
|
exports.CleanCommand = CleanCommand;
|
|
236
256
|
yok_1.injector.registerCommand("clean", CleanCommand);
|
|
257
|
+
//# sourceMappingURL=clean.js.map
|
package/lib/commands/config.js
CHANGED
|
@@ -25,6 +25,7 @@ class ConfigListCommand {
|
|
|
25
25
|
Object.keys(value)
|
|
26
26
|
.map((key) => {
|
|
27
27
|
return (color_1.color.green(`${indent()}${key}: `) +
|
|
28
|
+
// @ts-ignore
|
|
28
29
|
this.getValueString(value[key], depth + 1));
|
|
29
30
|
})
|
|
30
31
|
.join("\n"));
|
|
@@ -49,6 +50,7 @@ class ConfigGetCommand {
|
|
|
49
50
|
this.$logger.info(current);
|
|
50
51
|
}
|
|
51
52
|
catch (err) {
|
|
53
|
+
// ignore
|
|
52
54
|
}
|
|
53
55
|
}
|
|
54
56
|
async canExecute(args) {
|
|
@@ -75,6 +77,7 @@ class ConfigSetCommand {
|
|
|
75
77
|
const convertedValue = this.getConvertedValue(value);
|
|
76
78
|
const existingKey = current !== undefined;
|
|
77
79
|
const keyDisplay = color_1.color.green(key);
|
|
80
|
+
// when current is undefined, return empty string to avoid throw
|
|
78
81
|
const currentDisplay = current ? color_1.color.yellow(current) : "";
|
|
79
82
|
const updatedDisplay = color_1.color.cyan(convertedValue);
|
|
80
83
|
this.$logger.info(`${existingKey ? "Updating" : "Setting"} ${keyDisplay}${existingKey ? ` from ${currentDisplay} ` : " "}to ${updatedDisplay}`);
|
|
@@ -100,6 +103,7 @@ class ConfigSetCommand {
|
|
|
100
103
|
return JSON.parse(v);
|
|
101
104
|
}
|
|
102
105
|
catch (e) {
|
|
106
|
+
// just treat it as a string
|
|
103
107
|
return `${v}`;
|
|
104
108
|
}
|
|
105
109
|
}
|
|
@@ -108,3 +112,4 @@ exports.ConfigSetCommand = ConfigSetCommand;
|
|
|
108
112
|
yok_1.injector.registerCommand("config|*list", ConfigListCommand);
|
|
109
113
|
yok_1.injector.registerCommand("config|get", ConfigGetCommand);
|
|
110
114
|
yok_1.injector.registerCommand("config|set", ConfigSetCommand);
|
|
115
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -105,6 +105,7 @@ class CreateProjectCommand {
|
|
|
105
105
|
template: selectedTemplate,
|
|
106
106
|
appId: this.$options.appid,
|
|
107
107
|
pathToProject: this.$options.path,
|
|
108
|
+
// its already validated above
|
|
108
109
|
force: true,
|
|
109
110
|
ignoreScripts: this.$options.ignoreScripts,
|
|
110
111
|
});
|
|
@@ -399,6 +400,10 @@ can skip this prompt next time using the --template option, or using --ng, --rea
|
|
|
399
400
|
`For more options consult the docs or run ${color_1.color.green("ns --help")}`,
|
|
400
401
|
"",
|
|
401
402
|
].join("\n"));
|
|
403
|
+
// todo: add back ns preview
|
|
404
|
+
// this.$logger.printMarkdown(
|
|
405
|
+
// `After that you can preview it on device by executing \`$ ns preview\``
|
|
406
|
+
// );
|
|
402
407
|
}
|
|
403
408
|
}
|
|
404
409
|
exports.CreateProjectCommand = CreateProjectCommand;
|
|
@@ -415,3 +420,4 @@ CreateProjectCommand.DrawerTemplateDescription = "An app with pre-built pages th
|
|
|
415
420
|
CreateProjectCommand.TabsTemplateKey = "Tabs";
|
|
416
421
|
CreateProjectCommand.TabsTemplateDescription = "An app with pre-built pages that uses tabs for navigation";
|
|
417
422
|
yok_1.injector.registerCommand("create", CreateProjectCommand);
|
|
423
|
+
//# sourceMappingURL=create-project.js.map
|
package/lib/commands/debug.js
CHANGED
|
@@ -90,6 +90,10 @@ class DebugIOSCommand {
|
|
|
90
90
|
this.allowedParameters = [];
|
|
91
91
|
this.platform = this.$devicePlatformsConstants.iOS;
|
|
92
92
|
this.$projectData.initializeProjectData();
|
|
93
|
+
// 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.
|
|
94
|
+
// 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.
|
|
95
|
+
// That's why the `$ ns debug ios --justlaunch` command will not release the terminal.
|
|
96
|
+
// 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.
|
|
93
97
|
$iosDeviceOperations.setShouldDispose(false);
|
|
94
98
|
$iOSSimulatorLogProvider.setShouldDispose(false);
|
|
95
99
|
}
|
|
@@ -107,7 +111,7 @@ class DebugIOSCommand {
|
|
|
107
111
|
if (this.$options.inspector) {
|
|
108
112
|
const macOSWarning = await this.$sysInfo.getMacOSWarningMessage();
|
|
109
113
|
if (macOSWarning &&
|
|
110
|
-
macOSWarning.severity === "high") {
|
|
114
|
+
macOSWarning.severity === "high" /* SystemWarningsSeverity.high */) {
|
|
111
115
|
this.$errors.fail(`You cannot use NativeScript Inspector on this OS. To use it, please update your OS.`);
|
|
112
116
|
}
|
|
113
117
|
}
|
|
@@ -167,3 +171,4 @@ __decorate([
|
|
|
167
171
|
(0, decorators_1.cache)()
|
|
168
172
|
], DebugAndroidCommand.prototype, "debugPlatformCommand", null);
|
|
169
173
|
yok_1.injector.registerCommand("debug|android", DebugAndroidCommand);
|
|
174
|
+
//# sourceMappingURL=debug.js.map
|
package/lib/commands/deploy.js
CHANGED
|
@@ -16,11 +16,11 @@ class DeployOnDeviceCommand extends command_base_1.ValidatePlatformCommandBase {
|
|
|
16
16
|
this.allowedParameters = [];
|
|
17
17
|
this.dashedOptions = {
|
|
18
18
|
watch: {
|
|
19
|
-
type: "boolean"
|
|
19
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
20
20
|
default: false,
|
|
21
21
|
hasSensitiveValue: false,
|
|
22
22
|
},
|
|
23
|
-
hmr: { type: "boolean"
|
|
23
|
+
hmr: { type: "boolean" /* OptionType.Boolean */, default: false, hasSensitiveValue: false },
|
|
24
24
|
};
|
|
25
25
|
this.$projectData.initializeProjectData();
|
|
26
26
|
}
|
|
@@ -60,3 +60,4 @@ class DeployOnDeviceCommand extends command_base_1.ValidatePlatformCommandBase {
|
|
|
60
60
|
}
|
|
61
61
|
exports.DeployOnDeviceCommand = DeployOnDeviceCommand;
|
|
62
62
|
yok_1.injector.registerCommand("deploy", DeployOnDeviceCommand);
|
|
63
|
+
//# sourceMappingURL=deploy.js.map
|