nativescript 8.7.2 → 8.8.0-alpha.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/lib/android-tools-info.js +0 -12
- package/lib/base-package-manager.js +0 -7
- package/lib/bootstrap.js +1 -5
- package/lib/bun-package-manager.js +1 -17
- package/lib/color.js +0 -3
- package/lib/commands/add-platform.js +0 -1
- package/lib/commands/apple-login.js +0 -1
- package/lib/commands/appstore-list.js +0 -1
- package/lib/commands/appstore-upload.js +0 -4
- package/lib/commands/build.js +2 -3
- package/lib/commands/clean.js +1 -22
- package/lib/commands/command-base.js +0 -1
- package/lib/commands/config.js +0 -3
- package/lib/commands/create-project.js +0 -6
- package/lib/commands/debug.js +1 -6
- package/lib/commands/deploy.js +2 -3
- package/lib/commands/extensibility/install-extension.js +0 -1
- package/lib/commands/extensibility/list-extensions.js +0 -1
- package/lib/commands/extensibility/uninstall-extension.js +0 -1
- package/lib/commands/fonts.js +0 -1
- package/lib/commands/generate-assets.js +0 -1
- package/lib/commands/generate-help.js +0 -1
- package/lib/commands/generate.js +2 -12
- package/lib/commands/info.js +0 -1
- package/lib/commands/install.js +0 -1
- package/lib/commands/list-platforms.js +0 -1
- package/lib/commands/migrate.js +0 -1
- package/lib/commands/platform-clean.js +0 -1
- package/lib/commands/plugin/add-plugin.js +0 -1
- package/lib/commands/plugin/build-plugin.js +0 -1
- package/lib/commands/plugin/create-plugin.js +0 -5
- package/lib/commands/plugin/list-plugins.js +0 -1
- package/lib/commands/plugin/remove-plugin.js +0 -2
- package/lib/commands/plugin/update-plugin.js +0 -1
- package/lib/commands/post-install.js +0 -6
- package/lib/commands/prepare.js +2 -3
- package/lib/commands/preview.js +0 -2
- package/lib/commands/remove-platform.js +0 -1
- package/lib/commands/resources/resources-update.js +0 -2
- package/lib/commands/run.js +0 -1
- package/lib/commands/setup.js +0 -1
- package/lib/commands/start.js +0 -1
- package/lib/commands/test-init.js +0 -4
- package/lib/commands/test.js +2 -9
- package/lib/commands/typings.js +1 -2
- package/lib/commands/update-platform.js +0 -5
- package/lib/commands/update.js +0 -2
- package/lib/common/bootstrap.js +0 -1
- package/lib/common/child-process.js +0 -3
- package/lib/common/codeGeneration/code-entity.js +0 -1
- package/lib/common/codeGeneration/code-printer.js +0 -1
- package/lib/common/command-params.js +0 -1
- package/lib/common/commands/analytics.js +0 -3
- package/lib/common/commands/autocompletion.js +0 -3
- package/lib/common/commands/device/device-log-stream.js +0 -1
- package/lib/common/commands/device/get-file.js +0 -2
- package/lib/common/commands/device/list-applications.js +0 -1
- package/lib/common/commands/device/list-devices.js +0 -3
- package/lib/common/commands/device/list-files.js +0 -2
- package/lib/common/commands/device/put-file.js +0 -2
- package/lib/common/commands/device/run-application.js +0 -1
- package/lib/common/commands/device/stop-application.js +0 -1
- package/lib/common/commands/device/uninstall-application.js +0 -1
- package/lib/common/commands/doctor.js +2 -3
- package/lib/common/commands/generate-messages.js +0 -1
- package/lib/common/commands/help.js +0 -1
- package/lib/common/commands/package-manager-get.js +0 -1
- package/lib/common/commands/package-manager-set.js +0 -1
- package/lib/common/commands/post-install.js +0 -1
- package/lib/common/commands/preuninstall.js +2 -11
- package/lib/common/commands/proxy/proxy-base.js +0 -4
- package/lib/common/commands/proxy/proxy-clear.js +0 -1
- package/lib/common/commands/proxy/proxy-get.js +0 -1
- package/lib/common/commands/proxy/proxy-set.js +0 -1
- package/lib/common/common-lib.js +0 -1
- package/lib/common/constants.js +0 -11
- package/lib/common/decorators.js +0 -48
- package/lib/common/dispatchers.js +1 -10
- package/lib/common/errors.js +3 -13
- package/lib/common/file-system.js +2 -13
- package/lib/common/header.js +0 -3
- package/lib/common/helpers.js +3 -89
- package/lib/common/host-info.js +0 -4
- package/lib/common/http-client.js +0 -20
- package/lib/common/logger/appenders/cli-appender.js +0 -4
- package/lib/common/logger/appenders/emit-appender.js +0 -4
- package/lib/common/logger/layouts/cli-layout.js +0 -1
- package/lib/common/logger/logger.js +0 -5
- package/lib/common/messages/messages.js +0 -6
- package/lib/common/mobile/android/android-application-manager.js +1 -20
- package/lib/common/mobile/android/android-debug-bridge-result-handler.js +0 -1
- package/lib/common/mobile/android/android-debug-bridge.js +0 -6
- package/lib/common/mobile/android/android-device-file-system.js +0 -4
- package/lib/common/mobile/android/android-device-hash-service.js +0 -3
- package/lib/common/mobile/android/android-device.js +0 -8
- package/lib/common/mobile/android/android-emulator-services.js +1 -2
- package/lib/common/mobile/android/android-ini-file-parser.js +0 -9
- package/lib/common/mobile/android/android-log-filter.js +0 -4
- package/lib/common/mobile/android/android-virtual-device-service.js +0 -26
- package/lib/common/mobile/android/device-android-debug-bridge.js +0 -1
- package/lib/common/mobile/android/genymotion/genymotion-service.js +0 -5
- package/lib/common/mobile/android/genymotion/virtualbox-service.js +0 -11
- package/lib/common/mobile/android/logcat-helper.js +1 -20
- package/lib/common/mobile/application-manager-base.js +0 -6
- package/lib/common/mobile/device-emitter.js +0 -4
- package/lib/common/mobile/device-log-emitter.js +0 -1
- package/lib/common/mobile/device-log-provider-base.js +0 -1
- package/lib/common/mobile/device-log-provider.js +0 -23
- package/lib/common/mobile/device-platforms-constants.js +0 -1
- package/lib/common/mobile/emulator-helper.js +0 -3
- package/lib/common/mobile/ios/device/ios-application-manager.js +0 -3
- package/lib/common/mobile/ios/device/ios-device-file-system.js +0 -1
- package/lib/common/mobile/ios/device/ios-device-operations.js +0 -4
- package/lib/common/mobile/ios/device/ios-device.js +0 -4
- package/lib/common/mobile/ios/ios-device-base.js +0 -1
- package/lib/common/mobile/ios/ios-device-product-name-mapper.js +0 -2
- package/lib/common/mobile/ios/ios-log-filter.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-emulator-services.js +0 -4
- package/lib/common/mobile/ios/simulator/ios-sim-resolver.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-application-manager.js +0 -6
- package/lib/common/mobile/ios/simulator/ios-simulator-device.js +0 -5
- package/lib/common/mobile/ios/simulator/ios-simulator-file-system.js +0 -1
- package/lib/common/mobile/ios/simulator/ios-simulator-log-provider.js +0 -1
- package/lib/common/mobile/local-to-device-path-data-factory.js +0 -1
- package/lib/common/mobile/log-filter.js +0 -2
- package/lib/common/mobile/logging-levels.js +0 -1
- package/lib/common/mobile/mobile-core/android-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/android-emulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-core/android-process-service.js +0 -32
- package/lib/common/mobile/mobile-core/device-discovery.js +0 -1
- package/lib/common/mobile/mobile-core/devices-service.js +0 -69
- package/lib/common/mobile/mobile-core/ios-device-discovery.js +0 -2
- package/lib/common/mobile/mobile-core/ios-simulator-discovery.js +0 -3
- package/lib/common/mobile/mobile-helper.js +0 -1
- package/lib/common/mobile/wp8/wp8-emulator-services.js +0 -1
- package/lib/common/opener.js +0 -1
- package/lib/common/os-info.js +0 -1
- package/lib/common/plist-parser.js +0 -1
- package/lib/common/project-helper.js +0 -1
- package/lib/common/prompter.js +1 -9
- package/lib/common/queue.js +0 -1
- package/lib/common/resource-loader.js +0 -1
- package/lib/common/services/auto-completion-service.js +1 -13
- package/lib/common/services/cancellation.js +1 -2
- package/lib/common/services/commands-service.js +6 -17
- package/lib/common/services/help-service.js +3 -11
- package/lib/common/services/hooks-service.js +0 -13
- package/lib/common/services/ios-notification-service.js +0 -1
- package/lib/common/services/json-file-settings-service.js +0 -6
- package/lib/common/services/lock-service.js +0 -6
- package/lib/common/services/message-contract-generator.js +0 -1
- package/lib/common/services/messages-service.js +0 -1
- package/lib/common/services/micro-templating-service.js +0 -6
- package/lib/common/services/net-service.js +0 -3
- package/lib/common/services/project-files-manager.js +0 -5
- package/lib/common/services/project-files-provider-base.js +0 -1
- package/lib/common/services/proxy-service.js +0 -1
- package/lib/common/services/qr.js +0 -1
- package/lib/common/services/settings-service.js +0 -1
- package/lib/common/services/xcode-select-service.js +0 -1
- package/lib/common/utils.js +0 -1
- package/lib/common/validators/project-name-validator.js +0 -1
- package/lib/common/validators/validation-result.js +0 -1
- package/lib/common/verify-node-version.js +1 -8
- package/lib/common/yok.js +11 -32
- package/lib/config.js +1 -22
- package/lib/constants-provider.js +0 -1
- package/lib/constants.js +0 -53
- package/lib/controllers/build-controller.js +3 -4
- package/lib/controllers/debug-controller.js +3 -8
- package/lib/controllers/deploy-controller.js +0 -1
- package/lib/controllers/migrate-controller.js +3 -91
- package/lib/controllers/platform-controller.js +1 -9
- package/lib/controllers/prepare-controller.js +4 -14
- package/lib/controllers/run-controller.js +1 -17
- package/lib/controllers/update-controller-base.js +0 -1
- package/lib/controllers/update-controller.js +0 -11
- package/lib/data/build-data.js +0 -1
- package/lib/data/controller-data-base.js +0 -1
- package/lib/data/debug-data.js +0 -1
- package/lib/data/platform-data.js +0 -1
- package/lib/data/prepare-data.js +0 -1
- package/lib/data/run-data.js +0 -1
- package/lib/detached-processes/cleanup-js-subprocess.js +2 -8
- package/lib/detached-processes/cleanup-process.js +14 -18
- package/lib/detached-processes/file-log-service.js +1 -2
- package/lib/device-path-provider.js +0 -1
- package/lib/device-sockets/ios/app-debug-socket-proxy-factory.js +0 -7
- package/lib/device-sockets/ios/notification.js +0 -3
- package/lib/device-sockets/ios/socket-request-executor.js +0 -3
- package/lib/helpers/android-bundle-validator-helper.js +1 -2
- package/lib/helpers/deploy-command-helper.js +0 -1
- package/lib/helpers/key-command-helper.js +2 -4
- package/lib/helpers/livesync-command-helper.js +1 -4
- package/lib/helpers/network-connectivity-validator.js +0 -1
- package/lib/helpers/options-track-helper.js +2 -3
- package/lib/helpers/package-path-helper.js +0 -1
- package/lib/helpers/platform-command-helper.js +2 -7
- package/lib/helpers/version-validator-helper.js +0 -1
- package/lib/key-commands/bootstrap.js +2 -3
- package/lib/key-commands/index.js +4 -5
- package/lib/nativescript-cli-lib-bootstrap.js +0 -4
- package/lib/nativescript-cli-lib.js +0 -1
- package/lib/nativescript-cli.js +1 -10
- package/lib/node/pbxproj-dom-xcode.js +0 -1
- package/lib/node/xcode.js +0 -1
- package/lib/node-package-manager.js +1 -11
- package/lib/options.js +116 -141
- package/lib/package-installation-manager.js +1 -8
- package/lib/package-manager.js +0 -2
- package/lib/platform-command-param.js +0 -1
- package/lib/pnpm-package-manager.js +1 -4
- package/lib/project-data.js +0 -12
- package/lib/providers/project-files-provider.js +0 -1
- package/lib/resolvers/livesync-service-resolver.js +0 -1
- package/lib/services/analytics/analytics-broker-process.js +6 -10
- package/lib/services/analytics/analytics-broker.js +1 -2
- package/lib/services/analytics/analytics-service.js +25 -29
- package/lib/services/analytics/google-analytics-provider.js +12 -13
- package/lib/services/analytics-settings-service.js +0 -5
- package/lib/services/android/android-bundle-tool-service.js +0 -1
- package/lib/services/android/gradle-build-args-service.js +2 -9
- package/lib/services/android/gradle-build-service.js +0 -1
- package/lib/services/android/gradle-command-service.js +0 -1
- package/lib/services/android-device-debug-service.js +0 -6
- package/lib/services/android-plugin-build-service.js +12 -43
- package/lib/services/android-project-service.js +4 -71
- package/lib/services/android-resources-migration-service.js +0 -7
- package/lib/services/apple-portal/apple-portal-application-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-cookie-service.js +0 -1
- package/lib/services/apple-portal/apple-portal-session-service.js +4 -6
- package/lib/services/assets-generation/assets-generation-service.js +5 -16
- package/lib/services/build-artifacts-service.js +1 -2
- package/lib/services/build-data-service.js +0 -1
- package/lib/services/build-info-file-service.js +0 -1
- package/lib/services/cleanup-service.js +9 -13
- package/lib/services/cocoapods-platform-manager.js +0 -9
- package/lib/services/cocoapods-service.js +1 -21
- package/lib/services/debug-data-service.js +0 -1
- package/lib/services/debug-service-base.js +0 -7
- package/lib/services/device/device-install-app-service.js +1 -2
- package/lib/services/doctor-service.js +6 -21
- package/lib/services/extensibility-service.js +0 -8
- package/lib/services/files-hash-service.js +0 -1
- package/lib/services/hmr-status-service.js +0 -2
- package/lib/services/info-service.js +0 -1
- package/lib/services/initialize-service.js +1 -5
- package/lib/services/ios/export-options-plist-service.js +0 -4
- package/lib/services/ios/ios-signing-service.js +0 -4
- package/lib/services/ios/spm-service.js +0 -9
- package/lib/services/ios/xcodebuild-args-service.js +0 -9
- package/lib/services/ios/xcodebuild-command-service.js +0 -1
- package/lib/services/ios/xcodebuild-service.js +0 -1
- package/lib/services/ios-debugger-port-service.js +0 -1
- package/lib/services/ios-device-debug-service.js +0 -1
- package/lib/services/ios-entitlements-service.js +0 -1
- package/lib/services/ios-extensions-service.js +0 -1
- package/lib/services/ios-log-filter.js +0 -20
- package/lib/services/ios-native-target-service.js +4 -6
- package/lib/services/ios-project-service.js +1 -23
- package/lib/services/ios-provision-service.js +0 -3
- package/lib/services/ios-watch-app-service.js +0 -1
- package/lib/services/ip-service.js +0 -2
- package/lib/services/itmstransporter-service.js +0 -1
- package/lib/services/karma-execution.js +0 -2
- package/lib/services/livesync/android-device-livesync-service-base.js +0 -1
- package/lib/services/livesync/android-device-livesync-service.js +0 -2
- package/lib/services/livesync/android-device-livesync-sockets-service.js +0 -3
- package/lib/services/livesync/android-livesync-service.js +0 -1
- package/lib/services/livesync/android-livesync-tool.js +0 -4
- package/lib/services/livesync/device-livesync-service-base.js +0 -2
- package/lib/services/livesync/ios-device-livesync-service.js +0 -7
- package/lib/services/livesync/ios-livesync-service.js +0 -2
- package/lib/services/livesync/livesync-socket.js +0 -1
- package/lib/services/livesync/platform-livesync-service-base.js +0 -5
- package/lib/services/livesync-process-data-service.js +0 -1
- package/lib/services/log-parser-service.js +0 -1
- package/lib/services/log-source-map-service.js +0 -15
- package/lib/services/marking-mode-service.js +5 -8
- package/lib/services/metadata-filtering-service.js +0 -1
- package/lib/services/npm-config-service.js +0 -4
- package/lib/services/pacote-service.js +0 -7
- package/lib/services/performance-service.js +1 -3
- package/lib/services/platform/add-platform-service.js +2 -47
- package/lib/services/platform/platform-validation-service.js +0 -1
- package/lib/services/platform/prepare-native-platform-service.js +2 -5
- package/lib/services/platform-environment-requirements.js +3 -8
- package/lib/services/platform-project-service-base.js +0 -1
- package/lib/services/platforms-data-service.js +0 -1
- package/lib/services/plugins-service.js +2 -18
- package/lib/services/prepare-data-service.js +0 -1
- package/lib/services/project-backup-service.js +0 -4
- package/lib/services/project-changes-service.js +3 -12
- package/lib/services/project-cleanup-service.js +0 -2
- package/lib/services/project-config-service.js +1 -18
- package/lib/services/project-data-service.js +7 -36
- package/lib/services/project-name-service.js +0 -1
- package/lib/services/project-service.js +0 -10
- package/lib/services/project-templates-service.js +2 -3
- package/lib/services/qr-code-terminal-service.js +0 -1
- package/lib/services/require-service.js +0 -1
- package/lib/services/start-service.js +0 -1
- package/lib/services/temp-service.js +0 -1
- package/lib/services/terminal-spinner-service.js +0 -2
- package/lib/services/test-execution-service.js +2 -9
- package/lib/services/test-initialization-service.js +0 -4
- package/lib/services/timeline-profiler-service.js +0 -1
- package/lib/services/user-settings-service.js +0 -1
- package/lib/services/versions-service.js +4 -6
- package/lib/services/watch-ignore-list-service.js +0 -1
- package/lib/services/webpack/webpack-compiler-service.js +1 -42
- package/lib/services/xcconfig-service.js +0 -2
- package/lib/services/xcproj-service.js +0 -1
- package/lib/shared-event-bus.js +0 -6
- package/lib/sys-info.js +1 -2
- package/lib/tools/config-manipulation/config-transformer.js +0 -12
- package/lib/tools/node-modules/node-modules-builder.js +0 -1
- package/lib/tools/node-modules/node-modules-dependencies-builder.js +0 -6
- package/lib/yarn-package-manager.js +0 -1
- package/lib/yarn2-package-manager.js +0 -3
- package/package.json +1 -1
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-plugin/build.gradle +21 -15
- package/node_modules/@npmcli/move-file/node_modules/mkdirp/CHANGELOG.md +0 -15
- package/node_modules/rimraf/CHANGELOG.md +0 -65
- package/node_modules/stringify-package/CHANGELOG.md +0 -16
|
@@ -64,7 +64,6 @@ class PluginsService {
|
|
|
64
64
|
const realNpmPackageJson = this.$fs.readJson(pathToRealNpmPackageJson);
|
|
65
65
|
if (realNpmPackageJson.nativescript) {
|
|
66
66
|
const pluginData = this.convertToPluginData(realNpmPackageJson, projectData.projectDir);
|
|
67
|
-
// Validate
|
|
68
67
|
const action = (pluginDestinationPath, platform, platformData) => __awaiter(this, void 0, void 0, function* () {
|
|
69
68
|
this.isPluginDataValidForPlatform(pluginData, platform, projectData);
|
|
70
69
|
});
|
|
@@ -153,9 +152,6 @@ class PluginsService {
|
|
|
153
152
|
paths: [projectData.projectDir],
|
|
154
153
|
});
|
|
155
154
|
if (pathToPackage) {
|
|
156
|
-
// return false if the dependency is installed - we'll filter out boolean values
|
|
157
|
-
// and end up with an array of dep names that are not installed if we end up
|
|
158
|
-
// inside the catch block.
|
|
159
155
|
return false;
|
|
160
156
|
}
|
|
161
157
|
this.$logger.trace(`${dep} is not installed, or couldn't be found`);
|
|
@@ -191,9 +187,6 @@ class PluginsService {
|
|
|
191
187
|
return productionPlugins
|
|
192
188
|
.map((plugin) => this.convertToPluginData(plugin, projectData.projectDir))
|
|
193
189
|
.filter((item, idx, self) => {
|
|
194
|
-
// Filter out duplicates to speed up build times by not building the same dependency
|
|
195
|
-
// multiple times. One possible downside is that if there are different versions
|
|
196
|
-
// of the same native dependency only the first one in the array will be built
|
|
197
190
|
return self.findIndex((p) => p.name === item.name) === idx;
|
|
198
191
|
});
|
|
199
192
|
}
|
|
@@ -225,11 +218,9 @@ class PluginsService {
|
|
|
225
218
|
const dependenciesGroupedByName = _.groupBy(productionDependencies, (p) => p.name);
|
|
226
219
|
_.each(dependenciesGroupedByName, (dependencyOccurrences, dependencyName) => {
|
|
227
220
|
if (dependencyOccurrences.length > 1) {
|
|
228
|
-
// the dependency exists multiple times in node_modules
|
|
229
221
|
const dependencyOccurrencesGroupedByVersion = _.groupBy(dependencyOccurrences, (g) => g.version);
|
|
230
222
|
const versions = _.keys(dependencyOccurrencesGroupedByVersion);
|
|
231
223
|
if (versions.length === 1) {
|
|
232
|
-
// all dependencies with this name have the same version
|
|
233
224
|
this.$logger.trace(`Detected same versions (${_.first(versions)}) of the ${dependencyName} installed at locations: ${_.map(dependencyOccurrences, (d) => d.directory).join(", ")}`);
|
|
234
225
|
}
|
|
235
226
|
else {
|
|
@@ -255,11 +246,9 @@ class PluginsService {
|
|
|
255
246
|
const dependenciesGroupedByFrameworkName = _.groupBy(dependenciesWithFrameworks, (d) => d.frameworkName);
|
|
256
247
|
_.each(dependenciesGroupedByFrameworkName, (dependencyOccurrences, frameworkName) => {
|
|
257
248
|
if (dependencyOccurrences.length > 1) {
|
|
258
|
-
// A framework exists multiple times in node_modules
|
|
259
249
|
const groupedByName = _.groupBy(dependencyOccurrences, (d) => d.name);
|
|
260
250
|
const pluginsNames = _.keys(groupedByName);
|
|
261
251
|
if (pluginsNames.length > 1) {
|
|
262
|
-
// fail - the same framework is installed by different dependencies.
|
|
263
252
|
const locations = dependencyOccurrences.map((d) => d.frameworkLocation);
|
|
264
253
|
let msg = `Detected the framework ${frameworkName} is installed from multiple plugins at locations:\n${locations.join("\n")}\n`;
|
|
265
254
|
msg += this.getHelpMessage(projectDir);
|
|
@@ -269,7 +258,6 @@ class PluginsService {
|
|
|
269
258
|
const dependencyOccurrencesGroupedByVersion = _.groupBy(dependencyOccurrences, (g) => g.version);
|
|
270
259
|
const versions = _.keys(dependencyOccurrencesGroupedByVersion);
|
|
271
260
|
if (versions.length === 1) {
|
|
272
|
-
// all dependencies with this name have the same version
|
|
273
261
|
this.$logger.warn(`Detected the framework ${frameworkName} is installed multiple times from the same versions of plugin (${_.first(versions)}) at locations: ${_.map(dependencyOccurrences, (d) => d.directory).join(", ")}`);
|
|
274
262
|
const selectedPackage = _.minBy(dependencyOccurrences, (d) => d.depth);
|
|
275
263
|
this.$logger.info(color_1.color.green(`CLI will use only the native code from '${selectedPackage.directory}'.`));
|
|
@@ -321,7 +309,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
321
309
|
pluginData.isPlugin = !!cacheData.nativescript;
|
|
322
310
|
pluginData.pluginPlatformsFolderPath = (platform) => {
|
|
323
311
|
if (this.$mobileHelper.isvisionOSPlatform(platform)) {
|
|
324
|
-
platform = "ios"
|
|
312
|
+
platform = "ios";
|
|
325
313
|
}
|
|
326
314
|
return path.join(pluginData.fullPath, "platforms", platform.toLowerCase());
|
|
327
315
|
};
|
|
@@ -378,7 +366,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
378
366
|
return _.keys(require(packageJsonFilePath).dependencies);
|
|
379
367
|
}
|
|
380
368
|
getNodeModuleData(module, projectDir) {
|
|
381
|
-
// module can be modulePath or moduleName
|
|
382
369
|
if (!this.$fs.exists(module) || path.basename(module) !== "package.json") {
|
|
383
370
|
module = this.getPackageJsonFilePathForModule(module, projectDir);
|
|
384
371
|
}
|
|
@@ -416,7 +403,7 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
416
403
|
});
|
|
417
404
|
}
|
|
418
405
|
parseNpmCommandResult(npmCommandResult) {
|
|
419
|
-
return npmCommandResult.split("@")[0];
|
|
406
|
+
return npmCommandResult.split("@")[0];
|
|
420
407
|
}
|
|
421
408
|
executeForAllInstalledPlatforms(action, projectData) {
|
|
422
409
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -433,8 +420,6 @@ This framework comes from ${dependencyName} plugin, which is installed multiple
|
|
|
433
420
|
}
|
|
434
421
|
getInstalledFrameworkVersion(platform, projectData) {
|
|
435
422
|
const runtimePackage = this.$projectDataService.getRuntimePackage(projectData.projectDir, platform);
|
|
436
|
-
// const platformData = this.$platformsDataService.getPlatformData(platform, projectData);
|
|
437
|
-
// const frameworkData = this.$projectDataService.getNSValue(projectData.projectDir, platformData.frameworkPackageName);
|
|
438
423
|
return runtimePackage.version;
|
|
439
424
|
}
|
|
440
425
|
isPluginDataValidForPlatform(pluginData, platform, projectData) {
|
|
@@ -490,4 +475,3 @@ PluginsService.LOCK_FILES = [
|
|
|
490
475
|
];
|
|
491
476
|
exports.PluginsService = PluginsService;
|
|
492
477
|
yok_1.injector.register("pluginsService", PluginsService);
|
|
493
|
-
//# sourceMappingURL=plugins-service.js.map
|
|
@@ -46,7 +46,6 @@ ProjectBackupService.Backup = class Backup {
|
|
|
46
46
|
backedUpPaths.push(pathToBackup);
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
|
-
// create backup.json
|
|
50
49
|
this.$super.$fs.writeJson(path.resolve(this.backupDir, "_backup.json"), {
|
|
51
50
|
name: this.name,
|
|
52
51
|
paths: backedUpPaths,
|
|
@@ -67,7 +66,6 @@ ProjectBackupService.Backup = class Backup {
|
|
|
67
66
|
}
|
|
68
67
|
}
|
|
69
68
|
this.$super.$logger.trace(backupData);
|
|
70
|
-
// restore files
|
|
71
69
|
return this;
|
|
72
70
|
}
|
|
73
71
|
isUpToDate() {
|
|
@@ -77,7 +75,6 @@ ProjectBackupService.Backup = class Backup {
|
|
|
77
75
|
}
|
|
78
76
|
for (const pathToBackup of backupData.paths) {
|
|
79
77
|
const sourcePath = path.resolve(this.backupDir, pathToBackup);
|
|
80
|
-
// if any of the files don't exist the backup is not up-to-date
|
|
81
78
|
if (!this.$super.$fs.exists(sourcePath)) {
|
|
82
79
|
return false;
|
|
83
80
|
}
|
|
@@ -115,4 +112,3 @@ ProjectBackupService.Backup = class Backup {
|
|
|
115
112
|
};
|
|
116
113
|
exports.ProjectBackupService = ProjectBackupService;
|
|
117
114
|
yok_1.injector.register("projectBackupService", ProjectBackupService);
|
|
118
|
-
//# sourceMappingURL=project-backup-service.js.map
|
|
@@ -73,7 +73,6 @@ class ProjectChangesService {
|
|
|
73
73
|
this._prepareInfo.projectFileHash = this.getProjectFileStrippedHash(projectData.projectDir, platformData);
|
|
74
74
|
this._changesInfo.nativeChanged = this.isProjectFileChanged(projectData.projectDir, platformData);
|
|
75
75
|
}
|
|
76
|
-
// If this causes too much rebuilds of the plugins or uncecessary builds for Android, move overrideCocoapods to prepareInfo.
|
|
77
76
|
this._changesInfo.nsConfigChanged = this.filesChanged([
|
|
78
77
|
path.join(projectData.projectDir, constants_1.CONFIG_FILE_NAME_JS),
|
|
79
78
|
path.join(projectData.projectDir, constants_1.CONFIG_FILE_NAME_TS),
|
|
@@ -157,7 +156,7 @@ class ProjectChangesService {
|
|
|
157
156
|
this._prepareInfo = this._prepareInfo || this.getPrepareInfo(platformData);
|
|
158
157
|
if (this._prepareInfo &&
|
|
159
158
|
addedPlatform.nativePlatformStatus ===
|
|
160
|
-
"3"
|
|
159
|
+
"3") {
|
|
161
160
|
this._prepareInfo.nativePlatformStatus =
|
|
162
161
|
addedPlatform.nativePlatformStatus;
|
|
163
162
|
}
|
|
@@ -183,8 +182,8 @@ class ProjectChangesService {
|
|
|
183
182
|
return false;
|
|
184
183
|
}
|
|
185
184
|
const nativePlatformStatus = !prepareData.nativePrepare || !prepareData.nativePrepare.skipNativePrepare
|
|
186
|
-
? "2"
|
|
187
|
-
: "1"
|
|
185
|
+
? "2"
|
|
186
|
+
: "1";
|
|
188
187
|
this._prepareInfo = {
|
|
189
188
|
time: "",
|
|
190
189
|
nativePlatformStatus,
|
|
@@ -208,13 +207,6 @@ class ProjectChangesService {
|
|
|
208
207
|
const projectFileContents = this.$fs.readJson(projectFilePath);
|
|
209
208
|
const relevantProperties = ["dependencies"];
|
|
210
209
|
const projectFileStrippedContents = _.pick(projectFileContents, relevantProperties);
|
|
211
|
-
// _(this.$devicePlatformsConstants)
|
|
212
|
-
// .keys()
|
|
213
|
-
// .map(k => k.toLowerCase())
|
|
214
|
-
// .difference([platformData.platformNameLowerCase])
|
|
215
|
-
// .each(otherPlatform => {
|
|
216
|
-
// delete projectFileContents.nativescript[`tns-${otherPlatform}`];
|
|
217
|
-
// });
|
|
218
210
|
return (0, helpers_1.getHash)(JSON.stringify(projectFileStrippedContents));
|
|
219
211
|
}
|
|
220
212
|
isProjectFileChanged(projectDir, platformData) {
|
|
@@ -280,4 +272,3 @@ __decorate([
|
|
|
280
272
|
], ProjectChangesService.prototype, "checkForChanges", null);
|
|
281
273
|
exports.ProjectChangesService = ProjectChangesService;
|
|
282
274
|
yok_1.injector.register("projectChangesService", ProjectChangesService);
|
|
283
|
-
//# sourceMappingURL=project-changes-service.js.map
|
|
@@ -38,7 +38,6 @@ class ProjectCleanupService {
|
|
|
38
38
|
success = success && cleanRes.ok;
|
|
39
39
|
}
|
|
40
40
|
if (!(options === null || options === void 0 ? void 0 : options.silent)) {
|
|
41
|
-
// required to print an empty line for the spinner to not replace the last status... (probably a bug in the spinners)
|
|
42
41
|
console.log();
|
|
43
42
|
}
|
|
44
43
|
if (stats) {
|
|
@@ -101,4 +100,3 @@ class ProjectCleanupService {
|
|
|
101
100
|
}
|
|
102
101
|
exports.ProjectCleanupService = ProjectCleanupService;
|
|
103
102
|
yok_1.injector.register("projectCleanupService", ProjectCleanupService);
|
|
104
|
-
//# sourceMappingURL=project-cleanup-service.js.map
|
|
@@ -44,7 +44,6 @@ class ProjectConfigService {
|
|
|
44
44
|
return (this.forceUsingLegacyConfig = force);
|
|
45
45
|
}
|
|
46
46
|
requireFromString(src, filename) {
|
|
47
|
-
// @ts-ignore
|
|
48
47
|
const m = new module.constructor();
|
|
49
48
|
m.paths = module.paths;
|
|
50
49
|
m._compile(src, filename);
|
|
@@ -67,7 +66,6 @@ export default {
|
|
|
67
66
|
} as NativeScriptConfig;`.trim();
|
|
68
67
|
}
|
|
69
68
|
warnUsingLegacyNSConfig() {
|
|
70
|
-
// todo: remove hack
|
|
71
69
|
const isMigrate = _.get(this.$options, "argv._[0]") === "migrate";
|
|
72
70
|
if (isMigrate) {
|
|
73
71
|
return;
|
|
@@ -76,7 +74,6 @@ export default {
|
|
|
76
74
|
}
|
|
77
75
|
detectProjectConfigs(projectDir) {
|
|
78
76
|
var _a;
|
|
79
|
-
// allow overriding config name with env variable or --config (or -c)
|
|
80
77
|
let configName = (_a = process.env.NATIVESCRIPT_CONFIG_NAME) !== null && _a !== void 0 ? _a : this.$options.config;
|
|
81
78
|
if (configName === "false") {
|
|
82
79
|
configName = false;
|
|
@@ -106,7 +103,6 @@ export default {
|
|
|
106
103
|
const existingConfigs = possibleConfigPaths.filter((path) => {
|
|
107
104
|
return this.$fs.exists(path);
|
|
108
105
|
});
|
|
109
|
-
// push the first possible config into the "existing" list
|
|
110
106
|
const hasExistingConfig = !!existingConfigs.length;
|
|
111
107
|
if (!hasExistingConfig) {
|
|
112
108
|
this.$logger.trace(`No config file found - falling back to ${possibleConfigPaths[0]}.`);
|
|
@@ -205,11 +201,9 @@ export default {
|
|
|
205
201
|
this.$logger.error(`Failed to update config.` + error);
|
|
206
202
|
}
|
|
207
203
|
finally {
|
|
208
|
-
// verify config is updated correctly
|
|
209
204
|
if (this.getValue(key) !== value) {
|
|
210
205
|
this.$logger.error(`${os_1.EOL}Failed to update ${hasTSConfig ? constants_1.CONFIG_FILE_NAME_TS : constants_1.CONFIG_FILE_NAME_JS}.${os_1.EOL}`);
|
|
211
206
|
this.$logger.printMarkdown(`Please manually update \`${hasTSConfig ? constants_1.CONFIG_FILE_NAME_TS : constants_1.CONFIG_FILE_NAME_JS}\` and set \`${key}\` to \`${value}\`.${os_1.EOL}`);
|
|
212
|
-
// restore original content
|
|
213
207
|
this.$fs.writeFile(configFilePath, configContent);
|
|
214
208
|
return false;
|
|
215
209
|
}
|
|
@@ -239,11 +233,9 @@ export default {
|
|
|
239
233
|
? this.$fs.readJson(info.NSConfigPath)
|
|
240
234
|
: {};
|
|
241
235
|
try {
|
|
242
|
-
// injecting here to avoid circular dependency
|
|
243
236
|
const projectData = this.$injector.resolve("projectData");
|
|
244
237
|
const embeddedPackageJsonPath = path.resolve(this.projectHelper.projectDir, projectData.getAppDirectoryRelativePath(), constants.PACKAGE_JSON_FILE_NAME);
|
|
245
238
|
const embeddedPackageJson = this.$fs.readJson(embeddedPackageJsonPath);
|
|
246
|
-
// filter only the supported keys
|
|
247
239
|
additionalData.push(_.pick(embeddedPackageJson, [
|
|
248
240
|
"android",
|
|
249
241
|
"ios",
|
|
@@ -255,11 +247,9 @@ export default {
|
|
|
255
247
|
}
|
|
256
248
|
catch (err) {
|
|
257
249
|
this.$logger.trace("failed to add embedded package.json data to config", err);
|
|
258
|
-
// ignore if the file doesn't exist
|
|
259
250
|
}
|
|
260
251
|
try {
|
|
261
252
|
const packageJson = this.$fs.readJson(path.join(this.projectHelper.projectDir, "package.json"));
|
|
262
|
-
// add app id to additionalData for backwards compatibility
|
|
263
253
|
if (!NSConfig.id &&
|
|
264
254
|
packageJson &&
|
|
265
255
|
packageJson.nativescript &&
|
|
@@ -283,10 +273,8 @@ export default {
|
|
|
283
273
|
}
|
|
284
274
|
catch (err) {
|
|
285
275
|
this.$logger.trace("failed to read package.json data for config", err);
|
|
286
|
-
// ignore if the file doesn't exist
|
|
287
276
|
}
|
|
288
277
|
return _.defaultsDeep({}, ...additionalData, NSConfig);
|
|
289
|
-
// return Object.assign({}, ...additionalData, NSConfig);
|
|
290
278
|
}
|
|
291
279
|
writeLegacyNSConfigIfNeeded(projectDir, runtimePackage) {
|
|
292
280
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -296,8 +284,6 @@ export default {
|
|
|
296
284
|
}
|
|
297
285
|
if (runtimePackage.version &&
|
|
298
286
|
semver.gte(semver.coerce(runtimePackage.version), "7.0.0-rc.5")) {
|
|
299
|
-
// runtimes >= 7.0.0-rc.5 support passing appPath and appResourcesPath through gradle project flags
|
|
300
|
-
// so writing an nsconfig is not necessary.
|
|
301
287
|
return;
|
|
302
288
|
}
|
|
303
289
|
const runtimePackageDisplay = `${runtimePackage.name}${runtimePackage.version ? " v" + runtimePackage.version : ""}`;
|
|
@@ -314,11 +300,9 @@ You may add \`nsconfig.json\` to \`.gitignore\` as the CLI will regenerate it as
|
|
|
314
300
|
appPath: this.getValue("appPath"),
|
|
315
301
|
appResourcesPath: this.getValue("appResourcesPath"),
|
|
316
302
|
});
|
|
317
|
-
// mark the file for cleanup after the CLI exits
|
|
318
303
|
yield this.$cleanupService.addCleanupDeleteAction(nsConfigPath);
|
|
319
304
|
});
|
|
320
305
|
}
|
|
321
|
-
// todo: move into config manipulation
|
|
322
306
|
flattenObjectToPaths(obj, basePath) {
|
|
323
307
|
const toPath = (key) => [basePath, key].filter(Boolean).join(".");
|
|
324
308
|
return Object.keys(obj).reduce((all, key) => {
|
|
@@ -336,7 +320,7 @@ You may add \`nsconfig.json\` to \`.gitignore\` as the CLI will regenerate it as
|
|
|
336
320
|
}
|
|
337
321
|
}
|
|
338
322
|
__decorate([
|
|
339
|
-
(0, decorators_1.cache)()
|
|
323
|
+
(0, decorators_1.cache)()
|
|
340
324
|
], ProjectConfigService.prototype, "warnUsingLegacyNSConfig", null);
|
|
341
325
|
__decorate([
|
|
342
326
|
(0, decorators_1.exported)("projectConfigService")
|
|
@@ -349,4 +333,3 @@ __decorate([
|
|
|
349
333
|
], ProjectConfigService.prototype, "setValue", null);
|
|
350
334
|
exports.ProjectConfigService = ProjectConfigService;
|
|
351
335
|
yok_1.injector.register("projectConfigService", ProjectConfigService);
|
|
352
|
-
//# sourceMappingURL=project-config-service.js.map
|
|
@@ -36,14 +36,12 @@ class ProjectDataService {
|
|
|
36
36
|
this.$injector = $injector;
|
|
37
37
|
this.projectDataCache = {};
|
|
38
38
|
try {
|
|
39
|
-
// add the ProjectData of the default projectDir to the projectData cache
|
|
40
39
|
const projectData = this.$injector.resolve("projectData");
|
|
41
40
|
projectData.initializeProjectData();
|
|
42
41
|
this.defaultProjectDir = projectData.projectDir;
|
|
43
42
|
this.projectDataCache[this.defaultProjectDir] = projectData;
|
|
44
43
|
}
|
|
45
44
|
catch (e) {
|
|
46
|
-
// the CLI is required as a lib from a non-project folder
|
|
47
45
|
}
|
|
48
46
|
}
|
|
49
47
|
get $pluginsService() {
|
|
@@ -72,8 +70,6 @@ class ProjectDataService {
|
|
|
72
70
|
delete projectFileInfo.projectData[ProjectDataService.DEPENDENCIES_KEY_NAME][dependencyName];
|
|
73
71
|
this.$fs.writeJson(projectFileInfo.projectFilePath, projectFileInfo.projectData);
|
|
74
72
|
}
|
|
75
|
-
// TODO: Add tests
|
|
76
|
-
// TODO: Remove $projectData and replace it with $projectDataService.getProjectData
|
|
77
73
|
getProjectData(projectDir) {
|
|
78
74
|
projectDir = projectDir || this.defaultProjectDir;
|
|
79
75
|
this.projectDataCache[projectDir] =
|
|
@@ -130,10 +126,6 @@ class ProjectDataService {
|
|
|
130
126
|
}
|
|
131
127
|
getAndroidAssetsStructure(opts) {
|
|
132
128
|
return __awaiter(this, void 0, void 0, function* () {
|
|
133
|
-
// TODO: Use image-size package to get the width and height of an image.
|
|
134
|
-
// TODO: Parse the splash_screen.xml in nodpi directory and get from it the names of the background and center image.
|
|
135
|
-
// TODO: Parse the AndroidManifest.xml to get the name of the icon.
|
|
136
|
-
// This way we'll not use the image-definitions.json and the method will return the real android structure.
|
|
137
129
|
const projectDir = opts.projectDir;
|
|
138
130
|
const projectData = this.getProjectData(projectDir);
|
|
139
131
|
const pathToAndroidDir = path.join(projectData.appResourcesDirectoryPath, this.$devicePlatformsConstants.Android);
|
|
@@ -147,7 +139,6 @@ class ProjectDataService {
|
|
|
147
139
|
useLegacy = !manifest.includes(`android:icon="@mipmap/ic_launcher"`);
|
|
148
140
|
}
|
|
149
141
|
catch (err) {
|
|
150
|
-
// ignore
|
|
151
142
|
}
|
|
152
143
|
const content = this.getImageDefinitions()[useLegacy ? "android_legacy" : "android"];
|
|
153
144
|
return {
|
|
@@ -172,8 +163,6 @@ class ProjectDataService {
|
|
|
172
163
|
}
|
|
173
164
|
if (fstat.isDirectory()) {
|
|
174
165
|
if (filePath === pathToProjectNodeModules) {
|
|
175
|
-
// we do not want to get the files from node_modules directory of the project.
|
|
176
|
-
// We'll get here only when you have nativescript.config with appDirectoryPath set to "."
|
|
177
166
|
return false;
|
|
178
167
|
}
|
|
179
168
|
return true;
|
|
@@ -188,9 +177,6 @@ class ProjectDataService {
|
|
|
188
177
|
}
|
|
189
178
|
}
|
|
190
179
|
updateNsConfigValue(projectDir, updateObject, propertiesToRemove) {
|
|
191
|
-
// todo: figure out a way to update js/ts configs
|
|
192
|
-
// most likely needs an ast parser/writer
|
|
193
|
-
// should be delegated to the config service
|
|
194
180
|
const nsConfigPath = path.join(projectDir, constants.CONFIG_FILE_NAME_JS);
|
|
195
181
|
const currentNsConfig = this.getNsConfig(nsConfigPath);
|
|
196
182
|
let newNsConfig = currentNsConfig;
|
|
@@ -232,14 +218,10 @@ class ProjectDataService {
|
|
|
232
218
|
const imageDefinitions = this.getImageDefinitions().ios;
|
|
233
219
|
_.each(content && content.images, (image) => {
|
|
234
220
|
let foundMatchingDefinition = false;
|
|
235
|
-
// In some cases the image may not be available, it will just be described.
|
|
236
|
-
// When this happens, the filename will be empty.
|
|
237
|
-
// So we'll keep the path empty as well.
|
|
238
221
|
if (image.filename) {
|
|
239
222
|
image.path = path.join(dirPath, image.filename);
|
|
240
223
|
}
|
|
241
224
|
if (image.size) {
|
|
242
|
-
// size is basically <width>x<height>
|
|
243
225
|
const [width, height] = image.size
|
|
244
226
|
.toString()
|
|
245
227
|
.split(constants_1.AssetConstants.sizeDelimiter);
|
|
@@ -248,7 +230,6 @@ class ProjectDataService {
|
|
|
248
230
|
image.height = +height;
|
|
249
231
|
}
|
|
250
232
|
}
|
|
251
|
-
// Find the image size based on the hardcoded values in the image-definitions.json
|
|
252
233
|
_.each(imageDefinitions, (assetSubGroup) => {
|
|
253
234
|
const assetItem = _.find(assetSubGroup, (assetElement) => assetElement.filename === image.filename &&
|
|
254
235
|
path.basename(assetElement.directory) === path.basename(dirPath));
|
|
@@ -268,7 +249,6 @@ class ProjectDataService {
|
|
|
268
249
|
image.scale = image.scale || assetItem.scale;
|
|
269
250
|
image.rgba = assetItem.rgba;
|
|
270
251
|
finalContent.images.push(image);
|
|
271
|
-
// break each
|
|
272
252
|
return false;
|
|
273
253
|
}
|
|
274
254
|
});
|
|
@@ -372,16 +352,13 @@ class ProjectDataService {
|
|
|
372
352
|
getRuntimePackage(projectDir, platform) {
|
|
373
353
|
platform = platform.toLowerCase();
|
|
374
354
|
const packageJson = this.$fs.readJson(path.join(projectDir, constants.PACKAGE_JSON_FILE_NAME));
|
|
375
|
-
const runtimeName = platform === "android"
|
|
355
|
+
const runtimeName = platform === "android"
|
|
376
356
|
? constants.TNS_ANDROID_RUNTIME_NAME
|
|
377
357
|
: constants.TNS_IOS_RUNTIME_NAME;
|
|
378
358
|
if (packageJson &&
|
|
379
359
|
packageJson.nativescript &&
|
|
380
360
|
packageJson.nativescript[runtimeName] &&
|
|
381
361
|
packageJson.nativescript[runtimeName].version) {
|
|
382
|
-
// if we have a nativescript key with a runtime version in package.json
|
|
383
|
-
// that means we are dealing with a legacy project, and should respect
|
|
384
|
-
// that information
|
|
385
362
|
return {
|
|
386
363
|
name: runtimeName,
|
|
387
364
|
version: packageJson.nativescript[runtimeName].version,
|
|
@@ -393,19 +370,19 @@ class ProjectDataService {
|
|
|
393
370
|
const runtimePackage = this.$pluginsService
|
|
394
371
|
.getDependenciesFromPackageJson(projectDir)
|
|
395
372
|
.devDependencies.find((d) => {
|
|
396
|
-
if (platform === "ios"
|
|
373
|
+
if (platform === "ios") {
|
|
397
374
|
return [
|
|
398
375
|
constants.SCOPED_IOS_RUNTIME_NAME,
|
|
399
376
|
constants.TNS_IOS_RUNTIME_NAME,
|
|
400
377
|
].includes(d.name);
|
|
401
378
|
}
|
|
402
|
-
else if (platform === "android"
|
|
379
|
+
else if (platform === "android") {
|
|
403
380
|
return [
|
|
404
381
|
constants.SCOPED_ANDROID_RUNTIME_NAME,
|
|
405
382
|
constants.TNS_ANDROID_RUNTIME_NAME,
|
|
406
383
|
].includes(d.name);
|
|
407
384
|
}
|
|
408
|
-
else if (platform === "visionos"
|
|
385
|
+
else if (platform === "visionos") {
|
|
409
386
|
return d.name === constants.SCOPED_VISIONOS_RUNTIME_NAME;
|
|
410
387
|
}
|
|
411
388
|
});
|
|
@@ -413,14 +390,12 @@ class ProjectDataService {
|
|
|
413
390
|
const coerced = semver.coerce(runtimePackage.version);
|
|
414
391
|
const isRange = !!coerced && coerced.version !== runtimePackage.version;
|
|
415
392
|
const isTag = !coerced;
|
|
416
|
-
// in case we are using a local tgz for the runtime or a range like ~8.0.0, ^8.0.0 etc. or a tag like JSC
|
|
417
393
|
if (runtimePackage.version.includes("tgz") || isRange || isTag) {
|
|
418
394
|
try {
|
|
419
395
|
const runtimePackageJsonPath = (0, package_path_helper_1.resolvePackageJSONPath)(runtimePackage.name, {
|
|
420
396
|
paths: [projectDir],
|
|
421
397
|
});
|
|
422
398
|
if (!runtimePackageJsonPath) {
|
|
423
|
-
// caught below
|
|
424
399
|
throw new Error("Runtime package.json not found.");
|
|
425
400
|
}
|
|
426
401
|
runtimePackage.version = this.$fs.readJson(runtimePackageJsonPath).version;
|
|
@@ -437,21 +412,20 @@ class ProjectDataService {
|
|
|
437
412
|
}
|
|
438
413
|
return runtimePackage;
|
|
439
414
|
}
|
|
440
|
-
// default to the scoped runtimes
|
|
441
415
|
this.$logger.trace("Could not find an installed runtime, falling back to default runtimes");
|
|
442
|
-
if (platform === "ios"
|
|
416
|
+
if (platform === "ios") {
|
|
443
417
|
return {
|
|
444
418
|
name: constants.SCOPED_IOS_RUNTIME_NAME,
|
|
445
419
|
version: null,
|
|
446
420
|
};
|
|
447
421
|
}
|
|
448
|
-
else if (platform === "android"
|
|
422
|
+
else if (platform === "android") {
|
|
449
423
|
return {
|
|
450
424
|
name: constants.SCOPED_ANDROID_RUNTIME_NAME,
|
|
451
425
|
version: null,
|
|
452
426
|
};
|
|
453
427
|
}
|
|
454
|
-
else if (platform === "visionos"
|
|
428
|
+
else if (platform === "visionos") {
|
|
455
429
|
return {
|
|
456
430
|
name: constants.SCOPED_VISIONOS_RUNTIME_NAME,
|
|
457
431
|
version: null,
|
|
@@ -485,11 +459,9 @@ __decorate([
|
|
|
485
459
|
return projectDir + ":" + platform;
|
|
486
460
|
},
|
|
487
461
|
shouldCache(result) {
|
|
488
|
-
// don't cache coerced versions
|
|
489
462
|
if (result._coerced) {
|
|
490
463
|
return false;
|
|
491
464
|
}
|
|
492
|
-
// only cache if version is defined
|
|
493
465
|
return !!result.version;
|
|
494
466
|
},
|
|
495
467
|
})
|
|
@@ -499,4 +471,3 @@ __decorate([
|
|
|
499
471
|
], ProjectDataService.prototype, "getNsConfigDefaultContent", null);
|
|
500
472
|
exports.ProjectDataService = ProjectDataService;
|
|
501
473
|
yok_1.injector.register("projectDataService", ProjectDataService);
|
|
502
|
-
//# sourceMappingURL=project-data-service.js.map
|
|
@@ -76,15 +76,11 @@ class ProjectService {
|
|
|
76
76
|
appId: appId,
|
|
77
77
|
projectName,
|
|
78
78
|
});
|
|
79
|
-
// can pass --no-git to skip creating a git repo
|
|
80
|
-
// useful in monorepos where we're creating
|
|
81
|
-
// sub projects in an existing git repo.
|
|
82
79
|
if (this.$options.git) {
|
|
83
80
|
try {
|
|
84
81
|
if (!this.$options.force) {
|
|
85
82
|
const git = (0, simple_git_1.default)(projectDir);
|
|
86
83
|
if (yield git.checkIsRepo()) {
|
|
87
|
-
// throwing here since we're catching below.
|
|
88
84
|
throw new Error("Already part of a git repository.");
|
|
89
85
|
}
|
|
90
86
|
}
|
|
@@ -126,7 +122,6 @@ class ProjectService {
|
|
|
126
122
|
this.alterPackageJsonData(projectCreationSettings);
|
|
127
123
|
this.$projectConfigService.writeDefaultConfig(projectDir, appId);
|
|
128
124
|
yield this.ensureAppResourcesExist(projectDir);
|
|
129
|
-
// Install devDependencies and execute all scripts:
|
|
130
125
|
yield this.$packageManager.install(projectDir, projectDir, {
|
|
131
126
|
disableNpmInstall: false,
|
|
132
127
|
frameworkPath: null,
|
|
@@ -160,7 +155,6 @@ class ProjectService {
|
|
|
160
155
|
this.$logger.trace("Project does not have App_Resources - fetching from default template.");
|
|
161
156
|
this.$fs.createDirectory(appResourcesDestinationPath);
|
|
162
157
|
const tempDir = yield this.$tempService.mkdirSync("ns-default-template");
|
|
163
|
-
// the template installed doesn't have App_Resources -> get from a default template
|
|
164
158
|
yield this.$pacoteService.extractPackage(constants.RESERVED_TEMPLATE_NAMES["default"], tempDir);
|
|
165
159
|
const templateProjectData = this.$projectDataService.getProjectData(tempDir);
|
|
166
160
|
const templateAppResourcesDir = templateProjectData.getAppResourcesDirectoryPath(tempDir);
|
|
@@ -172,14 +166,12 @@ class ProjectService {
|
|
|
172
166
|
const { projectDir, projectName } = projectCreationSettings;
|
|
173
167
|
const projectFilePath = path.join(projectDir, this.$staticConfig.PROJECT_FILE_NAME);
|
|
174
168
|
let packageJsonData = this.$fs.readJson(projectFilePath);
|
|
175
|
-
// clean up keys from the template package.json that we don't care about.
|
|
176
169
|
Object.keys(packageJsonData).forEach((key) => {
|
|
177
170
|
if (key.startsWith("_") ||
|
|
178
171
|
constants.TemplatesV2PackageJsonKeysToRemove.includes(key)) {
|
|
179
172
|
delete packageJsonData[key];
|
|
180
173
|
}
|
|
181
174
|
});
|
|
182
|
-
// this is used to ensure the order of keys is consistent, the blanks are filled in from the template
|
|
183
175
|
const packageJsonSchema = {
|
|
184
176
|
name: projectName,
|
|
185
177
|
main: "",
|
|
@@ -187,7 +179,6 @@ class ProjectService {
|
|
|
187
179
|
private: true,
|
|
188
180
|
dependencies: {},
|
|
189
181
|
devDependencies: {},
|
|
190
|
-
// anythign else would go below
|
|
191
182
|
};
|
|
192
183
|
packageJsonData = Object.assign(packageJsonSchema, packageJsonData);
|
|
193
184
|
this.$fs.writeJson(projectFilePath, packageJsonData);
|
|
@@ -211,4 +202,3 @@ __decorate([
|
|
|
211
202
|
], ProjectService.prototype, "alterPackageJsonData", null);
|
|
212
203
|
exports.ProjectService = ProjectService;
|
|
213
204
|
yok_1.injector.register("projectService", ProjectService);
|
|
214
|
-
//# sourceMappingURL=project-service.js.map
|
|
@@ -50,12 +50,12 @@ class ProjectTemplatesService {
|
|
|
50
50
|
const templateNameToBeTracked = this.getTemplateNameToBeTracked(templateValue, templatePackageJsonContent);
|
|
51
51
|
if (templateNameToBeTracked) {
|
|
52
52
|
yield this.$analyticsService.trackEventActionInGoogleAnalytics({
|
|
53
|
-
action: "Create project"
|
|
53
|
+
action: "Create project",
|
|
54
54
|
isForDevice: null,
|
|
55
55
|
additionalData: templateNameToBeTracked,
|
|
56
56
|
});
|
|
57
57
|
yield this.$analyticsService.trackEventActionInGoogleAnalytics({
|
|
58
|
-
action: "Using Template"
|
|
58
|
+
action: "Using Template",
|
|
59
59
|
additionalData: templateNameToBeTracked,
|
|
60
60
|
});
|
|
61
61
|
}
|
|
@@ -112,4 +112,3 @@ __decorate([
|
|
|
112
112
|
], ProjectTemplatesService.prototype, "prepareTemplate", null);
|
|
113
113
|
exports.ProjectTemplatesService = ProjectTemplatesService;
|
|
114
114
|
yok_1.injector.register("projectTemplatesService", ProjectTemplatesService);
|
|
115
|
-
//# sourceMappingURL=project-templates-service.js.map
|
|
@@ -14,7 +14,6 @@ const ora = require("ora");
|
|
|
14
14
|
const yok_1 = require("../common/yok");
|
|
15
15
|
class TerminalSpinnerService {
|
|
16
16
|
createSpinner(spinnerOptions = {}) {
|
|
17
|
-
// @ts-expect-error - options are readonly, however we still want to override them before passing them on...
|
|
18
17
|
spinnerOptions.stream = spinnerOptions.stream || process.stdout;
|
|
19
18
|
return ora(spinnerOptions);
|
|
20
19
|
}
|
|
@@ -37,4 +36,3 @@ class TerminalSpinnerService {
|
|
|
37
36
|
}
|
|
38
37
|
exports.TerminalSpinnerService = TerminalSpinnerService;
|
|
39
38
|
yok_1.injector.register("terminalSpinnerService", TerminalSpinnerService);
|
|
40
|
-
//# sourceMappingURL=terminal-spinner-service.js.map
|