@akanjs/cli 3.0.1 → 3.0.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 +1 -1
- package/{CodeAgent-zfab7pkn.js → CodeAgent-szbjv4gv.js} +2 -2
- package/{CodeTui-0zhnr0pw.js → CodeTui-5nw86ab6.js} +1 -1
- package/{agent.command-aja6z9mn.js → agent.command-np1dffkb.js} +5 -5
- package/akanCode.js +2 -2
- package/{application.command-049ehgx3.js → application.command-gk69v1xs.js} +8 -8
- package/{applicationBuildRunner-75n5rpwp.js → applicationBuildRunner-wx09n9g6.js} +3 -3
- package/buildBatch.proc.js +4 -4
- package/{cloud.command-gw4kqxt8.js → cloud.command-tw06613r.js} +10 -10
- package/cloud.script-64gzba8r.js +20 -0
- package/{code.command-x9t6z5nw.js → code.command-hmtx14b2.js} +6 -6
- package/{context.command-yfbe1rtd.js → context.command-6aqvdx43.js} +13 -13
- package/context.runner-hnkvv3z3.js +21 -0
- package/{guideline.command-kq9gp690.js → guideline.command-axvf68gc.js} +2 -2
- package/guidelines/conventions/conventions.instruction.md +89 -17
- package/guidelines/queryRule/queryRule.instruction.md +4 -2
- package/guidelines/runtimeRule/runtimeRule.instruction.md +10 -5
- package/guidelines/transportRule/transportRule.instruction.md +40 -4
- package/guidelines/workspaceOnboarding/workspaceOnboarding.instruction.md +1 -1
- package/incrementalBuilder.proc.js +3 -3
- package/{index-66yspb67.js → index-1bjkfvm9.js} +29 -27
- package/{index-b95yhqjr.js → index-1gs9g12n.js} +3 -3
- package/{index-y7hx1ygz.js → index-3xmzr1p1.js} +2 -2
- package/{index-mzjb6zp4.js → index-50jjwg8y.js} +1 -1
- package/{index-150s07n8.js → index-50wb2a26.js} +313 -93
- package/{index-8b639zes.js → index-6keyf4sg.js} +4 -4
- package/{index-vs8mefhy.js → index-bsv901fd.js} +7 -7
- package/{index-5pvxf7z0.js → index-cb6yc5mb.js} +2 -2
- package/{index-rfcz04w9.js → index-f4e08ptp.js} +4 -4
- package/{index-25fvrxmy.js → index-g38nhv87.js} +1 -1
- package/{index-m3xsb1ms.js → index-gtjgnv36.js} +29 -11
- package/{index-mb59b8x0.js → index-h9ht6s60.js} +1 -1
- package/{index-5g4rkrvt.js → index-hp3stk1m.js} +3 -3
- package/{index-h54yj9wr.js → index-hxnnfy57.js} +6 -5
- package/{index-kn5d4jmg.js → index-j38qkvkk.js} +7 -7
- package/{index-y5ga5w9t.js → index-jb0hmt3k.js} +3 -3
- package/{index-7p4c0yer.js → index-jk9xnck6.js} +33 -11
- package/{index-senscydg.js → index-k9rrten6.js} +6 -1
- package/{index-qe71g4ze.js → index-nwd6qzvv.js} +42 -23
- package/{index-a37by9hn.js → index-q6ft9fkc.js} +4 -4
- package/{index-br8pkrk1.js → index-t91a7339.js} +5 -5
- package/{index-c14nsvnv.js → index-xwprn9nr.js} +1 -1
- package/{index-fkvb79qe.js → index-z750gk1j.js} +15 -11
- package/{index-5q14pwzd.js → index-zwd84m0w.js} +4 -4
- package/{index-8kvy8qb4.js → index-zyw622y1.js} +12 -2
- package/index.js +21 -21
- package/{library.command-keqjevpp.js → library.command-9m2rdwwz.js} +3 -3
- package/{localRegistry.command-pydeq5zf.js → localRegistry.command-kda81jyk.js} +9 -9
- package/{module.command-dkrnqx3v.js → module.command-q63dffya.js} +5 -5
- package/{package.command-wmc0ys5y.js → package.command-y2jh0m99.js} +3 -3
- package/package.json +2 -2
- package/{page.command-tf3erhrv.js → page.command-f3e4cwhh.js} +3 -3
- package/{primitive.command-7hqpegj4.js → primitive.command-r4kq75qj.js} +6 -6
- package/{quality.command-8122axq3.js → quality.command-f7gzh26z.js} +9 -2
- package/{repair.command-mcy12h0n.js → repair.command-0qmyr6qa.js} +5 -5
- package/{scalar.command-vvvbzttc.js → scalar.command-kddn7av4.js} +4 -4
- package/{subspace.command-pzvqfy5h.js → subspace.command-ft65qvc4.js} +5 -7
- package/templates/app/tsconfig.json.template +1 -6
- package/templates/app/ui/Recipe/jellyButton.ts +1 -0
- package/templates/facetIndex/index.ts +21 -6
- package/templates/lib/dict.ts +9 -1
- package/templates/lib/srv.ts +2 -3
- package/templates/libRoot/common/index.ts +2 -7
- package/templates/libRoot/srvkit/index.ts +2 -7
- package/templates/libRoot/ui/index.ts +2 -7
- package/templates/libRoot/webkit/index.ts +2 -7
- package/templates/moduleRoot/index.tsx +3 -3
- package/{tunnel.command-82zz5xnq.js → tunnel.command-b3ymdk4f.js} +2 -2
- package/{workflow.command-y8x3kgjv.js → workflow.command-z1srcdfw.js} +10 -10
- package/{workspace.command-jvsb7brc.js → workspace.command-vp6vmx3z.js} +21 -21
- package/cloud.script-c723cpcb.js +0 -20
- package/context.runner-erfe68j5.js +0 -21
- package/index-bjwxs904.js +0 -77
- package/templates/libRoot/common/commonLogic.ts +0 -14
- package/templates/libRoot/srvkit/backendLogic.ts +0 -13
- package/templates/libRoot/webkit/frontendLogic.ts +0 -13
|
@@ -5,19 +5,19 @@ import {
|
|
|
5
5
|
} from "./index-94s080qm.js";
|
|
6
6
|
import {
|
|
7
7
|
script
|
|
8
|
-
} from "./index-
|
|
8
|
+
} from "./index-q6ft9fkc.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-50wb2a26.js";
|
|
12
12
|
import {
|
|
13
13
|
ApplicationScript
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-nwd6qzvv.js";
|
|
15
15
|
import {
|
|
16
16
|
PackageScript
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-3xmzr1p1.js";
|
|
18
18
|
import {
|
|
19
19
|
CloudRunner
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-hxnnfy57.js";
|
|
21
21
|
|
|
22
22
|
// pkgs/@akanjs/cli/cloud/cloud.script.ts
|
|
23
23
|
import { Logger } from "akanjs/common";
|
|
@@ -116,7 +116,7 @@ class SubagentPool2 {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
async#run(id, kind, prompt, signal) {
|
|
119
|
-
const { CodeAgent } = await import("./CodeAgent-
|
|
119
|
+
const { CodeAgent } = await import("./CodeAgent-szbjv4gv.js");
|
|
120
120
|
const budget = this.#options.parent.tools.subagent;
|
|
121
121
|
const child = SubagentPool2.childOf(this.#options.parent, kind);
|
|
122
122
|
const agent = await CodeAgent.create({
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
resolveSsrPageEntriesForApp
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-50wb2a26.js";
|
|
5
5
|
import {
|
|
6
6
|
computeRouteSeedIndex,
|
|
7
7
|
saveRouteSeedIndex,
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
CsrEntryFiles,
|
|
17
17
|
PagesEntrySourceGenerator,
|
|
18
18
|
PagesBundleBuilder
|
|
19
|
-
} from "./index-
|
|
19
|
+
} from "./index-gtjgnv36.js";
|
|
20
20
|
import {
|
|
21
21
|
SOURCE_EXTS
|
|
22
|
-
} from "./index-
|
|
22
|
+
} from "./index-k9rrten6.js";
|
|
23
23
|
var __require = import.meta.require;
|
|
24
24
|
|
|
25
25
|
// pkgs/@akanjs/devkit/frontendBuild/allRoutesBuilder.ts
|
|
@@ -158,17 +158,11 @@ class CsrArtifactBuilder {
|
|
|
158
158
|
await this.#createEntryFile(basePath, CsrArtifactBuilder.pageEntriesForBasePath(pageEntries, basePath, basePaths))
|
|
159
159
|
]))).flat());
|
|
160
160
|
const result = await Bun.build({
|
|
161
|
-
|
|
161
|
+
...CsrArtifactBuilder.bundleOptions(this.#app, this.#command, akanConfig.optimizeImports),
|
|
162
162
|
entrypoints: htmlBasePaths.map((basePath) => this.#generatedPath(CsrArtifactBuilder.htmlFilename(basePath))),
|
|
163
163
|
files: generatedFiles,
|
|
164
164
|
root: this.#generatedDir,
|
|
165
|
-
outdir: this.#outputDir
|
|
166
|
-
splitting: false,
|
|
167
|
-
minify: true,
|
|
168
|
-
env: "AKAN_PUBLIC_*",
|
|
169
|
-
define: bundleDefine(this.#app, this.#command, "csr"),
|
|
170
|
-
optimizeImports: akanConfig.optimizeImports,
|
|
171
|
-
plugins: [PagesBundleBuilder.createCssStubPlugin()]
|
|
165
|
+
outdir: this.#outputDir
|
|
172
166
|
});
|
|
173
167
|
if (!result.success) {
|
|
174
168
|
const logs = result.logs.map((log) => log.message).join(`
|
|
@@ -180,6 +174,16 @@ ${logs}` : ""}`);
|
|
|
180
174
|
this.#app.verbose(`[csr-build] output -> ${this.#outputDir}`);
|
|
181
175
|
return { outputDir: this.#outputDir };
|
|
182
176
|
}
|
|
177
|
+
static bundleOptions(app, command, optimizeImports = []) {
|
|
178
|
+
return {
|
|
179
|
+
target: "browser",
|
|
180
|
+
splitting: false,
|
|
181
|
+
minify: true,
|
|
182
|
+
define: bundleDefine(app, command, "csr"),
|
|
183
|
+
optimizeImports,
|
|
184
|
+
plugins: [PagesBundleBuilder.createCssStubPlugin()]
|
|
185
|
+
};
|
|
186
|
+
}
|
|
183
187
|
static pageEntriesForBasePath(pageEntries, basePath, basePaths) {
|
|
184
188
|
return CsrEntryFiles.pageEntriesForBasePath(pageEntries, basePath, basePaths);
|
|
185
189
|
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
jsonText
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-h9ht6s60.js";
|
|
5
5
|
import {
|
|
6
6
|
akanMcpInstallTargets
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-zyw622y1.js";
|
|
8
8
|
import {
|
|
9
9
|
script
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-q6ft9fkc.js";
|
|
11
11
|
import {
|
|
12
12
|
ContextRunner2
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-j38qkvkk.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/cli/context/context.script.ts
|
|
16
16
|
import { Logger } from "akanjs/common";
|
|
@@ -4,11 +4,13 @@ import {
|
|
|
4
4
|
readDevkitVersion,
|
|
5
5
|
rootAllowedFiles,
|
|
6
6
|
rootAllowedDirs,
|
|
7
|
+
barrelFacetDirs,
|
|
8
|
+
facetIndexShadowOf,
|
|
7
9
|
rootEntryHintOf,
|
|
8
10
|
isScannedRootEntry,
|
|
9
11
|
AppExecutor,
|
|
10
12
|
LibExecutor
|
|
11
|
-
} from "./index-
|
|
13
|
+
} from "./index-50wb2a26.js";
|
|
12
14
|
import {
|
|
13
15
|
FileSys2
|
|
14
16
|
} from "./index-52w0fvh8.js";
|
|
@@ -21,7 +23,7 @@ import {
|
|
|
21
23
|
workflowPathsForPlan,
|
|
22
24
|
workflowRunArtifactPath,
|
|
23
25
|
workflowSyncDir
|
|
24
|
-
} from "./index-
|
|
26
|
+
} from "./index-h9ht6s60.js";
|
|
25
27
|
|
|
26
28
|
// pkgs/@akanjs/devkit/akanContext.ts
|
|
27
29
|
import { readdir } from "fs/promises";
|
|
@@ -401,6 +403,14 @@ class AkanContextAnalyzer {
|
|
|
401
403
|
message: `Unexpected ${entry.isDirectory() ? "folder" : "file"} in ${sys.type} root: ${sys.path}/${entry.name}${rootEntryHint ? ` (${rootEntryHint})` : ""}`
|
|
402
404
|
}, repairAction("module-shape", `akan repair module-shape --app ${sys.name}`, `Review ${sys.type} root shape and remove or move the unknown entry.`, false));
|
|
403
405
|
}
|
|
406
|
+
for (const facet of barrelFacetDirs)
|
|
407
|
+
for (const entry of await safeReadDir(path.join(sysPath, facet))) {
|
|
408
|
+
const shadow = entry.isDirectory() ? null : facetIndexShadowOf(`${facet}/${entry.name}`);
|
|
409
|
+
if (!shadow)
|
|
410
|
+
continue;
|
|
411
|
+
const entryPath = `${sys.path}/${facet}/${entry.name}`;
|
|
412
|
+
report({ severity: "error", code: "facet-index-shadowed", path: entryPath, message: `${entryPath} ${shadow}` }, repairAction("generated", `akan sync ${sys.name}`, `Delete ${entryPath} by hand, then sync.`, false));
|
|
413
|
+
}
|
|
404
414
|
}
|
|
405
415
|
const agentDrift = await AkanContextAnalyzer.#agentGuideDrift(workspace);
|
|
406
416
|
if (agentDrift)
|
package/index.js
CHANGED
|
@@ -4,34 +4,34 @@ import {
|
|
|
4
4
|
getTargetMetas,
|
|
5
5
|
getTargetCommandNames,
|
|
6
6
|
runCommands
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-q6ft9fkc.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
|
-
import"./index-
|
|
9
|
+
import"./index-50wb2a26.js";
|
|
10
10
|
|
|
11
11
|
// pkgs/@akanjs/cli/commandManifest.ts
|
|
12
12
|
import path from "path";
|
|
13
13
|
|
|
14
14
|
// pkgs/@akanjs/cli/commandModules.ts
|
|
15
15
|
var commandModules = {
|
|
16
|
-
workspace: async () => (await import("./workspace.command-
|
|
17
|
-
agent: async () => (await import("./agent.command-
|
|
18
|
-
code: async () => (await import("./code.command-
|
|
19
|
-
application: async () => (await import("./application.command-
|
|
20
|
-
library: async () => (await import("./library.command-
|
|
21
|
-
localRegistry: async () => (await import("./localRegistry.command-
|
|
22
|
-
package: async () => (await import("./package.command-
|
|
23
|
-
module: async () => (await import("./module.command-
|
|
24
|
-
page: async () => (await import("./page.command-
|
|
25
|
-
context: async () => (await import("./context.command-
|
|
26
|
-
cloud: async () => (await import("./cloud.command-
|
|
27
|
-
subspace: async () => (await import("./subspace.command-
|
|
28
|
-
guideline: async () => (await import("./guideline.command-
|
|
29
|
-
scalar: async () => (await import("./scalar.command-
|
|
30
|
-
primitive: async () => (await import("./primitive.command-
|
|
31
|
-
quality: async () => (await import("./quality.command-
|
|
32
|
-
repair: async () => (await import("./repair.command-
|
|
33
|
-
workflow: async () => (await import("./workflow.command-
|
|
34
|
-
tunnel: async () => (await import("./tunnel.command-
|
|
16
|
+
workspace: async () => (await import("./workspace.command-vp6vmx3z.js")).WorkspaceCommand,
|
|
17
|
+
agent: async () => (await import("./agent.command-np1dffkb.js")).AgentCommand,
|
|
18
|
+
code: async () => (await import("./code.command-hmtx14b2.js")).CodeCommand,
|
|
19
|
+
application: async () => (await import("./application.command-gk69v1xs.js")).ApplicationCommand,
|
|
20
|
+
library: async () => (await import("./library.command-9m2rdwwz.js")).LibraryCommand,
|
|
21
|
+
localRegistry: async () => (await import("./localRegistry.command-kda81jyk.js")).LocalRegistryCommand,
|
|
22
|
+
package: async () => (await import("./package.command-y2jh0m99.js")).PackageCommand,
|
|
23
|
+
module: async () => (await import("./module.command-q63dffya.js")).ModuleCommand,
|
|
24
|
+
page: async () => (await import("./page.command-f3e4cwhh.js")).PageCommand,
|
|
25
|
+
context: async () => (await import("./context.command-6aqvdx43.js")).ContextCommand,
|
|
26
|
+
cloud: async () => (await import("./cloud.command-tw06613r.js")).CloudCommand,
|
|
27
|
+
subspace: async () => (await import("./subspace.command-ft65qvc4.js")).SubspaceCommand,
|
|
28
|
+
guideline: async () => (await import("./guideline.command-axvf68gc.js")).GuidelineCommand,
|
|
29
|
+
scalar: async () => (await import("./scalar.command-kddn7av4.js")).ScalarCommand,
|
|
30
|
+
primitive: async () => (await import("./primitive.command-r4kq75qj.js")).PrimitiveCommand,
|
|
31
|
+
quality: async () => (await import("./quality.command-f7gzh26z.js")).QualityCommand,
|
|
32
|
+
repair: async () => (await import("./repair.command-0qmyr6qa.js")).RepairCommand,
|
|
33
|
+
workflow: async () => (await import("./workflow.command-z1srcdfw.js")).WorkflowCommand,
|
|
34
|
+
tunnel: async () => (await import("./tunnel.command-b3ymdk4f.js")).TunnelCommand
|
|
35
35
|
};
|
|
36
36
|
var commandModuleIds = Object.keys(commandModules);
|
|
37
37
|
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
Lib,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-q6ft9fkc.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-50wb2a26.js";
|
|
9
9
|
import {
|
|
10
10
|
LibraryScript
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-1bjkfvm9.js";
|
|
12
12
|
|
|
13
13
|
// pkgs/@akanjs/cli/library/library.command.ts
|
|
14
14
|
class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
|
|
@@ -4,28 +4,28 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-q6ft9fkc.js";
|
|
8
8
|
import"./index-52w0fvh8.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
13
|
-
import"./index-
|
|
14
|
-
import"./index-
|
|
11
|
+
} from "./index-50wb2a26.js";
|
|
12
|
+
import"./index-k9rrten6.js";
|
|
13
|
+
import"./index-jk9xnck6.js";
|
|
14
|
+
import"./index-1bjkfvm9.js";
|
|
15
15
|
import {
|
|
16
16
|
ApplicationScript
|
|
17
|
-
} from "./index-
|
|
17
|
+
} from "./index-nwd6qzvv.js";
|
|
18
18
|
import"./index-7md2g9vw.js";
|
|
19
19
|
import"./index-94s080qm.js";
|
|
20
20
|
import {
|
|
21
21
|
getNpmRegistryUrl,
|
|
22
22
|
CloudRunner
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-hxnnfy57.js";
|
|
24
24
|
import"./index-2ahj896a.js";
|
|
25
25
|
import {
|
|
26
26
|
PackageScript
|
|
27
|
-
} from "./index-
|
|
28
|
-
import"./index-
|
|
27
|
+
} from "./index-3xmzr1p1.js";
|
|
28
|
+
import"./index-50jjwg8y.js";
|
|
29
29
|
|
|
30
30
|
// pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
|
|
31
31
|
import { mkdir, rm } from "fs/promises";
|
|
@@ -3,16 +3,16 @@ import {
|
|
|
3
3
|
Sys,
|
|
4
4
|
Module,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-q6ft9fkc.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-50wb2a26.js";
|
|
9
9
|
import {
|
|
10
10
|
renderPrimitiveReport
|
|
11
|
-
} from "./index-
|
|
12
|
-
import"./index-
|
|
11
|
+
} from "./index-h9ht6s60.js";
|
|
12
|
+
import"./index-g38nhv87.js";
|
|
13
13
|
import {
|
|
14
14
|
ModuleScript
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-f4e08ptp.js";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/cli/module/module.command.ts
|
|
18
18
|
import { Logger, lowerlize } from "akanjs/common";
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
Pkg,
|
|
4
4
|
Workspace,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-q6ft9fkc.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-50wb2a26.js";
|
|
9
9
|
import"./index-2ahj896a.js";
|
|
10
10
|
import {
|
|
11
11
|
PackageScript
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-3xmzr1p1.js";
|
|
13
13
|
|
|
14
14
|
// pkgs/@akanjs/cli/package/package.command.ts
|
|
15
15
|
class PackageCommand extends command("package", [PackageScript], ({ public: target }) => ({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.2",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@earendil-works/pi-tui": "0.86.1",
|
|
40
40
|
"@inquirer/prompts": "^8.4.3",
|
|
41
41
|
"@tailwindcss/node": "^4.3.0",
|
|
42
|
-
"akanjs": "3.0.
|
|
42
|
+
"akanjs": "3.0.2",
|
|
43
43
|
"chalk": "^5.6.2",
|
|
44
44
|
"commander": "^14.0.3",
|
|
45
45
|
"dayjs": "^1.11.20",
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
App,
|
|
4
4
|
Module,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-q6ft9fkc.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-50wb2a26.js";
|
|
9
9
|
import {
|
|
10
10
|
PageScript
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-g38nhv87.js";
|
|
12
12
|
|
|
13
13
|
// pkgs/@akanjs/cli/page/page.command.ts
|
|
14
14
|
class PageCommand extends command("page", [PageScript], ({ public: target }) => ({
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Workspace,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-q6ft9fkc.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-50wb2a26.js";
|
|
8
8
|
import {
|
|
9
9
|
renderPrimitiveReport
|
|
10
|
-
} from "./index-
|
|
11
|
-
import"./index-
|
|
12
|
-
import"./index-
|
|
10
|
+
} from "./index-h9ht6s60.js";
|
|
11
|
+
import"./index-g38nhv87.js";
|
|
12
|
+
import"./index-f4e08ptp.js";
|
|
13
13
|
import {
|
|
14
14
|
PrimitiveScript
|
|
15
|
-
} from "./index-
|
|
15
|
+
} from "./index-6keyf4sg.js";
|
|
16
16
|
|
|
17
17
|
// pkgs/@akanjs/cli/primitive/primitive.command.ts
|
|
18
18
|
import { Logger } from "akanjs/common";
|
|
@@ -3,14 +3,15 @@ import {
|
|
|
3
3
|
Workspace,
|
|
4
4
|
script,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-q6ft9fkc.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
8
|
import {
|
|
9
9
|
rootAllowedFiles,
|
|
10
10
|
rootAllowedDirs,
|
|
11
11
|
isAllowedLibFacetRootFile,
|
|
12
|
+
facetIndexShadowOf,
|
|
12
13
|
rootEntryHintOf
|
|
13
|
-
} from "./index-
|
|
14
|
+
} from "./index-50wb2a26.js";
|
|
14
15
|
|
|
15
16
|
// pkgs/@akanjs/devkit/qualityScanner.ts
|
|
16
17
|
import { createHash } from "crypto";
|
|
@@ -505,6 +506,7 @@ var RULE_FIXES = {
|
|
|
505
506
|
"akan.layout.lib-root-file": "Move the file into a conventional lib folder (common, env, lib, page, private, public, srvkit, ui, or webkit).",
|
|
506
507
|
"akan.layout.lib-root-folder": "Move the folder's contents into a conventional lib folder (common, env, lib, page, private, public, srvkit, ui, or webkit) and delete it.",
|
|
507
508
|
"akan.layout.lib-facet-file": "Move the file into a domain module folder under lib/; keep the lib facet root limited to generated support facets.",
|
|
509
|
+
"akan.layout.facet-index-shadow": "Delete the hand-written index file and run akan sync; move a namespace it builds into <facet>/<Folder>/index.tsx.",
|
|
508
510
|
"akan.layout.module-ui-file": "Rename the file to an allowed module UI name, or move it to ui/ if it is not a module component.",
|
|
509
511
|
"akan.ssr.unnecessary-use-client": 'Delete the "use client" directive so the file renders on the server. If it exists only to wrap one client child, drop the wrapper and use the child directly.',
|
|
510
512
|
"akan.ssr.client-static-component": "Move the component to a server file \u2014 a <Model>.Unit.tsx / <Model>.View.tsx for a module, or a ui/ file with no directive \u2014 and reference it from the client file.",
|
|
@@ -642,6 +644,8 @@ class AkanQualityScanner {
|
|
|
642
644
|
continue;
|
|
643
645
|
if (declaration.kind === "interface" && allowedInterfaceNames.has(declaration.name))
|
|
644
646
|
continue;
|
|
647
|
+
if ((declaration.kind === "interface" || declaration.kind === "type") && !declaration.exported)
|
|
648
|
+
continue;
|
|
645
649
|
warnings.push(fileWarning("akan.file.class-export-global-declaration", "file", sourceFile.file, `Class export files should not declare top-level ${declaration.kind} "${declaration.name}". Move helpers to another file and import them.`, declaration.line));
|
|
646
650
|
}
|
|
647
651
|
return warnings;
|
|
@@ -699,6 +703,9 @@ class AkanQualityScanner {
|
|
|
699
703
|
if (!allowed)
|
|
700
704
|
warnings.push(fileWarning(`akan.layout.${type}-root-${kind}`, "layout", sourceFile.file, `Unexpected ${type} root ${kind} "${name}". ${rootEntryHintOf(type, name) ?? `Keep ${type} code in conventional ${type} folders.`}`));
|
|
701
705
|
}
|
|
706
|
+
const facetShadow = rootEntry?.isDir ? facetIndexShadowOf(sourceFile.file.split("/").slice(2).join("/")) : null;
|
|
707
|
+
if (facetShadow)
|
|
708
|
+
warnings.push(fileWarning("akan.layout.facet-index-shadow", "layout", sourceFile.file, `${path2.basename(sourceFile.file)} ${facetShadow}.`));
|
|
702
709
|
const libFacetFile = getLibFacetRootFile(sourceFile.file);
|
|
703
710
|
if (libFacetFile && !isAllowedLibFacetRootFile(libFacetFile))
|
|
704
711
|
warnings.push(fileWarning("akan.layout.lib-facet-file", "layout", sourceFile.file, `Unexpected lib facet root file "${libFacetFile}". Keep direct lib/ root files limited to generated support facets.`));
|
|
@@ -3,15 +3,15 @@ import {
|
|
|
3
3
|
Workspace,
|
|
4
4
|
script,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
6
|
+
} from "./index-q6ft9fkc.js";
|
|
7
7
|
import"./index-52w0fvh8.js";
|
|
8
|
-
import"./index-
|
|
8
|
+
import"./index-50wb2a26.js";
|
|
9
9
|
import"./index-hj6w4ka1.js";
|
|
10
|
-
import"./index-
|
|
11
|
-
import"./index-
|
|
10
|
+
import"./index-h9ht6s60.js";
|
|
11
|
+
import"./index-zyw622y1.js";
|
|
12
12
|
import {
|
|
13
13
|
RepairRunner
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-hp3stk1m.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/repair/repair.script.ts
|
|
17
17
|
import { Logger } from "akanjs/common";
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
import {
|
|
3
3
|
Sys,
|
|
4
4
|
command
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-q6ft9fkc.js";
|
|
6
6
|
import"./index-52w0fvh8.js";
|
|
7
|
-
import"./index-
|
|
7
|
+
import"./index-50wb2a26.js";
|
|
8
8
|
import {
|
|
9
9
|
renderPrimitiveReport
|
|
10
|
-
} from "./index-
|
|
10
|
+
} from "./index-h9ht6s60.js";
|
|
11
11
|
import {
|
|
12
12
|
ScalarScript
|
|
13
|
-
} from "./index-
|
|
13
|
+
} from "./index-cb6yc5mb.js";
|
|
14
14
|
|
|
15
15
|
// pkgs/@akanjs/cli/scalar/scalar.command.ts
|
|
16
16
|
import { Logger, lowerlize } from "akanjs/common";
|
|
@@ -11,18 +11,16 @@ import {
|
|
|
11
11
|
runner,
|
|
12
12
|
script,
|
|
13
13
|
command
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-q6ft9fkc.js";
|
|
15
15
|
import {
|
|
16
|
+
LibSource,
|
|
16
17
|
Executor,
|
|
17
18
|
WorkspaceExecutor,
|
|
18
19
|
AppExecutor
|
|
19
|
-
} from "./index-
|
|
20
|
+
} from "./index-50wb2a26.js";
|
|
20
21
|
import {
|
|
21
22
|
SlicePlanner
|
|
22
|
-
} from "./index-
|
|
23
|
-
import {
|
|
24
|
-
LibSource
|
|
25
|
-
} from "./index-bjwxs904.js";
|
|
23
|
+
} from "./index-50jjwg8y.js";
|
|
26
24
|
|
|
27
25
|
// pkgs/@akanjs/devkit/subspace.ts
|
|
28
26
|
import { mkdir, readdir, rename, rm } from "fs/promises";
|
|
@@ -716,7 +714,7 @@ class SubspaceRunner extends runner("subspace") {
|
|
|
716
714
|
if (!asked)
|
|
717
715
|
return { name: subspace.name, workspaceId, host, apps, libs: [], outcome: "cancelled", files: [] };
|
|
718
716
|
const { libs } = await subspace.slice();
|
|
719
|
-
const { CloudScript } = await import("./cloud.script-
|
|
717
|
+
const { CloudScript } = await import("./cloud.script-64gzba8r.js");
|
|
720
718
|
const { files } = await CommandContainer.get(CloudScript).uploadEnv(workspace, {
|
|
721
719
|
host,
|
|
722
720
|
workspaceId,
|
|
@@ -17,6 +17,21 @@ const excludedFilePattern = /(^index\.tsx?$|\.d\.ts$|\.(test|spec)\.(ts|tsx)$|\.
|
|
|
17
17
|
const pascalCasePattern = /^[A-Z][A-Za-z0-9]*$/;
|
|
18
18
|
const camelCasePattern = /^[a-z][A-Za-z0-9]*$/;
|
|
19
19
|
const nameCasePatternForFacet = (facet: string) => (facet === "ui" ? pascalCasePattern : camelCasePattern);
|
|
20
|
+
//? Biome's organizeImports order, or `akan lint` reorders the barrel: A < a < B < b, a digit before a letter, and a
|
|
21
|
+
//? run of digits compared by its length first. DevGeneratedIndexSync sorts the same way.
|
|
22
|
+
const letterRankOf = (char: string) => char.toLowerCase().charCodeAt(0) * 2 + (char === char.toLowerCase() ? 1 : 0);
|
|
23
|
+
const digitRunAt = (name: string, idx: number) => /^\d+/.exec(name.slice(idx))?.[0] ?? "";
|
|
24
|
+
const compareExportNames = (a: string, b: string) => {
|
|
25
|
+
for (let idx = 0; idx < a.length && idx < b.length; ) {
|
|
26
|
+
const [runA, runB] = [digitRunAt(a, idx), digitRunAt(b, idx)];
|
|
27
|
+
if (runA && runB && runA !== runB) return runA.length - runB.length || (runA < runB ? -1 : 1);
|
|
28
|
+
if (runA && runB) idx += runA.length;
|
|
29
|
+
else if (runA || runB) return runA ? -1 : 1;
|
|
30
|
+
else if (a.charAt(idx) !== b.charAt(idx)) return letterRankOf(a.charAt(idx)) - letterRankOf(b.charAt(idx));
|
|
31
|
+
else idx++;
|
|
32
|
+
}
|
|
33
|
+
return a.length - b.length;
|
|
34
|
+
};
|
|
20
35
|
|
|
21
36
|
export default async function getContent(scanInfo: AppInfo | LibInfo | null, dict: Dict = {}, options: Options = {}) {
|
|
22
37
|
const { exec, facet } = options;
|
|
@@ -31,11 +46,11 @@ export default async function getContent(scanInfo: AppInfo | LibInfo | null, dic
|
|
|
31
46
|
...dirs.filter((dirname) => !dirname.startsWith(".")),
|
|
32
47
|
]
|
|
33
48
|
.filter((name) => nameCasePattern.test(name))
|
|
34
|
-
.sort();
|
|
49
|
+
.sort(compareExportNames);
|
|
35
50
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
};
|
|
51
|
+
//? Not null: a null result writes nothing, so a barrel still exporting a deleted file would outlive the file.
|
|
52
|
+
const content = exportNames.length
|
|
53
|
+
? `${exportNames.map((name) => `export * from "./${name}";`).join("\n")}\n`
|
|
54
|
+
: "export {};\n";
|
|
55
|
+
return { filename: "index.ts", content };
|
|
41
56
|
}
|
package/templates/lib/dict.ts
CHANGED
|
@@ -7,8 +7,16 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
|
|
|
7
7
|
const scalarModules = scanInfo.getScalarModules();
|
|
8
8
|
const serviceModules = scanInfo.getServiceModules();
|
|
9
9
|
const libs = scanInfo.getLibs();
|
|
10
|
+
const dictionaryImports = [
|
|
11
|
+
"makeDictionary",
|
|
12
|
+
"makeTrans",
|
|
13
|
+
...(scalarModules.length ? ["registerScalarTrans"] : []),
|
|
14
|
+
...(serviceModules.length ? ["registerServiceTrans"] : []),
|
|
15
|
+
...(databaseModules.length ? ["registerModelTrans"] : []),
|
|
16
|
+
...(libs.length ? [] : ["dictionary as base"]),
|
|
17
|
+
];
|
|
10
18
|
return `
|
|
11
|
-
import {
|
|
19
|
+
import { ${dictionaryImports.join(", ")} } from "akanjs/dictionary";
|
|
12
20
|
${libs.length ? libs.map((lib) => `import { dictionary as ${lib} } from "@libs/${lib}/lib/dict";`).join("\n") : ""}
|
|
13
21
|
|
|
14
22
|
${databaseModules.map((module) => `import * as ${module} from "./${module}/${module}.dictionary";`).join("\n")}
|
package/templates/lib/srv.ts
CHANGED
|
@@ -12,15 +12,14 @@ export default function getContent(scanInfo: AppInfo | LibInfo | null, dict: { [
|
|
|
12
12
|
.map(([module]) => module);
|
|
13
13
|
const libs = scanInfo.getLibs();
|
|
14
14
|
return `
|
|
15
|
-
import { ServiceModel } from "akanjs/service";
|
|
15
|
+
${databaseModules.length || serviceModules.length ? 'import { ServiceModel } from "akanjs/service";' : ""}
|
|
16
16
|
${
|
|
17
17
|
libs.length
|
|
18
18
|
? libs.map((lib) => `import * as ${lib} from "@libs/${lib}/lib/option";`).join("\n")
|
|
19
19
|
: 'import type { BackendEnv } from "akanjs/base";'
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
import * as cnst from "./cnst";
|
|
23
|
-
import * as db from "./db";
|
|
22
|
+
${databaseModules.length ? 'import * as cnst from "./cnst";\nimport * as db from "./db";' : ""}
|
|
24
23
|
|
|
25
24
|
${databaseModules.map((module) => `import { ${capitalize(module)}Service } from "./${module}/${module}.service";`).join("\n")}
|
|
26
25
|
${serviceModules.map((module) => `import { ${capitalize(module)}Service } from "./_${module}/${module}.service";`).join("\n")}
|