@akanjs/cli 2.3.8-rc.5 → 2.3.8
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 +8 -7
- package/index.js +19 -24
- package/package.json +2 -2
|
@@ -1061,7 +1061,8 @@ var decreaseBuildNum = async (app) => {
|
|
|
1061
1061
|
};
|
|
1062
1062
|
// pkgs/@akanjs/devkit/getDirname.ts
|
|
1063
1063
|
import path2 from "path";
|
|
1064
|
-
|
|
1064
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1065
|
+
var getDirname = (url) => path2.dirname(fileURLToPath2(url));
|
|
1065
1066
|
|
|
1066
1067
|
// pkgs/@akanjs/devkit/linter.ts
|
|
1067
1068
|
import { spawn } from "child_process";
|
|
@@ -4120,7 +4121,7 @@ var BACKEND_RESTART_DEBOUNCE_MS = 120;
|
|
|
4120
4121
|
var BACKEND_GRACEFUL_TIMEOUT_MS = 3000;
|
|
4121
4122
|
var BACKEND_RECOVERY_BASE_DELAY_MS = 1000;
|
|
4122
4123
|
var BACKEND_RECOVERY_MAX_DELAY_MS = 30000;
|
|
4123
|
-
var BUILDER_READY_TIMEOUT_MS =
|
|
4124
|
+
var BUILDER_READY_TIMEOUT_MS = 150000;
|
|
4124
4125
|
var BUILDER_START_MAX_ATTEMPTS = 3;
|
|
4125
4126
|
var SOURCE_EXTS = new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"]);
|
|
4126
4127
|
var NON_SOURCE_EXT_RE = /\.(css|scss|sass|less|json|svg|png|jpe?g|webp|gif|avif|ico|woff2?|ttf|otf|mp3|mp4|wav|html)$/i;
|
|
@@ -9600,13 +9601,9 @@ var getMobileTargets = async (app) => {
|
|
|
9600
9601
|
var getMobileTargetChoices = async (app) => {
|
|
9601
9602
|
const config = await app.getConfig();
|
|
9602
9603
|
const targetNames = Object.keys(config.mobile.targets);
|
|
9603
|
-
if (targetNames.length > 1)
|
|
9604
|
-
return targetNames;
|
|
9605
|
-
const basePaths = [...config.basePaths];
|
|
9606
|
-
if (basePaths.length > 1)
|
|
9607
|
-
return basePaths;
|
|
9608
9604
|
if (targetNames.length > 0)
|
|
9609
9605
|
return targetNames;
|
|
9606
|
+
const basePaths = [...config.basePaths];
|
|
9610
9607
|
return basePaths;
|
|
9611
9608
|
};
|
|
9612
9609
|
var resolveMobileTargetByBasePath = (targets, basePath2) => {
|
|
@@ -9631,6 +9628,8 @@ var resolveMobileTargets = async (app, selection) => {
|
|
|
9631
9628
|
const targets = await getMobileTargets(app);
|
|
9632
9629
|
if (targets.length === 0)
|
|
9633
9630
|
throw new Error(`No mobile targets configured for ${app.name}`);
|
|
9631
|
+
if (!selection && targets.length === 1)
|
|
9632
|
+
return targets;
|
|
9634
9633
|
if (!selection) {
|
|
9635
9634
|
const choices2 = await getMobileTargetChoices(app);
|
|
9636
9635
|
if (choices2.length === 1)
|
|
@@ -11007,6 +11006,8 @@ var getOptionValue = async (argMeta, opt, context) => {
|
|
|
11007
11006
|
return defaultValue;
|
|
11008
11007
|
if (enumChoices) {
|
|
11009
11008
|
const choices = normalizeEnumChoices(await resolveEnumChoices(argMeta, context) ?? []);
|
|
11009
|
+
if (choices.length === 1)
|
|
11010
|
+
return choices[0]?.value;
|
|
11010
11011
|
const choice = await select3({ message: ask ?? desc ?? `Select the ${name} value`, choices });
|
|
11011
11012
|
return choice;
|
|
11012
11013
|
} else if (nullable)
|
package/index.js
CHANGED
|
@@ -1059,7 +1059,8 @@ var decreaseBuildNum = async (app) => {
|
|
|
1059
1059
|
};
|
|
1060
1060
|
// pkgs/@akanjs/devkit/getDirname.ts
|
|
1061
1061
|
import path2 from "path";
|
|
1062
|
-
|
|
1062
|
+
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1063
|
+
var getDirname = (url) => path2.dirname(fileURLToPath2(url));
|
|
1063
1064
|
|
|
1064
1065
|
// pkgs/@akanjs/devkit/linter.ts
|
|
1065
1066
|
import { spawn } from "child_process";
|
|
@@ -4118,7 +4119,7 @@ var BACKEND_RESTART_DEBOUNCE_MS = 120;
|
|
|
4118
4119
|
var BACKEND_GRACEFUL_TIMEOUT_MS = 3000;
|
|
4119
4120
|
var BACKEND_RECOVERY_BASE_DELAY_MS = 1000;
|
|
4120
4121
|
var BACKEND_RECOVERY_MAX_DELAY_MS = 30000;
|
|
4121
|
-
var BUILDER_READY_TIMEOUT_MS =
|
|
4122
|
+
var BUILDER_READY_TIMEOUT_MS = 150000;
|
|
4122
4123
|
var BUILDER_START_MAX_ATTEMPTS = 3;
|
|
4123
4124
|
var SOURCE_EXTS = new Set([".ts", ".tsx", ".js", ".jsx", ".mjs", ".cjs"]);
|
|
4124
4125
|
var NON_SOURCE_EXT_RE = /\.(css|scss|sass|less|json|svg|png|jpe?g|webp|gif|avif|ico|woff2?|ttf|otf|mp3|mp4|wav|html)$/i;
|
|
@@ -9598,13 +9599,9 @@ var getMobileTargets = async (app) => {
|
|
|
9598
9599
|
var getMobileTargetChoices = async (app) => {
|
|
9599
9600
|
const config = await app.getConfig();
|
|
9600
9601
|
const targetNames = Object.keys(config.mobile.targets);
|
|
9601
|
-
if (targetNames.length > 1)
|
|
9602
|
-
return targetNames;
|
|
9603
|
-
const basePaths = [...config.basePaths];
|
|
9604
|
-
if (basePaths.length > 1)
|
|
9605
|
-
return basePaths;
|
|
9606
9602
|
if (targetNames.length > 0)
|
|
9607
9603
|
return targetNames;
|
|
9604
|
+
const basePaths = [...config.basePaths];
|
|
9608
9605
|
return basePaths;
|
|
9609
9606
|
};
|
|
9610
9607
|
var resolveMobileTargetByBasePath = (targets, basePath2) => {
|
|
@@ -9629,6 +9626,8 @@ var resolveMobileTargets = async (app, selection) => {
|
|
|
9629
9626
|
const targets = await getMobileTargets(app);
|
|
9630
9627
|
if (targets.length === 0)
|
|
9631
9628
|
throw new Error(`No mobile targets configured for ${app.name}`);
|
|
9629
|
+
if (!selection && targets.length === 1)
|
|
9630
|
+
return targets;
|
|
9632
9631
|
if (!selection) {
|
|
9633
9632
|
const choices2 = await getMobileTargetChoices(app);
|
|
9634
9633
|
if (choices2.length === 1)
|
|
@@ -11005,6 +11004,8 @@ var getOptionValue = async (argMeta, opt, context) => {
|
|
|
11005
11004
|
return defaultValue;
|
|
11006
11005
|
if (enumChoices) {
|
|
11007
11006
|
const choices = normalizeEnumChoices(await resolveEnumChoices(argMeta, context) ?? []);
|
|
11007
|
+
if (choices.length === 1)
|
|
11008
|
+
return choices[0]?.value;
|
|
11008
11009
|
const choice = await select3({ message: ask ?? desc ?? `Select the ${name} value`, choices });
|
|
11009
11010
|
return choice;
|
|
11010
11011
|
} else if (nullable)
|
|
@@ -12506,6 +12507,11 @@ class ApplicationScript extends script("application", [
|
|
|
12506
12507
|
|
|
12507
12508
|
// pkgs/@akanjs/cli/application/application.command.ts
|
|
12508
12509
|
var asMobileEnv = (env) => env;
|
|
12510
|
+
var mobileTargetOption = {
|
|
12511
|
+
desc: "mobile target name or all",
|
|
12512
|
+
ask: "Select mobile target",
|
|
12513
|
+
enum: async ({ app }) => await getMobileTargetChoices(app)
|
|
12514
|
+
};
|
|
12509
12515
|
|
|
12510
12516
|
class ApplicationCommand extends command("application", [ApplicationScript], ({ public: target }) => ({
|
|
12511
12517
|
createApplication: target({ desc: "Create a new application in the workspace" }).arg("appName", String, { desc: "name of application" }).option("start", Boolean, { desc: "start application", default: false }).with(Workspace).exec(async function(appName, start, workspace) {
|
|
@@ -12532,22 +12538,14 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
12532
12538
|
test: target({ desc: "Prepare and test an app, library, or package" }).with(Exec).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(exec2, write) {
|
|
12533
12539
|
await this.applicationScript.test(exec2, { write });
|
|
12534
12540
|
}),
|
|
12535
|
-
buildIos: target({ short: true, desc: "Build iOS app with Capacitor" }).with(App).option("target", String, {
|
|
12536
|
-
desc: "mobile target name or all",
|
|
12537
|
-
ask: "Select mobile target",
|
|
12538
|
-
enum: async ({ app }) => await getMobileTargetChoices(app)
|
|
12539
|
-
}).option("env", String, {
|
|
12541
|
+
buildIos: target({ short: true, desc: "Build iOS app with Capacitor" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
|
|
12540
12542
|
enum: ["local", "debug", "develop", "main"],
|
|
12541
12543
|
desc: "backend environment",
|
|
12542
12544
|
default: "debug"
|
|
12543
12545
|
}).option("write", Boolean, { desc: "write code generation", default: true }).option("regenerate", Boolean, { flag: "g", desc: "delete and regenerate native project", default: false }).exec(async function(app, target2, env, write, regenerate) {
|
|
12544
12546
|
await this.applicationScript.buildIos(app, { target: target2, env: asMobileEnv(env), write, regenerate });
|
|
12545
12547
|
}),
|
|
12546
|
-
buildAndroid: target({ short: true, desc: "Build Android app with Capacitor" }).with(App).option("target", String, {
|
|
12547
|
-
desc: "mobile target name or all",
|
|
12548
|
-
ask: "Select mobile target",
|
|
12549
|
-
enum: async ({ app }) => await getMobileTargetChoices(app)
|
|
12550
|
-
}).option("env", String, {
|
|
12548
|
+
buildAndroid: target({ short: true, desc: "Build Android app with Capacitor" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
|
|
12551
12549
|
enum: ["local", "debug", "develop", "main"],
|
|
12552
12550
|
desc: "backend environment",
|
|
12553
12551
|
default: "debug"
|
|
@@ -12557,10 +12555,7 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
12557
12555
|
start: target({ short: true, desc: "Start development server (frontend SSR + backend)" }).with(App).option("open", Boolean, { desc: "open web browser?", default: false }).option("write", Boolean, { desc: "write code generation", default: true }).exec(async function(app, open, write) {
|
|
12558
12556
|
await this.applicationScript.start(app, { open, write });
|
|
12559
12557
|
}),
|
|
12560
|
-
startIos: target({ short: true, desc: "Start iOS app in simulator or device" }).with(App).option("target", String, {
|
|
12561
|
-
ask: "Select mobile target",
|
|
12562
|
-
enum: async ({ app }) => await getMobileTargetChoices(app)
|
|
12563
|
-
}).option("env", String, {
|
|
12558
|
+
startIos: target({ short: true, desc: "Start iOS app in simulator or device" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
|
|
12564
12559
|
enum: ["local", "debug", "develop", "main"],
|
|
12565
12560
|
desc: "backend environment",
|
|
12566
12561
|
default: "local"
|
|
@@ -12578,7 +12573,7 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
12578
12573
|
noAllowProvisioningUpdates
|
|
12579
12574
|
});
|
|
12580
12575
|
}),
|
|
12581
|
-
startAndroid: target({ short: true, desc: "Start Android app in emulator or device" }).with(App).option("target", String,
|
|
12576
|
+
startAndroid: target({ short: true, desc: "Start Android app in emulator or device" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
|
|
12582
12577
|
enum: ["local", "debug", "develop", "main"],
|
|
12583
12578
|
desc: "backend environment",
|
|
12584
12579
|
default: "local"
|
|
@@ -12592,7 +12587,7 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
12592
12587
|
regenerate
|
|
12593
12588
|
});
|
|
12594
12589
|
}),
|
|
12595
|
-
releaseIos: target({ desc: "Build and package iOS app for release (App Store)" }).with(App).option("target", String,
|
|
12590
|
+
releaseIos: target({ desc: "Build and package iOS app for release (App Store)" }).with(App).option("target", String, mobileTargetOption).option("env", String, {
|
|
12596
12591
|
enum: ["debug", "develop", "main", "local"],
|
|
12597
12592
|
desc: "backend environment",
|
|
12598
12593
|
default: "main"
|
|
@@ -12605,7 +12600,7 @@ class ApplicationCommand extends command("application", [ApplicationScript], ({
|
|
|
12605
12600
|
allowLocalRelease
|
|
12606
12601
|
});
|
|
12607
12602
|
}),
|
|
12608
|
-
releaseAndroid: target({ desc: "Build and package Android app for release (Play Store)" }).with(App).option("assembleType", String, { enum: ["apk", "aab"], default: "apk" }).option("target", String,
|
|
12603
|
+
releaseAndroid: target({ desc: "Build and package Android app for release (Play Store)" }).with(App).option("assembleType", String, { enum: ["apk", "aab"], default: "apk" }).option("target", String, mobileTargetOption).option("env", String, {
|
|
12609
12604
|
enum: ["debug", "develop", "main", "local"],
|
|
12610
12605
|
desc: "backend environment",
|
|
12611
12606
|
default: "main"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "2.3.8
|
|
3
|
+
"version": "2.3.8",
|
|
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.3.8
|
|
37
|
+
"akanjs": "2.3.8",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"daisyui": "5.5.23",
|