@akanjs/cli 3.3.0-rc.12 → 3.3.0-rc.13
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-cqbf9gsv.js → CodeAgent-zkr3s3xy.js} +2 -2
- package/{CodeTui-ehdr4hgw.js → CodeTui-1qvrzfmy.js} +1 -1
- package/TunnelShare-8j95ta3w.js +16 -0
- package/{agent.command-x55ncdjm.js → agent.command-dejgb8vz.js} +18 -17
- package/akanCode.js +2 -2
- package/{appExecutor-1ctzymwa.js → appExecutor-nj95a6en.js} +3 -3
- package/{application.command-xpntxnh8.js → application.command-3tnq1587.js} +45 -15
- package/{applicationBuildRunner-19c76791.js → applicationBuildRunner-cbjy05yg.js} +75 -12
- package/buildBatch.proc.js +10 -10
- package/{cloud.command-p3ybjes7.js → cloud.command-qae6et2e.js} +19 -18
- package/cloud.script-34xmprty.js +31 -0
- package/{code.command-m6skj1kj.js → code.command-xrh506zf.js} +10 -10
- package/commandManifest.json +1 -1
- package/{context.command-3c3nv0d6.js → context.command-fxyzkwg5.js} +18 -18
- package/context.runner-bz1jwxkk.js +32 -0
- package/{csrArtifactBuilder-mdh9ykn2.js → csrArtifactBuilder-rqg85wbg.js} +2 -2
- package/{guideline.command-725fq5p0.js → guideline.command-7dgscqjq.js} +6 -6
- package/guidelines/conventions/rules/config.md +5 -0
- package/guidelines/conventions/rules/page.md +3 -0
- package/guidelines/errorCodes/errorCodes.instruction.md +4 -0
- package/guidelines/pageRule/pageRule.instruction.md +19 -0
- package/guidelines/runtimeRule/runtimeRule.instruction.md +109 -6
- package/incrementalBuilder.proc.js +8 -8
- package/{index-3mj5trqc.js → index-0bzrcv91.js} +1 -1
- package/{index-q63nbpv7.js → index-0zkxsdsg.js} +3 -3
- package/{index-wxqp1amd.js → index-1c52g4st.js} +11 -9
- package/{index-vnk1qwgr.js → index-22h6vq3f.js} +4 -4
- package/index-35p43f33.js +16 -0
- package/{index-fagjtk6m.js → index-3q7ectss.js} +2 -2
- package/{index-se7n78fh.js → index-54g085ty.js} +1 -1
- package/{index-rt7q20sj.js → index-5sa1tr7w.js} +1 -1
- package/{index-h8w1n11r.js → index-6a3rmwxx.js} +4 -4
- package/{index-yey1envc.js → index-741xbhes.js} +1 -1
- package/{index-9a9t77hz.js → index-77627y32.js} +2 -2
- package/{index-4r8dgm4x.js → index-8javbznc.js} +3 -3
- package/{index-hxg6ctk2.js → index-a2a3nh57.js} +3 -3
- package/{index-j2wq064m.js → index-aezpcphy.js} +121 -15
- package/{index-3r1crbct.js → index-ay4vkwr8.js} +1 -1
- package/{index-t23dgyaf.js → index-b4m7bjbx.js} +7 -7
- package/{index-rdcgz02t.js → index-bma8tmgb.js} +4 -4
- package/{index-3zkhg65e.js → index-c4g8egm2.js} +40 -13
- package/{index-9gjcbp2g.js → index-c8kj74zz.js} +1 -1
- package/{index-fjqapyex.js → index-es2wkn41.js} +40 -5
- package/{index-pyjkbg8e.js → index-extg77rx.js} +2 -2
- package/{index-nmdmkjt2.js → index-fey1dd49.js} +4 -4
- package/{index-c669pbyb.js → index-fjzeak0t.js} +68 -37
- package/{index-f4jydw2x.js → index-gdgbgn82.js} +1 -1
- package/{index-4yvtqcme.js → index-gyyscjzx.js} +16 -4
- package/{index-qecrqpt6.js → index-hxcefw29.js} +1 -1
- package/{index-a4gcdffy.js → index-k380ww64.js} +3 -3
- package/index-kqxs1d7z.js +377 -0
- package/{index-nnmw56fz.js → index-mv3ke0fc.js} +5 -5
- package/{index-m303nhv6.js → index-mvdmb73w.js} +6 -6
- package/{index-cbm9gzgx.js → index-pa53zktp.js} +5 -5
- package/{index-3a3vy2xy.js → index-psvxwemh.js} +8 -8
- package/{index-ckcc9ab3.js → index-r24mj2pw.js} +8 -8
- package/{index-8bta5pnr.js → index-serpfvat.js} +2 -2
- package/{index-kbnvyhy4.js → index-shjjjdte.js} +3 -3
- package/{index-pr9nypg7.js → index-sjmk7wp7.js} +2 -2
- package/{index-wkwe91sn.js → index-th7qbjfz.js} +11 -11
- package/{index-5ahe641t.js → index-vgd07z61.js} +8 -8
- package/{index-crd99zqs.js → index-wzvvqkcy.js} +1 -1
- package/{index-v16gj2as.js → index-ys1sjp6m.js} +90 -51
- package/{index-22bwg8hy.js → index-zc43cyg8.js} +1 -1
- package/index.js +27 -27
- package/{libExecutor-n8hpm8s7.js → libExecutor-mqxnn0h6.js} +2 -2
- package/{library.command-8abb26pg.js → library.command-4kefxh8z.js} +7 -7
- package/{localRegistry.command-sa211m1z.js → localRegistry.command-phgrhkks.js} +18 -17
- package/{module.command-z3cwjf0p.js → module.command-8476gwze.js} +9 -9
- package/{package.command-akynhtee.js → package.command-ygxm5pp9.js} +8 -8
- package/package.json +2 -2
- package/{page.command-3fpdavk9.js → page.command-f7fwkj8y.js} +7 -7
- package/{pipeline.command-ca95n8rd.js → pipeline.command-9htjbrdm.js} +6 -6
- package/{pkgExecutor-a73q41vx.js → pkgExecutor-6a91xng5.js} +2 -2
- package/{primitive.command-xwe9ggnf.js → primitive.command-0k0h0cm0.js} +10 -10
- package/{projectTypecheck-7g542ymk.js → projectTypecheck-7kakbacs.js} +1 -1
- package/{quality.command-7wz7y8z1.js → quality.command-frsfdfc5.js} +9 -8
- package/{repair.command-dej1qtfq.js → repair.command-yag3bpq2.js} +9 -9
- package/{scalar.command-z9qfxnvm.js → scalar.command-qtyrywvt.js} +8 -8
- package/skills/akan-runtime/SKILL.md +20 -0
- package/{subspace.command-9wekm4gn.js → subspace.command-kr53abzt.js} +10 -10
- package/{tunnel.command-cxc4h3j8.js → tunnel.command-pswe6nye.js} +9 -9
- package/{typeChecker-7jt6abrs.js → typeChecker-epg7ebfy.js} +2 -1
- package/typecheck.proc.js +2 -1
- package/{verify.command-j0w9dr5c.js → verify.command-ghhhzgrw.js} +15 -14
- package/{workflow.command-yt4sz04b.js → workflow.command-fpwqth4w.js} +14 -14
- package/{workspace.command-8mp4mcp2.js → workspace.command-6bbmtn3w.js} +33 -31
- package/TunnelShare-0p4dy89e.js +0 -16
- package/cloud.script-0dsyd10v.js +0 -30
- package/context.runner-yyp7a112.js +0 -32
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mv3ke0fc.js";
|
|
6
6
|
import {
|
|
7
7
|
CommandExecutionError,
|
|
8
8
|
LibSource,
|
|
9
9
|
formatLibStatuses
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-ys1sjp6m.js";
|
|
11
11
|
import {
|
|
12
12
|
LibExecutor2
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-741xbhes.js";
|
|
14
14
|
import {
|
|
15
15
|
assertPlainName
|
|
16
16
|
} from "./index-va90m8nd.js";
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mv3ke0fc.js";
|
|
6
6
|
import {
|
|
7
7
|
FileSys2
|
|
8
8
|
} from "./index-zyjztrvc.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor2
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-wzvvqkcy.js";
|
|
12
12
|
import {
|
|
13
13
|
MaintainabilityBaseline
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-54g085ty.js";
|
|
15
15
|
import {
|
|
16
16
|
assertPackageName
|
|
17
17
|
} from "./index-va90m8nd.js";
|
|
@@ -2,7 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
camelToKebabCase,
|
|
4
4
|
runner
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mv3ke0fc.js";
|
|
6
|
+
import {
|
|
7
|
+
CliError
|
|
8
|
+
} from "./index-j4yvgfhr.js";
|
|
6
9
|
import {
|
|
7
10
|
rootAllowedFiles,
|
|
8
11
|
rootAllowedDirs,
|
|
@@ -10,22 +13,23 @@ import {
|
|
|
10
13
|
libFacetRootHintOf,
|
|
11
14
|
facetIndexShadowOf,
|
|
12
15
|
rootEntryHintOf,
|
|
16
|
+
parseBiomeReport,
|
|
13
17
|
Linter,
|
|
14
18
|
extractAgentBlock,
|
|
15
19
|
collectScopeRecipeSources,
|
|
16
20
|
renderScopeAgentBlock,
|
|
17
21
|
SysExecutor,
|
|
18
22
|
WorkspaceExecutor
|
|
19
|
-
} from "./index-
|
|
23
|
+
} from "./index-ys1sjp6m.js";
|
|
20
24
|
import {
|
|
21
25
|
FileSys2
|
|
22
26
|
} from "./index-zyjztrvc.js";
|
|
23
27
|
import {
|
|
24
28
|
LibExecutor2
|
|
25
|
-
} from "./index-
|
|
29
|
+
} from "./index-741xbhes.js";
|
|
26
30
|
import {
|
|
27
31
|
PkgExecutor2
|
|
28
|
-
} from "./index-
|
|
32
|
+
} from "./index-wzvvqkcy.js";
|
|
29
33
|
import {
|
|
30
34
|
collectRecipeSources2,
|
|
31
35
|
scanRecipes2
|
|
@@ -35,12 +39,15 @@ import {
|
|
|
35
39
|
formatStyleContract,
|
|
36
40
|
ThemeValidator
|
|
37
41
|
} from "./index-62md4dwy.js";
|
|
42
|
+
import {
|
|
43
|
+
WithheldEnvFile
|
|
44
|
+
} from "./index-35p43f33.js";
|
|
38
45
|
import {
|
|
39
46
|
GitRevision
|
|
40
47
|
} from "./index-zyb0ebm4.js";
|
|
41
48
|
import {
|
|
42
49
|
MaintainabilityBaseline
|
|
43
|
-
} from "./index-
|
|
50
|
+
} from "./index-54g085ty.js";
|
|
44
51
|
import {
|
|
45
52
|
createFactReader,
|
|
46
53
|
createAst
|
|
@@ -62,6 +69,106 @@ import path5 from "path";
|
|
|
62
69
|
// pkgs/@akanjs/devkit/lint/biomeBase.ts
|
|
63
70
|
var biomeVersion = "2.5.14";
|
|
64
71
|
|
|
72
|
+
// pkgs/@akanjs/devkit/lint/biomeCheck.ts
|
|
73
|
+
class BiomeCheck {
|
|
74
|
+
static #groupSize = 100;
|
|
75
|
+
static #summary = /^(?:Checked \d+ files? in |Found \d+ (?:errors?|warnings?|info))/;
|
|
76
|
+
static #colour = /\u001b\[[0-9;]*m/g;
|
|
77
|
+
static async run({ root, target, configPath, write, maxDiagnostics, print }) {
|
|
78
|
+
const [biome, ...biomeArgs] = Linter.biomeCommand(root);
|
|
79
|
+
const config = configPath ? ["--config-path", configPath] : [];
|
|
80
|
+
const first = Bun.spawn([
|
|
81
|
+
biome,
|
|
82
|
+
...biomeArgs,
|
|
83
|
+
"check",
|
|
84
|
+
...write ? ["--write"] : [],
|
|
85
|
+
"--reporter=json",
|
|
86
|
+
"--max-diagnostics=none",
|
|
87
|
+
"--no-errors-on-unmatched",
|
|
88
|
+
...config,
|
|
89
|
+
target
|
|
90
|
+
], { cwd: root, stdout: "pipe", stderr: "pipe" });
|
|
91
|
+
const [stdout, stderr, exitCode] = await Promise.all([
|
|
92
|
+
new Response(first.stdout).text(),
|
|
93
|
+
new Response(first.stderr).text(),
|
|
94
|
+
first.exited
|
|
95
|
+
]);
|
|
96
|
+
let diagnostics;
|
|
97
|
+
try {
|
|
98
|
+
diagnostics = parseBiomeReport(stdout).diagnostics ?? [];
|
|
99
|
+
} catch {
|
|
100
|
+
const cause = (stderr || stdout).trim();
|
|
101
|
+
throw new CliError("failed", cause && !WithheldEnvFile.namesEnvFile(cause) ? cause : `Biome exited with ${exitCode} and gave no report that could be read.`);
|
|
102
|
+
}
|
|
103
|
+
const shown = diagnostics.filter(({ severity }) => severity !== "hint");
|
|
104
|
+
const inEnv = (diagnostic) => WithheldEnvFile.isEnvFile(diagnostic.location?.path?.replaceAll("\\", "/"));
|
|
105
|
+
const fromEnv = shown.filter(inEnv);
|
|
106
|
+
const rest = shown.filter((diagnostic) => !inEnv(diagnostic));
|
|
107
|
+
let remaining = maxDiagnostics > 0 ? maxDiagnostics : Number.POSITIVE_INFINITY;
|
|
108
|
+
for (const diagnostic of fromEnv.slice(0, remaining))
|
|
109
|
+
print(BiomeCheck.#line(diagnostic));
|
|
110
|
+
let hidden = Math.max(0, fromEnv.length - remaining);
|
|
111
|
+
remaining -= Math.min(fromEnv.length, remaining);
|
|
112
|
+
for (const group of BiomeCheck.#groups(rest)) {
|
|
113
|
+
if (remaining <= 0) {
|
|
114
|
+
hidden += group.count;
|
|
115
|
+
continue;
|
|
116
|
+
}
|
|
117
|
+
const second = Bun.spawn([
|
|
118
|
+
biome,
|
|
119
|
+
...biomeArgs,
|
|
120
|
+
"check",
|
|
121
|
+
`--max-diagnostics=${Number.isFinite(remaining) ? remaining : "none"}`,
|
|
122
|
+
...process.stdout.isTTY && !process.env.NO_COLOR ? ["--colors=force"] : [],
|
|
123
|
+
...config,
|
|
124
|
+
...group.files
|
|
125
|
+
], { cwd: root, stdout: "pipe", stderr: "pipe" });
|
|
126
|
+
const [out, err] = await Promise.all([
|
|
127
|
+
new Response(second.stdout).text(),
|
|
128
|
+
new Response(second.stderr).text(),
|
|
129
|
+
second.exited
|
|
130
|
+
]);
|
|
131
|
+
print(BiomeCheck.withoutSummary(`${out}${err}`));
|
|
132
|
+
remaining -= Math.min(group.count, remaining);
|
|
133
|
+
}
|
|
134
|
+
for (const diagnostic of rest.filter(({ location }) => !location?.path))
|
|
135
|
+
print(diagnostic.message);
|
|
136
|
+
if (hidden)
|
|
137
|
+
print(`${hidden} more diagnostics are not shown; --max-diagnostics 0 shows them all.`);
|
|
138
|
+
const count = (severity) => shown.filter((diagnostic) => diagnostic.severity === severity).length;
|
|
139
|
+
for (const [severity, noun] of [
|
|
140
|
+
["error", "error"],
|
|
141
|
+
["warning", "warning"],
|
|
142
|
+
["information", "info"]
|
|
143
|
+
])
|
|
144
|
+
if (count(severity))
|
|
145
|
+
print(`Found ${count(severity)} ${noun}${count(severity) === 1 || noun === "info" ? "" : "s"}.`);
|
|
146
|
+
const errors = count("error");
|
|
147
|
+
if (errors)
|
|
148
|
+
throw new CliError("checkFailed", `Lint found ${errors} error${errors === 1 ? "" : "s"}.`);
|
|
149
|
+
}
|
|
150
|
+
static withoutSummary(text) {
|
|
151
|
+
return text.split(`
|
|
152
|
+
`).filter((line) => !BiomeCheck.#summary.test(line.replace(BiomeCheck.#colour, ""))).join(`
|
|
153
|
+
`).trim();
|
|
154
|
+
}
|
|
155
|
+
static #groups(diagnostics) {
|
|
156
|
+
const counts = new Map;
|
|
157
|
+
for (const { location } of diagnostics)
|
|
158
|
+
if (location?.path)
|
|
159
|
+
counts.set(location.path, (counts.get(location.path) ?? 0) + 1);
|
|
160
|
+
const entries = [...counts];
|
|
161
|
+
return Array.from({ length: Math.ceil(entries.length / BiomeCheck.#groupSize) }, (_, index) => {
|
|
162
|
+
const slice = entries.slice(index * BiomeCheck.#groupSize, (index + 1) * BiomeCheck.#groupSize);
|
|
163
|
+
return { files: slice.map(([file]) => file), count: slice.reduce((sum, [, count]) => sum + count, 0) };
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
static #line({ severity, category, location }) {
|
|
167
|
+
const at = `${location?.path}:${location?.start?.line ?? 0}:${location?.start?.column ?? 0}`;
|
|
168
|
+
return `${at} ${severity} ${category ?? "biome"} - ${WithheldEnvFile.note}`;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
|
|
65
172
|
// pkgs/@akanjs/devkit/quality/maintainabilityContract.ts
|
|
66
173
|
import { existsSync } from "fs";
|
|
67
174
|
import { copyFile, mkdtemp, readFile, rm, writeFile } from "fs/promises";
|
|
@@ -1778,6 +1885,7 @@ class MaintainabilityContract {
|
|
|
1778
1885
|
}
|
|
1779
1886
|
|
|
1780
1887
|
// pkgs/@akanjs/cli/workspace/workspace.runner.ts
|
|
1888
|
+
import { Logger } from "akanjs/common";
|
|
1781
1889
|
import { Ed25519Key } from "akanjs/server/ed25519Key";
|
|
1782
1890
|
|
|
1783
1891
|
// pkgs/@akanjs/cli/workflows/maintainabilityPaths.ts
|
|
@@ -2024,16 +2132,14 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
2024
2132
|
}
|
|
2025
2133
|
async lint(exec, workspace, { fix = true, maxDiagnostics = defaultMaxDiagnostics } = {}) {
|
|
2026
2134
|
const configPath = await WorkspaceRunner.resolveBiomeConfigPath(workspace);
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
exec.cwdPath
|
|
2036
|
-
]);
|
|
2135
|
+
await BiomeCheck.run({
|
|
2136
|
+
root: workspace.workspaceRoot,
|
|
2137
|
+
target: exec.cwdPath,
|
|
2138
|
+
configPath,
|
|
2139
|
+
write: fix,
|
|
2140
|
+
maxDiagnostics,
|
|
2141
|
+
print: (text) => Logger.rawLog(text)
|
|
2142
|
+
});
|
|
2037
2143
|
await this.#enforceStyleContract(exec);
|
|
2038
2144
|
await this.#enforceRecipeGate(exec);
|
|
2039
2145
|
await this.#enforceAgentsIndex(exec);
|
|
@@ -4,27 +4,27 @@ import {
|
|
|
4
4
|
CloudApi,
|
|
5
5
|
CloudUpdates,
|
|
6
6
|
PipelineSecrets
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-extg77rx.js";
|
|
8
8
|
import {
|
|
9
9
|
PkgExecutor2
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-wzvvqkcy.js";
|
|
11
11
|
import {
|
|
12
12
|
UpdatePackFolder,
|
|
13
13
|
NativePublicEnv,
|
|
14
14
|
NativeApp
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-es2wkn41.js";
|
|
16
16
|
import {
|
|
17
17
|
script
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-mv3ke0fc.js";
|
|
19
19
|
import {
|
|
20
20
|
ApplicationScript
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-c4g8egm2.js";
|
|
22
22
|
import {
|
|
23
23
|
PackageScript
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-a2a3nh57.js";
|
|
25
25
|
import {
|
|
26
26
|
CloudRunner
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-pa53zktp.js";
|
|
28
28
|
|
|
29
29
|
// pkgs/@akanjs/cli/cloud/cloud.script.ts
|
|
30
30
|
import { Logger } from "akanjs/common";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-mv3ke0fc.js";
|
|
6
6
|
import {
|
|
7
7
|
bilingualLabelForField,
|
|
8
8
|
bilingualDescriptionForField,
|
|
@@ -10,10 +10,10 @@ import {
|
|
|
10
10
|
sourceFile,
|
|
11
11
|
generatedFilesForSync,
|
|
12
12
|
createPassedPrimitiveReport
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-0zkxsdsg.js";
|
|
14
14
|
import {
|
|
15
15
|
PageScript
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-c8kj74zz.js";
|
|
17
17
|
import {
|
|
18
18
|
pluralizeName
|
|
19
19
|
} from "./index-nz8prx9g.js";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./index-va90m8nd.js";
|
|
23
23
|
import {
|
|
24
24
|
ModuleExecutor
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-ay4vkwr8.js";
|
|
26
26
|
|
|
27
27
|
// pkgs/@akanjs/cli/module/module.script.ts
|
|
28
28
|
import { capitalize as capitalize2 } from "akanjs/common";
|
|
@@ -1,37 +1,41 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
SysExecutor
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-ys1sjp6m.js";
|
|
5
5
|
import {
|
|
6
6
|
CliError
|
|
7
7
|
} from "./index-j4yvgfhr.js";
|
|
8
8
|
import {
|
|
9
9
|
ApplicationBuildReporter
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-serpfvat.js";
|
|
11
11
|
import {
|
|
12
12
|
script,
|
|
13
13
|
markCliErrorPrinted,
|
|
14
14
|
assertPromptable
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-mv3ke0fc.js";
|
|
16
16
|
import {
|
|
17
17
|
AppExecutor2
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-77627y32.js";
|
|
19
19
|
import {
|
|
20
20
|
LibExecutor2
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-741xbhes.js";
|
|
22
22
|
import {
|
|
23
23
|
PkgExecutor2
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-wzvvqkcy.js";
|
|
25
25
|
import {
|
|
26
26
|
DesktopServerStage
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-gdgbgn82.js";
|
|
28
|
+
import {
|
|
29
|
+
SecretEnvDeclaration,
|
|
30
|
+
SecretEnvFile
|
|
31
|
+
} from "./index-kqxs1d7z.js";
|
|
28
32
|
import {
|
|
29
33
|
LibraryScript
|
|
30
|
-
} from "./index-
|
|
34
|
+
} from "./index-8javbznc.js";
|
|
31
35
|
import {
|
|
32
36
|
ApplicationRunner,
|
|
33
37
|
VerifyScope
|
|
34
|
-
} from "./index-
|
|
38
|
+
} from "./index-th7qbjfz.js";
|
|
35
39
|
import {
|
|
36
40
|
PreviewChrome2,
|
|
37
41
|
PreviewView2,
|
|
@@ -39,7 +43,7 @@ import {
|
|
|
39
43
|
} from "./index-rwgqba9p.js";
|
|
40
44
|
import {
|
|
41
45
|
formatSlicePlan
|
|
42
|
-
} from "./index-
|
|
46
|
+
} from "./index-5sa1tr7w.js";
|
|
43
47
|
import {
|
|
44
48
|
openBrowser
|
|
45
49
|
} from "./index-9dp031by.js";
|
|
@@ -1427,7 +1431,8 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1427
1431
|
quiet = false,
|
|
1428
1432
|
profile,
|
|
1429
1433
|
env,
|
|
1430
|
-
budget = "report"
|
|
1434
|
+
budget = "report",
|
|
1435
|
+
inlineSecrets = false
|
|
1431
1436
|
} = {}) {
|
|
1432
1437
|
await app.scanSync({ write });
|
|
1433
1438
|
if (!quiet)
|
|
@@ -1438,7 +1443,8 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1438
1443
|
spinner: !quiet,
|
|
1439
1444
|
envProfile: profile,
|
|
1440
1445
|
environment: env,
|
|
1441
|
-
budget
|
|
1446
|
+
budget,
|
|
1447
|
+
secretEnv: inlineSecrets ? "inline" : "read"
|
|
1442
1448
|
});
|
|
1443
1449
|
Logger3.rawLog(`${app.name} built in dist/apps/${app.name}`);
|
|
1444
1450
|
if (quiet)
|
|
@@ -1452,6 +1458,27 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1452
1458
|
throw error;
|
|
1453
1459
|
}
|
|
1454
1460
|
}
|
|
1461
|
+
async secretEnv(app, {
|
|
1462
|
+
env,
|
|
1463
|
+
out,
|
|
1464
|
+
format = "k8s",
|
|
1465
|
+
name = `${app.name}-env`,
|
|
1466
|
+
force = false
|
|
1467
|
+
} = {}) {
|
|
1468
|
+
const environment = env ?? (await app.getConfig()).baseDevEnv.env;
|
|
1469
|
+
const declared = await SecretEnvDeclaration.of(path3.join(app.cwdPath, "env"), environment);
|
|
1470
|
+
if (!out)
|
|
1471
|
+
return Logger3.rawLog(SecretEnvFile.listing(declared));
|
|
1472
|
+
const { variables } = declared;
|
|
1473
|
+
await SecretEnvFile.write(out, SecretEnvFile.render(format, variables, name), {
|
|
1474
|
+
workspaceRoot: app.workspace.workspaceRoot,
|
|
1475
|
+
force
|
|
1476
|
+
});
|
|
1477
|
+
Logger3.rawLog(`Wrote ${variables.length} secret env value${variables.length === 1 ? "" : "s"} of ${app.name} (${environment}) to ${out}, which this user alone can read. It holds the values themselves: hand it to the deployment, then delete it.`);
|
|
1478
|
+
const unmoved = SecretEnvFile.unmovedNote(declared.unmoved);
|
|
1479
|
+
if (unmoved)
|
|
1480
|
+
Logger3.rawLog(unmoved);
|
|
1481
|
+
}
|
|
1455
1482
|
async typecheck(exec, { write = true, clean = false, incremental = true, tests = false } = {}) {
|
|
1456
1483
|
if (!(exec instanceof AppExecutor2) && !(exec instanceof LibExecutor2))
|
|
1457
1484
|
throw new Error(`akan typecheck takes an app or a library; ${exec.name} is a package, checked by its own tsconfig.`);
|
|
@@ -1779,7 +1806,7 @@ class ApplicationScript extends script("application", [ApplicationRunner, Librar
|
|
|
1779
1806
|
await Promise.all(shares.map(async (share) => await share.close()));
|
|
1780
1807
|
}, "Abandoning the tunnel release; the shares expire on their own.");
|
|
1781
1808
|
await Promise.all(apps.map(async (app) => {
|
|
1782
|
-
const { TunnelShare } = await import("./TunnelShare-
|
|
1809
|
+
const { TunnelShare } = await import("./TunnelShare-8j95ta3w.js");
|
|
1783
1810
|
const share = await TunnelShare.open(app, { workspace: app.workspace });
|
|
1784
1811
|
shares.push(share);
|
|
1785
1812
|
urls.set(app.name, share.url);
|
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
WorkspaceExecutor,
|
|
6
6
|
ServerEnvProfile,
|
|
7
7
|
AkanAppConfig
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-ys1sjp6m.js";
|
|
9
9
|
import {
|
|
10
10
|
resolveAppId,
|
|
11
11
|
targetHtmlFilename
|
|
12
12
|
} from "./index-m9jj544v.js";
|
|
13
13
|
import {
|
|
14
14
|
ExitCodeError
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-mv3ke0fc.js";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/devkit/mobile/desktopBin.ts
|
|
18
18
|
import { chmod, mkdir, rename, rm, writeFile } from "fs/promises";
|
|
@@ -1153,14 +1153,14 @@ class NativePublicEnv {
|
|
|
1153
1153
|
return [...new Set([...Object.keys(a), ...Object.keys(b)])].filter((key) => a[key] !== b[key]).sort((x, y) => x < y ? -1 : x > y ? 1 : 0);
|
|
1154
1154
|
}
|
|
1155
1155
|
static async built(app) {
|
|
1156
|
-
const { CsrArtifactBuilder } = await import("./csrArtifactBuilder-
|
|
1156
|
+
const { CsrArtifactBuilder } = await import("./csrArtifactBuilder-rqg85wbg.js");
|
|
1157
1157
|
const file = Bun.file(CsrArtifactBuilder.publicEnvPath(app));
|
|
1158
1158
|
if (!await file.exists())
|
|
1159
1159
|
return null;
|
|
1160
1160
|
return NativePublicEnv.of(await file.json());
|
|
1161
1161
|
}
|
|
1162
1162
|
static async inlined(app) {
|
|
1163
|
-
const { CsrArtifactBuilder } = await import("./csrArtifactBuilder-
|
|
1163
|
+
const { CsrArtifactBuilder } = await import("./csrArtifactBuilder-rqg85wbg.js");
|
|
1164
1164
|
const file = Bun.file(CsrArtifactBuilder.publicEnvPath(app));
|
|
1165
1165
|
const env = await file.exists() ? await file.json() : process.env;
|
|
1166
1166
|
return Object.fromEntries(Object.entries(env).flatMap(([key, value]) => key.startsWith("AKAN_PUBLIC_") && typeof value === "string" ? [[key, value]] : []));
|
|
@@ -1315,6 +1315,41 @@ class ServerBundleSecrets {
|
|
|
1315
1315
|
Build its server with a profile (native.desktop.server.profile), whose bundle leaves the env files' secrets out. A value a profile build still holds sits in code or a file the server carries: take it out there.`);
|
|
1316
1316
|
return unread;
|
|
1317
1317
|
}
|
|
1318
|
+
async assertImageClean(bundleDir, moved) {
|
|
1319
|
+
const searched = (value) => value.length >= 8;
|
|
1320
|
+
const sought = moved.filter(({ value }) => searched(value)).map((secret) => ({ secret, needles: ServerBundleSecrets.#needles(secret.value) }));
|
|
1321
|
+
const holders = new Map;
|
|
1322
|
+
if (sought.length)
|
|
1323
|
+
for (const bundled of await ServerBundleSecrets.#files(bundleDir)) {
|
|
1324
|
+
const text = await readFile2(bundled, "latin1");
|
|
1325
|
+
for (const { secret, needles } of sought)
|
|
1326
|
+
if (needles.some((needle) => text.includes(needle)))
|
|
1327
|
+
holders.set(secret, [...holders.get(secret) ?? [], ServerBundleSecrets.#relative(bundleDir, bundled)]);
|
|
1328
|
+
}
|
|
1329
|
+
const stops = [];
|
|
1330
|
+
const notes = [];
|
|
1331
|
+
for (const secret of moved) {
|
|
1332
|
+
const files = holders.get(secret) ?? [];
|
|
1333
|
+
const key = `${secret.path} (${secret.name})`;
|
|
1334
|
+
const twins = secret.twins.length ? `the env's ${secret.twins.join(", ")}` : "";
|
|
1335
|
+
if (files.length && ServerEnvProfile.distinctive(secret.value))
|
|
1336
|
+
stops.push(...files.map((file) => `${file} holds the value of ${key}${twins ? `, which ${twins} holds as well` : ""}`));
|
|
1337
|
+
else if (files.length || twins && !searched(secret.value))
|
|
1338
|
+
notes.push(`${key}: ${[files.join(", "), twins ? `${twins} holds the same string` : ""].filter(Boolean).join("; ")}`);
|
|
1339
|
+
}
|
|
1340
|
+
if (stops.length)
|
|
1341
|
+
throw new Error(`The build holds secret values the server reads from its process env, so it stops here:
|
|
1342
|
+
${[...new Set(stops)].join(`
|
|
1343
|
+
`)}
|
|
1344
|
+
The build left each out at its secret-named key of the env file, and the same string is in what it wrote for another reason: another key of the env holds it too, or the app's code, or a file the build copies. Take it out there, or read it there from the same variable. \`akan build --inline-secrets\` builds with the env files as written until akanjs 3.5.0 removes it.`);
|
|
1345
|
+
if (!notes.length)
|
|
1346
|
+
return null;
|
|
1347
|
+
const lines = [...new Set(notes)];
|
|
1348
|
+
return `${lines.length} secret value${lines.length === 1 ? "" : "s"} the server reads from its process env ${lines.length === 1 ? "is" : "are"} also in what this build wrote, short or plain enough to be there for another reason, so the build goes on:
|
|
1349
|
+
${lines.join(`
|
|
1350
|
+
`)}
|
|
1351
|
+
Where another key of the env or the app's code holds a secret's own string, the image holds it too: change one of the two.`;
|
|
1352
|
+
}
|
|
1318
1353
|
async#coded(values) {
|
|
1319
1354
|
const plain = [...new Set(values)].filter((value) => !ServerEnvProfile.distinctive(value));
|
|
1320
1355
|
const coded = new Set;
|
|
@@ -1802,4 +1837,4 @@ bundle.json records none, so no update can be checked against this build.`);
|
|
|
1802
1837
|
}
|
|
1803
1838
|
}
|
|
1804
1839
|
|
|
1805
|
-
export { DesktopBin, UpdatePackFolder, UpdateUploader, NativePublicEnv, NativeApp };
|
|
1840
|
+
export { DesktopBin, UpdatePackFolder, UpdateUploader, NativePublicEnv, ServerBundleSecrets, NativeApp };
|
|
@@ -9,10 +9,10 @@ import {
|
|
|
9
9
|
UpdatePackFolder,
|
|
10
10
|
NativePublicEnv,
|
|
11
11
|
NativeApp
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-es2wkn41.js";
|
|
13
13
|
import {
|
|
14
14
|
ExitCodeError
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-mv3ke0fc.js";
|
|
16
16
|
import {
|
|
17
17
|
ConfigLock
|
|
18
18
|
} from "./index-bqbf654f.js";
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
ROOT_LAYOUT_SYSTEM,
|
|
4
4
|
isImplicitRootLayoutKey,
|
|
5
5
|
resolveSsrPageEntriesForApp
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-77627y32.js";
|
|
7
7
|
import {
|
|
8
8
|
computeRouteSeedIndex,
|
|
9
9
|
saveRouteSeedIndex,
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
ClientEntriesBundler,
|
|
12
12
|
VENDOR_SPECIFIERS,
|
|
13
13
|
RouteClientBuilder
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-gyyscjzx.js";
|
|
15
15
|
import {
|
|
16
16
|
SOURCE_EXTS,
|
|
17
17
|
buildCacheStamp,
|
|
18
18
|
isBuildCacheStamp,
|
|
19
19
|
FontOptimizer
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-serpfvat.js";
|
|
21
21
|
import {
|
|
22
22
|
BarrelAnalyzer,
|
|
23
23
|
createTsconfigPackageResolver,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
CsrEntryFiles,
|
|
26
26
|
toClientReferencePath,
|
|
27
27
|
PagesBundleBuilder
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-0bzrcv91.js";
|
|
29
29
|
import {
|
|
30
30
|
FileSys2
|
|
31
31
|
} from "./index-zyjztrvc.js";
|