@akanjs/cli 3.2.0-rc.1 → 3.2.0-rc.11
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 +2 -1
- package/{CodeAgent-vmd9k4ak.js → CodeAgent-fk66n37w.js} +3 -3
- package/{CodeTui-zka44v52.js → CodeTui-4rf1mqmv.js} +1 -1
- package/README.ko.md +26 -1
- package/README.md +26 -1
- package/TunnelShare-44er4e29.js +15 -0
- package/{agent.command-2f657613.js → agent.command-7g9czkkd.js} +20 -19
- package/akanCode.js +3 -3
- package/{application.command-q6skd3am.js → application.command-00spg55s.js} +31 -24
- package/{applicationBuildRunner-sctcmkyx.js → applicationBuildRunner-f4yf0qyc.js} +9 -7
- package/buildBatch.proc.js +7 -6
- package/{cloud.command-7642pks6.js → cloud.command-ab704p0g.js} +24 -25
- package/cloud.script-4p4y0s7e.js +31 -0
- package/{code.command-7s4ndq2k.js → code.command-m6c9xk56.js} +7 -6
- package/{context.command-569z0rqf.js → context.command-hgcgxtdk.js} +20 -19
- package/context.runner-w071gmc3.js +30 -0
- package/{devTui-w38ch13a.js → devTui-h77zrjv5.js} +1 -1
- package/{guideline.command-gnv3e8p8.js → guideline.command-6yz6d4hf.js} +3 -2
- package/guidelines/agentRule/agentRule.instruction.md +4 -3
- package/guidelines/akanApi/akanApi.instruction.md +2 -0
- package/guidelines/conventions/core.md +1 -1
- package/guidelines/conventions/rules/app.md +3 -0
- package/guidelines/conventions/rules/page.md +5 -0
- package/guidelines/errorCodes/errorCodes.instruction.md +140 -0
- package/guidelines/fieldRule/fieldRule.instruction.md +2 -1
- package/guidelines/mcpRule/mcpRule.instruction.md +72 -2
- package/guidelines/pageRule/pageRule.instruction.md +5 -0
- package/guidelines/runtimeRule/runtimeRule.instruction.md +5 -1
- package/guidelines/transportRule/transportRule.instruction.md +5 -0
- package/incrementalBuilder.proc.js +8 -7
- package/{index-vkzfk7qt.js → index-097bjwvm.js} +40 -30
- package/{index-93ewzmp6.js → index-23d8gw08.js} +165 -102
- package/{index-p6hjwt2d.js → index-41mfhgq0.js} +72 -26
- package/{index-ktb3wcqz.js → index-4k9nv4m3.js} +71 -81
- package/{index-vr68mxj5.js → index-5jwx4bf2.js} +69 -33
- package/{index-5w9my9qe.js → index-6eptmk8z.js} +30 -20
- package/{index-d4n1wmrz.js → index-6fnrhpn1.js} +8 -4
- package/{index-kpdv34rq.js → index-6qtxs86x.js} +10 -7
- package/{index-ed6ea0qp.js → index-6z57w95f.js} +1 -1
- package/{index-drz9e84d.js → index-7ky4brfy.js} +2 -2
- package/{index-8g7tdsk4.js → index-849qvd7t.js} +58 -29
- package/{index-1q1cjn8s.js → index-9xh4zvw3.js} +94 -53
- package/{index-48d5qsj3.js → index-adj7qmz9.js} +23 -15
- package/{index-fjr4d6yd.js → index-apcr1qgk.js} +458 -304
- package/{index-8ts9774g.js → index-aybfcx58.js} +9 -4
- package/{index-8kczhnmv.js → index-b3pr4ee6.js} +1 -1
- package/{index-23860fej.js → index-b4qq3rq0.js} +23 -8
- package/{index-thckcabc.js → index-bper31wr.js} +24 -6
- package/{index-a8a9ede9.js → index-bxkx0x03.js} +14 -7
- package/{index-0fb3cpbt.js → index-c3r23w24.js} +9 -7
- package/{index-8pb9yvp8.js → index-dfsa009c.js} +148 -31
- package/{index-zpv14wpy.js → index-dsg50er9.js} +3 -3
- package/{index-hqrkqxx2.js → index-e5f6czck.js} +46 -7
- package/{index-sy481q2x.js → index-frvjq1rd.js} +1 -1
- package/{index-abgh0jve.js → index-grt0e6kk.js} +1 -1
- package/{index-e3vmjtph.js → index-hf9nvwam.js} +7 -2
- package/{index-v4p1zye8.js → index-hhagjhkh.js} +7 -7
- package/index-j4yvgfhr.js +70 -0
- package/{index-s2grpzef.js → index-k2r3hmbz.js} +6 -4
- package/{index-7y5yghjg.js → index-nd39rssn.js} +1162 -435
- package/{index-6wpaq392.js → index-p4htjyvk.js} +44 -5
- package/{index-aj3ehkcx.js → index-p54s83sz.js} +1 -1
- package/{index-7xdpww43.js → index-rdx8cyv2.js} +342 -134
- package/{index-sr5da35e.js → index-sq9d0jhj.js} +21 -18
- package/{index-eajbmk10.js → index-t4d0ckde.js} +2 -2
- package/{index-mqntfzv5.js → index-t8h09yjs.js} +7 -2
- package/index-va90m8nd.js +25 -0
- package/{index-rc5fvqj2.js → index-xfv2p7b5.js} +95 -58
- package/{index-w639tvkd.js → index-xgqz3kak.js} +29 -8
- package/{index-9tbgb4d8.js → index-xy70tcv4.js} +1 -1
- package/{index-mmym5xmb.js → index-z43wddce.js} +5 -3
- package/index.js +24 -23
- package/{library.command-1gp5qe3r.js → library.command-kc1zahcg.js} +5 -4
- package/{localRegistry.command-x7jptkd3.js → localRegistry.command-bz2df40m.js} +19 -18
- package/{module.command-4xz9he6h.js → module.command-cchwzz9r.js} +12 -7
- package/{package.command-s7qpnn1g.js → package.command-qcjajpv8.js} +8 -7
- package/package.json +2 -2
- package/{page.command-fan34c49.js → page.command-1t86dx8a.js} +4 -3
- package/{pipeline.command-ph4fnn9w.js → pipeline.command-2xx9z3d0.js} +3 -2
- package/{primitive.command-3fqh8emf.js → primitive.command-mc0x8txr.js} +8 -7
- package/{projectTypecheck-vkb40hjc.js → projectTypecheck-tz497yx7.js} +2 -1
- package/{quality.command-ecj6exsh.js → quality.command-11rayf5c.js} +7 -6
- package/{repair.command-fe9jw719.js → repair.command-8w41vy78.js} +7 -6
- package/{scalar.command-cnvfhk0n.js → scalar.command-rvwh98ny.js} +7 -6
- package/skills/akan-debug/SKILL.md +7 -3
- package/skills/akan-err/SKILL.md +7 -0
- package/skills/akan-mcp/SKILL.md +10 -1
- package/skills/akan-scaffold/SKILL.md +3 -2
- package/skills/akan-transport/SKILL.md +2 -0
- package/skills/akan-validate/SKILL.md +1 -0
- package/{subspace.command-qw5ddd6y.js → subspace.command-0970n7kd.js} +9 -8
- package/{tunnel.command-ggj38mqf.js → tunnel.command-bcy0rtmh.js} +8 -7
- package/typecheck.proc.js +5 -2
- package/{verify.command-w9ttxkdz.js → verify.command-ynaztxr2.js} +18 -16
- package/{workflow.command-ss8devj0.js → workflow.command-yp9ajthb.js} +45 -16
- package/{workspace.command-6z2rh8ze.js → workspace.command-e4wfxm86.js} +39 -34
- package/TunnelShare-k3ja4w9x.js +0 -14
- package/cloud.script-1sfseznn.js +0 -30
- package/context.runner-ms8v1rxy.js +0 -29
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
JsonFormatter
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-sq9d0jhj.js";
|
|
5
5
|
|
|
6
6
|
// pkgs/@akanjs/devkit/applicationBuildReporter.ts
|
|
7
7
|
import { realpathSync } from "fs";
|
|
@@ -694,47 +694,74 @@ class RouteJsBudget {
|
|
|
694
694
|
brotliBytes: urls.reduce((total, url) => total + (sizeByUrl.get(url)?.brotli ?? 0), 0)
|
|
695
695
|
})).sort((a, b) => b.brotliBytes - a.brotliBytes || RouteJsBudget.#byCodeUnit(a.routeId, b.routeId));
|
|
696
696
|
}
|
|
697
|
+
static modeOf({ checkBudget = false, updateBudget = false, raiseBudget = false }) {
|
|
698
|
+
if ([checkBudget, updateBudget, raiseBudget].filter(Boolean).length > 1)
|
|
699
|
+
throw new Error("Pass at most one of --check-budget, --update-budget and --raise-budget.");
|
|
700
|
+
return checkBudget ? "enforce" : updateBudget ? "update" : raiseBudget ? "raise" : "report";
|
|
701
|
+
}
|
|
697
702
|
static async load(filePath, source = filePath) {
|
|
698
703
|
const file = Bun.file(filePath);
|
|
699
704
|
if (!await file.exists())
|
|
700
705
|
return null;
|
|
701
706
|
return RouteJsBudget.parse(await file.text(), source);
|
|
702
707
|
}
|
|
703
|
-
static async check(sizes,
|
|
708
|
+
static async check(sizes, check) {
|
|
709
|
+
const { mode, app, budgetPath, source, environment } = check;
|
|
704
710
|
const { committed, unreadable } = await RouteJsBudget.#loadFor(mode, budgetPath, source);
|
|
705
|
-
|
|
706
|
-
|
|
711
|
+
if (mode === "enforce" && !committed)
|
|
712
|
+
throw new Error(`--check-budget found no ${source}: record one with \`akan build ${app} --update-budget\`.`);
|
|
713
|
+
const budget = mode === "raise" ? new RouteJsBudget().tightenedBy(sizes, environment) : mode === "update" ? (committed ?? new RouteJsBudget).tightenedBy(sizes, environment) : committed;
|
|
714
|
+
if ((mode === "update" || mode === "raise") && budget)
|
|
707
715
|
await Bun.write(budgetPath, budget.stringify());
|
|
708
716
|
const overages = budget?.overages(sizes) ?? [];
|
|
717
|
+
const unbudgeted = budget?.unbudgeted(sizes) ?? [];
|
|
709
718
|
const envNote = committed?.envNote(environment) ?? "";
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
719
|
+
const target = { app, source };
|
|
720
|
+
const failures = [
|
|
721
|
+
...overages.length && mode !== "report" ? [RouteJsBudget.formatOverages(overages, target, envNote)] : [],
|
|
722
|
+
...unbudgeted.length && mode === "enforce" ? [RouteJsBudget.formatUnbudgeted(unbudgeted, target)] : []
|
|
723
|
+
];
|
|
724
|
+
if (failures.length)
|
|
725
|
+
throw new Error(failures.join(`
|
|
726
|
+
`));
|
|
727
|
+
if (mode === "update" || mode === "raise")
|
|
728
|
+
return { summary: RouteJsBudget.#writtenSummary(check, unreadable, committed, budget) };
|
|
715
729
|
if (unreadable)
|
|
716
730
|
return {
|
|
717
731
|
summary: `${unreadable}, not checked`,
|
|
718
732
|
warnings: [
|
|
719
733
|
{
|
|
720
734
|
file: source,
|
|
721
|
-
message: `${unreadable}; akan build fails on it`,
|
|
722
|
-
fix:
|
|
735
|
+
message: `${unreadable}; akan build --check-budget fails on it`,
|
|
736
|
+
fix: `correct it, or rewrite it with akan build ${app} --update-budget`
|
|
723
737
|
}
|
|
724
738
|
]
|
|
725
739
|
};
|
|
726
740
|
if (!budget)
|
|
727
741
|
return { summary: `no ${RouteJsBudget.fileName}` };
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
742
|
+
const warnings = [
|
|
743
|
+
...overages.map(({ routeId, brotliBytes, limitBytes }) => ({
|
|
744
|
+
file: source,
|
|
745
|
+
message: `${routeId} loads ${RouteJsBudget.#bytes(brotliBytes)} bytes brotli, over its limit of ${RouteJsBudget.#bytes(limitBytes)}${envNote}; akan build --check-budget fails on it`,
|
|
746
|
+
fix: `shrink what the route loads, or raise its entry with akan build ${app} --raise-budget`
|
|
747
|
+
})),
|
|
748
|
+
...unbudgeted.map((routeId) => ({
|
|
749
|
+
file: source,
|
|
750
|
+
message: `${routeId} has no entry; akan build --check-budget fails on it`,
|
|
751
|
+
fix: `record it with akan build ${app} --update-budget`
|
|
752
|
+
}))
|
|
753
|
+
];
|
|
754
|
+
const verdict = overages.length ? `${overages.length} route(s) over ${source}${envNote}, reported only: ${overages.map(({ routeId }) => routeId).join(", ")}` : `within ${source}${envNote}`;
|
|
755
|
+
const unbudgetedNote = unbudgeted.length ? `; ${unbudgeted.length} route(s) without an entry` : "";
|
|
756
|
+
return { summary: `${verdict}${unbudgetedNote}`, ...warnings.length ? { warnings } : {} };
|
|
757
|
+
}
|
|
758
|
+
static #writtenSummary({ mode, source }, unreadable, committed, written) {
|
|
759
|
+
if (unreadable)
|
|
760
|
+
return `${source} rewritten (${unreadable})`;
|
|
761
|
+
if (mode === "update")
|
|
762
|
+
return `${source} updated`;
|
|
763
|
+
const raised = [...written?.kbByRoute ?? []].filter(([routeId, kb]) => kb > (committed?.kbByRoute.get(routeId) ?? kb));
|
|
764
|
+
return `${source} re-recorded at each route's measured size${raised.length ? `, raised: ${raised.map(([routeId]) => routeId).join(", ")}` : ""}`;
|
|
738
765
|
}
|
|
739
766
|
static async#loadFor(mode, budgetPath, source) {
|
|
740
767
|
try {
|
|
@@ -778,15 +805,27 @@ class RouteJsBudget {
|
|
|
778
805
|
...sizes.length > shown.length ? [` \u2026and ${sizes.length - shown.length} more`] : []
|
|
779
806
|
];
|
|
780
807
|
}
|
|
781
|
-
static formatOverages(overages,
|
|
808
|
+
static formatOverages(overages, target, envNote = "") {
|
|
782
809
|
const bytes = RouteJsBudget.#bytes;
|
|
810
|
+
const { source } = target;
|
|
783
811
|
return [
|
|
784
812
|
`${overages.length} route${overages.length === 1 ? "" : "s"} over the JS budget in ${source}${envNote}:`,
|
|
785
813
|
...overages.map(({ routeId, brotliBytes, budgetKB, limitBytes }) => ` ${routeId}: ${bytes(brotliBytes)} bytes brotli, over its limit of ${bytes(limitBytes)} (${budgetKB}KB + the larger of 1% and 4KB)`),
|
|
786
|
-
|
|
814
|
+
RouteJsBudget.#overageFix(target)
|
|
787
815
|
].join(`
|
|
788
816
|
`);
|
|
789
817
|
}
|
|
818
|
+
static formatUnbudgeted(routeIds, { app, source }) {
|
|
819
|
+
return [
|
|
820
|
+
`${routeIds.length} route${routeIds.length === 1 ? "" : "s"} with no entry in ${source}, which --check-budget checks every route against:`,
|
|
821
|
+
...routeIds.map((routeId) => ` ${routeId}`),
|
|
822
|
+
`Record ${routeIds.length === 1 ? "it" : "them"} in the same change: \`akan build ${app} --update-budget\` adds each new route at its measured size.`
|
|
823
|
+
].join(`
|
|
824
|
+
`);
|
|
825
|
+
}
|
|
826
|
+
static #overageFix({ app, source }) {
|
|
827
|
+
return `Shrink what the route loads. If the growth is intended, record it in the same change: \`akan build ${app} --raise-budget\` re-records every route at its measured size, or raise the route's entry under "${RouteJsBudget.section}" in ${source} by hand.`;
|
|
828
|
+
}
|
|
790
829
|
static #bytes(value) {
|
|
791
830
|
return value.toLocaleString("en-US");
|
|
792
831
|
}
|
|
@@ -838,12 +877,20 @@ class ApplicationBuildReporter {
|
|
|
838
877
|
Logger.rawLog(line);
|
|
839
878
|
Logger.rawLog("");
|
|
840
879
|
}
|
|
880
|
+
if (result.routeJsWarnings?.length) {
|
|
881
|
+
ApplicationBuildReporter.printRouteJsWarnings(result);
|
|
882
|
+
Logger.rawLog("");
|
|
883
|
+
}
|
|
841
884
|
Logger.rawLog(`Route artifacts: ${result.artifactDir}`);
|
|
842
885
|
Logger.rawLog(`Server output: ${result.outputDir}`);
|
|
843
886
|
Logger.rawLog(`Done in ${ApplicationBuildReporter.formatDuration(result.durationMs)}`);
|
|
844
887
|
if (result.environment === "local")
|
|
845
888
|
Logger.rawLog(ApplicationBuildReporter.localBuildNotice);
|
|
846
889
|
}
|
|
890
|
+
static printRouteJsWarnings({ routeJsWarnings = [] }) {
|
|
891
|
+
for (const { file, message, fix } of routeJsWarnings)
|
|
892
|
+
Logger.rawLog(`Warning: ${file}: ${message} (${fix})`);
|
|
893
|
+
}
|
|
847
894
|
static localBuildNotice = "Built for local: the server runs without endpoint rate limits, and boots on local defaults (Redis on localhost, the first database mode) where a deployment would stop to ask. For a host others can reach, run `akan build <app> --env main` with AKAN_PUBLIC_REPO_NAME and AKAN_PUBLIC_SERVE_DOMAIN set in the shell or the workspace .env.";
|
|
848
895
|
static formatError(error, workspaceRoot = process.cwd()) {
|
|
849
896
|
if (error instanceof AggregateError) {
|
|
@@ -907,7 +954,7 @@ var redisTunnelPolicy = ({
|
|
|
907
954
|
environment,
|
|
908
955
|
databaseMode
|
|
909
956
|
}) => environment === "local" ? "none" : databaseMode === "single" ? "optional" : "required";
|
|
910
|
-
var
|
|
957
|
+
var backendRecoveryPolicy = { min: 1000, max: 30000, maxAttempts: 5 };
|
|
911
958
|
var HELD_BUILDER_REQUEST_LIMIT = 64;
|
|
912
959
|
var BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS = 30000;
|
|
913
960
|
var BUILDER_TIGHT_RSS_REPORT_LIMIT = 2;
|
|
@@ -928,7 +975,6 @@ var shouldRestartBackendByDevPlan = (message) => {
|
|
|
928
975
|
return message.devPlan.actions.includes("restart-backend");
|
|
929
976
|
};
|
|
930
977
|
var shouldRestartBuilderByDevPlan = (message) => message.devPlan?.actions.includes("restart-builder") ?? false;
|
|
931
|
-
var shouldAbandonBackendRecovery = (attempts, maxAttempts = BACKEND_RECOVERY_MAX_ATTEMPTS) => attempts >= maxAttempts;
|
|
932
978
|
var normalizeBackendReportedGeneration = (generation) => generation >= 0 ? generation : undefined;
|
|
933
979
|
var shouldRestartDevHostByDevPlan = (message) => message.devPlan?.actions.includes("restart-dev-host") ?? message.kinds.includes("config");
|
|
934
980
|
var devHostStateByBackendState = {
|
|
@@ -1665,4 +1711,4 @@ class HmrWatcher {
|
|
|
1665
1711
|
}
|
|
1666
1712
|
}
|
|
1667
1713
|
|
|
1668
|
-
export { UNAVAILABLE_REDIS_HOST, redisTunnelPolicy, BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS, SOURCE_EXTS, shouldRestartBackendByDevPlan, shouldRestartBuilderByDevPlan,
|
|
1714
|
+
export { UNAVAILABLE_REDIS_HOST, redisTunnelPolicy, backendRecoveryPolicy, BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS, SOURCE_EXTS, shouldRestartBackendByDevPlan, shouldRestartBuilderByDevPlan, normalizeBackendReportedGeneration, shouldRestartDevHostByDevPlan, devHostStateOf, isLegacyBackendFallbackFile, shouldMarkBuildPhaseRecovered, shouldKeepBuildFailure, createBackendBuildStatus, backendRestartReasonFromMessage, mergeBackendRestartReasons, shouldReplaceLastGoodMessage, shouldQueueBuildStatusReplay, hasBuildFailureForGeneration, decideBuilderRssRecycle, decideBuilderRssSettle, decideIdleSuspend, resolveIdleSuspendMs, hasAnyBuildFailure, shouldRefreshConfigOnIdleWake, shouldHoldForReturningBuilder, shouldWarnBuilderRssCeilingTight, isRssCeilingUnreachable, shouldRelayRecycledFrontendState, mergeInvalidateMessages, buildStatusReplaySequence, filesChangedSince, HmrWatcher, WatchRootResolver, FontOptimizer, FontPruner, RouteJsBudget, ApplicationBuildReporter };
|
|
@@ -7,18 +7,21 @@ import {
|
|
|
7
7
|
AppExecutor,
|
|
8
8
|
LibExecutor,
|
|
9
9
|
PkgExecutor
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-sq9d0jhj.js";
|
|
11
11
|
import {
|
|
12
12
|
FileSys2
|
|
13
13
|
} from "./index-bns3wcpc.js";
|
|
14
|
+
import {
|
|
15
|
+
CliError
|
|
16
|
+
} from "./index-j4yvgfhr.js";
|
|
14
17
|
import {
|
|
15
18
|
UNAVAILABLE_REDIS_HOST,
|
|
16
19
|
redisTunnelPolicy,
|
|
20
|
+
backendRecoveryPolicy,
|
|
17
21
|
BUILDER_MIN_RSS_RECYCLE_INTERVAL_MS,
|
|
18
22
|
SOURCE_EXTS,
|
|
19
23
|
shouldRestartBackendByDevPlan,
|
|
20
24
|
shouldRestartBuilderByDevPlan,
|
|
21
|
-
shouldAbandonBackendRecovery,
|
|
22
25
|
normalizeBackendReportedGeneration,
|
|
23
26
|
shouldRestartDevHostByDevPlan,
|
|
24
27
|
devHostStateOf,
|
|
@@ -46,28 +49,27 @@ import {
|
|
|
46
49
|
filesChangedSince,
|
|
47
50
|
HmrWatcher,
|
|
48
51
|
WatchRootResolver
|
|
49
|
-
} from "./index-
|
|
52
|
+
} from "./index-41mfhgq0.js";
|
|
50
53
|
import {
|
|
51
54
|
runner,
|
|
52
|
-
ExitCodeError,
|
|
53
55
|
assertPromptable
|
|
54
|
-
} from "./index-
|
|
56
|
+
} from "./index-23d8gw08.js";
|
|
55
57
|
import {
|
|
56
58
|
UpdatePackFolder,
|
|
57
59
|
UpdateUploader,
|
|
58
60
|
NativePublicEnv,
|
|
59
61
|
NativeApp
|
|
60
|
-
} from "./index-
|
|
62
|
+
} from "./index-dsg50er9.js";
|
|
61
63
|
import {
|
|
62
64
|
DesktopServerStage
|
|
63
|
-
} from "./index-
|
|
65
|
+
} from "./index-6z57w95f.js";
|
|
64
66
|
import {
|
|
65
67
|
resolveMobileTargets,
|
|
66
68
|
resolveAppId
|
|
67
69
|
} from "./index-m9jj544v.js";
|
|
68
70
|
import {
|
|
69
71
|
SlicePlanner
|
|
70
|
-
} from "./index-
|
|
72
|
+
} from "./index-frvjq1rd.js";
|
|
71
73
|
import {
|
|
72
74
|
openBrowser
|
|
73
75
|
} from "./index-9dp031by.js";
|
|
@@ -84,7 +86,7 @@ import path7 from "path";
|
|
|
84
86
|
|
|
85
87
|
// pkgs/@akanjs/devkit/akanApp/akanApp.host.ts
|
|
86
88
|
import path4 from "path";
|
|
87
|
-
import { Logger as Logger2 } from "akanjs/common";
|
|
89
|
+
import { Logger as Logger2, RestartSchedule as RestartSchedule2 } from "akanjs/common";
|
|
88
90
|
|
|
89
91
|
// pkgs/@akanjs/devkit/createTunnel.ts
|
|
90
92
|
import { readFileSync } from "fs";
|
|
@@ -325,7 +327,7 @@ var createTunnel = async (service, { app, environment, port = service === "postg
|
|
|
325
327
|
// pkgs/@akanjs/devkit/incrementalBuilder/incrementalBuilder.host.ts
|
|
326
328
|
import fs from "fs";
|
|
327
329
|
import path2 from "path";
|
|
328
|
-
import { Logger } from "akanjs/common";
|
|
330
|
+
import { Logger, RestartSchedule } from "akanjs/common";
|
|
329
331
|
import { CSR_DEV_DIRNAME, CSR_DEV_PATCHING_MARKER, SSR_DEV_DIRNAME } from "akanjs/server/hmr/csrDevManifest";
|
|
330
332
|
import { MemoryLimit } from "akanjs/server/memoryLimit";
|
|
331
333
|
var builderMsgTypeSet = new Set([
|
|
@@ -344,8 +346,6 @@ var builderMsgTypeSet = new Set([
|
|
|
344
346
|
]);
|
|
345
347
|
|
|
346
348
|
class IncrementalBuilderHost {
|
|
347
|
-
static #restartBaseDelayMs = 1000;
|
|
348
|
-
static #restartMaxDelayMs = 30000;
|
|
349
349
|
static #recycleDrainTimeoutMs = 30000;
|
|
350
350
|
static #devMaxRssBytes = 2048 * 1024 * 1024;
|
|
351
351
|
logger = new Logger("IncrementalBuilderHost");
|
|
@@ -358,8 +358,7 @@ class IncrementalBuilderHost {
|
|
|
358
358
|
#onOutput;
|
|
359
359
|
#proc = null;
|
|
360
360
|
#status = "stopped";
|
|
361
|
-
#
|
|
362
|
-
#restartTimer = null;
|
|
361
|
+
#restart = new RestartSchedule({ min: 1000, max: 30000 });
|
|
363
362
|
#recycleTimer = null;
|
|
364
363
|
#recycleRequested = false;
|
|
365
364
|
#spawnAfterRecycle = false;
|
|
@@ -430,7 +429,7 @@ class IncrementalBuilderHost {
|
|
|
430
429
|
if (msg.type === "builder-ready" && !this.ready) {
|
|
431
430
|
this.ready = true;
|
|
432
431
|
this.#status = "ready";
|
|
433
|
-
this.#
|
|
432
|
+
this.#restart.reset();
|
|
434
433
|
if (isRestart)
|
|
435
434
|
this.#startOptions.onRestartReady?.();
|
|
436
435
|
else
|
|
@@ -495,19 +494,15 @@ class IncrementalBuilderHost {
|
|
|
495
494
|
} catch {}
|
|
496
495
|
}
|
|
497
496
|
#scheduleRestart() {
|
|
498
|
-
if (this.#manualStop || this.#
|
|
497
|
+
if (this.#manualStop || this.#restart.pending)
|
|
499
498
|
return;
|
|
500
499
|
this.#status = "restarting";
|
|
501
|
-
const
|
|
502
|
-
const delay = Math.min(IncrementalBuilderHost.#restartBaseDelayMs * 2 ** attempt, IncrementalBuilderHost.#restartMaxDelayMs);
|
|
503
|
-
this.#restartAttempts = attempt + 1;
|
|
504
|
-
this.logger.warn(`builder exited after ready; restarting in ${delay}ms (attempt ${this.#restartAttempts})`);
|
|
505
|
-
this.#restartTimer = setTimeout(() => {
|
|
506
|
-
this.#restartTimer = null;
|
|
500
|
+
const delay = this.#restart.schedule(() => {
|
|
507
501
|
if (this.#manualStop)
|
|
508
502
|
return;
|
|
509
503
|
this.#spawn(true);
|
|
510
|
-
}
|
|
504
|
+
});
|
|
505
|
+
this.logger.warn(`builder exited after ready; restarting in ${delay}ms (attempt ${this.#restart.attempts})`);
|
|
511
506
|
}
|
|
512
507
|
recycle(reason) {
|
|
513
508
|
if (!this.#proc || this.#status !== "ready" || this.#recycleRequested)
|
|
@@ -569,16 +564,13 @@ class IncrementalBuilderHost {
|
|
|
569
564
|
this.#inFlight.clear();
|
|
570
565
|
this.logger.warn(`failing ${lost.length} unanswered builder request(s): ${reason}`);
|
|
571
566
|
for (const [id, type] of lost)
|
|
572
|
-
this.#onMessage({ type: `${type}-res`, id, ok: false, error: reason });
|
|
567
|
+
this.#onMessage({ type: `${type}-res`, id, ok: false, error: reason, kind: "unavailable" });
|
|
573
568
|
}
|
|
574
569
|
stop() {
|
|
575
570
|
this.#manualStop = true;
|
|
576
571
|
this.#clearRecycle();
|
|
577
572
|
this.#failInFlight("builder was stopped before answering");
|
|
578
|
-
|
|
579
|
-
clearTimeout(this.#restartTimer);
|
|
580
|
-
this.#restartTimer = null;
|
|
581
|
-
}
|
|
573
|
+
this.#restart.cancel();
|
|
582
574
|
if (this.#proc)
|
|
583
575
|
this.#proc.kill();
|
|
584
576
|
this.#proc = null;
|
|
@@ -818,16 +810,12 @@ var backendMsgTypeSet = new Set(["build-route", "build-csr", "build-graph"]);
|
|
|
818
810
|
var asMib = (bytes) => Math.round(bytes / 1024 / 1024);
|
|
819
811
|
var BACKEND_RESTART_DEBOUNCE_MS = 120;
|
|
820
812
|
var BACKEND_GRACEFUL_TIMEOUT_MS = 8000;
|
|
821
|
-
var BACKEND_RECOVERY_BASE_DELAY_MS = 1000;
|
|
822
|
-
var BACKEND_RECOVERY_MAX_DELAY_MS = 30000;
|
|
823
813
|
var BACKEND_STDERR_TAIL_LIMIT = 40;
|
|
824
814
|
var BUILDER_READY_TIMEOUT_MS = 150000;
|
|
825
815
|
var BUILDER_START_MAX_ATTEMPTS = 3;
|
|
826
816
|
var BUILDER_RSS_RECYCLE_QUIET_MS = 750;
|
|
827
817
|
var BUILDER_RSS_SETTLE_MS = 20000;
|
|
828
818
|
var PS_RSS_TIMEOUT_MS = 2000;
|
|
829
|
-
var BUILDER_RECOVERY_BASE_DELAY_MS = 2000;
|
|
830
|
-
var BUILDER_RECOVERY_MAX_DELAY_MS = 60000;
|
|
831
819
|
|
|
832
820
|
class AkanAppHost {
|
|
833
821
|
app;
|
|
@@ -843,8 +831,7 @@ class AkanAppHost {
|
|
|
843
831
|
#backendReady = false;
|
|
844
832
|
#plannedBackendStops = new WeakSet;
|
|
845
833
|
#restartTimer = null;
|
|
846
|
-
#
|
|
847
|
-
#backendRecoveryAttempts = 0;
|
|
834
|
+
#backendRecovery = new RestartSchedule2(backendRecoveryPolicy);
|
|
848
835
|
#backendGaveUp = false;
|
|
849
836
|
#backendLifecycleState = "stopped";
|
|
850
837
|
#pendingRestartReason = null;
|
|
@@ -852,8 +839,8 @@ class AkanAppHost {
|
|
|
852
839
|
#pendingRecycle = null;
|
|
853
840
|
#restartFailedAfterApply = null;
|
|
854
841
|
#stopping = false;
|
|
855
|
-
#
|
|
856
|
-
#
|
|
842
|
+
#builderRecovery = new RestartSchedule2({ min: 2000, max: 60000 });
|
|
843
|
+
#abandonBuilderStart = null;
|
|
857
844
|
#backendStartStatus = null;
|
|
858
845
|
#backendBuildStatusGeneration = 0;
|
|
859
846
|
#backendStderrTail = [];
|
|
@@ -920,6 +907,7 @@ class AkanAppHost {
|
|
|
920
907
|
this.#cancelIdleSuspend();
|
|
921
908
|
this.#stopIdleWatcher();
|
|
922
909
|
this.#clearRestartTimers();
|
|
910
|
+
this.#abandonBuilderStart?.(new Error("dev server stopped before the builder was ready"));
|
|
923
911
|
this.#pendingRestartReason = null;
|
|
924
912
|
this.#failPendingBuilderMessages("dev server is shutting down");
|
|
925
913
|
await this.#backendRestart;
|
|
@@ -928,10 +916,11 @@ class AkanAppHost {
|
|
|
928
916
|
return this;
|
|
929
917
|
}
|
|
930
918
|
#clearRestartTimers() {
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
this.#
|
|
919
|
+
if (this.#restartTimer)
|
|
920
|
+
clearTimeout(this.#restartTimer);
|
|
921
|
+
this.#restartTimer = null;
|
|
922
|
+
this.#backendRecovery.cancel();
|
|
923
|
+
this.#builderRecovery.cancel();
|
|
935
924
|
}
|
|
936
925
|
kill() {
|
|
937
926
|
this.stop();
|
|
@@ -973,7 +962,7 @@ class AkanAppHost {
|
|
|
973
962
|
return;
|
|
974
963
|
if (msg.type === "backend-ready") {
|
|
975
964
|
this.#backendReady = true;
|
|
976
|
-
this.#
|
|
965
|
+
this.#backendRecovery.reset();
|
|
977
966
|
this.#setBackendLifecycleState("ready", `pid=${msg.pid}`);
|
|
978
967
|
this.#recordBackendReadyStatus();
|
|
979
968
|
this.logger.verbose(`backend ready pid=${msg.pid}`);
|
|
@@ -1131,10 +1120,7 @@ class AkanAppHost {
|
|
|
1131
1120
|
this.#pendingRestartReason = mergeBackendRestartReasons(this.#pendingRestartReason, reason);
|
|
1132
1121
|
const pending = this.#pendingRestartReason;
|
|
1133
1122
|
this.#setBackendLifecycleState("restart-pending", `generation=${pending.generation ?? "(unknown)"} files=${pending.files.length} roles=${pending.roles.join(",") || "(none)"}`);
|
|
1134
|
-
|
|
1135
|
-
clearTimeout(this.#backendRecoveryTimer);
|
|
1136
|
-
this.#backendRecoveryTimer = null;
|
|
1137
|
-
}
|
|
1123
|
+
this.#backendRecovery.cancel();
|
|
1138
1124
|
if (this.#restartTimer)
|
|
1139
1125
|
clearTimeout(this.#restartTimer);
|
|
1140
1126
|
this.#restartTimer = setTimeout(() => {
|
|
@@ -1153,17 +1139,17 @@ class AkanAppHost {
|
|
|
1153
1139
|
}
|
|
1154
1140
|
async#restartBackend(reason) {
|
|
1155
1141
|
this.logger.verbose(`[backend-reload] restarting backend generation=${reason.generation ?? "(unknown)"} files=${reason.files.length} roles=${reason.roles.join(",") || "(none)"}`);
|
|
1156
|
-
this.#
|
|
1142
|
+
this.#backendRecovery.reset();
|
|
1157
1143
|
await Promise.all([this.#stopBackend(), this.#backendGraph.refresh()]);
|
|
1158
1144
|
this.#startBackend({ generation: reason.generation, files: reason.files });
|
|
1159
1145
|
}
|
|
1160
1146
|
#scheduleBackendRecovery(reason) {
|
|
1161
|
-
if (this.#
|
|
1147
|
+
if (this.#backendRecovery.pending || this.#backend)
|
|
1162
1148
|
return;
|
|
1163
|
-
if (
|
|
1164
|
-
const message = `Backend exited ${this.#
|
|
1149
|
+
if (this.#backendRecovery.exhausted) {
|
|
1150
|
+
const message = `Backend exited ${this.#backendRecovery.attempts} times in a row (${reason}); waiting for an edit or a green build to retry.`;
|
|
1165
1151
|
this.#backendGaveUp = true;
|
|
1166
|
-
this.#setBackendLifecycleState("stopped", `gave up after ${this.#
|
|
1152
|
+
this.#setBackendLifecycleState("stopped", `gave up after ${this.#backendRecovery.attempts} recovery attempts`);
|
|
1167
1153
|
this.logger.error(`[backend-recovery] ${message}`);
|
|
1168
1154
|
if (this.#backendStderrTail.length > 0) {
|
|
1169
1155
|
this.logger.error(`[backend-recovery] recent backend stderr:
|
|
@@ -1175,30 +1161,27 @@ ${this.#backendStderrTail.join(`
|
|
|
1175
1161
|
return;
|
|
1176
1162
|
}
|
|
1177
1163
|
this.#setBackendLifecycleState("recovering", reason);
|
|
1178
|
-
const
|
|
1179
|
-
const delay = Math.min(BACKEND_RECOVERY_BASE_DELAY_MS * 2 ** attempt, BACKEND_RECOVERY_MAX_DELAY_MS);
|
|
1180
|
-
this.#backendRecoveryAttempts = attempt + 1;
|
|
1164
|
+
const delay = this.#backendRecovery.next();
|
|
1181
1165
|
const failureStatus = this.#recordBackendBuildStatus({
|
|
1182
1166
|
ok: false,
|
|
1183
1167
|
files: [],
|
|
1184
1168
|
message: `Backend exited unexpectedly (${reason}); restarting in ${delay}ms`
|
|
1185
1169
|
});
|
|
1186
1170
|
this.#sendOrQueueBuildStatus(failureStatus);
|
|
1187
|
-
this.logger.warn(`[backend-recovery] backend exited unexpectedly (${reason}); restarting in ${delay}ms (attempt ${this.#
|
|
1171
|
+
this.logger.warn(`[backend-recovery] backend exited unexpectedly (${reason}); restarting in ${delay}ms (attempt ${this.#backendRecovery.attempts})`);
|
|
1188
1172
|
if (this.#backendStderrTail.length > 0) {
|
|
1189
1173
|
this.logger.warn(`[backend-recovery] recent backend stderr:
|
|
1190
1174
|
${this.#backendStderrTail.join(`
|
|
1191
1175
|
`)}`);
|
|
1192
1176
|
}
|
|
1193
|
-
this.#
|
|
1194
|
-
this.#backendRecoveryTimer = null;
|
|
1177
|
+
this.#backendRecovery.arm(delay, () => {
|
|
1195
1178
|
if (this.#backend)
|
|
1196
1179
|
return;
|
|
1197
1180
|
this.#backendGraph.refresh().finally(() => {
|
|
1198
1181
|
if (!this.#backend)
|
|
1199
1182
|
this.#startBackend({ generation: failureStatus.generation, files: failureStatus.files });
|
|
1200
1183
|
});
|
|
1201
|
-
}
|
|
1184
|
+
});
|
|
1202
1185
|
}
|
|
1203
1186
|
#enqueueBuilderMessage(message) {
|
|
1204
1187
|
this.#builderMessageQueue = this.#builderMessageQueue.then(() => this.#handleBuilderMessage(message)).catch((err) => {
|
|
@@ -1463,7 +1446,7 @@ ${this.#backendStderrTail.join(`
|
|
|
1463
1446
|
this.logger.info(`[idle-suspend] no build activity for ${Math.round(idleMs / 1000)}s; released the builder \u2014 the next edit or route request brings it back`);
|
|
1464
1447
|
}
|
|
1465
1448
|
get #restartPending() {
|
|
1466
|
-
return !!(this.#pendingRecycle || this.#restartTimer || this.#backendRestart || this.#
|
|
1449
|
+
return !!(this.#pendingRecycle || this.#restartTimer || this.#backendRestart || this.#backendRecovery.pending || this.#builderRecovery.pending || this.#rssRecycleReason);
|
|
1467
1450
|
}
|
|
1468
1451
|
async#startIdleWatcher() {
|
|
1469
1452
|
try {
|
|
@@ -1608,11 +1591,11 @@ ${this.#backendStderrTail.join(`
|
|
|
1608
1591
|
}
|
|
1609
1592
|
#failBuilderRequest(message, error) {
|
|
1610
1593
|
if (message.type === "build-route")
|
|
1611
|
-
this.#sendToBackend({ type: "build-route-res", id: message.id, ok: false, error });
|
|
1594
|
+
this.#sendToBackend({ type: "build-route-res", id: message.id, ok: false, error, kind: "unavailable" });
|
|
1612
1595
|
else if (message.type === "build-csr")
|
|
1613
|
-
this.#sendToBackend({ type: "build-csr-res", id: message.id, ok: false, error });
|
|
1596
|
+
this.#sendToBackend({ type: "build-csr-res", id: message.id, ok: false, error, kind: "unavailable" });
|
|
1614
1597
|
else if (message.type === "build-graph")
|
|
1615
|
-
this.#sendToBackend({ type: "build-graph-res", id: message.id, ok: false, error });
|
|
1598
|
+
this.#sendToBackend({ type: "build-graph-res", id: message.id, ok: false, error, kind: "unavailable" });
|
|
1616
1599
|
else
|
|
1617
1600
|
return false;
|
|
1618
1601
|
return true;
|
|
@@ -1707,28 +1690,26 @@ ${this.#backendStderrTail.join(`
|
|
|
1707
1690
|
this.#scheduleBuilderRecovery({ generation, files: message.files });
|
|
1708
1691
|
}
|
|
1709
1692
|
#scheduleBuilderRecovery(reason) {
|
|
1710
|
-
if (this.#
|
|
1711
|
-
return;
|
|
1712
|
-
const
|
|
1713
|
-
|
|
1714
|
-
this.#builderRecoveryAttempts = attempt + 1;
|
|
1715
|
-
this.logger.warn(`[builder-recovery] builder is down; retrying start in ${delay}ms (attempt ${this.#builderRecoveryAttempts})`);
|
|
1716
|
-
this.#builderRecoveryTimer = setTimeout(() => {
|
|
1717
|
-
this.#builderRecoveryTimer = null;
|
|
1718
|
-
if (this.#builder)
|
|
1693
|
+
if (this.#stopping || this.#builderRecovery.pending || this.#builder)
|
|
1694
|
+
return;
|
|
1695
|
+
const delay = this.#builderRecovery.schedule(() => {
|
|
1696
|
+
if (this.#stopping || this.#builder)
|
|
1719
1697
|
return;
|
|
1720
1698
|
this.#recoverBuilder(reason);
|
|
1721
|
-
}
|
|
1699
|
+
});
|
|
1700
|
+
this.logger.warn(`[builder-recovery] builder is down; retrying start in ${delay}ms (attempt ${this.#builderRecovery.attempts})`);
|
|
1722
1701
|
}
|
|
1723
1702
|
async#recoverBuilder(reason) {
|
|
1724
1703
|
try {
|
|
1725
1704
|
await this.#startBuilder();
|
|
1726
1705
|
} catch (err) {
|
|
1706
|
+
if (this.#stopping)
|
|
1707
|
+
return;
|
|
1727
1708
|
this.logger.warn(`[builder-recovery] builder start failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
1728
1709
|
this.#scheduleBuilderRecovery(reason);
|
|
1729
1710
|
return;
|
|
1730
1711
|
}
|
|
1731
|
-
this.#
|
|
1712
|
+
this.#builderRecovery.reset();
|
|
1732
1713
|
this.logger.info("[builder-recovery] builder recovered");
|
|
1733
1714
|
this.#restartBackendForGapChanges();
|
|
1734
1715
|
const failedAfterApply = this.#restartFailedAfterApply;
|
|
@@ -1742,15 +1723,15 @@ ${this.#backendStderrTail.join(`
|
|
|
1742
1723
|
};
|
|
1743
1724
|
this.#recordBuildStatus(status);
|
|
1744
1725
|
this.#sendOrQueueBuildStatus(status);
|
|
1745
|
-
if (!this.#backend && !this.#
|
|
1726
|
+
if (!this.#backend && !this.#backendRecovery.pending) {
|
|
1746
1727
|
this.#startBackend({ generation: reason.generation, files: reason.files });
|
|
1747
1728
|
}
|
|
1748
1729
|
}
|
|
1749
1730
|
#reviveBackendAfterGreenBuild(status) {
|
|
1750
|
-
if (!status.ok || !this.#backendGaveUp || this.#backend || this.#
|
|
1731
|
+
if (!status.ok || !this.#backendGaveUp || this.#backend || this.#backendRecovery.pending)
|
|
1751
1732
|
return;
|
|
1752
1733
|
this.logger.info(`[backend-recovery] build went green (generation=${status.generation}); retrying backend`);
|
|
1753
|
-
this.#
|
|
1734
|
+
this.#backendRecovery.reset();
|
|
1754
1735
|
this.#startBackend({ generation: status.generation, files: status.files });
|
|
1755
1736
|
}
|
|
1756
1737
|
async#restartDevChildren(message) {
|
|
@@ -1766,7 +1747,7 @@ ${this.#backendStderrTail.join(`
|
|
|
1766
1747
|
async#recycleDevChildren(message, { refreshConfig = false, progress } = {}) {
|
|
1767
1748
|
const generation = message.devPlan?.generation ?? message.generation;
|
|
1768
1749
|
this.#clearRestartTimers();
|
|
1769
|
-
this.#
|
|
1750
|
+
this.#builderRecovery.reset();
|
|
1770
1751
|
this.#pendingRestartReason = null;
|
|
1771
1752
|
await this.#backendRestart;
|
|
1772
1753
|
this.#lastGoodFrontend = {};
|
|
@@ -1886,13 +1867,18 @@ ${this.#backendStderrTail.join(`
|
|
|
1886
1867
|
this.app.verbose(`[cli] waiting for builder to complete initial base build\u2026`);
|
|
1887
1868
|
let lastError;
|
|
1888
1869
|
for (let attempt = 1;attempt <= BUILDER_START_MAX_ATTEMPTS; attempt++) {
|
|
1889
|
-
|
|
1870
|
+
const builder = await IncrementalBuilderHost.create(this.app, this.env, (msg) => {
|
|
1890
1871
|
this.#enqueueBuilderMessage(msg);
|
|
1891
1872
|
}, {
|
|
1892
1873
|
stdio: this.stdio,
|
|
1893
1874
|
onOutput: (kind, text) => void (kind === "stderr" ? process.stderr : process.stdout).write(text),
|
|
1894
1875
|
patcherOff: this.#patcherOff
|
|
1895
1876
|
});
|
|
1877
|
+
if (this.#stopping) {
|
|
1878
|
+
builder.stop();
|
|
1879
|
+
throw new Error("dev server stopped before the builder started");
|
|
1880
|
+
}
|
|
1881
|
+
this.#builder = builder;
|
|
1896
1882
|
try {
|
|
1897
1883
|
await this.#waitForBuilderReady(attempt, { announceBootState });
|
|
1898
1884
|
this.app.verbose(`[cli] base build ready in ${Date.now() - startTime}ms \u2014 starting backend`);
|
|
@@ -1900,7 +1886,7 @@ ${this.#backendStderrTail.join(`
|
|
|
1900
1886
|
} catch (err) {
|
|
1901
1887
|
lastError = err;
|
|
1902
1888
|
this.#stopBuilder();
|
|
1903
|
-
if (attempt >= BUILDER_START_MAX_ATTEMPTS)
|
|
1889
|
+
if (attempt >= BUILDER_START_MAX_ATTEMPTS || this.#stopping)
|
|
1904
1890
|
break;
|
|
1905
1891
|
this.app.verbose(`[cli] builder failed before ready; retrying (${attempt + 1}/${BUILDER_START_MAX_ATTEMPTS})`);
|
|
1906
1892
|
}
|
|
@@ -1918,8 +1904,12 @@ ${this.#backendStderrTail.join(`
|
|
|
1918
1904
|
return;
|
|
1919
1905
|
settled = true;
|
|
1920
1906
|
clearTimeout(timeout);
|
|
1907
|
+
if (this.#abandonBuilderStart === abandon)
|
|
1908
|
+
this.#abandonBuilderStart = null;
|
|
1921
1909
|
fn();
|
|
1922
1910
|
};
|
|
1911
|
+
const abandon = (error) => settle(() => reject(error));
|
|
1912
|
+
this.#abandonBuilderStart = abandon;
|
|
1923
1913
|
const timeout = setTimeout(() => {
|
|
1924
1914
|
settle(() => reject(new Error("[cli] builder timed out before emitting builder-ready")));
|
|
1925
1915
|
}, BUILDER_READY_TIMEOUT_MS);
|
|
@@ -2038,7 +2028,7 @@ var reportsNoTestFile = (exec) => {
|
|
|
2038
2028
|
};
|
|
2039
2029
|
|
|
2040
2030
|
// pkgs/@akanjs/cli/application/application.runner.ts
|
|
2041
|
-
var loadBuildRunner = async () => (await import("./applicationBuildRunner-
|
|
2031
|
+
var loadBuildRunner = async () => (await import("./applicationBuildRunner-f4yf0qyc.js")).ApplicationBuildRunner;
|
|
2042
2032
|
var loadPrompts = async () => await import("@inquirer/prompts");
|
|
2043
2033
|
|
|
2044
2034
|
class ApplicationRunner extends runner("application") {
|
|
@@ -2239,7 +2229,7 @@ if (loaded) process.exitCode = await loaded.migrations.command(loaded.server, ar
|
|
|
2239
2229
|
await new (await loadBuildRunner())(app).typecheck(options);
|
|
2240
2230
|
}
|
|
2241
2231
|
async typecheckLibrary(lib, options = {}) {
|
|
2242
|
-
const { ProjectTypecheck } = await import("./projectTypecheck-
|
|
2232
|
+
const { ProjectTypecheck } = await import("./projectTypecheck-tz497yx7.js");
|
|
2243
2233
|
const root = lib.workspace.workspaceRoot;
|
|
2244
2234
|
await new ProjectTypecheck(lib.cwdPath, root, { ...process.env, AKAN_WORKSPACE_ROOT: root }).run([
|
|
2245
2235
|
"../../server.ts",
|
|
@@ -2715,7 +2705,7 @@ class VerifyScope {
|
|
|
2715
2705
|
const targets = requested.map((name) => {
|
|
2716
2706
|
const target = known.find((candidate) => candidate.name === name);
|
|
2717
2707
|
if (!target)
|
|
2718
|
-
throw new
|
|
2708
|
+
throw new CliError("unknownTarget", `${name} is not an app, library or package of this workspace`);
|
|
2719
2709
|
return { ...target, files: changedFilesOf(target.dir) };
|
|
2720
2710
|
});
|
|
2721
2711
|
return new VerifyScope(targets);
|