@akanjs/cli 3.3.0-rc.1 → 3.3.0-rc.2
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-xdw73nbz.js +11 -0
- package/{CodeTui-zee8atsr.js → CodeTui-0gewm71c.js} +4 -4
- package/TunnelShare-cccfdgbm.js +16 -0
- package/{agent.command-x65f2ags.js → agent.command-g1mj34wz.js} +20 -22
- package/akanCode.js +5 -5
- package/appExecutor-rrx10jya.js +11 -0
- package/{application.command-azbd1pb2.js → application.command-3w4v7t40.js} +17 -19
- package/{applicationBuildRunner-trfxv3pd.js → applicationBuildRunner-y5xbetyz.js} +12 -12
- package/buildBatch.proc.js +19 -18
- package/{cloud.command-gapp4634.js → cloud.command-ph0rz6sw.js} +19 -24
- package/cloud.script-8bs9tp4j.js +30 -0
- package/{code.command-5smx61yf.js → code.command-9b967qpg.js} +13 -13
- package/{context.command-ym5jbkny.js → context.command-ndzs5rbf.js} +20 -22
- package/context.runner-bmstpng2.js +32 -0
- package/csrArtifactBuilder-gtvff6k7.js +10 -0
- package/{index-2ny1e95c.js → dependencyScanner-93g8tk0r.js} +6 -5
- package/{fileSys-q22646yc.js → fileSys-e5mwt73x.js} +1 -1
- package/frameworkGraph-aneq2nwy.js +8 -0
- package/{guideline.command-zwypaqsh.js → guideline.command-y8qz9kxy.js} +8 -8
- package/incrementalBuilder.proc.js +24 -18
- package/{index-8jtqfye2.js → index-02v45hh9.js} +6 -6
- package/{index-2jmvfa62.js → index-0csk6jqm.js} +3 -3
- package/{index-nc3br31y.js → index-0wa5z6rm.js} +2 -2
- package/{index-9wh04mqy.js → index-0z8sbdme.js} +2 -2
- package/{index-zmd9xxgd.js → index-1c2807kg.js} +3 -3
- package/{index-4ss4gkv3.js → index-1p9bxjmt.js} +2 -2
- package/{index-612fdtbk.js → index-2kh4xj3m.js} +1 -1
- package/{index-kfvjzk8r.js → index-2vn0m9z5.js} +3 -3
- package/{index-xwwex8rf.js → index-3569fr49.js} +5 -5
- package/{index-a860mx0m.js → index-38x8ynrx.js} +24 -24
- package/{index-p7beqww9.js → index-3fmzz9sf.js} +18 -18
- package/{index-s885g0jj.js → index-45aprybg.js} +3 -3
- package/{index-v7ajmsh3.js → index-4a1n0nym.js} +1 -1
- package/{index-ybcb9wc8.js → index-4zgm54wf.js} +9 -9
- package/{index-2yn3r67f.js → index-652f3bs8.js} +6 -6
- package/{index-j6jjmn2r.js → index-6gepp8yn.js} +10 -10
- package/{index-dmcpetwe.js → index-6j351de4.js} +98 -23
- package/{index-0dm25wvf.js → index-7ssr7wq4.js} +1 -1
- package/{index-k6vwww45.js → index-82cmbpxc.js} +7 -7
- package/{index-j592zfqc.js → index-9rymt8d6.js} +1 -1
- package/{index-275a4r3n.js → index-ankyx6dj.js} +11 -15
- package/{index-41a03gkj.js → index-b0t92k71.js} +19 -19
- package/{index-z92zm3wd.js → index-b372rck5.js} +17 -6
- package/{index-78y75t0a.js → index-cm9rb480.js} +6 -6
- package/{index-z96ks033.js → index-d0n78fzc.js} +153 -45
- package/{index-gt8phqpt.js → index-dr1carpr.js} +4 -4
- package/{index-zfnz878d.js → index-f2arv0mv.js} +1 -1
- package/{index-67sd09ag.js → index-gtydr9qc.js} +8 -8
- package/{index-knpm8sdm.js → index-j3fqs8rc.js} +1 -1
- package/{index-h901f24n.js → index-jdw9m5c4.js} +5 -5
- package/{index-dadwp2aw.js → index-jg5rwrf7.js} +49 -22
- package/{index-baccvws5.js → index-ktxdfqg5.js} +1 -1
- package/{index-w1zexzpx.js → index-mnhrqjjq.js} +1 -1
- package/{index-71y6176j.js → index-pc42gxa5.js} +7 -7
- package/{index-6dzjer7p.js → index-q8h4eg5y.js} +6 -6
- package/{index-j0wr4e32.js → index-qh81drde.js} +9 -9
- package/{index-jek2re5k.js → index-scfsqen7.js} +4 -4
- package/{index-0s7w2085.js → index-twjgmryg.js} +4 -4
- package/{index-7wf8snar.js → index-whvhsb5f.js} +1 -1
- package/{index-p5zh7pmc.js → index-xv3pvdw4.js} +1 -1
- package/{index-3txdtztz.js → index-y2g0s9tn.js} +1 -1
- package/{index-ebn9kgea.js → index-ymgsvhc5.js} +4 -5
- package/{index-by2tvsq6.js → index-zyjztrvc.js} +1 -1
- package/index.js +30 -28
- package/{libExecutor-jc6f8hm6.js → libExecutor-nstr00s7.js} +3 -3
- package/{library.command-nxvesvhb.js → library.command-b02aw1hm.js} +8 -8
- package/{localRegistry.command-xz62e4ng.js → localRegistry.command-3hg1p4aj.js} +18 -23
- package/{module.command-aaws9byg.js → module.command-bd9gz6cv.js} +10 -10
- package/{package.command-j7hv26p0.js → package.command-xmr0mxze.js} +9 -12
- package/package.json +2 -2
- package/{page.command-7yffs7n9.js → page.command-x94qf58g.js} +8 -8
- package/{pipeline.command-7yk0zcng.js → pipeline.command-n2843k6t.js} +7 -7
- package/{pkgExecutor-arxmvx4t.js → pkgExecutor-cka27e3c.js} +3 -3
- package/{primitive.command-7a1pt715.js → primitive.command-cs7v376h.js} +11 -11
- package/{projectTypecheck-f4qhbecd.js → projectTypecheck-za2n3nbr.js} +1 -1
- package/{prompter-qyggfhqd.js → prompter-d33wmdpa.js} +2 -2
- package/{quality.command-c6mvrjh1.js → quality.command-nqngh1jd.js} +9 -9
- package/{repair.command-093adzt9.js → repair.command-v2medwsm.js} +10 -10
- package/{scalar.command-2ex84spb.js → scalar.command-61cjmxn1.js} +9 -9
- package/{subspace.command-4n4n4jpv.js → subspace.command-dtv8nfh7.js} +11 -13
- package/{tunnel.command-f7ep1qfa.js → tunnel.command-fmwm5fgb.js} +10 -12
- package/{verify.command-zrkxnvct.js → verify.command-4f260t53.js} +15 -17
- package/{workflow.command-ks16jegk.js → workflow.command-tm5q9xsm.js} +15 -15
- package/{workspace.command-ahhfpaag.js → workspace.command-75gc280j.js} +34 -38
- package/CodeAgent-fx6088tv.js +0 -11
- package/TunnelShare-9ry4vh0y.js +0 -18
- package/appExecutor-79azsb2w.js +0 -11
- package/cloud.script-3b401efv.js +0 -35
- package/context.runner-kctbfsde.js +0 -34
- package/dependencyScanner-ge10gb52.js +0 -8
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
ApplicationBuildReporter
|
|
4
|
-
} from "./index-dmcpetwe.js";
|
|
5
2
|
import {
|
|
6
3
|
parseBiomeReport,
|
|
7
4
|
Linter,
|
|
8
5
|
ProjectTypecheck2
|
|
9
|
-
} from "./index-
|
|
6
|
+
} from "./index-pc42gxa5.js";
|
|
10
7
|
import {
|
|
11
8
|
TypecheckFailure
|
|
12
9
|
} from "./index-j4yvgfhr.js";
|
|
10
|
+
import {
|
|
11
|
+
ApplicationBuildReporter
|
|
12
|
+
} from "./index-6j351de4.js";
|
|
13
13
|
import {
|
|
14
14
|
AppExecutor2
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-b372rck5.js";
|
|
16
16
|
import {
|
|
17
17
|
LibExecutor2
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-f2arv0mv.js";
|
|
19
19
|
import {
|
|
20
20
|
PkgExecutor2
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-mnhrqjjq.js";
|
|
22
22
|
import {
|
|
23
23
|
WorkspaceRunner,
|
|
24
24
|
AkanQualityScanner
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-cm9rb480.js";
|
|
26
26
|
import {
|
|
27
27
|
VerifyScope
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-d0n78fzc.js";
|
|
29
29
|
|
|
30
30
|
// pkgs/@akanjs/cli/verify/verifyComments.ts
|
|
31
31
|
import { existsSync } from "fs";
|
|
@@ -5,24 +5,24 @@ import {
|
|
|
5
5
|
import {
|
|
6
6
|
Executor,
|
|
7
7
|
WorkspaceExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-pc42gxa5.js";
|
|
9
9
|
import {
|
|
10
10
|
getDirname2,
|
|
11
11
|
FileSys2
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-zyjztrvc.js";
|
|
13
13
|
import {
|
|
14
14
|
AppExecutor2
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-b372rck5.js";
|
|
16
16
|
import {
|
|
17
17
|
LibExecutor2
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-f2arv0mv.js";
|
|
19
19
|
import {
|
|
20
20
|
PkgExecutor2
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-mnhrqjjq.js";
|
|
22
22
|
import {
|
|
23
23
|
ModuleExecutor,
|
|
24
24
|
ErrorReport
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-whvhsb5f.js";
|
|
26
26
|
|
|
27
27
|
// pkgs/@akanjs/devkit/commandDecorators/camelToKebabCase.ts
|
|
28
28
|
var camelToKebabCase = (str) => str.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
script,
|
|
5
5
|
WorkspaceVersionCheck,
|
|
6
6
|
markCliErrorPrinted
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-652f3bs8.js";
|
|
8
8
|
import {
|
|
9
9
|
CliError
|
|
10
10
|
} from "./index-j4yvgfhr.js";
|
|
@@ -16,39 +16,39 @@ import {
|
|
|
16
16
|
upsertAgentBlock,
|
|
17
17
|
renderRecipeEntries,
|
|
18
18
|
CLAUDE_COMMENT_RULE
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-pc42gxa5.js";
|
|
20
20
|
import {
|
|
21
21
|
AppExecutor2
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-b372rck5.js";
|
|
23
23
|
import {
|
|
24
24
|
LibExecutor2
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-f2arv0mv.js";
|
|
26
26
|
import {
|
|
27
27
|
AkanContextAnalyzer
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-jdw9m5c4.js";
|
|
29
29
|
import {
|
|
30
30
|
collectRecipeSources2,
|
|
31
31
|
scanRecipes2
|
|
32
32
|
} from "./index-1p81ecbz.js";
|
|
33
33
|
import {
|
|
34
34
|
akanCodePaths2
|
|
35
|
-
} from "./index-
|
|
35
|
+
} from "./index-xv3pvdw4.js";
|
|
36
36
|
import {
|
|
37
37
|
ConventionSet,
|
|
38
38
|
Prompter2
|
|
39
|
-
} from "./index-
|
|
39
|
+
} from "./index-j3fqs8rc.js";
|
|
40
40
|
import {
|
|
41
41
|
ApplicationRunner,
|
|
42
42
|
VerifyScope
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-d0n78fzc.js";
|
|
44
44
|
import {
|
|
45
45
|
WorkspaceRunner
|
|
46
|
-
} from "./index-
|
|
46
|
+
} from "./index-cm9rb480.js";
|
|
47
47
|
import {
|
|
48
48
|
VerifyComments,
|
|
49
49
|
VerifyPipeline,
|
|
50
50
|
VerifyReport
|
|
51
|
-
} from "./index-
|
|
51
|
+
} from "./index-4zgm54wf.js";
|
|
52
52
|
|
|
53
53
|
// pkgs/@akanjs/cli/agent/agent.script.ts
|
|
54
54
|
import { Logger as Logger3 } from "akanjs/common";
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./index-
|
|
3
|
+
FileSys2
|
|
4
|
+
} from "./index-zyjztrvc.js";
|
|
5
|
+
import {
|
|
6
|
+
JsonFormatter,
|
|
7
|
+
AkanAppConfig
|
|
8
|
+
} from "./index-pc42gxa5.js";
|
|
5
9
|
import {
|
|
6
|
-
|
|
7
|
-
} from "./index-
|
|
10
|
+
ErrorReport
|
|
11
|
+
} from "./index-whvhsb5f.js";
|
|
8
12
|
|
|
9
13
|
// pkgs/@akanjs/devkit/app/applicationBuildReporter.ts
|
|
10
14
|
import { Logger } from "akanjs/common";
|
|
@@ -14,14 +18,28 @@ import path4 from "path";
|
|
|
14
18
|
import { toError } from "akanjs/common";
|
|
15
19
|
|
|
16
20
|
// pkgs/@akanjs/devkit/frontendBuild/fontPruner.ts
|
|
17
|
-
import { rm, rmdir, stat as stat2 } from "fs/promises";
|
|
21
|
+
import { rm as rm2, rmdir, stat as stat2 } from "fs/promises";
|
|
18
22
|
import path2 from "path";
|
|
19
23
|
import { isFontOptimizationEnabled } from "akanjs/client";
|
|
20
24
|
|
|
21
25
|
// pkgs/@akanjs/devkit/frontendBuild/fontOptimizer.ts
|
|
22
|
-
import { mkdir, stat } from "fs/promises";
|
|
26
|
+
import { mkdir, readdir, rm, stat } from "fs/promises";
|
|
23
27
|
import path from "path";
|
|
24
28
|
import ts from "typescript";
|
|
29
|
+
|
|
30
|
+
// pkgs/@akanjs/devkit/frontendBuild/buildCacheStamp.ts
|
|
31
|
+
import { statSync } from "fs";
|
|
32
|
+
var buildCacheStamp = (producers) => ({
|
|
33
|
+
akanjs: AkanAppConfig.akanVersion,
|
|
34
|
+
bun: `${Bun.version}+${Bun.revision}`,
|
|
35
|
+
code: producers.map((file) => {
|
|
36
|
+
const stats = statSync(file, { throwIfNoEntry: false });
|
|
37
|
+
return stats ? `${stats.mtimeMs}:${stats.size}` : "missing";
|
|
38
|
+
}).join(",")
|
|
39
|
+
});
|
|
40
|
+
var isBuildCacheStamp = (value, stamp) => value?.akanjs === stamp.akanjs && value.bun === stamp.bun && value.code === stamp.code;
|
|
41
|
+
|
|
42
|
+
// pkgs/@akanjs/devkit/frontendBuild/fontOptimizer.ts
|
|
25
43
|
var FONT_URL_PREFIX = "/_akan/fonts";
|
|
26
44
|
var DEFAULT_FONT_SUBSETS = ["latin"];
|
|
27
45
|
|
|
@@ -29,15 +47,18 @@ class FontOptimizer {
|
|
|
29
47
|
#app;
|
|
30
48
|
#command;
|
|
31
49
|
#artifactRoot;
|
|
50
|
+
#cacheRoot;
|
|
51
|
+
#stamp = buildCacheStamp([import.meta.path]);
|
|
32
52
|
#files = [];
|
|
33
53
|
#cssParts = [];
|
|
34
54
|
#woff2Ready = null;
|
|
35
55
|
static #ksX1001Text = null;
|
|
36
|
-
static #cacheVersion =
|
|
56
|
+
static #cacheVersion = 4;
|
|
37
57
|
constructor(app, command = "start") {
|
|
38
58
|
this.#app = app;
|
|
39
59
|
this.#command = command;
|
|
40
60
|
this.#artifactRoot = path.join(command === "build" ? app.dist.cwdPath : app.cwdPath, ".akan/artifact");
|
|
61
|
+
this.#cacheRoot = command === "build" ? this.#artifactRoot : path.join(app.cwdPath, ".akan/cache");
|
|
41
62
|
}
|
|
42
63
|
async optimize() {
|
|
43
64
|
const fonts = await this.discoverFonts();
|
|
@@ -58,11 +79,13 @@ class FontOptimizer {
|
|
|
58
79
|
const result = { css: this.#cssParts.join(`
|
|
59
80
|
`), fonts, files: this.#files };
|
|
60
81
|
if (cacheKey)
|
|
61
|
-
await this.#writeCache(cacheKey, result)
|
|
82
|
+
await this.#writeCache(cacheKey, result).catch(() => {
|
|
83
|
+
return;
|
|
84
|
+
});
|
|
62
85
|
return result;
|
|
63
86
|
}
|
|
64
87
|
get #cachePath() {
|
|
65
|
-
return path.join(this.#
|
|
88
|
+
return path.join(this.#cacheRoot, "fontCache.json");
|
|
66
89
|
}
|
|
67
90
|
async#buildCacheKey(fonts) {
|
|
68
91
|
const sources = [];
|
|
@@ -71,10 +94,10 @@ class FontOptimizer {
|
|
|
71
94
|
continue;
|
|
72
95
|
for (const face of this.#getFontFaces(font)) {
|
|
73
96
|
const sourcePath = await this.#resolveFontSourcePath(face.src);
|
|
74
|
-
const
|
|
75
|
-
if (!
|
|
97
|
+
const digest = sourcePath ? await this.#fileDigest(sourcePath) : null;
|
|
98
|
+
if (!digest)
|
|
76
99
|
return null;
|
|
77
|
-
sources.push({ optimizedSrc: face.optimizedSrc, ...
|
|
100
|
+
sources.push({ optimizedSrc: face.optimizedSrc, sourcePath, ...digest });
|
|
78
101
|
}
|
|
79
102
|
for (const filePath of font.subsetFiles ?? []) {
|
|
80
103
|
const abs = path.isAbsolute(filePath) ? filePath : path.join(this.#app.cwdPath, filePath);
|
|
@@ -86,11 +109,30 @@ class FontOptimizer {
|
|
|
86
109
|
if (this.#getFontSubsets(font).includes("auto"))
|
|
87
110
|
sources.push({ autoSubsetText: this.#cacheDigest(await this.#collectAutoSubsetText()) });
|
|
88
111
|
}
|
|
89
|
-
|
|
112
|
+
const lockfile = await this.#lockfileDigest();
|
|
113
|
+
return this.#cacheDigest({
|
|
114
|
+
version: FontOptimizer.#cacheVersion,
|
|
115
|
+
command: this.#command,
|
|
116
|
+
lockfile,
|
|
117
|
+
fonts,
|
|
118
|
+
sources
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
async#lockfileDigest() {
|
|
122
|
+
const root = this.#app.workspace.workspaceRoot;
|
|
123
|
+
const lockfiles = await Promise.all(["bun.lock", "bun.lockb"].map((name) => Bun.file(path.join(root, name)).bytes().catch(() => null)));
|
|
124
|
+
return lockfiles.map((bytes) => bytes ? this.#sha256(bytes) : null);
|
|
125
|
+
}
|
|
126
|
+
#sha256(bytes) {
|
|
127
|
+
return new Bun.CryptoHasher("sha256").update(bytes).digest("hex");
|
|
90
128
|
}
|
|
91
129
|
#cacheDigest(value) {
|
|
92
130
|
return new Bun.CryptoHasher("sha256").update(this.#stableStringify(value)).digest("hex");
|
|
93
131
|
}
|
|
132
|
+
async#fileDigest(filePath) {
|
|
133
|
+
const bytes = await Bun.file(filePath).bytes().catch(() => null);
|
|
134
|
+
return bytes ? { size: bytes.byteLength, sha256: this.#sha256(bytes) } : null;
|
|
135
|
+
}
|
|
94
136
|
async#fileStamp(filePath) {
|
|
95
137
|
try {
|
|
96
138
|
const stats = await stat(filePath);
|
|
@@ -101,23 +143,56 @@ class FontOptimizer {
|
|
|
101
143
|
}
|
|
102
144
|
async#readCache(key) {
|
|
103
145
|
const cache = await Bun.file(this.#cachePath).json().catch(() => null);
|
|
104
|
-
if (cache?.version !== FontOptimizer.#cacheVersion || cache.key !== key)
|
|
146
|
+
if (cache?.version !== FontOptimizer.#cacheVersion || cache.key !== key || typeof cache.css !== "string")
|
|
147
|
+
return null;
|
|
148
|
+
if (!isBuildCacheStamp(cache, this.#stamp) || !Array.isArray(cache.files))
|
|
105
149
|
return null;
|
|
106
|
-
const files =
|
|
107
|
-
for (const
|
|
108
|
-
|
|
150
|
+
const files = [];
|
|
151
|
+
for (const file of cache.files) {
|
|
152
|
+
const bytes = await this.#readIntact(this.#cacheRoot, file);
|
|
153
|
+
if (!bytes)
|
|
109
154
|
return null;
|
|
155
|
+
if (this.#cacheRoot !== this.#artifactRoot && !await this.#readIntact(this.#artifactRoot, file))
|
|
156
|
+
await Bun.write(path.join(this.#artifactRoot, file.path), bytes);
|
|
157
|
+
files.push(path.join(this.#artifactRoot, file.path));
|
|
110
158
|
}
|
|
111
159
|
return { css: cache.css, files };
|
|
112
160
|
}
|
|
161
|
+
async#readIntact(root, file) {
|
|
162
|
+
if (typeof file?.path !== "string" || typeof file.size !== "number")
|
|
163
|
+
return null;
|
|
164
|
+
const bytes = await Bun.file(path.join(root, file.path)).bytes().catch(() => null);
|
|
165
|
+
if (!bytes || bytes.byteLength !== file.size || this.#sha256(bytes) !== file.sha256)
|
|
166
|
+
return null;
|
|
167
|
+
return bytes;
|
|
168
|
+
}
|
|
113
169
|
async#writeCache(key, result) {
|
|
170
|
+
const files = [];
|
|
171
|
+
for (const filePath of result.files) {
|
|
172
|
+
const bytes = await Bun.file(filePath).bytes();
|
|
173
|
+
const relativePath = path.relative(this.#artifactRoot, filePath);
|
|
174
|
+
const cachedPath = path.join(this.#cacheRoot, relativePath);
|
|
175
|
+
if (cachedPath !== filePath)
|
|
176
|
+
await FileSys2.writeTextAtomic(cachedPath, bytes);
|
|
177
|
+
files.push({ path: relativePath, size: bytes.byteLength, sha256: this.#sha256(bytes) });
|
|
178
|
+
}
|
|
114
179
|
const cache = {
|
|
115
180
|
version: FontOptimizer.#cacheVersion,
|
|
181
|
+
...this.#stamp,
|
|
116
182
|
key,
|
|
117
183
|
css: result.css,
|
|
118
|
-
files
|
|
184
|
+
files
|
|
119
185
|
};
|
|
120
|
-
await
|
|
186
|
+
await FileSys2.writeTextAtomic(this.#cachePath, JSON.stringify(cache));
|
|
187
|
+
await this.#pruneCachedFonts(files);
|
|
188
|
+
}
|
|
189
|
+
async#pruneCachedFonts(kept) {
|
|
190
|
+
if (this.#cacheRoot === this.#artifactRoot)
|
|
191
|
+
return;
|
|
192
|
+
const dir = path.join(this.#cacheRoot, FONT_URL_PREFIX.replace(/^\/_akan\//, ""));
|
|
193
|
+
const keep = new Set(kept.map((file) => path.join(this.#cacheRoot, file.path)));
|
|
194
|
+
const names = await readdir(dir).catch(() => []);
|
|
195
|
+
await Promise.all(names.filter((name) => !name.endsWith(".tmp")).map((name) => path.join(dir, name)).filter((filePath) => !keep.has(filePath)).map((filePath) => rm(filePath, { force: true })));
|
|
121
196
|
}
|
|
122
197
|
async discoverFonts() {
|
|
123
198
|
const pageKeys = await this.#app.getPageKeys();
|
|
@@ -620,7 +695,7 @@ class FontPruner {
|
|
|
620
695
|
}
|
|
621
696
|
}
|
|
622
697
|
async#remove(files) {
|
|
623
|
-
await Promise.all(files.map((file) =>
|
|
698
|
+
await Promise.all(files.map((file) => rm2(path2.join(this.#publicRoot, file), { force: true })));
|
|
624
699
|
const dirs = [...new Set(files.map((file) => path2.posix.dirname(file)))].filter((dir) => dir !== "." && dir !== "/").sort((a, b) => b.length - a.length);
|
|
625
700
|
for (const dir of dirs)
|
|
626
701
|
await rmdir(path2.join(this.#publicRoot, dir)).catch(() => {
|
|
@@ -1244,7 +1319,7 @@ class HmrChangeClassifier {
|
|
|
1244
1319
|
}
|
|
1245
1320
|
|
|
1246
1321
|
// pkgs/@akanjs/devkit/frontendBuild/sourceMtimeIndex.ts
|
|
1247
|
-
import { readdir, stat as stat3 } from "fs/promises";
|
|
1322
|
+
import { readdir as readdir2, stat as stat3 } from "fs/promises";
|
|
1248
1323
|
import path7 from "path";
|
|
1249
1324
|
var UNREADABLE = Number.NaN;
|
|
1250
1325
|
|
|
@@ -1465,7 +1540,7 @@ class SourceMtimeIndex {
|
|
|
1465
1540
|
}
|
|
1466
1541
|
static async#readdirPath(dir) {
|
|
1467
1542
|
try {
|
|
1468
|
-
return { entries: await
|
|
1543
|
+
return { entries: await readdir2(dir, { withFileTypes: true }), err: null };
|
|
1469
1544
|
} catch (err) {
|
|
1470
1545
|
return { entries: null, err };
|
|
1471
1546
|
}
|
|
@@ -1773,4 +1848,4 @@ class WatchRootResolver {
|
|
|
1773
1848
|
}
|
|
1774
1849
|
}
|
|
1775
1850
|
|
|
1776
|
-
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, precompressArtifacts, RouteJsBudget, ApplicationBuildReporter };
|
|
1851
|
+
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, buildCacheStamp, isBuildCacheStamp, FontOptimizer, FontPruner, precompressArtifacts, RouteJsBudget, ApplicationBuildReporter };
|
|
@@ -4,27 +4,27 @@ import {
|
|
|
4
4
|
CloudApi,
|
|
5
5
|
CloudUpdates,
|
|
6
6
|
PipelineSecrets
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-45aprybg.js";
|
|
8
8
|
import {
|
|
9
9
|
PkgExecutor2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-mnhrqjjq.js";
|
|
11
11
|
import {
|
|
12
12
|
UpdatePackFolder,
|
|
13
13
|
NativePublicEnv,
|
|
14
14
|
NativeApp
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-ymgsvhc5.js";
|
|
16
16
|
import {
|
|
17
17
|
script
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-652f3bs8.js";
|
|
19
19
|
import {
|
|
20
20
|
ApplicationScript
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-b0t92k71.js";
|
|
22
22
|
import {
|
|
23
23
|
PackageScript
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-ankyx6dj.js";
|
|
25
25
|
import {
|
|
26
26
|
CloudRunner
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-3569fr49.js";
|
|
28
28
|
|
|
29
29
|
// pkgs/@akanjs/cli/cloud/cloud.script.ts
|
|
30
30
|
import { Logger } from "akanjs/common";
|
|
@@ -2,22 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-652f3bs8.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSys2
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-zyjztrvc.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor2
|
|
11
|
-
} from "./index-
|
|
12
|
-
import {
|
|
13
|
-
FrameworkGraph
|
|
14
|
-
} from "./index-p7beqww9.js";
|
|
11
|
+
} from "./index-mnhrqjjq.js";
|
|
15
12
|
import {
|
|
16
13
|
MaintainabilityBaseline
|
|
17
|
-
} from "./index-
|
|
18
|
-
import {
|
|
19
|
-
TypeScriptDependencyScanner2
|
|
20
|
-
} from "./index-2ny1e95c.js";
|
|
14
|
+
} from "./index-ktxdfqg5.js";
|
|
21
15
|
import {
|
|
22
16
|
assertPackageName
|
|
23
17
|
} from "./index-va90m8nd.js";
|
|
@@ -169,9 +163,10 @@ class PackageRunner extends runner("package") {
|
|
|
169
163
|
return await pkg.scan();
|
|
170
164
|
}
|
|
171
165
|
async buildPackage(pkg) {
|
|
166
|
+
const { TypeScriptDependencyScanner } = await import("./dependencyScanner-93g8tk0r.js");
|
|
172
167
|
await $`rm -rf ${pkg.dist.cwdPath}`;
|
|
173
168
|
await pkg.dist.mkdir(pkg.dist.cwdPath);
|
|
174
|
-
const scanner = await
|
|
169
|
+
const scanner = await TypeScriptDependencyScanner.from(pkg);
|
|
175
170
|
const { npmDeps, npmDevDeps, missingDeps } = await scanner.getPackageBuildDependencies(pkg.name);
|
|
176
171
|
const packageRuntimeDependencies = {
|
|
177
172
|
"@akanjs/devkit": [
|
|
@@ -286,9 +281,9 @@ class PackageRunner extends runner("package") {
|
|
|
286
281
|
if (!failures.length)
|
|
287
282
|
return;
|
|
288
283
|
throw new Error(`[package] ${pkg.name} dist imports ${failures.length} subpath(s) no consumer can resolve:
|
|
289
|
-
|
|
284
|
+
${failures.sort((a, b) => a < b ? -1 : a > b ? 1 : 0).join(`
|
|
290
285
|
`)}
|
|
291
|
-
|
|
286
|
+
Add the missing "exports" entries: a bare file facet needs "./*": "./*.ts", a directory facet needs its own "./name": "./name/index.ts", and "./*.ts": "./*.ts" keeps an already-suffixed specifier from gaining a second extension.`);
|
|
292
287
|
}
|
|
293
288
|
async#verifyDistImportsPublished(pkg) {
|
|
294
289
|
const imports = await this.#collectDistAkanImports(pkg.dist.cwdPath, PackageRunner.#unpublishedPackages);
|
|
@@ -300,9 +295,9 @@ class PackageRunner extends runner("package") {
|
|
|
300
295
|
return ` ${specifier} \u2014 imported by ${shown}`;
|
|
301
296
|
});
|
|
302
297
|
throw new Error(`[package] ${pkg.name} dist imports ${failures.length} specifier(s) of a package that is never published:
|
|
303
|
-
|
|
298
|
+
${failures.sort((a, b) => a < b ? -1 : a > b ? 1 : 0).join(`
|
|
304
299
|
`)}
|
|
305
|
-
|
|
300
|
+
Reach it through a published package that embeds it (akanjs/native/api for @akanjs/native/api), or embed it in this package's build.`);
|
|
306
301
|
}
|
|
307
302
|
async verifyDistPackage(pkg, {
|
|
308
303
|
peerExportsMaps = new Map
|
|
@@ -355,6 +350,7 @@ class PackageRunner extends runner("package") {
|
|
|
355
350
|
};
|
|
356
351
|
}
|
|
357
352
|
async syncArchitecture(workspace) {
|
|
353
|
+
const { FrameworkGraph } = await import("./frameworkGraph-aneq2nwy.js");
|
|
358
354
|
const architecture = await FrameworkGraph.architecture(workspace.workspaceRoot);
|
|
359
355
|
if (!architecture)
|
|
360
356
|
throw new Error(`${FrameworkGraph.architectureFile} is only kept in the akanjs repository`);
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
import {
|
|
3
|
+
SysExecutor
|
|
4
|
+
} from "./index-pc42gxa5.js";
|
|
5
|
+
import {
|
|
6
|
+
CliError
|
|
7
|
+
} from "./index-j4yvgfhr.js";
|
|
2
8
|
import {
|
|
3
9
|
ApplicationBuildReporter
|
|
4
|
-
} from "./index-
|
|
10
|
+
} from "./index-6j351de4.js";
|
|
5
11
|
import {
|
|
6
12
|
script,
|
|
7
13
|
markCliErrorPrinted,
|
|
8
14
|
assertPromptable
|
|
9
|
-
} from "./index-
|
|
10
|
-
import {
|
|
11
|
-
CliError
|
|
12
|
-
} from "./index-j4yvgfhr.js";
|
|
13
|
-
import {
|
|
14
|
-
SysExecutor
|
|
15
|
-
} from "./index-71y6176j.js";
|
|
15
|
+
} from "./index-652f3bs8.js";
|
|
16
16
|
import {
|
|
17
17
|
AppExecutor2
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-b372rck5.js";
|
|
19
19
|
import {
|
|
20
20
|
LibExecutor2
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-f2arv0mv.js";
|
|
22
22
|
import {
|
|
23
23
|
PkgExecutor2
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-mnhrqjjq.js";
|
|
25
25
|
import {
|
|
26
26
|
DesktopServerStage
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-2kh4xj3m.js";
|
|
28
28
|
import {
|
|
29
29
|
LibraryScript
|
|
30
|
-
} from "./index-
|
|
30
|
+
} from "./index-0csk6jqm.js";
|
|
31
31
|
import {
|
|
32
32
|
ApplicationRunner,
|
|
33
33
|
VerifyScope
|
|
34
|
-
} from "./index-
|
|
34
|
+
} from "./index-d0n78fzc.js";
|
|
35
35
|
import {
|
|
36
36
|
PreviewChrome2,
|
|
37
37
|
PreviewView2,
|
|
@@ -39,13 +39,13 @@ import {
|
|
|
39
39
|
} from "./index-rwgqba9p.js";
|
|
40
40
|
import {
|
|
41
41
|
formatSlicePlan
|
|
42
|
-
} from "./index-
|
|
43
|
-
import {
|
|
44
|
-
assertPlainName
|
|
45
|
-
} from "./index-va90m8nd.js";
|
|
42
|
+
} from "./index-9rymt8d6.js";
|
|
46
43
|
import {
|
|
47
44
|
openBrowser
|
|
48
45
|
} from "./index-9dp031by.js";
|
|
46
|
+
import {
|
|
47
|
+
assertPlainName
|
|
48
|
+
} from "./index-va90m8nd.js";
|
|
49
49
|
|
|
50
50
|
// pkgs/@akanjs/cli/application/application.script.ts
|
|
51
51
|
import { mkdir as mkdir3, rm } from "fs/promises";
|
|
@@ -1779,7 +1779,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1779
1779
|
await Promise.all(shares.map(async (share) => await share.close()));
|
|
1780
1780
|
}, "Abandoning the tunnel release; the shares expire on their own.");
|
|
1781
1781
|
await Promise.all(apps.map(async (app) => {
|
|
1782
|
-
const { TunnelShare } = await import("./TunnelShare-
|
|
1782
|
+
const { TunnelShare } = await import("./TunnelShare-cccfdgbm.js");
|
|
1783
1783
|
const share = await TunnelShare.open(app, { workspace: app.workspace });
|
|
1784
1784
|
shares.push(share);
|
|
1785
1785
|
urls.set(app.name, share.url);
|
|
@@ -7,16 +7,16 @@ import {
|
|
|
7
7
|
AkanAppConfig,
|
|
8
8
|
increaseBuildNum,
|
|
9
9
|
decreaseBuildNum
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-pc42gxa5.js";
|
|
11
11
|
import {
|
|
12
12
|
FileSys2
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-zyjztrvc.js";
|
|
14
14
|
import {
|
|
15
15
|
LibExecutor2
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-f2arv0mv.js";
|
|
17
17
|
|
|
18
18
|
// pkgs/@akanjs/devkit/executors/appExecutor.ts
|
|
19
|
-
import { cp as cpEntry, lstat, mkdir, readdir as readDirEntries, realpath, symlink } from "fs/promises";
|
|
19
|
+
import { cp as cpEntry, lstat, mkdir, readdir as readDirEntries, realpath, rm as rm2, stat, symlink } from "fs/promises";
|
|
20
20
|
import path3 from "path";
|
|
21
21
|
import { pathToFileURL } from "url";
|
|
22
22
|
import { isRouteSourceFile, parseRouteModuleKey, validatePageSourceFile, validateSubRoutePageKey } from "akanjs/common";
|
|
@@ -409,7 +409,7 @@ class AppExecutor2 extends SysExecutor {
|
|
|
409
409
|
static from(executor, name) {
|
|
410
410
|
return new AppExecutor2({ workspace: executor instanceof WorkspaceExecutor ? executor : executor.workspace, name });
|
|
411
411
|
}
|
|
412
|
-
static #keptOnStart = [path3.join(".akan", "cache"
|
|
412
|
+
static #keptOnStart = [path3.join(".akan", "cache")];
|
|
413
413
|
static #legacyNative = path3.join(".akan", "native");
|
|
414
414
|
async#removeDevOutput(dir = ".akan") {
|
|
415
415
|
const entries = await readDirEntries(this.getPath(dir)).catch(() => []);
|
|
@@ -420,12 +420,23 @@ class AppExecutor2 extends SysExecutor {
|
|
|
420
420
|
return;
|
|
421
421
|
}
|
|
422
422
|
if (AppExecutor2.#keptOnStart.includes(entry))
|
|
423
|
-
return;
|
|
423
|
+
return await this.#removeStaleTemps(entry);
|
|
424
424
|
if (AppExecutor2.#keptOnStart.some((kept) => kept.startsWith(`${entry}${path3.sep}`)))
|
|
425
425
|
return await this.#removeDevOutput(entry);
|
|
426
426
|
await this.removeDir(entry);
|
|
427
427
|
}));
|
|
428
428
|
}
|
|
429
|
+
static #staleTempMs = 60000;
|
|
430
|
+
async#removeStaleTemps(dir) {
|
|
431
|
+
const root = this.getPath(dir);
|
|
432
|
+
const names = await readDirEntries(root, { recursive: true }).catch(() => []);
|
|
433
|
+
await Promise.all(names.filter((name) => name.endsWith(".tmp")).map(async (name) => {
|
|
434
|
+
const file = path3.join(root, name);
|
|
435
|
+
const stats = await stat(file).catch(() => null);
|
|
436
|
+
if (stats?.isFile() && Date.now() - stats.mtimeMs > AppExecutor2.#staleTempMs)
|
|
437
|
+
await rm2(file, { force: true });
|
|
438
|
+
}));
|
|
439
|
+
}
|
|
429
440
|
getEnv() {
|
|
430
441
|
return WorkspaceExecutor.getBaseDevEnv().env;
|
|
431
442
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
camelToKebabCase,
|
|
4
4
|
runner
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-652f3bs8.js";
|
|
6
6
|
import {
|
|
7
7
|
rootAllowedFiles,
|
|
8
8
|
rootAllowedDirs,
|
|
@@ -16,16 +16,16 @@ import {
|
|
|
16
16
|
renderScopeAgentBlock,
|
|
17
17
|
SysExecutor,
|
|
18
18
|
WorkspaceExecutor
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-pc42gxa5.js";
|
|
20
20
|
import {
|
|
21
21
|
FileSys2
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-zyjztrvc.js";
|
|
23
23
|
import {
|
|
24
24
|
LibExecutor2
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-f2arv0mv.js";
|
|
26
26
|
import {
|
|
27
27
|
PkgExecutor2
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-mnhrqjjq.js";
|
|
29
29
|
import {
|
|
30
30
|
collectRecipeSources2,
|
|
31
31
|
scanRecipes2
|
|
@@ -40,7 +40,7 @@ import {
|
|
|
40
40
|
} from "./index-zyb0ebm4.js";
|
|
41
41
|
import {
|
|
42
42
|
MaintainabilityBaseline
|
|
43
|
-
} from "./index-
|
|
43
|
+
} from "./index-ktxdfqg5.js";
|
|
44
44
|
import {
|
|
45
45
|
createFactReader,
|
|
46
46
|
createAst
|