nativescript 8.5.3 → 8.5.4-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/config.json +0 -5
- package/lib/.d.ts +2 -37
- package/lib/bootstrap.js +1 -12
- package/lib/color.js +5 -0
- package/lib/commands/build.js +2 -6
- package/lib/commands/clean.js +11 -10
- package/lib/commands/config.js +6 -5
- package/lib/commands/create-project.js +12 -11
- package/lib/commands/debug.js +10 -11
- package/lib/commands/plugin/list-plugins.js +3 -2
- package/lib/commands/post-install.js +3 -5
- package/lib/commands/preview.js +4 -3
- package/lib/commands/run.js +17 -19
- package/lib/commands/test-init.js +14 -15
- package/lib/commands/test.js +0 -3
- package/lib/commands/update.js +1 -1
- package/lib/common/bootstrap.js +0 -1
- package/lib/common/child-process.js +3 -3
- package/lib/common/codeGeneration/code-printer.js +1 -1
- package/lib/common/commands/device/device-log-stream.js +1 -1
- package/lib/common/commands/device/list-devices.js +7 -8
- package/lib/common/commands/generate-messages.js +1 -1
- package/lib/common/constants.js +11 -11
- package/lib/common/declarations.d.ts +1 -53
- package/lib/common/definitions/commands-service.d.ts +0 -1
- package/lib/common/definitions/commands.d.ts +0 -1
- package/lib/common/definitions/google-analytics.d.ts +0 -5
- package/lib/common/dispatchers.js +4 -7
- package/lib/common/file-system.js +18 -22
- package/lib/common/host-info.js +4 -4
- package/lib/common/http-client.js +2 -2
- package/lib/common/logger/layouts/cli-layout.js +6 -2
- package/lib/common/logger/logger.js +7 -7
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +1 -1
- package/lib/common/mobile/android/android-log-filter.js +5 -5
- package/lib/common/mobile/android/android-virtual-device-service.js +2 -2
- package/lib/common/mobile/android/genymotion/genymotion-service.js +2 -2
- package/lib/common/mobile/android/logcat-helper.js +1 -1
- package/lib/common/mobile/device-log-provider.js +8 -8
- package/lib/common/mobile/ios/device/ios-device-file-system.js +1 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +1 -1
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +1 -1
- package/lib/common/mobile/mobile-helper.js +1 -1
- package/lib/common/mobile/wp8/wp8-emulator-services.js +4 -4
- package/lib/common/opener.js +5 -1
- package/lib/common/plist-parser.js +3 -3
- package/lib/common/project-helper.js +2 -2
- package/lib/common/services/analytics/google-analytics-custom-dimensions.d.ts +7 -7
- package/lib/common/services/auto-completion-service.js +2 -2
- package/lib/common/services/commands-service.js +5 -114
- package/lib/common/services/help-service.js +16 -16
- package/lib/common/services/hooks-service.js +2 -1
- package/lib/common/services/json-file-settings-service.js +3 -3
- package/lib/common/services/lock-service.js +5 -5
- package/lib/common/services/messages-service.js +6 -6
- package/lib/common/services/net-service.js +1 -1
- package/lib/common/services/project-files-manager.js +2 -2
- package/lib/common/services/settings-service.js +2 -2
- package/lib/common/validators/project-name-validator.js +1 -1
- package/lib/common/validators/validation-result.js +1 -1
- package/lib/common/verify-node-version.js +2 -2
- package/lib/config.js +3 -8
- package/lib/constants.js +18 -32
- package/lib/controllers/build-controller.js +5 -5
- package/lib/controllers/debug-controller.js +2 -2
- package/lib/controllers/migrate-controller.js +21 -20
- package/lib/controllers/update-controller.js +5 -4
- package/lib/declarations.d.ts +0 -24
- package/lib/definitions/build.d.ts +1 -1
- package/lib/definitions/livesync.d.ts +0 -10
- package/lib/definitions/project.d.ts +0 -6
- package/lib/definitions/xcode.d.ts +1 -1
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +15 -4
- package/lib/device-sockets/ios/notification.js +1 -1
- package/lib/helpers/android-bundle-validator-helper.js +1 -1
- package/lib/helpers/network-connectivity-validator.js +1 -1
- package/lib/helpers/options-track-helper.js +1 -1
- package/lib/nativescript-cli.js +8 -10
- package/lib/options.js +61 -21
- package/lib/package-installation-manager.js +5 -4
- package/lib/project-data.js +9 -10
- package/lib/providers/project-files-provider.js +3 -3
- package/lib/services/analytics/analytics-broker-process.js +0 -3
- package/lib/services/analytics/analytics-broker.js +5 -5
- package/lib/services/analytics/analytics-service.js +0 -4
- package/lib/services/analytics/analytics.d.ts +1 -8
- package/lib/services/analytics/google-analytics-provider.js +1 -21
- package/lib/services/analytics-settings-service.js +3 -11
- package/lib/services/android-device-debug-service.js +3 -3
- package/lib/services/android-plugin-build-service.js +3 -3
- package/lib/services/android-resources-migration-service.js +1 -1
- package/lib/services/assets-generation/assets-generation-service.js +5 -5
- package/lib/services/{build-artefacts-service.js → build-artifacts-service.js} +4 -4
- package/lib/services/cocoapods-service.js +1 -1
- package/lib/services/device/device-install-app-service.js +3 -3
- package/lib/services/doctor-service.js +10 -9
- package/lib/services/extensibility-service.js +8 -8
- package/lib/services/ios-entitlements-service.js +1 -1
- package/lib/services/ios-project-service.js +5 -5
- package/lib/services/ios-provision-service.js +7 -7
- package/lib/services/ios-watch-app-service.js +1 -1
- package/lib/services/ip-service.js +2 -4
- package/lib/services/itmstransporter-service.js +2 -2
- package/lib/services/livesync/android-device-livesync-sockets-service.js +1 -1
- package/lib/services/livesync/android-livesync-tool.js +5 -5
- package/lib/services/livesync/ios-device-livesync-service.js +2 -2
- package/lib/services/livesync/platform-livesync-service-base.js +2 -1
- package/lib/services/log-parser-service.js +1 -5
- package/lib/services/log-source-map-service.js +10 -7
- package/lib/services/npm-config-service.js +23 -9
- package/lib/services/performance-service.js +3 -3
- package/lib/services/platform-environment-requirements.js +1 -1
- package/lib/services/plugins-service.js +19 -19
- package/lib/services/project-backup-service.js +4 -3
- package/lib/services/project-cleanup-service.js +4 -3
- package/lib/services/test-execution-service.js +2 -2
- package/lib/services/timeline-profiler-service.js +4 -1
- package/lib/services/user-settings-service.js +4 -4
- package/lib/tools/config-manipulation/config-transformer.js +3 -3
- package/lib/tools/node-modules/node-modules-builder.js +1 -1
- package/node_modules/@npmcli/move-file/LICENSE.md +22 -0
- package/node_modules/@npmcli/move-file/README.md +69 -0
- package/node_modules/@npmcli/move-file/lib/index.js +185 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +15 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/LICENSE +21 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/bin/cmd.js +68 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/index.js +31 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/find-made.js +29 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/mkdirp-manual.js +64 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/mkdirp-native.js +39 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/opts-arg.js +23 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/path-arg.js +29 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/lib/use-native.js +10 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/package.json +44 -0
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/readme.markdown +266 -0
- package/node_modules/@npmcli/move-file/package.json +47 -0
- package/node_modules/balanced-match/.npmignore +5 -0
- package/node_modules/balanced-match/LICENSE.md +21 -0
- package/node_modules/balanced-match/README.md +91 -0
- package/node_modules/balanced-match/index.js +59 -0
- package/node_modules/balanced-match/package.json +49 -0
- package/node_modules/brace-expansion/LICENSE +21 -0
- package/node_modules/brace-expansion/README.md +129 -0
- package/node_modules/brace-expansion/index.js +201 -0
- package/node_modules/brace-expansion/package.json +47 -0
- package/node_modules/concat-map/.travis.yml +4 -0
- package/node_modules/concat-map/LICENSE +18 -0
- package/node_modules/concat-map/README.markdown +62 -0
- package/node_modules/concat-map/example/map.js +6 -0
- package/node_modules/concat-map/index.js +13 -0
- package/node_modules/concat-map/package.json +43 -0
- package/node_modules/concat-map/test/map.js +39 -0
- package/node_modules/fs.realpath/LICENSE +43 -0
- package/node_modules/fs.realpath/README.md +33 -0
- package/node_modules/fs.realpath/index.js +66 -0
- package/node_modules/fs.realpath/old.js +303 -0
- package/node_modules/fs.realpath/package.json +26 -0
- package/node_modules/inflight/LICENSE +15 -0
- package/node_modules/inflight/README.md +37 -0
- package/node_modules/inflight/inflight.js +54 -0
- package/node_modules/inflight/package.json +29 -0
- package/node_modules/inherits/LICENSE +16 -0
- package/node_modules/inherits/README.md +42 -0
- package/node_modules/inherits/inherits.js +9 -0
- package/node_modules/inherits/inherits_browser.js +27 -0
- package/node_modules/inherits/package.json +29 -0
- package/node_modules/once/LICENSE +15 -0
- package/node_modules/once/README.md +79 -0
- package/node_modules/once/once.js +42 -0
- package/node_modules/once/package.json +33 -0
- package/node_modules/path-is-absolute/index.js +20 -0
- package/node_modules/path-is-absolute/license +21 -0
- package/node_modules/path-is-absolute/package.json +43 -0
- package/node_modules/path-is-absolute/readme.md +59 -0
- package/node_modules/rimraf/CHANGELOG.md +65 -0
- package/node_modules/rimraf/LICENSE +15 -0
- package/node_modules/rimraf/README.md +101 -0
- package/node_modules/rimraf/bin.js +68 -0
- package/node_modules/rimraf/node_modules/glob/LICENSE +21 -0
- package/node_modules/rimraf/node_modules/glob/README.md +378 -0
- package/node_modules/rimraf/node_modules/glob/common.js +238 -0
- package/node_modules/rimraf/node_modules/glob/glob.js +790 -0
- package/node_modules/rimraf/node_modules/glob/package.json +55 -0
- package/node_modules/rimraf/node_modules/glob/sync.js +486 -0
- package/node_modules/rimraf/node_modules/minimatch/LICENSE +15 -0
- package/node_modules/rimraf/node_modules/minimatch/README.md +230 -0
- package/node_modules/rimraf/node_modules/minimatch/minimatch.js +947 -0
- package/node_modules/rimraf/node_modules/minimatch/package.json +33 -0
- package/node_modules/rimraf/package.json +32 -0
- package/node_modules/rimraf/rimraf.js +360 -0
- package/node_modules/stringify-package/CHANGELOG.md +16 -0
- package/node_modules/stringify-package/LICENSE +13 -0
- package/node_modules/stringify-package/README.md +55 -0
- package/node_modules/stringify-package/index.js +18 -0
- package/node_modules/stringify-package/package.json +38 -0
- package/node_modules/wrappy/LICENSE +15 -0
- package/node_modules/wrappy/README.md +36 -0
- package/node_modules/wrappy/package.json +29 -0
- package/node_modules/wrappy/wrappy.js +33 -0
- package/package.json +88 -89
- package/lib/common/definitions/byline.d.ts +0 -4
- package/lib/common/definitions/colors.d.ts +0 -24
- package/lib/common/definitions/marked.d.ts +0 -125
- package/lib/common/definitions/open.d.ts +0 -5
- package/lib/common/definitions/osenv.d.ts +0 -4
- package/lib/common/definitions/plist.d.ts +0 -7
- package/lib/common/definitions/rimraf.d.ts +0 -9
- package/lib/common/definitions/shelljs.d.ts +0 -583
- package/lib/common/definitions/simple-plist.d.ts +0 -7
- package/lib/common/definitions/xmlhttprequest.d.ts +0 -29
- package/lib/controllers/company-insights-controller.js +0 -78
- package/lib/controllers/preview-app-controller.js +0 -251
- package/lib/definitions/company-insights-controller.d.ts +0 -59
- package/lib/definitions/email-validator.d.ts +0 -8
- package/lib/definitions/libnpmconfig.d.ts +0 -3
- package/lib/definitions/npm.d.ts +0 -12
- package/lib/definitions/preview-app-livesync.d.ts +0 -116
- package/lib/services/livesync/playground/devices/preview-devices-service.js +0 -67
- package/lib/services/livesync/playground/preview-app-constants.js +0 -23
- package/lib/services/livesync/playground/preview-app-files-service.js +0 -83
- package/lib/services/livesync/playground/preview-app-log-provider.js +0 -14
- package/lib/services/livesync/playground/preview-app-plugins-service.js +0 -134
- package/lib/services/livesync/playground/preview-qr-code-service.js +0 -109
- package/lib/services/livesync/playground/preview-schema-service.js +0 -57
- package/lib/services/livesync/playground/preview-sdk-service.js +0 -112
- package/lib/services/playground-service.js +0 -65
- package/lib/xml-validator.js +0 -47
|
@@ -49,7 +49,6 @@ class ProjectNameValidator {
|
|
|
49
49
|
return isSuccessful;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
-
exports.ProjectNameValidator = ProjectNameValidator;
|
|
53
52
|
ProjectNameValidator.MAX_FILENAME_LENGTH = 30;
|
|
54
53
|
ProjectNameValidator.EMPTY_FILENAME_ERROR_MESSAGE = "Name cannot be empty.";
|
|
55
54
|
ProjectNameValidator.NOT_VALID_NAME_ERROR_MESSAGE = "Name should contain only the following symbols: A-Z, a-z, 0-9, _, ., - and space";
|
|
@@ -85,4 +84,5 @@ ProjectNameValidator.INVALID_FILENAMES = [
|
|
|
85
84
|
"LPT9",
|
|
86
85
|
];
|
|
87
86
|
ProjectNameValidator.INVALID_EXTENSIONS = [];
|
|
87
|
+
exports.ProjectNameValidator = ProjectNameValidator;
|
|
88
88
|
yok_1.injector.register("projectNameValidator", ProjectNameValidator);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getNodeWarning = exports.verifyNodeVersion = void 0;
|
|
4
|
+
const color_1 = require("../color");
|
|
4
5
|
var os = require("os");
|
|
5
6
|
var semver = require("semver");
|
|
6
7
|
var util = require("util");
|
|
@@ -23,11 +24,10 @@ function verifyNodeVersion() {
|
|
|
23
24
|
var cliName = verificationOpts.cliName;
|
|
24
25
|
var supportedVersionsRange = verificationOpts.supportedVersionsRange;
|
|
25
26
|
var nodeVer = verificationOpts.nodeVer;
|
|
26
|
-
require("colors");
|
|
27
27
|
if (versionsCausingFailure.indexOf(nodeVer) !== -1 ||
|
|
28
28
|
!semver.valid(nodeVer) ||
|
|
29
29
|
semver.lt(nodeVer, minimumRequiredVersion)) {
|
|
30
|
-
console.error(util.format("%sNode.js '%s' is not supported. To be able to work with %s CLI, install any Node.js version in the following range: %s.%s", os.EOL, nodeVer, cliName, supportedVersionsRange, os.EOL)
|
|
30
|
+
console.error(color_1.color.red.bold(util.format("%sNode.js '%s' is not supported. To be able to work with %s CLI, install any Node.js version in the following range: %s.%s", os.EOL, nodeVer, cliName, supportedVersionsRange, os.EOL)));
|
|
31
31
|
process.exit(1);
|
|
32
32
|
}
|
|
33
33
|
}
|
package/lib/config.js
CHANGED
|
@@ -21,11 +21,6 @@ class Configuration {
|
|
|
21
21
|
this.DEBUG = false;
|
|
22
22
|
this.ANDROID_DEBUG_UI = null;
|
|
23
23
|
this.USE_POD_SANDBOX = false;
|
|
24
|
-
this.UPLOAD_PLAYGROUND_FILES_ENDPOINT = null;
|
|
25
|
-
this.SHORTEN_URL_ENDPOINT = null;
|
|
26
|
-
this.INSIGHTS_URL_ENDPOINT = null;
|
|
27
|
-
this.WHOAMI_URL_ENDPOINT = null;
|
|
28
|
-
this.PREVIEW_APP_ENVIRONMENT = null;
|
|
29
24
|
this.GA_TRACKING_ID = null;
|
|
30
25
|
this.DISABLE_HOOKS = false;
|
|
31
26
|
_.extend(this, this.loadConfig("config"));
|
|
@@ -41,6 +36,9 @@ class Configuration {
|
|
|
41
36
|
exports.Configuration = Configuration;
|
|
42
37
|
yok_1.injector.register("config", Configuration);
|
|
43
38
|
class StaticConfig {
|
|
39
|
+
get PROFILE_DIR_NAME() {
|
|
40
|
+
return ".nativescript-cli";
|
|
41
|
+
}
|
|
44
42
|
constructor($injector) {
|
|
45
43
|
this.$injector = $injector;
|
|
46
44
|
this.QR_SIZE = 5;
|
|
@@ -56,9 +54,6 @@ class StaticConfig {
|
|
|
56
54
|
this._adbFilePath = null;
|
|
57
55
|
this._userAgent = null;
|
|
58
56
|
}
|
|
59
|
-
get PROFILE_DIR_NAME() {
|
|
60
|
-
return ".nativescript-cli";
|
|
61
|
-
}
|
|
62
57
|
get disableCommandHooks() {
|
|
63
58
|
return true;
|
|
64
59
|
}
|
package/lib/constants.js
CHANGED
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.APK_DIR = exports.OUTPUTS_DIR = exports.BUILD_DIR = exports.BUILD_XCCONFIG_FILE_NAME = exports.INCLUDE_GRADLE_NAME = exports.INFO_PLIST_FILE_NAME = exports.APP_GRADLE_FILE_NAME = exports.MANIFEST_FILE_NAME = exports.ANDROID_ANALYTICS_DATA_FILE = exports.ANDROID_ANALYTICS_DATA_DIR = exports.FONTS_DIR = exports.ASSETS_DIR = exports.MAIN_DIR = exports.SRC_DIR = exports.AWAIT_NOTIFICATION_TIMEOUT_SECONDS = exports.CODE_SIGN_ENTITLEMENTS = exports.LIB_DIR_NAME = exports.KARMA_CONFIG_NAME = exports.TSCCONFIG_TNS_JSON_NAME = exports.WEBPACK_CONFIG_NAME = exports.HOOKS_DIR_NAME = exports.PLATFORMS_DIR_NAME = exports.XML_FILE_EXTENSION = exports.LIVESYNC_EXCLUDED_FILE_PATTERNS = exports.TEST_RUNNER_NAME = exports.TESTING_FRAMEWORKS = exports.LIVESYNC_EXCLUDED_DIRECTORIES = exports.DEFAULT_APP_IDENTIFIER_PREFIX = exports.NODE_MODULE_CACHE_PATH_KEY_NAME = exports.ANDROID_DEVICE_APP_ROOT_TEMPLATE = exports.PACKAGE_LOCK_JSON_FILE_NAME = exports.PACKAGE_JSON_FILE_NAME = exports.SCOPED_IOS_RUNTIME_NAME = exports.SCOPED_ANDROID_RUNTIME_NAME = exports.TNS_IOS_RUNTIME_NAME = exports.TNS_ANDROID_RUNTIME_NAME = exports.UI_MOBILE_BASE_NAME = exports.TNS_CORE_MODULES_WIDGETS_NAME = exports.WEBPACK_PLUGIN_NAME = exports.SCOPED_TNS_CORE_THEME_NAME = exports.TNS_CORE_THEME_NAME = exports.SCOPED_TNS_CORE_MODULES = exports.TNS_CORE_MODULES_NAME = exports.TNS_MODULES_FOLDER_NAME = exports.NODE_MODULES_FOLDER_NAME = exports.NATIVESCRIPT_KEY_NAME = exports.NS_BASE_PODFILE = exports.PROJECT_FRAMEWORK_FOLDER_NAME = exports.APP_RESOURCES_FOLDER_NAME = exports.APP_FOLDER_NAME = void 0;
|
|
4
4
|
exports.DEBUGGER_DETACHED_EVENT_NAME = exports.DEBUGGER_ATTACHED_EVENT_NAME = exports.USER_INTERACTION_NEEDED_EVENT_NAME = exports.CONNECTION_ERROR_EVENT_NAME = exports.BUILD_OUTPUT_EVENT_NAME = exports.ProjectTypes = exports.JsFlavorName = exports.TsFlavorName = exports.SvelteFlavorName = exports.ReactFlavorName = exports.VueFlavorName = exports.NgFlavorName = exports.SVELTE_NAME = exports.REACT_NAME = exports.TYPESCRIPT_NAME = exports.JAVASCRIPT_NAME = exports.ANGULAR_NAME = exports.VUE_NAME = exports.ItunesConnectApplicationTypes = exports.androidAppResourcesFolderName = exports.iOSAppResourcesFolderName = exports.ITMSConstants = exports.ANALYTICS_LOCAL_TEMPLATE_PREFIX = exports.RESERVED_TEMPLATE_NAMES = exports.ReleaseType = exports.SaveOptions = exports.TemplatesV2PackageJsonKeysToRemove = exports.PackageJsonKeysToKeep = exports.LiveSyncTrackActionNames = exports.PackageVersion = exports.MetadataFilteringConstants = exports.IOS_WATCHAPP_EXTENSION_FOLDER = exports.IOS_WATCHAPP_FOLDER = exports.NATIVE_EXTENSION_FOLDER = exports.APPLICATION_RESPONSE_TIMEOUT_SECONDS = exports.NATIVE_SOURCE_FOLDER = exports.TNS_NATIVE_SOURCE_GROUP_NAME = exports.HASHES_FILE_NAME = exports.APKS_EXTENSION_NAME = exports.AAB_EXTENSION_NAME = exports.APK_EXTENSION_NAME = exports.DEPENDENCIES_JSON_NAME = exports.CONFIG_FILE_NAME_TS = exports.CONFIG_FILE_NAME_JS = exports.CONFIG_FILE_NAME_DISPLAY = exports.CONFIG_NS_APP_ENTRY = exports.CONFIG_NS_APP_RESOURCES_ENTRY = exports.CONFIG_NS_FILE_NAME = exports.RESOURCES_DIR = exports.BUNDLE_DIR = void 0;
|
|
5
|
-
exports.PackageManagers = exports.EMIT_APPENDER_EVENT_NAME = exports.LoggerConfigData = exports.LoggerLevel = exports.DeviceConnectionType = exports.LoggerAppenders = exports.IOSNativeTargetTypes = exports.IOSNativeTargetProductTypes = exports.IOSDeviceTargets = exports.RunOnDeviceEvents = exports.AndroidAppBundleMessages = exports.AndroidBundleValidatorMessages = exports.BundleValidatorMessages = exports.IosProjectConstants = exports.PODFILE_NAME = exports.PLUGINS_BUILD_DATA_FILENAME = exports.PLUGIN_BUILD_DATA_FILENAME = exports.AddPlaformErrors = exports.PACKAGE_PLACEHOLDER_NAME = exports.AndroidBuildDefaults = exports.Hooks = exports.
|
|
6
|
-
require("colors");
|
|
7
|
-
const preview_app_constants_1 = require("./services/livesync/playground/preview-app-constants");
|
|
5
|
+
exports.PackageManagers = exports.EMIT_APPENDER_EVENT_NAME = exports.LoggerConfigData = exports.LoggerLevel = exports.DeviceConnectionType = exports.LoggerAppenders = exports.IOSNativeTargetTypes = exports.IOSNativeTargetProductTypes = exports.IOSDeviceTargets = exports.RunOnDeviceEvents = exports.AndroidAppBundleMessages = exports.AndroidBundleValidatorMessages = exports.BundleValidatorMessages = exports.IosProjectConstants = exports.PODFILE_NAME = exports.PLUGINS_BUILD_DATA_FILENAME = exports.PLUGIN_BUILD_DATA_FILENAME = exports.AddPlaformErrors = exports.PACKAGE_PLACEHOLDER_NAME = exports.AndroidBuildDefaults = exports.Hooks = exports.XcodeDeprecationStringFormat = exports.MacOSDeprecationStringFormat = exports.MacOSVersions = exports.AssetConstants = exports.CLI_RESOURCES_DIR_NAME = exports.NATIVESCRIPT_PROPS_INTERNAL_DELIMITER = exports.AnalyticsEventLabelDelimiter = exports.DebugCommandErrors = exports.WEBPACK_COMPILATION_COMPLETE = exports.PREPARE_READY_EVENT_NAME = exports.INITIAL_SYNC_EVENT_NAME = exports.FILES_CHANGE_EVENT_NAME = exports.CACACHE_DIRECTORY_NAME = exports.ANDROID_APP_BUNDLE_SIGNING_ERROR_MESSAGE = exports.ANDROID_RELEASE_BUILD_ERROR_MESSAGE = exports.POST_INSTALL_COMMAND_NAME = exports.INSPECTOR_CACHE_DIRNAME = exports.VERSION_STRING = void 0;
|
|
8
6
|
const path_1 = require("path");
|
|
9
7
|
exports.APP_FOLDER_NAME = "app";
|
|
10
8
|
exports.APP_RESOURCES_FOLDER_NAME = "App_Resources";
|
|
@@ -77,23 +75,23 @@ exports.IOS_WATCHAPP_FOLDER = "watchapp";
|
|
|
77
75
|
exports.IOS_WATCHAPP_EXTENSION_FOLDER = "watchextension";
|
|
78
76
|
class MetadataFilteringConstants {
|
|
79
77
|
}
|
|
80
|
-
exports.MetadataFilteringConstants = MetadataFilteringConstants;
|
|
81
78
|
MetadataFilteringConstants.NATIVE_API_USAGE_FILE_NAME = "native-api-usage.json";
|
|
82
79
|
MetadataFilteringConstants.WHITELIST_FILE_NAME = "whitelist.mdg";
|
|
83
80
|
MetadataFilteringConstants.BLACKLIST_FILE_NAME = "blacklist.mdg";
|
|
81
|
+
exports.MetadataFilteringConstants = MetadataFilteringConstants;
|
|
84
82
|
class PackageVersion {
|
|
85
83
|
}
|
|
86
|
-
exports.PackageVersion = PackageVersion;
|
|
87
84
|
PackageVersion.NEXT = "next";
|
|
88
85
|
PackageVersion.LATEST = "latest";
|
|
89
86
|
PackageVersion.RC = "rc";
|
|
87
|
+
exports.PackageVersion = PackageVersion;
|
|
90
88
|
const liveSyncOperation = "LiveSync Operation";
|
|
91
89
|
class LiveSyncTrackActionNames {
|
|
92
90
|
}
|
|
93
|
-
exports.LiveSyncTrackActionNames = LiveSyncTrackActionNames;
|
|
94
91
|
LiveSyncTrackActionNames.LIVESYNC_OPERATION = liveSyncOperation;
|
|
95
92
|
LiveSyncTrackActionNames.LIVESYNC_OPERATION_BUILD = `${liveSyncOperation} - Build`;
|
|
96
93
|
LiveSyncTrackActionNames.DEVICE_INFO = `Device Info for ${liveSyncOperation}`;
|
|
94
|
+
exports.LiveSyncTrackActionNames = LiveSyncTrackActionNames;
|
|
97
95
|
exports.PackageJsonKeysToKeep = [
|
|
98
96
|
"name",
|
|
99
97
|
"main",
|
|
@@ -119,14 +117,13 @@ exports.TemplatesV2PackageJsonKeysToRemove = [
|
|
|
119
117
|
];
|
|
120
118
|
class SaveOptions {
|
|
121
119
|
}
|
|
122
|
-
exports.SaveOptions = SaveOptions;
|
|
123
120
|
SaveOptions.PRODUCTION = "save";
|
|
124
121
|
SaveOptions.DEV = "save-dev";
|
|
125
122
|
SaveOptions.OPTIONAL = "save-optional";
|
|
126
123
|
SaveOptions.EXACT = "save-exact";
|
|
124
|
+
exports.SaveOptions = SaveOptions;
|
|
127
125
|
class ReleaseType {
|
|
128
126
|
}
|
|
129
|
-
exports.ReleaseType = ReleaseType;
|
|
130
127
|
ReleaseType.MAJOR = "major";
|
|
131
128
|
ReleaseType.PREMAJOR = "premajor";
|
|
132
129
|
ReleaseType.MINOR = "minor";
|
|
@@ -134,6 +131,7 @@ ReleaseType.PREMINOR = "preminor";
|
|
|
134
131
|
ReleaseType.PATCH = "patch";
|
|
135
132
|
ReleaseType.PREPATCH = "prepatch";
|
|
136
133
|
ReleaseType.PRERELEASE = "prerelease";
|
|
134
|
+
exports.ReleaseType = ReleaseType;
|
|
137
135
|
exports.RESERVED_TEMPLATE_NAMES = {
|
|
138
136
|
default: "@nativescript/template-hello-world",
|
|
139
137
|
javascript: "@nativescript/template-hello-world",
|
|
@@ -149,7 +147,6 @@ exports.RESERVED_TEMPLATE_NAMES = {
|
|
|
149
147
|
exports.ANALYTICS_LOCAL_TEMPLATE_PREFIX = "localTemplate_";
|
|
150
148
|
class ITMSConstants {
|
|
151
149
|
}
|
|
152
|
-
exports.ITMSConstants = ITMSConstants;
|
|
153
150
|
ITMSConstants.ApplicationMetadataFile = "metadata.xml";
|
|
154
151
|
ITMSConstants.VerboseLoggingLevels = {
|
|
155
152
|
Informational: "informational",
|
|
@@ -158,6 +155,7 @@ ITMSConstants.VerboseLoggingLevels = {
|
|
|
158
155
|
ITMSConstants.iTMSExecutableName = "iTMSTransporter";
|
|
159
156
|
ITMSConstants.iTMSDirectoryName = "itms";
|
|
160
157
|
ITMSConstants.altoolExecutableName = "altool";
|
|
158
|
+
exports.ITMSConstants = ITMSConstants;
|
|
161
159
|
class ItunesConnectApplicationTypesClass {
|
|
162
160
|
constructor() {
|
|
163
161
|
this.iOS = "iOS App";
|
|
@@ -181,13 +179,13 @@ exports.TsFlavorName = "Plain TypeScript";
|
|
|
181
179
|
exports.JsFlavorName = "Plain JavaScript";
|
|
182
180
|
class ProjectTypes {
|
|
183
181
|
}
|
|
184
|
-
exports.ProjectTypes = ProjectTypes;
|
|
185
182
|
ProjectTypes.NgFlavorName = exports.NgFlavorName;
|
|
186
183
|
ProjectTypes.VueFlavorName = exports.VueFlavorName;
|
|
187
184
|
ProjectTypes.TsFlavorName = "Pure TypeScript";
|
|
188
185
|
ProjectTypes.JsFlavorName = "Pure JavaScript";
|
|
189
186
|
ProjectTypes.ReactFlavorName = "React";
|
|
190
187
|
ProjectTypes.SvelteFlavorName = "Svelte";
|
|
188
|
+
exports.ProjectTypes = ProjectTypes;
|
|
191
189
|
exports.BUILD_OUTPUT_EVENT_NAME = "buildOutput";
|
|
192
190
|
exports.CONNECTION_ERROR_EVENT_NAME = "connectionError";
|
|
193
191
|
exports.USER_INTERACTION_NEEDED_EVENT_NAME = "userInteractionNeeded";
|
|
@@ -206,16 +204,15 @@ exports.PREPARE_READY_EVENT_NAME = "prepareReadyEvent";
|
|
|
206
204
|
exports.WEBPACK_COMPILATION_COMPLETE = "webpackCompilationComplete";
|
|
207
205
|
class DebugCommandErrors {
|
|
208
206
|
}
|
|
209
|
-
exports.DebugCommandErrors = DebugCommandErrors;
|
|
210
207
|
DebugCommandErrors.UNABLE_TO_USE_FOR_DEVICE_AND_EMULATOR = "The options --for-device and --emulator cannot be used simultaneously. Please use only one of them.";
|
|
211
208
|
DebugCommandErrors.NO_DEVICES_EMULATORS_FOUND_FOR_OPTIONS = "Unable to find device or emulator for specified options.";
|
|
212
209
|
DebugCommandErrors.UNSUPPORTED_DEVICE_OS_FOR_DEBUGGING = "Unsupported device OS for debugging";
|
|
210
|
+
exports.DebugCommandErrors = DebugCommandErrors;
|
|
213
211
|
exports.AnalyticsEventLabelDelimiter = "__";
|
|
214
212
|
exports.NATIVESCRIPT_PROPS_INTERNAL_DELIMITER = "**|__**";
|
|
215
213
|
exports.CLI_RESOURCES_DIR_NAME = "resources";
|
|
216
214
|
class AssetConstants {
|
|
217
215
|
}
|
|
218
|
-
exports.AssetConstants = AssetConstants;
|
|
219
216
|
AssetConstants.iOSResourcesFileName = "Contents.json";
|
|
220
217
|
AssetConstants.iOSAssetsDirName = "Assets.xcassets";
|
|
221
218
|
AssetConstants.iOSIconsDirName = "AppIcon.appiconset";
|
|
@@ -227,67 +224,56 @@ AssetConstants.assets = "assets";
|
|
|
227
224
|
AssetConstants.sizeDelimiter = "x";
|
|
228
225
|
AssetConstants.defaultScale = 1;
|
|
229
226
|
AssetConstants.defaultOverlayImageScale = 0.8;
|
|
227
|
+
exports.AssetConstants = AssetConstants;
|
|
230
228
|
class MacOSVersions {
|
|
231
229
|
}
|
|
232
|
-
exports.MacOSVersions = MacOSVersions;
|
|
233
230
|
MacOSVersions.Sierra = "10.12";
|
|
234
231
|
MacOSVersions.HighSierra = "10.13";
|
|
235
232
|
MacOSVersions.Mojave = "10.14";
|
|
236
233
|
MacOSVersions.Catalina = "10.15";
|
|
234
|
+
exports.MacOSVersions = MacOSVersions;
|
|
237
235
|
exports.MacOSDeprecationStringFormat = "NativeScript does not support macOS %s and some functionality may not work. Please, upgrade to the latest macOS version.";
|
|
238
236
|
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.";
|
|
239
|
-
exports.PROGRESS_PRIVACY_POLICY_URL = "https://www.progress.com/legal/privacy-policy";
|
|
240
|
-
class SubscribeForNewsletterMessages {
|
|
241
|
-
}
|
|
242
|
-
exports.SubscribeForNewsletterMessages = SubscribeForNewsletterMessages;
|
|
243
|
-
SubscribeForNewsletterMessages.AgreeToReceiveEmailMsg = "I agree".green.bold +
|
|
244
|
-
" to receive email communications in the form of the NativeScript Newsletter. Consent may be withdrawn at any time.";
|
|
245
|
-
SubscribeForNewsletterMessages.ReviewPrivacyPolicyMsg = `You can review the Privacy Policy at \`${exports.PROGRESS_PRIVACY_POLICY_URL}\``;
|
|
246
|
-
SubscribeForNewsletterMessages.PromptMsg = "Input your e-mail address to agree".green +
|
|
247
|
-
" or " +
|
|
248
|
-
"leave empty to decline".red.bold +
|
|
249
|
-
":";
|
|
250
237
|
class Hooks {
|
|
251
238
|
}
|
|
252
|
-
exports.Hooks = Hooks;
|
|
253
239
|
Hooks.createProject = "createProject";
|
|
240
|
+
exports.Hooks = Hooks;
|
|
254
241
|
class AndroidBuildDefaults {
|
|
255
242
|
}
|
|
256
|
-
exports.AndroidBuildDefaults = AndroidBuildDefaults;
|
|
257
243
|
AndroidBuildDefaults.GradleVersion = "7.4.0";
|
|
258
244
|
AndroidBuildDefaults.GradleAndroidPluginVersion = "7.1.2";
|
|
245
|
+
exports.AndroidBuildDefaults = AndroidBuildDefaults;
|
|
259
246
|
exports.PACKAGE_PLACEHOLDER_NAME = "__PACKAGE__";
|
|
260
247
|
class AddPlaformErrors {
|
|
261
248
|
}
|
|
262
|
-
exports.AddPlaformErrors = AddPlaformErrors;
|
|
263
249
|
AddPlaformErrors.InvalidFrameworkPathStringFormat = "Invalid frameworkPath: %s. Please ensure the specified frameworkPath exists.";
|
|
250
|
+
exports.AddPlaformErrors = AddPlaformErrors;
|
|
264
251
|
exports.PLUGIN_BUILD_DATA_FILENAME = "plugin-data.json";
|
|
265
252
|
exports.PLUGINS_BUILD_DATA_FILENAME = ".ns-plugins-build-data.json";
|
|
266
253
|
exports.PODFILE_NAME = "Podfile";
|
|
267
254
|
class IosProjectConstants {
|
|
268
255
|
}
|
|
269
|
-
exports.IosProjectConstants = IosProjectConstants;
|
|
270
256
|
IosProjectConstants.XcodeProjExtName = ".xcodeproj";
|
|
271
257
|
IosProjectConstants.XcodeSchemeExtName = ".xcscheme";
|
|
258
|
+
exports.IosProjectConstants = IosProjectConstants;
|
|
272
259
|
class BundleValidatorMessages {
|
|
273
260
|
}
|
|
274
|
-
exports.BundleValidatorMessages = BundleValidatorMessages;
|
|
275
261
|
BundleValidatorMessages.MissingBundlePlugin = "Passing --bundle requires a bundling plugin. No bundling plugin found or the specified bundling plugin is invalid.";
|
|
262
|
+
exports.BundleValidatorMessages = BundleValidatorMessages;
|
|
276
263
|
class AndroidBundleValidatorMessages {
|
|
277
264
|
}
|
|
278
|
-
exports.AndroidBundleValidatorMessages = AndroidBundleValidatorMessages;
|
|
279
265
|
AndroidBundleValidatorMessages.AAB_NOT_SUPPORTED_BY_COMMNAND_MESSAGE = "This command does not support --aab (Android App Bundle) parameter.";
|
|
280
266
|
AndroidBundleValidatorMessages.NOT_SUPPORTED_RUNTIME_VERSION = "Android App Bundle (--aab) option requires NativeScript Android Runtime (tns-android) version %s and above.";
|
|
281
267
|
AndroidBundleValidatorMessages.NOT_SUPPORTED_ANDROID_VERSION = "Cannot use the Android App Bundle (--aab) option on device '%s' with Android '%s'. The --aab options is supported on Android '%s' and above.";
|
|
268
|
+
exports.AndroidBundleValidatorMessages = AndroidBundleValidatorMessages;
|
|
282
269
|
class AndroidAppBundleMessages {
|
|
283
270
|
}
|
|
284
|
-
exports.AndroidAppBundleMessages = AndroidAppBundleMessages;
|
|
285
271
|
AndroidAppBundleMessages.ANDROID_APP_BUNDLE_DOCS_MESSAGE = "What is Android App Bundle: https://docs.nativescript.org/tooling/publishing/android-app-bundle";
|
|
286
272
|
AndroidAppBundleMessages.ANDROID_APP_BUNDLE_PUBLISH_DOCS_MESSAGE = "How to use Android App Bundle for publishing: https://docs.nativescript.org/tooling/publishing/publishing-android-apps#android-app-bundle";
|
|
273
|
+
exports.AndroidAppBundleMessages = AndroidAppBundleMessages;
|
|
287
274
|
exports.RunOnDeviceEvents = {
|
|
288
275
|
runOnDeviceStopped: "runOnDeviceStopped",
|
|
289
276
|
runOnDeviceError: "runOnDeviceError",
|
|
290
|
-
previewAppLiveSyncError: preview_app_constants_1.PreviewAppLiveSyncEvents.PREVIEW_APP_LIVE_SYNC_ERROR,
|
|
291
277
|
runOnDeviceExecuted: "runOnDeviceExecuted",
|
|
292
278
|
runOnDeviceStarted: "runOnDeviceStarted",
|
|
293
279
|
runOnDeviceNotification: "notify",
|
|
@@ -17,10 +17,10 @@ const helpers_1 = require("../common/helpers");
|
|
|
17
17
|
const yok_1 = require("../common/yok");
|
|
18
18
|
const perf_hooks_1 = require("perf_hooks");
|
|
19
19
|
class BuildController extends events_1.EventEmitter {
|
|
20
|
-
constructor($analyticsService, $
|
|
20
|
+
constructor($analyticsService, $buildArtifactsService, $buildInfoFileService, $fs, $logger, $injector, $mobileHelper, $projectDataService, $projectChangesService, $prepareController) {
|
|
21
21
|
super();
|
|
22
22
|
this.$analyticsService = $analyticsService;
|
|
23
|
-
this.$
|
|
23
|
+
this.$buildArtifactsService = $buildArtifactsService;
|
|
24
24
|
this.$buildInfoFileService = $buildInfoFileService;
|
|
25
25
|
this.$fs = $fs;
|
|
26
26
|
this.$logger = $logger;
|
|
@@ -76,9 +76,9 @@ class BuildController extends events_1.EventEmitter {
|
|
|
76
76
|
const buildTime = (endTime - startTime) / 1000;
|
|
77
77
|
this.$logger.info("Project successfully built.");
|
|
78
78
|
this.$logger.info(`Build time: ${buildTime.toFixed(3)} s.`);
|
|
79
|
-
const result = yield this.$
|
|
79
|
+
const result = yield this.$buildArtifactsService.getLatestAppPackagePath(platformData, buildData);
|
|
80
80
|
if (buildData.copyTo) {
|
|
81
|
-
this.$
|
|
81
|
+
this.$buildArtifactsService.copyLatestAppPackage(buildData.copyTo, platformData, buildData);
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
84
|
this.$logger.info(`The build result is located at: ${result}`);
|
|
@@ -110,7 +110,7 @@ class BuildController extends events_1.EventEmitter {
|
|
|
110
110
|
return true;
|
|
111
111
|
}
|
|
112
112
|
const validBuildOutputData = platformData.getValidBuildOutputData(buildData);
|
|
113
|
-
const packages = this.$
|
|
113
|
+
const packages = this.$buildArtifactsService.getAllAppPackages(outputPath, validBuildOutputData);
|
|
114
114
|
if (packages.length === 0) {
|
|
115
115
|
return true;
|
|
116
116
|
}
|
|
@@ -24,6 +24,7 @@ const constants_1 = require("../common/constants");
|
|
|
24
24
|
const constants_2 = require("../constants");
|
|
25
25
|
const events_1 = require("events");
|
|
26
26
|
const yok_1 = require("../common/yok");
|
|
27
|
+
const color_1 = require("../color");
|
|
27
28
|
class DebugController extends events_1.EventEmitter {
|
|
28
29
|
constructor($analyticsService, $debugDataService, $devicesService, $errors, $injector, $liveSyncProcessDataService, $logger, $mobileHelper, $projectDataService) {
|
|
29
30
|
super();
|
|
@@ -163,8 +164,7 @@ class DebugController extends events_1.EventEmitter {
|
|
|
163
164
|
if (fireDebuggerAttachedEvent) {
|
|
164
165
|
this.emit(constants_2.DEBUGGER_ATTACHED_EVENT_NAME, debugInformation);
|
|
165
166
|
}
|
|
166
|
-
this.$logger.info(`To start debugging, open the following URL in Chrome:${os_1.EOL}${debugInformation.url}${os_1.EOL}`
|
|
167
|
-
.green);
|
|
167
|
+
this.$logger.info(color_1.color.green(`To start debugging, open the following URL in Chrome:${os_1.EOL}${debugInformation.url}${os_1.EOL}`));
|
|
168
168
|
}
|
|
169
169
|
return debugInformation;
|
|
170
170
|
}
|
|
@@ -13,13 +13,14 @@ exports.MigrateController = void 0;
|
|
|
13
13
|
const path = require("path");
|
|
14
14
|
const semver = require("semver");
|
|
15
15
|
const constants = require("../constants");
|
|
16
|
-
const
|
|
16
|
+
const glob_1 = require("glob");
|
|
17
17
|
const _ = require("lodash");
|
|
18
18
|
const simple_git_1 = require("simple-git");
|
|
19
19
|
const update_controller_base_1 = require("./update-controller-base");
|
|
20
20
|
const helpers_1 = require("../common/helpers");
|
|
21
21
|
const yok_1 = require("../common/yok");
|
|
22
22
|
const temp = require("temp");
|
|
23
|
+
const color_1 = require("../color");
|
|
23
24
|
class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
24
25
|
constructor($fs, $platformCommandHelper, $platformsDataService, $packageInstallationManager, $packageManager, $pacoteService, $logger, $errors, $pluginsService, $projectDataService, $projectConfigService, $options, $resources, $injector, $settingsService, $staticConfig, $terminalSpinnerService, $projectCleanupService, $projectBackupService, $childProcess) {
|
|
25
26
|
super($fs, $platformCommandHelper, $platformsDataService, $packageInstallationManager, $packageManager, $pacoteService);
|
|
@@ -283,9 +284,9 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
283
284
|
this.spinner.succeed("Cleaned old artifacts");
|
|
284
285
|
const newConfigPath = path.resolve(projectDir, "nativescript.config.ts");
|
|
285
286
|
if (!this.$fs.exists(newConfigPath)) {
|
|
286
|
-
this.spinner.info(`Migrating project to use ${"nativescript.config.ts"
|
|
287
|
+
this.spinner.info(`Migrating project to use ${color_1.color.green("nativescript.config.ts")}`);
|
|
287
288
|
yield this.migrateConfigs(projectDir);
|
|
288
|
-
this.spinner.succeed(`Project has been migrated to use ${"nativescript.config.ts"
|
|
289
|
+
this.spinner.succeed(`Project has been migrated to use ${color_1.color.green("nativescript.config.ts")}`);
|
|
289
290
|
}
|
|
290
291
|
this.spinner.info("Updating project dependencies");
|
|
291
292
|
yield this.migrateDependencies(projectData, platforms, loose);
|
|
@@ -299,13 +300,13 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
299
300
|
}
|
|
300
301
|
const tsConfigPath = path.resolve(projectDir, "tsconfig.json");
|
|
301
302
|
if (this.$fs.exists(tsConfigPath)) {
|
|
302
|
-
this.spinner.info(`Updating ${"tsconfig.json"
|
|
303
|
+
this.spinner.info(`Updating ${color_1.color.yellow("tsconfig.json")}`);
|
|
303
304
|
yield this.migrateTSConfig({
|
|
304
305
|
tsConfigPath,
|
|
305
306
|
isAngular,
|
|
306
307
|
polyfillsPath,
|
|
307
308
|
});
|
|
308
|
-
this.spinner.succeed(`Updated ${"tsconfig.json"
|
|
309
|
+
this.spinner.succeed(`Updated ${color_1.color.yellow("tsconfig.json")}`);
|
|
309
310
|
}
|
|
310
311
|
yield this.migrateWebpack5(projectDir, projectData);
|
|
311
312
|
yield this.runESLint(projectDir);
|
|
@@ -408,7 +409,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
408
409
|
this.$errors.fail("Not in Git repo.");
|
|
409
410
|
return false;
|
|
410
411
|
}
|
|
411
|
-
this.spinner.warn(`Not in Git repo, but using ${"--force"
|
|
412
|
+
this.spinner.warn(`Not in Git repo, but using ${color_1.color.red("--force")}`);
|
|
412
413
|
return true;
|
|
413
414
|
}
|
|
414
415
|
const isClean = (yield git.status()).isClean();
|
|
@@ -418,7 +419,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
418
419
|
this.$errors.fail("Git branch not clean.");
|
|
419
420
|
return false;
|
|
420
421
|
}
|
|
421
|
-
this.spinner.warn(`Git branch not clean, but using ${"--force"
|
|
422
|
+
this.spinner.warn(`Git branch not clean, but using ${color_1.color.red("--force")}`);
|
|
422
423
|
return true;
|
|
423
424
|
}
|
|
424
425
|
return true;
|
|
@@ -462,17 +463,17 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
462
463
|
handleAutoGeneratedFiles(backup, projectData) {
|
|
463
464
|
return __awaiter(this, void 0, void 0, function* () {
|
|
464
465
|
const globOptions = {
|
|
465
|
-
silent: true,
|
|
466
466
|
nocase: true,
|
|
467
467
|
matchBase: true,
|
|
468
468
|
nodir: true,
|
|
469
469
|
absolute: false,
|
|
470
470
|
cwd: projectData.appDirectoryPath,
|
|
471
|
+
withFileTypes: false,
|
|
471
472
|
};
|
|
472
|
-
const jsFiles =
|
|
473
|
+
const jsFiles = (0, glob_1.globSync)("*.@(js|ts|js.map)", globOptions);
|
|
473
474
|
const autoGeneratedJsFiles = this.getGeneratedFiles(jsFiles, [".js"], [".ts"]);
|
|
474
475
|
const autoGeneratedJsMapFiles = this.getGeneratedFiles(jsFiles, [".map"], [""]);
|
|
475
|
-
const cssFiles =
|
|
476
|
+
const cssFiles = (0, glob_1.globSync)("*.@(less|sass|scss|css)", globOptions);
|
|
476
477
|
const autoGeneratedCssFiles = this.getGeneratedFiles(cssFiles, [".css"], [".scss", ".sass", ".less"]);
|
|
477
478
|
const allGeneratedFiles = autoGeneratedJsFiles
|
|
478
479
|
.concat(autoGeneratedJsMapFiles)
|
|
@@ -594,7 +595,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
594
595
|
const version = (_a = dependency.desiredVersion) !== null && _a !== void 0 ? _a : dependency.minVersion;
|
|
595
596
|
this.$pluginsService.addToPackageJson(dependency.packageName, version, dependency.isDev, projectData.projectDir);
|
|
596
597
|
this.spinner.clear();
|
|
597
|
-
this.$logger.info(` - ${dependency.packageName
|
|
598
|
+
this.$logger.info(` - ${color_1.color.yellow(dependency.packageName)} ${color_1.color.green(version)} has been added`);
|
|
598
599
|
this.spinner.render();
|
|
599
600
|
return;
|
|
600
601
|
}
|
|
@@ -610,7 +611,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
610
611
|
const version = (_d = (_c = (_b = replacementDep.desiredVersion) !== null && _b !== void 0 ? _b : replacementDep.minVersion) !== null && _c !== void 0 ? _c : dependency.desiredVersion) !== null && _d !== void 0 ? _d : dependency.minVersion;
|
|
611
612
|
this.$pluginsService.addToPackageJson(replacementDep.packageName, version, replacementDep.isDev, projectData.projectDir);
|
|
612
613
|
this.spinner.clear();
|
|
613
|
-
this.$logger.info(` - ${dependency.packageName
|
|
614
|
+
this.$logger.info(` - ${color_1.color.yellow(dependency.packageName)} has been replaced with ${color_1.color.cyan(replacementDep.packageName)} ${color_1.color.green(version)}`);
|
|
614
615
|
this.spinner.render();
|
|
615
616
|
yield this.runMigrateActionIfAny(replacementDep, projectData, loose, true);
|
|
616
617
|
return;
|
|
@@ -622,7 +623,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
622
623
|
const version = (_e = dependency.desiredVersion) !== null && _e !== void 0 ? _e : dependency.minVersion;
|
|
623
624
|
this.$pluginsService.addToPackageJson(dependency.packageName, version, dependency.isDev, projectData.projectDir);
|
|
624
625
|
this.spinner.clear();
|
|
625
|
-
this.$logger.info(` - ${dependency.packageName
|
|
626
|
+
this.$logger.info(` - ${color_1.color.yellow(dependency.packageName)} has been updated to ${color_1.color.green(version)}`);
|
|
626
627
|
this.spinner.render();
|
|
627
628
|
});
|
|
628
629
|
}
|
|
@@ -773,7 +774,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
773
774
|
yield this.$pacoteService.extractPackage(constants.RESERVED_TEMPLATE_NAMES["angular"], tempDir);
|
|
774
775
|
this.$fs.copyFile(path.resolve(tempDir, "src/polyfills.ts"), possiblePaths[0]);
|
|
775
776
|
this.$fs.deleteDirectory(tempDir);
|
|
776
|
-
this.spinner.succeed(`Created fresh ${"polyfills.ts"
|
|
777
|
+
this.spinner.succeed(`Created fresh ${color_1.color.cyan("polyfills.ts")}`);
|
|
777
778
|
return "./" + path.relative(projectDir, possiblePaths[0]);
|
|
778
779
|
});
|
|
779
780
|
}
|
|
@@ -1015,12 +1016,12 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
1015
1016
|
if (this.$fs.exists(webpackConfigPath)) {
|
|
1016
1017
|
const webpackConfigContent = this.$fs.readText(webpackConfigPath);
|
|
1017
1018
|
if (webpackConfigContent.includes("webpack.init(")) {
|
|
1018
|
-
this.spinner.succeed(`Project already using new ${"webpack.config.js"
|
|
1019
|
+
this.spinner.succeed(`Project already using new ${color_1.color.yellow("webpack.config.js")}`);
|
|
1019
1020
|
return;
|
|
1020
1021
|
}
|
|
1021
1022
|
}
|
|
1022
1023
|
yield this.$projectCleanupService.clean(["webpack.config.js"]);
|
|
1023
|
-
this.spinner.info(`Initializing new ${"webpack.config.js"
|
|
1024
|
+
this.spinner.info(`Initializing new ${color_1.color.yellow("webpack.config.js")}`);
|
|
1024
1025
|
const { desiredVersion: webpackVersion } = this.migrationDependencies.find((dep) => dep.packageName === constants.WEBPACK_PLUGIN_NAME);
|
|
1025
1026
|
try {
|
|
1026
1027
|
const scopedWebpackPackage = `@nativescript/webpack`;
|
|
@@ -1031,10 +1032,10 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
1031
1032
|
"nativescript-webpack",
|
|
1032
1033
|
"init",
|
|
1033
1034
|
]);
|
|
1034
|
-
this.spinner.succeed(`Initialized new ${"webpack.config.js"
|
|
1035
|
+
this.spinner.succeed(`Initialized new ${color_1.color.yellow("webpack.config.js")}`);
|
|
1035
1036
|
}
|
|
1036
1037
|
catch (err) {
|
|
1037
|
-
this.spinner.fail(`Failed to initialize ${"webpack.config.js"
|
|
1038
|
+
this.spinner.fail(`Failed to initialize ${color_1.color.yellow("webpack.config.js")}`);
|
|
1038
1039
|
this.$logger.trace("Failed to initialize webpack.config.js. Error is: ", err);
|
|
1039
1040
|
this.$logger.printMarkdown(`You can try again by running \`npm install\` (or yarn, pnpm) and then \`npx @nativescript/webpack init\`.`);
|
|
1040
1041
|
}
|
|
@@ -1063,7 +1064,7 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
1063
1064
|
replacedMain = `./${path.relative(projectDir, replacedMain)}`.replace(/\\/g, "/");
|
|
1064
1065
|
packageJSON.main = replacedMain;
|
|
1065
1066
|
this.$fs.writeJson(projectData.projectFilePath, packageJSON);
|
|
1066
|
-
this.spinner.info(`Updated ${"package.json"
|
|
1067
|
+
this.spinner.info(`Updated ${color_1.color.yellow("package.json")} main field to ${color_1.color.green(replacedMain)}`);
|
|
1067
1068
|
}
|
|
1068
1069
|
else {
|
|
1069
1070
|
this.$logger.warn();
|
|
@@ -1097,7 +1098,6 @@ class MigrateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
1097
1098
|
});
|
|
1098
1099
|
}
|
|
1099
1100
|
}
|
|
1100
|
-
exports.MigrateController = MigrateController;
|
|
1101
1101
|
MigrateController.backupFolderName = ".migration_backup";
|
|
1102
1102
|
MigrateController.pathsToBackup = [
|
|
1103
1103
|
constants.LIB_DIR_NAME,
|
|
@@ -1109,4 +1109,5 @@ MigrateController.pathsToBackup = [
|
|
|
1109
1109
|
constants.KARMA_CONFIG_NAME,
|
|
1110
1110
|
constants.CONFIG_NS_FILE_NAME,
|
|
1111
1111
|
];
|
|
1112
|
+
exports.MigrateController = MigrateController;
|
|
1112
1113
|
yok_1.injector.register("migrateController", MigrateController);
|
|
@@ -15,6 +15,7 @@ const constants = require("../constants");
|
|
|
15
15
|
const update_controller_base_1 = require("./update-controller-base");
|
|
16
16
|
const yok_1 = require("../common/yok");
|
|
17
17
|
const constants_1 = require("../constants");
|
|
18
|
+
const color_1 = require("../color");
|
|
18
19
|
class UpdateController extends update_controller_base_1.UpdateControllerBase {
|
|
19
20
|
constructor($fs, $platformsDataService, $platformCommandHelper, $packageInstallationManager, $packageManager, $pluginsService, $pacoteService, $logger, $errors, $projectDataService, $projectBackupService, $projectCleanupService, $terminalSpinnerService) {
|
|
20
21
|
super($fs, $platformCommandHelper, $platformsDataService, $packageInstallationManager, $packageManager, $pacoteService);
|
|
@@ -86,8 +87,8 @@ class UpdateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
86
87
|
}
|
|
87
88
|
const desiredVersion = yield this.getVersionFromTagOrVersion(dependency.packageName, version);
|
|
88
89
|
if (typeof desiredVersion === "boolean") {
|
|
89
|
-
this.$logger.info(` - ${dependency.packageName
|
|
90
|
-
"Skipping."
|
|
90
|
+
this.$logger.info(` - ${color_1.color.yellow(dependency.packageName)} does not have version/tag ${color_1.color.green(version)}. ` +
|
|
91
|
+
color_1.color.yellow("Skipping."));
|
|
91
92
|
return;
|
|
92
93
|
}
|
|
93
94
|
const shouldUpdate = yield this.shouldUpdateDependency(projectData, dependency, desiredVersion);
|
|
@@ -104,7 +105,7 @@ class UpdateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
104
105
|
return desiredVersion;
|
|
105
106
|
})();
|
|
106
107
|
this.$pluginsService.addToPackageJson(dependency.packageName, updatedVersion, dependency.isDev, projectData.projectDir);
|
|
107
|
-
this.$logger.info(` - ${dependency.packageName
|
|
108
|
+
this.$logger.info(` - ${color_1.color.yellow(dependency.packageName)} has been updated to ${color_1.color.green(updatedVersion)}`);
|
|
108
109
|
});
|
|
109
110
|
}
|
|
110
111
|
shouldUpdateDependency(projectData, dependency, desiredVersion) {
|
|
@@ -153,7 +154,6 @@ class UpdateController extends update_controller_base_1.UpdateControllerBase {
|
|
|
153
154
|
});
|
|
154
155
|
}
|
|
155
156
|
}
|
|
156
|
-
exports.UpdateController = UpdateController;
|
|
157
157
|
UpdateController.updatableDependencies = [
|
|
158
158
|
{
|
|
159
159
|
packageName: "@nativescript/core",
|
|
@@ -184,4 +184,5 @@ UpdateController.pathsToBackup = [
|
|
|
184
184
|
constants.PACKAGE_LOCK_JSON_FILE_NAME,
|
|
185
185
|
constants.CONFIG_NS_FILE_NAME,
|
|
186
186
|
];
|
|
187
|
+
exports.UpdateController = UpdateController;
|
|
187
188
|
yok_1.injector.register("updateController", UpdateController);
|
package/lib/declarations.d.ts
CHANGED
|
@@ -506,11 +506,6 @@ interface IStaticConfig extends Config.IStaticConfig {}
|
|
|
506
506
|
interface IConfiguration extends Config.IConfig {
|
|
507
507
|
ANDROID_DEBUG_UI: string;
|
|
508
508
|
USE_POD_SANDBOX: boolean;
|
|
509
|
-
UPLOAD_PLAYGROUND_FILES_ENDPOINT: string;
|
|
510
|
-
SHORTEN_URL_ENDPOINT: string;
|
|
511
|
-
INSIGHTS_URL_ENDPOINT: string;
|
|
512
|
-
WHOAMI_URL_ENDPOINT: string;
|
|
513
|
-
PREVIEW_APP_ENVIRONMENT: string;
|
|
514
509
|
GA_TRACKING_ID: string;
|
|
515
510
|
}
|
|
516
511
|
|
|
@@ -929,25 +924,6 @@ interface IiOSSocketRequestExecutor {
|
|
|
929
924
|
): Promise<boolean>;
|
|
930
925
|
}
|
|
931
926
|
|
|
932
|
-
/**
|
|
933
|
-
* Describes validation methods for XMLs.
|
|
934
|
-
*/
|
|
935
|
-
interface IXmlValidator {
|
|
936
|
-
/**
|
|
937
|
-
* Checks the passed xml files for errors and if such exists, print them on the stdout.
|
|
938
|
-
* @param {string[]} sourceFiles Files to be checked. Only the ones that ends with .xml are filtered.
|
|
939
|
-
* @return {boolean} true in case there are no errors in specified files and false in case there's at least one error.
|
|
940
|
-
*/
|
|
941
|
-
validateXmlFiles(sourceFiles: string[]): boolean;
|
|
942
|
-
|
|
943
|
-
/**
|
|
944
|
-
* Checks the passed xml file for errors and returns them as a result.
|
|
945
|
-
* @param {string} sourceFile File to be checked.
|
|
946
|
-
* @return {string} The errors detected (as a single string) or null in case there are no errors.
|
|
947
|
-
*/
|
|
948
|
-
getXmlFileErrors(sourceFile: string): string;
|
|
949
|
-
}
|
|
950
|
-
|
|
951
927
|
/**
|
|
952
928
|
* Describes methods for working with versions.
|
|
953
929
|
*/
|
|
@@ -52,7 +52,7 @@ interface IBuildDataService {
|
|
|
52
52
|
getBuildData(projectDir: string, platform: string, data: any): IBuildData;
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
-
interface
|
|
55
|
+
interface IBuildArtifactsService {
|
|
56
56
|
getAllAppPackages(
|
|
57
57
|
buildOutputPath: string,
|
|
58
58
|
validBuildOutputData: IValidBuildOutputData
|
|
@@ -23,7 +23,6 @@ declare global {
|
|
|
23
23
|
isStopped: boolean;
|
|
24
24
|
deviceDescriptors: ILiveSyncDeviceDescriptor[];
|
|
25
25
|
currentSyncAction: Promise<any>;
|
|
26
|
-
syncToPreviewApp: boolean;
|
|
27
26
|
platforms: string[];
|
|
28
27
|
}
|
|
29
28
|
|
|
@@ -167,15 +166,6 @@ declare global {
|
|
|
167
166
|
liveSyncData: ILiveSyncInfo
|
|
168
167
|
): Promise<void>;
|
|
169
168
|
|
|
170
|
-
/**
|
|
171
|
-
* Starts LiveSync operation to Preview app.
|
|
172
|
-
* @param {IPreviewAppLiveSyncData} data Describes information about the current operation.
|
|
173
|
-
* @returns {Promise<IQrCodeImageData>} Data of the QR code that should be used to start the LiveSync operation.
|
|
174
|
-
*/
|
|
175
|
-
liveSyncToPreviewApp(
|
|
176
|
-
data: IPreviewAppLiveSyncData
|
|
177
|
-
): Promise<IQrCodeImageData>;
|
|
178
|
-
|
|
179
169
|
/**
|
|
180
170
|
* Stops LiveSync operation for specified directory.
|
|
181
171
|
* @param {string} projectDir The directory for which to stop the operation.
|
|
@@ -152,7 +152,6 @@ interface INsConfig {
|
|
|
152
152
|
appPath?: string;
|
|
153
153
|
appResourcesPath?: string;
|
|
154
154
|
shared?: boolean;
|
|
155
|
-
previewAppSchema?: string;
|
|
156
155
|
overridePods?: string;
|
|
157
156
|
webpackConfigPath?: string;
|
|
158
157
|
ios?: INsConfigIOS;
|
|
@@ -187,11 +186,6 @@ interface IProjectData extends ICreateProjectData {
|
|
|
187
186
|
*/
|
|
188
187
|
isShared: boolean;
|
|
189
188
|
|
|
190
|
-
/**
|
|
191
|
-
* Defines the schema for the preview app
|
|
192
|
-
*/
|
|
193
|
-
previewAppSchema: string;
|
|
194
|
-
|
|
195
189
|
/**
|
|
196
190
|
* Defines the path to the configuration file passed to webpack process.
|
|
197
191
|
* By default this is the webpack.config.js at the root of the application.
|