@akylas/nativescript-cli 8.8.7 → 8.10.0

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.
Files changed (85) hide show
  1. package/config/test-deps-versions-generated.json +16 -0
  2. package/docs/build-jekyll-md.sh +1 -1
  3. package/docs/man_pages/config/config-get.md +36 -0
  4. package/docs/man_pages/config/config-set.md +40 -0
  5. package/docs/man_pages/config/config.md +39 -0
  6. package/docs/man_pages/project/configuration/widget-ios.md +24 -0
  7. package/docs/man_pages/project/configuration/widget.md +24 -0
  8. package/docs/man_pages/project/hooks/hooks.md +35 -0
  9. package/docs/man_pages/start.md +2 -1
  10. package/lib/.d.ts +9 -3
  11. package/lib/bootstrap.js +4 -1
  12. package/lib/bun-package-manager.js +1 -1
  13. package/lib/color.js +38 -7
  14. package/lib/commands/build.js +18 -2
  15. package/lib/commands/clean.js +1 -2
  16. package/lib/commands/config.js +1 -1
  17. package/lib/commands/embedding/embed.js +1 -1
  18. package/lib/commands/generate.js +2 -41
  19. package/lib/commands/hooks/common.js +79 -0
  20. package/lib/commands/hooks/hooks-lock.js +100 -0
  21. package/lib/commands/hooks/hooks.js +71 -0
  22. package/lib/commands/post-install.js +2 -2
  23. package/lib/commands/typings.js +29 -18
  24. package/lib/commands/widget.js +799 -0
  25. package/lib/common/definitions/extensibility.d.ts +2 -2
  26. package/lib/common/definitions/mobile.d.ts +72 -72
  27. package/lib/common/file-system.js +1 -2
  28. package/lib/common/header.js +3 -3
  29. package/lib/common/logger/layouts/cli-layout.js +1 -1
  30. package/lib/common/logger/logger.js +5 -5
  31. package/lib/common/mobile/android/android-device.js +1 -1
  32. package/lib/common/mobile/android/android-emulator-services.js +9 -7
  33. package/lib/common/mobile/device-log-provider.js +3 -4
  34. package/lib/common/mobile/emulator-helper.js +1 -0
  35. package/lib/common/mobile/mobile-core/devices-service.js +2 -1
  36. package/lib/common/opener.js +2 -2
  37. package/lib/common/project-helper.js +15 -2
  38. package/lib/common/services/hooks-service.js +23 -6
  39. package/lib/common/verify-node-version.js +1 -1
  40. package/lib/constants.js +8 -5
  41. package/lib/controllers/migrate-controller.js +11 -12
  42. package/lib/controllers/prepare-controller.js +11 -13
  43. package/lib/controllers/run-controller.js +1 -1
  44. package/lib/declarations.d.ts +5 -0
  45. package/lib/definitions/hooks.d.ts +1 -0
  46. package/lib/definitions/ios.d.ts +11 -1
  47. package/lib/definitions/nativescript-dev-xcode.d.ts +25 -1
  48. package/lib/definitions/project.d.ts +102 -25
  49. package/lib/definitions/temp-service.d.ts +6 -2
  50. package/lib/helpers/key-command-helper.js +2 -1
  51. package/lib/nativescript-cli.js +28 -0
  52. package/lib/node-package-manager.js +1 -1
  53. package/lib/options.js +4 -0
  54. package/lib/project-data.js +10 -4
  55. package/lib/services/analytics/analytics-broker-process.js +1 -1
  56. package/lib/services/analytics/analytics-service.js +2 -1
  57. package/lib/services/analytics-settings-service.js +2 -1
  58. package/lib/services/android/gradle-build-args-service.js +8 -4
  59. package/lib/services/android/gradle-build-service.js +4 -1
  60. package/lib/services/android-plugin-build-service.js +1 -1
  61. package/lib/services/android-project-service.js +12 -10
  62. package/lib/services/assets-generation/assets-generation-service.js +33 -15
  63. package/lib/services/{webpack/webpack-compiler-service.js → bundler/bundler-compiler-service.js} +258 -88
  64. package/lib/services/bundler/bundler.js +2 -0
  65. package/lib/services/extensibility-service.js +1 -1
  66. package/lib/services/ios/spm-service.js +22 -2
  67. package/lib/services/ios/xcodebuild-args-service.js +7 -5
  68. package/lib/services/ios-debugger-port-service.js +1 -1
  69. package/lib/services/ios-project-service.js +45 -15
  70. package/lib/services/ios-watch-app-service.js +540 -16
  71. package/lib/services/livesync/android-livesync-tool.js +4 -2
  72. package/lib/services/plugins-service.js +1 -0
  73. package/lib/services/project-changes-service.js +1 -1
  74. package/lib/services/project-config-service.js +12 -3
  75. package/lib/services/temp-service.js +16 -4
  76. package/lib/services/versions-service.js +2 -1
  77. package/lib/tools/config-manipulation/config-transformer.js +9 -0
  78. package/package.json +59 -66
  79. package/vendor/aab-tool/README.txt +1 -1
  80. package/vendor/aab-tool/bundletool.jar +0 -0
  81. package/vendor/gradle-app/app/build.gradle +365 -130
  82. package/vendor/gradle-app/app/gradle.properties +45 -0
  83. package/vendor/gradle-app/build.gradle +7 -7
  84. package/vendor/gradle-plugin/build.gradle +7 -6
  85. package/lib/services/webpack/webpack.d.ts +0 -227
