@akanjs/cli 3.2.0-rc.5 → 3.2.0-rc.6
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-4a2skdph.js → CodeAgent-aq43sq64.js} +2 -2
- package/{CodeTui-enrzsnzc.js → CodeTui-pmychb3m.js} +1 -1
- package/TunnelShare-11a3fqxb.js +14 -0
- package/{agent.command-y22t9x1e.js → agent.command-pdmb75bk.js} +15 -15
- package/akanCode.js +2 -2
- package/{application.command-yhj5arwc.js → application.command-xwch7rww.js} +16 -16
- package/{applicationBuildRunner-6w1fd61b.js → applicationBuildRunner-6yjrxfqs.js} +7 -6
- package/buildBatch.proc.js +6 -6
- package/{cloud.command-bqfh4cnx.js → cloud.command-g9k7zb5s.js} +16 -16
- package/cloud.script-jttgtbch.js +30 -0
- package/{code.command-y94hwxsn.js → code.command-ceyhrgrc.js} +6 -6
- package/{context.command-xz65fhrn.js → context.command-n7dbh0ca.js} +16 -16
- package/context.runner-9d5rbt2p.js +29 -0
- package/{guideline.command-sn843nw6.js → guideline.command-h5dfzrng.js} +2 -2
- package/guidelines/agentRule/agentRule.instruction.md +4 -3
- package/incrementalBuilder.proc.js +4 -4
- package/{index-wfmpxke3.js → index-0fq1b5jp.js} +10 -2
- package/{index-3wen6ddy.js → index-146p5x0r.js} +3 -3
- package/{index-jqsj5wjb.js → index-1xfdzwrt.js} +3 -3
- package/{index-w15hnxmb.js → index-2b3n00gz.js} +6 -6
- package/{index-b9q5aw30.js → index-2m6gaatn.js} +8 -8
- package/{index-jxaq2evq.js → index-36dywqhv.js} +2 -2
- package/{index-kjmrkc45.js → index-3wvc8cfa.js} +4 -4
- package/{index-50mg8bsm.js → index-80yc5q5y.js} +3 -3
- package/{index-49y45vbj.js → index-8bh9en9m.js} +8 -8
- package/{index-vftjqv28.js → index-9km2h20g.js} +2 -2
- package/{index-qrp98bmp.js → index-bza4z89k.js} +4 -4
- package/{index-5hhe0rdd.js → index-df0r4008.js} +1 -1
- package/{index-z9b72teg.js → index-dnqznx16.js} +1 -1
- package/{index-ygrdw6jw.js → index-dtxntsfx.js} +1 -1
- package/{index-fqx74yxn.js → index-fq72hk0a.js} +2 -2
- package/{index-kr8dvqnr.js → index-g6ss1r1w.js} +1 -1
- package/{index-hkq0q73d.js → index-ggzb32a9.js} +1 -1
- package/{index-w88xghey.js → index-h4xv44b2.js} +7 -7
- package/{index-5qq6qky3.js → index-kj7vyjng.js} +8 -8
- package/{index-kgxhwgdk.js → index-mcdezskv.js} +2 -2
- package/{index-ah09graf.js → index-mtxbw4fy.js} +13 -11
- package/{index-jrdp7c4h.js → index-n0vev0fv.js} +2 -2
- package/{index-y725zb1a.js → index-p9f6dsf2.js} +70 -23
- package/{index-5w8amdr7.js → index-qtcm6s8p.js} +22 -8
- package/{index-3rff2c48.js → index-qx12c8k5.js} +1 -1
- package/{index-sjj3ywn5.js → index-t0a5mng5.js} +4 -4
- package/{index-jgj6ajnk.js → index-ttrrm805.js} +4 -4
- package/{index-gsty3pkx.js → index-w0nztbs0.js} +3 -3
- package/{index-8vxdsqra.js → index-wnxc9n5v.js} +25 -9
- package/{index-2rcptfyp.js → index-xzscbgx2.js} +1 -1
- package/{index-8jpc5fqv.js → index-y1a7dc7t.js} +1 -1
- package/{index-g43360sn.js → index-y9xbhs20.js} +3 -3
- package/{index-4mgabs8t.js → index-yp6mpazs.js} +3 -3
- package/{index-02b8qvww.js → index-z0r6bhqe.js} +2 -2
- package/index.js +23 -23
- package/{library.command-6eafevmj.js → library.command-4c2yjfqa.js} +3 -3
- package/{localRegistry.command-9tef2qsj.js → localRegistry.command-ef65g36k.js} +15 -15
- package/{module.command-pn1k7dfk.js → module.command-c6284z1b.js} +5 -5
- package/{package.command-kbg9z7re.js → package.command-3wh1hh2j.js} +4 -4
- package/package.json +2 -2
- package/{page.command-st0y2xg8.js → page.command-sx22j4yv.js} +3 -3
- package/{pipeline.command-76m32y7z.js → pipeline.command-8kdcgy47.js} +2 -2
- package/{primitive.command-ax6wg70s.js → primitive.command-4jaegn0m.js} +6 -6
- package/{projectTypecheck-s9hhe5sa.js → projectTypecheck-t0r9argb.js} +1 -1
- package/{quality.command-0gzskga8.js → quality.command-46jhrbm2.js} +4 -4
- package/{repair.command-g5kc3x89.js → repair.command-dj4ke29k.js} +5 -5
- package/{scalar.command-ck8621dy.js → scalar.command-qwvbhytf.js} +4 -4
- package/{subspace.command-vh6dye0v.js → subspace.command-hg0hqscf.js} +8 -8
- package/{tunnel.command-4mezrypt.js → tunnel.command-00v81x42.js} +7 -7
- package/{verify.command-f2n4bwp7.js → verify.command-sz542tvy.js} +12 -12
- package/{workflow.command-bx9xwgs5.js → workflow.command-0ra9304f.js} +10 -10
- package/{workspace.command-04qgwsst.js → workspace.command-zvnybhr6.js} +29 -29
- package/TunnelShare-xs5rrpf1.js +0 -14
- package/cloud.script-8jvfw1sh.js +0 -30
- package/context.runner-dpt5wjb7.js +0 -29
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
JsonFormatter
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-0fq1b5jp.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) {
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
SOURCE_EXTS,
|
|
7
7
|
WatchRootResolver
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-p9f6dsf2.js";
|
|
9
9
|
import {
|
|
10
10
|
loaderFor,
|
|
11
11
|
BarrelAnalyzer,
|
|
@@ -21,12 +21,12 @@ import {
|
|
|
21
21
|
CsrDevPaths,
|
|
22
22
|
PagesEntrySourceGenerator,
|
|
23
23
|
PagesBundleBuilder
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-qx12c8k5.js";
|
|
25
25
|
import {
|
|
26
26
|
AsyncDefaultExportDetector,
|
|
27
27
|
StoreBootstrap,
|
|
28
28
|
resolveSsrPageEntriesForApp
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-0fq1b5jp.js";
|
|
30
30
|
|
|
31
31
|
// pkgs/@akanjs/devkit/frontendBuild/autoImportSync.ts
|
|
32
32
|
import { readdir, readFile, stat } from "fs/promises";
|
|
@@ -590,6 +590,7 @@ class GraphClientEntryDiscovery {
|
|
|
590
590
|
#resolvedFileCache = new Map;
|
|
591
591
|
#resolvedSpecifierCache = new Map;
|
|
592
592
|
#reachableEntriesCache = new Map;
|
|
593
|
+
#swappedEntriesCaches = new WeakMap;
|
|
593
594
|
#readFiles = new Set;
|
|
594
595
|
#barrelImporters = new Map;
|
|
595
596
|
#reread = new Map;
|
|
@@ -603,17 +604,27 @@ class GraphClientEntryDiscovery {
|
|
|
603
604
|
static async create(app) {
|
|
604
605
|
return new GraphClientEntryDiscovery(await app.getConfig(), await createTsconfigPackageResolver(app));
|
|
605
606
|
}
|
|
606
|
-
async discover(seeds) {
|
|
607
|
+
async discover(seeds, { importsAs } = {}) {
|
|
607
608
|
this.#settled = this.#settled.then(() => this.#dropRenarrowed());
|
|
608
609
|
await this.#settled;
|
|
609
610
|
const entries = new Set;
|
|
611
|
+
const reachable = importsAs ? this.#swappedEntriesCache(importsAs) : this.#reachableEntriesCache;
|
|
610
612
|
for (const seed of seeds) {
|
|
611
|
-
const walk = { visiting: new Set, partial: new Set, memo: new Map };
|
|
613
|
+
const walk = { visiting: new Set, partial: new Set, memo: new Map, importsAs, reachable };
|
|
612
614
|
for (const entry of await this.#discoverFromFile(seed, walk))
|
|
613
615
|
entries.add(entry);
|
|
614
616
|
}
|
|
615
617
|
return Array.from(entries).sort();
|
|
616
618
|
}
|
|
619
|
+
async resolveImport(spec, importerDir) {
|
|
620
|
+
const resolved = await this.#resolveSpecifier(spec, importerDir);
|
|
621
|
+
return resolved ? path2.resolve(resolved) : null;
|
|
622
|
+
}
|
|
623
|
+
#swappedEntriesCache(importsAs) {
|
|
624
|
+
const cache = this.#swappedEntriesCaches.get(importsAs) ?? new Map;
|
|
625
|
+
this.#swappedEntriesCaches.set(importsAs, cache);
|
|
626
|
+
return cache;
|
|
627
|
+
}
|
|
617
628
|
invalidate(files) {
|
|
618
629
|
if (files.length === 0)
|
|
619
630
|
return;
|
|
@@ -630,6 +641,7 @@ class GraphClientEntryDiscovery {
|
|
|
630
641
|
}
|
|
631
642
|
this.#epoch += 1;
|
|
632
643
|
this.#reachableEntriesCache.clear();
|
|
644
|
+
this.#swappedEntriesCaches = new WeakMap;
|
|
633
645
|
for (const [barrel, before] of this.#analyzer.forget(files))
|
|
634
646
|
if (!this.#reread.has(barrel))
|
|
635
647
|
this.#reread.set(barrel, before);
|
|
@@ -734,7 +746,8 @@ class GraphClientEntryDiscovery {
|
|
|
734
746
|
async#discoverFromFile(file, walk) {
|
|
735
747
|
const epoch = this.#epoch;
|
|
736
748
|
const absPath = path2.resolve(file);
|
|
737
|
-
const
|
|
749
|
+
const importsAs = walk.importsAs?.get(absPath);
|
|
750
|
+
const cached = walk.reachable.get(absPath);
|
|
738
751
|
if (cached)
|
|
739
752
|
return new Set(cached);
|
|
740
753
|
const memo = walk.memo.get(absPath);
|
|
@@ -767,7 +780,8 @@ class GraphClientEntryDiscovery {
|
|
|
767
780
|
}
|
|
768
781
|
const importerDir = path2.dirname(absPath);
|
|
769
782
|
for (const imp of facts.imports) {
|
|
770
|
-
const
|
|
783
|
+
const swapped = importsAs?.get(imp.path);
|
|
784
|
+
const spec = swapped === undefined ? imp.path : swapped;
|
|
771
785
|
if (!spec)
|
|
772
786
|
continue;
|
|
773
787
|
if (NON_SOURCE_EXT_RE.test(spec))
|
|
@@ -786,7 +800,7 @@ class GraphClientEntryDiscovery {
|
|
|
786
800
|
walk.visiting.delete(absPath);
|
|
787
801
|
walk.memo.set(absPath, entries);
|
|
788
802
|
if (epoch === this.#epoch && !walk.partial.has(absPath))
|
|
789
|
-
|
|
803
|
+
walk.reachable.set(absPath, entries);
|
|
790
804
|
return new Set(entries);
|
|
791
805
|
}
|
|
792
806
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
script
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-ggzb32a9.js";
|
|
5
5
|
import {
|
|
6
6
|
AppExecutor,
|
|
7
7
|
LibExecutor,
|
|
8
8
|
ModuleExecutor
|
|
9
|
-
} from "./index-
|
|
9
|
+
} from "./index-0fq1b5jp.js";
|
|
10
10
|
import {
|
|
11
11
|
InteractionScaffold,
|
|
12
12
|
workflowStatus,
|
|
@@ -45,10 +45,10 @@ import {
|
|
|
45
45
|
addFieldUiPolicyForType,
|
|
46
46
|
KeyRename,
|
|
47
47
|
MutationScaffold
|
|
48
|
-
} from "./index-
|
|
48
|
+
} from "./index-z0r6bhqe.js";
|
|
49
49
|
import {
|
|
50
50
|
ModuleScript
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-ttrrm805.js";
|
|
52
52
|
import {
|
|
53
53
|
plainNameProblem
|
|
54
54
|
} from "./index-va90m8nd.js";
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-ggzb32a9.js";
|
|
6
6
|
import {
|
|
7
7
|
ModuleExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-0fq1b5jp.js";
|
|
9
9
|
import {
|
|
10
10
|
sourceFile,
|
|
11
11
|
moduleSourcePaths,
|
|
@@ -13,10 +13,10 @@ import {
|
|
|
13
13
|
createPassedPrimitiveReport,
|
|
14
14
|
bilingualLabelForField,
|
|
15
15
|
bilingualDescriptionForField
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-z0r6bhqe.js";
|
|
17
17
|
import {
|
|
18
18
|
PageScript
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-dnqznx16.js";
|
|
20
20
|
import {
|
|
21
21
|
pluralizeName
|
|
22
22
|
} from "./index-nz8prx9g.js";
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-ggzb32a9.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSys2
|
|
8
8
|
} from "./index-bns3wcpc.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-0fq1b5jp.js";
|
|
12
12
|
import {
|
|
13
13
|
TypeScriptDependencyScanner2
|
|
14
14
|
} from "./index-qd7xn2bk.js";
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
} from "./index-cmg5ngqa.js";
|
|
18
18
|
import {
|
|
19
19
|
MaintainabilityBaseline
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-dtxntsfx.js";
|
|
21
21
|
import {
|
|
22
22
|
assertPackageName
|
|
23
23
|
} from "./index-va90m8nd.js";
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
+
ROOT_LAYOUT_SYSTEM,
|
|
4
|
+
isImplicitRootLayoutKey,
|
|
3
5
|
resolveSsrPageEntriesForApp
|
|
4
|
-
} from "./index-
|
|
6
|
+
} from "./index-0fq1b5jp.js";
|
|
5
7
|
import {
|
|
6
8
|
computeRouteSeedIndex,
|
|
7
9
|
saveRouteSeedIndex,
|
|
@@ -9,12 +11,12 @@ import {
|
|
|
9
11
|
ClientEntriesBundler,
|
|
10
12
|
VENDOR_SPECIFIERS,
|
|
11
13
|
RouteClientBuilder
|
|
12
|
-
} from "./index-
|
|
14
|
+
} from "./index-qtcm6s8p.js";
|
|
13
15
|
import {
|
|
14
16
|
SOURCE_EXTS,
|
|
15
17
|
FontOptimizer,
|
|
16
18
|
FontPruner
|
|
17
|
-
} from "./index-
|
|
19
|
+
} from "./index-p9f6dsf2.js";
|
|
18
20
|
import {
|
|
19
21
|
BarrelAnalyzer,
|
|
20
22
|
createTsconfigPackageResolver,
|
|
@@ -22,7 +24,7 @@ import {
|
|
|
22
24
|
CsrEntryFiles,
|
|
23
25
|
toClientReferencePath,
|
|
24
26
|
PagesBundleBuilder
|
|
25
|
-
} from "./index-
|
|
27
|
+
} from "./index-qx12c8k5.js";
|
|
26
28
|
import {
|
|
27
29
|
CssBlockParser
|
|
28
30
|
} from "./index-62md4dwy.js";
|
|
@@ -98,7 +100,7 @@ class AllRoutesBuilder {
|
|
|
98
100
|
};
|
|
99
101
|
#knownSet = new Set;
|
|
100
102
|
#routeIds = [];
|
|
101
|
-
#
|
|
103
|
+
#ssrEntriesByRoute = new Map;
|
|
102
104
|
#externalsByChunkUrl = {};
|
|
103
105
|
#discovery = null;
|
|
104
106
|
constructor(app, command = "start") {
|
|
@@ -111,14 +113,16 @@ class AllRoutesBuilder {
|
|
|
111
113
|
const pageEntries = await resolveSsrPageEntriesForApp(this.#app, pageKeys);
|
|
112
114
|
const seedIndex = computeRouteSeedIndex(pageEntries);
|
|
113
115
|
this.#app.verbose(`[build-all] discovered ${seedIndex.entries.length} routes`);
|
|
114
|
-
|
|
116
|
+
const discovery = await GraphClientEntryDiscovery.create(this.#app);
|
|
117
|
+
this.#discovery = discovery;
|
|
118
|
+
const importsAs = await this.#ssrImportsAs(discovery, pageEntries);
|
|
115
119
|
const allEntries = new Set;
|
|
116
120
|
for (const entry of seedIndex.entries) {
|
|
117
121
|
const seeds = Array.from(new Set([...seedIndex.globalLayoutFiles, ...entry.seeds]));
|
|
118
|
-
const routeEntries = await
|
|
122
|
+
const routeEntries = await discovery.discover(seeds);
|
|
119
123
|
for (const discovered of routeEntries)
|
|
120
124
|
allEntries.add(discovered);
|
|
121
|
-
this.#
|
|
125
|
+
this.#ssrEntriesByRoute.set(entry.routeId, await discovery.discover(seeds, { importsAs }));
|
|
122
126
|
this.#routeIds.push(entry.routeId);
|
|
123
127
|
}
|
|
124
128
|
this.#app.verbose(`[build-all] ${allEntries.size} client entries across ${this.#routeIds.length} routes`);
|
|
@@ -134,10 +138,22 @@ class AllRoutesBuilder {
|
|
|
134
138
|
this.#app.verbose(`[build-all] wrote ${manifestPath} routes=${this.#routeIds.length} entries=${this.#merged.knownEntries.length}`);
|
|
135
139
|
return { manifest, manifestPath, seedIndex };
|
|
136
140
|
}
|
|
141
|
+
async#ssrImportsAs(discovery, pageEntries) {
|
|
142
|
+
const { specifier, ssrShell, importsNoSsrPageRenders } = ROOT_LAYOUT_SYSTEM;
|
|
143
|
+
const importsAs = new Map;
|
|
144
|
+
const toShell = new Map([[specifier, ssrShell]]);
|
|
145
|
+
for (const { key, moduleAbsPath } of pageEntries)
|
|
146
|
+
if (isImplicitRootLayoutKey(key))
|
|
147
|
+
importsAs.set(path.resolve(moduleAbsPath), toShell);
|
|
148
|
+
const system = await discovery.resolveImport(specifier, this.#app.cwdPath);
|
|
149
|
+
if (system)
|
|
150
|
+
importsAs.set(system, new Map(importsNoSsrPageRenders.map((spec) => [spec, null])));
|
|
151
|
+
return importsAs;
|
|
152
|
+
}
|
|
137
153
|
async writeModulePreloads(runtimeChunks) {
|
|
138
154
|
const preloads = new RouteModulePreloads({
|
|
139
155
|
runtimeChunks,
|
|
140
|
-
entriesByRoute: this.#
|
|
156
|
+
entriesByRoute: this.#ssrEntriesByRoute,
|
|
141
157
|
clientManifest: this.#merged.clientManifest,
|
|
142
158
|
externalsByChunkUrl: this.#externalsByChunkUrl,
|
|
143
159
|
workspaceRoot: this.#app.workspace.workspaceRoot
|
|
@@ -5,17 +5,17 @@ import {
|
|
|
5
5
|
AkanAppConfig,
|
|
6
6
|
Executor,
|
|
7
7
|
WorkspaceExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-0fq1b5jp.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveAppId,
|
|
11
11
|
targetHtmlFilename
|
|
12
12
|
} from "./index-m9jj544v.js";
|
|
13
13
|
import {
|
|
14
14
|
CsrArtifactBuilder
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-36dywqhv.js";
|
|
16
16
|
import {
|
|
17
17
|
ExitCodeError
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-ggzb32a9.js";
|
|
19
19
|
|
|
20
20
|
// pkgs/@akanjs/devkit/mobile/desktopBin.ts
|
|
21
21
|
import { chmod, mkdir, rename, rm, writeFile } from "fs/promises";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-fq72hk0a.js";
|
|
5
5
|
import {
|
|
6
6
|
writeWorkflowRunArtifact,
|
|
7
7
|
generatedFilePathsForTarget,
|
|
8
8
|
writeGeneratedSyncState,
|
|
9
9
|
createRepairReport,
|
|
10
10
|
renderRepairReport
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-z0r6bhqe.js";
|
|
12
12
|
import {
|
|
13
13
|
runner
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-ggzb32a9.js";
|
|
15
15
|
import {
|
|
16
16
|
isWorkflowSysName,
|
|
17
17
|
isWorkflowModuleName
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
AppExecutor,
|
|
4
4
|
LibExecutor
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-0fq1b5jp.js";
|
|
6
6
|
import {
|
|
7
7
|
createAst,
|
|
8
8
|
AkanIndex
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
} from "./index-va90m8nd.js";
|
|
14
14
|
import {
|
|
15
15
|
camelToKebabCase
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-ggzb32a9.js";
|
|
17
17
|
|
|
18
18
|
// pkgs/@akanjs/devkit/workflow/artifacts.ts
|
|
19
19
|
import { capitalize as capitalize2 } from "akanjs/common";
|
package/index.js
CHANGED
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
getTargetMetas,
|
|
5
5
|
getTargetCommandNames,
|
|
6
6
|
runCommands
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-ggzb32a9.js";
|
|
8
8
|
import"./index-bns3wcpc.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-0fq1b5jp.js";
|
|
10
10
|
|
|
11
11
|
// pkgs/@akanjs/cli/bunVersionGuard.ts
|
|
12
12
|
class BunVersionGuard {
|
|
@@ -22,27 +22,27 @@ import path from "path";
|
|
|
22
22
|
|
|
23
23
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
24
24
|
var commandModules = {
|
|
25
|
-
workspace: async () => (await import("./workspace.command-
|
|
26
|
-
agent: async () => (await import("./agent.command-
|
|
27
|
-
code: async () => (await import("./code.command-
|
|
28
|
-
application: async () => (await import("./application.command-
|
|
29
|
-
library: async () => (await import("./library.command-
|
|
30
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
31
|
-
package: async () => (await import("./package.command-
|
|
32
|
-
module: async () => (await import("./module.command-
|
|
33
|
-
page: async () => (await import("./page.command-
|
|
34
|
-
context: async () => (await import("./context.command-
|
|
35
|
-
cloud: async () => (await import("./cloud.command-
|
|
36
|
-
subspace: async () => (await import("./subspace.command-
|
|
37
|
-
guideline: async () => (await import("./guideline.command-
|
|
38
|
-
scalar: async () => (await import("./scalar.command-
|
|
39
|
-
primitive: async () => (await import("./primitive.command-
|
|
40
|
-
quality: async () => (await import("./quality.command-
|
|
41
|
-
verify: async () => (await import("./verify.command-
|
|
42
|
-
repair: async () => (await import("./repair.command-
|
|
43
|
-
workflow: async () => (await import("./workflow.command-
|
|
44
|
-
pipeline: async () => (await import("./pipeline.command-
|
|
45
|
-
tunnel: async () => (await import("./tunnel.command-
|
|
25
|
+
workspace: async () => (await import("./workspace.command-zvnybhr6.js")).WorkspaceCommand,
|
|
26
|
+
agent: async () => (await import("./agent.command-pdmb75bk.js")).AgentCommand,
|
|
27
|
+
code: async () => (await import("./code.command-ceyhrgrc.js")).CodeCommand,
|
|
28
|
+
application: async () => (await import("./application.command-xwch7rww.js")).ApplicationCommand,
|
|
29
|
+
library: async () => (await import("./library.command-4c2yjfqa.js")).LibraryCommand,
|
|
30
|
+
localRegistry: async () => (await import("./localRegistry.command-ef65g36k.js")).LocalRegistryCommand,
|
|
31
|
+
package: async () => (await import("./package.command-3wh1hh2j.js")).PackageCommand,
|
|
32
|
+
module: async () => (await import("./module.command-c6284z1b.js")).ModuleCommand,
|
|
33
|
+
page: async () => (await import("./page.command-sx22j4yv.js")).PageCommand,
|
|
34
|
+
context: async () => (await import("./context.command-n7dbh0ca.js")).ContextCommand,
|
|
35
|
+
cloud: async () => (await import("./cloud.command-g9k7zb5s.js")).CloudCommand,
|
|
36
|
+
subspace: async () => (await import("./subspace.command-hg0hqscf.js")).SubspaceCommand,
|
|
37
|
+
guideline: async () => (await import("./guideline.command-h5dfzrng.js")).GuidelineCommand,
|
|
38
|
+
scalar: async () => (await import("./scalar.command-qwvbhytf.js")).ScalarCommand,
|
|
39
|
+
primitive: async () => (await import("./primitive.command-4jaegn0m.js")).PrimitiveCommand,
|
|
40
|
+
quality: async () => (await import("./quality.command-46jhrbm2.js")).QualityCommand,
|
|
41
|
+
verify: async () => (await import("./verify.command-sz542tvy.js")).VerifyCommand,
|
|
42
|
+
repair: async () => (await import("./repair.command-dj4ke29k.js")).RepairCommand,
|
|
43
|
+
workflow: async () => (await import("./workflow.command-0ra9304f.js")).WorkflowCommand,
|
|
44
|
+
pipeline: async () => (await import("./pipeline.command-8kdcgy47.js")).PipelineCommand,
|
|
45
|
+
tunnel: async () => (await import("./tunnel.command-00v81x42.js")).TunnelCommand
|
|
46
46
|
};
|
|
47
47
|
var commandModuleIds = Object.keys(commandModules);
|
|
48
48
|
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
Lib,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-ggzb32a9.js";
|
|
7
7
|
import"./index-bns3wcpc.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-0fq1b5jp.js";
|
|
9
9
|
import {
|
|
10
10
|
LibraryScript
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-n0vev0fv.js";
|
|
12
12
|
|
|
13
13
|
// pkgs/@akanjs/cli/library/library.command.ts
|
|
14
14
|
class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
|
|
@@ -4,41 +4,41 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-ggzb32a9.js";
|
|
8
8
|
import"./index-bns3wcpc.js";
|
|
9
9
|
import {
|
|
10
10
|
parseEnvFile,
|
|
11
11
|
PkgExecutor
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-0fq1b5jp.js";
|
|
13
13
|
import {
|
|
14
14
|
npmRegistryFromEnv,
|
|
15
15
|
warnIgnoredNpmRegistry,
|
|
16
16
|
getNpmRegistryUrl
|
|
17
17
|
} from "./index-ny2k80mv.js";
|
|
18
|
-
import"./index-
|
|
19
|
-
import"./index-
|
|
20
|
-
import"./index-
|
|
18
|
+
import"./index-p9f6dsf2.js";
|
|
19
|
+
import"./index-y9xbhs20.js";
|
|
20
|
+
import"./index-df0r4008.js";
|
|
21
21
|
import"./index-m9jj544v.js";
|
|
22
|
-
import"./index-
|
|
23
|
-
import"./index-
|
|
24
|
-
import"./index-
|
|
25
|
-
import"./index-
|
|
22
|
+
import"./index-qx12c8k5.js";
|
|
23
|
+
import"./index-36dywqhv.js";
|
|
24
|
+
import"./index-n0vev0fv.js";
|
|
25
|
+
import"./index-kj7vyjng.js";
|
|
26
26
|
import"./index-b4qq3rq0.js";
|
|
27
27
|
import {
|
|
28
28
|
ApplicationScript
|
|
29
|
-
} from "./index-
|
|
30
|
-
import"./index-
|
|
29
|
+
} from "./index-mtxbw4fy.js";
|
|
30
|
+
import"./index-9km2h20g.js";
|
|
31
31
|
import {
|
|
32
32
|
CloudRunner
|
|
33
|
-
} from "./index-
|
|
33
|
+
} from "./index-3wvc8cfa.js";
|
|
34
34
|
import"./index-qd7xn2bk.js";
|
|
35
35
|
import"./index-9p260r4e.js";
|
|
36
36
|
import"./index-cmg5ngqa.js";
|
|
37
|
-
import"./index-
|
|
37
|
+
import"./index-dtxntsfx.js";
|
|
38
38
|
import {
|
|
39
39
|
PackageScript
|
|
40
|
-
} from "./index-
|
|
41
|
-
import"./index-
|
|
40
|
+
} from "./index-w0nztbs0.js";
|
|
41
|
+
import"./index-y1a7dc7t.js";
|
|
42
42
|
import"./index-9bv479q5.js";
|
|
43
43
|
|
|
44
44
|
// pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
|