@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.
- package/config/test-deps-versions-generated.json +16 -0
- package/docs/build-jekyll-md.sh +1 -1
- package/docs/man_pages/config/config-get.md +36 -0
- package/docs/man_pages/config/config-set.md +40 -0
- package/docs/man_pages/config/config.md +39 -0
- package/docs/man_pages/project/configuration/widget-ios.md +24 -0
- package/docs/man_pages/project/configuration/widget.md +24 -0
- package/docs/man_pages/project/hooks/hooks.md +35 -0
- package/docs/man_pages/start.md +2 -1
- package/lib/.d.ts +9 -3
- package/lib/bootstrap.js +4 -1
- package/lib/bun-package-manager.js +1 -1
- package/lib/color.js +38 -7
- package/lib/commands/build.js +18 -2
- package/lib/commands/clean.js +1 -2
- package/lib/commands/config.js +1 -1
- package/lib/commands/embedding/embed.js +1 -1
- package/lib/commands/generate.js +2 -41
- package/lib/commands/hooks/common.js +79 -0
- package/lib/commands/hooks/hooks-lock.js +100 -0
- package/lib/commands/hooks/hooks.js +71 -0
- package/lib/commands/post-install.js +2 -2
- package/lib/commands/typings.js +29 -18
- package/lib/commands/widget.js +799 -0
- package/lib/common/definitions/extensibility.d.ts +2 -2
- package/lib/common/definitions/mobile.d.ts +72 -72
- package/lib/common/file-system.js +1 -2
- package/lib/common/header.js +3 -3
- package/lib/common/logger/layouts/cli-layout.js +1 -1
- package/lib/common/logger/logger.js +5 -5
- package/lib/common/mobile/android/android-device.js +1 -1
- package/lib/common/mobile/android/android-emulator-services.js +9 -7
- package/lib/common/mobile/device-log-provider.js +3 -4
- package/lib/common/mobile/emulator-helper.js +1 -0
- package/lib/common/mobile/mobile-core/devices-service.js +2 -1
- package/lib/common/opener.js +2 -2
- package/lib/common/project-helper.js +15 -2
- package/lib/common/services/hooks-service.js +23 -6
- package/lib/common/verify-node-version.js +1 -1
- package/lib/constants.js +8 -5
- package/lib/controllers/migrate-controller.js +11 -12
- package/lib/controllers/prepare-controller.js +11 -13
- package/lib/controllers/run-controller.js +1 -1
- package/lib/declarations.d.ts +5 -0
- package/lib/definitions/hooks.d.ts +1 -0
- package/lib/definitions/ios.d.ts +11 -1
- package/lib/definitions/nativescript-dev-xcode.d.ts +25 -1
- package/lib/definitions/project.d.ts +102 -25
- package/lib/definitions/temp-service.d.ts +6 -2
- package/lib/helpers/key-command-helper.js +2 -1
- package/lib/nativescript-cli.js +28 -0
- package/lib/node-package-manager.js +1 -1
- package/lib/options.js +4 -0
- package/lib/project-data.js +10 -4
- package/lib/services/analytics/analytics-broker-process.js +1 -1
- package/lib/services/analytics/analytics-service.js +2 -1
- package/lib/services/analytics-settings-service.js +2 -1
- package/lib/services/android/gradle-build-args-service.js +8 -4
- package/lib/services/android/gradle-build-service.js +4 -1
- package/lib/services/android-plugin-build-service.js +1 -1
- package/lib/services/android-project-service.js +12 -10
- package/lib/services/assets-generation/assets-generation-service.js +33 -15
- package/lib/services/{webpack/webpack-compiler-service.js → bundler/bundler-compiler-service.js} +258 -88
- package/lib/services/bundler/bundler.js +2 -0
- package/lib/services/extensibility-service.js +1 -1
- package/lib/services/ios/spm-service.js +22 -2
- package/lib/services/ios/xcodebuild-args-service.js +7 -5
- package/lib/services/ios-debugger-port-service.js +1 -1
- package/lib/services/ios-project-service.js +45 -15
- package/lib/services/ios-watch-app-service.js +540 -16
- package/lib/services/livesync/android-livesync-tool.js +4 -2
- package/lib/services/plugins-service.js +1 -0
- package/lib/services/project-changes-service.js +1 -1
- package/lib/services/project-config-service.js +12 -3
- package/lib/services/temp-service.js +16 -4
- package/lib/services/versions-service.js +2 -1
- package/lib/tools/config-manipulation/config-transformer.js +9 -0
- package/package.json +59 -66
- package/vendor/aab-tool/README.txt +1 -1
- package/vendor/aab-tool/bundletool.jar +0 -0
- package/vendor/gradle-app/app/build.gradle +365 -130
- package/vendor/gradle-app/app/gradle.properties +45 -0
- package/vendor/gradle-app/build.gradle +7 -7
- package/vendor/gradle-plugin/build.gradle +7 -6
- 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
|
-
|
|
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("
|
|
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 (
|
|
680
|
-
const
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
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);
|