@@ -18,6 +18,7 @@ const projectServiceBaseLib = require("./platform-project-service-base");
18
18
  const plist_merge_patch_1 = require("plist-merge-patch");
19
19
  const os_1 = require("os");
20
20
  const plist = require("plist");
21
+ const fastGlob = require("fast-glob");
21
22
  const constants_2 = require("../constants");
22
23
  const helpers_2 = require("../common/helpers");
23
24
  const yok_1 = require("../common/yok");
@@ -42,7 +43,7 @@ const getConfigurationName = (release) => {
42
43
  return release ? constants_1.Configurations.Release : constants_1.Configurations.Debug;
43
44
  };
44
45
  class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase {
45
- constructor($fs, $options, $childProcess, $cocoapodsService, $errors, $logger, $injector, $projectDataService, $devicePlatformsConstants, $hostInfo, $xcprojService, $iOSProvisionService, $iOSSigningService, $pbxprojDomXcode, $xcode, $iOSEntitlementsService, $platformEnvironmentRequirements, $plistParser, $xcconfigService, $xcodebuildService, $iOSExtensionsService, $iOSWatchAppService, $iOSNativeTargetService, $sysInfo, $tempService, $spmService, $mobileHelper) {
46
+ constructor($fs, $options, $childProcess, $cocoapodsService, $errors, $logger, $injector, $projectDataService, $devicePlatformsConstants, $hostInfo, $xcprojService, $iOSProvisionService, $iOSSigningService, $pbxprojDomXcode, $xcode, $iOSEntitlementsService, $platformEnvironmentRequirements, $plistParser, $xcconfigService, $xcodebuildService, $iOSExtensionsService, $iOSWatchAppService, $iOSNativeTargetService, $sysInfo, $tempService, $spmService, $mobileHelper, $projectConfigService) {
46
47
  super($fs, $projectDataService);
47
48
  this.$options = $options;
48
49
  this.$childProcess = $childProcess;
@@ -69,6 +70,7 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
69
70
  this.$tempService = $tempService;
70
71
  this.$spmService = $spmService;
71
72
  this.$mobileHelper = $mobileHelper;
73
+ this.$projectConfigService = $projectConfigService;
72
74
  this._platformsDirCache = null;
73
75
  this._platformData = null;
74
76
  }
@@ -362,8 +364,13 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
362
364
  resourcesNativeCodePath = path.join(resourcesDirectoryPath, this.$devicePlatformsConstants.iOS, constants.NATIVE_SOURCE_FOLDER);
363
365
  }
364
366
  await this.prepareNativeSourceCode(constants.TNS_NATIVE_SOURCE_GROUP_NAME, resourcesNativeCodePath, projectData);
367
+ const nativeSource = this.$projectConfigService.getValue(`${this._platformData.platformNameLowerCase}.NativeSource`, []);
368
+ if (nativeSource === null || nativeSource === void 0 ? void 0 : nativeSource.length) {
369
+ for (const source of nativeSource) {
370
+ await this.prepareNativeSourceCode(source.name, source.path, projectData);
371
+ }
372
+ }
365
373
  }
