@akanjs/cli 3.0.0-alpha.3 → 3.0.0-alpha.5
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 +1 -1
- package/{agent.command-yv00p0s0.js → agent.command-b0fcx3r2.js} +6 -6
- package/{application.command-0qsczf4k.js → application.command-cgmy00gd.js} +4 -4
- package/{applicationBuildRunner-ct2pxyvw.js → applicationBuildRunner-n1svrwgt.js} +3 -3
- package/buildBatch.proc.js +3 -3
- package/{capacitorApp-4r9sm3qg.js → capacitorApp-yyw35vg4.js} +2 -2
- package/{cloud.command-dxfv18sa.js → cloud.command-1m7hfdpk.js} +7 -7
- package/{context.command-8d9e3k6b.js → context.command-b5heat2a.js} +13 -13
- package/{guideline.command-3jbkxzh6.js → guideline.command-9ew6aqhm.js} +3 -3
- package/incrementalBuilder.proc.js +2 -2
- package/{index-pyt2b4nw.js → index-0fj4yg7k.js} +50 -15
- package/{index-hgna5rjy.js → index-47qxw1tz.js} +27 -21
- package/{index-yzmhasdb.js → index-60a3jfcz.js} +5 -5
- package/{index-mr5s7mqd.js → index-6npsfpxr.js} +3 -3
- package/{index-2q1f5j9k.js → index-c94nq3c1.js} +3 -3
- package/{index-7c6k4yvg.js → index-exhpp31y.js} +2 -2
- package/{index-bbkek1bp.js → index-hrwzz2wf.js} +1 -1
- package/{index-rh16j3c7.js → index-j9cxndc0.js} +3 -2
- package/{index-8hsbnyes.js → index-jkynkyfk.js} +1 -1
- package/{index-a00jg8x8.js → index-jn9vfpwz.js} +9 -31
- package/{index-rzwcpcc3.js → index-m4kpmmtj.js} +1 -1
- package/{index-k95xkh4p.js → index-meh7mmz9.js} +2 -2
- package/{index-nm6wghb6.js → index-mn96y1nk.js} +5 -5
- package/{index-t3723f99.js → index-mterpj70.js} +1 -1
- package/{index-ej426mcr.js → index-nfxq39kj.js} +4 -4
- package/{index-e16gnn26.js → index-nx1vbtsc.js} +5 -5
- package/{index-1pvex4az.js → index-p69fcwe1.js} +11 -11
- package/{index-zasydjxd.js → index-p6txr1ss.js} +3 -3
- package/{index-bekddz9q.js → index-pfrt7qwh.js} +4 -4
- package/{index-tdbas9r0.js → index-qp089jp0.js} +1 -1
- package/{index-ec09pws3.js → index-wrrb8rxk.js} +3 -3
- package/index.js +18 -18
- package/{library.command-ebdj1vnm.js → library.command-aa1g8nsa.js} +3 -3
- package/{localRegistry.command-gb178ne8.js → localRegistry.command-kshva1ck.js} +6 -6
- package/{module.command-9c1bnsx4.js → module.command-b1zzgqde.js} +6 -6
- package/{package.command-t93p4jkj.js → package.command-9qv6vr9s.js} +3 -3
- package/package.json +2 -2
- package/{page.command-k3k0meh2.js → page.command-k16pw244.js} +3 -3
- package/{primitive.command-de6nktdt.js → primitive.command-s60dn1ae.js} +7 -7
- package/{quality.command-z5kth2wa.js → quality.command-p3vaze52.js} +7 -25
- package/{repair.command-ehf2g112.js → repair.command-mfv749ha.js} +5 -5
- package/{scalar.command-7a2jtv33.js → scalar.command-hs3nwzv1.js} +5 -5
- package/templates/lib/useClient.ts +9 -3
- package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +3 -2
- package/templates/workspaceRoot/AGENTS.md.template +4 -0
- package/templates/workspaceRoot/biome.json.template +22 -0
- package/{workflow.command-e0tt0vk2.js → workflow.command-z0e0fk0z.js} +10 -10
- package/{workspace.command-fpda0evj.js → workspace.command-3q1d6kk4.js} +19 -19
package/.build-stamp
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
a0eaadfb9b58c3aa21817d33fb8bc0ad7889c719fb293715682a39a426dc01b9
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AgentScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
4
|
+
} from "./index-nfxq39kj.js";
|
|
5
|
+
import"./index-jn9vfpwz.js";
|
|
6
|
+
import"./index-m4kpmmtj.js";
|
|
7
|
+
import"./index-qp089jp0.js";
|
|
8
8
|
import {
|
|
9
9
|
Workspace,
|
|
10
10
|
command
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-jkynkyfk.js";
|
|
12
|
+
import"./index-47qxw1tz.js";
|
|
13
13
|
import"./index-mxvakhsm.js";
|
|
14
14
|
import"./index-xys926f2.js";
|
|
15
15
|
import"./index-67546d0j.js";
|
|
@@ -4,21 +4,21 @@ import {
|
|
|
4
4
|
} from "./index-0wae5ebk.js";
|
|
5
5
|
import {
|
|
6
6
|
ApplicationScript
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-nx1vbtsc.js";
|
|
8
8
|
import {
|
|
9
9
|
getMobileTargetChoices
|
|
10
10
|
} from "./index-76rn3g2c.js";
|
|
11
|
-
import"./index-
|
|
11
|
+
import"./index-exhpp31y.js";
|
|
12
12
|
import {
|
|
13
13
|
App,
|
|
14
14
|
Exec,
|
|
15
15
|
Sys,
|
|
16
16
|
Workspace,
|
|
17
17
|
command
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-jkynkyfk.js";
|
|
19
19
|
import"./index-fgc8r6dj.js";
|
|
20
20
|
import"./index-bjpxzr6s.js";
|
|
21
|
-
import"./index-
|
|
21
|
+
import"./index-47qxw1tz.js";
|
|
22
22
|
import"./index-mxvakhsm.js";
|
|
23
23
|
import"./index-67546d0j.js";
|
|
24
24
|
import"./index-r24hmh0q.js";
|
|
@@ -4,9 +4,9 @@ import {
|
|
|
4
4
|
CsrArtifactBuilder,
|
|
5
5
|
SsrBaseArtifactBuilder,
|
|
6
6
|
precompressArtifacts
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-0fj4yg7k.js";
|
|
8
8
|
import"./index-xjd3rqzj.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-j9cxndc0.js";
|
|
10
10
|
import"./index-bjpxzr6s.js";
|
|
11
11
|
import {
|
|
12
12
|
Spinner
|
|
@@ -66,7 +66,7 @@ class ApplicationBuildRunner {
|
|
|
66
66
|
await this.#runPhase("backend", "Compiling backend", () => this.#buildBackend(), (result) => `${result.entrypoints} entrypoints, ${result.outputs} outputs`, phaseOptions);
|
|
67
67
|
await this.#runPhase("ssr", "Building SSR route artifacts", () => this.#buildSsr(), (result) => result ? `${result.allRoutes.manifest.routeIds.length} routes, ${result.allRoutes.manifest.knownEntries.length} entries` : "skipped", phaseOptions);
|
|
68
68
|
await this.#runPhase("csr", "Building CSR assets", () => this.#buildCsr(), (result) => result?.outputDir ?? "skipped", phaseOptions);
|
|
69
|
-
await this.#runPhase("compress", "Compressing static assets", () => precompressArtifacts(this.#app), (result) => result.files > 0 ? `${result.files} files, ${ApplicationBuildRunner.formatBytes(result.inputBytes)} -> ${ApplicationBuildRunner.formatBytes(result.outputBytes)}` : "no files", phaseOptions);
|
|
69
|
+
await this.#runPhase("compress", "Compressing static assets", () => precompressArtifacts(this.#app), (result) => result.files > 0 ? `${result.files} files, ${ApplicationBuildRunner.formatBytes(result.inputBytes)} -> gzip ${ApplicationBuildRunner.formatBytes(result.outputBytes)} / br ${ApplicationBuildRunner.formatBytes(result.brotliBytes)}` : "no files", phaseOptions);
|
|
70
70
|
await this.#runPhase("metadata", "Writing production metadata", () => this.#buildAppMeta(), undefined, {
|
|
71
71
|
spinner
|
|
72
72
|
});
|
package/buildBatch.proc.js
CHANGED
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
FontOptimizer,
|
|
6
6
|
PagesBundleBuilder,
|
|
7
7
|
SsrBaseArtifactBuilder
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-0fj4yg7k.js";
|
|
9
9
|
import"./index-xjd3rqzj.js";
|
|
10
|
-
import"./index-
|
|
10
|
+
import"./index-j9cxndc0.js";
|
|
11
11
|
import"./index-bjpxzr6s.js";
|
|
12
12
|
import {
|
|
13
13
|
AppExecutor,
|
|
14
14
|
WorkspaceExecutor
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-47qxw1tz.js";
|
|
16
16
|
import"./index-mxvakhsm.js";
|
|
17
17
|
import"./index-67546d0j.js";
|
|
18
18
|
import"./index-r24hmh0q.js";
|
|
@@ -24,9 +24,9 @@ import {
|
|
|
24
24
|
selectLocalDevHost,
|
|
25
25
|
sortIosRunTargets,
|
|
26
26
|
writeRootCapacitorConfig
|
|
27
|
-
} from "./index-
|
|
27
|
+
} from "./index-mterpj70.js";
|
|
28
28
|
import"./index-76rn3g2c.js";
|
|
29
|
-
import"./index-
|
|
29
|
+
import"./index-47qxw1tz.js";
|
|
30
30
|
import"./index-mxvakhsm.js";
|
|
31
31
|
import"./index-67546d0j.js";
|
|
32
32
|
import"./index-r24hmh0q.js";
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
CloudScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
4
|
+
} from "./index-mn96y1nk.js";
|
|
5
|
+
import"./index-p6txr1ss.js";
|
|
6
|
+
import"./index-meh7mmz9.js";
|
|
7
7
|
import {
|
|
8
8
|
GlobalConfig
|
|
9
9
|
} from "./index-0cj2zxbm.js";
|
|
10
|
-
import"./index-
|
|
10
|
+
import"./index-nx1vbtsc.js";
|
|
11
11
|
import"./index-76rn3g2c.js";
|
|
12
|
-
import"./index-
|
|
12
|
+
import"./index-exhpp31y.js";
|
|
13
13
|
import {
|
|
14
14
|
Workspace,
|
|
15
15
|
command
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-jkynkyfk.js";
|
|
17
17
|
import"./index-fgc8r6dj.js";
|
|
18
18
|
import"./index-bjpxzr6s.js";
|
|
19
|
-
import"./index-
|
|
19
|
+
import"./index-47qxw1tz.js";
|
|
20
20
|
import"./index-mxvakhsm.js";
|
|
21
21
|
import"./index-46tjzh6s.js";
|
|
22
22
|
import"./index-67546d0j.js";
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
ContextScript
|
|
4
|
-
} from "./index-
|
|
5
|
-
import"./index-
|
|
6
|
-
import"./index-
|
|
7
|
-
import"./index-
|
|
8
|
-
import"./index-
|
|
9
|
-
import"./index-
|
|
10
|
-
import"./index-
|
|
4
|
+
} from "./index-p69fcwe1.js";
|
|
5
|
+
import"./index-6npsfpxr.js";
|
|
6
|
+
import"./index-c94nq3c1.js";
|
|
7
|
+
import"./index-pfrt7qwh.js";
|
|
8
|
+
import"./index-60a3jfcz.js";
|
|
9
|
+
import"./index-hrwzz2wf.js";
|
|
10
|
+
import"./index-wrrb8rxk.js";
|
|
11
11
|
import"./index-ss469dec.js";
|
|
12
|
-
import"./index-
|
|
12
|
+
import"./index-mterpj70.js";
|
|
13
13
|
import"./index-0cj2zxbm.js";
|
|
14
|
-
import"./index-
|
|
15
|
-
import"./index-
|
|
16
|
-
import"./index-
|
|
14
|
+
import"./index-jn9vfpwz.js";
|
|
15
|
+
import"./index-m4kpmmtj.js";
|
|
16
|
+
import"./index-qp089jp0.js";
|
|
17
17
|
import"./index-76rn3g2c.js";
|
|
18
18
|
import {
|
|
19
19
|
Workspace,
|
|
20
20
|
command
|
|
21
|
-
} from "./index-
|
|
22
|
-
import"./index-
|
|
21
|
+
} from "./index-jkynkyfk.js";
|
|
22
|
+
import"./index-47qxw1tz.js";
|
|
23
23
|
import"./index-mxvakhsm.js";
|
|
24
24
|
import"./index-xys926f2.js";
|
|
25
25
|
import"./index-67546d0j.js";
|
|
@@ -4,16 +4,16 @@ import {
|
|
|
4
4
|
} from "./index-0cj2zxbm.js";
|
|
5
5
|
import {
|
|
6
6
|
Prompter
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-qp089jp0.js";
|
|
8
8
|
import {
|
|
9
9
|
Workspace,
|
|
10
10
|
command,
|
|
11
11
|
runner,
|
|
12
12
|
script
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-jkynkyfk.js";
|
|
14
14
|
import {
|
|
15
15
|
getDirname
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-47qxw1tz.js";
|
|
17
17
|
import"./index-mxvakhsm.js";
|
|
18
18
|
import {
|
|
19
19
|
FileSys
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
DevGeneratedIndexSync,
|
|
9
9
|
GraphClientEntryDiscovery,
|
|
10
10
|
RouteClientBuilder
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-j9cxndc0.js";
|
|
12
12
|
import {
|
|
13
13
|
HmrWatcher,
|
|
14
14
|
WatchRootResolver
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
import {
|
|
17
17
|
AppExecutor,
|
|
18
18
|
WorkspaceExecutor
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-47qxw1tz.js";
|
|
20
20
|
import"./index-mxvakhsm.js";
|
|
21
21
|
import"./index-67546d0j.js";
|
|
22
22
|
import"./index-r24hmh0q.js";
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
createTsconfigPackageResolver,
|
|
10
10
|
rewriteBarrelImports,
|
|
11
11
|
transformUseClient
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-j9cxndc0.js";
|
|
13
13
|
import {
|
|
14
14
|
__require
|
|
15
15
|
} from "./index-r24hmh0q.js";
|
|
@@ -415,11 +415,21 @@ class AllRoutesBuilder {
|
|
|
415
415
|
const seedIndex = computeRouteSeedIndex(pageEntries);
|
|
416
416
|
this.#app.verbose(`[build-all] discovered ${seedIndex.entries.length} routes`);
|
|
417
417
|
this.#discovery = await GraphClientEntryDiscovery.create(this.#app);
|
|
418
|
+
const allEntries = [];
|
|
419
|
+
const seen = new Set;
|
|
418
420
|
for (const entry of seedIndex.entries) {
|
|
419
421
|
const seeds = Array.from(new Set([...seedIndex.globalLayoutFiles, ...entry.seeds]));
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
+
for (const discovered of await this.#discovery.discover(seeds)) {
|
|
423
|
+
if (seen.has(discovered))
|
|
424
|
+
continue;
|
|
425
|
+
seen.add(discovered);
|
|
426
|
+
allEntries.push(discovered);
|
|
427
|
+
}
|
|
428
|
+
this.#routeIds.push(entry.routeId);
|
|
422
429
|
}
|
|
430
|
+
this.#app.verbose(`[build-all] ${allEntries.length} client entries across ${this.#routeIds.length} routes`);
|
|
431
|
+
const delta = await this.#buildEntries(allEntries);
|
|
432
|
+
this.#mergeDelta(delta);
|
|
423
433
|
this.#merged.knownEntries = Array.from(this.#knownSet);
|
|
424
434
|
const manifest = {
|
|
425
435
|
routeIds: this.#routeIds,
|
|
@@ -433,23 +443,30 @@ class AllRoutesBuilder {
|
|
|
433
443
|
this.#app.verbose(`[build-all] wrote ${manifestPath} routes=${this.#routeIds.length} entries=${this.#merged.knownEntries.length}`);
|
|
434
444
|
return { manifest, manifestPath, seedIndex };
|
|
435
445
|
}
|
|
436
|
-
async#
|
|
446
|
+
async#buildEntries(entries) {
|
|
437
447
|
if (!this.#discovery)
|
|
438
448
|
throw new Error("[build-all] client entry discovery is not initialized");
|
|
449
|
+
if (entries.length === 0)
|
|
450
|
+
return {
|
|
451
|
+
manifestDelta: {},
|
|
452
|
+
ssrManifestDelta: { moduleLoading: null, moduleMap: {} },
|
|
453
|
+
newEntries: [],
|
|
454
|
+
clientDeps: []
|
|
455
|
+
};
|
|
439
456
|
const started = Date.now();
|
|
440
457
|
const delta = await new RouteClientBuilder({
|
|
441
458
|
app: this.#app,
|
|
442
|
-
|
|
443
|
-
|
|
459
|
+
seeds: [],
|
|
460
|
+
entries,
|
|
444
461
|
artifact: this.#artifact,
|
|
445
462
|
knownEntries: this.#knownSet,
|
|
446
463
|
discovery: this.#discovery,
|
|
447
464
|
command: this.#command
|
|
448
465
|
}).build();
|
|
449
|
-
this.#app.verbose(`[build-all] ${
|
|
466
|
+
this.#app.verbose(`[build-all] bundled ${delta.newEntries.length} entries (${Date.now() - started}ms)`);
|
|
450
467
|
return delta;
|
|
451
468
|
}
|
|
452
|
-
#
|
|
469
|
+
#mergeDelta(delta) {
|
|
453
470
|
for (const [key, row] of Object.entries(delta.manifestDelta))
|
|
454
471
|
this.#merged.clientManifest[key] = row;
|
|
455
472
|
for (const [url, byName] of Object.entries(delta.ssrManifestDelta.moduleMap)) {
|
|
@@ -457,7 +474,6 @@ class AllRoutesBuilder {
|
|
|
457
474
|
}
|
|
458
475
|
for (const abs of delta.newEntries)
|
|
459
476
|
this.#knownSet.add(abs);
|
|
460
|
-
this.#routeIds.push(routeId);
|
|
461
477
|
}
|
|
462
478
|
}
|
|
463
479
|
|
|
@@ -2025,14 +2041,21 @@ function loaderFor2(absPath) {
|
|
|
2025
2041
|
// pkgs/@akanjs/devkit/frontendBuild/precompressArtifacts.ts
|
|
2026
2042
|
import fs2 from "fs";
|
|
2027
2043
|
import path12 from "path";
|
|
2044
|
+
import zlib from "zlib";
|
|
2028
2045
|
var COMPRESSIBLE_EXTS = new Set([".css", ".html", ".js", ".json", ".svg"]);
|
|
2029
2046
|
var MIN_COMPRESS_BYTES = 1024;
|
|
2047
|
+
var BROTLI_QUALITY_BY_EXT = { ".css": 11 };
|
|
2048
|
+
var DEFAULT_BROTLI_QUALITY = 9;
|
|
2049
|
+
var GZIP_LEVEL = 9;
|
|
2030
2050
|
async function precompressArtifacts(app) {
|
|
2031
|
-
const roots = [
|
|
2032
|
-
|
|
2051
|
+
const roots = [
|
|
2052
|
+
path12.join(app.dist.cwdPath, ".akan/artifact/client"),
|
|
2053
|
+
path12.join(app.dist.cwdPath, ".akan/artifact/styles")
|
|
2054
|
+
];
|
|
2055
|
+
const result = { files: 0, inputBytes: 0, outputBytes: 0, brotliBytes: 0 };
|
|
2033
2056
|
await Promise.all(roots.map((root) => precompressRoot(root, result)));
|
|
2034
2057
|
if (result.files > 0) {
|
|
2035
|
-
app.verbose(`[precompress] wrote ${result.files}
|
|
2058
|
+
app.verbose(`[precompress] wrote ${result.files} sidecars (${formatBytes(result.inputBytes)} -> gzip ${formatBytes(result.outputBytes)} / br ${formatBytes(result.brotliBytes)})`);
|
|
2036
2059
|
}
|
|
2037
2060
|
return result;
|
|
2038
2061
|
}
|
|
@@ -2044,15 +2067,27 @@ async function precompressRoot(root, result) {
|
|
|
2044
2067
|
if (!await shouldPrecompress(filePath))
|
|
2045
2068
|
continue;
|
|
2046
2069
|
const bytes = await Bun.file(filePath).bytes();
|
|
2047
|
-
const
|
|
2048
|
-
|
|
2070
|
+
const buffer = toArrayBuffer(bytes);
|
|
2071
|
+
const gz = Bun.gzipSync(buffer, { level: GZIP_LEVEL });
|
|
2072
|
+
const br = brotliCompress(buffer, path12.extname(filePath).toLowerCase());
|
|
2073
|
+
await Promise.all([Bun.write(`${filePath}.gz`, gz), Bun.write(`${filePath}.br`, br)]);
|
|
2049
2074
|
result.files += 1;
|
|
2050
2075
|
result.inputBytes += bytes.byteLength;
|
|
2051
2076
|
result.outputBytes += gz.byteLength;
|
|
2077
|
+
result.brotliBytes += br.byteLength;
|
|
2052
2078
|
}
|
|
2053
2079
|
}
|
|
2080
|
+
function brotliCompress(buffer, ext) {
|
|
2081
|
+
const quality = BROTLI_QUALITY_BY_EXT[ext] ?? DEFAULT_BROTLI_QUALITY;
|
|
2082
|
+
return zlib.brotliCompressSync(buffer, {
|
|
2083
|
+
params: {
|
|
2084
|
+
[zlib.constants.BROTLI_PARAM_QUALITY]: quality,
|
|
2085
|
+
[zlib.constants.BROTLI_PARAM_SIZE_HINT]: buffer.byteLength
|
|
2086
|
+
}
|
|
2087
|
+
});
|
|
2088
|
+
}
|
|
2054
2089
|
async function shouldPrecompress(filePath) {
|
|
2055
|
-
if (filePath.endsWith(".gz"))
|
|
2090
|
+
if (filePath.endsWith(".gz") || filePath.endsWith(".br"))
|
|
2056
2091
|
return false;
|
|
2057
2092
|
if (!COMPRESSIBLE_EXTS.has(path12.extname(filePath).toLowerCase()))
|
|
2058
2093
|
return false;
|
|
@@ -913,19 +913,8 @@ ${errorText}, ${warningText} found`];
|
|
|
913
913
|
// pkgs/@akanjs/devkit/scanInfo.ts
|
|
914
914
|
import { rm } from "fs/promises";
|
|
915
915
|
import path4 from "path";
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
"dictionary",
|
|
919
|
-
"document",
|
|
920
|
-
"service",
|
|
921
|
-
"signal",
|
|
922
|
-
"store",
|
|
923
|
-
"template",
|
|
924
|
-
"unit",
|
|
925
|
-
"util",
|
|
926
|
-
"view",
|
|
927
|
-
"zone"
|
|
928
|
-
];
|
|
916
|
+
|
|
917
|
+
// pkgs/@akanjs/devkit/workspaceLayout.ts
|
|
929
918
|
var appRootAllowedFiles = new Set([
|
|
930
919
|
"AGENTS.md",
|
|
931
920
|
"CLAUDE.md",
|
|
@@ -939,25 +928,25 @@ var appRootAllowedFiles = new Set([
|
|
|
939
928
|
"tsconfig.json",
|
|
940
929
|
"tsconfig.tsbuildinfo"
|
|
941
930
|
]);
|
|
942
|
-
var generatedRootCapacitorConfigFiles = ["capacitor.config.js", "capacitor.config.json"];
|
|
943
931
|
var appRootAllowedDirs = new Set([
|
|
944
932
|
".akan",
|
|
945
933
|
"android",
|
|
934
|
+
"common",
|
|
946
935
|
"env",
|
|
947
936
|
"ios",
|
|
948
937
|
"lib",
|
|
949
938
|
"mobile",
|
|
950
939
|
"page",
|
|
940
|
+
"plugin",
|
|
951
941
|
"private",
|
|
952
942
|
"public",
|
|
953
943
|
"script",
|
|
954
|
-
"
|
|
944
|
+
"secrets",
|
|
955
945
|
"srvkit",
|
|
956
|
-
"
|
|
957
|
-
"
|
|
958
|
-
"secrets"
|
|
946
|
+
"ui",
|
|
947
|
+
"webkit"
|
|
959
948
|
]);
|
|
960
|
-
var
|
|
949
|
+
var libFacetRootAllowedFiles = new Set([
|
|
961
950
|
"cnst.ts",
|
|
962
951
|
"db.ts",
|
|
963
952
|
"dict.ts",
|
|
@@ -968,6 +957,23 @@ var libRootAllowedFiles = new Set([
|
|
|
968
957
|
"useClient.ts",
|
|
969
958
|
"useServer.ts"
|
|
970
959
|
]);
|
|
960
|
+
var isScannedAppRootEntry = (name) => !name.startsWith(".") || appRootAllowedDirs.has(name);
|
|
961
|
+
|
|
962
|
+
// pkgs/@akanjs/devkit/scanInfo.ts
|
|
963
|
+
var databaseFileTypes = [
|
|
964
|
+
"constant",
|
|
965
|
+
"dictionary",
|
|
966
|
+
"document",
|
|
967
|
+
"service",
|
|
968
|
+
"signal",
|
|
969
|
+
"store",
|
|
970
|
+
"template",
|
|
971
|
+
"unit",
|
|
972
|
+
"util",
|
|
973
|
+
"view",
|
|
974
|
+
"zone"
|
|
975
|
+
];
|
|
976
|
+
var generatedRootCapacitorConfigFiles = ["capacitor.config.js", "capacitor.config.json"];
|
|
971
977
|
var internalLibDirs = new Set(["__lib", "__scalar"]);
|
|
972
978
|
var moduleNonUiFileTypes = {
|
|
973
979
|
database: new Set(["constant", "dictionary", "document", "service", "signal", "store"]),
|
|
@@ -983,7 +989,7 @@ var testFilePattern = /\.(test|spec)\.(ts|tsx)$/;
|
|
|
983
989
|
var rootSignalTestFilePattern = /^[A-Za-z][A-Za-z0-9_-]*\.signal\.(test|spec)\.(ts|tsx)$/;
|
|
984
990
|
var createDependencyScanner = async (exec) => (await import("./dependencyScanner-f6grrep3.js")).TypeScriptDependencyScanner.from(exec);
|
|
985
991
|
var isAllowedTestFile = (filename) => testFilePattern.test(filename);
|
|
986
|
-
var isAllowedLibRootFile = (filename) =>
|
|
992
|
+
var isAllowedLibRootFile = (filename) => libFacetRootAllowedFiles.has(filename) || rootSignalTestFilePattern.test(filename);
|
|
987
993
|
var getScanPath = (exec, relativePath) => path4.posix.join(`${exec.type}s`, exec.name, relativePath.split(path4.sep).join("/"));
|
|
988
994
|
async function clearGeneratedRootCapacitorConfigs(exec) {
|
|
989
995
|
if (exec.type !== "app")
|
|
@@ -3003,4 +3009,4 @@ class ModuleExecutor extends Executor {
|
|
|
3003
3009
|
}
|
|
3004
3010
|
}
|
|
3005
3011
|
|
|
3006
|
-
export { AGENT_BLOCK_START, AGENT_BLOCK_END, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, getDirname, CommandExecutionError, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, LibExecutor, PkgExecutor, ModuleExecutor };
|
|
3012
|
+
export { AGENT_BLOCK_START, AGENT_BLOCK_END, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, getDirname, appRootAllowedFiles, appRootAllowedDirs, libFacetRootAllowedFiles, isScannedAppRootEntry, CommandExecutionError, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, LibExecutor, PkgExecutor, ModuleExecutor };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
PageScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-hrwzz2wf.js";
|
|
5
5
|
import {
|
|
6
6
|
pluralizeName
|
|
7
7
|
} from "./index-ss469dec.js";
|
|
@@ -15,17 +15,17 @@ import {
|
|
|
15
15
|
generatedFilesForSync,
|
|
16
16
|
moduleSourcePaths,
|
|
17
17
|
sourceFile
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-m4kpmmtj.js";
|
|
19
19
|
import {
|
|
20
20
|
Prompter
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-qp089jp0.js";
|
|
22
22
|
import {
|
|
23
23
|
runner,
|
|
24
24
|
script
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-jkynkyfk.js";
|
|
26
26
|
import {
|
|
27
27
|
ModuleExecutor
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-47qxw1tz.js";
|
|
29
29
|
import {
|
|
30
30
|
FileSys
|
|
31
31
|
} from "./index-67546d0j.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-jn9vfpwz.js";
|
|
5
5
|
import {
|
|
6
6
|
createRepairReport,
|
|
7
7
|
generatedFilePathsForTarget,
|
|
8
8
|
renderRepairReport,
|
|
9
9
|
writeGeneratedSyncState,
|
|
10
10
|
writeWorkflowRunArtifact
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-m4kpmmtj.js";
|
|
12
12
|
import {
|
|
13
13
|
runner
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-jkynkyfk.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/repair/repair.runner.ts
|
|
17
17
|
var commandForShell = (command) => command.startsWith("akan ") ? `bun run ${command}` : command;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-jn9vfpwz.js";
|
|
5
5
|
import {
|
|
6
6
|
WorkflowExecutor,
|
|
7
7
|
compactWorkflowInputs,
|
|
@@ -23,10 +23,10 @@ import {
|
|
|
23
23
|
workflowCommandsForPlan,
|
|
24
24
|
workflowPlanApproval,
|
|
25
25
|
writeWorkflowRunArtifact
|
|
26
|
-
} from "./index-
|
|
26
|
+
} from "./index-m4kpmmtj.js";
|
|
27
27
|
import {
|
|
28
28
|
runner
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-jkynkyfk.js";
|
|
30
30
|
|
|
31
31
|
// pkgs/@akanjs/cli/workflow/workflow.runner.ts
|
|
32
32
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
@@ -1143,16 +1143,17 @@ class RouteClientBuilder {
|
|
|
1143
1143
|
#knownEntries;
|
|
1144
1144
|
#command;
|
|
1145
1145
|
#discovery;
|
|
1146
|
+
#entries;
|
|
1146
1147
|
constructor(options) {
|
|
1147
1148
|
this.#app = options.app;
|
|
1148
1149
|
this.#seeds = options.seeds;
|
|
1149
1150
|
this.#knownEntries = options.knownEntries ?? new Set;
|
|
1150
1151
|
this.#command = options.command ?? "start";
|
|
1151
1152
|
this.#discovery = options.discovery;
|
|
1153
|
+
this.#entries = options.entries;
|
|
1152
1154
|
}
|
|
1153
1155
|
async build() {
|
|
1154
|
-
const
|
|
1155
|
-
const discovered = await discovery.discover(this.#seeds);
|
|
1156
|
+
const discovered = this.#entries ?? await (this.#discovery ?? await GraphClientEntryDiscovery.create(this.#app)).discover(this.#seeds);
|
|
1156
1157
|
const entries = discovered.filter((e) => !this.#knownEntries.has(e));
|
|
1157
1158
|
if (entries.length === 0)
|
|
1158
1159
|
return this.#emptyResult(discovered);
|
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
import {
|
|
3
3
|
workflowRunArtifactPath,
|
|
4
4
|
workflowSyncDir
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-m4kpmmtj.js";
|
|
6
6
|
import {
|
|
7
7
|
AppExecutor,
|
|
8
|
-
LibExecutor
|
|
9
|
-
|
|
8
|
+
LibExecutor,
|
|
9
|
+
appRootAllowedDirs,
|
|
10
|
+
appRootAllowedFiles,
|
|
11
|
+
isScannedAppRootEntry
|
|
12
|
+
} from "./index-47qxw1tz.js";
|
|
10
13
|
import {
|
|
11
14
|
collectRecipeSources,
|
|
12
15
|
findInlineRecipeDuplicates,
|
|
@@ -150,33 +153,6 @@ var moduleShapeFiles = (module) => {
|
|
|
150
153
|
];
|
|
151
154
|
};
|
|
152
155
|
var constantFieldNames = (content) => [...content.matchAll(/\b([A-Za-z_$][\w$]*)\s*:\s*field\(/g)].map((match) => match[1]).filter(Boolean);
|
|
153
|
-
var appRootAllowFiles = new Set([
|
|
154
|
-
"AGENTS.md",
|
|
155
|
-
"CLAUDE.md",
|
|
156
|
-
"akan.app.json",
|
|
157
|
-
"akan.config.ts",
|
|
158
|
-
"capacitor.config.ts",
|
|
159
|
-
"client.ts",
|
|
160
|
-
"main.ts",
|
|
161
|
-
"package.json",
|
|
162
|
-
"server.ts",
|
|
163
|
-
"tsconfig.json"
|
|
164
|
-
]);
|
|
165
|
-
var appRootAllowDirs = new Set([
|
|
166
|
-
".akan",
|
|
167
|
-
"android",
|
|
168
|
-
"common",
|
|
169
|
-
"env",
|
|
170
|
-
"ios",
|
|
171
|
-
"lib",
|
|
172
|
-
"page",
|
|
173
|
-
"private",
|
|
174
|
-
"public",
|
|
175
|
-
"script",
|
|
176
|
-
"srvkit",
|
|
177
|
-
"ui",
|
|
178
|
-
"webkit"
|
|
179
|
-
]);
|
|
180
156
|
var safeReadDir = async (dirPath) => {
|
|
181
157
|
try {
|
|
182
158
|
return (await readdir(dirPath, { withFileTypes: true })).sort((a, b) => a.name.localeCompare(b.name));
|
|
@@ -404,7 +380,9 @@ class AkanContextAnalyzer {
|
|
|
404
380
|
for (const app of context.apps) {
|
|
405
381
|
const appPath = path.join(workspace.workspaceRoot, app.path);
|
|
406
382
|
for (const entry of await safeReadDir(appPath)) {
|
|
407
|
-
|
|
383
|
+
if (!isScannedAppRootEntry(entry.name))
|
|
384
|
+
continue;
|
|
385
|
+
const allowed = entry.isDirectory() ? appRootAllowedDirs.has(entry.name) : appRootAllowedFiles.has(entry.name);
|
|
408
386
|
if (!allowed) {
|
|
409
387
|
const action = repairAction("module-shape", `akan repair module-shape --app ${app.name}`, "Review app root shape and remove or move the unknown entry.", false);
|
|
410
388
|
diagnostics.push({
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-jkynkyfk.js";
|
|
6
6
|
import {
|
|
7
7
|
PkgExecutor
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-47qxw1tz.js";
|
|
9
9
|
import {
|
|
10
10
|
TypeScriptDependencyScanner
|
|
11
11
|
} from "./index-46tjzh6s.js";
|