@akanjs/cli 3.0.0-beta.2 → 3.0.0-beta.20
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-awv258wb.js +9 -0
- package/CodeAgentRpcHost-p7h6n2hp.js +7 -0
- package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
- package/CodeTui-1nqh35ez.js +1457 -0
- package/README.md +3 -0
- package/TunnelShare-scf4e4pd.js +9 -0
- package/{agent.command-d2gfxfck.js → agent.command-1s9ag7sb.js} +8 -9
- package/akanCode.js +102 -0
- package/{application.command-pj2m7584.js → application.command-49hwy6va.js} +51 -78
- package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-ybyp97pv.js} +63 -64
- package/{applicationReleasePackager-4yasxwv9.js → applicationReleasePackager-esnrphw8.js} +40 -60
- package/buildBatch.proc.js +19 -24
- package/{capacitorApp-36rbr858.js → capacitorApp-1synz4en.js} +3 -4
- package/cloud.command-d7rqtzt9.js +94 -0
- package/cloud.script-bkbpcr96.js +19 -0
- package/code.command-nn48xzej.js +154 -0
- package/commandManifest.json +1 -1
- package/consoleToStderr-h5bryj94.js +7 -0
- package/context.command-s3mcmvpa.js +48 -0
- package/context.runner-k99nb5pk.js +21 -0
- package/{dependencyScanner-shs82ynp.js → dependencyScanner-ye2e6pdz.js} +2 -2
- package/{devTui-40ggmd99.js → devTui-q7k7bakd.js} +122 -40
- package/fileSys-5ngz93ga.js +9 -0
- package/guideline.command-sct4qnt5.js +42 -0
- package/guidelines/agentRule/agentRule.instruction.md +206 -25
- package/guidelines/conventions/conventions.instruction.md +79 -24
- package/guidelines/fieldRule/fieldRule.instruction.md +1 -0
- package/guidelines/mcpRule/mcpRule.instruction.md +7 -5
- package/guidelines/queryRule/queryRule.instruction.md +17 -7
- package/guidelines/runtimeRule/runtimeRule.instruction.md +74 -0
- package/guidelines/ssrRule/ssrRule.instruction.md +4 -2
- package/guidelines/transportRule/transportRule.instruction.md +51 -0
- package/guidelines/workspaceRecipes/workspaceRecipes.instruction.md +66 -3
- package/incrementalBuilder.proc.js +31 -48
- package/{index-h7yw2z9n.js → index-0bq14vr1.js} +8 -14
- package/index-13ffe9wp.js +69 -0
- package/index-22d57v4c.js +266 -0
- package/{index-fz5q3gd7.js → index-31yr441d.js} +10 -17
- package/index-3hx1z96c.js +87 -0
- package/index-3sq321ak.js +53 -0
- package/{index-kcxmv48c.js → index-3t7g9e4r.js} +45 -79
- package/{index-q0y2jq9j.js → index-5b6tavv3.js} +6 -3
- package/{index-47pj3aee.js → index-5e0n4hqx.js} +11 -12
- package/{index-259dsnz3.js → index-5pc1qrbv.js} +5 -8
- package/index-7md2g9vw.js +6 -0
- package/index-8mna0947.js +187 -0
- package/{index-zry5nz81.js → index-8sf7wmdr.js} +51 -30
- package/{index-2tv3fdx4.js → index-9d9bgcx4.js} +342 -765
- package/index-9dp031by.js +12 -0
- package/{index-ne2qy0nk.js → index-ahemdr5n.js} +12 -12
- package/{index-ws5e0j51.js → index-as7xmyz8.js} +40 -24
- package/index-axzjaqve.js +1118 -0
- package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
- package/index-c6eggbee.js +123 -0
- package/index-d2242ksy.js +99 -0
- package/{index-a64esmtb.js → index-ddxvdd1p.js} +169 -305
- package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
- package/{index-pnqbkf5p.js → index-dzf3r49a.js} +6 -2
- package/{index-w8kmx1b6.js → index-fgq75haa.js} +198 -290
- package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
- package/{index-hwkygn9s.js → index-khpfpcsd.js} +302 -33
- package/{index-wt7qrtd4.js → index-mxav6j3c.js} +93 -232
- package/{index-gyd220p2.js → index-myhc3c1j.js} +554 -577
- package/{index-600zhnve.js → index-nv5976x3.js} +56 -197
- package/index-p6pbz9n5.js +25 -0
- package/{index-4edzf1gr.js → index-przybvy5.js} +77 -150
- package/index-smme4r47.js +49 -0
- package/{index-mak3cd28.js → index-w2zdcw3k.js} +137 -255
- package/index-wa5jbxj1.js +760 -0
- package/{index-v0qh106m.js → index-ww4z397j.js} +527 -723
- package/{index-j9yhg404.js → index-xqjwd384.js} +4 -7
- package/{index-7737gxcp.js → index-xqpzbab5.js} +107 -241
- package/index-xsjh6nzh.js +2729 -0
- package/{index-ktb5njgy.js → index-ygn77a5w.js} +47 -99
- package/index-ztp3e73t.js +700 -0
- package/index.js +23 -22
- package/{library.command-nbsky672.js → library.command-1gx04jgn.js} +4 -5
- package/{localRegistry.command-yeq57wjr.js → localRegistry.command-zndxj1q6.js} +22 -42
- package/{module.command-29vqzrh8.js → module.command-3waddk95.js} +8 -11
- package/{package.command-axv0abmn.js → package.command-zrc7br1y.js} +6 -7
- package/package.json +14 -5
- package/{page.command-vs9s3zrh.js → page.command-vpjgardh.js} +4 -5
- package/{primitive.command-cbxmqbtc.js → primitive.command-sz84tk4t.js} +9 -22
- package/prompter-ptaa3nk0.js +8 -0
- package/{quality.command-gmbs7nws.js → quality.command-g869hafs.js} +203 -376
- package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
- package/{repair.command-bqsjptsj.js → repair.command-chsnjvvv.js} +11 -35
- package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
- package/{scalar.command-6k1vhe9s.js → scalar.command-2v21newx.js} +7 -10
- package/skills/akan-code/SKILL.md +130 -0
- package/skills/akan-debug/SKILL.md +42 -0
- package/skills/akan-deps/SKILL.md +50 -0
- package/skills/akan-err/SKILL.md +39 -0
- package/skills/akan-module/SKILL.md +45 -0
- package/skills/akan-scaffold/SKILL.md +76 -0
- package/skills/akan-scalar/SKILL.md +52 -0
- package/skills/akan-service/SKILL.md +34 -0
- package/skills/akan-store/SKILL.md +67 -0
- package/skills/akan-ui/SKILL.md +63 -0
- package/skills/akan-validate/SKILL.md +44 -0
- package/{subspace.command-fwjfcts7.js → subspace.command-ckcbwfp1.js} +138 -67
- package/templates/__scalar/__model__/__model__.abstract.md.template +8 -0
- package/templates/appSample/lib/__scalar/workHistory/workHistory.abstract.ts +8 -39
- package/templates/appSample/lib/_noti/noti.abstract.ts +6 -29
- package/templates/appSample/lib/task/task.abstract.ts +12 -32
- package/templates/appSample/lib/task/task.signal.spec.ts +15 -18
- package/templates/appSample/lib/task/task.signal.test.ts +15 -1
- package/templates/appSample/lib/task/task.signal.ts +1 -1
- package/templates/appSample/srvkit/{AuthGuard.ts → guards.ts} +7 -4
- package/templates/appSample/srvkit/{SessionInternalArg.ts → internalArgs.ts} +6 -4
- package/templates/client.ts +7 -30
- package/templates/crudPages/[__model__Id]/edit/page.tsx +2 -1
- package/templates/crudPages/[__model__Id]/page.tsx +2 -1
- package/templates/crudPages/new/page.tsx +2 -1
- package/templates/crudPages/page.tsx +2 -1
- package/templates/crudSinglePage/page.tsx +2 -1
- package/templates/lib/__lib/lib.dictionary.ts +0 -2
- package/templates/lib/__lib/lib.document.ts +0 -2
- package/templates/lib/sig.ts +8 -30
- package/templates/localDev/docker-compose.yaml.template +3 -14
- package/templates/module/__model__.signal.ts +12 -4
- package/templates/pkgRoot/tsconfig.json.template +2 -7
- package/templates/server.ts +0 -2
- package/templates/service/__model__.abstract.md.template +8 -0
- package/tunnel.command-kd2yr4fx.js +129 -0
- package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/workflow.command-44252cqv.js +79 -0
- package/{workspace.command-8s050m0h.js → workspace.command-fqcztt5p.js} +77 -109
- package/abstractCompactor-mjh5ppsq.js +0 -101
- package/cloud.command-jshwdq22.js +0 -93
- package/context.command-ez8a0zyz.js +0 -80
- package/devTuiView-c08ccbat.js +0 -9
- package/getDirname-dr3jz1xg.js +0 -7
- package/guideline.command-xmqwx8zm.js +0 -359
- package/guidelines/agentRule/agentRule.generate.json +0 -31
- package/guidelines/componentRule/componentRule.generate.json +0 -31
- package/guidelines/conventions/conventions.generate.json +0 -25
- package/guidelines/cssRule/cssRule.generate.json +0 -31
- package/guidelines/docPageRule/docPageRule.generate.json +0 -31
- package/guidelines/docPageRule/docPageRule.instruction.md +0 -25
- package/guidelines/docSyncRule/docSyncRule.generate.json +0 -31
- package/guidelines/docSyncRule/docSyncRule.instruction.md +0 -25
- package/guidelines/enumConstant/enumConstant.generate.json +0 -31
- package/guidelines/enumConstant/enumConstant.instruction.md +0 -28
- package/guidelines/fieldRule/fieldRule.generate.json +0 -31
- package/guidelines/framework/framework.generate.json +0 -32
- package/guidelines/mcpRule/mcpRule.generate.json +0 -35
- package/guidelines/modelConstant/modelConstant.generate.json +0 -32
- package/guidelines/modelDictionary/modelDictionary.generate.json +0 -32
- package/guidelines/modelDocument/modelDocument.generate.json +0 -31
- package/guidelines/modelService/modelService.generate.json +0 -31
- package/guidelines/modelSignal/modelSignal.generate.json +0 -31
- package/guidelines/modelStore/modelStore.generate.json +0 -31
- package/guidelines/modelTemplate/modelTemplate.generate.json +0 -31
- package/guidelines/modelUnit/modelUnit.generate.json +0 -31
- package/guidelines/modelUtil/modelUtil.generate.json +0 -31
- package/guidelines/modelView/modelView.generate.json +0 -31
- package/guidelines/modelZone/modelZone.generate.json +0 -31
- package/guidelines/moduleCodegen/moduleCodegen.generate.json +0 -31
- package/guidelines/moduleCodegen/moduleCodegen.instruction.md +0 -28
- package/guidelines/moduleOverview/moduleOverview.generate.json +0 -31
- package/guidelines/queryRule/queryRule.generate.json +0 -31
- package/guidelines/recipeRule/recipeRule.generate.json +0 -31
- package/guidelines/runtimeRule/runtimeRule.generate.json +0 -25
- package/guidelines/scalarConstant/scalarConstant.generate.json +0 -32
- package/guidelines/scalarDictionary/scalarDictionary.generate.json +0 -32
- package/guidelines/scalarModule/scalarModule.generate.json +0 -31
- package/guidelines/sharedUiUsage/sharedUiUsage.generate.json +0 -31
- package/guidelines/sharedUiUsage/sharedUiUsage.instruction.md +0 -25
- package/guidelines/ssrRule/ssrRule.generate.json +0 -31
- package/guidelines/transportRule/transportRule.generate.json +0 -31
- package/guidelines/utilUiUsage/utilUiUsage.generate.json +0 -31
- package/guidelines/utilUiUsage/utilUiUsage.instruction.md +0 -25
- package/guidelines/workspaceOnboarding/workspaceOnboarding.generate.json +0 -24
- package/guidelines/workspaceRecipes/workspaceRecipes.generate.json +0 -33
- package/index-2hq52jq3.js +0 -465
- package/index-6wwzs1bc.js +0 -7
- package/index-8pm30m73.js +0 -841
- package/index-kn1h7p1x.js +0 -560
- package/index-meh558jy.js +0 -65
- package/index-rwg2aa4f.js +0 -229
- package/templates/__scalar/__model__/__model__.abstract.md +0 -28
- package/templates/module/__model__.abstract.md +0 -28
- package/templates/service/__model__.abstract.md +0 -28
- package/workflow.command-nwpcdc8p.js +0 -107
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// pkgs/@akanjs/cli/openBrowser.ts
|
|
3
|
+
import { spawn } from "child_process";
|
|
4
|
+
function openBrowser(url) {
|
|
5
|
+
const command = process.platform === "darwin" ? ["open", url] : process.platform === "win32" ? ["cmd", "/c", "start", "", url] : ["xdg-open", url];
|
|
6
|
+
const child = spawn(command[0], command.slice(1), { detached: true, stdio: "ignore" });
|
|
7
|
+
child.on("error", () => {});
|
|
8
|
+
child.unref();
|
|
9
|
+
return Promise.resolve();
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { openBrowser };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-w2zdcw3k.js";
|
|
6
6
|
import {
|
|
7
7
|
AGENT_BLOCK_START,
|
|
8
8
|
AGENT_BLOCK_END,
|
|
@@ -13,17 +13,17 @@ import {
|
|
|
13
13
|
CLAUDE_COMMENT_RULE,
|
|
14
14
|
AppExecutor,
|
|
15
15
|
LibExecutor
|
|
16
|
-
} from "./index-
|
|
16
|
+
} from "./index-9d9bgcx4.js";
|
|
17
17
|
import {
|
|
18
18
|
collectRecipeSources2,
|
|
19
19
|
scanRecipes2
|
|
20
|
-
} from "./index-
|
|
20
|
+
} from "./index-hj6w4ka1.js";
|
|
21
21
|
import {
|
|
22
22
|
AkanContextAnalyzer
|
|
23
|
-
} from "./index-
|
|
23
|
+
} from "./index-ygn77a5w.js";
|
|
24
24
|
import {
|
|
25
|
-
|
|
26
|
-
} from "./index-
|
|
25
|
+
Prompter2
|
|
26
|
+
} from "./index-0bq14vr1.js";
|
|
27
27
|
|
|
28
28
|
// pkgs/@akanjs/cli/agent/agent.script.ts
|
|
29
29
|
import { Logger as Logger2 } from "akanjs/common";
|
|
@@ -106,10 +106,10 @@ ${scopeIndexPointer}
|
|
|
106
106
|
`;
|
|
107
107
|
};
|
|
108
108
|
var renderGuides = async (context) => {
|
|
109
|
-
const conventions = (await
|
|
109
|
+
const conventions = (await Prompter2.getInstruction("conventions")).trim();
|
|
110
110
|
if (context.pkgs.some((pkg) => pkg.name === "akanjs"))
|
|
111
111
|
return conventions;
|
|
112
|
-
const onboarding = (await
|
|
112
|
+
const onboarding = (await Prompter2.getInstruction("workspaceOnboarding")).trim();
|
|
113
113
|
const appName = context.apps[0]?.name ?? "app";
|
|
114
114
|
return `${conventions}
|
|
115
115
|
|
|
@@ -117,7 +117,7 @@ ${onboarding.replaceAll("<%= appName %>", appName)}`;
|
|
|
117
117
|
};
|
|
118
118
|
var renderManagedBlock = async (workspace) => {
|
|
119
119
|
const context = await AkanContextAnalyzer.analyze(workspace);
|
|
120
|
-
const frameworkGuide = await
|
|
120
|
+
const frameworkGuide = await Prompter2.getInstruction("framework");
|
|
121
121
|
const appNames = context.apps.map((app) => app.name);
|
|
122
122
|
const sampleCleanup = await renderSampleCleanup(workspace, appNames);
|
|
123
123
|
const recipeIndex = await renderRecipeIndex(workspace);
|
|
@@ -126,7 +126,7 @@ var renderManagedBlock = async (workspace) => {
|
|
|
126
126
|
const block = `## Workspace
|
|
127
127
|
|
|
128
128
|
- Repo: ${context.repoName}
|
|
129
|
-
- Apps: ${
|
|
129
|
+
- Apps: ${appNames.join(", ") || "none"}
|
|
130
130
|
- Libraries: ${context.libs.map((lib) => lib.name).join(", ") || "none"}
|
|
131
131
|
- Packages: ${context.pkgs.map((pkg) => pkg.name).join(", ") || "none"}
|
|
132
132
|
|
|
@@ -138,7 +138,7 @@ ${sampleCleanup}## Akan Module Abstracts
|
|
|
138
138
|
- Update the abstract when business invariants, workflows, or public behavior change.
|
|
139
139
|
- Do not update the abstract for formatting-only, import-only, or style-only changes.
|
|
140
140
|
- Service modules live in \`lib/_<service>\`, but their abstract file is \`<service>.abstract.md\`.
|
|
141
|
-
- Keep an abstract short
|
|
141
|
+
- Keep an abstract short \u2014 the invariants the code cannot show, and nothing it already states. \`akan quality scan\` warns past 300 lines.
|
|
142
142
|
|
|
143
143
|
## Generated Files
|
|
144
144
|
|
|
@@ -148,7 +148,7 @@ If generated output is stale or broken, update the owning source file and run \`
|
|
|
148
148
|
${recipeIndex}## MCP Workflow Policy
|
|
149
149
|
|
|
150
150
|
- **Prefer an Akan workflow to a direct source edit.** A direct edit is denied when an allowlisted workflow or repair tool can make the change.
|
|
151
|
-
- Inspect with \`akan mcp --mode plan\` (\`list_workflows\`, \`explain_workflow\`, \`plan_workflow\`); apply with \`akan mcp --mode apply\`, which allowlists \`apply_workflow\`, \`run_validation\`, and the repair tools.
|
|
151
|
+
- Inspect with \`akan mcp --mode plan\` (\`list_workflows\`, \`explain_workflow\`, \`plan_workflow\`); apply with \`akan mcp --mode apply\`, which allowlists \`apply_workflow\`, \`run_validation\`, and three of the five repair tools \u2014 \`repair_generated\`, \`repair_imports\` and \`repair_module_shape\`. \`akan repair format\` and \`akan repair dictionary\` are CLI-only.
|
|
152
152
|
- If \`plan_workflow\` returns \`planPath\` or \`next.tool=apply_workflow\`, call \`apply_workflow({ planPath })\` before editing source. Then run \`run_validation\` with \`validationTarget\` when present, otherwise \`applyReportPath\`.
|
|
153
153
|
- Split a compound request into workflows and apply each \`planPath\` in order, such as \`create-module\` followed by \`add-field\`.
|
|
154
154
|
- When no workflow exists, or apply reports unsupported/no-op/failed diagnostics needing manual action, keep edits scoped to owning source files and never patch generated files directly.
|
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-w2zdcw3k.js";
|
|
6
6
|
import {
|
|
7
|
-
|
|
8
|
-
} from "./index-
|
|
7
|
+
FileSys2
|
|
8
|
+
} from "./index-5b6tavv3.js";
|
|
9
9
|
import {
|
|
10
10
|
PkgExecutor
|
|
11
|
-
} from "./index-
|
|
11
|
+
} from "./index-9d9bgcx4.js";
|
|
12
12
|
import {
|
|
13
13
|
TypeScriptDependencyScanner2
|
|
14
|
-
} from "./index-
|
|
14
|
+
} from "./index-3t7g9e4r.js";
|
|
15
15
|
|
|
16
16
|
// pkgs/@akanjs/cli/package/package.runner.ts
|
|
17
17
|
import path2 from "path";
|
|
@@ -112,7 +112,7 @@ class PackageRunner extends runner("package") {
|
|
|
112
112
|
"create-akan-workspace"
|
|
113
113
|
];
|
|
114
114
|
async version(workspace, { log = true } = {}) {
|
|
115
|
-
const pkgJson = process.env.USE_AKANJS_PKGS === "true" ? await
|
|
115
|
+
const pkgJson = process.env.USE_AKANJS_PKGS === "true" ? await FileSys2.readJson(`${workspace?.workspaceRoot ?? process.cwd()}/pkgs/akanjs/package.json`) : await this.#getInstalledPackageJson();
|
|
116
116
|
const version = pkgJson.name === "akanjs" ? pkgJson.version : pkgJson.dependencies?.akanjs ?? pkgJson.version;
|
|
117
117
|
if (log)
|
|
118
118
|
Logger.rawLog(`akanjs@${version}`);
|
|
@@ -129,14 +129,19 @@ class PackageRunner extends runner("package") {
|
|
|
129
129
|
for (const packageJsonPath of packageJsonCandidates) {
|
|
130
130
|
if (!await Bun.file(packageJsonPath).exists())
|
|
131
131
|
continue;
|
|
132
|
-
const packageJson = await
|
|
132
|
+
const packageJson = await FileSys2.readJson(packageJsonPath);
|
|
133
133
|
if (packageJson.name === "akanjs" || packageJson.name === "@akanjs/cli")
|
|
134
134
|
return packageJson;
|
|
135
135
|
}
|
|
136
136
|
throw new Error(`[package] failed to locate akanjs package.json from ${path2.dirname(Bun.main)}`);
|
|
137
137
|
}
|
|
138
138
|
async createPackage(workspace, pkgName) {
|
|
139
|
-
|
|
139
|
+
const workspaceRootPath = ["pkgs", ...pkgName.split("/")].map(() => "..").join("/");
|
|
140
|
+
await workspace.applyTemplate({
|
|
141
|
+
basePath: `pkgs/${pkgName}`,
|
|
142
|
+
template: "pkgRoot",
|
|
143
|
+
dict: { pkgName, workspaceRootPath }
|
|
144
|
+
});
|
|
140
145
|
await workspace.setPkgTsPaths(pkgName);
|
|
141
146
|
}
|
|
142
147
|
async removePackage(pkg) {
|
|
@@ -144,8 +149,7 @@ class PackageRunner extends runner("package") {
|
|
|
144
149
|
await pkg.workspace.unsetPkgTsPaths(pkg.name);
|
|
145
150
|
}
|
|
146
151
|
async scanSync(pkg) {
|
|
147
|
-
|
|
148
|
-
return scanResult;
|
|
152
|
+
return await pkg.scan();
|
|
149
153
|
}
|
|
150
154
|
async buildPackage(pkg) {
|
|
151
155
|
await $`rm -rf ${pkg.dist.cwdPath}`;
|
|
@@ -153,7 +157,14 @@ class PackageRunner extends runner("package") {
|
|
|
153
157
|
const scanner = await TypeScriptDependencyScanner2.from(pkg);
|
|
154
158
|
const { npmDeps, npmDevDeps, missingDeps } = await scanner.getPackageBuildDependencies(pkg.name);
|
|
155
159
|
const packageRuntimeDependencies = {
|
|
156
|
-
"@akanjs/devkit": [
|
|
160
|
+
"@akanjs/devkit": [
|
|
161
|
+
"tailwind-scrollbar",
|
|
162
|
+
"@earendil-works/chord",
|
|
163
|
+
"@earendil-works/pi-agent-core",
|
|
164
|
+
"@earendil-works/pi-ai",
|
|
165
|
+
"@earendil-works/pi-telemetry",
|
|
166
|
+
"@earendil-works/pi-tui"
|
|
167
|
+
]
|
|
157
168
|
};
|
|
158
169
|
const packageRuntimeDevDependencies = { akanjs: ["@biomejs/biome", "@types/bun"] };
|
|
159
170
|
if (pkg.name === "@akanjs/cli") {
|
|
@@ -172,9 +183,14 @@ class PackageRunner extends runner("package") {
|
|
|
172
183
|
const forcedRuntimeDevDeps = packageRuntimeDevDependencies[pkg.name] ?? [];
|
|
173
184
|
const [rootPackageJson, pkgJson] = await Promise.all([pkg.workspace.getPackageJson(), pkg.getPackageJson()]);
|
|
174
185
|
const optionalPeerDeps = new Set(Object.entries(pkgJson.peerDependenciesMeta ?? {}).filter(([, meta]) => meta.optional).map(([dep]) => dep));
|
|
175
|
-
const
|
|
176
|
-
const
|
|
177
|
-
const
|
|
186
|
+
const isShipped = (dep) => !optionalPeerDeps.has(dep) && !bundledRuntimeDeps.has(dep);
|
|
187
|
+
const packageRuntimeDeps = [...new Set([...npmDeps, ...forcedRuntimeDeps])].filter(isShipped);
|
|
188
|
+
const packageRuntimeDevDeps = [...new Set([...npmDevDeps, ...forcedRuntimeDevDeps])].filter(isShipped);
|
|
189
|
+
const rootDeps = {
|
|
190
|
+
...rootPackageJson.overrides,
|
|
191
|
+
...rootPackageJson.dependencies,
|
|
192
|
+
...rootPackageJson.devDependencies
|
|
193
|
+
};
|
|
178
194
|
const missingForcedDeps = forcedRuntimeDeps.filter((dep) => !rootDeps[dep]);
|
|
179
195
|
const missingForcedDevDeps = forcedRuntimeDevDeps.filter((dep) => !rootDeps[dep]);
|
|
180
196
|
const requiredMissingDeps = missingDeps.filter((dep) => !optionalPeerDeps.has(dep));
|
|
@@ -192,7 +208,8 @@ class PackageRunner extends runner("package") {
|
|
|
192
208
|
stdio: "inherit"
|
|
193
209
|
});
|
|
194
210
|
} else {
|
|
195
|
-
await
|
|
211
|
+
await pkg.dist.cp(pkg.cwdPath, pkg.dist.cwdPath);
|
|
212
|
+
await $`rm -rf ${pkg.dist.cwdPath}/local`;
|
|
196
213
|
await Promise.all([
|
|
197
214
|
pkg.generateDistPackageJson(packageRuntimeDeps, packageRuntimeDevDeps),
|
|
198
215
|
pkg.generateTsconfigJson()
|
|
@@ -266,7 +283,7 @@ class PackageRunner extends runner("package") {
|
|
|
266
283
|
if (!await Bun.file(distPackageJsonPath).exists()) {
|
|
267
284
|
throw new Error(`[package] dist package not found for ${pkg.name}. Run build-package first.`);
|
|
268
285
|
}
|
|
269
|
-
const pkgJson = await
|
|
286
|
+
const pkgJson = await FileSys2.readJson(distPackageJsonPath);
|
|
270
287
|
if (pkgJson.name !== pkg.name) {
|
|
271
288
|
throw new Error(`[package] dist package name mismatch: expected ${pkg.name}, got ${pkgJson.name ?? "(missing)"}`);
|
|
272
289
|
}
|
|
@@ -275,12 +292,9 @@ class PackageRunner extends runner("package") {
|
|
|
275
292
|
if (pkgJson.publishConfig?.access !== "public") {
|
|
276
293
|
throw new Error(`[package] ${pkg.name} must publish with publishConfig.access=public`);
|
|
277
294
|
}
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
if (!await Bun.file(`${pkg.dist.cwdPath}/README.ko.md`).exists()) {
|
|
282
|
-
throw new Error(`[package] README.ko.md is missing from dist package ${pkg.name}`);
|
|
283
|
-
}
|
|
295
|
+
for (const readme of ["README.md", "README.ko.md"])
|
|
296
|
+
if (!await Bun.file(`${pkg.dist.cwdPath}/${readme}`).exists())
|
|
297
|
+
throw new Error(`[package] ${readme} is missing from dist package ${pkg.name}`);
|
|
284
298
|
const binEntries = typeof pkgJson.bin === "string" ? [pkgJson.bin] : Object.values(pkgJson.bin ?? {});
|
|
285
299
|
if (binEntries.some((binPath) => binPath.endsWith(".ts"))) {
|
|
286
300
|
throw new Error(`[package] ${pkg.name} dist bin entries must not point at TypeScript sources`);
|
|
@@ -297,6 +311,9 @@ class PackageRunner extends runner("package") {
|
|
|
297
311
|
cwd: pkg.workspace.workspaceRoot
|
|
298
312
|
});
|
|
299
313
|
const [packResult] = JSON.parse(packOutput);
|
|
314
|
+
const localFiles = (packResult?.files ?? []).filter((file) => file.path?.startsWith("local/"));
|
|
315
|
+
if (localFiles.length > 0)
|
|
316
|
+
throw new Error(`[package] ${pkg.name} would publish ${localFiles.length} test-run files under local/`);
|
|
300
317
|
return {
|
|
301
318
|
name: pkg.name,
|
|
302
319
|
version: pkgJson.version,
|
|
@@ -313,9 +330,8 @@ class PackageRunner extends runner("package") {
|
|
|
313
330
|
peerExportsMaps.set(pkg.name, await PackageExportsMap.from(pkg.dist.cwdPath));
|
|
314
331
|
}
|
|
315
332
|
const results = [];
|
|
316
|
-
for (const pkg of pkgs)
|
|
333
|
+
for (const pkg of pkgs)
|
|
317
334
|
results.push(await this.verifyDistPackage(pkg, { peerExportsMaps }));
|
|
318
|
-
}
|
|
319
335
|
return results;
|
|
320
336
|
}
|
|
321
337
|
async#copyPackageReadmes(pkg) {
|