366
- this.$iOSWatchAppService.removeWatchApp({ pbxProjPath });
367
374
  const addedWatchApp = await this.$iOSWatchAppService.addWatchAppFromPath({
368
375
  watchAppFolderPath: path.join(resourcesDirectoryPath, platformData.normalizedPlatformName),
369
376
  projectData,
@@ -532,7 +539,20 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
532
539
  await this.$cocoapodsService.executePodInstall(platformData.projectRoot, this.$xcprojService.getXcodeprojPath(projectData, platformData.projectRoot));
533
540
  await this.$cocoapodsService.mergePodXcconfigFile(projectData, platformData, opts);
534
541
  }
535
- await this.$spmService.applySPMPackages(platformData, projectData);
542
+ const pluginSpmPackages = [];
543
+ for (const plugin of pluginsData) {
544
+ if (plugin.fullPath) {
545
+ const pluginConfigPath = path.join(plugin.fullPath, constants.CONFIG_FILE_NAME_TS);
546
+ if (this.$fs.exists(pluginConfigPath)) {
547
+ const config = this.$projectConfigService.readConfig(plugin.fullPath);
548
+ const packages = _.get(config, `${platformData.platformNameLowerCase}.SPMPackages`, []);
549
+ if (packages.length) {
550
+ pluginSpmPackages.push(...packages);
551
+ }
552
+ }
553
+ }
554
+ }
555
+ await this.$spmService.applySPMPackages(platformData, projectData, pluginSpmPackages);
536
556
  }
537
557
  beforePrepareAllPlugins(projectData, dependencies) {
538
558
  return Promise.resolve(dependencies);
@@ -626,7 +646,7 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
626
646
  }
627
647
  async prepareNativeSourceCode(groupName, sourceFolderPath, projectData) {
628
648
  const project = this.createPbxProj(projectData);
629
- const group = this.getRootGroup(groupName, sourceFolderPath);
649
+ const group = await this.getRootGroup(groupName, sourceFolderPath);
630
650
  project.addPbxGroup(group.files, group.name, group.path, null, {
631
651
  isMain: true,
632
652
  filesRelativeToProject: true,
@@ -666,23 +686,33 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
666
686
  addedExtensionsFromPlugins || addedExtensionFromPlugin;
667
687
  }
668
688
  if (addedExtensionsFromResources || addedExtensionsFromPlugins) {
669
- this.$logger.warn("The support for iOS App Extensions is currently in Beta. For more information about the current development state and any known issues, please check the relevant GitHub issue: https://github.com/NativeScript/nativescript-cli/issues/4472");
689
+ this.$logger.warn("Let us know if there are other Extension features you'd like! https://github.com/NativeScript/NativeScript/issues");
670
690
  }
671
691
  }
672
- getRootGroup(name, rootPath) {
692
+ async getRootGroup(name, rootPath) {
673
693
  const filePathsArr = [];
674
694
  const rootGroup = {
675
695
  name: name,
676
696
  files: filePathsArr,
677
697
  path: rootPath,
678
698
  };
679
- if (this.$fs.exists(rootPath)) {
680
- const stats = this.$fs.getFsStats(rootPath);
681
- if (stats.isDirectory() && !this.$fs.isEmptyDir(rootPath)) {
682
- this.$fs.readDirectory(rootPath).forEach((fileName) => {
683
- const filePath = path.join(rootGroup.path, fileName);
684
- filePathsArr.push(filePath);
685
- });
699
+ if (fastGlob.isDynamicPattern(rootPath)) {
700
+ const projectRoot = this.$projectDataService.getProjectData().projectDir;
701
+ const filePaths = await fastGlob(rootPath);
702
+ for (const filePath of filePaths) {
703
+ const sourceFilePath = path.normalize(path.join(projectRoot, filePath));
704
+ filePathsArr.push(sourceFilePath);
705
+ }
706
+ }
707
+ else {
708
+ if (this.$fs.exists(rootPath)) {
709
+ const stats = this.$fs.getFsStats(rootPath);
710
+ if (stats.isDirectory() && !this.$fs.isEmptyDir(rootPath)) {
711
+ this.$fs.readDirectory(rootPath).forEach((fileName) => {
712
+ const filePath = path.join(rootGroup.path, fileName);
713
+ filePathsArr.push(filePath);
714
+ });
715
+ }
686
716
  }
687
717
  }
688
718
  return rootGroup;
@@ -708,9 +738,9 @@ class IOSProjectService extends projectServiceBaseLib.PlatformProjectServiceBase
708
738
  await this.addStaticLibrary(path.join(pluginPlatformsFolderPath, fileName), projectData);
709
739
  }
710
740
  }
711
- removeNativeSourceCode(pluginPlatformsFolderPath, pluginData, projectData) {
741
+ async removeNativeSourceCode(pluginPlatformsFolderPath, pluginData, projectData) {
712
742
  const project = this.createPbxProj(projectData);
713
- const group = this.getRootGroup(pluginData.name, pluginPlatformsFolderPath);
743
+ const group = await this.getRootGroup(pluginData.name, pluginPlatformsFolderPath);
714
744
  project.removePbxGroup(group.name, group.path);
715
745
  project.removeFromHeaderSearchPaths(group.path);
716
746
  this.savePbxProj(project, projectData);