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
|
@@ -22,6 +22,7 @@ class EmbedCommand extends prepare_1.PrepareCommand {
|
|
|
22
22
|
}
|
|
23
23
|
resolveHostProjectPath(hostProjectPath) {
|
|
24
24
|
if (hostProjectPath.charAt(0) === ".") {
|
|
25
|
+
// resolve relative to the project dir
|
|
25
26
|
const projectDir = this.$projectData.projectDir;
|
|
26
27
|
return (0, path_1.resolve)(projectDir, hostProjectPath);
|
|
27
28
|
}
|
|
@@ -45,7 +46,11 @@ class EmbedCommand extends prepare_1.PrepareCommand {
|
|
|
45
46
|
if (!canSuperExecute) {
|
|
46
47
|
return false;
|
|
47
48
|
}
|
|
49
|
+
// args[0] is the platform
|
|
50
|
+
// args[1] is the path to the host project
|
|
51
|
+
// args[2] is the host project module name
|
|
48
52
|
const platform = args[0].toLowerCase();
|
|
53
|
+
// also allow these to be set in the nativescript.config.ts
|
|
49
54
|
if (!args[1]) {
|
|
50
55
|
const hostProjectPath = this.getEmbedConfigForKey("hostProjectPath", platform);
|
|
51
56
|
if (hostProjectPath) {
|
|
@@ -65,8 +70,10 @@ class EmbedCommand extends prepare_1.PrepareCommand {
|
|
|
65
70
|
return true;
|
|
66
71
|
}
|
|
67
72
|
getEmbedConfigForKey(key, platform) {
|
|
73
|
+
// get the embed.<platform>.<key> value, or fallback to embed.<key> value
|
|
68
74
|
return this.$projectConfigService.getValue(`embed.${platform}.${key}`, this.$projectConfigService.getValue(`embed.${key}`));
|
|
69
75
|
}
|
|
70
76
|
}
|
|
71
77
|
exports.EmbedCommand = EmbedCommand;
|
|
72
78
|
yok_1.injector.registerCommand("embed", EmbedCommand);
|
|
79
|
+
//# sourceMappingURL=embed.js.map
|
package/lib/commands/fonts.js
CHANGED
|
@@ -54,3 +54,4 @@ class GenerateSplashScreensCommand extends GenerateCommandBase {
|
|
|
54
54
|
}
|
|
55
55
|
exports.GenerateSplashScreensCommand = GenerateSplashScreensCommand;
|
|
56
56
|
yok_1.injector.registerCommand("resources|generate|splashes", GenerateSplashScreensCommand);
|
|
57
|
+
//# sourceMappingURL=generate-assets.js.map
|
package/lib/commands/generate.js
CHANGED
|
@@ -3,7 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.GenerateCommand = void 0;
|
|
4
4
|
const yok_1 = require("../common/yok");
|
|
5
5
|
class GenerateCommand {
|
|
6
|
-
|
|
6
|
+
// private executionOptions: ExecutionOptions;
|
|
7
|
+
constructor($logger,
|
|
8
|
+
// private $options: IOptions,
|
|
9
|
+
$errors) {
|
|
7
10
|
this.$logger = $logger;
|
|
8
11
|
this.$errors = $errors;
|
|
9
12
|
this.allowedParameters = [];
|
|
@@ -11,6 +14,7 @@ class GenerateCommand {
|
|
|
11
14
|
async execute(_rawArgs) {
|
|
12
15
|
try {
|
|
13
16
|
this.$logger.info("If you have ideas for this command, please discuss at https://nativescript.org/discord");
|
|
17
|
+
// await run(this.executionOptions);
|
|
14
18
|
}
|
|
15
19
|
catch (error) {
|
|
16
20
|
this.$errors.fail(error.message);
|
|
@@ -22,9 +26,52 @@ class GenerateCommand {
|
|
|
22
26
|
return true;
|
|
23
27
|
}
|
|
24
28
|
validateExecutionOptions() {
|
|
29
|
+
// if (!this.executionOptions.schematic) {
|
|
30
|
+
// this.$errors.failWithHelp(
|
|
31
|
+
// `The generate command requires a schematic name to be specified.`
|
|
32
|
+
// );
|
|
33
|
+
// }
|
|
25
34
|
}
|
|
26
35
|
setExecutionOptions(rawArgs) {
|
|
36
|
+
// const options = this.parseRawArgs(rawArgs);
|
|
37
|
+
// this.executionOptions = {
|
|
38
|
+
// ...options,
|
|
39
|
+
// logger: this.$logger,
|
|
40
|
+
// directory: process.cwd(),
|
|
41
|
+
// };
|
|
27
42
|
}
|
|
28
43
|
}
|
|
29
44
|
exports.GenerateCommand = GenerateCommand;
|
|
45
|
+
/**
|
|
46
|
+
* Converts an array of command line arguments to options for the executed schematic.
|
|
47
|
+
* @param rawArgs The command line arguments. They should be in the format 'key=value' for strings or 'key' for booleans.
|
|
48
|
+
*/
|
|
49
|
+
// function parseSchematicSettings(rawArgs: string[]) {
|
|
50
|
+
// const [optionStrings, args] = partition<string>(rawArgs, (item) =>
|
|
51
|
+
// item.includes("=")
|
|
52
|
+
// );
|
|
53
|
+
// const options = optionStrings
|
|
54
|
+
// .map((o) => o.split("=")) // split to key and value pairs
|
|
55
|
+
// .map(([key, ...value]) => [key, value.join("=")]) // concat the value arrays if there are multiple = signs
|
|
56
|
+
// .reduce((obj, [key, value]) => {
|
|
57
|
+
// return { ...obj, [key]: value };
|
|
58
|
+
// }, {});
|
|
59
|
+
// return { options, args };
|
|
60
|
+
// }
|
|
61
|
+
/**
|
|
62
|
+
* Splits an array into two groups based on a predicate.
|
|
63
|
+
* @param array The array to split.
|
|
64
|
+
* @param predicate The condition to be used for splitting.
|
|
65
|
+
*/
|
|
66
|
+
// function partition<T>(array: T[], predicate: (item: T) => boolean): T[][] {
|
|
67
|
+
// return array.reduce(
|
|
68
|
+
// ([pass, fail], item) => {
|
|
69
|
+
// return predicate(item)
|
|
70
|
+
// ? [[...pass, item], fail]
|
|
71
|
+
// : [pass, [...fail, item]];
|
|
72
|
+
// },
|
|
73
|
+
// [[], []]
|
|
74
|
+
// );
|
|
75
|
+
// }
|
|
30
76
|
yok_1.injector.registerCommand("generate", GenerateCommand);
|
|
77
|
+
//# sourceMappingURL=generate.js.map
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HooksVerify = exports.LOCK_FILE_NAME = void 0;
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const crypto = require("crypto");
|
|
6
|
+
exports.LOCK_FILE_NAME = "nativescript-lock.json";
|
|
7
|
+
class HooksVerify {
|
|
8
|
+
constructor($projectData, $errors, $fs, $logger) {
|
|
9
|
+
this.$projectData = $projectData;
|
|
10
|
+
this.$errors = $errors;
|
|
11
|
+
this.$fs = $fs;
|
|
12
|
+
this.$logger = $logger;
|
|
13
|
+
this.allowedParameters = [];
|
|
14
|
+
this.$projectData.initializeProjectData();
|
|
15
|
+
}
|
|
16
|
+
async verifyHooksLock(plugins, hooksLockPath) {
|
|
17
|
+
var _a;
|
|
18
|
+
let lockFileContent;
|
|
19
|
+
let hooksLock;
|
|
20
|
+
try {
|
|
21
|
+
lockFileContent = this.$fs.readText(hooksLockPath, "utf8");
|
|
22
|
+
hooksLock = JSON.parse(lockFileContent);
|
|
23
|
+
}
|
|
24
|
+
catch (err) {
|
|
25
|
+
this.$errors.fail(`❌ Failed to read or parse ${exports.LOCK_FILE_NAME} at ${hooksLockPath}`);
|
|
26
|
+
}
|
|
27
|
+
const lockMap = new Map(); // pluginName -> hookType -> hash
|
|
28
|
+
for (const plugin of hooksLock) {
|
|
29
|
+
const hookMap = new Map();
|
|
30
|
+
for (const hook of plugin.hooks) {
|
|
31
|
+
hookMap.set(hook.type, hook.hash);
|
|
32
|
+
}
|
|
33
|
+
lockMap.set(plugin.name, hookMap);
|
|
34
|
+
}
|
|
35
|
+
let isValid = true;
|
|
36
|
+
for (const plugin of plugins) {
|
|
37
|
+
const pluginLockHooks = lockMap.get(plugin.name);
|
|
38
|
+
if (!pluginLockHooks) {
|
|
39
|
+
this.$logger.error(`❌ Plugin '${plugin.name}' not found in ${exports.LOCK_FILE_NAME}`);
|
|
40
|
+
isValid = false;
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
for (const hook of ((_a = plugin.nativescript) === null || _a === void 0 ? void 0 : _a.hooks) || []) {
|
|
44
|
+
const expectedHash = pluginLockHooks.get(hook.type);
|
|
45
|
+
if (!expectedHash) {
|
|
46
|
+
this.$logger.error(`❌ Missing hook '${hook.type}' for plugin '${plugin.name}' in ${exports.LOCK_FILE_NAME}`);
|
|
47
|
+
isValid = false;
|
|
48
|
+
continue;
|
|
49
|
+
}
|
|
50
|
+
let fileContent;
|
|
51
|
+
try {
|
|
52
|
+
fileContent = this.$fs.readFile(path.join(plugin.fullPath, hook.script));
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
this.$logger.error(`❌ Cannot read script file '${hook.script}' for hook '${hook.type}' in plugin '${plugin.name}'`);
|
|
56
|
+
isValid = false;
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
const actualHash = crypto
|
|
60
|
+
.createHash("sha256")
|
|
61
|
+
.update(fileContent)
|
|
62
|
+
.digest("hex");
|
|
63
|
+
if (actualHash !== expectedHash) {
|
|
64
|
+
this.$logger.error(`❌ Hash mismatch for '${hook.script}' (${hook.type} in ${plugin.name}):`);
|
|
65
|
+
this.$logger.error(` Expected: ${expectedHash}`);
|
|
66
|
+
this.$logger.error(` Actual: ${actualHash}`);
|
|
67
|
+
isValid = false;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (isValid) {
|
|
72
|
+
this.$logger.info("✅ All hooks verified successfully. No issues found.");
|
|
73
|
+
}
|
|
74
|
+
else {
|
|
75
|
+
this.$errors.fail("❌ One or more hooks failed verification.");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
exports.HooksVerify = HooksVerify;
|
|
80
|
+
//# sourceMappingURL=common.js.map
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HooksVerifyPluginCommand = exports.HooksLockPluginCommand = void 0;
|
|
4
|
+
const yok_1 = require("../../common/yok");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const crypto = require("crypto");
|
|
7
|
+
const common_1 = require("./common");
|
|
8
|
+
class HooksLockPluginCommand {
|
|
9
|
+
constructor($pluginsService, $projectData, $errors, $fs, $logger) {
|
|
10
|
+
this.$pluginsService = $pluginsService;
|
|
11
|
+
this.$projectData = $projectData;
|
|
12
|
+
this.$errors = $errors;
|
|
13
|
+
this.$fs = $fs;
|
|
14
|
+
this.$logger = $logger;
|
|
15
|
+
this.allowedParameters = [];
|
|
16
|
+
this.$projectData.initializeProjectData();
|
|
17
|
+
}
|
|
18
|
+
async execute() {
|
|
19
|
+
var _a, _b;
|
|
20
|
+
const plugins = await this.$pluginsService.getAllInstalledPlugins(this.$projectData);
|
|
21
|
+
if (plugins && plugins.length > 0) {
|
|
22
|
+
const pluginsWithHooks = [];
|
|
23
|
+
for (const plugin of plugins) {
|
|
24
|
+
if (((_b = (_a = plugin.nativescript) === null || _a === void 0 ? void 0 : _a.hooks) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
25
|
+
pluginsWithHooks.push(plugin);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
await this.writeHooksLockFile(pluginsWithHooks, this.$projectData.projectDir);
|
|
29
|
+
}
|
|
30
|
+
else {
|
|
31
|
+
this.$logger.info("No plugins with hooks found.");
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
async canExecute(args) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
async writeHooksLockFile(plugins, outputDir) {
|
|
38
|
+
var _a;
|
|
39
|
+
const output = [];
|
|
40
|
+
for (const plugin of plugins) {
|
|
41
|
+
const hooks = [];
|
|
42
|
+
for (const hook of ((_a = plugin.nativescript) === null || _a === void 0 ? void 0 : _a.hooks) || []) {
|
|
43
|
+
try {
|
|
44
|
+
const fileContent = this.$fs.readFile(path.join(plugin.fullPath, hook.script));
|
|
45
|
+
const hash = crypto
|
|
46
|
+
.createHash("sha256")
|
|
47
|
+
.update(fileContent)
|
|
48
|
+
.digest("hex");
|
|
49
|
+
hooks.push({
|
|
50
|
+
type: hook.type,
|
|
51
|
+
hash,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
this.$logger.warn(`Warning: Failed to read script '${hook.script}' for plugin '${plugin.name}'. Skipping this hook.`);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
output.push({ name: plugin.name, hooks });
|
|
60
|
+
}
|
|
61
|
+
const filePath = path.resolve(outputDir, common_1.LOCK_FILE_NAME);
|
|
62
|
+
try {
|
|
63
|
+
this.$fs.writeFile(filePath, JSON.stringify(output, null, 2), "utf8");
|
|
64
|
+
this.$logger.info(`✅ ${common_1.LOCK_FILE_NAME} written to: ${filePath}`);
|
|
65
|
+
}
|
|
66
|
+
catch (err) {
|
|
67
|
+
this.$errors.fail(`❌ Failed to write ${common_1.LOCK_FILE_NAME}: ${err}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
exports.HooksLockPluginCommand = HooksLockPluginCommand;
|
|
72
|
+
class HooksVerifyPluginCommand extends common_1.HooksVerify {
|
|
73
|
+
constructor($pluginsService, $projectData, $errors, $fs, $logger) {
|
|
74
|
+
super($projectData, $errors, $fs, $logger);
|
|
75
|
+
this.$pluginsService = $pluginsService;
|
|
76
|
+
this.allowedParameters = [];
|
|
77
|
+
}
|
|
78
|
+
async execute() {
|
|
79
|
+
var _a, _b;
|
|
80
|
+
const plugins = await this.$pluginsService.getAllInstalledPlugins(this.$projectData);
|
|
81
|
+
if (plugins && plugins.length > 0) {
|
|
82
|
+
const pluginsWithHooks = [];
|
|
83
|
+
for (const plugin of plugins) {
|
|
84
|
+
if (((_b = (_a = plugin.nativescript) === null || _a === void 0 ? void 0 : _a.hooks) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
85
|
+
pluginsWithHooks.push(plugin);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
await this.verifyHooksLock(pluginsWithHooks, path.join(this.$projectData.projectDir, common_1.LOCK_FILE_NAME));
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
this.$logger.info("No plugins with hooks found.");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async canExecute(args) {
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.HooksVerifyPluginCommand = HooksVerifyPluginCommand;
|
|
99
|
+
yok_1.injector.registerCommand(["hooks|lock"], HooksLockPluginCommand);
|
|
100
|
+
yok_1.injector.registerCommand(["hooks|verify"], HooksVerifyPluginCommand);
|
|
101
|
+
//# sourceMappingURL=hooks-lock.js.map
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HooksListPluginCommand = exports.HooksPluginCommand = void 0;
|
|
4
|
+
const yok_1 = require("../../common/yok");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
const helpers_1 = require("../../common/helpers");
|
|
8
|
+
const nsHooks = require("@nativescript/hook");
|
|
9
|
+
const common_1 = require("./common");
|
|
10
|
+
class HooksPluginCommand extends common_1.HooksVerify {
|
|
11
|
+
constructor($pluginsService, $projectData, $errors, $fs, $logger) {
|
|
12
|
+
super($projectData, $errors, $fs, $logger);
|
|
13
|
+
this.$pluginsService = $pluginsService;
|
|
14
|
+
this.allowedParameters = [];
|
|
15
|
+
}
|
|
16
|
+
async execute(args) {
|
|
17
|
+
var _a, _b;
|
|
18
|
+
const isList = args.length > 0 && args[0] === "list" ? true : false;
|
|
19
|
+
const plugins = await this.$pluginsService.getAllInstalledPlugins(this.$projectData);
|
|
20
|
+
if (plugins && plugins.length > 0) {
|
|
21
|
+
const hooksDir = path.join(this.$projectData.projectDir, constants_1.HOOKS_DIR_NAME);
|
|
22
|
+
const pluginsWithHooks = [];
|
|
23
|
+
for (const plugin of plugins) {
|
|
24
|
+
if (((_b = (_a = plugin.nativescript) === null || _a === void 0 ? void 0 : _a.hooks) === null || _b === void 0 ? void 0 : _b.length) > 0) {
|
|
25
|
+
pluginsWithHooks.push(plugin);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
if (isList) {
|
|
29
|
+
const headers = ["Plugin", "HookName", "HookPath"];
|
|
30
|
+
const hookDataData = pluginsWithHooks.flatMap((plugin) => plugin.nativescript.hooks.map((hook) => {
|
|
31
|
+
return [plugin.name, hook.type, hook.script];
|
|
32
|
+
}));
|
|
33
|
+
const hookDataTable = (0, helpers_1.createTable)(headers, hookDataData);
|
|
34
|
+
this.$logger.info("Hooks:");
|
|
35
|
+
this.$logger.info(hookDataTable.toString());
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
if (this.$fs.exists(path.join(this.$projectData.projectDir, common_1.LOCK_FILE_NAME))) {
|
|
39
|
+
await this.verifyHooksLock(pluginsWithHooks, path.join(this.$projectData.projectDir, common_1.LOCK_FILE_NAME));
|
|
40
|
+
}
|
|
41
|
+
if (pluginsWithHooks.length === 0) {
|
|
42
|
+
if (!this.$fs.exists(hooksDir)) {
|
|
43
|
+
this.$fs.createDirectory(hooksDir);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
for (const plugin of pluginsWithHooks) {
|
|
47
|
+
nsHooks(plugin.fullPath).postinstall();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async canExecute(args) {
|
|
53
|
+
if (args.length > 0 && args[0] !== "list") {
|
|
54
|
+
this.$errors.failWithHelp(`Invalid argument ${args[0]}. Supported argument is "list".`);
|
|
55
|
+
}
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
exports.HooksPluginCommand = HooksPluginCommand;
|
|
60
|
+
class HooksListPluginCommand extends HooksPluginCommand {
|
|
61
|
+
constructor($pluginsService, $projectData, $errors, $fs, $logger) {
|
|
62
|
+
super($pluginsService, $projectData, $errors, $fs, $logger);
|
|
63
|
+
this.allowedParameters = [];
|
|
64
|
+
}
|
|
65
|
+
async execute() {
|
|
66
|
+
await super.execute(["list"]);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.HooksListPluginCommand = HooksListPluginCommand;
|
|
70
|
+
yok_1.injector.registerCommand(["hooks|install"], HooksPluginCommand);
|
|
71
|
+
yok_1.injector.registerCommand(["hooks|*list"], HooksListPluginCommand);
|
|
72
|
+
//# sourceMappingURL=hooks.js.map
|
package/lib/commands/info.js
CHANGED
package/lib/commands/install.js
CHANGED
package/lib/commands/migrate.js
CHANGED
|
@@ -173,6 +173,7 @@ class NativeAddObjectiveCCommand extends NativeAddSingleCommand {
|
|
|
173
173
|
const classFilePath = path.join(iosSourceBase, `${className}.m`);
|
|
174
174
|
const headerFilePath = path.join(iosSourceBase, `${className}.h`);
|
|
175
175
|
if (this.generateObjectiveCFiles(className, classFilePath, headerFilePath)) {
|
|
176
|
+
// Modify/Generate moduleMap
|
|
176
177
|
this.generateOrUpdateModuleMap(`${className}.h`, path.join(iosSourceBase, "module.modulemap"));
|
|
177
178
|
}
|
|
178
179
|
}
|
|
@@ -185,7 +186,9 @@ class NativeAddObjectiveCCommand extends NativeAddSingleCommand {
|
|
|
185
186
|
}
|
|
186
187
|
const headerDeclaration = `header "${headerPath}"`;
|
|
187
188
|
if (moduleMapContent.includes(`module ${moduleName}`)) {
|
|
189
|
+
// Module declaration already exists in the module map
|
|
188
190
|
if (moduleMapContent.includes(headerDeclaration)) {
|
|
191
|
+
// Header is already present in the module map
|
|
189
192
|
this.$logger.warn(`Header '${headerFileName}' is already added to the module map.`);
|
|
190
193
|
return;
|
|
191
194
|
}
|
|
@@ -193,6 +196,7 @@ class NativeAddObjectiveCCommand extends NativeAddSingleCommand {
|
|
|
193
196
|
fs.writeFileSync(moduleMapPath, updatedModuleMapContent);
|
|
194
197
|
}
|
|
195
198
|
else {
|
|
199
|
+
// Module declaration does not exist in the module map
|
|
196
200
|
const moduleDeclaration = `module ${moduleName} {${os_1.EOL} ${headerDeclaration}${os_1.EOL} export *${os_1.EOL}}`;
|
|
197
201
|
moduleMapContent += `${os_1.EOL}${os_1.EOL}${moduleDeclaration}`;
|
|
198
202
|
fs.writeFileSync(moduleMapPath, moduleMapContent);
|
|
@@ -275,3 +279,4 @@ yok_1.injector.registerCommand(["native|add|java"], NativeAddJavaCommand);
|
|
|
275
279
|
yok_1.injector.registerCommand(["native|add|kotlin"], NativeAddKotlinCommand);
|
|
276
280
|
yok_1.injector.registerCommand(["native|add|swift"], NativeAddSwiftCommand);
|
|
277
281
|
yok_1.injector.registerCommand(["native|add|objective-c"], NativeAddObjectiveCCommand);
|
|
282
|
+
//# sourceMappingURL=native-add.js.map
|
|
@@ -28,12 +28,14 @@ class CreatePluginCommand {
|
|
|
28
28
|
const selectedTemplate = this.$options.template;
|
|
29
29
|
const selectedPath = path.resolve(pathToProject || ".");
|
|
30
30
|
const projectDir = path.join(selectedPath, pluginRepoName);
|
|
31
|
+
// Must be out of try catch block, because will throw error if folder alredy exists and we don't want to delete it.
|
|
31
32
|
this.ensurePackageDir(projectDir);
|
|
32
33
|
try {
|
|
33
34
|
await this.downloadPackage(selectedTemplate, projectDir);
|
|
34
35
|
await this.setupSeed(projectDir, pluginRepoName);
|
|
35
36
|
}
|
|
36
37
|
catch (err) {
|
|
38
|
+
// The call to this.ensurePackageDir() above will throw error if folder alredy exists, so it is safe to delete here.
|
|
37
39
|
this.$fs.deleteDirectory(projectDir);
|
|
38
40
|
throw err;
|
|
39
41
|
}
|
|
@@ -69,6 +71,7 @@ class CreatePluginCommand {
|
|
|
69
71
|
!config.includeTypeScriptDemo)) {
|
|
70
72
|
this.$logger.printMarkdown("Using default values for plugin creation options since your shell is not interactive.");
|
|
71
73
|
}
|
|
74
|
+
// run postclone script manually and kill it if it takes more than 10 sec
|
|
72
75
|
const pathToPostCloneScript = path.join("scripts", "postclone");
|
|
73
76
|
const params = [
|
|
74
77
|
pathToPostCloneScript,
|
|
@@ -123,6 +126,7 @@ class CreatePluginCommand {
|
|
|
123
126
|
}
|
|
124
127
|
async getPluginNameSource(pluginNameSource, pluginRepoName) {
|
|
125
128
|
if (!pluginNameSource) {
|
|
129
|
+
// remove nativescript- prefix for naming plugin files
|
|
126
130
|
const prefix = "nativescript-";
|
|
127
131
|
pluginNameSource = pluginRepoName.toLowerCase().startsWith(prefix)
|
|
128
132
|
? pluginRepoName.slice(prefix.length, pluginRepoName.length)
|
|
@@ -150,3 +154,4 @@ class CreatePluginCommand {
|
|
|
150
154
|
}
|
|
151
155
|
exports.CreatePluginCommand = CreatePluginCommand;
|
|
152
156
|
yok_1.injector.registerCommand(["plugin|create"], CreatePluginCommand);
|
|
157
|
+
//# sourceMappingURL=create-plugin.js.map
|
|
@@ -21,6 +21,7 @@ class RemovePluginCommand {
|
|
|
21
21
|
}
|
|
22
22
|
let pluginNames = [];
|
|
23
23
|
try {
|
|
24
|
+
// try installing the plugins, so we can get information from node_modules about their native code, libs, etc.
|
|
24
25
|
const installedPlugins = await this.$pluginsService.getAllInstalledPlugins(this.$projectData);
|
|
25
26
|
pluginNames = installedPlugins.map((pl) => pl.name);
|
|
26
27
|
}
|
|
@@ -37,3 +38,4 @@ class RemovePluginCommand {
|
|
|
37
38
|
}
|
|
38
39
|
exports.RemovePluginCommand = RemovePluginCommand;
|
|
39
40
|
yok_1.injector.registerCommand("plugin|remove", RemovePluginCommand);
|
|
41
|
+
//# sourceMappingURL=remove-plugin.js.map
|
|
@@ -19,13 +19,18 @@ class PostInstallCliCommand {
|
|
|
19
19
|
async execute(args) {
|
|
20
20
|
const isRunningWithSudoUser = !!process.env.SUDO_USER;
|
|
21
21
|
if (!this.$hostInfo.isWindows) {
|
|
22
|
+
// when running under 'sudo' we create a working dir with wrong owner (root) and
|
|
23
|
+
// it is no longer accessible for the user initiating the installation
|
|
24
|
+
// patch the owner here
|
|
22
25
|
if (isRunningWithSudoUser) {
|
|
26
|
+
// TODO: Check if this is the correct place, probably we should set this at the end of the command.
|
|
23
27
|
await this.$fs.setCurrentUserAsOwner(this.$settingsService.getProfileDir(), process.env.SUDO_USER);
|
|
24
28
|
}
|
|
25
29
|
}
|
|
26
30
|
const canExecutePostInstallTask = !isRunningWithSudoUser || (0, helpers_1.doesCurrentNpmCommandMatch)([/^--unsafe-perm$/]);
|
|
27
31
|
if (canExecutePostInstallTask) {
|
|
28
32
|
await this.$helpService.generateHtmlPages();
|
|
33
|
+
// Explicitly ask for confirmation of usage-reporting:
|
|
29
34
|
await this.$analyticsService.checkConsent();
|
|
30
35
|
await this.$commandsService.tryExecuteCommand("autocomplete", []);
|
|
31
36
|
}
|
|
@@ -42,3 +47,4 @@ class PostInstallCliCommand {
|
|
|
42
47
|
}
|
|
43
48
|
exports.PostInstallCliCommand = PostInstallCliCommand;
|
|
44
49
|
yok_1.injector.registerCommand("post-install-cli", PostInstallCliCommand);
|
|
50
|
+
//# sourceMappingURL=post-install.js.map
|
package/lib/commands/prepare.js
CHANGED
|
@@ -17,13 +17,13 @@ class PrepareCommand extends command_base_1.ValidatePlatformCommandBase {
|
|
|
17
17
|
this.allowedParameters = [this.$platformCommandParameter];
|
|
18
18
|
this.dashedOptions = {
|
|
19
19
|
watch: {
|
|
20
|
-
type: "boolean"
|
|
20
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
21
21
|
default: false,
|
|
22
22
|
hasSensitiveValue: false,
|
|
23
23
|
},
|
|
24
|
-
hmr: { type: "boolean"
|
|
24
|
+
hmr: { type: "boolean" /* OptionType.Boolean */, default: false, hasSensitiveValue: false },
|
|
25
25
|
whatever: {
|
|
26
|
-
type: "boolean"
|
|
26
|
+
type: "boolean" /* OptionType.Boolean */,
|
|
27
27
|
default: false,
|
|
28
28
|
hasSensitiveValue: false,
|
|
29
29
|
},
|
|
@@ -54,3 +54,4 @@ class PrepareCommand extends command_base_1.ValidatePlatformCommandBase {
|
|
|
54
54
|
}
|
|
55
55
|
exports.PrepareCommand = PrepareCommand;
|
|
56
56
|
yok_1.injector.registerCommand("prepare", PrepareCommand);
|
|
57
|
+
//# sourceMappingURL=prepare.js.map
|
package/lib/commands/preview.js
CHANGED
|
@@ -24,6 +24,7 @@ class PreviewCommand {
|
|
|
24
24
|
}
|
|
25
25
|
async execute(args) {
|
|
26
26
|
if (!this.$options.disableNpmInstall) {
|
|
27
|
+
// ensure latest is installed
|
|
27
28
|
await this.$packageManager.install(`${PREVIEW_CLI_PACKAGE}@latest`, this.$projectData.projectDir, {
|
|
28
29
|
"save-dev": true,
|
|
29
30
|
"save-exact": true,
|
|
@@ -78,3 +79,4 @@ class PreviewCommand {
|
|
|
78
79
|
}
|
|
79
80
|
exports.PreviewCommand = PreviewCommand;
|
|
80
81
|
yok_1.injector.registerCommand("preview", PreviewCommand);
|
|
82
|
+
//# sourceMappingURL=preview.js.map
|
|
@@ -15,6 +15,7 @@ class ResourcesUpdateCommand {
|
|
|
15
15
|
}
|
|
16
16
|
async canExecute(args) {
|
|
17
17
|
if (!args || args.length === 0) {
|
|
18
|
+
// Command defaults to migrating the Android App_Resources, unless explicitly specified
|
|
18
19
|
args = ["android"];
|
|
19
20
|
}
|
|
20
21
|
for (const platform of args) {
|
|
@@ -30,3 +31,4 @@ class ResourcesUpdateCommand {
|
|
|
30
31
|
}
|
|
31
32
|
exports.ResourcesUpdateCommand = ResourcesUpdateCommand;
|
|
32
33
|
yok_1.injector.registerCommand("resources|update", ResourcesUpdateCommand);
|
|
34
|
+
//# sourceMappingURL=resources-update.js.map
|
package/lib/commands/run.js
CHANGED
|
@@ -154,3 +154,4 @@ class RunVisionOSCommand extends RunIosCommand {
|
|
|
154
154
|
exports.RunVisionOSCommand = RunVisionOSCommand;
|
|
155
155
|
yok_1.injector.registerCommand("run|vision", RunVisionOSCommand);
|
|
156
156
|
yok_1.injector.registerCommand("run|visionos", RunVisionOSCommand);
|
|
157
|
+
//# sourceMappingURL=run.js.map
|
package/lib/commands/setup.js
CHANGED
package/lib/commands/start.js
CHANGED
|
@@ -66,6 +66,8 @@ class TestInitCommand {
|
|
|
66
66
|
continue;
|
|
67
67
|
}
|
|
68
68
|
const dependencyVersion = modulePeerDependencies[peerDependency] || "*";
|
|
69
|
+
// catch errors when a peerDependency is already installed
|
|
70
|
+
// e.g karma is installed; karma-jasmine depends on karma and will try to install it again
|
|
69
71
|
try {
|
|
70
72
|
await this.$packageManager.install(`${peerDependency}@${dependencyVersion}`, projectDir, {
|
|
71
73
|
"save-dev": true,
|
|
@@ -117,6 +119,7 @@ class TestInitCommand {
|
|
|
117
119
|
const targetExampleTestRelativePath = path.relative(projectDir, targetExampleTestPath);
|
|
118
120
|
bufferedLogs.push(`Added example test: ${color_1.color.yellow(targetExampleTestRelativePath)}`);
|
|
119
121
|
}
|
|
122
|
+
// test main entry
|
|
120
123
|
const testMainResourcesPath = this.$resources.resolvePath(`test/test-main${projectFilesExtension}`);
|
|
121
124
|
const testMainPath = path.join(this.$projectData.appDirectoryPath, `test${projectFilesExtension}`);
|
|
122
125
|
if (!this.$fs.exists(testMainPath)) {
|
|
@@ -154,3 +157,4 @@ class TestInitCommand {
|
|
|
154
157
|
}
|
|
155
158
|
}
|
|
156
159
|
yok_1.injector.registerCommand("test|init", TestInitCommand);
|
|
160
|
+
//# sourceMappingURL=test-init.js.map
|