@akanjs/cli 3.0.0-alpha.2 → 3.0.0-alpha.4
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/.build-stamp +1 -1
- package/{abstractCompactor-e5yq60qz.js → abstractCompactor-rk6twzvj.js} +2 -2
- package/{agent.command-yv00p0s0.js → agent.command-jfz8yfwy.js} +7 -7
- package/{application.command-0qsczf4k.js → application.command-mxyqtd6p.js} +5 -5
- package/{applicationBuildRunner-ct2pxyvw.js → applicationBuildRunner-cwk52sb7.js} +2 -2
- package/{applicationReleasePackager-gg8ccbeh.js → applicationReleasePackager-yrrhbkv3.js} +1 -1
- package/buildBatch.proc.js +3 -3
- package/{capacitorApp-4r9sm3qg.js → capacitorApp-j357ak1g.js} +5 -3
- package/{cloud.command-dxfv18sa.js → cloud.command-f87dwe52.js} +9 -9
- package/{context.command-8d9e3k6b.js → context.command-z5bf8bn7.js} +15 -15
- package/{guideline.command-3jbkxzh6.js → guideline.command-1m1ctar3.js} +5 -5
- package/incrementalBuilder.proc.js +2 -2
- package/{index-1pvex4az.js → index-1s71fwrq.js} +11 -11
- package/{index-0cj2zxbm.js → index-3pgtw35d.js} +1 -1
- package/{index-a00jg8x8.js → index-4yp06pn1.js} +2 -2
- package/{index-rzwcpcc3.js → index-4zgs8g1w.js} +1 -1
- package/{index-mxvakhsm.js → index-6pz1j0zj.js} +2 -6
- package/{index-mr5s7mqd.js → index-b978vs2e.js} +3 -3
- package/{index-pyt2b4nw.js → index-cap2k2ch.js} +2 -2
- package/{index-7c6k4yvg.js → index-cn24dcqn.js} +2 -2
- package/{index-2q1f5j9k.js → index-csqk9z5j.js} +3 -3
- package/{index-k95xkh4p.js → index-e3qskyt2.js} +2 -2
- package/{index-ec09pws3.js → index-fmgbwsr5.js} +4 -4
- package/{index-bbkek1bp.js → index-hjzr8ja1.js} +1 -1
- package/{index-8hsbnyes.js → index-jk9q6pse.js} +1 -1
- package/{index-hgna5rjy.js → index-jtm86byd.js} +1 -1
- package/{index-ej426mcr.js → index-n0z3f2xg.js} +4 -4
- package/{index-bekddz9q.js → index-r4w8cry5.js} +4 -4
- package/{index-e16gnn26.js → index-tq1y56tp.js} +12 -35
- package/{index-yzmhasdb.js → index-vhv3xnjz.js} +6 -6
- package/{index-zasydjxd.js → index-xj8bks3p.js} +4 -4
- package/{index-tdbas9r0.js → index-xwgm94zr.js} +1 -1
- package/{index-t3723f99.js → index-y0k42k04.js} +86 -17
- package/{index-nm6wghb6.js → index-ybybkec0.js} +6 -6
- package/index.js +19 -19
- package/{library.command-ebdj1vnm.js → library.command-pwfx8dx2.js} +4 -4
- package/{localRegistry.command-gb178ne8.js → localRegistry.command-r4zjx5py.js} +8 -8
- package/{module.command-9c1bnsx4.js → module.command-0t3ewata.js} +8 -8
- package/{package.command-t93p4jkj.js → package.command-7hmkxvpa.js} +4 -4
- package/package.json +2 -2
- package/{page.command-k3k0meh2.js → page.command-st6r4s0q.js} +4 -4
- package/{primitive.command-de6nktdt.js → primitive.command-1qkxpzsn.js} +9 -9
- package/{quality.command-z5kth2wa.js → quality.command-hy5vt1bh.js} +48 -451
- package/{repair.command-ehf2g112.js → repair.command-nakkq2zp.js} +6 -6
- package/{scalar.command-7a2jtv33.js → scalar.command-fjq272gs.js} +7 -7
- package/templates/lib/db.ts +1 -3
- package/templates/libRoot/base/baseLogic.ts +14 -0
- package/templates/libRoot/base/index.ts +8 -0
- package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -1
- package/templates/workspaceRoot/AGENTS.md.template +24 -148
- package/templates/workspaceRoot/biome.json.template +19 -0
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
- package/{workflow.command-e0tt0vk2.js → workflow.command-jswbgk90.js} +12 -12
- package/{workspace.command-fpda0evj.js → workspace.command-h9wwcjpt.js} +21 -21
- package/guidelines/ssrRule/ssrRule.generate.json +0 -31
- package/guidelines/ssrRule/ssrRule.instruction.md +0 -108
- package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
|
@@ -4,11 +4,11 @@ import {
|
|
|
4
4
|
} from "./index-76rn3g2c.js";
|
|
5
5
|
import {
|
|
6
6
|
LibraryScript
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-cn24dcqn.js";
|
|
8
8
|
import {
|
|
9
9
|
runner,
|
|
10
10
|
script
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-jk9q6pse.js";
|
|
12
12
|
import {
|
|
13
13
|
HmrWatcher,
|
|
14
14
|
WatchRootResolver
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
LibExecutor,
|
|
19
19
|
PkgExecutor,
|
|
20
20
|
WorkspaceExecutor
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-jtm86byd.js";
|
|
22
22
|
import {
|
|
23
23
|
__require
|
|
24
24
|
} from "./index-r24hmh0q.js";
|
|
@@ -1898,10 +1898,10 @@ function openBrowser(url) {
|
|
|
1898
1898
|
}
|
|
1899
1899
|
|
|
1900
1900
|
// pkgs/@akanjs/cli/application/application.runner.ts
|
|
1901
|
-
var loadBuildRunner = async () => (await import("./applicationBuildRunner-
|
|
1902
|
-
var loadReleasePackager = async () => (await import("./applicationReleasePackager-
|
|
1903
|
-
var loadCapacitorApp = async () => (await import("./capacitorApp-
|
|
1904
|
-
var loadAbstractCompactor = async () => (await import("./abstractCompactor-
|
|
1901
|
+
var loadBuildRunner = async () => (await import("./applicationBuildRunner-cwk52sb7.js")).ApplicationBuildRunner;
|
|
1902
|
+
var loadReleasePackager = async () => (await import("./applicationReleasePackager-yrrhbkv3.js")).ApplicationReleasePackager;
|
|
1903
|
+
var loadCapacitorApp = async () => (await import("./capacitorApp-j357ak1g.js")).CapacitorApp;
|
|
1904
|
+
var loadAbstractCompactor = async () => (await import("./abstractCompactor-rk6twzvj.js")).AbstractCompactor;
|
|
1905
1905
|
var loadPrompts = async () => await import("@inquirer/prompts");
|
|
1906
1906
|
|
|
1907
1907
|
class ApplicationRunner extends runner("application") {
|
|
@@ -2241,7 +2241,6 @@ ${detail}`
|
|
|
2241
2241
|
|
|
2242
2242
|
// pkgs/@akanjs/cli/application/application.script.ts
|
|
2243
2243
|
class ApplicationScript extends script("application", [ApplicationRunner, LibraryScript]) {
|
|
2244
|
-
static dbShutdownTimeoutMs = 20000;
|
|
2245
2244
|
async confirmDatabaseModeDependencyInstall(databaseMode, installSpecs) {
|
|
2246
2245
|
return await confirm({
|
|
2247
2246
|
message: [
|
|
@@ -2419,7 +2418,10 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
2419
2418
|
if (app.getEnv() === "local" && dbup && databaseMode !== "single") {
|
|
2420
2419
|
const wasDbAlreadyUp = await this.dbup(app.workspace, databaseMode);
|
|
2421
2420
|
if (!wasDbAlreadyUp)
|
|
2422
|
-
|
|
2421
|
+
process.on("SIGINT", async () => {
|
|
2422
|
+
await this.dbdown(app.workspace);
|
|
2423
|
+
process.exit(0);
|
|
2424
|
+
});
|
|
2423
2425
|
}
|
|
2424
2426
|
const spinner = app.spinning("Preparing backend...");
|
|
2425
2427
|
const akanAppHost = await this.applicationRunner.start(app, {
|
|
@@ -2516,34 +2518,9 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
2516
2518
|
}
|
|
2517
2519
|
async dbdown(workspace) {
|
|
2518
2520
|
const spinner = workspace.spinning("Stopping local database...");
|
|
2519
|
-
|
|
2520
|
-
await this.applicationRunner.dbdown(workspace);
|
|
2521
|
-
} catch (error) {
|
|
2522
|
-
spinner.fail("Local database failed to stop");
|
|
2523
|
-
throw error;
|
|
2524
|
-
}
|
|
2521
|
+
await this.applicationRunner.dbdown(workspace);
|
|
2525
2522
|
spinner.succeed("Local database (/local/docker-compose.yaml) is down");
|
|
2526
2523
|
}
|
|
2527
|
-
#stopDatabaseOnInterrupt(workspace) {
|
|
2528
|
-
let stopping = false;
|
|
2529
|
-
process.on("SIGINT", () => {
|
|
2530
|
-
if (stopping) {
|
|
2531
|
-
Logger5.rawLog("Abandoning the local database teardown; containers are left running.", undefined, "warn");
|
|
2532
|
-
process.exit(130);
|
|
2533
|
-
}
|
|
2534
|
-
stopping = true;
|
|
2535
|
-
this.#stopDatabase(workspace).finally(() => process.exit(0));
|
|
2536
|
-
});
|
|
2537
|
-
}
|
|
2538
|
-
async#stopDatabase(workspace) {
|
|
2539
|
-
const timeout = new Promise((resolve) => setTimeout(() => resolve("timeout"), ApplicationScript.dbShutdownTimeoutMs));
|
|
2540
|
-
const result = await Promise.race([this.dbdown(workspace).catch(() => {
|
|
2541
|
-
return;
|
|
2542
|
-
}), timeout]);
|
|
2543
|
-
if (result !== "timeout")
|
|
2544
|
-
return;
|
|
2545
|
-
Logger5.rawLog(`Local database did not stop within ${ApplicationScript.dbShutdownTimeoutMs}ms; run \`akan dbdown\` once Docker responds.`, undefined, "warn");
|
|
2546
|
-
}
|
|
2547
2524
|
async testSys(sys) {
|
|
2548
2525
|
if (sys.type === "app")
|
|
2549
2526
|
await this.testApplication(sys);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PageScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-hjzr8ja1.js";
|
|
5
5
|
import {
|
|
6
6
|
pluralizeName
|
|
7
7
|
} from "./index-ss469dec.js";
|
|
8
8
|
import {
|
|
9
9
|
AiSession
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-3pgtw35d.js";
|
|
11
11
|
import {
|
|
12
12
|
bilingualDescriptionForField,
|
|
13
13
|
bilingualLabelForField,
|
|
@@ -15,17 +15,17 @@ import {
|
|
|
15
15
|
generatedFilesForSync,
|
|
16
16
|
moduleSourcePaths,
|
|
17
17
|
sourceFile
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-4zgs8g1w.js";
|
|
19
19
|
import {
|
|
20
20
|
Prompter
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-xwgm94zr.js";
|
|
22
22
|
import {
|
|
23
23
|
runner,
|
|
24
24
|
script
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-jk9q6pse.js";
|
|
26
26
|
import {
|
|
27
27
|
ModuleExecutor
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-jtm86byd.js";
|
|
29
29
|
import {
|
|
30
30
|
FileSys
|
|
31
31
|
} from "./index-67546d0j.js";
|
|
@@ -4,17 +4,17 @@ import {
|
|
|
4
4
|
CloudApi,
|
|
5
5
|
GlobalConfig,
|
|
6
6
|
getDefaultHostConfig
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-3pgtw35d.js";
|
|
8
8
|
import {
|
|
9
9
|
openBrowser
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-tq1y56tp.js";
|
|
11
11
|
import {
|
|
12
12
|
runner
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-jk9q6pse.js";
|
|
14
14
|
import {
|
|
15
15
|
AppExecutor,
|
|
16
16
|
WorkspaceExecutor
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-jtm86byd.js";
|
|
18
18
|
|
|
19
19
|
// pkgs/@akanjs/cli/cloud/cloud.runner.ts
|
|
20
20
|
import path from "path";
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./index-76rn3g2c.js";
|
|
6
6
|
import {
|
|
7
7
|
CommandExecutionError
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-jtm86byd.js";
|
|
9
9
|
|
|
10
10
|
// pkgs/@akanjs/devkit/capacitorApp.ts
|
|
11
11
|
import { cp, mkdir, readFile, rm, writeFile } from "fs/promises";
|
|
@@ -514,6 +514,10 @@ function getAdbDeviceStateIssues(output) {
|
|
|
514
514
|
return [];
|
|
515
515
|
});
|
|
516
516
|
}
|
|
517
|
+
function getAndroidLocalServerHost(adbDevicesOutput, fallbackHost) {
|
|
518
|
+
const onlineDeviceIds = adbDevicesOutput?.split(/\r?\n/).map((line) => line.trim().split(/\s+/)).filter(([id, state]) => id && state === "device").map(([id]) => id) ?? [];
|
|
519
|
+
return onlineDeviceIds.length === 1 && onlineDeviceIds[0]?.startsWith("emulator-") ? "10.0.2.2" : fallbackHost;
|
|
520
|
+
}
|
|
517
521
|
var ANDROID_MIN_SDK_VERSION = 26;
|
|
518
522
|
function raiseGradleMinSdkVersion(content, floor = ANDROID_MIN_SDK_VERSION) {
|
|
519
523
|
const match = content.match(/minSdkVersion\s*=\s*(\d+)/);
|
|
@@ -691,7 +695,7 @@ class CapacitorApp {
|
|
|
691
695
|
async save() {
|
|
692
696
|
await this.project.commit();
|
|
693
697
|
}
|
|
694
|
-
async#prepareIos({ operation, env, regenerate = false }) {
|
|
698
|
+
async#prepareIos({ operation, env, regenerate = false, iosRunTargetKind }) {
|
|
695
699
|
await this.init({ platform: "ios", operation, env, regenerate });
|
|
696
700
|
await this.#prepareTargetAssets();
|
|
697
701
|
await this.#prepareExternalFiles("ios");
|
|
@@ -700,9 +704,10 @@ class CapacitorApp {
|
|
|
700
704
|
await this.#applyDeepLinks("ios", { operation, env });
|
|
701
705
|
await this.#flushIosEntitlements();
|
|
702
706
|
await this.project.commit();
|
|
707
|
+
await this.#setCodeSignEntitlementsInIosIfExists("App/App.entitlements");
|
|
703
708
|
await this.#generateAssets({ operation, env });
|
|
704
709
|
this.app.verbose(`syncing iOS`);
|
|
705
|
-
await this.#spawnMobile("npx", ["cap", "sync", "ios"], { operation, env });
|
|
710
|
+
await this.#spawnMobile("npx", ["cap", "sync", "ios"], { operation, env }, { iosRunTargetKind });
|
|
706
711
|
this.app.verbose(`sync completed.`);
|
|
707
712
|
}
|
|
708
713
|
async buildIos({ env = "debug", regenerate = false } = {}) {
|
|
@@ -721,10 +726,10 @@ class CapacitorApp {
|
|
|
721
726
|
async runIos({ operation, env, regenerate = false, noAllowProvisioningUpdates = false, iosDeviceId }) {
|
|
722
727
|
if (operation === "release")
|
|
723
728
|
await this.prepareWww();
|
|
724
|
-
await this.#prepareIos({ operation, env, regenerate });
|
|
725
729
|
const runTarget = await this.#selectIosRunTarget(iosDeviceId);
|
|
730
|
+
await this.#prepareIos({ operation, env, regenerate, iosRunTargetKind: runTarget.kind });
|
|
726
731
|
if (runTarget.kind === "simulator") {
|
|
727
|
-
await this.#spawnMobile("npx", ["cap", "run", "ios", "--target", runTarget.id], { operation, env }, { stdio: "inherit" });
|
|
732
|
+
await this.#spawnMobile("npx", ["cap", "run", "ios", "--target", runTarget.id, "--no-sync"], { operation, env }, { stdio: "inherit", platform: "ios", iosRunTargetKind: runTarget.kind });
|
|
728
733
|
return;
|
|
729
734
|
}
|
|
730
735
|
await this.#runIosPhysicalDevice({ operation, env, runTarget, noAllowProvisioningUpdates });
|
|
@@ -800,7 +805,7 @@ ${textError instanceof Error ? textError.message : ""}`);
|
|
|
800
805
|
noAllowProvisioningUpdates
|
|
801
806
|
}) {
|
|
802
807
|
const mobileEnv = sanitizeIosNativeRunEnv(await this.#commandEnv(operation, env));
|
|
803
|
-
const configContent = await this.#writeCapacitorConfig({ operation }, mobileEnv);
|
|
808
|
+
const configContent = await this.#writeCapacitorConfig({ operation, platform: "ios", iosRunTargetKind: runTarget.kind }, mobileEnv);
|
|
804
809
|
await this.#writeRootCapacitorConfig(configContent);
|
|
805
810
|
const scheme = this.#iosScheme();
|
|
806
811
|
const command = buildIosNativeRunCommand({
|
|
@@ -857,6 +862,7 @@ ${error.message}`;
|
|
|
857
862
|
await this.#applyAndroidMinSdkVersion();
|
|
858
863
|
await this.#applyPermissions({ operation, env });
|
|
859
864
|
await this.#applyDeepLinks("android", { operation, env });
|
|
865
|
+
await this.#disableNativeKeyboardResizeInAndroid();
|
|
860
866
|
await this.project.commit();
|
|
861
867
|
await this.#generateAssets({ operation, env });
|
|
862
868
|
await this.#ensureAndroidAssetsDir();
|
|
@@ -916,6 +922,23 @@ ${error.message}`;
|
|
|
916
922
|
async openAndroid() {
|
|
917
923
|
await this.#spawnMobile("npx", ["cap", "open", "android"], { operation: "local", env: "local" });
|
|
918
924
|
}
|
|
925
|
+
async#disableNativeKeyboardResizeInAndroid() {
|
|
926
|
+
const manifestPath = path.join(this.app.cwdPath, this.androidRootPath, "app/src/main/AndroidManifest.xml");
|
|
927
|
+
let manifest = await readFile(manifestPath, "utf8");
|
|
928
|
+
let changed = false;
|
|
929
|
+
manifest = manifest.replace(/<activity\b[^>]*android:name="\.MainActivity"[^>]*>/, (activityTag) => {
|
|
930
|
+
if (activityTag.includes("android:windowSoftInputMode=")) {
|
|
931
|
+
const nextTag = activityTag.replace(/android:windowSoftInputMode="[^"]*"/, 'android:windowSoftInputMode="adjustNothing"');
|
|
932
|
+
changed ||= nextTag !== activityTag;
|
|
933
|
+
return nextTag;
|
|
934
|
+
}
|
|
935
|
+
changed = true;
|
|
936
|
+
return activityTag.replace(/>$/, `
|
|
937
|
+
android:windowSoftInputMode="adjustNothing">`);
|
|
938
|
+
});
|
|
939
|
+
if (changed)
|
|
940
|
+
await writeFile(manifestPath, manifest);
|
|
941
|
+
}
|
|
919
942
|
async#ensureAndroidAssetsDir() {
|
|
920
943
|
await mkdir(path.join(this.app.cwdPath, this.androidAssetsPath), { recursive: true });
|
|
921
944
|
}
|
|
@@ -1005,12 +1028,16 @@ ${error.message}`;
|
|
|
1005
1028
|
return html.replace(/<\/head\s*>/i, `${script}
|
|
1006
1029
|
</head>`);
|
|
1007
1030
|
}
|
|
1008
|
-
async#writeCapacitorConfig({
|
|
1031
|
+
async#writeCapacitorConfig({
|
|
1032
|
+
operation,
|
|
1033
|
+
platform,
|
|
1034
|
+
iosRunTargetKind
|
|
1035
|
+
}, commandEnv) {
|
|
1009
1036
|
await mkdir(this.targetRoot, { recursive: true });
|
|
1010
1037
|
let localIp;
|
|
1011
1038
|
if (operation === "local") {
|
|
1012
1039
|
const override = commandEnv.AKAN_PUBLIC_CLIENT_HOST ?? process.env.AKAN_PUBLIC_CLIENT_HOST;
|
|
1013
|
-
const resolution =
|
|
1040
|
+
const resolution = await this.#resolveLocalDevHost({ override, platform, iosRunTargetKind });
|
|
1014
1041
|
localIp = resolution.host;
|
|
1015
1042
|
this.#logDevHostResolution(resolution, commandEnv);
|
|
1016
1043
|
}
|
|
@@ -1024,9 +1051,29 @@ ${error.message}`;
|
|
|
1024
1051
|
await Bun.write(path.join(this.targetRoot, "capacitor.config.json"), content);
|
|
1025
1052
|
return content;
|
|
1026
1053
|
}
|
|
1054
|
+
async#resolveLocalDevHost({
|
|
1055
|
+
override,
|
|
1056
|
+
platform,
|
|
1057
|
+
iosRunTargetKind
|
|
1058
|
+
}) {
|
|
1059
|
+
const resolution = selectLocalDevHost(os.networkInterfaces(), { override });
|
|
1060
|
+
if (resolution.source === "override")
|
|
1061
|
+
return resolution;
|
|
1062
|
+
if (platform === "ios" && iosRunTargetKind === "simulator")
|
|
1063
|
+
return { ...resolution, host: "localhost", source: "platform" };
|
|
1064
|
+
if (platform === "android") {
|
|
1065
|
+
try {
|
|
1066
|
+
const host = getAndroidLocalServerHost(await this.#spawn("adb", ["devices"]), resolution.host);
|
|
1067
|
+
return host === resolution.host ? resolution : { ...resolution, host, source: "platform" };
|
|
1068
|
+
} catch {
|
|
1069
|
+
return resolution;
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
return resolution;
|
|
1073
|
+
}
|
|
1027
1074
|
#logDevHostResolution(resolution, commandEnv) {
|
|
1028
1075
|
this.app.log(`Mobile live-reload server: ${this.#localCsrUrl(resolution.host, commandEnv)}`);
|
|
1029
|
-
if (resolution.source === "override")
|
|
1076
|
+
if (resolution.source === "override" || resolution.source === "platform")
|
|
1030
1077
|
return;
|
|
1031
1078
|
const suspicious = resolution.host === "127.0.0.1" || resolution.host.startsWith("169.254.");
|
|
1032
1079
|
const alternatives = resolution.candidates.filter((candidate) => candidate.address !== resolution.host);
|
|
@@ -1226,18 +1273,26 @@ ${error.message}`;
|
|
|
1226
1273
|
return await this.app.spawn(command, args, { cwd: this.app.cwdPath, ...options });
|
|
1227
1274
|
}
|
|
1228
1275
|
async#spawnMobile(command, args = [], { operation, env }, options = {}) {
|
|
1276
|
+
const { iosRunTargetKind, platform, ...spawnOptions } = options;
|
|
1229
1277
|
const mobileEnv = { ...await this.#commandEnv(operation, env), ...options.env };
|
|
1230
|
-
const configContent = await this.#writeCapacitorConfig({ operation }, mobileEnv);
|
|
1278
|
+
const configContent = await this.#writeCapacitorConfig({ operation, platform: platform ?? this.#inferMobilePlatform(args), iosRunTargetKind }, mobileEnv);
|
|
1231
1279
|
await this.#writeRootCapacitorConfig(configContent);
|
|
1232
1280
|
try {
|
|
1233
1281
|
return await this.#spawn(command, args, {
|
|
1234
|
-
...
|
|
1282
|
+
...spawnOptions,
|
|
1235
1283
|
env: mobileEnv
|
|
1236
1284
|
});
|
|
1237
1285
|
} finally {
|
|
1238
1286
|
await this.#clearRootCapacitorConfigs();
|
|
1239
1287
|
}
|
|
1240
1288
|
}
|
|
1289
|
+
#inferMobilePlatform(args) {
|
|
1290
|
+
if (args.includes("android"))
|
|
1291
|
+
return "android";
|
|
1292
|
+
if (args.includes("ios"))
|
|
1293
|
+
return "ios";
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1241
1296
|
async addCamera() {
|
|
1242
1297
|
await this.#setPermissionInIos({
|
|
1243
1298
|
cameraUsageDescription: "$(PRODUCT_NAME) requires access to the camera to take photos.",
|
|
@@ -1339,17 +1394,31 @@ ${error.message}`;
|
|
|
1339
1394
|
while (end < lines.length && !/^\s*\};\s*$/.test(lines[end] ?? ""))
|
|
1340
1395
|
end++;
|
|
1341
1396
|
const settings = lines.slice(start, end + 1);
|
|
1342
|
-
|
|
1343
|
-
continue;
|
|
1397
|
+
const configName = lines.slice(end + 1, end + 8).find((setting) => setting.includes("name = ")) ?? "";
|
|
1344
1398
|
const indent = line.match(/^\s*/)?.[0] ?? "";
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1399
|
+
const insertSettings = [];
|
|
1400
|
+
if (!settings.some((setting) => setting.includes("CODE_SIGN_ENTITLEMENTS"))) {
|
|
1401
|
+
insertSettings.push(`${indent}CODE_SIGN_ENTITLEMENTS = ${entitlementsRelPath};`);
|
|
1402
|
+
}
|
|
1403
|
+
if (configName.includes("name = Debug;") && !settings.some((setting) => setting.includes("CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION"))) {
|
|
1404
|
+
insertSettings.push(`${indent}CODE_SIGN_ALLOW_ENTITLEMENTS_MODIFICATION = YES;`);
|
|
1405
|
+
}
|
|
1406
|
+
if (insertSettings.length > 0) {
|
|
1407
|
+
lines.splice(index, 0, ...insertSettings);
|
|
1408
|
+
index += insertSettings.length;
|
|
1409
|
+
changed = true;
|
|
1410
|
+
}
|
|
1348
1411
|
}
|
|
1349
1412
|
if (changed)
|
|
1350
1413
|
await writeFile(pbxprojPath, lines.join(`
|
|
1351
1414
|
`));
|
|
1352
1415
|
}
|
|
1416
|
+
async#setCodeSignEntitlementsInIosIfExists(entitlementsRelPath) {
|
|
1417
|
+
const entitlementsPath = path.join(this.app.cwdPath, this.iosProjectPath, entitlementsRelPath);
|
|
1418
|
+
if (!await Bun.file(entitlementsPath).exists())
|
|
1419
|
+
return;
|
|
1420
|
+
await this.#setCodeSignEntitlementsInIos(entitlementsRelPath);
|
|
1421
|
+
}
|
|
1353
1422
|
async#setUrlSchemesInAndroid(schemes) {
|
|
1354
1423
|
const manifestPath = path.join(this.app.cwdPath, this.androidRootPath, "app/src/main/AndroidManifest.xml");
|
|
1355
1424
|
let manifest = await readFile(manifestPath, "utf8");
|
|
@@ -1444,4 +1513,4 @@ ${filter}$1`);
|
|
|
1444
1513
|
}
|
|
1445
1514
|
}
|
|
1446
1515
|
|
|
1447
|
-
export { SWIFTUICORE_MIN_IOS_MAJOR, rootCapacitorConfigFilenames, rootCapacitorConfigPaths, clearRootCapacitorConfigs, writeRootCapacitorConfig, selectLocalDevHost, parseIosRuntimeMajor, sortIosRunTargets, parseDevicectlDevices, parseSimctlDevices, buildIosNativeRunCommand, classifyIosRunFailure, formatIosRunFailureMessage, sanitizeIosNativeRunEnv, PLACEHOLDER_APP_IDS, isPlaceholderAppId, getMissingAndroidReleaseSigningKeys, formatAndroidReleaseSigningError, getAdbDeviceStateIssues, ANDROID_MIN_SDK_VERSION, raiseGradleMinSdkVersion, assertJsonSerializable, materializeCapacitorConfig, CapacitorApp };
|
|
1516
|
+
export { SWIFTUICORE_MIN_IOS_MAJOR, rootCapacitorConfigFilenames, rootCapacitorConfigPaths, clearRootCapacitorConfigs, writeRootCapacitorConfig, selectLocalDevHost, parseIosRuntimeMajor, sortIosRunTargets, parseDevicectlDevices, parseSimctlDevices, buildIosNativeRunCommand, classifyIosRunFailure, formatIosRunFailureMessage, sanitizeIosNativeRunEnv, PLACEHOLDER_APP_IDS, isPlaceholderAppId, getMissingAndroidReleaseSigningKeys, formatAndroidReleaseSigningError, getAdbDeviceStateIssues, getAndroidLocalServerHost, ANDROID_MIN_SDK_VERSION, raiseGradleMinSdkVersion, assertJsonSerializable, materializeCapacitorConfig, CapacitorApp };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
CloudRunner
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-xj8bks3p.js";
|
|
5
5
|
import {
|
|
6
6
|
PackageScript
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-e3qskyt2.js";
|
|
8
8
|
import {
|
|
9
9
|
AiSession,
|
|
10
10
|
CloudApi,
|
|
11
11
|
GlobalConfig
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-3pgtw35d.js";
|
|
13
13
|
import {
|
|
14
14
|
ApplicationScript
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-tq1y56tp.js";
|
|
16
16
|
import {
|
|
17
17
|
script
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-jk9q6pse.js";
|
|
19
19
|
import {
|
|
20
20
|
PkgExecutor
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-jtm86byd.js";
|
|
22
22
|
|
|
23
23
|
// pkgs/@akanjs/cli/cloud/cloud.script.ts
|
|
24
24
|
import { Logger } from "akanjs/common";
|
package/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
getTargetCommandNames,
|
|
5
5
|
getTargetMetas,
|
|
6
6
|
runCommands
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
7
|
+
} from "./index-jk9q6pse.js";
|
|
8
|
+
import"./index-jtm86byd.js";
|
|
9
|
+
import"./index-6pz1j0zj.js";
|
|
10
10
|
import"./index-67546d0j.js";
|
|
11
11
|
import {
|
|
12
12
|
__require
|
|
@@ -17,22 +17,22 @@ import path from "path";
|
|
|
17
17
|
|
|
18
18
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
19
19
|
var commandModules = {
|
|
20
|
-
workspace: async () => (await import("./workspace.command-
|
|
21
|
-
agent: async () => (await import("./agent.command-
|
|
22
|
-
application: async () => (await import("./application.command-
|
|
23
|
-
library: async () => (await import("./library.command-
|
|
24
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
25
|
-
package: async () => (await import("./package.command-
|
|
26
|
-
module: async () => (await import("./module.command-
|
|
27
|
-
page: async () => (await import("./page.command-
|
|
28
|
-
context: async () => (await import("./context.command-
|
|
29
|
-
cloud: async () => (await import("./cloud.command-
|
|
30
|
-
guideline: async () => (await import("./guideline.command-
|
|
31
|
-
scalar: async () => (await import("./scalar.command-
|
|
32
|
-
primitive: async () => (await import("./primitive.command-
|
|
33
|
-
quality: async () => (await import("./quality.command-
|
|
34
|
-
repair: async () => (await import("./repair.command-
|
|
35
|
-
workflow: async () => (await import("./workflow.command-
|
|
20
|
+
workspace: async () => (await import("./workspace.command-h9wwcjpt.js")).WorkspaceCommand,
|
|
21
|
+
agent: async () => (await import("./agent.command-jfz8yfwy.js")).AgentCommand,
|
|
22
|
+
application: async () => (await import("./application.command-mxyqtd6p.js")).ApplicationCommand,
|
|
23
|
+
library: async () => (await import("./library.command-pwfx8dx2.js")).LibraryCommand,
|
|
24
|
+
localRegistry: async () => (await import("./localRegistry.command-r4zjx5py.js")).LocalRegistryCommand,
|
|
25
|
+
package: async () => (await import("./package.command-7hmkxvpa.js")).PackageCommand,
|
|
26
|
+
module: async () => (await import("./module.command-0t3ewata.js")).ModuleCommand,
|
|
27
|
+
page: async () => (await import("./page.command-st6r4s0q.js")).PageCommand,
|
|
28
|
+
context: async () => (await import("./context.command-z5bf8bn7.js")).ContextCommand,
|
|
29
|
+
cloud: async () => (await import("./cloud.command-f87dwe52.js")).CloudCommand,
|
|
30
|
+
guideline: async () => (await import("./guideline.command-1m1ctar3.js")).GuidelineCommand,
|
|
31
|
+
scalar: async () => (await import("./scalar.command-fjq272gs.js")).ScalarCommand,
|
|
32
|
+
primitive: async () => (await import("./primitive.command-1qkxpzsn.js")).PrimitiveCommand,
|
|
33
|
+
quality: async () => (await import("./quality.command-hy5vt1bh.js")).QualityCommand,
|
|
34
|
+
repair: async () => (await import("./repair.command-nakkq2zp.js")).RepairCommand,
|
|
35
|
+
workflow: async () => (await import("./workflow.command-jswbgk90.js")).WorkflowCommand
|
|
36
36
|
};
|
|
37
37
|
var commandModuleIds = Object.keys(commandModules);
|
|
38
38
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
LibraryScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-cn24dcqn.js";
|
|
5
5
|
import {
|
|
6
6
|
Lib,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
9
|
+
} from "./index-jk9q6pse.js";
|
|
10
|
+
import"./index-jtm86byd.js";
|
|
11
|
+
import"./index-6pz1j0zj.js";
|
|
12
12
|
import"./index-67546d0j.js";
|
|
13
13
|
import"./index-r24hmh0q.js";
|
|
14
14
|
|
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CloudRunner,
|
|
4
4
|
getNpmRegistryUrl
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-xj8bks3p.js";
|
|
6
6
|
import {
|
|
7
7
|
PackageScript
|
|
8
|
-
} from "./index-
|
|
9
|
-
import"./index-
|
|
8
|
+
} from "./index-e3qskyt2.js";
|
|
9
|
+
import"./index-3pgtw35d.js";
|
|
10
10
|
import {
|
|
11
11
|
ApplicationScript
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-tq1y56tp.js";
|
|
13
13
|
import"./index-76rn3g2c.js";
|
|
14
|
-
import"./index-
|
|
14
|
+
import"./index-cn24dcqn.js";
|
|
15
15
|
import {
|
|
16
16
|
Workspace,
|
|
17
17
|
command,
|
|
18
18
|
runner,
|
|
19
19
|
script
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-jk9q6pse.js";
|
|
21
21
|
import"./index-fgc8r6dj.js";
|
|
22
22
|
import"./index-bjpxzr6s.js";
|
|
23
23
|
import {
|
|
24
24
|
PkgExecutor
|
|
25
|
-
} from "./index-
|
|
26
|
-
import"./index-
|
|
25
|
+
} from "./index-jtm86byd.js";
|
|
26
|
+
import"./index-6pz1j0zj.js";
|
|
27
27
|
import"./index-46tjzh6s.js";
|
|
28
28
|
import"./index-67546d0j.js";
|
|
29
29
|
import"./index-r24hmh0q.js";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ModuleScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
4
|
+
} from "./index-vhv3xnjz.js";
|
|
5
|
+
import"./index-hjzr8ja1.js";
|
|
6
6
|
import"./index-ss469dec.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-3pgtw35d.js";
|
|
8
8
|
import {
|
|
9
9
|
renderPrimitiveReport
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
} from "./index-4zgs8g1w.js";
|
|
11
|
+
import"./index-xwgm94zr.js";
|
|
12
12
|
import {
|
|
13
13
|
Module,
|
|
14
14
|
Sys,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
16
|
+
} from "./index-jk9q6pse.js";
|
|
17
|
+
import"./index-jtm86byd.js";
|
|
18
|
+
import"./index-6pz1j0zj.js";
|
|
19
19
|
import"./index-67546d0j.js";
|
|
20
20
|
import"./index-r24hmh0q.js";
|
|
21
21
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PackageScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-e3qskyt2.js";
|
|
5
5
|
import {
|
|
6
6
|
Pkg,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
9
|
+
} from "./index-jk9q6pse.js";
|
|
10
|
+
import"./index-jtm86byd.js";
|
|
11
|
+
import"./index-6pz1j0zj.js";
|
|
12
12
|
import"./index-46tjzh6s.js";
|
|
13
13
|
import"./index-67546d0j.js";
|
|
14
14
|
import"./index-r24hmh0q.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.4",
|
|
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": "3.0.0-alpha.
|
|
37
|
+
"akanjs": "3.0.0-alpha.4",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"dayjs": "^1.11.20",
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PageScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-hjzr8ja1.js";
|
|
5
5
|
import {
|
|
6
6
|
App,
|
|
7
7
|
Module,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
9
|
+
} from "./index-jk9q6pse.js";
|
|
10
|
+
import"./index-jtm86byd.js";
|
|
11
|
+
import"./index-6pz1j0zj.js";
|
|
12
12
|
import"./index-67546d0j.js";
|
|
13
13
|
import"./index-r24hmh0q.js";
|
|
14
14
|
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PrimitiveScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-r4w8cry5.js";
|
|
5
|
+
import"./index-vhv3xnjz.js";
|
|
6
|
+
import"./index-hjzr8ja1.js";
|
|
7
7
|
import"./index-ss469dec.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-3pgtw35d.js";
|
|
9
9
|
import {
|
|
10
10
|
renderPrimitiveReport
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-4zgs8g1w.js";
|
|
12
|
+
import"./index-xwgm94zr.js";
|
|
13
13
|
import {
|
|
14
14
|
Workspace,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
18
|
-
import"./index-
|
|
16
|
+
} from "./index-jk9q6pse.js";
|
|
17
|
+
import"./index-jtm86byd.js";
|
|
18
|
+
import"./index-6pz1j0zj.js";
|
|
19
19
|
import"./index-67546d0j.js";
|
|
20
20
|
import"./index-r24hmh0q.js";
|
|
21
21
|
|