@akanjs/cli 3.2.0-rc.18 → 3.2.0-rc.19
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 -2
- package/{CodeAgent-w96z7fm7.js → CodeAgent-q0xkt4at.js} +2 -2
- package/{CodeTui-496f55hh.js → CodeTui-n56kpaca.js} +819 -663
- package/TunnelShare-844s9te4.js +18 -0
- package/{agent.command-81h65wcv.js → agent.command-k07raqft.js} +20 -20
- package/akanCode.js +8 -8
- package/{appExecutor-g4wq24v1.js → appExecutor-xav1zemr.js} +3 -3
- package/{application.command-rcw4h1gh.js → application.command-dv8y8r12.js} +52 -25
- package/{applicationBuildRunner-emhp6rh0.js → applicationBuildRunner-vhx7zq97.js} +9 -10
- package/buildBatch.proc.js +20 -11
- package/{cloud.command-k47h3kma.js → cloud.command-0vjy3x96.js} +22 -22
- package/cloud.script-jp48r0kw.js +35 -0
- package/{code.command-dam01a2f.js → code.command-xc5exq4b.js} +10 -10
- package/{context.command-44carkt5.js → context.command-etsat8yk.js} +22 -22
- package/context.runner-e52ak0cx.js +34 -0
- package/{guideline.command-ccxs69br.js → guideline.command-zqkntk7b.js} +6 -6
- package/guidelines/agentRule/agentRule.instruction.md +5 -4
- package/guidelines/conventions/core.md +18 -0
- package/guidelines/errorCodes/errorCodes.instruction.md +6 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +4 -2
- package/guidelines/transportRule/transportRule.instruction.md +3 -1
- package/incrementalBuilder.proc.js +559 -409
- package/{index-aw7at6j6.js → index-12js5pj4.js} +1 -1
- package/{index-tpr9nqkj.js → index-12vv4g80.js} +1 -1
- package/index-4zqebbqb.js +80 -0
- package/{index-rxxjkbj2.js → index-6bryy19d.js} +499 -421
- package/{index-2hwjhe8r.js → index-6pzncry1.js} +4 -4
- package/{index-jeqq717b.js → index-6rrh0ffr.js} +44 -32
- package/{index-a42cf737.js → index-7jr9mfp2.js} +235 -105
- package/{index-pcqr0r0m.js → index-81qt1jyj.js} +1 -1
- package/{index-2mrn1mrg.js → index-9f3reh2y.js} +1 -1
- package/{index-h9356zmz.js → index-a05ewnnp.js} +1 -1
- package/{index-ptpdd9hw.js → index-bxevbjw7.js} +8 -8
- package/{index-g95rbz83.js → index-c1vym3gx.js} +2 -2
- package/{index-vh8q7mrq.js → index-c9hd79py.js} +4 -4
- package/{index-wy7qcqsd.js → index-c9mnfy9r.js} +38 -23
- package/{index-a85n83t6.js → index-cc9pevta.js} +1 -1
- package/{index-4279crca.js → index-cet2s7xk.js} +2 -2
- package/{index-k1p29hdp.js → index-dasa0kbj.js} +2 -2
- package/{index-y27cxjd6.js → index-ddc2zjj5.js} +1 -1
- package/{index-r790hx48.js → index-dz7z9n9t.js} +25 -25
- package/{index-mgvvtjp1.js → index-e4vna9dn.js} +4 -4
- package/{index-ggmwp14t.js → index-ean2tff1.js} +723 -691
- package/{index-s21zxj7p.js → index-fgp04fh7.js} +6 -6
- package/{index-cef0fxf2.js → index-g541mhzw.js} +3 -3
- package/{index-rj406y9n.js → index-gh741qft.js} +8 -8
- package/{index-sa8g94se.js → index-k51718xz.js} +2138 -2138
- package/{index-286djj0d.js → index-m6r3pvf5.js} +2 -2
- package/{index-kqf2s304.js → index-my17308p.js} +7 -7
- package/{index-pqf6d5ff.js → index-nd8bq17n.js} +6 -6
- package/{index-her656ng.js → index-nxcmgqk3.js} +3 -3
- package/{index-gd9tkq2k.js → index-pkgha3rt.js} +5 -5
- package/{index-tkrg58qv.js → index-q2t2w996.js} +1 -1
- package/{index-b061e6fn.js → index-qtqhsb33.js} +204 -160
- package/{index-nwbdpnna.js → index-rj2n5kfk.js} +67 -67
- package/{index-ktvyva62.js → index-s5gvwvkb.js} +103 -138
- package/{index-bbd1727m.js → index-sh3yzse2.js} +8 -7
- package/{index-y71v7grx.js → index-syn4vm3y.js} +1 -1
- package/{index-gkfpqdm8.js → index-t00xrkey.js} +1 -1
- package/{index-hw2eammf.js → index-v72mh89f.js} +5 -6
- package/{index-qrh7kdb1.js → index-wq8pnev4.js} +3 -3
- package/{index-1j1jmmac.js → index-wxr3941g.js} +8 -8
- package/{index-e4w015qt.js → index-y8mqkhcf.js} +1 -1
- package/{index-ctrx7asj.js → index-zk1gjk46.js} +4 -4
- package/index.js +27 -27
- package/{libExecutor-mmrzd606.js → libExecutor-mr3vxtnr.js} +2 -2
- package/{library.command-brkcat13.js → library.command-ps9q5t37.js} +7 -7
- package/{localRegistry.command-qwzy3t7w.js → localRegistry.command-rszxmvd0.js} +21 -21
- package/{module.command-t5emqxkr.js → module.command-fcybnn1a.js} +10 -10
- package/{package.command-xv04dbxf.js → package.command-zen3rhye.js} +10 -10
- package/package.json +2 -2
- package/{page.command-yhgq9tj8.js → page.command-gwrxymms.js} +7 -7
- package/{pipeline.command-x3nkf9kc.js → pipeline.command-m1brkqqw.js} +6 -6
- package/{pkgExecutor-4cbe3sgr.js → pkgExecutor-x51agavp.js} +2 -2
- package/{primitive.command-jv60b759.js → primitive.command-5vkxvvmk.js} +11 -11
- package/{projectTypecheck-fbfq9rm9.js → projectTypecheck-9dzfah37.js} +1 -1
- package/{quality.command-mdjardf1.js → quality.command-gqry7eas.js} +9 -9
- package/{repair.command-s22j5xbe.js → repair.command-qs4ejcrg.js} +10 -10
- package/{scalar.command-a6qs7012.js → scalar.command-ny0vchqq.js} +9 -9
- package/skills/akan-scaffold/SKILL.md +1 -1
- package/{subspace.command-26hkjqf9.js → subspace.command-5pxqjgmw.js} +12 -12
- package/templates/workspaceRoot/AGENTS.md.template +2 -1
- package/{tunnel.command-83sfgz5z.js → tunnel.command-ndajt0xk.js} +11 -11
- package/{verify.command-krm1rrf1.js → verify.command-m59ashc7.js} +17 -17
- package/{workflow.command-z05y7amj.js → workflow.command-jchqey88.js} +15 -15
- package/{workspace.command-qga6cn1n.js → workspace.command-g0gzxkpd.js} +36 -36
- package/TunnelShare-tyj8nb0z.js +0 -19
- package/cloud.script-b4smdpa5.js +0 -35
- package/context.runner-xtr9ngpa.js +0 -34
- package/index-k2kr1wd4.js +0 -18
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
AsyncDefaultExportDetector,
|
|
4
4
|
StoreBootstrap,
|
|
5
5
|
resolveSsrPageEntriesForApp
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-cet2s7xk.js";
|
|
7
7
|
import {
|
|
8
8
|
FileSys2
|
|
9
9
|
} from "./index-by2tvsq6.js";
|
|
@@ -579,6 +579,50 @@ var serializeNamedItem = (item) => {
|
|
|
579
579
|
return `${prefix}${item.imported} as ${item.local}`;
|
|
580
580
|
};
|
|
581
581
|
|
|
582
|
+
// pkgs/@akanjs/devkit/transforms/rscUseClientTransform.ts
|
|
583
|
+
import path3 from "path";
|
|
584
|
+
import ts2 from "typescript";
|
|
585
|
+
var USE_CLIENT_RE = /^\s*(?:\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\/\s*|\/\/[^\n]*\n\s*)*["']use client["']/;
|
|
586
|
+
var IMPLICIT_ROOT_LAYOUT_RE = /[/\\]\.akan[/\\]generated[/\\](?:implicit-root-layout|root-layouts[/\\][^/\\]*__root_layout)\.(tsx|ts|jsx|js)$/;
|
|
587
|
+
var STAR_REEXPORT_HINT_RE = /\bexport\s*\*\s*from\b/;
|
|
588
|
+
var hasUseClientDirective = (source) => USE_CLIENT_RE.test(source);
|
|
589
|
+
function toClientReferencePath(absPath, workspaceRoot) {
|
|
590
|
+
return path3.relative(path3.resolve(workspaceRoot), path3.resolve(absPath)).split(path3.sep).join("/");
|
|
591
|
+
}
|
|
592
|
+
var starReexportSpecifiers = (source, filePath) => ts2.createSourceFile(filePath, source, ts2.ScriptTarget.Latest).statements.filter((statement) => ts2.isExportDeclaration(statement) && !statement.exportClause && !statement.isTypeOnly && !!statement.moduleSpecifier && ts2.isStringLiteral(statement.moduleSpecifier)).map((statement) => statement.moduleSpecifier.text);
|
|
593
|
+
var scanUseClientExports = (source, filePath, workspaceRoot) => {
|
|
594
|
+
const stars = USE_CLIENT_RE.test(source) && STAR_REEXPORT_HINT_RE.test(source) ? starReexportSpecifiers(source, filePath) : [];
|
|
595
|
+
if (stars.length) {
|
|
596
|
+
const file = workspaceRoot ? toClientReferencePath(filePath, workspaceRoot) : filePath;
|
|
597
|
+
const listed = stars.slice(0, 3).map((specifier) => `\`export * from ${JSON.stringify(specifier)}\``);
|
|
598
|
+
const written = stars.length > 3 ? `${listed.join(", ")} (and ${stars.length - 3} more)` : listed.join(", ");
|
|
599
|
+
throw new Error(`${file} is a "use client" module, so it cannot ${written}: the server sees only the names a client module ` + `declares, and a star re-export declares none. Re-export them by name \u2014 \`export { \u2026 } from ${JSON.stringify(stars[0])}\`.`);
|
|
600
|
+
}
|
|
601
|
+
return new Bun.Transpiler({ loader: loaderFor(filePath) }).scan(source).exports;
|
|
602
|
+
};
|
|
603
|
+
function transformUseClient(source, args) {
|
|
604
|
+
if (!USE_CLIENT_RE.test(source))
|
|
605
|
+
return null;
|
|
606
|
+
if (IMPLICIT_ROOT_LAYOUT_RE.test(args.path))
|
|
607
|
+
return null;
|
|
608
|
+
const exports = scanUseClientExports(source, args.path, args.workspaceRoot);
|
|
609
|
+
if (exports.length === 0)
|
|
610
|
+
return null;
|
|
611
|
+
args.onClientModule?.(args.path, exports);
|
|
612
|
+
const referencePath = args.workspaceRoot ? toClientReferencePath(args.path, args.workspaceRoot) : args.path;
|
|
613
|
+
const filePathLit = JSON.stringify(referencePath);
|
|
614
|
+
const lines = [`import { registerClientReference } from "react-server-dom-webpack/server.node";`];
|
|
615
|
+
for (const name of exports) {
|
|
616
|
+
const nameLit = JSON.stringify(name);
|
|
617
|
+
const errMsg = JSON.stringify(`Attempted to call '${name}' from '${referencePath}' on the server, but it is a client-only export.`);
|
|
618
|
+
const proxy = `() => { throw new Error(${errMsg}); }`;
|
|
619
|
+
const binding = name === "default" ? `export default registerClientReference(${proxy}, ${filePathLit}, ${nameLit});` : `export const ${name} = registerClientReference(${proxy}, ${filePathLit}, ${nameLit});`;
|
|
620
|
+
lines.push(binding);
|
|
621
|
+
}
|
|
622
|
+
return lines.join(`
|
|
623
|
+
`);
|
|
624
|
+
}
|
|
625
|
+
|
|
582
626
|
// pkgs/@akanjs/devkit/frontendBuild/bundleDefine.ts
|
|
583
627
|
var bundleConditions = (command) => command === "build" ? ["production"] : [];
|
|
584
628
|
var bundleDefine = (app, command, renderEnv) => {
|
|
@@ -593,7 +637,7 @@ var bundleDefine = (app, command, renderEnv) => {
|
|
|
593
637
|
|
|
594
638
|
// pkgs/@akanjs/devkit/frontendBuild/csrDevPaths.ts
|
|
595
639
|
import fs2 from "fs";
|
|
596
|
-
import
|
|
640
|
+
import path4 from "path";
|
|
597
641
|
|
|
598
642
|
class CsrDevPaths {
|
|
599
643
|
static modulePrefix = "akan-module:";
|
|
@@ -606,18 +650,18 @@ class CsrDevPaths {
|
|
|
606
650
|
}
|
|
607
651
|
idOf(file) {
|
|
608
652
|
const real = CsrDevPaths.realpath(file);
|
|
609
|
-
const relative =
|
|
610
|
-
const id = relative.startsWith("..") ||
|
|
611
|
-
return id.split(
|
|
653
|
+
const relative = path4.relative(this.root, real);
|
|
654
|
+
const id = relative.startsWith("..") || path4.isAbsolute(relative) ? real : relative;
|
|
655
|
+
return id.split(path4.sep).join("/");
|
|
612
656
|
}
|
|
613
657
|
fileOf(id) {
|
|
614
|
-
return
|
|
658
|
+
return path4.isAbsolute(id) ? id : path4.join(this.root, id);
|
|
615
659
|
}
|
|
616
660
|
static isStub(target) {
|
|
617
661
|
return target.startsWith(CsrDevPaths.stubPrefix);
|
|
618
662
|
}
|
|
619
663
|
static isVendorFile(file) {
|
|
620
|
-
return file.includes(`${
|
|
664
|
+
return file.includes(`${path4.sep}node_modules${path4.sep}`);
|
|
621
665
|
}
|
|
622
666
|
static isScript(file) {
|
|
623
667
|
return /\.[cm]?[jt]sx?$/.test(file);
|
|
@@ -630,7 +674,7 @@ class CsrDevPaths {
|
|
|
630
674
|
return await source.exists() ? Bun.hash(await source.arrayBuffer()).toString(36) : "";
|
|
631
675
|
}
|
|
632
676
|
static realpath(file) {
|
|
633
|
-
return fs2.existsSync(file) ? fs2.realpathSync.native(file) :
|
|
677
|
+
return fs2.existsSync(file) ? fs2.realpathSync.native(file) : path4.resolve(file);
|
|
634
678
|
}
|
|
635
679
|
static isNamed(file) {
|
|
636
680
|
try {
|
|
@@ -647,7 +691,7 @@ class CsrDevPaths {
|
|
|
647
691
|
return CsrDevPaths.#asFile(base, kind) ?? CsrDevPaths.#asFolder(base, kind);
|
|
648
692
|
}
|
|
649
693
|
static resolveRelative(dir, specifier, kind = "import") {
|
|
650
|
-
const base =
|
|
694
|
+
const base = path4.resolve(dir, specifier);
|
|
651
695
|
const folder = /(^|[\\/])\.\.?$|[\\/]$/.test(specifier);
|
|
652
696
|
return folder ? CsrDevPaths.#asFolder(base, kind) : CsrDevPaths.resolveOnDisk(base, kind);
|
|
653
697
|
}
|
|
@@ -657,15 +701,15 @@ class CsrDevPaths {
|
|
|
657
701
|
}
|
|
658
702
|
static #asFolder(dir, kind) {
|
|
659
703
|
const entry = CsrDevPaths.#packageEntryOf(dir, kind);
|
|
660
|
-
const named = entry ? CsrDevPaths.#asFile(
|
|
704
|
+
const named = entry ? CsrDevPaths.#asFile(path4.join(dir, entry), kind) ?? CsrDevPaths.#indexOf(path4.join(dir, entry), kind) : null;
|
|
661
705
|
return named ?? CsrDevPaths.#indexOf(dir, kind);
|
|
662
706
|
}
|
|
663
707
|
static #indexOf(dir, kind) {
|
|
664
|
-
return CsrDevPaths.#asFile(
|
|
708
|
+
return CsrDevPaths.#asFile(path4.join(dir, "index"), kind);
|
|
665
709
|
}
|
|
666
710
|
static #packageEntryOf(dir, kind) {
|
|
667
711
|
try {
|
|
668
|
-
const pkg = JSON.parse(fs2.readFileSync(
|
|
712
|
+
const pkg = JSON.parse(fs2.readFileSync(path4.join(dir, "package.json"), "utf8"));
|
|
669
713
|
const fields = kind === "require" ? [pkg.browser, pkg.main] : [pkg.browser, pkg.module, pkg.main];
|
|
670
714
|
const entry = fields.find((field) => typeof field === "string");
|
|
671
715
|
return typeof entry === "string" ? entry : null;
|
|
@@ -678,11 +722,11 @@ class CsrDevPaths {
|
|
|
678
722
|
const name = first.startsWith("@") ? `${first}/${second}` : first;
|
|
679
723
|
if (!name || name.startsWith("."))
|
|
680
724
|
return false;
|
|
681
|
-
for (let dir =
|
|
682
|
-
const pkgDir =
|
|
683
|
-
if (fs2.existsSync(
|
|
725
|
+
for (let dir = path4.resolve(from);; dir = path4.dirname(dir)) {
|
|
726
|
+
const pkgDir = path4.join(dir, "node_modules", name);
|
|
727
|
+
if (fs2.existsSync(path4.join(pkgDir, "package.json")))
|
|
684
728
|
return (fs2.statSync(pkgDir, { throwIfNoEntry: false })?.ctimeMs ?? 0) > since;
|
|
685
|
-
if (
|
|
729
|
+
if (path4.dirname(dir) === dir)
|
|
686
730
|
return false;
|
|
687
731
|
}
|
|
688
732
|
}
|
|
@@ -704,7 +748,7 @@ class CsrDevPaths {
|
|
|
704
748
|
}
|
|
705
749
|
|
|
706
750
|
// pkgs/@akanjs/devkit/frontendBuild/csrEntryFiles.ts
|
|
707
|
-
import
|
|
751
|
+
import path5 from "path";
|
|
708
752
|
|
|
709
753
|
class CsrEntryFiles {
|
|
710
754
|
static entryFilename(basePath) {
|
|
@@ -717,7 +761,7 @@ class CsrEntryFiles {
|
|
|
717
761
|
});
|
|
718
762
|
}
|
|
719
763
|
static basePathOfPageKey(pageKey, basePaths) {
|
|
720
|
-
const normalized = pageKey.split(
|
|
764
|
+
const normalized = pageKey.split(path5.sep).join("/").replace(/^\.\//, "");
|
|
721
765
|
const segments = normalized.split("/");
|
|
722
766
|
const firstPublicSegment = segments.find((segment) => segment !== "[lang]" && !/^\(.+\)$/.test(segment));
|
|
723
767
|
return firstPublicSegment && basePaths.includes(firstPublicSegment) ? firstPublicSegment : null;
|
|
@@ -730,7 +774,7 @@ import path9 from "path";
|
|
|
730
774
|
import ts3 from "typescript";
|
|
731
775
|
|
|
732
776
|
// pkgs/@akanjs/devkit/transforms/externalizeFrameworkPlugin.ts
|
|
733
|
-
import
|
|
777
|
+
import path6 from "path";
|
|
734
778
|
var DEFAULT_INCLUDE = ["akanjs/", "@apps/", "@libs/"];
|
|
735
779
|
var DEFAULT_EXCLUDE_EXACT = new Set(["akanjs/webkit", "@akanjs/cli", "@akanjs/devkit"]);
|
|
736
780
|
var DEFAULT_EXCLUDE_PREFIX = ["@akanjs/cli/", "@akanjs/devkit/"];
|
|
@@ -766,7 +810,7 @@ async function createExternalizeFrameworkPlugin(options) {
|
|
|
766
810
|
const replPath = repl?.endsWith("/*") ? repl.slice(0, -1) : repl ?? "";
|
|
767
811
|
if (!replPath)
|
|
768
812
|
continue;
|
|
769
|
-
const candidate =
|
|
813
|
+
const candidate = path6.resolve(workspaceRoot, replPath + suffix);
|
|
770
814
|
const hit = await firstExisting(candidate);
|
|
771
815
|
if (hit)
|
|
772
816
|
return hit;
|
|
@@ -776,8 +820,8 @@ async function createExternalizeFrameworkPlugin(options) {
|
|
|
776
820
|
if (!spec.startsWith(`${pkg}/`))
|
|
777
821
|
continue;
|
|
778
822
|
const suffix = spec.slice(pkg.length + 1);
|
|
779
|
-
const pkgDir =
|
|
780
|
-
const candidate =
|
|
823
|
+
const pkgDir = path6.dirname(path6.resolve(workspaceRoot, entryFile));
|
|
824
|
+
const candidate = path6.join(pkgDir, suffix);
|
|
781
825
|
const hit = await firstExisting(candidate);
|
|
782
826
|
if (hit)
|
|
783
827
|
return hit;
|
|
@@ -822,57 +866,13 @@ async function firstExisting(basePath) {
|
|
|
822
866
|
return candidate;
|
|
823
867
|
}
|
|
824
868
|
for (const ext of CANDIDATE_EXTS3) {
|
|
825
|
-
const candidate =
|
|
869
|
+
const candidate = path6.join(basePath, `index${ext}`);
|
|
826
870
|
if (await Bun.file(candidate).exists())
|
|
827
871
|
return candidate;
|
|
828
872
|
}
|
|
829
873
|
return null;
|
|
830
874
|
}
|
|
831
875
|
|
|
832
|
-
// pkgs/@akanjs/devkit/transforms/rscUseClientTransform.ts
|
|
833
|
-
import path6 from "path";
|
|
834
|
-
import ts2 from "typescript";
|
|
835
|
-
var USE_CLIENT_RE = /^\s*(?:\/\*[^*]*\*+(?:[^/*][^*]*\*+)*\/\s*|\/\/[^\n]*\n\s*)*["']use client["']/;
|
|
836
|
-
var IMPLICIT_ROOT_LAYOUT_RE = /[/\\]\.akan[/\\]generated[/\\](?:implicit-root-layout|root-layouts[/\\][^/\\]*__root_layout)\.(tsx|ts|jsx|js)$/;
|
|
837
|
-
var STAR_REEXPORT_HINT_RE = /\bexport\s*\*\s*from\b/;
|
|
838
|
-
var hasUseClientDirective = (source) => USE_CLIENT_RE.test(source);
|
|
839
|
-
function toClientReferencePath(absPath, workspaceRoot) {
|
|
840
|
-
return path6.relative(path6.resolve(workspaceRoot), path6.resolve(absPath)).split(path6.sep).join("/");
|
|
841
|
-
}
|
|
842
|
-
var starReexportSpecifiers = (source, filePath) => ts2.createSourceFile(filePath, source, ts2.ScriptTarget.Latest).statements.filter((statement) => ts2.isExportDeclaration(statement) && !statement.exportClause && !statement.isTypeOnly && !!statement.moduleSpecifier && ts2.isStringLiteral(statement.moduleSpecifier)).map((statement) => statement.moduleSpecifier.text);
|
|
843
|
-
var scanUseClientExports = (source, filePath, workspaceRoot) => {
|
|
844
|
-
const stars = USE_CLIENT_RE.test(source) && STAR_REEXPORT_HINT_RE.test(source) ? starReexportSpecifiers(source, filePath) : [];
|
|
845
|
-
if (stars.length) {
|
|
846
|
-
const file = workspaceRoot ? toClientReferencePath(filePath, workspaceRoot) : filePath;
|
|
847
|
-
const listed = stars.slice(0, 3).map((specifier) => `\`export * from ${JSON.stringify(specifier)}\``);
|
|
848
|
-
const written = stars.length > 3 ? `${listed.join(", ")} (and ${stars.length - 3} more)` : listed.join(", ");
|
|
849
|
-
throw new Error(`${file} is a "use client" module, so it cannot ${written}: the server sees only the names a client module ` + `declares, and a star re-export declares none. Re-export them by name \u2014 \`export { \u2026 } from ${JSON.stringify(stars[0])}\`.`);
|
|
850
|
-
}
|
|
851
|
-
return new Bun.Transpiler({ loader: loaderFor(filePath) }).scan(source).exports;
|
|
852
|
-
};
|
|
853
|
-
function transformUseClient(source, args) {
|
|
854
|
-
if (!USE_CLIENT_RE.test(source))
|
|
855
|
-
return null;
|
|
856
|
-
if (IMPLICIT_ROOT_LAYOUT_RE.test(args.path))
|
|
857
|
-
return null;
|
|
858
|
-
const exports = scanUseClientExports(source, args.path, args.workspaceRoot);
|
|
859
|
-
if (exports.length === 0)
|
|
860
|
-
return null;
|
|
861
|
-
args.onClientModule?.(args.path, exports);
|
|
862
|
-
const referencePath = args.workspaceRoot ? toClientReferencePath(args.path, args.workspaceRoot) : args.path;
|
|
863
|
-
const filePathLit = JSON.stringify(referencePath);
|
|
864
|
-
const lines = [`import { registerClientReference } from "react-server-dom-webpack/server.node";`];
|
|
865
|
-
for (const name of exports) {
|
|
866
|
-
const nameLit = JSON.stringify(name);
|
|
867
|
-
const errMsg = JSON.stringify(`Attempted to call '${name}' from '${referencePath}' on the server, but it is a client-only export.`);
|
|
868
|
-
const proxy = `() => { throw new Error(${errMsg}); }`;
|
|
869
|
-
const binding = name === "default" ? `export default registerClientReference(${proxy}, ${filePathLit}, ${nameLit});` : `export const ${name} = registerClientReference(${proxy}, ${filePathLit}, ${nameLit});`;
|
|
870
|
-
lines.push(binding);
|
|
871
|
-
}
|
|
872
|
-
return lines.join(`
|
|
873
|
-
`);
|
|
874
|
-
}
|
|
875
|
-
|
|
876
876
|
// pkgs/@akanjs/devkit/transforms/useClientBundlePlugin.ts
|
|
877
877
|
function createUseClientBundlePlugin(options = {}) {
|
|
878
878
|
return {
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ErrorReport
|
|
4
|
+
} from "./index-4zqebbqb.js";
|
|
2
5
|
import {
|
|
3
6
|
JsonFormatter
|
|
4
|
-
} from "./index-
|
|
7
|
+
} from "./index-v72mh89f.js";
|
|
5
8
|
|
|
6
9
|
// pkgs/@akanjs/devkit/app/applicationBuildReporter.ts
|
|
7
|
-
import { realpathSync } from "fs";
|
|
8
|
-
import path4 from "path";
|
|
9
10
|
import { Logger } from "akanjs/common";
|
|
10
11
|
|
|
11
12
|
// pkgs/@akanjs/devkit/app/routeJsBudget.ts
|
|
@@ -893,45 +894,7 @@ class ApplicationBuildReporter {
|
|
|
893
894
|
}
|
|
894
895
|
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.";
|
|
895
896
|
static formatError(error, workspaceRoot = process.cwd()) {
|
|
896
|
-
|
|
897
|
-
const nestedMessages = error.errors.map((nestedError, index) => ApplicationBuildReporter.formatError(nestedError, workspaceRoot).trim() || `Unknown error ${index + 1}`).map((message) => message.replace(/^/gm, " ")).join(`
|
|
898
|
-
`);
|
|
899
|
-
return nestedMessages ? `${error.message}
|
|
900
|
-
${nestedMessages}` : error.message;
|
|
901
|
-
}
|
|
902
|
-
if (error instanceof Error) {
|
|
903
|
-
const causeMessage = error.cause ? `
|
|
904
|
-
Caused by: ${ApplicationBuildReporter.formatError(error.cause, workspaceRoot)}` : "";
|
|
905
|
-
return `${ApplicationBuildReporter.#withLocation(error.message, error, workspaceRoot)}${causeMessage}`;
|
|
906
|
-
}
|
|
907
|
-
if (typeof error === "object" && error !== null && "message" in error)
|
|
908
|
-
return ApplicationBuildReporter.#withLocation(String(error.message), error, workspaceRoot);
|
|
909
|
-
return String(error);
|
|
910
|
-
}
|
|
911
|
-
static #withLocation(message, error, workspaceRoot) {
|
|
912
|
-
const { position } = error;
|
|
913
|
-
if (!position?.file)
|
|
914
|
-
return message;
|
|
915
|
-
const file = ApplicationBuildReporter.#relativeToWorkspace(position.file, workspaceRoot);
|
|
916
|
-
const location = position.line > 0 ? `${file}:${position.line}:${position.column}` : file;
|
|
917
|
-
return message.includes(location) ? message : message.replace(/^.*/, (headline) => `${headline} (${location})`);
|
|
918
|
-
}
|
|
919
|
-
static #relativeToWorkspace(file, workspaceRoot) {
|
|
920
|
-
if (!path4.isAbsolute(file))
|
|
921
|
-
return file;
|
|
922
|
-
for (const root of [workspaceRoot, ApplicationBuildReporter.#realpathOf(workspaceRoot)]) {
|
|
923
|
-
const relative = path4.relative(root, file);
|
|
924
|
-
if (!relative.startsWith(`..${path4.sep}`) && !path4.isAbsolute(relative))
|
|
925
|
-
return relative.replaceAll(path4.sep, "/");
|
|
926
|
-
}
|
|
927
|
-
return file;
|
|
928
|
-
}
|
|
929
|
-
static #realpathOf(dir) {
|
|
930
|
-
try {
|
|
931
|
-
return realpathSync(dir);
|
|
932
|
-
} catch {
|
|
933
|
-
return dir;
|
|
934
|
-
}
|
|
897
|
+
return ErrorReport.format(error, workspaceRoot);
|
|
935
898
|
}
|
|
936
899
|
static formatDuration(ms) {
|
|
937
900
|
if (ms < 1000)
|
|
@@ -948,7 +911,7 @@ Caused by: ${ApplicationBuildReporter.formatError(error.cause, workspaceRoot)}`
|
|
|
948
911
|
}
|
|
949
912
|
|
|
950
913
|
// pkgs/@akanjs/devkit/akanApp/devHostPolicy.ts
|
|
951
|
-
import
|
|
914
|
+
import path4 from "path";
|
|
952
915
|
var UNAVAILABLE_REDIS_HOST = "redis-tunnel-unavailable.invalid";
|
|
953
916
|
var redisTunnelPolicy = ({
|
|
954
917
|
environment,
|
|
@@ -989,18 +952,18 @@ var devHostStateOf = (state, gaveUp) => state === "stopped" && gaveUp ? "failed"
|
|
|
989
952
|
var RESTART_ROLE_ORDER = ["server", "shared", "barrel", "config"];
|
|
990
953
|
var generationValue = (generation) => generation ?? -1;
|
|
991
954
|
var isLegacyBackendFallbackFile = (file, workspaceRoot) => {
|
|
992
|
-
const abs =
|
|
993
|
-
const ext =
|
|
955
|
+
const abs = path4.resolve(file);
|
|
956
|
+
const ext = path4.extname(abs).toLowerCase();
|
|
994
957
|
if (!SOURCE_EXTS.has(ext))
|
|
995
958
|
return false;
|
|
996
|
-
const rel =
|
|
997
|
-
if (!rel || rel.startsWith("..") ||
|
|
959
|
+
const rel = path4.relative(path4.resolve(workspaceRoot), abs);
|
|
960
|
+
if (!rel || rel.startsWith("..") || path4.isAbsolute(rel))
|
|
998
961
|
return false;
|
|
999
|
-
const parts = rel.split(
|
|
962
|
+
const parts = rel.split(path4.sep).filter(Boolean);
|
|
1000
963
|
const [scope] = parts;
|
|
1001
964
|
if (scope !== "apps" && scope !== "libs" && scope !== "pkgs")
|
|
1002
965
|
return false;
|
|
1003
|
-
const base =
|
|
966
|
+
const base = path4.basename(abs);
|
|
1004
967
|
return parts.includes("srvkit") || parts.includes("common") || SERVER_SUFFIXES.some((suffix) => base.endsWith(suffix)) || SHARED_SUFFIXES.some((suffix) => base.endsWith(suffix)) || RUNTIME_METADATA_BASENAMES.has(base) || base === "main.ts" || base === "server.ts";
|
|
1005
968
|
};
|
|
1006
969
|
var shouldMarkBuildPhaseRecovered = (previousByPhase, status) => {
|
|
@@ -1161,83 +1124,12 @@ var mergeInvalidateMessages = (current, next) => {
|
|
|
1161
1124
|
var buildStatusReplaySequence = (pendingReplay, latestByPhase) => [...pendingReplay, ...latestByPhase.values()];
|
|
1162
1125
|
var filesChangedSince = (before, after) => [...before].filter(([file, stamp]) => after.get(file) !== stamp).map(([file]) => file);
|
|
1163
1126
|
|
|
1164
|
-
// pkgs/@akanjs/devkit/frontendBuild/watchRootResolver.ts
|
|
1165
|
-
import fs from "fs";
|
|
1166
|
-
import { readFile } from "fs/promises";
|
|
1167
|
-
import path6 from "path";
|
|
1168
|
-
|
|
1169
|
-
class WatchRootResolver {
|
|
1170
|
-
#app;
|
|
1171
|
-
constructor(app) {
|
|
1172
|
-
this.#app = app;
|
|
1173
|
-
}
|
|
1174
|
-
async resolve() {
|
|
1175
|
-
const tsconfig = await this.#app.getTsConfig();
|
|
1176
|
-
const appDir = path6.resolve(this.#app.cwdPath);
|
|
1177
|
-
const appsContainer = path6.dirname(appDir);
|
|
1178
|
-
const libsContainer = path6.resolve(this.#app.workspace.workspaceRoot, "libs");
|
|
1179
|
-
const libRoots = (await this.#resolveLibDeps(libsContainer))?.map((name) => path6.join(libsContainer, name)).filter((dir) => fs.existsSync(dir));
|
|
1180
|
-
const set = new Set;
|
|
1181
|
-
set.add(path6.resolve(`${this.#app.cwdPath}/page`));
|
|
1182
|
-
for (const targets of Object.values(tsconfig.compilerOptions.paths ?? {})) {
|
|
1183
|
-
for (const target of targets) {
|
|
1184
|
-
if (!target)
|
|
1185
|
-
continue;
|
|
1186
|
-
if (path6.isAbsolute(target))
|
|
1187
|
-
continue;
|
|
1188
|
-
const cleaned = target.replace(/\/?\*+.*$/, "").replace(/\/[^/]+\.[^/]+$/, "");
|
|
1189
|
-
const resolved = path6.resolve(this.#app.workspace.workspaceRoot, cleaned);
|
|
1190
|
-
if (resolved === libsContainer && libRoots) {
|
|
1191
|
-
for (const root of libRoots)
|
|
1192
|
-
set.add(root);
|
|
1193
|
-
continue;
|
|
1194
|
-
}
|
|
1195
|
-
const root = resolved === appsContainer ? appDir : resolved;
|
|
1196
|
-
if (fs.existsSync(root))
|
|
1197
|
-
set.add(root);
|
|
1198
|
-
}
|
|
1199
|
-
}
|
|
1200
|
-
return [...set];
|
|
1201
|
-
}
|
|
1202
|
-
async#resolveLibDeps(libsContainer) {
|
|
1203
|
-
const scanInfo = this.#app.getScanInfo({ allowEmpty: true });
|
|
1204
|
-
if (scanInfo?.type === "app")
|
|
1205
|
-
return scanInfo.libDeps;
|
|
1206
|
-
const direct = await WatchRootResolver.#readManifestLibDeps(path6.join(this.#app.cwdPath, "akan.app.json"));
|
|
1207
|
-
if (!direct)
|
|
1208
|
-
return null;
|
|
1209
|
-
const closure = new Set;
|
|
1210
|
-
const queue = [...direct];
|
|
1211
|
-
while (queue.length > 0) {
|
|
1212
|
-
const name = queue.shift();
|
|
1213
|
-
if (!name || closure.has(name))
|
|
1214
|
-
continue;
|
|
1215
|
-
closure.add(name);
|
|
1216
|
-
const nested = await WatchRootResolver.#readManifestLibDeps(path6.join(libsContainer, name, "akan.lib.json"));
|
|
1217
|
-
if (!nested)
|
|
1218
|
-
return null;
|
|
1219
|
-
queue.push(...nested);
|
|
1220
|
-
}
|
|
1221
|
-
return [...closure];
|
|
1222
|
-
}
|
|
1223
|
-
static async#readManifestLibDeps(manifestPath) {
|
|
1224
|
-
try {
|
|
1225
|
-
const parsed = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
1226
|
-
if (!Array.isArray(parsed.libDeps))
|
|
1227
|
-
return null;
|
|
1228
|
-
return parsed.libDeps.filter((name) => typeof name === "string" && name.length > 0);
|
|
1229
|
-
} catch {
|
|
1230
|
-
return null;
|
|
1231
|
-
}
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
|
|
1235
1127
|
// pkgs/@akanjs/devkit/frontendBuild/hmrWatcher.ts
|
|
1236
|
-
import
|
|
1237
|
-
import
|
|
1128
|
+
import fs from "fs";
|
|
1129
|
+
import path7 from "path";
|
|
1238
1130
|
|
|
1239
1131
|
// pkgs/@akanjs/devkit/frontendBuild/hmrChangeClassifier.ts
|
|
1240
|
-
import
|
|
1132
|
+
import path5 from "path";
|
|
1241
1133
|
var CSS_EXTS = new Set([".css"]);
|
|
1242
1134
|
var CONFIG_BASENAMES = new Set(["akan.config.ts", "bunfig.toml", "tsconfig.json", "package.json"]);
|
|
1243
1135
|
|
|
@@ -1245,10 +1137,10 @@ class HmrChangeClassifier {
|
|
|
1245
1137
|
classify(abs) {
|
|
1246
1138
|
if (this.#isUninteresting(abs))
|
|
1247
1139
|
return "ignore";
|
|
1248
|
-
const base =
|
|
1140
|
+
const base = path5.basename(abs);
|
|
1249
1141
|
if (CONFIG_BASENAMES.has(base))
|
|
1250
1142
|
return "config";
|
|
1251
|
-
const ext =
|
|
1143
|
+
const ext = path5.extname(abs).toLowerCase();
|
|
1252
1144
|
if (CSS_EXTS.has(ext))
|
|
1253
1145
|
return "css";
|
|
1254
1146
|
if (SOURCE_EXTS.has(ext))
|
|
@@ -1256,16 +1148,16 @@ class HmrChangeClassifier {
|
|
|
1256
1148
|
return "ignore";
|
|
1257
1149
|
}
|
|
1258
1150
|
#isUninteresting(abs) {
|
|
1259
|
-
const base =
|
|
1151
|
+
const base = path5.basename(abs);
|
|
1260
1152
|
if (!base)
|
|
1261
1153
|
return true;
|
|
1262
1154
|
if (base.startsWith("."))
|
|
1263
1155
|
return true;
|
|
1264
1156
|
if (base.endsWith("~") || base.endsWith(".swp") || base.endsWith(".swx") || base.endsWith(".tmp"))
|
|
1265
1157
|
return true;
|
|
1266
|
-
if (abs.includes(`${
|
|
1158
|
+
if (abs.includes(`${path5.sep}node_modules${path5.sep}`))
|
|
1267
1159
|
return true;
|
|
1268
|
-
if (abs.includes(`${
|
|
1160
|
+
if (abs.includes(`${path5.sep}.akan${path5.sep}`))
|
|
1269
1161
|
return true;
|
|
1270
1162
|
return false;
|
|
1271
1163
|
}
|
|
@@ -1273,7 +1165,7 @@ class HmrChangeClassifier {
|
|
|
1273
1165
|
|
|
1274
1166
|
// pkgs/@akanjs/devkit/frontendBuild/sourceMtimeIndex.ts
|
|
1275
1167
|
import { readdir, stat as stat3 } from "fs/promises";
|
|
1276
|
-
import
|
|
1168
|
+
import path6 from "path";
|
|
1277
1169
|
var UNREADABLE = Number.NaN;
|
|
1278
1170
|
|
|
1279
1171
|
class SourceMtimeIndex {
|
|
@@ -1336,7 +1228,7 @@ class SourceMtimeIndex {
|
|
|
1336
1228
|
if (!this.#primed)
|
|
1337
1229
|
return;
|
|
1338
1230
|
await Promise.all(paths.map(async (file) => {
|
|
1339
|
-
const abs =
|
|
1231
|
+
const abs = path6.resolve(file);
|
|
1340
1232
|
const stats = await stat3(abs).catch(() => null);
|
|
1341
1233
|
if (!stats?.isFile()) {
|
|
1342
1234
|
this.#files.delete(abs);
|
|
@@ -1422,7 +1314,7 @@ class SourceMtimeIndex {
|
|
|
1422
1314
|
for (const entry of entries) {
|
|
1423
1315
|
if (SourceMtimeIndex.#skipDirent(entry.name))
|
|
1424
1316
|
continue;
|
|
1425
|
-
const abs =
|
|
1317
|
+
const abs = path6.join(dir, entry.name);
|
|
1426
1318
|
if (entry.isDirectory()) {
|
|
1427
1319
|
descend.push(abs);
|
|
1428
1320
|
continue;
|
|
@@ -1449,7 +1341,7 @@ class SourceMtimeIndex {
|
|
|
1449
1341
|
}
|
|
1450
1342
|
if (known) {
|
|
1451
1343
|
for (const abs of [...this.#files.keys()]) {
|
|
1452
|
-
if (present.has(abs) ||
|
|
1344
|
+
if (present.has(abs) || path6.dirname(abs) !== dir)
|
|
1453
1345
|
continue;
|
|
1454
1346
|
this.#files.delete(abs);
|
|
1455
1347
|
changed?.add(abs);
|
|
@@ -1467,7 +1359,7 @@ class SourceMtimeIndex {
|
|
|
1467
1359
|
this.#unsettled.delete(dir);
|
|
1468
1360
|
}
|
|
1469
1361
|
#forget(dir) {
|
|
1470
|
-
const prefix = `${dir}${
|
|
1362
|
+
const prefix = `${dir}${path6.sep}`;
|
|
1471
1363
|
this.#dirs.delete(dir);
|
|
1472
1364
|
this.#unreadable.delete(dir);
|
|
1473
1365
|
this.#unsettled.delete(dir);
|
|
@@ -1505,8 +1397,8 @@ class SourceMtimeIndex {
|
|
|
1505
1397
|
return !name || name.startsWith(".") || name === "node_modules";
|
|
1506
1398
|
}
|
|
1507
1399
|
static #pruneNestedRoots(roots) {
|
|
1508
|
-
const resolved = [...new Set(roots.map((root) =>
|
|
1509
|
-
return resolved.filter((root) => !resolved.some((other) => other !== root && root.startsWith(`${other}${
|
|
1400
|
+
const resolved = [...new Set(roots.map((root) => path6.resolve(root)))].sort();
|
|
1401
|
+
return resolved.filter((root) => !resolved.some((other) => other !== root && root.startsWith(`${other}${path6.sep}`)));
|
|
1510
1402
|
}
|
|
1511
1403
|
}
|
|
1512
1404
|
|
|
@@ -1531,7 +1423,7 @@ class HmrWatcher {
|
|
|
1531
1423
|
#reportedCompensating = false;
|
|
1532
1424
|
#reportedGaps = "";
|
|
1533
1425
|
constructor(opts) {
|
|
1534
|
-
this.#roots = [...new Set(opts.roots.map((r) =>
|
|
1426
|
+
this.#roots = [...new Set(opts.roots.map((r) => path7.resolve(r)))];
|
|
1535
1427
|
this.#debounceMs = opts.debounceMs ?? HmrWatcher.#envDebounceMs() ?? 30;
|
|
1536
1428
|
this.#verifyDelayMs = opts.verifyDelayMs ?? 250;
|
|
1537
1429
|
this.#onBatch = opts.onBatch;
|
|
@@ -1544,10 +1436,10 @@ class HmrWatcher {
|
|
|
1544
1436
|
async start() {
|
|
1545
1437
|
for (const root of this.#roots) {
|
|
1546
1438
|
try {
|
|
1547
|
-
const w =
|
|
1439
|
+
const w = fs.watch(root, { recursive: true, persistent: false }, (_event, filename) => {
|
|
1548
1440
|
if (!filename)
|
|
1549
1441
|
return;
|
|
1550
|
-
const abs =
|
|
1442
|
+
const abs = path7.resolve(root, filename.toString());
|
|
1551
1443
|
this.#queue(abs);
|
|
1552
1444
|
});
|
|
1553
1445
|
w.on("error", (err) => {
|
|
@@ -1622,6 +1514,8 @@ class HmrWatcher {
|
|
|
1622
1514
|
try {
|
|
1623
1515
|
while (!this.#stopped) {
|
|
1624
1516
|
await this.#mergeDetectedChanges();
|
|
1517
|
+
if (this.#stopped)
|
|
1518
|
+
break;
|
|
1625
1519
|
if (this.#pending.size === 0) {
|
|
1626
1520
|
this.#windowStartedAt = null;
|
|
1627
1521
|
break;
|
|
@@ -1711,4 +1605,75 @@ class HmrWatcher {
|
|
|
1711
1605
|
}
|
|
1712
1606
|
}
|
|
1713
1607
|
|
|
1608
|
+
// pkgs/@akanjs/devkit/frontendBuild/watchRootResolver.ts
|
|
1609
|
+
import fs2 from "fs";
|
|
1610
|
+
import { readFile } from "fs/promises";
|
|
1611
|
+
import path8 from "path";
|
|
1612
|
+
|
|
1613
|
+
class WatchRootResolver {
|
|
1614
|
+
#app;
|
|
1615
|
+
constructor(app) {
|
|
1616
|
+
this.#app = app;
|
|
1617
|
+
}
|
|
1618
|
+
async resolve() {
|
|
1619
|
+
const tsconfig = await this.#app.getTsConfig();
|
|
1620
|
+
const appDir = path8.resolve(this.#app.cwdPath);
|
|
1621
|
+
const appsContainer = path8.dirname(appDir);
|
|
1622
|
+
const libsContainer = path8.resolve(this.#app.workspace.workspaceRoot, "libs");
|
|
1623
|
+
const libRoots = (await this.#resolveLibDeps(libsContainer))?.map((name) => path8.join(libsContainer, name)).filter((dir) => fs2.existsSync(dir));
|
|
1624
|
+
const set = new Set;
|
|
1625
|
+
set.add(path8.resolve(`${this.#app.cwdPath}/page`));
|
|
1626
|
+
for (const targets of Object.values(tsconfig.compilerOptions.paths ?? {})) {
|
|
1627
|
+
for (const target of targets) {
|
|
1628
|
+
if (!target)
|
|
1629
|
+
continue;
|
|
1630
|
+
if (path8.isAbsolute(target))
|
|
1631
|
+
continue;
|
|
1632
|
+
const cleaned = target.replace(/\/?\*+.*$/, "").replace(/\/[^/]+\.[^/]+$/, "");
|
|
1633
|
+
const resolved = path8.resolve(this.#app.workspace.workspaceRoot, cleaned);
|
|
1634
|
+
if (resolved === libsContainer && libRoots) {
|
|
1635
|
+
for (const root of libRoots)
|
|
1636
|
+
set.add(root);
|
|
1637
|
+
continue;
|
|
1638
|
+
}
|
|
1639
|
+
const root = resolved === appsContainer ? appDir : resolved;
|
|
1640
|
+
if (fs2.existsSync(root))
|
|
1641
|
+
set.add(root);
|
|
1642
|
+
}
|
|
1643
|
+
}
|
|
1644
|
+
return [...set];
|
|
1645
|
+
}
|
|
1646
|
+
async#resolveLibDeps(libsContainer) {
|
|
1647
|
+
const scanInfo = this.#app.getScanInfo({ allowEmpty: true });
|
|
1648
|
+
if (scanInfo?.type === "app")
|
|
1649
|
+
return scanInfo.libDeps;
|
|
1650
|
+
const direct = await WatchRootResolver.#readManifestLibDeps(path8.join(this.#app.cwdPath, "akan.app.json"));
|
|
1651
|
+
if (!direct)
|
|
1652
|
+
return null;
|
|
1653
|
+
const closure = new Set;
|
|
1654
|
+
const queue = [...direct];
|
|
1655
|
+
while (queue.length > 0) {
|
|
1656
|
+
const name = queue.shift();
|
|
1657
|
+
if (!name || closure.has(name))
|
|
1658
|
+
continue;
|
|
1659
|
+
closure.add(name);
|
|
1660
|
+
const nested = await WatchRootResolver.#readManifestLibDeps(path8.join(libsContainer, name, "akan.lib.json"));
|
|
1661
|
+
if (!nested)
|
|
1662
|
+
return null;
|
|
1663
|
+
queue.push(...nested);
|
|
1664
|
+
}
|
|
1665
|
+
return [...closure];
|
|
1666
|
+
}
|
|
1667
|
+
static async#readManifestLibDeps(manifestPath) {
|
|
1668
|
+
try {
|
|
1669
|
+
const parsed = JSON.parse(await readFile(manifestPath, "utf8"));
|
|
1670
|
+
if (!Array.isArray(parsed.libDeps))
|
|
1671
|
+
return null;
|
|
1672
|
+
return parsed.libDeps.filter((name) => typeof name === "string" && name.length > 0);
|
|
1673
|
+
} catch {
|
|
1674
|
+
return null;
|
|
1675
|
+
}
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1714
1679
|
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 };
|
|
@@ -5,23 +5,24 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
Executor,
|
|
7
7
|
WorkspaceExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-v72mh89f.js";
|
|
9
9
|
import {
|
|
10
10
|
getDirname2,
|
|
11
11
|
FileSys2
|
|
12
12
|
} from "./index-by2tvsq6.js";
|
|
13
13
|
import {
|
|
14
14
|
AppExecutor2
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-cet2s7xk.js";
|
|
16
16
|
import {
|
|
17
17
|
LibExecutor2
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-t00xrkey.js";
|
|
19
19
|
import {
|
|
20
20
|
PkgExecutor2
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-cc9pevta.js";
|
|
22
22
|
import {
|
|
23
|
-
ModuleExecutor
|
|
24
|
-
|
|
23
|
+
ModuleExecutor,
|
|
24
|
+
ErrorReport
|
|
25
|
+
} from "./index-4zqebbqb.js";
|
|
25
26
|
|
|
26
27
|
// pkgs/@akanjs/devkit/commandDecorators/camelToKebabCase.ts
|
|
27
28
|
var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
@@ -371,7 +372,7 @@ var printCliError = (error, stream = "log") => {
|
|
|
371
372
|
return;
|
|
372
373
|
loggedCliErrorObjects.add(error);
|
|
373
374
|
}
|
|
374
|
-
const message = CliError.messageOf(error);
|
|
375
|
+
const message = error instanceof Error ? ErrorReport.format(error) || error.name : CliError.messageOf(error);
|
|
375
376
|
if (loggedCliErrorMessages.has(message))
|
|
376
377
|
return;
|
|
377
378
|
loggedCliErrorMessages.add(message);
|