nativescript 8.7.0-rc.1 → 8.7.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/android-tools-info.js +12 -0
- package/lib/base-package-manager.js +7 -0
- package/lib/bootstrap.js +7 -1
- package/lib/color.js +3 -0
- package/lib/commands/add-platform.js +1 -0
- package/lib/commands/apple-login.js +1 -0
- package/lib/commands/appstore-list.js +1 -0
- package/lib/commands/appstore-upload.js +4 -0
- package/lib/commands/build.js +20 -3
- package/lib/commands/clean.js +22 -1
- package/lib/commands/command-base.js +1 -0
- package/lib/commands/config.js +3 -0
- package/lib/commands/create-project.js +34 -22
- package/lib/commands/debug.js +6 -1
- package/lib/commands/deploy.js +3 -2
- package/lib/commands/extensibility/install-extension.js +1 -0
- package/lib/commands/extensibility/list-extensions.js +1 -0
- package/lib/commands/extensibility/uninstall-extension.js +1 -0
- package/lib/commands/fonts.js +1 -0
- package/lib/commands/generate-assets.js +1 -0
- package/lib/commands/generate-help.js +1 -0
- package/lib/commands/generate.js +12 -2
- package/lib/commands/info.js +1 -0
- package/lib/commands/install.js +1 -0
- package/lib/commands/list-platforms.js +1 -0
- package/lib/commands/migrate.js +1 -0
- package/lib/commands/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 +3 -2
- 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 +1 -0
- package/lib/commands/update-platform.js +5 -0
- package/lib/commands/update.js +2 -0
- package/lib/common/bootstrap.js +1 -0
- package/lib/common/child-process.js +3 -0
- package/lib/common/codeGeneration/code-entity.js +1 -0
- package/lib/common/codeGeneration/code-printer.js +1 -0
- package/lib/common/command-params.js +1 -0
- package/lib/common/commands/analytics.js +3 -0
- package/lib/common/commands/autocompletion.js +3 -0
- package/lib/common/commands/device/device-log-stream.js +1 -0
- package/lib/common/commands/device/get-file.js +2 -0
- package/lib/common/commands/device/list-applications.js +1 -0
- package/lib/common/commands/device/list-devices.js +3 -0
- package/lib/common/commands/device/list-files.js +2 -0
- package/lib/common/commands/device/put-file.js +2 -0
- package/lib/common/commands/device/run-application.js +1 -0
- package/lib/common/commands/device/stop-application.js +1 -0
- package/lib/common/commands/device/uninstall-application.js +1 -0
- package/lib/common/commands/doctor.js +3 -2
- package/lib/common/commands/generate-messages.js +1 -0
- package/lib/common/commands/help.js +1 -0
- package/lib/common/commands/package-manager-get.js +1 -0
- package/lib/common/commands/package-manager-set.js +1 -0
- package/lib/common/commands/post-install.js +1 -0
- package/lib/common/commands/preuninstall.js +11 -2
- package/lib/common/commands/proxy/proxy-base.js +4 -0
- package/lib/common/commands/proxy/proxy-clear.js +1 -0
- package/lib/common/commands/proxy/proxy-get.js +1 -0
- package/lib/common/commands/proxy/proxy-set.js +1 -0
- package/lib/common/common-lib.js +1 -0
- package/lib/common/constants.js +11 -0
- package/lib/common/decorators.js +48 -0
- package/lib/common/definitions/mobile.d.ts +1 -1
- 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 +5 -0
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +11 -0
- package/lib/common/mobile/android/logcat-helper.js +20 -1
- 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 +72 -3
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +3 -1
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +3 -0
- package/lib/common/mobile/mobile-helper.js +2 -1
- 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 +12 -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 +58 -5
- package/lib/controllers/build-controller.js +4 -3
- package/lib/controllers/debug-controller.js +8 -3
- package/lib/controllers/deploy-controller.js +1 -0
- package/lib/controllers/migrate-controller.js +91 -3
- package/lib/controllers/platform-controller.js +9 -1
- package/lib/controllers/prepare-controller.js +15 -5
- package/lib/controllers/run-controller.js +17 -1
- package/lib/controllers/update-controller-base.js +1 -0
- package/lib/controllers/update-controller.js +11 -0
- package/lib/data/build-data.js +1 -0
- package/lib/data/controller-data-base.js +1 -0
- package/lib/data/debug-data.js +1 -0
- package/lib/data/platform-data.js +1 -0
- package/lib/data/prepare-data.js +1 -0
- package/lib/data/run-data.js +1 -0
- package/lib/detached-processes/cleanup-js-subprocess.js +8 -2
- package/lib/detached-processes/cleanup-process.js +18 -14
- package/lib/detached-processes/file-log-service.js +2 -1
- package/lib/device-path-provider.js +3 -2
- 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 +5 -2
- package/lib/helpers/network-connectivity-validator.js +1 -0
- package/lib/helpers/options-track-helper.js +3 -2
- package/lib/helpers/package-path-helper.js +1 -0
- package/lib/helpers/platform-command-helper.js +7 -2
- package/lib/helpers/version-validator-helper.js +1 -0
- package/lib/key-commands/bootstrap.js +3 -2
- package/lib/key-commands/index.js +5 -4
- package/lib/nativescript-cli-lib-bootstrap.js +4 -0
- package/lib/nativescript-cli-lib.js +1 -0
- package/lib/nativescript-cli.js +10 -1
- package/lib/node/pbxproj-dom-xcode.js +1 -0
- package/lib/node/xcode.js +1 -0
- package/lib/node-package-manager.js +11 -1
- package/lib/options.js +141 -115
- 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 +2 -1
- 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 +28 -0
- package/lib/services/android-project-service.js +71 -4
- package/lib/services/android-resources-migration-service.js +7 -0
- package/lib/services/apple-portal/apple-portal-application-service.js +1 -0
- package/lib/services/apple-portal/apple-portal-cookie-service.js +1 -0
- package/lib/services/apple-portal/apple-portal-session-service.js +6 -4
- package/lib/services/assets-generation/assets-generation-service.js +16 -5
- package/lib/services/build-artifacts-service.js +2 -1
- package/lib/services/build-data-service.js +2 -1
- package/lib/services/build-info-file-service.js +1 -0
- package/lib/services/cleanup-service.js +13 -9
- package/lib/services/cocoapods-platform-manager.js +9 -0
- package/lib/services/cocoapods-service.js +21 -1
- package/lib/services/debug-data-service.js +1 -0
- package/lib/services/debug-service-base.js +7 -0
- package/lib/services/device/device-install-app-service.js +2 -1
- package/lib/services/doctor-service.js +21 -6
- package/lib/services/extensibility-service.js +8 -0
- package/lib/services/files-hash-service.js +1 -0
- package/lib/services/hmr-status-service.js +2 -0
- package/lib/services/info-service.js +1 -0
- package/lib/services/initialize-service.js +5 -1
- package/lib/services/ios/export-options-plist-service.js +4 -0
- package/lib/services/ios/ios-signing-service.js +4 -0
- package/lib/services/ios/spm-service.js +10 -1
- package/lib/services/ios/xcodebuild-args-service.js +13 -4
- package/lib/services/ios/xcodebuild-command-service.js +1 -0
- package/lib/services/ios/xcodebuild-service.js +1 -0
- package/lib/services/ios-debugger-port-service.js +1 -0
- package/lib/services/ios-device-debug-service.js +1 -0
- package/lib/services/ios-entitlements-service.js +1 -0
- package/lib/services/ios-extensions-service.js +1 -0
- package/lib/services/ios-log-filter.js +20 -0
- package/lib/services/ios-native-target-service.js +6 -4
- package/lib/services/ios-project-service.js +29 -7
- 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 +47 -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 +18 -2
- package/lib/services/prepare-data-service.js +2 -1
- package/lib/services/project-backup-service.js +4 -0
- package/lib/services/project-changes-service.js +12 -3
- package/lib/services/project-cleanup-service.js +2 -0
- package/lib/services/project-config-service.js +18 -1
- package/lib/services/project-data-service.js +36 -7
- package/lib/services/project-name-service.js +1 -0
- package/lib/services/project-service.js +10 -0
- package/lib/services/project-templates-service.js +3 -2
- package/lib/services/qr-code-terminal-service.js +1 -0
- package/lib/services/require-service.js +1 -0
- package/lib/services/start-service.js +1 -0
- package/lib/services/temp-service.js +1 -0
- package/lib/services/terminal-spinner-service.js +2 -0
- package/lib/services/test-execution-service.js +9 -2
- package/lib/services/test-initialization-service.js +4 -0
- package/lib/services/timeline-profiler-service.js +1 -0
- package/lib/services/user-settings-service.js +1 -0
- package/lib/services/versions-service.js +6 -4
- package/lib/services/watch-ignore-list-service.js +1 -0
- package/lib/services/webpack/webpack-compiler-service.js +42 -1
- package/lib/services/xcconfig-service.js +2 -0
- package/lib/services/xcproj-service.js +1 -0
- package/lib/shared-event-bus.js +6 -0
- package/lib/sys-info.js +2 -1
- package/lib/tools/config-manipulation/config-transformer.js +12 -0
- package/lib/tools/node-modules/node-modules-builder.js +1 -0
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +6 -0
- package/lib/yarn-package-manager.js +1 -0
- package/lib/yarn2-package-manager.js +3 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +15 -0
- package/node_modules/rimraf/CHANGELOG.md +65 -0
- package/node_modules/stringify-package/CHANGELOG.md +16 -0
- package/package.json +1 -1
|
@@ -61,6 +61,7 @@ class HooksService {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
static formatHookName(commandName) {
|
|
64
|
+
// Remove everything after | (including the pipe)
|
|
64
65
|
return commandName.replace(/\|[\s\S]*$/, "");
|
|
65
66
|
}
|
|
66
67
|
executeBeforeHooks(commandName, hookArguments) {
|
|
@@ -129,6 +130,11 @@ class HooksService {
|
|
|
129
130
|
this.$logger.warn(`${hook.fullPath} will NOT be executed because it has invalid arguments - ${color_1.color.grey(invalidArguments.join(", "))}.`);
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
133
|
+
// HACK for backwards compatibility:
|
|
134
|
+
// In case $projectData wasn't resolved by the time we got here (most likely we got here without running a command but through a service directly)
|
|
135
|
+
// then it is probably passed as a hookArg
|
|
136
|
+
// if that is the case then pass it directly to the hook instead of trying to resolve $projectData via injector
|
|
137
|
+
// This helps make hooks stateless
|
|
132
138
|
const projectDataHookArg = hookArguments["hookArgs"] && hookArguments["hookArgs"]["projectData"];
|
|
133
139
|
if (projectDataHookArg) {
|
|
134
140
|
hookArguments["projectData"] = hookArguments["$projectData"] = projectDataHookArg;
|
|
@@ -146,6 +152,7 @@ class HooksService {
|
|
|
146
152
|
this.$logger.warn(err.message || err);
|
|
147
153
|
}
|
|
148
154
|
else {
|
|
155
|
+
// Print the actual error with its callstack, so it is easy to find out which hooks is causing troubles.
|
|
149
156
|
this.$logger.error(err);
|
|
150
157
|
throw err || new Error(`Failed to execute hook: ${hook.fullPath}.`);
|
|
151
158
|
}
|
|
@@ -251,6 +258,7 @@ class HooksService {
|
|
|
251
258
|
interpreter = sheBangMatch[1];
|
|
252
259
|
}
|
|
253
260
|
if (interpreter) {
|
|
261
|
+
// Likewise, make /usr/bin/bash work like "bash".
|
|
254
262
|
shMatch = interpreter.match(/bin\/((?:ba)?sh)$/);
|
|
255
263
|
}
|
|
256
264
|
if (shMatch) {
|
|
@@ -291,6 +299,7 @@ class HooksService {
|
|
|
291
299
|
}
|
|
292
300
|
validateHookArguments(hookConstructor, hookFullPath) {
|
|
293
301
|
const invalidArguments = [];
|
|
302
|
+
// We need to annotate the hook in order to have the arguments of the constructor.
|
|
294
303
|
(0, helpers_1.annotate)(hookConstructor);
|
|
295
304
|
_.each(hookConstructor.$inject.args, (argument) => {
|
|
296
305
|
try {
|
|
@@ -310,9 +319,13 @@ HooksService.HOOKS_DIRECTORY_NAME = "hooks";
|
|
|
310
319
|
__decorate([
|
|
311
320
|
(0, decorators_1.memoize)({
|
|
312
321
|
shouldCache() {
|
|
322
|
+
// only cache if we have hooks directories, the only case to
|
|
323
|
+
// not have hooks directories is when the project dir is
|
|
324
|
+
// not set yet, ie. when creating a project.
|
|
313
325
|
return !!this.hooksDirectories.length;
|
|
314
326
|
},
|
|
315
327
|
})
|
|
316
328
|
], HooksService.prototype, "initialize", null);
|
|
317
329
|
exports.HooksService = HooksService;
|
|
318
330
|
yok_1.injector.register("hooksService", HooksService);
|
|
331
|
+
//# sourceMappingURL=hooks-service.js.map
|
|
@@ -35,6 +35,8 @@ class JsonFileSettingsService {
|
|
|
35
35
|
const dataToReturn = data.modifiedByCacheMechanism ? data.value : data;
|
|
36
36
|
if (cacheOpts && cacheOpts.cacheTimeout) {
|
|
37
37
|
if (!data.modifiedByCacheMechanism) {
|
|
38
|
+
// If data has no cache, but we want to check the timeout, consider the data as outdated.
|
|
39
|
+
// this should be a really rare case
|
|
38
40
|
return null;
|
|
39
41
|
}
|
|
40
42
|
const currentTime = Date.now();
|
|
@@ -100,6 +102,8 @@ class JsonFileSettingsService {
|
|
|
100
102
|
if (!this.$fs.exists(this.jsonSettingsFilePath)) {
|
|
101
103
|
const unexistingDirs = this.getUnexistingDirectories(this.jsonSettingsFilePath);
|
|
102
104
|
this.$fs.writeFile(this.jsonSettingsFilePath, null);
|
|
105
|
+
// when running under 'sudo' we create the <path to home dir>/.local/share/.nativescript-cli dir with root as owner
|
|
106
|
+
// and other Applications cannot access this directory anymore. (bower/heroku/etc)
|
|
103
107
|
if (process.env.SUDO_USER) {
|
|
104
108
|
for (const dir of unexistingDirs) {
|
|
105
109
|
yield this.$fs.setCurrentUserAsOwner(dir, process.env.SUDO_USER);
|
|
@@ -120,6 +124,7 @@ class JsonFileSettingsService {
|
|
|
120
124
|
const unexistingDirs = [];
|
|
121
125
|
let currentDir = path.join(filePath, "..");
|
|
122
126
|
while (true) {
|
|
127
|
+
// this directory won't be created.
|
|
123
128
|
if (this.$fs.exists(currentDir)) {
|
|
124
129
|
break;
|
|
125
130
|
}
|
|
@@ -131,3 +136,4 @@ class JsonFileSettingsService {
|
|
|
131
136
|
}
|
|
132
137
|
exports.JsonFileSettingsService = JsonFileSettingsService;
|
|
133
138
|
yok_1.injector.register("jsonFileSettingsService", JsonFileSettingsService, false);
|
|
139
|
+
//# sourceMappingURL=json-file-settings-service.js.map
|
|
@@ -31,6 +31,7 @@ class LockService {
|
|
|
31
31
|
}
|
|
32
32
|
get defaultLockParams() {
|
|
33
33
|
const lockParams = {
|
|
34
|
+
// https://www.npmjs.com/package/retry#retrytimeoutsoptions
|
|
34
35
|
retriesObj: { retries: 13, minTimeout: 100, maxTimeout: 1000, factor: 2 },
|
|
35
36
|
stale: 10 * 1000,
|
|
36
37
|
realpath: false,
|
|
@@ -89,6 +90,8 @@ class LockService {
|
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
92
|
getPathsForCleanupAction(lockPath) {
|
|
93
|
+
// The proper-lockfile creates directory with the passed name and `.lock` at the end.
|
|
94
|
+
// Ensure we will take care of it as well.
|
|
92
95
|
return [lockPath, `${lockPath}.lock`];
|
|
93
96
|
}
|
|
94
97
|
getLockFileSettings(filePath, fileOpts) {
|
|
@@ -104,6 +107,7 @@ class LockService {
|
|
|
104
107
|
fileOpts.retriesObj.retries = fileOpts.retries;
|
|
105
108
|
}
|
|
106
109
|
if (fileOpts.retryWait) {
|
|
110
|
+
// backwards compatibility
|
|
107
111
|
fileOpts.retriesObj.minTimeout = fileOpts.retriesObj.maxTimeout =
|
|
108
112
|
fileOpts.retryWait;
|
|
109
113
|
}
|
|
@@ -126,4 +130,6 @@ __decorate([
|
|
|
126
130
|
], LockService.prototype, "defaultLockFilePath", null);
|
|
127
131
|
exports.LockService = LockService;
|
|
128
132
|
yok_1.injector.register("lockService", LockService);
|
|
133
|
+
// backwards compatibility
|
|
129
134
|
yok_1.injector.register("lockfile", LockService);
|
|
135
|
+
//# sourceMappingURL=lock-service.js.map
|
|
@@ -18,12 +18,16 @@ const _ = require("lodash");
|
|
|
18
18
|
class MicroTemplateService {
|
|
19
19
|
constructor($injector) {
|
|
20
20
|
this.$injector = $injector;
|
|
21
|
+
// Injector's dynamicCallRegex doesn't have 'g' option, which we need here.
|
|
22
|
+
// Use ( ) in order to use $1 to get whole expression later
|
|
21
23
|
this.dynamicCallRegex = new RegExp(util.format("(%s)", this.$injector.dynamicCallRegex.source), "g");
|
|
22
24
|
}
|
|
23
25
|
parseContent(data, options) {
|
|
24
26
|
return __awaiter(this, void 0, void 0, function* () {
|
|
25
27
|
const localVariables = this.getLocalVariables(options);
|
|
26
28
|
const compiledTemplate = _.template(data.replace(this.dynamicCallRegex, 'this.$injector.getDynamicCallData("$1")'));
|
|
29
|
+
// When debugging parsing, uncomment the line below:
|
|
30
|
+
// console.log(compiledTemplate.source);
|
|
27
31
|
return yield compiledTemplate.apply(this, [localVariables]);
|
|
28
32
|
});
|
|
29
33
|
}
|
|
@@ -33,6 +37,7 @@ class MicroTemplateService {
|
|
|
33
37
|
}
|
|
34
38
|
getLocalVariables(options) {
|
|
35
39
|
const isHtml = options.isHtml;
|
|
40
|
+
// in html help we want to show all help. Only CONSOLE specific help(wrapped in if(isConsole) ) must be omitted
|
|
36
41
|
const localVariables = {
|
|
37
42
|
constants,
|
|
38
43
|
};
|
|
@@ -47,3 +52,4 @@ class MicroTemplateService {
|
|
|
47
52
|
}
|
|
48
53
|
exports.MicroTemplateService = MicroTemplateService;
|
|
49
54
|
yok_1.injector.register("microTemplateService", MicroTemplateService);
|
|
55
|
+
//# sourceMappingURL=micro-templating-service.js.map
|
|
@@ -24,6 +24,7 @@ class Net {
|
|
|
24
24
|
getFreePort() {
|
|
25
25
|
return __awaiter(this, void 0, void 0, function* () {
|
|
26
26
|
const server = net.createServer((sock) => {
|
|
27
|
+
/* empty - noone will connect here */
|
|
27
28
|
});
|
|
28
29
|
return new Promise((resolve, reject) => {
|
|
29
30
|
let isResolved = false;
|
|
@@ -57,6 +58,7 @@ class Net {
|
|
|
57
58
|
});
|
|
58
59
|
server.once("close", () => {
|
|
59
60
|
if (!isResolved) {
|
|
61
|
+
// "close" will be emitted right after "error"
|
|
60
62
|
isResolved = true;
|
|
61
63
|
resolve(true);
|
|
62
64
|
}
|
|
@@ -135,3 +137,4 @@ class Net {
|
|
|
135
137
|
Net.DEFAULT_INTERVAL = 1000;
|
|
136
138
|
exports.Net = Net;
|
|
137
139
|
yok_1.injector.register("net", Net);
|
|
140
|
+
//# sourceMappingURL=net-service.js.map
|
|
@@ -66,6 +66,7 @@ class ProjectFilesManager {
|
|
|
66
66
|
this.processPlatformSpecificFilesCore(platform, files, projectFilesConfig);
|
|
67
67
|
}
|
|
68
68
|
processPlatformSpecificFilesCore(platform, files, projectFilesConfig) {
|
|
69
|
+
// Renames the files that have `platform` as substring and removes the files from other platform
|
|
69
70
|
_.each(files, (filePath) => {
|
|
70
71
|
const projectFileInfo = this.$projectFilesProvider.getProjectFileInfo(filePath, platform, projectFilesConfig);
|
|
71
72
|
if (!projectFileInfo.shouldIncludeFile) {
|
|
@@ -73,6 +74,7 @@ class ProjectFilesManager {
|
|
|
73
74
|
}
|
|
74
75
|
else if (projectFileInfo.onDeviceFileName) {
|
|
75
76
|
const onDeviceFilePath = path.join(path.dirname(filePath), projectFileInfo.onDeviceFileName);
|
|
77
|
+
// Fix .js.map entries
|
|
76
78
|
const extension = path.extname(projectFileInfo.onDeviceFileName);
|
|
77
79
|
if (onDeviceFilePath !== filePath) {
|
|
78
80
|
if (extension === ".js" || extension === ".map") {
|
|
@@ -86,6 +88,8 @@ class ProjectFilesManager {
|
|
|
86
88
|
fileContent = fileContent.replace(new RegExp(oldName, "g"), newName);
|
|
87
89
|
this.$fs.writeFile(filePath, fileContent);
|
|
88
90
|
}
|
|
91
|
+
// Rename the file
|
|
92
|
+
// this.$fs.rename is not called as it is error prone on some systems with slower hard drives and rigorous antivirus software
|
|
89
93
|
this.$fs.writeFile(onDeviceFilePath, this.$fs.readText(filePath));
|
|
90
94
|
this.$fs.deleteFile(filePath);
|
|
91
95
|
}
|
|
@@ -98,3 +102,4 @@ class ProjectFilesManager {
|
|
|
98
102
|
}
|
|
99
103
|
exports.ProjectFilesManager = ProjectFilesManager;
|
|
100
104
|
yok_1.injector.register("projectFilesManager", ProjectFilesManager);
|
|
105
|
+
//# sourceMappingURL=project-files-manager.js.map
|
package/lib/common/utils.js
CHANGED
|
@@ -86,3 +86,4 @@ ProjectNameValidator.INVALID_FILENAMES = [
|
|
|
86
86
|
ProjectNameValidator.INVALID_EXTENSIONS = [];
|
|
87
87
|
exports.ProjectNameValidator = ProjectNameValidator;
|
|
88
88
|
yok_1.injector.register("projectNameValidator", ProjectNameValidator);
|
|
89
|
+
//# sourceMappingURL=project-name-validator.js.map
|
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
// This function must be separate to avoid dependencies on C++ modules - it must execute precisely when other functions cannot
|
|
2
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
4
|
exports.getNodeWarning = exports.verifyNodeVersion = void 0;
|
|
4
5
|
const color_1 = require("../color");
|
|
6
|
+
// Use only ES5 code here - pure JavaScript can be executed with any Node.js version (even 0.10, 0.12).
|
|
7
|
+
/* tslint:disable:no-var-keyword no-var-requires prefer-const*/
|
|
5
8
|
var os = require("os");
|
|
6
9
|
var semver = require("semver");
|
|
7
10
|
var util = require("util");
|
|
11
|
+
// These versions cannot be used with CLI due to bugs in the node itself.
|
|
12
|
+
// We are absolutely sure we cannot work with them, so inform the user if he is trying to use any of them and exit the process.
|
|
8
13
|
var versionsCausingFailure = ["0.10.34", "4.0.0", "4.2.0", "5.0.0"];
|
|
9
14
|
var minimumRequiredVersion = "8.0.0";
|
|
10
15
|
function getNodeVersionOpts() {
|
|
@@ -69,10 +74,12 @@ function getNodeWarning() {
|
|
|
69
74
|
if (warningMessage) {
|
|
70
75
|
nodeWarn = {
|
|
71
76
|
message: warningMessage,
|
|
72
|
-
severity: "medium"
|
|
77
|
+
severity: "medium" /* SystemWarningsSeverity.medium */,
|
|
73
78
|
};
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
return nodeWarn;
|
|
77
82
|
}
|
|
78
83
|
exports.getNodeWarning = getNodeWarning;
|
|
84
|
+
/* tslint:enable */
|
|
85
|
+
//# sourceMappingURL=verify-node-version.js.map
|
package/lib/common/yok.js
CHANGED
|
@@ -16,6 +16,13 @@ const helpers_1 = require("./helpers");
|
|
|
16
16
|
const constants_1 = require("./constants");
|
|
17
17
|
let indent = "";
|
|
18
18
|
function trace(formatStr, ...args) {
|
|
19
|
+
// uncomment following lines when debugging dependency injection
|
|
20
|
+
// const items: any[] = [];
|
|
21
|
+
// for (let _i = 1; _i < arguments.length; _i++) {
|
|
22
|
+
// items[_i - 1] = arguments[_i];
|
|
23
|
+
// }
|
|
24
|
+
// const util = require("util");
|
|
25
|
+
// console.log(util.format.apply(util, [indent + formatStr].concat(args)));
|
|
19
26
|
}
|
|
20
27
|
function pushIndent() {
|
|
21
28
|
indent += " ";
|
|
@@ -33,6 +40,7 @@ function forEachName(names, action) {
|
|
|
33
40
|
}
|
|
34
41
|
function register(...rest) {
|
|
35
42
|
return function (target) {
|
|
43
|
+
// TODO: Check if 'rest' has more arguments that have to be registered
|
|
36
44
|
exports.injector.register(rest[0], target);
|
|
37
45
|
};
|
|
38
46
|
}
|
|
@@ -52,7 +60,7 @@ class Yok {
|
|
|
52
60
|
}
|
|
53
61
|
requireCommand(names, file) {
|
|
54
62
|
forEachName(names, (commandName) => {
|
|
55
|
-
const commands = commandName.split("|");
|
|
63
|
+
const commands = commandName.split("|" /* CommandsDelimiters.HierarchicalCommand */);
|
|
56
64
|
if (commands.length > 1) {
|
|
57
65
|
if (_.startsWith(commands[1], "*") &&
|
|
58
66
|
this.modules[this.createCommandName(commands[0])]) {
|
|
@@ -62,7 +70,7 @@ class Yok {
|
|
|
62
70
|
if (!this.hierarchicalCommands[parentCommandName]) {
|
|
63
71
|
this.hierarchicalCommands[parentCommandName] = [];
|
|
64
72
|
}
|
|
65
|
-
this.hierarchicalCommands[parentCommandName].push(_.tail(commands).join("|"));
|
|
73
|
+
this.hierarchicalCommands[parentCommandName].push(_.tail(commands).join("|" /* CommandsDelimiters.HierarchicalCommand */));
|
|
66
74
|
}
|
|
67
75
|
if (commands.length > 1 &&
|
|
68
76
|
!this.modules[this.createCommandName(commands[0])]) {
|
|
@@ -133,7 +141,7 @@ class Yok {
|
|
|
133
141
|
}
|
|
134
142
|
registerCommand(names, resolver) {
|
|
135
143
|
forEachName(names, (name) => {
|
|
136
|
-
const commands = name.split("|");
|
|
144
|
+
const commands = name.split("|" /* CommandsDelimiters.HierarchicalCommand */);
|
|
137
145
|
this.register(this.createCommandName(name), resolver);
|
|
138
146
|
if (commands.length > 1) {
|
|
139
147
|
this.createHierarchicalCommand(commands[0]);
|
|
@@ -145,7 +153,7 @@ class Yok {
|
|
|
145
153
|
}
|
|
146
154
|
getDefaultCommand(name, commandArguments) {
|
|
147
155
|
const subCommands = this.hierarchicalCommands[name];
|
|
148
|
-
const defaultCommand = _.find(subCommands, (command) => _.some(command.split("|"), (c) => _.startsWith(c, "*")));
|
|
156
|
+
const defaultCommand = _.find(subCommands, (command) => _.some(command.split("|" /* CommandsDelimiters.HierarchicalCommand */), (c) => _.startsWith(c, "*" /* CommandsDelimiters.DefaultCommandSymbol */)));
|
|
149
157
|
return defaultCommand;
|
|
150
158
|
}
|
|
151
159
|
buildHierarchicalCommand(parentCommandName, commandLineArguments) {
|
|
@@ -161,7 +169,7 @@ class Yok {
|
|
|
161
169
|
remainingArguments = _.tail(remainingArguments);
|
|
162
170
|
if ((matchingSubCommandName = _.find(subCommands, (sc) => sc === currentSubCommandName ||
|
|
163
171
|
sc ===
|
|
164
|
-
`${"*"}${currentSubCommandName}`))) {
|
|
172
|
+
`${"*" /* CommandsDelimiters.DefaultCommandSymbol */}${currentSubCommandName}`))) {
|
|
165
173
|
finalSubCommandName = matchingSubCommandName;
|
|
166
174
|
finalRemainingArguments = remainingArguments;
|
|
167
175
|
}
|
|
@@ -170,8 +178,8 @@ class Yok {
|
|
|
170
178
|
finalSubCommandName =
|
|
171
179
|
this.getDefaultCommand(parentCommandName, commandLineArguments) || "";
|
|
172
180
|
finalRemainingArguments = _.difference(commandLineArguments, finalSubCommandName
|
|
173
|
-
.split("|")
|
|
174
|
-
.map((command) => _.startsWith(command, "*")
|
|
181
|
+
.split("|" /* CommandsDelimiters.HierarchicalCommand */)
|
|
182
|
+
.map((command) => _.startsWith(command, "*" /* CommandsDelimiters.DefaultCommandSymbol */)
|
|
175
183
|
? command.substr(1)
|
|
176
184
|
: command));
|
|
177
185
|
}
|
|
@@ -202,7 +210,9 @@ class Yok {
|
|
|
202
210
|
commandName = defaultCommand
|
|
203
211
|
? this.getHierarchicalCommandName(name, defaultCommand)
|
|
204
212
|
: "help";
|
|
205
|
-
|
|
213
|
+
// If we'll execute the default command, but it's full name had been written by the user
|
|
214
|
+
// for example "tns run ios", we have to remove the "ios" option from the arguments that we'll pass to the command.
|
|
215
|
+
if (_.includes(this.hierarchicalCommands[name], "*" /* CommandsDelimiters.DefaultCommandSymbol */ + args[0])) {
|
|
206
216
|
commandArguments = _.tail(args);
|
|
207
217
|
}
|
|
208
218
|
else {
|
|
@@ -211,11 +221,13 @@ class Yok {
|
|
|
211
221
|
}
|
|
212
222
|
}
|
|
213
223
|
else {
|
|
224
|
+
//Execute only default command without arguments
|
|
214
225
|
if (defaultCommand) {
|
|
215
226
|
commandName = this.getHierarchicalCommandName(name, defaultCommand);
|
|
216
227
|
}
|
|
217
228
|
else {
|
|
218
229
|
commandName = "help";
|
|
230
|
+
// Show command-line help
|
|
219
231
|
const options = this.resolve("options");
|
|
220
232
|
options.help = true;
|
|
221
233
|
}
|
|
@@ -227,7 +239,7 @@ class Yok {
|
|
|
227
239
|
exports.injector.registerCommand(name, factory);
|
|
228
240
|
}
|
|
229
241
|
getHierarchicalCommandName(parentCommandName, subCommandName) {
|
|
230
|
-
return [parentCommandName, subCommandName].join("|");
|
|
242
|
+
return [parentCommandName, subCommandName].join("|" /* CommandsDelimiters.HierarchicalCommand */);
|
|
231
243
|
}
|
|
232
244
|
isValidHierarchicalCommand(commandName, commandArguments) {
|
|
233
245
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -236,6 +248,8 @@ class Yok {
|
|
|
236
248
|
if (subCommands) {
|
|
237
249
|
const fullCommandName = this.buildHierarchicalCommand(commandName, commandArguments);
|
|
238
250
|
if (!fullCommandName) {
|
|
251
|
+
// In case buildHierarchicalCommand doesn't find a valid command
|
|
252
|
+
// there isn't a valid command or default with those arguments
|
|
239
253
|
const errors = exports.injector.resolve("errors");
|
|
240
254
|
errors.failWithHelp(constants_1.ERROR_NO_VALID_SUBCOMMAND_FORMAT, commandName);
|
|
241
255
|
}
|
|
@@ -246,8 +260,8 @@ class Yok {
|
|
|
246
260
|
});
|
|
247
261
|
}
|
|
248
262
|
isDefaultCommand(commandName) {
|
|
249
|
-
return (commandName.indexOf("*") > 0 &&
|
|
250
|
-
commandName.indexOf("|") > 0);
|
|
263
|
+
return (commandName.indexOf("*" /* CommandsDelimiters.DefaultCommandSymbol */) > 0 &&
|
|
264
|
+
commandName.indexOf("|" /* CommandsDelimiters.HierarchicalCommand */) > 0);
|
|
251
265
|
}
|
|
252
266
|
register(name, resolver, shared) {
|
|
253
267
|
shared = shared === undefined ? true : shared;
|
|
@@ -294,6 +308,12 @@ class Yok {
|
|
|
294
308
|
return this.resolveByName(param, ctorArguments);
|
|
295
309
|
}
|
|
296
310
|
}
|
|
311
|
+
/* Regex to match dynamic calls in the following format:
|
|
312
|
+
#{moduleName.functionName} or
|
|
313
|
+
#{moduleName.functionName(param1)} or
|
|
314
|
+
#{moduleName.functionName(param1, param2)} - multiple parameters separated with comma are supported
|
|
315
|
+
Check dynamicCall method for sample usage of this regular expression and see how to determine the passed parameters
|
|
316
|
+
*/
|
|
297
317
|
get dynamicCallRegex() {
|
|
298
318
|
return /#{([^.]+)\.([^}]+?)(\((.+)\))*}/;
|
|
299
319
|
}
|
|
@@ -424,3 +444,4 @@ function setGlobalInjector(inj) {
|
|
|
424
444
|
return inj;
|
|
425
445
|
}
|
|
426
446
|
exports.setGlobalInjector = setGlobalInjector;
|
|
447
|
+
//# sourceMappingURL=yok.js.map
|
package/lib/config.js
CHANGED
|
@@ -16,8 +16,10 @@ const os = require("os");
|
|
|
16
16
|
const _ = require("lodash");
|
|
17
17
|
const yok_1 = require("./common/yok");
|
|
18
18
|
class Configuration {
|
|
19
|
+
/*don't require logger and everything that has logger as dependency in config.js due to cyclic dependency*/
|
|
19
20
|
constructor($fs) {
|
|
20
21
|
this.$fs = $fs;
|
|
22
|
+
// User specific config
|
|
21
23
|
this.DEBUG = false;
|
|
22
24
|
this.ANDROID_DEBUG_UI = null;
|
|
23
25
|
this.USE_POD_SANDBOX = false;
|
|
@@ -56,6 +58,7 @@ class StaticConfig {
|
|
|
56
58
|
this._userAgent = null;
|
|
57
59
|
}
|
|
58
60
|
get disableCommandHooks() {
|
|
61
|
+
// Never set this to false because it will duplicate execution of hooks realized through method decoration
|
|
59
62
|
return true;
|
|
60
63
|
}
|
|
61
64
|
get HTML_CLI_HELPERS_DIR() {
|
|
@@ -100,6 +103,7 @@ class StaticConfig {
|
|
|
100
103
|
return __awaiter(this, void 0, void 0, function* () {
|
|
101
104
|
const $childProcess = this.$injector.resolve("$childProcess");
|
|
102
105
|
try {
|
|
106
|
+
// Do NOT use the adb wrapper because it will end blow up with Segmentation fault because the wrapper uses this method!!!
|
|
103
107
|
const proc = yield $childProcess.spawnFromEvent("adb", ["version"], "exit", undefined, { throwError: false });
|
|
104
108
|
if (proc.stderr) {
|
|
105
109
|
return yield this.spawnPrivateAdb();
|
|
@@ -113,21 +117,37 @@ class StaticConfig {
|
|
|
113
117
|
return "adb";
|
|
114
118
|
});
|
|
115
119
|
}
|
|
120
|
+
/*
|
|
121
|
+
Problem:
|
|
122
|
+
1. Adb forks itself as a server which keeps running until adb kill-server is invoked or crashes
|
|
123
|
+
2. On Windows running processes lock their image files due to memory mapping. Locked files prevent their parent directories from deletion and cannot be overwritten.
|
|
124
|
+
3. Update and uninstall scenarios are broken
|
|
125
|
+
Solution:
|
|
126
|
+
- Copy adb and associated files into a temporary directory. Let this copy of adb run persistently
|
|
127
|
+
- On Posix OSes, immediately delete the file to not take file space
|
|
128
|
+
- Tie common lib version to updates of adb, so that when we integrate a newer adb we can use it
|
|
129
|
+
- Adb is named differently on OSes and may have additional files. The code is hairy to accommodate these differences
|
|
130
|
+
*/
|
|
116
131
|
spawnPrivateAdb() {
|
|
117
132
|
return __awaiter(this, void 0, void 0, function* () {
|
|
118
133
|
const $fs = this.$injector.resolve("$fs"), $childProcess = this.$injector.resolve("$childProcess"), $hostInfo = this.$injector.resolve("$hostInfo");
|
|
134
|
+
// prepare the directory to host our copy of adb
|
|
119
135
|
const defaultAdbDirPath = path.join(__dirname, "common", "resources", "platform-tools", "android", process.platform);
|
|
120
136
|
const pathToPackageJson = path.join(__dirname, "..", "package.json");
|
|
121
137
|
const nsCliVersion = require(pathToPackageJson).version;
|
|
122
138
|
const tmpDir = path.join(os.tmpdir(), `nativescript-cli-${nsCliVersion}`);
|
|
123
139
|
$fs.createDirectory(tmpDir);
|
|
140
|
+
// copy the adb and associated files
|
|
124
141
|
const targetAdb = path.join(tmpDir, "adb");
|
|
142
|
+
// In case directory is missing or it's empty, copy the new adb
|
|
125
143
|
if (!$fs.exists(tmpDir) || !$fs.readDirectory(tmpDir).length) {
|
|
126
|
-
shelljs.cp(path.join(defaultAdbDirPath, "*"), tmpDir);
|
|
144
|
+
shelljs.cp(path.join(defaultAdbDirPath, "*"), tmpDir); // deliberately ignore copy errors
|
|
145
|
+
// adb loses its executable bit when packed inside electron asar file. Manually fix the issue
|
|
127
146
|
if (!$hostInfo.isWindows) {
|
|
128
147
|
shelljs.chmod("+x", targetAdb);
|
|
129
148
|
}
|
|
130
149
|
}
|
|
150
|
+
// let adb start its global server
|
|
131
151
|
yield $childProcess.spawnFromEvent(targetAdb, ["start-server"], "exit");
|
|
132
152
|
return targetAdb;
|
|
133
153
|
});
|
|
@@ -135,3 +155,4 @@ class StaticConfig {
|
|
|
135
155
|
}
|
|
136
156
|
exports.StaticConfig = StaticConfig;
|
|
137
157
|
yok_1.injector.register("staticConfig", StaticConfig);
|
|
158
|
+
//# sourceMappingURL=config.js.map
|
package/lib/constants.js
CHANGED
|
@@ -137,18 +137,19 @@ exports.RESERVED_TEMPLATE_NAMES = {
|
|
|
137
137
|
default: "@nativescript/template-hello-world",
|
|
138
138
|
javascript: "@nativescript/template-hello-world",
|
|
139
139
|
tsc: "@nativescript/template-hello-world-ts",
|
|
140
|
-
vision: "@nativescript/template-hello-world-ts-vision",
|
|
141
140
|
vue: "@nativescript/template-blank-vue",
|
|
142
|
-
"vision-vue": "@nativescript/template-blank-vue-vision",
|
|
143
141
|
typescript: "@nativescript/template-hello-world-ts",
|
|
144
142
|
ng: "@nativescript/template-hello-world-ng",
|
|
145
143
|
angular: "@nativescript/template-hello-world-ng",
|
|
146
|
-
"vision-ng": "@nativescript/template-hello-world-ng-vision",
|
|
147
144
|
react: "@nativescript/template-blank-react",
|
|
148
|
-
"vision-react": "@nativescript/template-blank-react-vision",
|
|
149
145
|
reactjs: "@nativescript/template-blank-react",
|
|
150
|
-
"vision-solid": "@nativescript/template-blank-solid-vision",
|
|
151
146
|
svelte: "@nativescript/template-blank-svelte",
|
|
147
|
+
// vision templates
|
|
148
|
+
vision: "@nativescript/template-hello-world-ts-vision",
|
|
149
|
+
"vision-vue": "@nativescript/template-blank-vue-vision",
|
|
150
|
+
"vision-ng": "@nativescript/template-hello-world-ng-vision",
|
|
151
|
+
"vision-react": "@nativescript/template-blank-react-vision",
|
|
152
|
+
"vision-solid": "@nativescript/template-blank-solid-vision",
|
|
152
153
|
"vision-svelte": "@nativescript/template-blank-svelte-vision",
|
|
153
154
|
};
|
|
154
155
|
exports.ANALYTICS_LOCAL_TEMPLATE_PREFIX = "localTemplate_";
|
|
@@ -216,6 +217,9 @@ DebugCommandErrors.NO_DEVICES_EMULATORS_FOUND_FOR_OPTIONS = "Unable to find devi
|
|
|
216
217
|
DebugCommandErrors.UNSUPPORTED_DEVICE_OS_FOR_DEBUGGING = "Unsupported device OS for debugging";
|
|
217
218
|
exports.DebugCommandErrors = DebugCommandErrors;
|
|
218
219
|
exports.AnalyticsEventLabelDelimiter = "__";
|
|
220
|
+
/**
|
|
221
|
+
* Used in ProjectDataService to concatenate the names of the properties inside nativescript key of package.json.
|
|
222
|
+
*/
|
|
219
223
|
exports.NATIVESCRIPT_PROPS_INTERNAL_DELIMITER = "**|__**";
|
|
220
224
|
exports.CLI_RESOURCES_DIR_NAME = "resources";
|
|
221
225
|
class AssetConstants {
|
|
@@ -232,6 +236,7 @@ AssetConstants.sizeDelimiter = "x";
|
|
|
232
236
|
AssetConstants.defaultScale = 1;
|
|
233
237
|
AssetConstants.defaultOverlayImageScale = 0.8;
|
|
234
238
|
exports.AssetConstants = AssetConstants;
|
|
239
|
+
// https://en.wikipedia.org/wiki/Darwin_(operating_system)#Release_history
|
|
235
240
|
class MacOSVersions {
|
|
236
241
|
}
|
|
237
242
|
MacOSVersions.Sierra = "10.12";
|
|
@@ -241,6 +246,14 @@ MacOSVersions.Catalina = "10.15";
|
|
|
241
246
|
exports.MacOSVersions = MacOSVersions;
|
|
242
247
|
exports.MacOSDeprecationStringFormat = "NativeScript does not support macOS %s and some functionality may not work. Please, upgrade to the latest macOS version.";
|
|
243
248
|
exports.XcodeDeprecationStringFormat = "The current Xcode version %s will not be supported in the next release of NativeScript. Consider updating your Xcode to latest official version.";
|
|
249
|
+
// export class TemplateVersions {
|
|
250
|
+
// public static v1 = "v1";
|
|
251
|
+
// public static v2 = "v2";
|
|
252
|
+
// }
|
|
253
|
+
// export class ProjectTemplateErrors {
|
|
254
|
+
// public static InvalidTemplateVersionStringFormat =
|
|
255
|
+
// "The template '%s' has a NativeScript version '%s' that is not supported. Unable to create project from it.";
|
|
256
|
+
// }
|
|
244
257
|
class Hooks {
|
|
245
258
|
}
|
|
246
259
|
Hooks.createProject = "createProject";
|
|
@@ -281,6 +294,7 @@ AndroidAppBundleMessages.ANDROID_APP_BUNDLE_PUBLISH_DOCS_MESSAGE = "How to use A
|
|
|
281
294
|
exports.AndroidAppBundleMessages = AndroidAppBundleMessages;
|
|
282
295
|
exports.RunOnDeviceEvents = {
|
|
283
296
|
runOnDeviceStopped: "runOnDeviceStopped",
|
|
297
|
+
// In case we name it error, EventEmitter expects instance of Error to be raised and will also raise uncaught exception in case there's no handler
|
|
284
298
|
runOnDeviceError: "runOnDeviceError",
|
|
285
299
|
runOnDeviceExecuted: "runOnDeviceExecuted",
|
|
286
300
|
runOnDeviceStarted: "runOnDeviceStarted",
|
|
@@ -317,14 +331,52 @@ var DeviceConnectionType;
|
|
|
317
331
|
})(DeviceConnectionType = exports.DeviceConnectionType || (exports.DeviceConnectionType = {}));
|
|
318
332
|
var LoggerLevel;
|
|
319
333
|
(function (LoggerLevel) {
|
|
334
|
+
/**
|
|
335
|
+
* Show all log messages.
|
|
336
|
+
* Log levels are used to assign importance to log messages, with the integer value being used to sort them.
|
|
337
|
+
* If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
|
|
338
|
+
*/
|
|
320
339
|
LoggerLevel["ALL"] = "ALL";
|
|
340
|
+
/**
|
|
341
|
+
* Log levels are used to assign importance to log messages, with the integer value being used to sort them.
|
|
342
|
+
* If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
|
|
343
|
+
*/
|
|
321
344
|
LoggerLevel["TRACE"] = "TRACE";
|
|
345
|
+
/**
|
|
346
|
+
* Log levels are used to assign importance to log messages, with the integer value being used to sort them.
|
|
347
|
+
* If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
|
|
348
|
+
*/
|
|
322
349
|
LoggerLevel["DEBUG"] = "DEBUG";
|
|
350
|
+
/**
|
|
351
|
+
* Log levels are used to assign importance to log messages, with the integer value being used to sort them.
|
|
352
|
+
* If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
|
|
353
|
+
*/
|
|
323
354
|
LoggerLevel["INFO"] = "INFO";
|
|
355
|
+
/**
|
|
356
|
+
* Log levels are used to assign importance to log messages, with the integer value being used to sort them.
|
|
357
|
+
* If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
|
|
358
|
+
*/
|
|
324
359
|
LoggerLevel["WARN"] = "WARN";
|
|
360
|
+
/**
|
|
361
|
+
* Log levels are used to assign importance to log messages, with the integer value being used to sort them.
|
|
362
|
+
* If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
|
|
363
|
+
*/
|
|
325
364
|
LoggerLevel["ERROR"] = "ERROR";
|
|
365
|
+
/**
|
|
366
|
+
* Log levels are used to assign importance to log messages, with the integer value being used to sort them.
|
|
367
|
+
* If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
|
|
368
|
+
*/
|
|
326
369
|
LoggerLevel["FATAL"] = "FATAL";
|
|
370
|
+
/**
|
|
371
|
+
* Log levels are used to assign importance to log messages, with the integer value being used to sort them.
|
|
372
|
+
* If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
|
|
373
|
+
*/
|
|
327
374
|
LoggerLevel["MARK"] = "MARK";
|
|
375
|
+
/**
|
|
376
|
+
* Disable all logging.
|
|
377
|
+
* Log levels are used to assign importance to log messages, with the integer value being used to sort them.
|
|
378
|
+
* If you do not specify anything in your configuration, the default values are used (ALL < TRACE < DEBUG < INFO < WARN < ERROR < FATAL < MARK < OFF)
|
|
379
|
+
*/
|
|
328
380
|
LoggerLevel["OFF"] = "OFF";
|
|
329
381
|
})(LoggerLevel = exports.LoggerLevel || (exports.LoggerLevel = {}));
|
|
330
382
|
var LoggerConfigData;
|
|
@@ -341,3 +393,4 @@ var PackageManagers;
|
|
|
341
393
|
PackageManagers["yarn"] = "yarn";
|
|
342
394
|
PackageManagers["yarn2"] = "yarn2";
|
|
343
395
|
})(PackageManagers = exports.PackageManagers || (exports.PackageManagers = {}));
|
|
396
|
+
//# sourceMappingURL=constants.js.map
|