@akanjs/cli 2.4.0-rc.4 → 2.4.0-rc.5
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/incrementalBuilder.proc.js +14 -3
- package/index.js +41 -5
- package/package.json +2 -2
|
@@ -727,13 +727,21 @@ var MOBILE_RUNTIME_PACKAGES = [
|
|
|
727
727
|
"@capacitor/core",
|
|
728
728
|
"@capacitor/ios",
|
|
729
729
|
"@capacitor/android",
|
|
730
|
-
"@capacitor/assets"
|
|
730
|
+
"@capacitor/assets"
|
|
731
|
+
];
|
|
732
|
+
var MOBILE_APP_CAPACITOR_PLUGINS = [
|
|
733
|
+
"@capacitor-community/fcm",
|
|
731
734
|
"@capacitor/app",
|
|
735
|
+
"@capacitor/browser",
|
|
736
|
+
"@capacitor/camera",
|
|
737
|
+
"@capacitor/core",
|
|
732
738
|
"@capacitor/device",
|
|
733
|
-
"@capacitor/
|
|
739
|
+
"@capacitor/geolocation",
|
|
734
740
|
"@capacitor/haptics",
|
|
741
|
+
"@capacitor/inappbrowser",
|
|
742
|
+
"@capacitor/keyboard",
|
|
735
743
|
"@capacitor/preferences",
|
|
736
|
-
"@capacitor/
|
|
744
|
+
"@capacitor/push-notifications",
|
|
737
745
|
"capacitor-plugin-safe-area"
|
|
738
746
|
];
|
|
739
747
|
var DATABASE_MODE_RUNTIME_PACKAGES = {
|
|
@@ -1045,6 +1053,9 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
|
|
|
1045
1053
|
getMissingMobileDependencySpecs() {
|
|
1046
1054
|
return this.#getMissingDependencySpecs(this.getMobileRuntimePackages());
|
|
1047
1055
|
}
|
|
1056
|
+
getMobileAppCapacitorPlugins() {
|
|
1057
|
+
return [...MOBILE_APP_CAPACITOR_PLUGINS];
|
|
1058
|
+
}
|
|
1048
1059
|
#getMissingDependencySpecs(libs) {
|
|
1049
1060
|
const rootDependencies = {
|
|
1050
1061
|
...this.rootPackageJson.dependencies,
|
package/index.js
CHANGED
|
@@ -725,13 +725,21 @@ var MOBILE_RUNTIME_PACKAGES = [
|
|
|
725
725
|
"@capacitor/core",
|
|
726
726
|
"@capacitor/ios",
|
|
727
727
|
"@capacitor/android",
|
|
728
|
-
"@capacitor/assets"
|
|
728
|
+
"@capacitor/assets"
|
|
729
|
+
];
|
|
730
|
+
var MOBILE_APP_CAPACITOR_PLUGINS = [
|
|
731
|
+
"@capacitor-community/fcm",
|
|
729
732
|
"@capacitor/app",
|
|
733
|
+
"@capacitor/browser",
|
|
734
|
+
"@capacitor/camera",
|
|
735
|
+
"@capacitor/core",
|
|
730
736
|
"@capacitor/device",
|
|
731
|
-
"@capacitor/
|
|
737
|
+
"@capacitor/geolocation",
|
|
732
738
|
"@capacitor/haptics",
|
|
739
|
+
"@capacitor/inappbrowser",
|
|
740
|
+
"@capacitor/keyboard",
|
|
733
741
|
"@capacitor/preferences",
|
|
734
|
-
"@capacitor/
|
|
742
|
+
"@capacitor/push-notifications",
|
|
735
743
|
"capacitor-plugin-safe-area"
|
|
736
744
|
];
|
|
737
745
|
var DATABASE_MODE_RUNTIME_PACKAGES = {
|
|
@@ -1043,6 +1051,9 @@ CMD [${command.map((c) => `"${c}"`).join(",")}]`;
|
|
|
1043
1051
|
getMissingMobileDependencySpecs() {
|
|
1044
1052
|
return this.#getMissingDependencySpecs(this.getMobileRuntimePackages());
|
|
1045
1053
|
}
|
|
1054
|
+
getMobileAppCapacitorPlugins() {
|
|
1055
|
+
return [...MOBILE_APP_CAPACITOR_PLUGINS];
|
|
1056
|
+
}
|
|
1046
1057
|
#getMissingDependencySpecs(libs) {
|
|
1047
1058
|
const rootDependencies = {
|
|
1048
1059
|
...this.rootPackageJson.dependencies,
|
|
@@ -17767,6 +17778,27 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
17767
17778
|
throw error;
|
|
17768
17779
|
}
|
|
17769
17780
|
}
|
|
17781
|
+
async syncMobileAppCapacitorPlugins(app, akanConfig3) {
|
|
17782
|
+
const plugins = akanConfig3.getMobileAppCapacitorPlugins();
|
|
17783
|
+
if (plugins.length === 0)
|
|
17784
|
+
return;
|
|
17785
|
+
const packageJson = await app.getPackageJson({ refresh: true });
|
|
17786
|
+
const dependencies = packageJson.dependencies ?? {};
|
|
17787
|
+
const missing = plugins.filter((plugin) => !dependencies[plugin]);
|
|
17788
|
+
if (missing.length === 0)
|
|
17789
|
+
return;
|
|
17790
|
+
const spinner2 = app.workspace.spinning(`Adding default Capacitor plugins to ${app.name}...`);
|
|
17791
|
+
try {
|
|
17792
|
+
packageJson.dependencies = { ...dependencies, ...Object.fromEntries(missing.map((plugin) => [plugin, "*"])) };
|
|
17793
|
+
await app.setPackageJson(packageJson);
|
|
17794
|
+
await app.workspace.spawn("bun", ["install"], { stdio: "inherit" });
|
|
17795
|
+
await app.getPackageJson({ refresh: true });
|
|
17796
|
+
spinner2.succeed(`Added default Capacitor plugins to ${app.name}: ${missing.join(", ")}`);
|
|
17797
|
+
} catch (error) {
|
|
17798
|
+
spinner2.fail(`Failed to add default Capacitor plugins to ${app.name}`);
|
|
17799
|
+
throw error;
|
|
17800
|
+
}
|
|
17801
|
+
}
|
|
17770
17802
|
async createApplication(appName, workspace, { start = false, libs = [] } = {}) {
|
|
17771
17803
|
const spinner2 = workspace.spinning("Creating application...");
|
|
17772
17804
|
const app = await this.applicationRunner.createApplication(appName, workspace, libs);
|
|
@@ -17888,7 +17920,9 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
17888
17920
|
noAllowProvisioningUpdates = false
|
|
17889
17921
|
} = {}) {
|
|
17890
17922
|
await app.scanSync({ write });
|
|
17891
|
-
|
|
17923
|
+
const akanConfig3 = await app.getConfig();
|
|
17924
|
+
await this.syncMobileDependencies(app, akanConfig3);
|
|
17925
|
+
await this.syncMobileAppCapacitorPlugins(app, akanConfig3);
|
|
17892
17926
|
await this.applicationRunner.startIos(app, {
|
|
17893
17927
|
open,
|
|
17894
17928
|
operation,
|
|
@@ -17917,7 +17951,9 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
17917
17951
|
regenerate = false
|
|
17918
17952
|
} = {}) {
|
|
17919
17953
|
await app.scanSync({ write });
|
|
17920
|
-
|
|
17954
|
+
const akanConfig3 = await app.getConfig();
|
|
17955
|
+
await this.syncMobileDependencies(app, akanConfig3);
|
|
17956
|
+
await this.syncMobileAppCapacitorPlugins(app, akanConfig3);
|
|
17921
17957
|
await this.applicationRunner.startAndroid(app, {
|
|
17922
17958
|
open,
|
|
17923
17959
|
operation,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "2.4.0-rc.
|
|
3
|
+
"version": "2.4.0-rc.5",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@langchain/openai": "^1.4.6",
|
|
35
35
|
"@tailwindcss/node": "^4.3.0",
|
|
36
36
|
"@trapezedev/project": "^7.1.4",
|
|
37
|
-
"akanjs": "2.4.0-rc.
|
|
37
|
+
"akanjs": "2.4.0-rc.5",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"daisyui": "5.5.23",
|