@akanjs/cli 3.0.0-alpha.84 → 3.0.0-alpha.85
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/{abstractCompactor-pwc6d6yk.js → abstractCompactor-gp3kwz7x.js} +2 -1
- package/{agent.command-180hh0ye.js → agent.command-dzys24ee.js} +7 -5
- package/{application.command-4fq5pmdd.js → application.command-m96rteme.js} +7 -5
- package/{applicationBuildRunner-tavpx3fv.js → applicationBuildRunner-d95dswfy.js} +5 -4
- package/{applicationReleasePackager-ktjt0erc.js → applicationReleasePackager-3cnjss29.js} +1 -1
- package/buildBatch.proc.js +4 -2
- package/{capacitorApp-kwa67kzs.js → capacitorApp-zrj7q1z4.js} +4 -2
- package/{cloud.command-wm3mtfve.js → cloud.command-eng6hqd4.js} +11 -9
- package/{context.command-dk2m2sjx.js → context.command-s96e60h6.js} +15 -13
- package/{guideline.command-w6ddv13r.js → guideline.command-0raa8ng7.js} +5 -3
- package/guidelines/conventions/conventions.instruction.md +9 -0
- package/incrementalBuilder.proc.js +3 -1
- package/{index-b2nt0w0k.js → index-1q83gs77.js} +1 -1
- package/index-5es51p0n.js +66 -0
- package/index-7nr23j55.js +344 -0
- package/{index-z3c9mmw4.js → index-7vvqsanf.js} +1 -1
- package/{index-qcracvc9.js → index-aknp5f6x.js} +3 -3
- package/{index-k86zc21w.js → index-azkj85kx.js} +7 -7
- package/{index-k1n0h7dk.js → index-c6rfvayh.js} +73 -472
- package/{index-a8h184wr.js → index-cnfawb2y.js} +2 -2
- package/{index-1tgp56ke.js → index-fqwtcy9j.js} +6 -6
- package/{index-dq6wq1tv.js → index-ktkm3ht3.js} +10 -10
- package/{index-1kzsn94d.js → index-ktnvnp7h.js} +1 -1
- package/{index-saheq2bs.js → index-md3wv29p.js} +1 -1
- package/{index-wet2ytnr.js → index-mr9b7nkd.js} +1 -1
- package/{index-ft1sfjz0.js → index-n0x82fhs.js} +1 -1
- package/{index-v0s24t8j.js → index-nf4zam3r.js} +3 -3
- package/{index-cd5x18qh.js → index-nr8w8h7y.js} +4 -4
- package/{index-ypvdw8nr.js → index-q2xqmbcq.js} +8 -8
- package/{index-5n0hf8r9.js → index-rna7cj75.js} +3 -3
- package/{index-m9c7k0gm.js → index-sc7s8927.js} +1 -1
- package/{index-5y7qba1c.js → index-vfwdwq5c.js} +2 -2
- package/{index-j9vnq8tr.js → index-y429w5m5.js} +3 -3
- package/{index-m7e0f1sy.js → index-yagad3ht.js} +8 -8
- package/{index-xxe90kqy.js → index-zp8y6zbb.js} +2 -2
- package/index.js +21 -19
- package/{library.command-wpedct6c.js → library.command-9cv75y0z.js} +5 -3
- package/{localRegistry.command-gk773cte.js → localRegistry.command-csgtnbb1.js} +10 -8
- package/{module.command-8n4kct3e.js → module.command-jafd05sa.js} +8 -6
- package/{package.command-fcbd0b1d.js → package.command-1kmswspp.js} +5 -3
- package/package.json +2 -2
- package/{page.command-x4379grq.js → page.command-p186hd45.js} +5 -3
- package/{primitive.command-8etmnqhq.js → primitive.command-a5w19jdg.js} +9 -7
- package/{quality.command-hfx7z8yr.js → quality.command-gcxmxqss.js} +4 -2
- package/{repair.command-j0fs5qkz.js → repair.command-z642bc2h.js} +7 -5
- package/{scalar.command-2emk89eh.js → scalar.command-9hgcdztr.js} +7 -5
- package/{subspace.command-nr32nm35.js → subspace.command-9x4nhzn2.js} +5 -3
- package/templates/workspaceRoot/.gitignore.template +2 -1
- package/templates/workspaceRoot/.husky/pre-commit.template +6 -1
- package/templates/workspaceRoot/biome.json.template +1 -1
- package/{workflow.command-cvpmzwjg.js → workflow.command-camcqd0s.js} +12 -10
- package/{workspace.command-4ztb4fdh.js → workspace.command-n1nvp28s.js} +91 -50
- package/templates/workspaceRoot/.husky/biome.precommit.json.template +0 -10
|
@@ -4,19 +4,21 @@ import {
|
|
|
4
4
|
runner,
|
|
5
5
|
script,
|
|
6
6
|
command
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-n0x82fhs.js";
|
|
8
8
|
import {
|
|
9
9
|
Executor,
|
|
10
10
|
WorkspaceExecutor,
|
|
11
11
|
AppExecutor
|
|
12
|
-
} from "./index-
|
|
12
|
+
} from "./index-c6rfvayh.js";
|
|
13
|
+
import"./index-7nr23j55.js";
|
|
13
14
|
import {
|
|
14
15
|
FileSys
|
|
15
16
|
} from "./index-ayy5ecax.js";
|
|
16
17
|
import"./index-6wwzs1bc.js";
|
|
18
|
+
import"./index-5es51p0n.js";
|
|
17
19
|
import {
|
|
18
20
|
SlicePlanner
|
|
19
|
-
} from "./index-
|
|
21
|
+
} from "./index-sc7s8927.js";
|
|
20
22
|
import {
|
|
21
23
|
LibSource
|
|
22
24
|
} from "./index-3d9y066c.js";
|
|
@@ -11,6 +11,11 @@ LINT_FILES=$(echo "$FILES" | grep -E '(\.ts|\.tsx)$' || true)
|
|
|
11
11
|
echo "Checking commit files with Biome..."
|
|
12
12
|
# Run Biome autofix if there are lint files. Any remaining errors fail the commit.
|
|
13
13
|
if [ -n "$LINT_FILES" ]; then
|
|
14
|
-
|
|
14
|
+
# biome.json leaves the type- and project-aware domains off so the editor never builds those graphs on save.
|
|
15
|
+
# This throwaway config puts them back for the commit; it lands in the workspace root because Biome resolves
|
|
16
|
+
# plugin paths from the config's own directory, and is removed on exit.
|
|
17
|
+
STRICT_CONFIG=$(bun node_modules/@akanjs/devkit/biomeStrictConfig.ts)
|
|
18
|
+
trap 'rm -f "$STRICT_CONFIG"' EXIT
|
|
19
|
+
echo "$LINT_FILES" | xargs ./node_modules/.bin/biome check --write --config-path="$STRICT_CONFIG" --no-errors-on-unmatched --diagnostic-level=error
|
|
15
20
|
echo "$LINT_FILES" | xargs git add --
|
|
16
21
|
fi
|
|
@@ -3,30 +3,32 @@ import {
|
|
|
3
3
|
Workspace,
|
|
4
4
|
script,
|
|
5
5
|
command
|
|
6
|
-
} from "./index-
|
|
7
|
-
import"./index-
|
|
6
|
+
} from "./index-n0x82fhs.js";
|
|
7
|
+
import"./index-c6rfvayh.js";
|
|
8
|
+
import"./index-7nr23j55.js";
|
|
8
9
|
import"./index-ayy5ecax.js";
|
|
9
10
|
import"./index-6wwzs1bc.js";
|
|
11
|
+
import"./index-5es51p0n.js";
|
|
10
12
|
import {
|
|
11
13
|
createWorkflowStepRegistry
|
|
12
|
-
} from "./index-
|
|
13
|
-
import"./index-
|
|
14
|
+
} from "./index-md3wv29p.js";
|
|
15
|
+
import"./index-mr9b7nkd.js";
|
|
14
16
|
import {
|
|
15
17
|
ModuleScript
|
|
16
|
-
} from "./index-
|
|
17
|
-
import"./index-
|
|
18
|
+
} from "./index-azkj85kx.js";
|
|
19
|
+
import"./index-ktnvnp7h.js";
|
|
18
20
|
import"./index-h7yw2z9n.js";
|
|
19
21
|
import {
|
|
20
22
|
PrimitiveScript
|
|
21
|
-
} from "./index-
|
|
23
|
+
} from "./index-nr8w8h7y.js";
|
|
22
24
|
import {
|
|
23
25
|
ScalarScript
|
|
24
|
-
} from "./index-
|
|
26
|
+
} from "./index-nf4zam3r.js";
|
|
25
27
|
import"./index-by5gpp8x.js";
|
|
26
|
-
import"./index-
|
|
28
|
+
import"./index-vfwdwq5c.js";
|
|
27
29
|
import {
|
|
28
30
|
WorkflowRunner
|
|
29
|
-
} from "./index-
|
|
31
|
+
} from "./index-y429w5m5.js";
|
|
30
32
|
|
|
31
33
|
// pkgs/@akanjs/cli/workflow/workflow.script.ts
|
|
32
34
|
import { Logger } from "akanjs/common";
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
} from "./index-ayy5ecax.js";
|
|
5
5
|
import {
|
|
6
6
|
GlobalConfig
|
|
7
|
-
} from "./index-
|
|
7
|
+
} from "./index-mr9b7nkd.js";
|
|
8
8
|
import {
|
|
9
9
|
Exec,
|
|
10
10
|
Workspace,
|
|
11
11
|
runner,
|
|
12
12
|
script,
|
|
13
13
|
command
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-n0x82fhs.js";
|
|
15
15
|
import {
|
|
16
16
|
extractAgentBlock,
|
|
17
17
|
collectScopeRecipeSources,
|
|
@@ -21,8 +21,10 @@ import {
|
|
|
21
21
|
AppExecutor,
|
|
22
22
|
LibExecutor,
|
|
23
23
|
PkgExecutor
|
|
24
|
-
} from "./index-
|
|
24
|
+
} from "./index-c6rfvayh.js";
|
|
25
|
+
import"./index-7nr23j55.js";
|
|
25
26
|
import"./index-6wwzs1bc.js";
|
|
27
|
+
import"./index-5es51p0n.js";
|
|
26
28
|
import {
|
|
27
29
|
countBlocking,
|
|
28
30
|
formatStyleContract,
|
|
@@ -32,47 +34,85 @@ import {
|
|
|
32
34
|
collectRecipeSources2,
|
|
33
35
|
scanRecipes2
|
|
34
36
|
} from "./index-by5gpp8x.js";
|
|
35
|
-
import"./index-
|
|
36
|
-
import"./index-
|
|
37
|
+
import"./index-md3wv29p.js";
|
|
38
|
+
import"./index-vfwdwq5c.js";
|
|
37
39
|
import"./index-h7yw2z9n.js";
|
|
38
40
|
import {
|
|
39
41
|
AgentScript
|
|
40
|
-
} from "./index-
|
|
42
|
+
} from "./index-rna7cj75.js";
|
|
41
43
|
import {
|
|
42
44
|
ApplicationScript
|
|
43
|
-
} from "./index-
|
|
45
|
+
} from "./index-yagad3ht.js";
|
|
44
46
|
import {
|
|
45
47
|
LibraryScript
|
|
46
|
-
} from "./index-
|
|
48
|
+
} from "./index-zp8y6zbb.js";
|
|
47
49
|
import"./index-ctphds8v.js";
|
|
48
50
|
import"./index-mfm35dhh.js";
|
|
49
51
|
import {
|
|
50
52
|
PackageScript
|
|
51
|
-
} from "./index-
|
|
53
|
+
} from "./index-cnfawb2y.js";
|
|
52
54
|
import {
|
|
53
55
|
getNpmRegistryUrl,
|
|
54
56
|
getLatestPackageVersion
|
|
55
|
-
} from "./index-
|
|
57
|
+
} from "./index-fqwtcy9j.js";
|
|
56
58
|
import {
|
|
57
59
|
CloudScript
|
|
58
|
-
} from "./index-
|
|
60
|
+
} from "./index-q2xqmbcq.js";
|
|
59
61
|
import {
|
|
60
62
|
ContextScript
|
|
61
|
-
} from "./index-
|
|
62
|
-
import"./index-
|
|
63
|
-
import"./index-
|
|
64
|
-
import"./index-
|
|
65
|
-
import"./index-
|
|
66
|
-
import"./index-
|
|
67
|
-
import"./index-
|
|
68
|
-
import"./index-
|
|
69
|
-
import"./index-
|
|
63
|
+
} from "./index-ktkm3ht3.js";
|
|
64
|
+
import"./index-1q83gs77.js";
|
|
65
|
+
import"./index-aknp5f6x.js";
|
|
66
|
+
import"./index-y429w5m5.js";
|
|
67
|
+
import"./index-azkj85kx.js";
|
|
68
|
+
import"./index-ktnvnp7h.js";
|
|
69
|
+
import"./index-nr8w8h7y.js";
|
|
70
|
+
import"./index-nf4zam3r.js";
|
|
71
|
+
import"./index-sc7s8927.js";
|
|
70
72
|
|
|
71
73
|
// pkgs/@akanjs/cli/workspace/workspace.runner.ts
|
|
72
|
-
import
|
|
74
|
+
import path2 from "path";
|
|
73
75
|
|
|
74
76
|
// pkgs/@akanjs/devkit/biomeBase.ts
|
|
75
|
-
var
|
|
77
|
+
var biomeBaseConfig = "@akanjs/devkit/biome.base.json";
|
|
78
|
+
var biomeDomainsConfig = "@akanjs/devkit/biome.domains.json";
|
|
79
|
+
var biomeVersion = "2.5.12";
|
|
80
|
+
|
|
81
|
+
// pkgs/@akanjs/devkit/biomeStrictConfig.ts
|
|
82
|
+
import { rm } from "fs/promises";
|
|
83
|
+
import path from "path";
|
|
84
|
+
class BiomeStrictConfig {
|
|
85
|
+
static configFileNames = ["biome.json", "biome.jsonc"];
|
|
86
|
+
static async resolveConfigName(workspaceRoot) {
|
|
87
|
+
for (const fileName of BiomeStrictConfig.configFileNames) {
|
|
88
|
+
if (await Bun.file(path.join(workspaceRoot, fileName)).exists())
|
|
89
|
+
return fileName;
|
|
90
|
+
}
|
|
91
|
+
return null;
|
|
92
|
+
}
|
|
93
|
+
#filePath;
|
|
94
|
+
#workspaceRoot;
|
|
95
|
+
constructor(workspaceRoot, { id = process.pid } = {}) {
|
|
96
|
+
this.#workspaceRoot = workspaceRoot;
|
|
97
|
+
this.#filePath = path.join(workspaceRoot, `.biome.strict.${id}.json`);
|
|
98
|
+
}
|
|
99
|
+
get filePath() {
|
|
100
|
+
return this.#filePath;
|
|
101
|
+
}
|
|
102
|
+
async write() {
|
|
103
|
+
const configName = await BiomeStrictConfig.resolveConfigName(this.#workspaceRoot);
|
|
104
|
+
if (!configName)
|
|
105
|
+
return null;
|
|
106
|
+
const config = { extends: [biomeBaseConfig, `./${configName}`, biomeDomainsConfig] };
|
|
107
|
+
await Bun.write(this.#filePath, `${JSON.stringify(config, null, 2)}
|
|
108
|
+
`);
|
|
109
|
+
return this.#filePath;
|
|
110
|
+
}
|
|
111
|
+
async remove() {
|
|
112
|
+
await rm(this.#filePath, { force: true });
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
if (false) {}
|
|
76
116
|
|
|
77
117
|
// pkgs/@akanjs/cli/workspace/workspace.runner.ts
|
|
78
118
|
var defaultWorkspacePeerDependencies = new Set([
|
|
@@ -128,7 +168,7 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
128
168
|
owner = ""
|
|
129
169
|
}) {
|
|
130
170
|
const cwdPath = process.cwd();
|
|
131
|
-
const workspaceRoot =
|
|
171
|
+
const workspaceRoot = path2.join(cwdPath, dirname, repoName);
|
|
132
172
|
const normalizedRegistryUrl = registryUrl ? getNpmRegistryUrl(registryUrl) : undefined;
|
|
133
173
|
const workspace = WorkspaceExecutor.fromRoot({ workspaceRoot, repoName });
|
|
134
174
|
const templateSpinner = workspace.spinning(`Creating workspace template files in ${dirname}/${repoName}...`);
|
|
@@ -181,9 +221,9 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
181
221
|
}
|
|
182
222
|
async#getCliPackageJson() {
|
|
183
223
|
const packageJsonCandidates = [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
224
|
+
path2.join(import.meta.dir, "../package.json"),
|
|
225
|
+
path2.join(import.meta.dir, "package.json"),
|
|
226
|
+
path2.join(path2.dirname(Bun.main), "package.json")
|
|
187
227
|
];
|
|
188
228
|
try {
|
|
189
229
|
packageJsonCandidates.unshift(Bun.resolveSync("@akanjs/cli/package.json", import.meta.dir));
|
|
@@ -199,9 +239,9 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
199
239
|
}
|
|
200
240
|
async#getAkanPackageJson() {
|
|
201
241
|
const packageJsonCandidates = [
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
242
|
+
path2.join(import.meta.dir, "../../../akanjs/package.json"),
|
|
243
|
+
path2.join(process.cwd(), "pkgs/akanjs/package.json"),
|
|
244
|
+
path2.join(path2.dirname(Bun.main), "node_modules/akanjs/package.json")
|
|
205
245
|
];
|
|
206
246
|
try {
|
|
207
247
|
packageJsonCandidates.unshift(Bun.resolveSync("akanjs/package.json", import.meta.dir));
|
|
@@ -215,13 +255,13 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
215
255
|
}
|
|
216
256
|
let current = import.meta.dir;
|
|
217
257
|
for (let depth = 0;depth < 6; depth++) {
|
|
218
|
-
const packageJsonPath =
|
|
258
|
+
const packageJsonPath = path2.join(current, "package.json");
|
|
219
259
|
if (await Bun.file(packageJsonPath).exists()) {
|
|
220
260
|
const packageJson = await FileSys.readJson(packageJsonPath);
|
|
221
261
|
if (packageJson.name === "akanjs")
|
|
222
262
|
return packageJson;
|
|
223
263
|
}
|
|
224
|
-
const parent =
|
|
264
|
+
const parent = path2.dirname(current);
|
|
225
265
|
if (parent === current)
|
|
226
266
|
break;
|
|
227
267
|
current = parent;
|
|
@@ -229,26 +269,27 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
229
269
|
throw new Error(`[workspace] failed to locate akanjs package.json from ${import.meta.dir}`);
|
|
230
270
|
}
|
|
231
271
|
async lint(exec, workspace, { fix = true, maxDiagnostics = defaultMaxDiagnostics } = {}) {
|
|
232
|
-
const
|
|
233
|
-
await
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
272
|
+
const strictConfig = new BiomeStrictConfig(workspace.workspaceRoot);
|
|
273
|
+
const configPath = await strictConfig.write();
|
|
274
|
+
try {
|
|
275
|
+
await workspace.spawn("./node_modules/.bin/biome", [
|
|
276
|
+
"check",
|
|
277
|
+
...fix ? ["--write"] : [],
|
|
278
|
+
"--no-errors-on-unmatched",
|
|
279
|
+
`--max-diagnostics=${maxDiagnostics > 0 ? maxDiagnostics : "none"}`,
|
|
280
|
+
...configPath ? ["--config-path", configPath] : [],
|
|
281
|
+
exec.cwdPath
|
|
282
|
+
]);
|
|
283
|
+
} finally {
|
|
284
|
+
await strictConfig.remove();
|
|
285
|
+
}
|
|
241
286
|
await this.#enforceStyleContract(exec);
|
|
242
287
|
await this.#enforceRecipeGate(exec);
|
|
243
288
|
await this.#enforceAgentsIndex(exec);
|
|
244
289
|
}
|
|
245
290
|
static async resolveBiomeConfigPath(workspace) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
if (await Bun.file(configPath).exists())
|
|
249
|
-
return configPath;
|
|
250
|
-
}
|
|
251
|
-
return null;
|
|
291
|
+
const fileName = await BiomeStrictConfig.resolveConfigName(workspace.workspaceRoot);
|
|
292
|
+
return fileName ? path2.join(workspace.workspaceRoot, fileName) : null;
|
|
252
293
|
}
|
|
253
294
|
async#enforceAgentsIndex(exec) {
|
|
254
295
|
if (!(exec instanceof SysExecutor))
|
|
@@ -267,7 +308,7 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
267
308
|
const cwdPath = exec.cwdPath;
|
|
268
309
|
if (!cwdPath)
|
|
269
310
|
return;
|
|
270
|
-
const uiDir =
|
|
311
|
+
const uiDir = path2.join(cwdPath, "ui");
|
|
271
312
|
const sources = [
|
|
272
313
|
...await collectRecipeSources2(uiDir, "ui/Recipe"),
|
|
273
314
|
...await collectRecipeSources2(uiDir, "ui/recipe", "recipe")
|
|
@@ -284,7 +325,7 @@ class WorkspaceRunner extends runner("workspace") {
|
|
|
284
325
|
const cwdPath = exec.cwdPath;
|
|
285
326
|
if (!cwdPath)
|
|
286
327
|
return;
|
|
287
|
-
const stylesCssPath =
|
|
328
|
+
const stylesCssPath = path2.join(cwdPath, "page", "styles.css");
|
|
288
329
|
if (!await Bun.file(stylesCssPath).exists())
|
|
289
330
|
return;
|
|
290
331
|
const violations = {
|
|
@@ -320,7 +361,7 @@ AKAN_PUBLIC_LOG_LEVEL=debug
|
|
|
320
361
|
}
|
|
321
362
|
|
|
322
363
|
// pkgs/@akanjs/cli/workspace/workspace.script.ts
|
|
323
|
-
import
|
|
364
|
+
import path3 from "path";
|
|
324
365
|
import { Logger } from "akanjs/common";
|
|
325
366
|
class WorkspaceScript extends script("workspace", [
|
|
326
367
|
WorkspaceRunner,
|
|
@@ -370,7 +411,7 @@ class WorkspaceScript extends script("workspace", [
|
|
|
370
411
|
} catch (_) {
|
|
371
412
|
gitSpinner.fail("Git repository initialization failed. It's not fatal, you can commit manually");
|
|
372
413
|
}
|
|
373
|
-
const workspacePath =
|
|
414
|
+
const workspacePath = path3.join(dirname, repoName);
|
|
374
415
|
Logger.rawLog(`
|
|
375
416
|
\uD83C\uDF89 Welcome aboard! Workspace created in ${dirname}/${repoName}`);
|
|
376
417
|
Logger.rawLog(`\uD83D\uDE80 Run \`cd ${workspacePath} && akan start ${appName}\` to start the development server.`);
|