@akanjs/cli 3.0.0-alpha.1 → 3.0.0-alpha.10
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-f0gqkfgz.js} +7 -6
- package/{application.command-0qsczf4k.js → application.command-x903m2qq.js} +5 -4
- package/{applicationBuildRunner-ct2pxyvw.js → applicationBuildRunner-ha3y8ew8.js} +3 -3
- package/buildBatch.proc.js +4 -3
- package/{capacitorApp-4r9sm3qg.js → capacitorApp-9xswcgx7.js} +5 -2
- package/{cloud.command-dxfv18sa.js → cloud.command-zs6kyf83.js} +8 -7
- package/{context.command-8d9e3k6b.js → context.command-fmepgjzg.js} +14 -13
- package/getDirname-m9s0cmhq.js +8 -0
- package/{guideline.command-3jbkxzh6.js → guideline.command-n6sw0a0c.js} +5 -4
- package/guidelines/conventions/conventions.generate.json +25 -0
- package/guidelines/conventions/conventions.instruction.md +668 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +24 -0
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +972 -0
- package/incrementalBuilder.proc.js +3 -2
- package/index-1577bej2.js +7 -0
- package/{index-bekddz9q.js → index-3vta1tqa.js} +4 -4
- package/{index-zasydjxd.js → index-4m0bphac.js} +3 -3
- package/{index-1pvex4az.js → index-5sn5w2mt.js} +13 -13
- package/{index-e16gnn26.js → index-62955kn5.js} +7 -7
- package/{index-a00jg8x8.js → index-774gcx29.js} +49 -32
- package/{index-t3723f99.js → index-779ske1y.js} +86 -17
- package/{index-nm6wghb6.js → index-82jrh4hj.js} +5 -5
- package/{index-7c6k4yvg.js → index-d43t8af2.js} +2 -2
- package/{index-ej426mcr.js → index-eyyf2149.js} +34 -6
- package/{index-k95xkh4p.js → index-gcv8ncfh.js} +2 -2
- package/{index-tdbas9r0.js → index-j37qq1f2.js} +1 -1
- package/{index-rh16j3c7.js → index-j9cxndc0.js} +3 -2
- package/{index-mr5s7mqd.js → index-jf2ya7r2.js} +3 -3
- package/{index-yzmhasdb.js → index-jhpa13zj.js} +7 -7
- package/{index-8hsbnyes.js → index-kdh76j26.js} +4 -2
- package/{index-pyt2b4nw.js → index-qb61h0k7.js} +52 -17
- package/{index-2q1f5j9k.js → index-qzdjd4ct.js} +3 -3
- package/{index-rzwcpcc3.js → index-rxkpk7n4.js} +1 -1
- package/{index-bbkek1bp.js → index-xmmzf150.js} +1 -1
- package/{index-ec09pws3.js → index-y4vkyhvv.js} +3 -3
- package/{index-hgna5rjy.js → index-z8ptfkzv.js} +83 -39
- package/index.js +19 -18
- package/{library.command-ebdj1vnm.js → library.command-cv9gdbmg.js} +4 -3
- package/{localRegistry.command-gb178ne8.js → localRegistry.command-d8fg36zc.js} +7 -6
- package/{module.command-9c1bnsx4.js → module.command-qyr1s9cn.js} +7 -6
- package/{package.command-t93p4jkj.js → package.command-wsjx0k47.js} +4 -3
- package/package.json +2 -2
- package/{page.command-k3k0meh2.js → page.command-rdzg65rm.js} +4 -3
- package/{primitive.command-de6nktdt.js → primitive.command-89g38b53.js} +8 -7
- package/{quality.command-z5kth2wa.js → quality.command-0cs2z92d.js} +10 -40
- package/{repair.command-ehf2g112.js → repair.command-6fphxfwj.js} +6 -5
- package/{routeSourceValidator-cncd92fv.js → routeSourceValidator-e4jmbfcx.js} +2 -38
- package/{scalar.command-7a2jtv33.js → scalar.command-xfer69s6.js} +6 -5
- package/templates/app/page/styles.css.template +3 -3
- package/templates/crudPages/[__model__Id]/edit/page.tsx +1 -1
- package/templates/crudPages/new/page.tsx +1 -1
- package/templates/crudSinglePage/page.tsx +1 -1
- package/templates/lib/db.ts +3 -1
- package/templates/lib/useClient.ts +9 -3
- package/templates/module/__Model__.Util.tsx +1 -1
- package/templates/module/__Model__.Zone.tsx +3 -5
- package/templates/workspaceRoot/AGENTS.md.template +0 -948
- package/templates/workspaceRoot/biome.json.template +3 -198
- package/templates/workspaceRoot/docs/AI-DEVELOPMENT.md.template +4 -1
- package/{workflow.command-e0tt0vk2.js → workflow.command-2ygfqt4f.js} +13 -12
- package/{workspace.command-fpda0evj.js → workspace.command-vbgpjkf9.js} +35 -33
- package/templates/libRoot/base/baseLogic.ts +0 -14
- package/templates/libRoot/base/index.ts +0 -8
- package/templates/workspaceRoot/.cursor/rules/akan-page-routing.mdc.template +0 -43
- package/templates/workspaceRoot/.cursor/rules/akan-sync-conventions.mdc.template +0 -33
- package/templates/workspaceRoot/.cursor/rules/application-test-commands.mdc.template +0 -16
- package/templates/workspaceRoot/.cursor/rules/change-scope.mdc.template +0 -12
- package/templates/workspaceRoot/.cursor/rules/client-server-boundaries.mdc.template +0 -18
- package/templates/workspaceRoot/.cursor/rules/coding-comments.mdc.template +0 -25
- package/templates/workspaceRoot/.cursor/rules/coding-style.mdc.template +0 -44
- package/templates/workspaceRoot/.cursor/rules/domain-module-conventions.mdc.template +0 -17
- package/templates/workspaceRoot/.cursor/rules/format-lint.mdc.template +0 -12
- package/templates/workspaceRoot/.cursor/rules/lint-enforced-rules.mdc.template +0 -18
- package/templates/workspaceRoot/.cursor/rules/module-file-playbook.mdc.template +0 -61
- package/templates/workspaceRoot/.cursor/rules/naming-conventions.mdc.template +0 -15
- package/templates/workspaceRoot/.cursor/rules/react-component-style.mdc.template +0 -21
- package/templates/workspaceRoot/.cursor/rules/repo-overview.mdc.template +0 -17
- package/templates/workspaceRoot/.cursor/rules/scalar-modeling.mdc.template +0 -58
- package/templates/workspaceRoot/.cursor/rules/secrets-and-env.mdc.template +0 -13
- package/templates/workspaceRoot/.cursor/rules/service-signal-conventions.mdc.template +0 -83
- package/templates/workspaceRoot/.cursor/rules/srvkit-adapters-and-guards.mdc.template +0 -50
- package/templates/workspaceRoot/.cursor/rules/ssr-first.mdc.template +0 -59
- package/templates/workspaceRoot/.cursor/rules/typescript-imports.mdc.template +0 -16
|
@@ -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);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-774gcx29.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-rxkpk7n4.js";
|
|
12
12
|
import {
|
|
13
13
|
runner
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-kdh76j26.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,10 +1,10 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import {
|
|
3
|
-
PageScript
|
|
4
|
-
} from "./index-bbkek1bp.js";
|
|
5
2
|
import {
|
|
6
3
|
pluralizeName
|
|
7
4
|
} from "./index-ss469dec.js";
|
|
5
|
+
import {
|
|
6
|
+
PageScript
|
|
7
|
+
} from "./index-xmmzf150.js";
|
|
8
8
|
import {
|
|
9
9
|
AiSession
|
|
10
10
|
} from "./index-0cj2zxbm.js";
|
|
@@ -15,17 +15,17 @@ import {
|
|
|
15
15
|
generatedFilesForSync,
|
|
16
16
|
moduleSourcePaths,
|
|
17
17
|
sourceFile
|
|
18
|
-
} from "./index-
|
|
18
|
+
} from "./index-rxkpk7n4.js";
|
|
19
19
|
import {
|
|
20
20
|
Prompter
|
|
21
|
-
} from "./index-
|
|
21
|
+
} from "./index-j37qq1f2.js";
|
|
22
22
|
import {
|
|
23
23
|
runner,
|
|
24
24
|
script
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-kdh76j26.js";
|
|
26
26
|
import {
|
|
27
27
|
ModuleExecutor
|
|
28
|
-
} from "./index-
|
|
28
|
+
} from "./index-z8ptfkzv.js";
|
|
29
29
|
import {
|
|
30
30
|
FileSys
|
|
31
31
|
} from "./index-67546d0j.js";
|
|
@@ -5,9 +5,11 @@ import {
|
|
|
5
5
|
LibExecutor,
|
|
6
6
|
ModuleExecutor,
|
|
7
7
|
PkgExecutor,
|
|
8
|
-
WorkspaceExecutor
|
|
8
|
+
WorkspaceExecutor
|
|
9
|
+
} from "./index-z8ptfkzv.js";
|
|
10
|
+
import {
|
|
9
11
|
getDirname
|
|
10
|
-
} from "./index-
|
|
12
|
+
} from "./index-1577bej2.js";
|
|
11
13
|
import {
|
|
12
14
|
FileSys
|
|
13
15
|
} from "./index-67546d0j.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
|
|
|
@@ -794,10 +810,10 @@ import { compile } from "tailwindcss";
|
|
|
794
810
|
|
|
795
811
|
// pkgs/@akanjs/devkit/frontendBuild/cssCandidateCache.ts
|
|
796
812
|
import { stat } from "fs/promises";
|
|
797
|
-
var CANDIDATE_RE = /-?[\w@][\w:/.-]*(?:\[[^\]]+\][\w:/.-]*)*/g;
|
|
813
|
+
var CANDIDATE_RE = /-?(?:[\w@]|\[[^\]\s]+\])[\w:/.-]*(?:\[[^\]\s]+\][\w:/.-]*)*/g;
|
|
798
814
|
|
|
799
815
|
class CssCandidateCache {
|
|
800
|
-
static #version =
|
|
816
|
+
static #version = 3;
|
|
801
817
|
#path;
|
|
802
818
|
#entries = new Map;
|
|
803
819
|
#dirty = false;
|
|
@@ -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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AkanContextAnalyzer
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-774gcx29.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-rxkpk7n4.js";
|
|
27
27
|
import {
|
|
28
28
|
runner
|
|
29
|
-
} from "./index-
|
|
29
|
+
} from "./index-kdh76j26.js";
|
|
30
30
|
|
|
31
31
|
// pkgs/@akanjs/cli/workflow/workflow.runner.ts
|
|
32
32
|
import { mkdir, readFile, writeFile } from "fs/promises";
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
createPassedPrimitiveReport,
|
|
10
10
|
generatedFilesForSync,
|
|
11
11
|
scalarChangedFiles
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-rxkpk7n4.js";
|
|
13
13
|
import {
|
|
14
14
|
Prompter
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-j37qq1f2.js";
|
|
16
16
|
import {
|
|
17
17
|
runner,
|
|
18
18
|
script
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-kdh76j26.js";
|
|
20
20
|
|
|
21
21
|
// pkgs/@akanjs/cli/scalar/scalar.prompt.ts
|
|
22
22
|
import { input } from "@inquirer/prompts";
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Spinner
|
|
4
4
|
} from "./index-mxvakhsm.js";
|
|
5
|
+
import {
|
|
6
|
+
getDirname
|
|
7
|
+
} from "./index-1577bej2.js";
|
|
5
8
|
import {
|
|
6
9
|
FileSys
|
|
7
10
|
} from "./index-67546d0j.js";
|
|
@@ -44,6 +47,21 @@ var recipeScannerLoad = null;
|
|
|
44
47
|
var loadRecipeScanner = () => recipeScannerLoad ??= import("./recipeScanner-tghkzrrt.js");
|
|
45
48
|
var AGENT_BLOCK_START = "<!-- akan:agent:start -->";
|
|
46
49
|
var AGENT_BLOCK_END = "<!-- akan:agent:end -->";
|
|
50
|
+
var AGENT_VERSION_PREFIX = "<!-- akan:agent:version ";
|
|
51
|
+
var stampBlockVersion = (block, version) => `${AGENT_VERSION_PREFIX}${version} -->
|
|
52
|
+
|
|
53
|
+
${block}`;
|
|
54
|
+
var extractBlockVersion = (content) => content.match(/<!-- akan:agent:version ([^\s]+) -->/)?.[1] ?? null;
|
|
55
|
+
var readDevkitVersion = async () => {
|
|
56
|
+
const { readFile } = await import("fs/promises");
|
|
57
|
+
const { getDirname: getDirname2 } = await import("./getDirname-m9s0cmhq.js");
|
|
58
|
+
try {
|
|
59
|
+
const raw = await readFile(`${getDirname2(import.meta.url)}/package.json`, "utf-8");
|
|
60
|
+
return JSON.parse(raw).version ?? null;
|
|
61
|
+
} catch {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
};
|
|
47
65
|
var upsertAgentBlock = (existing, block) => {
|
|
48
66
|
const managed = `${AGENT_BLOCK_START}
|
|
49
67
|
${block}
|
|
@@ -627,15 +645,10 @@ var decreaseBuildNum = async (app) => {
|
|
|
627
645
|
const akanConfigContent = akanConfig.replace(`buildNum: ${appConfig.mobile.buildNum}`, `buildNum: ${appConfig.mobile.buildNum - 1}`);
|
|
628
646
|
fs.writeFileSync(akanConfigPath, akanConfigContent);
|
|
629
647
|
};
|
|
630
|
-
// pkgs/@akanjs/devkit/getDirname.ts
|
|
631
|
-
import path2 from "path";
|
|
632
|
-
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
633
|
-
var getDirname = (url) => path2.dirname(fileURLToPath2(url));
|
|
634
|
-
|
|
635
648
|
// pkgs/@akanjs/devkit/linter.ts
|
|
636
649
|
import { spawn } from "child_process";
|
|
637
650
|
import { existsSync, readFileSync } from "fs";
|
|
638
|
-
import
|
|
651
|
+
import path2 from "path";
|
|
639
652
|
import chalk from "chalk";
|
|
640
653
|
|
|
641
654
|
class Linter {
|
|
@@ -643,26 +656,26 @@ class Linter {
|
|
|
643
656
|
#biomeBin;
|
|
644
657
|
constructor(cwdPath) {
|
|
645
658
|
this.lintRoot = this.#findBiomeRootPath(cwdPath);
|
|
646
|
-
const localBiomeBin =
|
|
659
|
+
const localBiomeBin = path2.join(this.lintRoot, "node_modules/.bin/biome");
|
|
647
660
|
this.#biomeBin = existsSync(localBiomeBin) ? localBiomeBin : "biome";
|
|
648
661
|
}
|
|
649
662
|
#findBiomeRootPath(dir) {
|
|
650
|
-
const configPath =
|
|
663
|
+
const configPath = path2.join(dir, "biome.json");
|
|
651
664
|
if (existsSync(configPath))
|
|
652
665
|
return dir;
|
|
653
|
-
const parentDir =
|
|
666
|
+
const parentDir = path2.dirname(dir);
|
|
654
667
|
if (parentDir === dir)
|
|
655
668
|
throw new Error(`biome.json not found from ${dir}`);
|
|
656
669
|
return this.#findBiomeRootPath(parentDir);
|
|
657
670
|
}
|
|
658
671
|
#toBiomePath(filePath) {
|
|
659
|
-
const relativePath =
|
|
660
|
-
if (!relativePath.startsWith("..") && !
|
|
672
|
+
const relativePath = path2.relative(this.lintRoot, filePath);
|
|
673
|
+
if (!relativePath.startsWith("..") && !path2.isAbsolute(relativePath))
|
|
661
674
|
return relativePath;
|
|
662
675
|
return filePath;
|
|
663
676
|
}
|
|
664
677
|
#resolveFilePath(filePath) {
|
|
665
|
-
return
|
|
678
|
+
return path2.isAbsolute(filePath) ? filePath : path2.join(this.lintRoot, filePath);
|
|
666
679
|
}
|
|
667
680
|
async#runBiome(args, input) {
|
|
668
681
|
return await new Promise((resolve, reject) => {
|
|
@@ -694,7 +707,7 @@ class Linter {
|
|
|
694
707
|
const diagnosticPath = diagnostic.location?.path;
|
|
695
708
|
if (!diagnosticPath)
|
|
696
709
|
return fallbackFilePath;
|
|
697
|
-
return
|
|
710
|
+
return path2.isAbsolute(diagnosticPath) ? diagnosticPath : path2.join(this.lintRoot, diagnosticPath);
|
|
698
711
|
}
|
|
699
712
|
#createLintMessage(diagnostic) {
|
|
700
713
|
const start = diagnostic.location?.start;
|
|
@@ -759,7 +772,7 @@ class Linter {
|
|
|
759
772
|
"--max-diagnostics=none",
|
|
760
773
|
"--no-errors-on-unmatched",
|
|
761
774
|
"--config-path",
|
|
762
|
-
|
|
775
|
+
path2.join(this.lintRoot, "biome.json"),
|
|
763
776
|
this.#toBiomePath(filePath)
|
|
764
777
|
]);
|
|
765
778
|
const report = this.#parseBiomeReport(stdout || stderr);
|
|
@@ -884,7 +897,7 @@ ${errorText}, ${warningText} found`];
|
|
|
884
897
|
"check",
|
|
885
898
|
"--write",
|
|
886
899
|
"--config-path",
|
|
887
|
-
|
|
900
|
+
path2.join(this.lintRoot, "biome.json"),
|
|
888
901
|
"--stdin-file-path",
|
|
889
902
|
this.#toBiomePath(resolvedFilePath)
|
|
890
903
|
], source);
|
|
@@ -895,7 +908,7 @@ ${errorText}, ${warningText} found`];
|
|
|
895
908
|
const resolvedFilePath = this.#resolveFilePath(filePath);
|
|
896
909
|
if (!existsSync(resolvedFilePath))
|
|
897
910
|
throw new Error(`File not found: ${filePath}`);
|
|
898
|
-
return JSON.parse(readFileSync(
|
|
911
|
+
return JSON.parse(readFileSync(path2.join(this.lintRoot, "biome.json"), "utf8"));
|
|
899
912
|
}
|
|
900
913
|
async getProblematicRules(filePath) {
|
|
901
914
|
const { results } = await this.lintFile(filePath);
|
|
@@ -910,22 +923,36 @@ ${errorText}, ${warningText} found`];
|
|
|
910
923
|
}
|
|
911
924
|
}
|
|
912
925
|
|
|
926
|
+
// pkgs/@akanjs/devkit/repoIdentity.ts
|
|
927
|
+
import { execFileSync } from "child_process";
|
|
928
|
+
import path3 from "path";
|
|
929
|
+
var resolved = new Map;
|
|
930
|
+
var readRemoteName = (workspaceRoot) => {
|
|
931
|
+
try {
|
|
932
|
+
const url = execFileSync("git", ["config", "--get", "remote.origin.url"], {
|
|
933
|
+
cwd: workspaceRoot,
|
|
934
|
+
encoding: "utf-8",
|
|
935
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
936
|
+
}).trim();
|
|
937
|
+
return url.replace(/\.git$/, "").split(/[/:]/).pop() || null;
|
|
938
|
+
} catch {
|
|
939
|
+
return null;
|
|
940
|
+
}
|
|
941
|
+
};
|
|
942
|
+
var resolveRepoName = (workspaceRoot) => {
|
|
943
|
+
const cached = resolved.get(workspaceRoot);
|
|
944
|
+
if (cached)
|
|
945
|
+
return cached;
|
|
946
|
+
const repoName = readRemoteName(workspaceRoot) ?? path3.basename(workspaceRoot);
|
|
947
|
+
resolved.set(workspaceRoot, repoName);
|
|
948
|
+
return repoName;
|
|
949
|
+
};
|
|
950
|
+
|
|
913
951
|
// pkgs/@akanjs/devkit/scanInfo.ts
|
|
914
952
|
import { rm } from "fs/promises";
|
|
915
953
|
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
|
-
];
|
|
954
|
+
|
|
955
|
+
// pkgs/@akanjs/devkit/workspaceLayout.ts
|
|
929
956
|
var appRootAllowedFiles = new Set([
|
|
930
957
|
"AGENTS.md",
|
|
931
958
|
"CLAUDE.md",
|
|
@@ -939,25 +966,25 @@ var appRootAllowedFiles = new Set([
|
|
|
939
966
|
"tsconfig.json",
|
|
940
967
|
"tsconfig.tsbuildinfo"
|
|
941
968
|
]);
|
|
942
|
-
var generatedRootCapacitorConfigFiles = ["capacitor.config.js", "capacitor.config.json"];
|
|
943
969
|
var appRootAllowedDirs = new Set([
|
|
944
970
|
".akan",
|
|
945
971
|
"android",
|
|
972
|
+
"common",
|
|
946
973
|
"env",
|
|
947
974
|
"ios",
|
|
948
975
|
"lib",
|
|
949
976
|
"mobile",
|
|
950
977
|
"page",
|
|
978
|
+
"plugin",
|
|
951
979
|
"private",
|
|
952
980
|
"public",
|
|
953
981
|
"script",
|
|
954
|
-
"
|
|
982
|
+
"secrets",
|
|
955
983
|
"srvkit",
|
|
956
|
-
"
|
|
957
|
-
"
|
|
958
|
-
"secrets"
|
|
984
|
+
"ui",
|
|
985
|
+
"webkit"
|
|
959
986
|
]);
|
|
960
|
-
var
|
|
987
|
+
var libFacetRootAllowedFiles = new Set([
|
|
961
988
|
"cnst.ts",
|
|
962
989
|
"db.ts",
|
|
963
990
|
"dict.ts",
|
|
@@ -968,6 +995,23 @@ var libRootAllowedFiles = new Set([
|
|
|
968
995
|
"useClient.ts",
|
|
969
996
|
"useServer.ts"
|
|
970
997
|
]);
|
|
998
|
+
var isScannedAppRootEntry = (name) => !name.startsWith(".") || appRootAllowedDirs.has(name);
|
|
999
|
+
|
|
1000
|
+
// pkgs/@akanjs/devkit/scanInfo.ts
|
|
1001
|
+
var databaseFileTypes = [
|
|
1002
|
+
"constant",
|
|
1003
|
+
"dictionary",
|
|
1004
|
+
"document",
|
|
1005
|
+
"service",
|
|
1006
|
+
"signal",
|
|
1007
|
+
"store",
|
|
1008
|
+
"template",
|
|
1009
|
+
"unit",
|
|
1010
|
+
"util",
|
|
1011
|
+
"view",
|
|
1012
|
+
"zone"
|
|
1013
|
+
];
|
|
1014
|
+
var generatedRootCapacitorConfigFiles = ["capacitor.config.js", "capacitor.config.json"];
|
|
971
1015
|
var internalLibDirs = new Set(["__lib", "__scalar"]);
|
|
972
1016
|
var moduleNonUiFileTypes = {
|
|
973
1017
|
database: new Set(["constant", "dictionary", "document", "service", "signal", "store"]),
|
|
@@ -983,7 +1027,7 @@ var testFilePattern = /\.(test|spec)\.(ts|tsx)$/;
|
|
|
983
1027
|
var rootSignalTestFilePattern = /^[A-Za-z][A-Za-z0-9_-]*\.signal\.(test|spec)\.(ts|tsx)$/;
|
|
984
1028
|
var createDependencyScanner = async (exec) => (await import("./dependencyScanner-f6grrep3.js")).TypeScriptDependencyScanner.from(exec);
|
|
985
1029
|
var isAllowedTestFile = (filename) => testFilePattern.test(filename);
|
|
986
|
-
var isAllowedLibRootFile = (filename) =>
|
|
1030
|
+
var isAllowedLibRootFile = (filename) => libFacetRootAllowedFiles.has(filename) || rootSignalTestFilePattern.test(filename);
|
|
987
1031
|
var getScanPath = (exec, relativePath) => path4.posix.join(`${exec.type}s`, exec.name, relativePath.split(path4.sep).join("/"));
|
|
988
1032
|
async function clearGeneratedRootCapacitorConfigs(exec) {
|
|
989
1033
|
if (exec.type !== "app")
|
|
@@ -2103,7 +2147,7 @@ class WorkspaceExecutor extends Executor {
|
|
|
2103
2147
|
static #execs = new Map;
|
|
2104
2148
|
static fromRoot({
|
|
2105
2149
|
workspaceRoot = process.cwd(),
|
|
2106
|
-
repoName =
|
|
2150
|
+
repoName = resolveRepoName(workspaceRoot)
|
|
2107
2151
|
} = {}) {
|
|
2108
2152
|
return WorkspaceExecutor.#execs.get(repoName) ?? new WorkspaceExecutor({ workspaceRoot, repoName });
|
|
2109
2153
|
}
|
|
@@ -2479,7 +2523,7 @@ class SysExecutor extends Executor {
|
|
|
2479
2523
|
class AppExecutor extends SysExecutor {
|
|
2480
2524
|
static #routeSourceValidator = null;
|
|
2481
2525
|
static async#getRouteSourceValidator() {
|
|
2482
|
-
AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-
|
|
2526
|
+
AppExecutor.#routeSourceValidator ??= (await import("./routeSourceValidator-e4jmbfcx.js")).RouteSourceValidator;
|
|
2483
2527
|
return AppExecutor.#routeSourceValidator;
|
|
2484
2528
|
}
|
|
2485
2529
|
dist;
|
|
@@ -3003,4 +3047,4 @@ class ModuleExecutor extends Executor {
|
|
|
3003
3047
|
}
|
|
3004
3048
|
}
|
|
3005
3049
|
|
|
3006
|
-
export { AGENT_BLOCK_START, AGENT_BLOCK_END, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock,
|
|
3050
|
+
export { AGENT_BLOCK_START, AGENT_BLOCK_END, stampBlockVersion, extractBlockVersion, readDevkitVersion, upsertAgentBlock, extractAgentBlock, renderRecipeEntries, collectScopeRecipeSources, renderScopeAgentBlock, appRootAllowedFiles, appRootAllowedDirs, libFacetRootAllowedFiles, isScannedAppRootEntry, CommandExecutionError, Executor, WorkspaceExecutor, SysExecutor, AppExecutor, LibExecutor, PkgExecutor, ModuleExecutor };
|
package/index.js
CHANGED
|
@@ -4,9 +4,10 @@ import {
|
|
|
4
4
|
getTargetCommandNames,
|
|
5
5
|
getTargetMetas,
|
|
6
6
|
runCommands
|
|
7
|
-
} from "./index-
|
|
8
|
-
import"./index-
|
|
7
|
+
} from "./index-kdh76j26.js";
|
|
8
|
+
import"./index-z8ptfkzv.js";
|
|
9
9
|
import"./index-mxvakhsm.js";
|
|
10
|
+
import"./index-1577bej2.js";
|
|
10
11
|
import"./index-67546d0j.js";
|
|
11
12
|
import {
|
|
12
13
|
__require
|
|
@@ -17,22 +18,22 @@ import path from "path";
|
|
|
17
18
|
|
|
18
19
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
19
20
|
var commandModules = {
|
|
20
|
-
workspace: async () => (await import("./workspace.command-
|
|
21
|
-
agent: async () => (await import("./agent.command-
|
|
22
|
-
application: async () => (await import("./application.command-
|
|
23
|
-
library: async () => (await import("./library.command-
|
|
24
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
25
|
-
package: async () => (await import("./package.command-
|
|
26
|
-
module: async () => (await import("./module.command-
|
|
27
|
-
page: async () => (await import("./page.command-
|
|
28
|
-
context: async () => (await import("./context.command-
|
|
29
|
-
cloud: async () => (await import("./cloud.command-
|
|
30
|
-
guideline: async () => (await import("./guideline.command-
|
|
31
|
-
scalar: async () => (await import("./scalar.command-
|
|
32
|
-
primitive: async () => (await import("./primitive.command-
|
|
33
|
-
quality: async () => (await import("./quality.command-
|
|
34
|
-
repair: async () => (await import("./repair.command-
|
|
35
|
-
workflow: async () => (await import("./workflow.command-
|
|
21
|
+
workspace: async () => (await import("./workspace.command-vbgpjkf9.js")).WorkspaceCommand,
|
|
22
|
+
agent: async () => (await import("./agent.command-f0gqkfgz.js")).AgentCommand,
|
|
23
|
+
application: async () => (await import("./application.command-x903m2qq.js")).ApplicationCommand,
|
|
24
|
+
library: async () => (await import("./library.command-cv9gdbmg.js")).LibraryCommand,
|
|
25
|
+
localRegistry: async () => (await import("./localRegistry.command-d8fg36zc.js")).LocalRegistryCommand,
|
|
26
|
+
package: async () => (await import("./package.command-wsjx0k47.js")).PackageCommand,
|
|
27
|
+
module: async () => (await import("./module.command-qyr1s9cn.js")).ModuleCommand,
|
|
28
|
+
page: async () => (await import("./page.command-rdzg65rm.js")).PageCommand,
|
|
29
|
+
context: async () => (await import("./context.command-fmepgjzg.js")).ContextCommand,
|
|
30
|
+
cloud: async () => (await import("./cloud.command-zs6kyf83.js")).CloudCommand,
|
|
31
|
+
guideline: async () => (await import("./guideline.command-n6sw0a0c.js")).GuidelineCommand,
|
|
32
|
+
scalar: async () => (await import("./scalar.command-xfer69s6.js")).ScalarCommand,
|
|
33
|
+
primitive: async () => (await import("./primitive.command-89g38b53.js")).PrimitiveCommand,
|
|
34
|
+
quality: async () => (await import("./quality.command-0cs2z92d.js")).QualityCommand,
|
|
35
|
+
repair: async () => (await import("./repair.command-6fphxfwj.js")).RepairCommand,
|
|
36
|
+
workflow: async () => (await import("./workflow.command-2ygfqt4f.js")).WorkflowCommand
|
|
36
37
|
};
|
|
37
38
|
var commandModuleIds = Object.keys(commandModules);
|
|
38
39
|
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
LibraryScript
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-d43t8af2.js";
|
|
5
5
|
import {
|
|
6
6
|
Lib,
|
|
7
7
|
Workspace,
|
|
8
8
|
command
|
|
9
|
-
} from "./index-
|
|
10
|
-
import"./index-
|
|
9
|
+
} from "./index-kdh76j26.js";
|
|
10
|
+
import"./index-z8ptfkzv.js";
|
|
11
11
|
import"./index-mxvakhsm.js";
|
|
12
|
+
import"./index-1577bej2.js";
|
|
12
13
|
import"./index-67546d0j.js";
|
|
13
14
|
import"./index-r24hmh0q.js";
|
|
14
15
|
|
|
@@ -2,28 +2,29 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CloudRunner,
|
|
4
4
|
getNpmRegistryUrl
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-4m0bphac.js";
|
|
6
6
|
import {
|
|
7
7
|
PackageScript
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-gcv8ncfh.js";
|
|
9
9
|
import"./index-0cj2zxbm.js";
|
|
10
10
|
import {
|
|
11
11
|
ApplicationScript
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-62955kn5.js";
|
|
13
|
+
import"./index-d43t8af2.js";
|
|
13
14
|
import"./index-76rn3g2c.js";
|
|
14
|
-
import"./index-7c6k4yvg.js";
|
|
15
15
|
import {
|
|
16
16
|
Workspace,
|
|
17
17
|
command,
|
|
18
18
|
runner,
|
|
19
19
|
script
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-kdh76j26.js";
|
|
21
21
|
import"./index-fgc8r6dj.js";
|
|
22
22
|
import"./index-bjpxzr6s.js";
|
|
23
23
|
import {
|
|
24
24
|
PkgExecutor
|
|
25
|
-
} from "./index-
|
|
25
|
+
} from "./index-z8ptfkzv.js";
|
|
26
26
|
import"./index-mxvakhsm.js";
|
|
27
|
+
import"./index-1577bej2.js";
|
|
27
28
|
import"./index-46tjzh6s.js";
|
|
28
29
|
import"./index-67546d0j.js";
|
|
29
30
|
import"./index-r24hmh0q.js";
|