@akanjs/cli 2.4.0 → 2.4.1-rc.0
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/agent.command-h4afc69n.js +26 -0
- package/application.command-4ctkfdan.js +165 -0
- package/applicationBuildRunner-esa1kj7v.js +284 -0
- package/applicationReleasePackager-brvth6rs.js +245 -0
- package/capacitorApp-y0h6cgft.js +58 -0
- package/cloud.command-rpztn4fh.js +94 -0
- package/commandManifest.json +1 -0
- package/context.command-nqbtak4f.js +82 -0
- package/dependencyScanner-m4x5maek.js +9 -0
- package/guideline.command-ya0dh44f.js +356 -0
- package/incrementalBuilder.proc.js +89 -17394
- package/index-1xdrsbry.js +1447 -0
- package/index-45aj5ry0.js +990 -0
- package/index-5vvwc0cz.js +559 -0
- package/index-61keag0s.js +40 -0
- package/index-6pz1j0zj.js +62 -0
- package/index-73pr2cmy.js +534 -0
- package/index-76rn3g2c.js +76 -0
- package/index-85msc0wg.js +161 -0
- package/index-8pkbzj26.js +840 -0
- package/index-8rc0bm04.js +514 -0
- package/index-9sp6fsc5.js +1884 -0
- package/index-a6sbyy0b.js +2769 -0
- package/index-b0brjbp3.js +83 -0
- package/index-fgc8r6dj.js +33 -0
- package/index-h6ca6qg0.js +2777 -0
- package/index-hdqztm58.js +758 -0
- package/index-hwzpw9c1.js +202 -0
- package/index-pmm9e2jf.js +120 -0
- package/index-qaq13qk3.js +80 -0
- package/index-qhtr07v8.js +1072 -0
- package/index-r24hmh0q.js +4 -0
- package/index-ss469dec.js +11 -0
- package/index-swf4bmbg.js +25 -0
- package/index-w7fyqjrw.js +462 -0
- package/index-wnp7hwq7.js +193 -0
- package/index-wq8jwx8z.js +224 -0
- package/index-x53a5nya.js +301 -0
- package/index-xmc2w32q.js +4359 -0
- package/index-y3hdhy4p.js +229 -0
- package/index.js +54 -23340
- package/library.command-r15zdqvp.js +33 -0
- package/localRegistry.command-5tcahs3f.js +178 -0
- package/module.command-qrj3kmyz.js +54 -0
- package/package.command-r8sq5kzp.js +43 -0
- package/package.json +2 -2
- package/page.command-c6xdx0xm.js +24 -0
- package/primitive.command-pv9ssmtf.js +62 -0
- package/quality.command-es67wvdp.js +809 -0
- package/repair.command-677675vw.js +67 -0
- package/routeSourceValidator-wbhmbwpj.js +132 -0
- package/scalar.command-kabkd6wd.js +35 -0
- package/templates/facetIndex/index.ts +1 -1
- package/typeChecker-kravn7ns.js +8 -0
- package/typecheck.proc.js +4 -194
- package/workflow.command-64r6cw0w.js +108 -0
- package/workspace.command-vrws0rgx.js +435 -0
- package/README.ko.md +0 -72
- package/README.md +0 -85
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
LibraryScript
|
|
4
|
+
} from "./index-pmm9e2jf.js";
|
|
5
|
+
import {
|
|
6
|
+
Lib,
|
|
7
|
+
Workspace,
|
|
8
|
+
command
|
|
9
|
+
} from "./index-hdqztm58.js";
|
|
10
|
+
import"./index-a6sbyy0b.js";
|
|
11
|
+
import"./index-61keag0s.js";
|
|
12
|
+
import"./index-6pz1j0zj.js";
|
|
13
|
+
import"./index-r24hmh0q.js";
|
|
14
|
+
|
|
15
|
+
// pkgs/@akanjs/cli/library/library.command.ts
|
|
16
|
+
class LibraryCommand extends command("library", [LibraryScript], ({ public: target }) => ({
|
|
17
|
+
createLibrary: target({ desc: "Create a new shared library in the workspace" }).arg("libName", String, { desc: "name of library" }).with(Workspace).exec(async function(libName, workspace) {
|
|
18
|
+
await this.libraryScript.createLibrary(libName.toLowerCase().replace(/ /g, "-"), workspace);
|
|
19
|
+
}),
|
|
20
|
+
removeLibrary: target({ desc: "Remove a library from the workspace" }).with(Lib).exec(async function(lib) {
|
|
21
|
+
await this.libraryScript.removeLibrary(lib);
|
|
22
|
+
}),
|
|
23
|
+
syncLibrary: target({ desc: "Sync dependencies and configuration for a library" }).with(Lib).exec(async function(lib) {
|
|
24
|
+
await this.libraryScript.syncLibrary(lib);
|
|
25
|
+
}),
|
|
26
|
+
installLibrary: target({ desc: "Install pre-built library templates (shared, util, etc.)" }).arg("libName", String, { desc: "name of library", nullable: true }).with(Workspace).exec(async function(libName, workspace) {
|
|
27
|
+
await this.libraryScript.installLibrary(workspace, libName);
|
|
28
|
+
})
|
|
29
|
+
})) {
|
|
30
|
+
}
|
|
31
|
+
export {
|
|
32
|
+
LibraryCommand
|
|
33
|
+
};
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
CloudRunner,
|
|
4
|
+
getNpmRegistryUrl
|
|
5
|
+
} from "./index-w7fyqjrw.js";
|
|
6
|
+
import {
|
|
7
|
+
ApplicationScript
|
|
8
|
+
} from "./index-9sp6fsc5.js";
|
|
9
|
+
import"./index-76rn3g2c.js";
|
|
10
|
+
import"./index-pmm9e2jf.js";
|
|
11
|
+
import {
|
|
12
|
+
PackageScript
|
|
13
|
+
} from "./index-wq8jwx8z.js";
|
|
14
|
+
import"./index-5vvwc0cz.js";
|
|
15
|
+
import {
|
|
16
|
+
Workspace,
|
|
17
|
+
command,
|
|
18
|
+
runner,
|
|
19
|
+
script
|
|
20
|
+
} from "./index-hdqztm58.js";
|
|
21
|
+
import"./index-fgc8r6dj.js";
|
|
22
|
+
import {
|
|
23
|
+
PkgExecutor
|
|
24
|
+
} from "./index-a6sbyy0b.js";
|
|
25
|
+
import"./index-x53a5nya.js";
|
|
26
|
+
import"./index-61keag0s.js";
|
|
27
|
+
import"./index-6pz1j0zj.js";
|
|
28
|
+
import"./index-r24hmh0q.js";
|
|
29
|
+
|
|
30
|
+
// pkgs/@akanjs/cli/localRegistry/localRegistry.runner.ts
|
|
31
|
+
import { mkdir, rm } from "fs/promises";
|
|
32
|
+
import path from "path";
|
|
33
|
+
import { Logger } from "akanjs/common";
|
|
34
|
+
var defaultLocalRegistryUrl = "http://127.0.0.1:4873";
|
|
35
|
+
var containerName = "akan-verdaccio";
|
|
36
|
+
var smokeRepoName = "akan-local-smoke";
|
|
37
|
+
var smokeAppName = "demo";
|
|
38
|
+
|
|
39
|
+
class LocalRegistryRunner extends runner("localRegistry") {
|
|
40
|
+
getRegistryUrl(registryUrl = process.env.AKAN_NPM_REGISTRY ?? defaultLocalRegistryUrl) {
|
|
41
|
+
return getNpmRegistryUrl(registryUrl);
|
|
42
|
+
}
|
|
43
|
+
async start(workspace, { registryUrl } = {}) {
|
|
44
|
+
const registry = this.getRegistryUrl(registryUrl);
|
|
45
|
+
try {
|
|
46
|
+
await workspace.spawn("docker", ["inspect", containerName]);
|
|
47
|
+
Logger.info(`Local registry is already running at ${registry}`);
|
|
48
|
+
return registry;
|
|
49
|
+
} catch {}
|
|
50
|
+
const configPath = path.join(workspace.workspaceRoot, "pkgs/@akanjs/cli/localRegistry/verdaccio.yaml");
|
|
51
|
+
const storagePath = path.join(workspace.workspaceRoot, ".akan/verdaccio/storage");
|
|
52
|
+
await mkdir(storagePath, { recursive: true });
|
|
53
|
+
await workspace.spawn("docker", [
|
|
54
|
+
"run",
|
|
55
|
+
"--rm",
|
|
56
|
+
"-d",
|
|
57
|
+
"--name",
|
|
58
|
+
containerName,
|
|
59
|
+
"-p",
|
|
60
|
+
"4873:4873",
|
|
61
|
+
"-v",
|
|
62
|
+
`${configPath}:/verdaccio/conf/config.yaml:ro`,
|
|
63
|
+
"-v",
|
|
64
|
+
`${storagePath}:/verdaccio/storage`,
|
|
65
|
+
"verdaccio/verdaccio:6"
|
|
66
|
+
], { stdio: "inherit" });
|
|
67
|
+
Logger.info(`Local registry is running at ${registry}`);
|
|
68
|
+
return registry;
|
|
69
|
+
}
|
|
70
|
+
async reset(workspace) {
|
|
71
|
+
try {
|
|
72
|
+
await workspace.spawn("docker", ["rm", "-f", containerName], { stdio: "inherit" });
|
|
73
|
+
} catch {}
|
|
74
|
+
await rm(path.join(workspace.workspaceRoot, ".akan/verdaccio"), { recursive: true, force: true });
|
|
75
|
+
Logger.info("Local registry storage has been reset");
|
|
76
|
+
}
|
|
77
|
+
async smoke(workspace, { registryUrl } = {}) {
|
|
78
|
+
const registry = this.getRegistryUrl(registryUrl);
|
|
79
|
+
const smokeRoot = path.join(workspace.workspaceRoot, ".akan/e2e");
|
|
80
|
+
await rm(path.join(smokeRoot, smokeRepoName), { recursive: true, force: true });
|
|
81
|
+
await workspace.spawn(process.execPath, [
|
|
82
|
+
"dist/pkgs/create-akan-workspace/index.js",
|
|
83
|
+
smokeRepoName,
|
|
84
|
+
"--app",
|
|
85
|
+
smokeAppName,
|
|
86
|
+
"--dir",
|
|
87
|
+
".akan/e2e",
|
|
88
|
+
"--init",
|
|
89
|
+
"true",
|
|
90
|
+
"--registry",
|
|
91
|
+
registry
|
|
92
|
+
], {
|
|
93
|
+
env: { ...process.env, AKAN_NPM_REGISTRY: registry, NPM_CONFIG_REGISTRY: registry },
|
|
94
|
+
stdio: "inherit"
|
|
95
|
+
});
|
|
96
|
+
await workspace.spawn("akan", ["typecheck", smokeAppName], {
|
|
97
|
+
cwd: path.join(smokeRoot, smokeRepoName),
|
|
98
|
+
env: { ...process.env, AKAN_NPM_REGISTRY: registry, NPM_CONFIG_REGISTRY: registry },
|
|
99
|
+
stdio: "inherit"
|
|
100
|
+
});
|
|
101
|
+
await workspace.spawn("akan", ["build", smokeAppName], {
|
|
102
|
+
cwd: path.join(smokeRoot, smokeRepoName),
|
|
103
|
+
env: { ...process.env, AKAN_NPM_REGISTRY: registry, NPM_CONFIG_REGISTRY: registry },
|
|
104
|
+
stdio: "inherit"
|
|
105
|
+
});
|
|
106
|
+
Logger.info(`Local registry smoke test completed for ${smokeRepoName}/${smokeAppName}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// pkgs/@akanjs/cli/localRegistry/localRegistry.script.ts
|
|
111
|
+
class LocalRegistryScript extends script("localRegistry", [
|
|
112
|
+
LocalRegistryRunner,
|
|
113
|
+
CloudRunner,
|
|
114
|
+
ApplicationScript,
|
|
115
|
+
PackageScript
|
|
116
|
+
]) {
|
|
117
|
+
async start(workspace, { registryUrl } = {}) {
|
|
118
|
+
const spinner = workspace.spinning("Starting local npm registry...");
|
|
119
|
+
const registry = await this.localRegistryRunner.start(workspace, { registryUrl });
|
|
120
|
+
spinner.succeed(`Local npm registry is ready at ${registry}`);
|
|
121
|
+
}
|
|
122
|
+
async reset(workspace) {
|
|
123
|
+
const spinner = workspace.spinning("Resetting local npm registry...");
|
|
124
|
+
await this.localRegistryRunner.reset(workspace);
|
|
125
|
+
spinner.succeed("Local npm registry reset");
|
|
126
|
+
}
|
|
127
|
+
async smoke(workspace, { tag = "rc", test = true, registryUrl } = {}) {
|
|
128
|
+
const registry = await this.localRegistryRunner.start(workspace, { registryUrl });
|
|
129
|
+
const akanPkgs = await this.cloudRunner.getAkanPkgs(workspace);
|
|
130
|
+
await this.#preparePackages(workspace, akanPkgs, { test });
|
|
131
|
+
await this.cloudRunner.deployAkan(workspace, akanPkgs, {
|
|
132
|
+
registryUrl: registry,
|
|
133
|
+
confirmPublish: false,
|
|
134
|
+
tag
|
|
135
|
+
});
|
|
136
|
+
await this.localRegistryRunner.smoke(workspace, { registryUrl: registry });
|
|
137
|
+
}
|
|
138
|
+
async#preparePackages(workspace, akanPkgs, { test = true } = {}) {
|
|
139
|
+
await this.packageScript.updateWorskpaceRootPackageJson(workspace);
|
|
140
|
+
const pkgs = akanPkgs.map((pkgName) => PkgExecutor.from(workspace, pkgName));
|
|
141
|
+
if (test)
|
|
142
|
+
for (const pkg of pkgs)
|
|
143
|
+
await this.applicationScript.test(pkg);
|
|
144
|
+
for (const pkg of pkgs)
|
|
145
|
+
await this.packageScript.buildPackage(pkg, { showSpinner: false });
|
|
146
|
+
await this.packageScript.verifyAkanPublishPackages(workspace);
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// pkgs/@akanjs/cli/localRegistry/localRegistry.command.ts
|
|
151
|
+
class LocalRegistryCommand extends command("local-registry", [LocalRegistryScript], ({ public: target }) => ({
|
|
152
|
+
startRegistry: target({ devOnly: true, desc: "Start the local Verdaccio npm registry" }).with(Workspace).option("registry", String, {
|
|
153
|
+
desc: "local npm registry URL",
|
|
154
|
+
default: process.env.AKAN_NPM_REGISTRY ?? "http://127.0.0.1:4873"
|
|
155
|
+
}).exec(async function(workspace, registry) {
|
|
156
|
+
await this.localRegistryScript.start(workspace, { registryUrl: registry });
|
|
157
|
+
}),
|
|
158
|
+
resetRegistry: target({ devOnly: true, desc: "Stop and clear the local Verdaccio npm registry" }).with(Workspace).exec(async function(workspace) {
|
|
159
|
+
await this.localRegistryScript.reset(workspace);
|
|
160
|
+
}),
|
|
161
|
+
smokeRegistry: target({ devOnly: true, desc: "Publish to local registry and build a generated workspace" }).with(Workspace).option("tag", String, {
|
|
162
|
+
flag: "g",
|
|
163
|
+
desc: "dist-tag for local registry publish",
|
|
164
|
+
default: "rc"
|
|
165
|
+
}).option("test", Boolean, {
|
|
166
|
+
desc: "run package tests before publishing",
|
|
167
|
+
default: true
|
|
168
|
+
}).option("registry", String, {
|
|
169
|
+
desc: "local npm registry URL",
|
|
170
|
+
default: process.env.AKAN_NPM_REGISTRY
|
|
171
|
+
}).exec(async function(workspace, tag, test, registry) {
|
|
172
|
+
await this.localRegistryScript.smoke(workspace, { tag, test, registryUrl: registry });
|
|
173
|
+
})
|
|
174
|
+
})) {
|
|
175
|
+
}
|
|
176
|
+
export {
|
|
177
|
+
LocalRegistryCommand
|
|
178
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
ModuleScript
|
|
4
|
+
} from "./index-8pkbzj26.js";
|
|
5
|
+
import"./index-swf4bmbg.js";
|
|
6
|
+
import"./index-ss469dec.js";
|
|
7
|
+
import"./index-qaq13qk3.js";
|
|
8
|
+
import {
|
|
9
|
+
renderPrimitiveReport
|
|
10
|
+
} from "./index-h6ca6qg0.js";
|
|
11
|
+
import"./index-5vvwc0cz.js";
|
|
12
|
+
import {
|
|
13
|
+
Module,
|
|
14
|
+
Sys,
|
|
15
|
+
command
|
|
16
|
+
} from "./index-hdqztm58.js";
|
|
17
|
+
import"./index-a6sbyy0b.js";
|
|
18
|
+
import"./index-61keag0s.js";
|
|
19
|
+
import"./index-6pz1j0zj.js";
|
|
20
|
+
import"./index-r24hmh0q.js";
|
|
21
|
+
|
|
22
|
+
// pkgs/@akanjs/cli/module/module.command.ts
|
|
23
|
+
import { Logger, lowerlize } from "akanjs/common";
|
|
24
|
+
class ModuleCommand extends command("module", [ModuleScript], ({ public: target }) => ({
|
|
25
|
+
createModule: target({ desc: "Create a new domain module (constant, service, signal, store, UI)" }).arg("moduleName", String, { desc: "name of module" }).with(Sys).option("page", Boolean, { desc: "create page", default: false }).option("ai", Boolean, { desc: "use ai to create module constant and dictionary", default: false }).option("format", String, { flag: "o", desc: "output format", default: "markdown", enum: ["markdown", "json"] }).exec(async function(moduleName, sys, page, ai, format) {
|
|
26
|
+
const name = lowerlize(moduleName.replace(/ /g, ""));
|
|
27
|
+
const report = ai ? await this.moduleScript.createModule(sys, name, { page }) : await this.moduleScript.createModuleTemplate(sys, name, { page });
|
|
28
|
+
Logger.rawLog(renderPrimitiveReport(report, format));
|
|
29
|
+
}),
|
|
30
|
+
removeModule: target({ desc: "Remove a module from an app or library" }).with(Module).exec(async function(module) {
|
|
31
|
+
await this.moduleScript.removeModule(module);
|
|
32
|
+
}),
|
|
33
|
+
createService: target({ desc: "Create a service module without database files" }).arg("serviceName", String, { desc: "name of service module" }).with(Sys).option("format", String, { flag: "o", desc: "output format", default: "markdown", enum: ["markdown", "json"] }).exec(async function(serviceName, sys, format) {
|
|
34
|
+
const name = lowerlize(serviceName.replace(/ /g, "").replace(/^_+/, ""));
|
|
35
|
+
const report = await this.moduleScript.createService(sys, name);
|
|
36
|
+
Logger.rawLog(renderPrimitiveReport(report, format));
|
|
37
|
+
}),
|
|
38
|
+
createView: target({ desc: "Create a View component for a module (full page view)" }).with(Module).option("format", String, { flag: "o", desc: "output format", default: "markdown", enum: ["markdown", "json"] }).exec(async function(module, format) {
|
|
39
|
+
const report = await this.moduleScript.createView(module);
|
|
40
|
+
Logger.rawLog(renderPrimitiveReport(report, format));
|
|
41
|
+
}),
|
|
42
|
+
createUnit: target({ desc: "Create a Unit component for a module (list/card item)" }).with(Module).option("format", String, { flag: "o", desc: "output format", default: "markdown", enum: ["markdown", "json"] }).exec(async function(module, format) {
|
|
43
|
+
const report = await this.moduleScript.createUnit(module);
|
|
44
|
+
Logger.rawLog(renderPrimitiveReport(report, format));
|
|
45
|
+
}),
|
|
46
|
+
createTemplate: target({ desc: "Create a Template component for a module (form)" }).with(Module).option("format", String, { flag: "o", desc: "output format", default: "markdown", enum: ["markdown", "json"] }).exec(async function(module, format) {
|
|
47
|
+
const report = await this.moduleScript.createTemplate(module);
|
|
48
|
+
Logger.rawLog(renderPrimitiveReport(report, format));
|
|
49
|
+
})
|
|
50
|
+
})) {
|
|
51
|
+
}
|
|
52
|
+
export {
|
|
53
|
+
ModuleCommand
|
|
54
|
+
};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
PackageScript
|
|
4
|
+
} from "./index-wq8jwx8z.js";
|
|
5
|
+
import {
|
|
6
|
+
Pkg,
|
|
7
|
+
Workspace,
|
|
8
|
+
command
|
|
9
|
+
} from "./index-hdqztm58.js";
|
|
10
|
+
import"./index-a6sbyy0b.js";
|
|
11
|
+
import"./index-x53a5nya.js";
|
|
12
|
+
import"./index-61keag0s.js";
|
|
13
|
+
import"./index-6pz1j0zj.js";
|
|
14
|
+
import"./index-r24hmh0q.js";
|
|
15
|
+
|
|
16
|
+
// pkgs/@akanjs/cli/package/package.command.ts
|
|
17
|
+
class PackageCommand extends command("package", [PackageScript], ({ public: target }) => ({
|
|
18
|
+
version: target({ desc: "Show version information for all packages" }).with(Workspace).exec(async function(workspace) {
|
|
19
|
+
await this.packageScript.version(workspace);
|
|
20
|
+
}),
|
|
21
|
+
createPackage: target({ desc: "Create a new package in pkgs/akanjs/" }).option("name", String, { desc: "name of package" }).with(Workspace).exec(async function(name, workspace) {
|
|
22
|
+
await this.packageScript.createPackage(workspace, name.toLowerCase().replace(/ /g, "-"));
|
|
23
|
+
}),
|
|
24
|
+
removePackage: target({ desc: "Remove a package from the workspace" }).with(Pkg).exec(async function(pkg) {
|
|
25
|
+
await this.packageScript.removePackage(pkg);
|
|
26
|
+
}),
|
|
27
|
+
syncPackage: target({ desc: "Sync dependencies and configuration for a package" }).with(Pkg).exec(async function(pkg) {
|
|
28
|
+
await this.packageScript.syncPackage(pkg);
|
|
29
|
+
}),
|
|
30
|
+
buildPackage: target({ desc: "Build a package for distribution" }).with(Pkg).exec(async function(pkg) {
|
|
31
|
+
await this.packageScript.buildPackage(pkg);
|
|
32
|
+
}),
|
|
33
|
+
verifyDistPackage: target({ desc: "Verify a built dist package with npm pack dry-run" }).with(Pkg).exec(async function(pkg) {
|
|
34
|
+
await this.packageScript.verifyDistPackage(pkg);
|
|
35
|
+
}),
|
|
36
|
+
verifyAkanPublishPackages: target({ devOnly: true, desc: "Verify all Akan publish dist packages" }).with(Workspace).exec(async function(workspace) {
|
|
37
|
+
await this.packageScript.verifyAkanPublishPackages(workspace);
|
|
38
|
+
})
|
|
39
|
+
})) {
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
PackageCommand
|
|
43
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@akanjs/cli",
|
|
3
|
-
"version": "2.4.0",
|
|
3
|
+
"version": "2.4.1-rc.0",
|
|
4
4
|
"sourceType": "module",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"publishConfig": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@langchain/openai": "^1.4.6",
|
|
35
35
|
"@tailwindcss/node": "^4.3.0",
|
|
36
36
|
"@trapezedev/project": "^7.1.4",
|
|
37
|
-
"akanjs": "2.4.0",
|
|
37
|
+
"akanjs": "2.4.1-rc.0",
|
|
38
38
|
"chalk": "^5.6.2",
|
|
39
39
|
"commander": "^14.0.3",
|
|
40
40
|
"daisyui": "5.5.23",
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
PageScript
|
|
4
|
+
} from "./index-swf4bmbg.js";
|
|
5
|
+
import {
|
|
6
|
+
App,
|
|
7
|
+
Module,
|
|
8
|
+
command
|
|
9
|
+
} from "./index-hdqztm58.js";
|
|
10
|
+
import"./index-a6sbyy0b.js";
|
|
11
|
+
import"./index-61keag0s.js";
|
|
12
|
+
import"./index-6pz1j0zj.js";
|
|
13
|
+
import"./index-r24hmh0q.js";
|
|
14
|
+
|
|
15
|
+
// pkgs/@akanjs/cli/page/page.command.ts
|
|
16
|
+
class PageCommand extends command("page", [PageScript], ({ public: target }) => ({
|
|
17
|
+
createCrudPage: target({ desc: "Create CRUD pages for a module (list, detail, create, edit)" }).with(App).with(Module).option("basePath", String, { desc: "base path", nullable: true }).option("single", Boolean, { desc: "single page", default: false }).exec(async function(app, module, basePath, single) {
|
|
18
|
+
await this.pageScript.createCrudPage(module, { app, basePath, single });
|
|
19
|
+
})
|
|
20
|
+
})) {
|
|
21
|
+
}
|
|
22
|
+
export {
|
|
23
|
+
PageCommand
|
|
24
|
+
};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import {
|
|
3
|
+
PrimitiveScript
|
|
4
|
+
} from "./index-73pr2cmy.js";
|
|
5
|
+
import"./index-8pkbzj26.js";
|
|
6
|
+
import"./index-swf4bmbg.js";
|
|
7
|
+
import"./index-ss469dec.js";
|
|
8
|
+
import"./index-qaq13qk3.js";
|
|
9
|
+
import {
|
|
10
|
+
renderPrimitiveReport
|
|
11
|
+
} from "./index-h6ca6qg0.js";
|
|
12
|
+
import"./index-5vvwc0cz.js";
|
|
13
|
+
import {
|
|
14
|
+
Workspace,
|
|
15
|
+
command
|
|
16
|
+
} from "./index-hdqztm58.js";
|
|
17
|
+
import"./index-a6sbyy0b.js";
|
|
18
|
+
import"./index-61keag0s.js";
|
|
19
|
+
import"./index-6pz1j0zj.js";
|
|
20
|
+
import"./index-r24hmh0q.js";
|
|
21
|
+
|
|
22
|
+
// pkgs/@akanjs/cli/primitive/primitive.command.ts
|
|
23
|
+
import { Logger } from "akanjs/common";
|
|
24
|
+
class PrimitiveCommand extends command("primitive", [PrimitiveScript], ({ public: target }) => ({
|
|
25
|
+
createUi: target({ desc: "Create a UI surface for a module" }).with(Workspace).option("app", String, { desc: "target app or library name", nullable: true }).option("module", String, { desc: "target module name", nullable: true }).option("surface", String, {
|
|
26
|
+
flag: "u",
|
|
27
|
+
desc: "view, unit, or template",
|
|
28
|
+
default: "template",
|
|
29
|
+
enum: ["view", "unit", "template"]
|
|
30
|
+
}).option("format", String, { flag: "o", desc: "output format", default: "markdown", enum: ["markdown", "json"] }).exec(async function(workspace, app, module, surface, format) {
|
|
31
|
+
const report = await this.primitiveScript.createUi(workspace, {
|
|
32
|
+
app,
|
|
33
|
+
module,
|
|
34
|
+
surface
|
|
35
|
+
});
|
|
36
|
+
Logger.rawLog(renderPrimitiveReport(report, format));
|
|
37
|
+
}),
|
|
38
|
+
addField: target({ desc: "Add a source-limited field to a module constant and dictionary" }).with(Workspace).option("app", String, { desc: "target app or library name", nullable: true }).option("module", String, { desc: "target module name", nullable: true }).option("field", String, { desc: "field name", nullable: true }).option("type", String, { desc: "field type or scalar name", nullable: true }).option("default", String, { desc: "default value", nullable: true }).option("format", String, { flag: "o", desc: "output format", default: "markdown", enum: ["markdown", "json"] }).exec(async function(workspace, app, module, field, typeName, defaultValue, format) {
|
|
39
|
+
const report = await this.primitiveScript.addField(workspace, {
|
|
40
|
+
app,
|
|
41
|
+
module,
|
|
42
|
+
field,
|
|
43
|
+
type: typeName,
|
|
44
|
+
defaultValue
|
|
45
|
+
});
|
|
46
|
+
Logger.rawLog(renderPrimitiveReport(report, format));
|
|
47
|
+
}),
|
|
48
|
+
addEnumField: target({ desc: "Add a source-limited enum field to a module constant and dictionary" }).with(Workspace).option("app", String, { desc: "target app or library name", nullable: true }).option("module", String, { desc: "target module name", nullable: true }).option("field", String, { desc: "field name", nullable: true }).option("values", String, { flag: "l", desc: "comma-separated enum values", nullable: true }).option("default", String, { desc: "default value", nullable: true }).option("format", String, { flag: "o", desc: "output format", default: "markdown", enum: ["markdown", "json"] }).exec(async function(workspace, app, module, field, values, defaultValue, format) {
|
|
49
|
+
const report = await this.primitiveScript.addEnumField(workspace, {
|
|
50
|
+
app,
|
|
51
|
+
module,
|
|
52
|
+
field,
|
|
53
|
+
values,
|
|
54
|
+
defaultValue
|
|
55
|
+
});
|
|
56
|
+
Logger.rawLog(renderPrimitiveReport(report, format));
|
|
57
|
+
})
|
|
58
|
+
})) {
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
PrimitiveCommand
|
|
62
|
+
};
|