@akanjs/cli 3.0.0-beta.2 → 3.0.0-beta.21
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-q2m47rqp.js +9 -0
- package/CodeAgentRpcHost-p7h6n2hp.js +7 -0
- package/CodeAgentRpcListener-7p7z5dd7.js +97 -0
- package/CodeTui-pdqhc3sn.js +1457 -0
- package/README.md +3 -0
- package/TunnelShare-scf4e4pd.js +9 -0
- package/{agent.command-d2gfxfck.js → agent.command-ttn09rx3.js} +8 -9
- package/akanCode.js +102 -0
- package/application.command-7gweenv7.js +179 -0
- package/{applicationBuildRunner-kxwbssgn.js → applicationBuildRunner-38exmejd.js} +63 -64
- package/buildBatch.proc.js +26 -25
- package/cloud.command-bhztw7c2.js +95 -0
- package/cloud.script-aabyhgba.js +20 -0
- package/code.command-6s8c0k91.js +154 -0
- package/commandManifest.json +1 -1
- package/consoleToStderr-h5bryj94.js +7 -0
- package/context.command-phmgywt2.js +48 -0
- package/context.runner-yvyw5g2d.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-7jk47fgq.js +42 -0
- package/guidelines/agentRule/agentRule.instruction.md +209 -28
- package/guidelines/conventions/conventions.instruction.md +96 -29
- 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 +77 -3
- 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-259dsnz3.js → index-1db2cw0y.js} +5 -8
- package/index-22d57v4c.js +266 -0
- package/index-3hx1z96c.js +87 -0
- package/{index-kcxmv48c.js → index-3t7g9e4r.js} +45 -79
- package/{index-ne2qy0nk.js → index-4dn1p115.js} +12 -12
- package/{index-q0y2jq9j.js → index-5b6tavv3.js} +6 -3
- package/index-7cqjvraf.js +69 -0
- package/index-7md2g9vw.js +6 -0
- package/{index-zry5nz81.js → index-8kb5p54p.js} +51 -30
- package/{index-ktb5njgy.js → index-9629w7ns.js} +49 -99
- package/index-9dp031by.js +12 -0
- package/{index-a64esmtb.js → index-aadpbnt2.js} +172 -308
- package/{index-3d9y066c.js → index-bjwxs904.js} +9 -8
- package/index-c6eggbee.js +123 -0
- package/index-d0arnrm8.js +700 -0
- package/index-d2242ksy.js +99 -0
- package/{index-600zhnve.js → index-dg97qp24.js} +70 -200
- package/{index-92zztqy1.js → index-dy0jx9ay.js} +2 -17
- package/{index-w8kmx1b6.js → index-fgq75haa.js} +198 -290
- package/{index-2tv3fdx4.js → index-ga6hygxr.js} +944 -1333
- package/{index-by5gpp8x.js → index-hj6w4ka1.js} +2 -1
- package/index-hr5n7t4x.js +465 -0
- package/{index-hwkygn9s.js → index-khpfpcsd.js} +302 -33
- package/{index-7737gxcp.js → index-m0ms3n1c.js} +107 -241
- package/{index-ws5e0j51.js → index-mgfx3mfs.js} +43 -26
- package/index-p6pbz9n5.js +25 -0
- package/index-pp54p5zk.js +53 -0
- package/{index-j9yhg404.js → index-q44jbw48.js} +4 -7
- package/{index-mak3cd28.js → index-rmcw8yc8.js} +137 -255
- package/{index-pnqbkf5p.js → index-rnt66vym.js} +6 -2
- package/index-smme4r47.js +49 -0
- package/index-tgjy8xf3.js +187 -0
- package/index-v5eayqqw.js +2729 -0
- package/index-wa5jbxj1.js +760 -0
- package/{index-4edzf1gr.js → index-wp43xrjv.js} +77 -150
- package/{index-fz5q3gd7.js → index-ya5qbmyg.js} +10 -17
- package/index-yjkte9aj.js +1119 -0
- package/{index-gyd220p2.js → index-yy4s1j72.js} +554 -577
- package/{index-v0qh106m.js → index-z50k041j.js} +580 -862
- package/index.js +23 -22
- package/{library.command-nbsky672.js → library.command-ccb1cp92.js} +4 -5
- package/{localRegistry.command-yeq57wjr.js → localRegistry.command-ajb9n87j.js} +23 -42
- package/{module.command-29vqzrh8.js → module.command-5k6h407d.js} +8 -11
- package/{package.command-axv0abmn.js → package.command-e6ntvpez.js} +6 -7
- package/package.json +14 -6
- package/{page.command-vs9s3zrh.js → page.command-v4f90wb8.js} +4 -5
- package/{primitive.command-cbxmqbtc.js → primitive.command-g6km57q5.js} +9 -22
- package/prompter-ptaa3nk0.js +8 -0
- package/{quality.command-gmbs7nws.js → quality.command-de3p36pz.js} +205 -377
- package/{recipeScanner-fpagtgc1.js → recipeScanner-4b69ybe0.js} +1 -1
- package/{repair.command-bqsjptsj.js → repair.command-d3x1javq.js} +11 -35
- package/{routeSourceValidator-apyqw7wk.js → routeSourceValidator-7ycnfz0e.js} +0 -6
- package/{scalar.command-6k1vhe9s.js → scalar.command-7ezrac2b.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-ps71ynp6.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/templates/workspaceRoot/.gitignore.template +0 -1
- package/tunnel.command-hsrv2mny.js +129 -0
- package/{typeChecker-3xgrzc2v.js → typeChecker-px49mezc.js} +1 -1
- package/typecheck.proc.js +1 -1
- package/workflow.command-z2p32nmf.js +79 -0
- package/{workspace.command-8s050m0h.js → workspace.command-tmdqkrh0.js} +77 -109
- package/abstractCompactor-mjh5ppsq.js +0 -101
- package/application.command-pj2m7584.js +0 -204
- package/applicationReleasePackager-4yasxwv9.js +0 -244
- package/capacitorApp-36rbr858.js +0 -12
- 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-47pj3aee.js +0 -76
- 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/index-wt7qrtd4.js +0 -1516
- 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
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import {
|
|
3
3
|
runner,
|
|
4
4
|
script
|
|
5
|
-
} from "./index-
|
|
5
|
+
} from "./index-rmcw8yc8.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-ga6hygxr.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") {
|
|
@@ -164,17 +175,23 @@ class PackageRunner extends runner("package") {
|
|
|
164
175
|
].filter((dep) => dep !== "akanjs" && dep !== "@akanjs/devkit");
|
|
165
176
|
}
|
|
166
177
|
const packageBundledRuntimeDependencies = {
|
|
167
|
-
"@akanjs/cli": ["@akanjs/devkit"],
|
|
168
|
-
akanjs: ["
|
|
178
|
+
"@akanjs/cli": ["@akanjs/devkit", "@akanjs/native"],
|
|
179
|
+
"@akanjs/devkit": ["@akanjs/native"],
|
|
180
|
+
akanjs: ["use-agentic", "@akanjs/native"]
|
|
169
181
|
};
|
|
170
182
|
const bundledRuntimeDeps = new Set(packageBundledRuntimeDependencies[pkg.name] ?? []);
|
|
171
183
|
const forcedRuntimeDeps = packageRuntimeDependencies[pkg.name] ?? [];
|
|
172
184
|
const forcedRuntimeDevDeps = packageRuntimeDevDependencies[pkg.name] ?? [];
|
|
173
185
|
const [rootPackageJson, pkgJson] = await Promise.all([pkg.workspace.getPackageJson(), pkg.getPackageJson()]);
|
|
174
186
|
const optionalPeerDeps = new Set(Object.entries(pkgJson.peerDependenciesMeta ?? {}).filter(([, meta]) => meta.optional).map(([dep]) => dep));
|
|
175
|
-
const
|
|
176
|
-
const
|
|
177
|
-
const
|
|
187
|
+
const isShipped = (dep) => !optionalPeerDeps.has(dep) && !bundledRuntimeDeps.has(dep);
|
|
188
|
+
const packageRuntimeDeps = [...new Set([...npmDeps, ...forcedRuntimeDeps])].filter(isShipped);
|
|
189
|
+
const packageRuntimeDevDeps = [...new Set([...npmDevDeps, ...forcedRuntimeDevDeps])].filter(isShipped);
|
|
190
|
+
const rootDeps = {
|
|
191
|
+
...rootPackageJson.overrides,
|
|
192
|
+
...rootPackageJson.dependencies,
|
|
193
|
+
...rootPackageJson.devDependencies
|
|
194
|
+
};
|
|
178
195
|
const missingForcedDeps = forcedRuntimeDeps.filter((dep) => !rootDeps[dep]);
|
|
179
196
|
const missingForcedDevDeps = forcedRuntimeDevDeps.filter((dep) => !rootDeps[dep]);
|
|
180
197
|
const requiredMissingDeps = missingDeps.filter((dep) => !optionalPeerDeps.has(dep));
|
|
@@ -192,7 +209,8 @@ class PackageRunner extends runner("package") {
|
|
|
192
209
|
stdio: "inherit"
|
|
193
210
|
});
|
|
194
211
|
} else {
|
|
195
|
-
await
|
|
212
|
+
await pkg.dist.cp(pkg.cwdPath, pkg.dist.cwdPath);
|
|
213
|
+
await $`rm -rf ${pkg.dist.cwdPath}/local`;
|
|
196
214
|
await Promise.all([
|
|
197
215
|
pkg.generateDistPackageJson(packageRuntimeDeps, packageRuntimeDevDeps),
|
|
198
216
|
pkg.generateTsconfigJson()
|
|
@@ -266,7 +284,7 @@ class PackageRunner extends runner("package") {
|
|
|
266
284
|
if (!await Bun.file(distPackageJsonPath).exists()) {
|
|
267
285
|
throw new Error(`[package] dist package not found for ${pkg.name}. Run build-package first.`);
|
|
268
286
|
}
|
|
269
|
-
const pkgJson = await
|
|
287
|
+
const pkgJson = await FileSys2.readJson(distPackageJsonPath);
|
|
270
288
|
if (pkgJson.name !== pkg.name) {
|
|
271
289
|
throw new Error(`[package] dist package name mismatch: expected ${pkg.name}, got ${pkgJson.name ?? "(missing)"}`);
|
|
272
290
|
}
|
|
@@ -275,12 +293,9 @@ class PackageRunner extends runner("package") {
|
|
|
275
293
|
if (pkgJson.publishConfig?.access !== "public") {
|
|
276
294
|
throw new Error(`[package] ${pkg.name} must publish with publishConfig.access=public`);
|
|
277
295
|
}
|
|
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
|
-
}
|
|
296
|
+
for (const readme of ["README.md", "README.ko.md"])
|
|
297
|
+
if (!await Bun.file(`${pkg.dist.cwdPath}/${readme}`).exists())
|
|
298
|
+
throw new Error(`[package] ${readme} is missing from dist package ${pkg.name}`);
|
|
284
299
|
const binEntries = typeof pkgJson.bin === "string" ? [pkgJson.bin] : Object.values(pkgJson.bin ?? {});
|
|
285
300
|
if (binEntries.some((binPath) => binPath.endsWith(".ts"))) {
|
|
286
301
|
throw new Error(`[package] ${pkg.name} dist bin entries must not point at TypeScript sources`);
|
|
@@ -297,6 +312,9 @@ class PackageRunner extends runner("package") {
|
|
|
297
312
|
cwd: pkg.workspace.workspaceRoot
|
|
298
313
|
});
|
|
299
314
|
const [packResult] = JSON.parse(packOutput);
|
|
315
|
+
const localFiles = (packResult?.files ?? []).filter((file) => file.path?.startsWith("local/"));
|
|
316
|
+
if (localFiles.length > 0)
|
|
317
|
+
throw new Error(`[package] ${pkg.name} would publish ${localFiles.length} test-run files under local/`);
|
|
300
318
|
return {
|
|
301
319
|
name: pkg.name,
|
|
302
320
|
version: pkgJson.version,
|
|
@@ -313,9 +331,8 @@ class PackageRunner extends runner("package") {
|
|
|
313
331
|
peerExportsMaps.set(pkg.name, await PackageExportsMap.from(pkg.dist.cwdPath));
|
|
314
332
|
}
|
|
315
333
|
const results = [];
|
|
316
|
-
for (const pkg of pkgs)
|
|
334
|
+
for (const pkg of pkgs)
|
|
317
335
|
results.push(await this.verifyDistPackage(pkg, { peerExportsMaps }));
|
|
318
|
-
}
|
|
319
336
|
return results;
|
|
320
337
|
}
|
|
321
338
|
async#copyPackageReadmes(pkg) {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// pkgs/@akanjs/cli/clipboard.ts
|
|
3
|
+
var clipboardCommands = () => {
|
|
4
|
+
if (process.platform === "darwin")
|
|
5
|
+
return [["pbcopy"]];
|
|
6
|
+
if (process.platform === "win32")
|
|
7
|
+
return [["clip"]];
|
|
8
|
+
return [["wl-copy"], ["xclip", "-selection", "clipboard"], ["xsel", "--clipboard", "--input"]];
|
|
9
|
+
};
|
|
10
|
+
var writeClipboard = async (text) => {
|
|
11
|
+
for (const command of clipboardCommands()) {
|
|
12
|
+
try {
|
|
13
|
+
const proc = Bun.spawn(command, {
|
|
14
|
+
stdin: new TextEncoder().encode(text),
|
|
15
|
+
stdout: "ignore",
|
|
16
|
+
stderr: "ignore"
|
|
17
|
+
});
|
|
18
|
+
if (await proc.exited === 0)
|
|
19
|
+
return true;
|
|
20
|
+
} catch {}
|
|
21
|
+
}
|
|
22
|
+
return false;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export { writeClipboard };
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
runner,
|
|
4
|
+
script
|
|
5
|
+
} from "./index-rmcw8yc8.js";
|
|
6
|
+
import {
|
|
7
|
+
generatedFilesForSync,
|
|
8
|
+
createPassedPrimitiveReport,
|
|
9
|
+
scalarChangedFiles
|
|
10
|
+
} from "./index-yy4s1j72.js";
|
|
11
|
+
import {
|
|
12
|
+
pluralizeName
|
|
13
|
+
} from "./index-nz8prx9g.js";
|
|
14
|
+
|
|
15
|
+
// pkgs/@akanjs/cli/scalar/scalar.runner.ts
|
|
16
|
+
class ScalarRunner extends runner("scalar") {
|
|
17
|
+
async applyScalarTemplate(sys, scalarName) {
|
|
18
|
+
await sys.applyTemplate({
|
|
19
|
+
basePath: "./lib/__scalar",
|
|
20
|
+
template: "__scalar",
|
|
21
|
+
dict: { model: scalarName, models: pluralizeName(scalarName), sysName: sys.name },
|
|
22
|
+
overwrite: false
|
|
23
|
+
});
|
|
24
|
+
const read = async (suffix) => {
|
|
25
|
+
const filename = `${scalarName}.${suffix}`;
|
|
26
|
+
return { filename, content: await sys.readFile(`lib/__scalar/${scalarName}/${filename}`) };
|
|
27
|
+
};
|
|
28
|
+
return {
|
|
29
|
+
abstract: await read("abstract.md"),
|
|
30
|
+
constant: await read("constant.ts"),
|
|
31
|
+
dictionary: await read("dictionary.ts"),
|
|
32
|
+
document: await read("document.ts")
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
// pkgs/@akanjs/cli/scalar/scalar.script.ts
|
|
38
|
+
class ScalarScript extends script("scalar", [ScalarRunner]) {
|
|
39
|
+
async createScalar(sys, scalarName) {
|
|
40
|
+
const files = await this.scalarRunner.applyScalarTemplate(sys, scalarName);
|
|
41
|
+
return createPassedPrimitiveReport({
|
|
42
|
+
command: "create-scalar",
|
|
43
|
+
changedFiles: scalarChangedFiles(sys, scalarName, files),
|
|
44
|
+
generatedFiles: generatedFilesForSync(sys),
|
|
45
|
+
target: sys.name
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
async removeScalar(sys, scalarName) {
|
|
49
|
+
await sys.removeDir(`lib/__scalar/${scalarName}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export { ScalarScript };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
import {
|
|
3
3
|
AppInfo
|
|
4
|
-
} from "./index-
|
|
4
|
+
} from "./index-ga6hygxr.js";
|
|
5
5
|
|
|
6
6
|
// pkgs/@akanjs/devkit/slicePlanner.ts
|
|
7
7
|
class SlicePlanner {
|
|
@@ -65,9 +65,6 @@ class SlicePlanner {
|
|
|
65
65
|
constructor(app) {
|
|
66
66
|
this.#app = app;
|
|
67
67
|
}
|
|
68
|
-
async#trackedFiles(paths) {
|
|
69
|
-
return await this.#app.workspace.listGitFiles(paths);
|
|
70
|
-
}
|
|
71
68
|
async#untrackedFiles(paths) {
|
|
72
69
|
const [tracked, all] = await Promise.all([
|
|
73
70
|
this.#app.workspace.listGitFiles(paths),
|
|
@@ -102,12 +99,12 @@ class SlicePlanner {
|
|
|
102
99
|
const libs = appInfo.getLibs();
|
|
103
100
|
const slicePaths = [`apps/${this.#app.name}`, ...libs.map((lib) => `libs/${lib}`)];
|
|
104
101
|
const [appFiles, allTracked, untracked, rootPackageJson] = await Promise.all([
|
|
105
|
-
this.#
|
|
106
|
-
this.#
|
|
102
|
+
this.#app.workspace.listGitFiles([`apps/${this.#app.name}`]),
|
|
103
|
+
this.#app.workspace.listGitFiles(["."]),
|
|
107
104
|
this.#untrackedFiles(slicePaths),
|
|
108
105
|
this.#app.workspace.getPackageJson()
|
|
109
106
|
]);
|
|
110
|
-
const libFiles = Object.fromEntries(await Promise.all(libs.map(async (lib) => [lib, await this.#
|
|
107
|
+
const libFiles = Object.fromEntries(await Promise.all(libs.map(async (lib) => [lib, await this.#app.workspace.listGitFiles([`libs/${lib}`])])));
|
|
111
108
|
const rootFiles = allTracked.filter((file) => !this.#isMemberFile(file));
|
|
112
109
|
const required = SlicePlanner.#requiredDependencies(appInfo);
|
|
113
110
|
const {
|