@akanjs/cli 0.0.139 → 0.0.140
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/cjs/index.js +596 -366
- package/cjs/src/templates/module/__model__.constant.js +10 -1
- package/cjs/src/templates/module/__model__.dictionary.js +5 -0
- package/esm/index.js +596 -366
- package/esm/src/templates/module/__model__.constant.js +10 -1
- package/esm/src/templates/module/__model__.dictionary.js +5 -0
- package/package.json +1 -1
- package/src/application/application.command.d.ts +1 -1
- package/src/library/library.command.d.ts +2 -2
- package/src/module/module.command.d.ts +4 -6
- package/src/module/module.prompt.d.ts +7 -48
- package/src/module/module.request.d.ts +59 -0
- package/src/module/module.runner.d.ts +7 -1
- package/src/module/module.script.d.ts +7 -6
- package/src/workspace/workspace.command.d.ts +1 -1
package/cjs/index.js
CHANGED
|
@@ -447,11 +447,11 @@ var Logger = class _Logger {
|
|
|
447
447
|
console.log(`${processMsg} ${timestampMsg} ${logLevelMsg} ${contextMsg} ${contentMsg} ${timeDiffMsg}
|
|
448
448
|
`);
|
|
449
449
|
}
|
|
450
|
-
static rawLog(msg, method) {
|
|
450
|
+
static rawLog(msg = "", method) {
|
|
451
451
|
this.raw(`${msg}
|
|
452
452
|
`, method);
|
|
453
453
|
}
|
|
454
|
-
static raw(msg, method) {
|
|
454
|
+
static raw(msg = "", method) {
|
|
455
455
|
if (typeof window === "undefined" && method !== "console" && global.process)
|
|
456
456
|
global.process.stdout.write(msg);
|
|
457
457
|
else
|
|
@@ -999,13 +999,20 @@ var Executor = class _Executor {
|
|
|
999
999
|
if (!import_fs4.default.existsSync(cwdPath))
|
|
1000
1000
|
import_fs4.default.mkdirSync(cwdPath, { recursive: true });
|
|
1001
1001
|
}
|
|
1002
|
+
#stdout(data) {
|
|
1003
|
+
if (_Executor.verbose)
|
|
1004
|
+
Logger.raw(import_chalk.default.dim(data.toString()));
|
|
1005
|
+
}
|
|
1006
|
+
#stderr(data) {
|
|
1007
|
+
Logger.raw(import_chalk.default.red(data.toString()));
|
|
1008
|
+
}
|
|
1002
1009
|
exec(command, options = {}) {
|
|
1003
1010
|
const proc = (0, import_child_process.exec)(command, { cwd: this.cwdPath, ...options });
|
|
1004
1011
|
proc.stdout?.on("data", (data) => {
|
|
1005
|
-
|
|
1012
|
+
this.#stdout(data);
|
|
1006
1013
|
});
|
|
1007
1014
|
proc.stderr?.on("data", (data) => {
|
|
1008
|
-
|
|
1015
|
+
this.#stdout(data);
|
|
1009
1016
|
});
|
|
1010
1017
|
return new Promise((resolve, reject) => {
|
|
1011
1018
|
proc.on("exit", (code, signal) => {
|
|
@@ -1019,14 +1026,14 @@ var Executor = class _Executor {
|
|
|
1019
1026
|
spawn(command, args = [], options = {}) {
|
|
1020
1027
|
const proc = (0, import_child_process.spawn)(command, args, {
|
|
1021
1028
|
cwd: this.cwdPath,
|
|
1022
|
-
stdio:
|
|
1029
|
+
stdio: "inherit",
|
|
1023
1030
|
...options
|
|
1024
1031
|
});
|
|
1025
1032
|
proc.stdout?.on("data", (data) => {
|
|
1026
|
-
|
|
1033
|
+
this.#stdout(data);
|
|
1027
1034
|
});
|
|
1028
1035
|
proc.stderr?.on("data", (data) => {
|
|
1029
|
-
|
|
1036
|
+
this.#stderr(data);
|
|
1030
1037
|
});
|
|
1031
1038
|
return new Promise((resolve, reject) => {
|
|
1032
1039
|
proc.on("exit", (code, signal) => {
|
|
@@ -1040,14 +1047,14 @@ var Executor = class _Executor {
|
|
|
1040
1047
|
fork(modulePath, args = [], options = {}) {
|
|
1041
1048
|
const proc = (0, import_child_process.fork)(modulePath, args, {
|
|
1042
1049
|
cwd: this.cwdPath,
|
|
1043
|
-
stdio:
|
|
1050
|
+
stdio: ["ignore", "inherit", "inherit", "ipc"],
|
|
1044
1051
|
...options
|
|
1045
1052
|
});
|
|
1046
1053
|
proc.stdout?.on("data", (data) => {
|
|
1047
|
-
|
|
1054
|
+
this.#stdout(data);
|
|
1048
1055
|
});
|
|
1049
1056
|
proc.stderr?.on("data", (data) => {
|
|
1050
|
-
|
|
1057
|
+
this.#stderr(data);
|
|
1051
1058
|
});
|
|
1052
1059
|
return new Promise((resolve, reject) => {
|
|
1053
1060
|
proc.on("exit", (code, signal) => {
|
|
@@ -1072,6 +1079,20 @@ var Executor = class _Executor {
|
|
|
1072
1079
|
const readPath = this.#getPath(filePath);
|
|
1073
1080
|
return import_fs4.default.existsSync(readPath);
|
|
1074
1081
|
}
|
|
1082
|
+
remove(filePath) {
|
|
1083
|
+
const readPath = this.#getPath(filePath);
|
|
1084
|
+
if (import_fs4.default.existsSync(readPath))
|
|
1085
|
+
import_fs4.default.unlinkSync(readPath);
|
|
1086
|
+
this.logger.verbose(`Remove file ${readPath}`);
|
|
1087
|
+
return this;
|
|
1088
|
+
}
|
|
1089
|
+
removeDir(dirPath) {
|
|
1090
|
+
const readPath = this.#getPath(dirPath);
|
|
1091
|
+
if (import_fs4.default.existsSync(readPath))
|
|
1092
|
+
import_fs4.default.rmSync(readPath, { recursive: true });
|
|
1093
|
+
this.logger.verbose(`Remove directory ${readPath}`);
|
|
1094
|
+
return this;
|
|
1095
|
+
}
|
|
1075
1096
|
writeFile(filePath, content, { overwrite = true } = {}) {
|
|
1076
1097
|
const writePath = this.#getPath(filePath);
|
|
1077
1098
|
const dir = import_path3.default.dirname(writePath);
|
|
@@ -1292,23 +1313,41 @@ var WorkspaceExecutor = class _WorkspaceExecutor extends Executor {
|
|
|
1292
1313
|
}
|
|
1293
1314
|
setTsPaths(type, name) {
|
|
1294
1315
|
const rootTsConfig = this.readJson("tsconfig.json");
|
|
1295
|
-
if (type === "lib")
|
|
1316
|
+
if (type === "lib" || type === "pkg")
|
|
1296
1317
|
rootTsConfig.compilerOptions.paths[`@${name}`] = [`${type}s/${name}/index.ts`];
|
|
1297
1318
|
rootTsConfig.compilerOptions.paths[`@${name}/*`] = [`${type}s/${name}/*`];
|
|
1319
|
+
if (rootTsConfig.references) {
|
|
1320
|
+
if (!rootTsConfig.references.some((ref) => ref.path === `./${type}s/${name}/tsconfig.json`))
|
|
1321
|
+
rootTsConfig.references.push({ path: `./${type}s/${name}/tsconfig.json` });
|
|
1322
|
+
}
|
|
1323
|
+
this.writeJson("tsconfig.json", rootTsConfig);
|
|
1324
|
+
return this;
|
|
1325
|
+
}
|
|
1326
|
+
unsetTsPaths(type, name) {
|
|
1327
|
+
const rootTsConfig = this.readJson("tsconfig.json");
|
|
1328
|
+
const filteredKeys = Object.keys(rootTsConfig.compilerOptions.paths).filter((key) => !key.startsWith(`@${name}`));
|
|
1329
|
+
rootTsConfig.compilerOptions.paths = Object.fromEntries(
|
|
1330
|
+
filteredKeys.map((key) => [key, rootTsConfig.compilerOptions.paths[key]])
|
|
1331
|
+
);
|
|
1332
|
+
if (rootTsConfig.references) {
|
|
1333
|
+
rootTsConfig.references = rootTsConfig.references.filter(
|
|
1334
|
+
(ref) => !ref.path.startsWith(`./${type}s/${name}`)
|
|
1335
|
+
);
|
|
1336
|
+
}
|
|
1298
1337
|
this.writeJson("tsconfig.json", rootTsConfig);
|
|
1299
1338
|
return this;
|
|
1300
1339
|
}
|
|
1301
1340
|
async getDirInModule(basePath2, name) {
|
|
1302
|
-
const AVOID_DIRS = ["__lib", "__scalar", `_${name}`];
|
|
1341
|
+
const AVOID_DIRS = ["__lib", "__scalar", `_`, `_${name}`];
|
|
1303
1342
|
const getDirs = async (dirname, maxDepth = 3, results = [], prefix = "") => {
|
|
1304
1343
|
const dirs = await import_promises.default.readdir(dirname);
|
|
1305
1344
|
await Promise.all(
|
|
1306
1345
|
dirs.map(async (dir) => {
|
|
1307
|
-
if (AVOID_DIRS.includes(dir))
|
|
1346
|
+
if (dir.includes("_") || AVOID_DIRS.includes(dir))
|
|
1308
1347
|
return;
|
|
1309
1348
|
const dirPath = import_path3.default.join(dirname, dir);
|
|
1310
1349
|
if (import_fs4.default.lstatSync(dirPath).isDirectory()) {
|
|
1311
|
-
results.push(`${
|
|
1350
|
+
results.push(`${prefix}${dir}`);
|
|
1312
1351
|
if (maxDepth > 0)
|
|
1313
1352
|
await getDirs(dirPath, maxDepth - 1, results, `${prefix}${dir}/`);
|
|
1314
1353
|
}
|
|
@@ -1355,6 +1394,22 @@ var WorkspaceExecutor = class _WorkspaceExecutor extends Executor {
|
|
|
1355
1394
|
];
|
|
1356
1395
|
return scalarConstantExampleFiles;
|
|
1357
1396
|
}
|
|
1397
|
+
async getConstantFiles() {
|
|
1398
|
+
const [appNames, libNames] = await this.getSyss();
|
|
1399
|
+
const moduleConstantExampleFiles = [
|
|
1400
|
+
...(await Promise.all(appNames.map((appName) => AppExecutor.from(this, appName).getConstantFiles()))).flat(),
|
|
1401
|
+
...(await Promise.all(libNames.map((libName) => LibExecutor.from(this, libName).getConstantFiles()))).flat()
|
|
1402
|
+
];
|
|
1403
|
+
return moduleConstantExampleFiles;
|
|
1404
|
+
}
|
|
1405
|
+
async getDictionaryFiles() {
|
|
1406
|
+
const [appNames, libNames] = await this.getSyss();
|
|
1407
|
+
const moduleDictionaryExampleFiles = [
|
|
1408
|
+
...(await Promise.all(appNames.map((appName) => AppExecutor.from(this, appName).getDictionaryFiles()))).flat(),
|
|
1409
|
+
...(await Promise.all(libNames.map((libName) => LibExecutor.from(this, libName).getDictionaryFiles()))).flat()
|
|
1410
|
+
];
|
|
1411
|
+
return moduleDictionaryExampleFiles;
|
|
1412
|
+
}
|
|
1358
1413
|
async getViewFiles() {
|
|
1359
1414
|
const [appNames, libNames] = await this.getSyss();
|
|
1360
1415
|
const viewExampleFiles = [
|
|
@@ -1584,9 +1639,15 @@ var SysExecutor = class extends Executor {
|
|
|
1584
1639
|
}
|
|
1585
1640
|
async getScalarDictionaryFiles() {
|
|
1586
1641
|
const scalarModules = await this.getScalarModules();
|
|
1587
|
-
return scalarModules.map(
|
|
1588
|
-
|
|
1589
|
-
|
|
1642
|
+
return scalarModules.map((scalarModule) => this.getLocalFile(`lib/${scalarModule}/${scalarModule}.dictionary.ts`));
|
|
1643
|
+
}
|
|
1644
|
+
async getConstantFiles() {
|
|
1645
|
+
const modules = await this.getModules();
|
|
1646
|
+
return modules.map((module2) => this.getLocalFile(`lib/${module2}/${module2}.constant.ts`));
|
|
1647
|
+
}
|
|
1648
|
+
async getDictionaryFiles() {
|
|
1649
|
+
const modules = await this.getModules();
|
|
1650
|
+
return modules.map((module2) => this.getLocalFile(`lib/${module2}/${module2}.dictionary.ts`));
|
|
1590
1651
|
}
|
|
1591
1652
|
setTsPaths() {
|
|
1592
1653
|
this.workspace.setTsPaths(this.type, this.name);
|
|
@@ -2027,6 +2088,7 @@ var getArg = (type) => function(name, argsOption = {}) {
|
|
|
2027
2088
|
setArgMetasOnPrototype(prototype, key, argMetas);
|
|
2028
2089
|
};
|
|
2029
2090
|
};
|
|
2091
|
+
var Argument = getArg("Argument");
|
|
2030
2092
|
var Option = getArg("Option");
|
|
2031
2093
|
var createArgMetaDecorator = (type) => {
|
|
2032
2094
|
return function(option = {}) {
|
|
@@ -2103,6 +2165,16 @@ var handleOption = (programCommand, argMeta) => {
|
|
|
2103
2165
|
);
|
|
2104
2166
|
return programCommand;
|
|
2105
2167
|
};
|
|
2168
|
+
var handleArgument = (programCommand, argMeta) => {
|
|
2169
|
+
const kebabName = camelToKebabCase(argMeta.name);
|
|
2170
|
+
if ((argMeta.argsOption.type ?? "string") !== "string")
|
|
2171
|
+
throw new Error(`Argument type must be string: ${argMeta.name}`);
|
|
2172
|
+
programCommand.argument(
|
|
2173
|
+
`[${kebabName}]`,
|
|
2174
|
+
`${argMeta.argsOption.desc}${argMeta.argsOption.example ? ` (example: ${argMeta.argsOption.example})` : ""}`
|
|
2175
|
+
);
|
|
2176
|
+
return programCommand;
|
|
2177
|
+
};
|
|
2106
2178
|
var convertOptionValue = (value, type) => {
|
|
2107
2179
|
if (type === "string")
|
|
2108
2180
|
return value;
|
|
@@ -2139,7 +2211,21 @@ var getOptionValue = async (argMeta, opt) => {
|
|
|
2139
2211
|
return convertOptionValue(await (0, import_prompts3.input)({ message }), type ?? "string");
|
|
2140
2212
|
}
|
|
2141
2213
|
};
|
|
2142
|
-
var getArgumentValue = async (argMeta, value
|
|
2214
|
+
var getArgumentValue = async (argMeta, value) => {
|
|
2215
|
+
const {
|
|
2216
|
+
name,
|
|
2217
|
+
argsOption: { default: defaultValue, type, desc, nullable, example, ask }
|
|
2218
|
+
} = argMeta;
|
|
2219
|
+
if (value !== void 0)
|
|
2220
|
+
return value;
|
|
2221
|
+
else if (defaultValue !== void 0)
|
|
2222
|
+
return defaultValue;
|
|
2223
|
+
else if (nullable)
|
|
2224
|
+
return null;
|
|
2225
|
+
const message = ask ? `${ask}: ` : desc ? `${desc}: ` : `Enter the ${name} value${example ? ` (example: ${example})` : ""}: `;
|
|
2226
|
+
return await (0, import_prompts3.input)({ message });
|
|
2227
|
+
};
|
|
2228
|
+
var getInternalArgumentValue = async (argMeta, value, workspace) => {
|
|
2143
2229
|
if (argMeta.type === "Workspace")
|
|
2144
2230
|
return workspace;
|
|
2145
2231
|
const sysType = argMeta.type.toLowerCase();
|
|
@@ -2204,6 +2290,7 @@ var getArgumentValue = async (argMeta, value, workspace) => {
|
|
|
2204
2290
|
var runCommands = async (...commands) => {
|
|
2205
2291
|
process.on("unhandledRejection", (error) => {
|
|
2206
2292
|
console.error(import_chalk2.default.red("[fatal]"), error);
|
|
2293
|
+
process.exit(1);
|
|
2207
2294
|
});
|
|
2208
2295
|
const hasPackageJson = import_fs7.default.existsSync(`${__dirname}/../package.json`);
|
|
2209
2296
|
const version = hasPackageJson ? JSON.parse(import_fs7.default.readFileSync(`${__dirname}/../package.json`, "utf8")).version : "0.0.1";
|
|
@@ -2224,6 +2311,8 @@ var runCommands = async (...commands) => {
|
|
|
2224
2311
|
for (const argMeta of allArgMetas) {
|
|
2225
2312
|
if (argMeta.type === "Option")
|
|
2226
2313
|
programCommand = handleOption(programCommand, argMeta);
|
|
2314
|
+
else if (argMeta.type === "Argument")
|
|
2315
|
+
programCommand = handleArgument(programCommand, argMeta);
|
|
2227
2316
|
else if (argMeta.type === "Workspace")
|
|
2228
2317
|
continue;
|
|
2229
2318
|
const sysType = argMeta.type.toLowerCase();
|
|
@@ -2234,6 +2323,7 @@ var runCommands = async (...commands) => {
|
|
|
2234
2323
|
}
|
|
2235
2324
|
programCommand = programCommand.option(`-v, --verbose [boolean]`, `verbose output`);
|
|
2236
2325
|
programCommand.action(async (...args) => {
|
|
2326
|
+
Logger.rawLog();
|
|
2237
2327
|
const cmdArgs = args.slice(0, args.length - 2);
|
|
2238
2328
|
const opt = args[args.length - 2];
|
|
2239
2329
|
const commandArgs = [];
|
|
@@ -2241,8 +2331,14 @@ var runCommands = async (...commands) => {
|
|
|
2241
2331
|
for (const argMeta of allArgMetas) {
|
|
2242
2332
|
if (argMeta.type === "Option")
|
|
2243
2333
|
commandArgs[argMeta.idx] = await getOptionValue(argMeta, opt);
|
|
2334
|
+
else if (argMeta.type === "Argument")
|
|
2335
|
+
commandArgs[argMeta.idx] = await getArgumentValue(argMeta, cmdArgs[argMeta.idx]);
|
|
2244
2336
|
else
|
|
2245
|
-
commandArgs[argMeta.idx] = await
|
|
2337
|
+
commandArgs[argMeta.idx] = await getInternalArgumentValue(
|
|
2338
|
+
argMeta,
|
|
2339
|
+
cmdArgs[argMeta.idx],
|
|
2340
|
+
workspace
|
|
2341
|
+
);
|
|
2246
2342
|
if (commandArgs[argMeta.idx] instanceof AppExecutor)
|
|
2247
2343
|
process.env.NEXT_PUBLIC_APP_NAME = commandArgs[argMeta.idx].name;
|
|
2248
2344
|
if (opt.verbose)
|
|
@@ -2251,6 +2347,7 @@ var runCommands = async (...commands) => {
|
|
|
2251
2347
|
const cmd = new command();
|
|
2252
2348
|
try {
|
|
2253
2349
|
await cmd[targetMeta.key](...commandArgs);
|
|
2350
|
+
Logger.rawLog();
|
|
2254
2351
|
} catch (e) {
|
|
2255
2352
|
const errMsg = e instanceof Error ? e.message : typeof e === "string" ? e : JSON.stringify(e);
|
|
2256
2353
|
Logger.error(`Command Error: ${import_chalk2.default.red(errMsg)}`);
|
|
@@ -2353,7 +2450,7 @@ var AiSession = class _AiSession {
|
|
|
2353
2450
|
const stream = await _AiSession.#chat.stream(this.messageHistory);
|
|
2354
2451
|
let fullResponse = "", tokenIdx = 0;
|
|
2355
2452
|
for await (const chunk of stream) {
|
|
2356
|
-
if (loader.isSpinning())
|
|
2453
|
+
if (loader.isSpinning() && chunk.content.length)
|
|
2357
2454
|
loader.succeed(`${_AiSession.#chat.model} responded`);
|
|
2358
2455
|
const content = chunk.content;
|
|
2359
2456
|
if (typeof content === "string") {
|
|
@@ -2483,22 +2580,14 @@ var LibraryRunner = class {
|
|
|
2483
2580
|
await workspace.exec(`mkdir -p libs/${libName}`);
|
|
2484
2581
|
const lib = LibExecutor.from(workspace, libName);
|
|
2485
2582
|
await lib.applyTemplate({ basePath: ".", template: "libRoot", dict: { libName, LibName: capitalize(libName) } });
|
|
2486
|
-
|
|
2487
|
-
rootTsConfig.compilerOptions.paths[`@${libName}`] = [`libs/${libName}/index.ts`];
|
|
2488
|
-
rootTsConfig.compilerOptions.paths[`@${libName}/*`] = [`libs/${libName}/*`];
|
|
2489
|
-
if (rootTsConfig.references) {
|
|
2490
|
-
if (!rootTsConfig.references.some((ref) => ref.path === `./libs/${libName}/tsconfig.json`))
|
|
2491
|
-
rootTsConfig.references.push({ path: `./libs/${libName}/tsconfig.json` });
|
|
2492
|
-
}
|
|
2493
|
-
workspace.writeJson("tsconfig.json", rootTsConfig);
|
|
2583
|
+
workspace.setTsPaths("lib", libName);
|
|
2494
2584
|
return lib;
|
|
2495
2585
|
}
|
|
2496
2586
|
async removeLibrary(lib) {
|
|
2497
2587
|
await lib.workspace.exec(`rm -rf libs/${lib.name}`);
|
|
2498
|
-
lib.
|
|
2588
|
+
lib.workspace.unsetTsPaths("lib", lib.name);
|
|
2499
2589
|
}
|
|
2500
2590
|
async installLibrary(workspace, libName) {
|
|
2501
|
-
workspace.log(`Installing ${libName} library as git subtree...`);
|
|
2502
2591
|
await workspace.exec(`git subtree add --prefix=libs/${libName} git@github.com:akan-team/${libName}.git main`);
|
|
2503
2592
|
await workspace.cp(`libs/${libName}/env/env.server.example.ts`, `libs/${libName}/env/env.server.testing.ts`);
|
|
2504
2593
|
workspace.setTsPaths("lib", libName);
|
|
@@ -2535,13 +2624,11 @@ var LibraryRunner = class {
|
|
|
2535
2624
|
await lib.workspace.exec(
|
|
2536
2625
|
`git subtree push --prefix=libs/${lib.name} git@github.com:akan-team/${lib.name}.git ${branch}`
|
|
2537
2626
|
);
|
|
2538
|
-
lib.logger.log(`${lib.name} library pushed to ${branch} branch`);
|
|
2539
2627
|
}
|
|
2540
2628
|
async pullLibrary(lib, branch) {
|
|
2541
2629
|
await lib.workspace.exec(
|
|
2542
2630
|
`git subtree pull --prefix=libs/${lib.name} git@github.com:akan-team/${lib.name}.git ${branch}`
|
|
2543
2631
|
);
|
|
2544
|
-
lib.logger.log(`${lib.name} library pulled from ${branch} branch`);
|
|
2545
2632
|
}
|
|
2546
2633
|
#getEnv(lib, env = {}) {
|
|
2547
2634
|
const rootEnv = import_dotenv2.default.parse(lib.workspace.readFile(".env"));
|
|
@@ -2595,7 +2682,7 @@ var LibraryScript = class {
|
|
|
2595
2682
|
const installSpinner = workspace.spinning(`Installing ${libName} library`);
|
|
2596
2683
|
const lib = await this.#runner.installLibrary(workspace, libName);
|
|
2597
2684
|
installSpinner.succeed(`${libName} library (libs/${libName}) is installed`);
|
|
2598
|
-
const mergeSpinner =
|
|
2685
|
+
const mergeSpinner = lib.spinning("Merging library dependencies...");
|
|
2599
2686
|
await this.#runner.mergeLibraryDependencies(lib);
|
|
2600
2687
|
mergeSpinner.succeed(`${libName} library (libs/${libName}) dependencies merged to root package.json`);
|
|
2601
2688
|
}
|
|
@@ -3916,87 +4003,6 @@ Core ESLint Extensions
|
|
|
3916
4003
|
This configuration creates a robust linting setup that enforces Next.js App Router best practices, maintains clean code
|
|
3917
4004
|
organization, and ensures proper server/client code separation.
|
|
3918
4005
|
`;
|
|
3919
|
-
var componentDefaultDescription = ({
|
|
3920
|
-
modelName,
|
|
3921
|
-
ModelName,
|
|
3922
|
-
exampleFiles,
|
|
3923
|
-
constant,
|
|
3924
|
-
properties
|
|
3925
|
-
}) => `
|
|
3926
|
-
|
|
3927
|
-
|
|
3928
|
-
1. Akan.js \uD504\uB808\uC784\uC6CC\uD06C\uC5D0 \uB300\uD55C \uAC1C\uC694
|
|
3929
|
-
${frameworkAbstract}
|
|
3930
|
-
|
|
3931
|
-
2. Akan.js\uD504\uB808\uC784\uC6CC\uD06C \uB370\uC774\uD130 \uAE30\uBC18 \uBAA8\uB4C8\uC5D0 \uB300\uD55C \uC124\uBA85
|
|
3932
|
-
${moduleDesription}
|
|
3933
|
-
|
|
3934
|
-
3. Akan.js eslint \uC124\uC815\uC5D0 \uB300\uD55C \uC124\uBA85
|
|
3935
|
-
${eslintDescription}
|
|
3936
|
-
|
|
3937
|
-
4. util/ui \uB0B4 ui\uD0B7\uC5D0 \uB300\uD55C \uC124\uBA85
|
|
3938
|
-
${utilUiDescription}
|
|
3939
|
-
|
|
3940
|
-
5. shared/ui \uB0B4 ui\uD0B7\uC5D0 \uB300\uD55C \uC124\uBA85
|
|
3941
|
-
${shardUiDescription}
|
|
3942
|
-
|
|
3943
|
-
6. ${ModelName}.constant.ts \uD30C\uC77C\uC5D0 \uB300\uD55C \uC815\uBCF4
|
|
3944
|
-
${constant}
|
|
3945
|
-
|
|
3946
|
-
7. ${modelName}\uC5D0\uC11C \uC885\uC18D\uB418\uB294 \uB2E4\uB978 \uBAA8\uB378\uB4E4\uC758 \uD0C0\uC785 \uC815\uC758
|
|
3947
|
-
${properties.map(
|
|
3948
|
-
(property) => `
|
|
3949
|
-
\`\`\`
|
|
3950
|
-
${property.key}.constant.ts
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
${property.source}
|
|
3954
|
-
\`\`\`
|
|
3955
|
-
`
|
|
3956
|
-
).join("\n\n")}
|
|
3957
|
-
|
|
3958
|
-
|
|
3959
|
-
8. \uC608\uC2DC \uD30C\uC77C\uB4E4
|
|
3960
|
-
${exampleFiles.map(
|
|
3961
|
-
(example) => `
|
|
3962
|
-
Example filename: ${example.filepath}
|
|
3963
|
-
\`\`\`
|
|
3964
|
-
${example.content}
|
|
3965
|
-
\`\`\`
|
|
3966
|
-
`
|
|
3967
|
-
).join("\n\n")}
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3973
|
-
|
|
3974
|
-
\uC5ED\uD560\uBD80\uC5EC
|
|
3975
|
-
- Akan.js \uC0AC\uB0B4 \uD504\uB808\uC784\uC6CC\uD06C \uAE30\uBC18 Typescript \uC2DC\uB2C8\uC5B4 \uD504\uB860\uD2B8\uC5D4\uB4DC \uAC1C\uBC1C\uC790.
|
|
3976
|
-
|
|
3977
|
-
\uCF54\uB529 \uADDC\uCE59
|
|
3978
|
-
- \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
3979
|
-
- \uC544\uC774\uCF58: react-icons \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
3980
|
-
- CSS: tailwind, DaisyUI(btn, input, badge \uAC19\uC740 \uAE30\uBCF8 \uC694\uC18C\uB9CC \uC0AC\uC6A9 \uAC00\uB2A5, card/hero \uAC19\uC740 \uBCF5\uC7A1\uD55C \uCEF4\uD3EC\uB10C\uD2B8 \uC0AC\uC6A9 X) \uC0AC\uC6A9
|
|
3981
|
-
- Ui Component: @util/ui \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
3982
|
-
- \uC870\uAC74\uBD80 \uD074\uB798\uC2A4: clsx \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
3983
|
-
\uCF54\uB4DC \uC2A4\uD0C0\uC77C
|
|
3984
|
-
- \uC0C9\uC0C1: \uD558\uB4DC\uCF54\uB529(bg-red) \uB300\uC2E0 \uD14C\uB9C8 \uC0C9\uC0C1(bg-primary) \uC0AC\uC6A9
|
|
3985
|
-
- \uC870\uAC74\uBD80 \uB80C\uB354\uB9C1: field && <div>... \uB300\uC2E0 field ? <div>... : null \uC0AC\uC6A9
|
|
3986
|
-
- \uBAA8\uB378 \uC811\uADFC: \uAD6C\uC870\uBD84\uD574\uD560\uB2F9 \uB300\uC2E0 ${modelName}.field \uD615\uC2DD\uC73C\uB85C \uC811\uADFC
|
|
3987
|
-
- \uD0C0\uC785 \uC548\uC804: ${modelName}.constant.ts\uC758 \uC2A4\uD0A4\uB9C8 \uCC38\uC870\uD558\uC5EC \uC5D0\uB7EC \uBC29\uC9C0
|
|
3988
|
-
\uD544\uB4DC \uC811\uADFC \uC804: \uC2A4\uD0A4\uB9C8\uC758 \uC2E4\uC81C \uD544\uB4DC \uB9AC\uC2A4\uD2B8 \uC791\uC131 \uBC0F \uAC80\uD1A0 \uD544\uC218
|
|
3989
|
-
|
|
3990
|
-
\uC5C4\uACA9\uD55C \uC8FC\uC758\uC0AC\uD56D
|
|
3991
|
-
- UI \uD0B7\uC740 \uBB38\uC11C\uC5D0 \uBA85\uC2DC\uB41C \uCEF4\uD3EC\uB10C\uD2B8\uB9CC \uC0AC\uC6A9
|
|
3992
|
-
- \uCEF4\uD3EC\uB10C\uD2B8 \uC0AC\uC6A9 \uC804 \uBB38\uC11C \uD655\uC778 \uBC0F props \uC815\uD655\uD788 \uAC80\uC99D
|
|
3993
|
-
- \uBA85\uC2DC\uB41C \uB8F0 \uC678 \uC784\uC758 \uCD94\uC0C1\uD654 \uAE08\uC9C0
|
|
3994
|
-
- dayjs \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB294 @akanjs/base\uC5D0\uC11C \uB798\uD551\uD558\uC5EC \uC81C\uACF5\uD558\uACE0 \uC788\uC74C.
|
|
3995
|
-
|
|
3996
|
-
|
|
3997
|
-
|
|
3998
|
-
|
|
3999
|
-
`;
|
|
4000
4006
|
var scalarConstantDescription = `
|
|
4001
4007
|
Purpose and Structure
|
|
4002
4008
|
|
|
@@ -4334,159 +4340,56 @@ The \`@Field.Prop()\` decorator is commonly used in different model types:
|
|
|
4334
4340
|
- Reference options enable building relationships between different models
|
|
4335
4341
|
- Aggregation options support analytics use cases
|
|
4336
4342
|
`;
|
|
4337
|
-
var
|
|
4338
|
-
sysName,
|
|
4343
|
+
var componentDefaultDescription = ({
|
|
4339
4344
|
modelName,
|
|
4340
|
-
|
|
4341
|
-
|
|
4342
|
-
|
|
4343
|
-
|
|
4345
|
+
ModelName,
|
|
4346
|
+
exampleFiles,
|
|
4347
|
+
constant,
|
|
4348
|
+
properties
|
|
4344
4349
|
}) => `
|
|
4345
|
-
|
|
4346
|
-
\uB2E4\uC74C\uC758 \uBC30\uACBD \uC815\uBCF4\uB97C \uBC14\uD0D5\uC73C\uB85C ${modelName}.constant.ts \uD30C\uC77C\uC744 \uC791\uC131\uD574\uC918.
|
|
4350
|
+
|
|
4347
4351
|
|
|
4348
4352
|
1. Akan.js \uD504\uB808\uC784\uC6CC\uD06C\uC5D0 \uB300\uD55C \uAC1C\uC694
|
|
4349
4353
|
${frameworkAbstract}
|
|
4350
4354
|
|
|
4351
|
-
2.
|
|
4352
|
-
${
|
|
4353
|
-
|
|
4354
|
-
3. <model>.constant.ts \uD30C\uC77C\uC758 Enum \uC791\uC131\uBC95
|
|
4355
|
-
${howToSetEnumInModelConstant}
|
|
4356
|
-
|
|
4357
|
-
4. <model>.constant.ts \uD30C\uC77C\uC758 Field \uC791\uC131\uBC95
|
|
4358
|
-
${howToSetFieldInModelConstant}
|
|
4355
|
+
2. Akan.js\uD504\uB808\uC784\uC6CC\uD06C \uB370\uC774\uD130 \uAE30\uBC18 \uBAA8\uB4C8\uC5D0 \uB300\uD55C \uC124\uBA85
|
|
4356
|
+
${moduleDesription}
|
|
4359
4357
|
|
|
4360
|
-
|
|
4361
|
-
${
|
|
4362
|
-
(constant) => `
|
|
4363
|
-
Example file: ${constant.filepath}
|
|
4364
|
-
\`\`\`
|
|
4365
|
-
${constant.content}
|
|
4366
|
-
\`\`\`
|
|
4367
|
-
`
|
|
4368
|
-
).join("\n")}
|
|
4358
|
+
3. Akan.js eslint \uC124\uC815\uC5D0 \uB300\uD55C \uC124\uBA85
|
|
4359
|
+
${eslintDescription}
|
|
4369
4360
|
|
|
4361
|
+
4. util/ui \uB0B4 ui\uD0B7\uC5D0 \uB300\uD55C \uC124\uBA85
|
|
4362
|
+
${utilUiDescription}
|
|
4370
4363
|
|
|
4371
|
-
|
|
4364
|
+
5. shared/ui \uB0B4 ui\uD0B7\uC5D0 \uB300\uD55C \uC124\uBA85
|
|
4365
|
+
${shardUiDescription}
|
|
4372
4366
|
|
|
4373
|
-
|
|
4374
|
-
|
|
4375
|
-
Model description: ${modelDesc}
|
|
4376
|
-
Model schema design: ${modelSchemaDesign}
|
|
4367
|
+
6. ${ModelName}.constant.ts \uD30C\uC77C\uC5D0 \uB300\uD55C \uC815\uBCF4
|
|
4368
|
+
${constant}
|
|
4377
4369
|
|
|
4378
|
-
|
|
4379
|
-
|
|
4380
|
-
|
|
4381
|
-
\`\`\`
|
|
4382
|
-
`;
|
|
4383
|
-
var requestTemplate = ({
|
|
4384
|
-
sysName,
|
|
4385
|
-
modelName,
|
|
4386
|
-
ModelName,
|
|
4387
|
-
boilerplate,
|
|
4388
|
-
constant,
|
|
4389
|
-
properties,
|
|
4390
|
-
exampleFiles
|
|
4391
|
-
}) => `
|
|
4392
|
-
${componentDefaultDescription({
|
|
4393
|
-
sysName,
|
|
4394
|
-
modelName,
|
|
4395
|
-
ModelName,
|
|
4396
|
-
exampleFiles,
|
|
4397
|
-
constant,
|
|
4398
|
-
properties
|
|
4399
|
-
})}
|
|
4400
|
-
\uC694\uCCAD\uC0AC\uD56D
|
|
4401
|
-
- \uC544\uB798 \uC81C\uACF5\uD560 \uAE30\uBCF8 \uD15C\uD50C\uB9BF \uCF54\uB4DC\uC5D0 \uCD94\uAC00\uB85C \uCEF4\uD3EC\uB10C\uD2B8 \uAC1C\uBC1C
|
|
4402
|
-
- ${ModelName}.Template.tsx \uCF54\uB4DC \uC791\uC131
|
|
4403
|
-
- \uCEF4\uD3EC\uB10C\uD2B8 \uC774\uB984\uC740 \uBAA8\uB378 \uC774\uB984\uC740 \uC2A4\uD0A4\uB9C8\uC5D0 \uAE30\uBC18\uD55C \uAE30\uB2A5\uC5D0 \uCD08\uC810\uC744 \uB450\uACE0 \uC791\uC131
|
|
4404
|
-
- \uC544\uB798 \uC81C\uACF5\uD560 \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uC788\uB294 General \uCEF4\uD3EC\uB10C\uD2B8 1\uAC1C\uB97C \uC81C\uC678\uD55C \uB514\uC790\uC778 \uCEF4\uD3EC\uB10C\uD2B8 4\uAC1C \uAC1C\uBC1C
|
|
4405
|
-
- \uCD94\uC0C1\uD654 \uD574\uC57C\uD558\uB294 \uACBD\uC6B0\uAC00 \uC788\uC744 \uACBD\uC6B0\uC5D4 \uBB38\uC11C\uB97C \uB2E4\uC2DC \uCC38\uACE0\uD558\uACE0 \uC124\uBA85\uB41C \uB0B4\uC5D0\uC11C \uD574\uACB0\uD574\uC57C\uD568.
|
|
4406
|
-
- \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uB9DE\uAC8C \uC815\uB9AC\uD574\uC11C \uC81C\uACF5
|
|
4407
|
-
-
|
|
4408
|
-
|
|
4409
|
-
Application name: ${sysName}
|
|
4410
|
-
Model name: ${modelName}
|
|
4411
|
-
Target filename: ${ModelName}.Template.tsx
|
|
4370
|
+
7. ${modelName}\uC5D0\uC11C \uC885\uC18D\uB418\uB294 \uB2E4\uB978 \uBAA8\uB378\uB4E4\uC758 \uD0C0\uC785 \uC815\uC758
|
|
4371
|
+
${properties.map(
|
|
4372
|
+
(property) => `
|
|
4412
4373
|
\`\`\`
|
|
4374
|
+
${property.key}.constant.ts
|
|
4413
4375
|
|
|
4414
|
-
\`\`\`
|
|
4415
|
-
|
|
4416
|
-
|
|
4417
|
-
`;
|
|
4418
|
-
var requestView = ({
|
|
4419
|
-
sysName,
|
|
4420
|
-
modelName,
|
|
4421
|
-
ModelName,
|
|
4422
|
-
boilerplate,
|
|
4423
|
-
constant,
|
|
4424
|
-
properties,
|
|
4425
|
-
exampleFiles
|
|
4426
|
-
}) => `
|
|
4427
|
-
${componentDefaultDescription({
|
|
4428
|
-
sysName,
|
|
4429
|
-
modelName,
|
|
4430
|
-
ModelName,
|
|
4431
|
-
exampleFiles,
|
|
4432
|
-
constant,
|
|
4433
|
-
properties
|
|
4434
|
-
})}
|
|
4435
|
-
\uC694\uCCAD\uC0AC\uD56D
|
|
4436
|
-
- \uC544\uB798 \uC81C\uACF5\uD560 \uAE30\uBCF8 \uD15C\uD50C\uB9BF \uCF54\uB4DC\uC5D0 \uCD94\uAC00\uB85C \uCEF4\uD3EC\uB10C\uD2B8 \uAC1C\uBC1C
|
|
4437
|
-
- ${ModelName}.View.tsx \uCF54\uB4DC \uC791\uC131
|
|
4438
|
-
- \uCEF4\uD3EC\uB10C\uD2B8 \uC774\uB984\uC5D0 ${ModelName}\uC740 \uC0DD\uB7B5\uD558\uBA70, \uB514\uC790\uC778 \uC911\uC810\uC758 \uC774\uB984\uC73C\uB85C \uC791\uC131
|
|
4439
|
-
- \uC544\uB798 \uC81C\uACF5\uD560 \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uC788\uB294 General \uCEF4\uD3EC\uB10C\uD2B8 1\uAC1C\uB97C \uC81C\uC678\uD55C \uB514\uC790\uC778 \uCEF4\uD3EC\uB10C\uD2B8 4\uAC1C \uAC1C\uBC1C
|
|
4440
|
-
- \uCD94\uC0C1\uD654 \uD574\uC57C\uD558\uB294 \uACBD\uC6B0\uAC00 \uC788\uC744 \uACBD\uC6B0\uC5D4 \uBB38\uC11C\uB97C \uB2E4\uC2DC \uCC38\uACE0\uD558\uACE0 \uC124\uBA85\uB41C \uB0B4\uC5D0\uC11C \uD574\uACB0\uD574\uC57C\uD568.
|
|
4441
|
-
- \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uB9DE\uAC8C \uC815\uB9AC\uD574\uC11C \uC81C\uACF5
|
|
4442
|
-
|
|
4443
|
-
|
|
4444
|
-
Application name: ${sysName}
|
|
4445
|
-
Model name: ${modelName}
|
|
4446
4376
|
|
|
4447
|
-
|
|
4448
|
-
\`\`\`
|
|
4449
|
-
${boilerplate}
|
|
4377
|
+
${property.source}
|
|
4450
4378
|
\`\`\`
|
|
4379
|
+
`
|
|
4380
|
+
).join("\n\n")}
|
|
4451
4381
|
|
|
4452
|
-
|
|
4453
|
-
`;
|
|
4454
|
-
var requestUnit = ({
|
|
4455
|
-
sysName,
|
|
4456
|
-
modelName,
|
|
4457
|
-
ModelName,
|
|
4458
|
-
constant,
|
|
4459
|
-
properties,
|
|
4460
|
-
boilerplate,
|
|
4461
|
-
exampleFiles
|
|
4462
|
-
}) => `
|
|
4463
|
-
${componentDefaultDescription({
|
|
4464
|
-
sysName,
|
|
4465
|
-
modelName,
|
|
4466
|
-
ModelName,
|
|
4467
|
-
exampleFiles,
|
|
4468
|
-
constant,
|
|
4469
|
-
properties
|
|
4470
|
-
})}
|
|
4471
|
-
|
|
4472
|
-
\uC694\uCCAD\uC0AC\uD56D
|
|
4473
|
-
- \uC544\uB798 \uC81C\uACF5\uD560 \uAE30\uBCF8 \uD15C\uD50C\uB9BF \uCF54\uB4DC\uC5D0 \uCD94\uAC00\uB85C \uCEF4\uD3EC\uB10C\uD2B8 \uAC1C\uBC1C
|
|
4474
|
-
- ${ModelName}.Unit.tsx \uCF54\uB4DC \uC791\uC131
|
|
4475
|
-
- \uCEF4\uD3EC\uB10C\uD2B8 \uC774\uB984\uC5D0 ${ModelName}\uC740 \uC0DD\uB7B5\uD558\uBA70, \uB514\uC790\uC778 \uC911\uC810\uC758 \uC774\uB984\uC73C\uB85C \uC791\uC131
|
|
4476
|
-
- \uC608\uC2DC\uD30C\uC77C \uCEF4\uD3EC\uB10C\uD2B8\uC758 \uAE30\uBC18\uD558\uC5EC \uC77C\uBC18\uC801\uC73C\uB85C \uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCEF4\uD3EC\uB10C\uD2B8 1\uAC1C\uC640 \uB514\uC790\uC778\uC801 \uC694\uC18C\uAC00 \uD3EC\uD568\uB41C \uCEF4\uD3EC\uB10C\uD2B8 3\uAC1C \uAC1C\uBC1C
|
|
4477
|
-
- \uCD94\uC0C1\uD654 \uD574\uC57C\uD558\uB294 \uACBD\uC6B0\uAC00 \uC788\uC744 \uACBD\uC6B0\uC5D4 \uBB38\uC11C\uB97C \uB2E4\uC2DC \uCC38\uACE0\uD558\uACE0 \uC124\uBA85\uB41C \uB0B4\uC5D0\uC11C \uD574\uACB0\uD574\uC57C\uD568.
|
|
4478
|
-
- \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uB9DE\uAC8C \uC815\uB9AC\uD574\uC11C \uC81C\uACF5
|
|
4479
|
-
|
|
4480
|
-
|
|
4481
|
-
Application name: ${sysName}
|
|
4482
|
-
Model name: ${modelName}
|
|
4483
4382
|
|
|
4484
|
-
|
|
4383
|
+
8. \uC608\uC2DC \uD30C\uC77C\uB4E4
|
|
4384
|
+
${exampleFiles.map(
|
|
4385
|
+
(example) => `
|
|
4386
|
+
Example filename: ${example.filepath}
|
|
4485
4387
|
\`\`\`
|
|
4486
|
-
${
|
|
4388
|
+
${example.content}
|
|
4487
4389
|
\`\`\`
|
|
4390
|
+
`
|
|
4391
|
+
).join("\n\n")}
|
|
4488
4392
|
|
|
4489
|
-
|
|
4490
4393
|
`;
|
|
4491
4394
|
|
|
4492
4395
|
// pkgs/@akanjs/cli/src/application/application.prompt.ts
|
|
@@ -4540,6 +4443,7 @@ var ApplicationRunner = class {
|
|
|
4540
4443
|
}
|
|
4541
4444
|
async removeApplication(app) {
|
|
4542
4445
|
await app.workspace.exec(`rm -rf apps/${app.name}`);
|
|
4446
|
+
app.workspace.unsetTsPaths("app", app.name);
|
|
4543
4447
|
}
|
|
4544
4448
|
async getConfig(app) {
|
|
4545
4449
|
return await getAppConfig(app.cwdPath, {
|
|
@@ -5186,8 +5090,8 @@ var ApplicationScript = class {
|
|
|
5186
5090
|
// pkgs/@akanjs/cli/src/application/application.command.ts
|
|
5187
5091
|
var ApplicationCommand = class {
|
|
5188
5092
|
applicationScript = new ApplicationScript();
|
|
5189
|
-
async createApplication(
|
|
5190
|
-
await this.applicationScript.createApplication(
|
|
5093
|
+
async createApplication(appName, start, workspace) {
|
|
5094
|
+
await this.applicationScript.createApplication(appName.toLowerCase().replace(/ /g, "-"), workspace, { start });
|
|
5191
5095
|
}
|
|
5192
5096
|
async removeApplication(app) {
|
|
5193
5097
|
await this.applicationScript.removeApplication(app);
|
|
@@ -5264,7 +5168,7 @@ var ApplicationCommand = class {
|
|
|
5264
5168
|
};
|
|
5265
5169
|
__decorateClass([
|
|
5266
5170
|
Target.Public(),
|
|
5267
|
-
__decorateParam(0,
|
|
5171
|
+
__decorateParam(0, Argument("appName", { desc: "name of application" })),
|
|
5268
5172
|
__decorateParam(1, Option("start", { type: "boolean", desc: "start application", default: false })),
|
|
5269
5173
|
__decorateParam(2, Workspace())
|
|
5270
5174
|
], ApplicationCommand.prototype, "createApplication", 1);
|
|
@@ -5413,10 +5317,11 @@ var PackageRunner = class {
|
|
|
5413
5317
|
template: "pkgRoot",
|
|
5414
5318
|
dict: { pkgName, PkgName: capitalize(pkgName) }
|
|
5415
5319
|
});
|
|
5320
|
+
workspace.setTsPaths("pkg", pkgName);
|
|
5416
5321
|
}
|
|
5417
5322
|
async removePackage(pkg) {
|
|
5418
5323
|
await pkg.workspace.exec(`rm -rf pkgs/${pkg.name}`);
|
|
5419
|
-
pkg.
|
|
5324
|
+
pkg.workspace.unsetTsPaths("pkg", pkg.name);
|
|
5420
5325
|
}
|
|
5421
5326
|
async scanSync(pkg) {
|
|
5422
5327
|
const scanResult = await pkg.scan();
|
|
@@ -5700,8 +5605,8 @@ CloudCommand = __decorateClass([
|
|
|
5700
5605
|
// pkgs/@akanjs/cli/src/library/library.command.ts
|
|
5701
5606
|
var LibraryCommand = class {
|
|
5702
5607
|
libraryScript = new LibraryScript();
|
|
5703
|
-
async createLibrary(
|
|
5704
|
-
await this.libraryScript.createLibrary(
|
|
5608
|
+
async createLibrary(libName, workspace) {
|
|
5609
|
+
await this.libraryScript.createLibrary(libName.toLowerCase().replace(/ /g, "-"), workspace);
|
|
5705
5610
|
}
|
|
5706
5611
|
async removeLibrary(lib) {
|
|
5707
5612
|
await this.libraryScript.removeLibrary(lib);
|
|
@@ -5709,8 +5614,8 @@ var LibraryCommand = class {
|
|
|
5709
5614
|
async syncLibrary(lib) {
|
|
5710
5615
|
await this.libraryScript.syncLibrary(lib);
|
|
5711
5616
|
}
|
|
5712
|
-
async installLibrary(
|
|
5713
|
-
await this.libraryScript.installLibrary(workspace,
|
|
5617
|
+
async installLibrary(libName, workspace) {
|
|
5618
|
+
await this.libraryScript.installLibrary(workspace, libName);
|
|
5714
5619
|
}
|
|
5715
5620
|
async pushLibrary(lib, branch) {
|
|
5716
5621
|
await this.libraryScript.pushLibrary(lib, branch);
|
|
@@ -5721,7 +5626,7 @@ var LibraryCommand = class {
|
|
|
5721
5626
|
};
|
|
5722
5627
|
__decorateClass([
|
|
5723
5628
|
Target.Public(),
|
|
5724
|
-
__decorateParam(0,
|
|
5629
|
+
__decorateParam(0, Argument("libName", { desc: "name of library" })),
|
|
5725
5630
|
__decorateParam(1, Workspace())
|
|
5726
5631
|
], LibraryCommand.prototype, "createLibrary", 1);
|
|
5727
5632
|
__decorateClass([
|
|
@@ -5734,7 +5639,7 @@ __decorateClass([
|
|
|
5734
5639
|
], LibraryCommand.prototype, "syncLibrary", 1);
|
|
5735
5640
|
__decorateClass([
|
|
5736
5641
|
Target.Public(),
|
|
5737
|
-
__decorateParam(0,
|
|
5642
|
+
__decorateParam(0, Argument("libName", { desc: "name of library", nullable: true })),
|
|
5738
5643
|
__decorateParam(1, Workspace())
|
|
5739
5644
|
], LibraryCommand.prototype, "installLibrary", 1);
|
|
5740
5645
|
__decorateClass([
|
|
@@ -5751,15 +5656,325 @@ LibraryCommand = __decorateClass([
|
|
|
5751
5656
|
Commands()
|
|
5752
5657
|
], LibraryCommand);
|
|
5753
5658
|
|
|
5754
|
-
// pkgs/@akanjs/cli/src/module/module.
|
|
5659
|
+
// pkgs/@akanjs/cli/src/module/module.command.ts
|
|
5755
5660
|
var import_prompts8 = require("@inquirer/prompts");
|
|
5661
|
+
|
|
5662
|
+
// pkgs/@akanjs/cli/src/module/module.script.ts
|
|
5756
5663
|
var import_fs10 = __toESM(require("fs"));
|
|
5757
5664
|
|
|
5665
|
+
// pkgs/@akanjs/cli/src/module/module.request.ts
|
|
5666
|
+
var requestConstant = ({
|
|
5667
|
+
sysName,
|
|
5668
|
+
modelName,
|
|
5669
|
+
modelDesc,
|
|
5670
|
+
modelSchemaDesign,
|
|
5671
|
+
boilerplate,
|
|
5672
|
+
exampleFiles
|
|
5673
|
+
}) => `
|
|
5674
|
+
\uB108\uB294 Akan.js\uB77C\uB294 \uC0AC\uB0B4 \uD504\uB808\uC784\uC6CC\uD06C\uB85C Typescript \uAE30\uBC18 \uD504\uB85C\uADF8\uB7A8\uC744 \uC791\uC131\uD558\uB294 \uC2DC\uB2C8\uC5B4 \uAC1C\uBC1C\uC790\uC57C.
|
|
5675
|
+
\uB2E4\uC74C\uC758 \uBC30\uACBD \uC815\uBCF4\uB97C \uBC14\uD0D5\uC73C\uB85C ${modelName}.constant.ts \uD30C\uC77C\uC744 \uC791\uC131\uD574\uC918.
|
|
5676
|
+
|
|
5677
|
+
1. Akan.js \uD504\uB808\uC784\uC6CC\uD06C\uC5D0 \uB300\uD55C \uAC1C\uC694
|
|
5678
|
+
${frameworkAbstract}
|
|
5679
|
+
|
|
5680
|
+
2. <model>.constant.ts \uD30C\uC77C\uC5D0 \uB300\uD55C \uAC1C\uC694
|
|
5681
|
+
${scalarConstantDescription}
|
|
5682
|
+
|
|
5683
|
+
3. <model>.constant.ts \uD30C\uC77C\uC758 Enum \uC791\uC131\uBC95
|
|
5684
|
+
${howToSetEnumInModelConstant}
|
|
5685
|
+
|
|
5686
|
+
4. <model>.constant.ts \uD30C\uC77C\uC758 Field \uC791\uC131\uBC95
|
|
5687
|
+
${howToSetFieldInModelConstant}
|
|
5688
|
+
|
|
5689
|
+
5. \uD604\uC7AC \uD504\uB85C\uC81D\uD2B8 \uB0B4 \uB2E4\uB978 constant.ts \uD30C\uC77C\uB4E4\uC5D0 \uB300\uD55C \uC608\uC2DC
|
|
5690
|
+
${exampleFiles.map(
|
|
5691
|
+
(constant) => `
|
|
5692
|
+
Example file: ${constant.filepath}
|
|
5693
|
+
\`\`\`
|
|
5694
|
+
${constant.content}
|
|
5695
|
+
\`\`\`
|
|
5696
|
+
`
|
|
5697
|
+
).join("\n")}
|
|
5698
|
+
|
|
5699
|
+
|
|
5700
|
+
\uC704 \uB0B4\uC6A9\uB4E4\uC744 \uBC14\uD0D5\uC73C\uB85C \uD30C\uC2F1\uD558\uAE30 \uC27D\uAC8C \uC544\uB798\uC5D0 \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uB9DE\uAC8C \uC815\uB9AC\uD574\uC11C \uC918
|
|
5701
|
+
|
|
5702
|
+
Application name: ${sysName}
|
|
5703
|
+
Model name: ${modelName}
|
|
5704
|
+
Model description: ${modelDesc}
|
|
5705
|
+
Model schema design: ${modelSchemaDesign}
|
|
5706
|
+
|
|
5707
|
+
Target filename: ${modelName}.constant.ts
|
|
5708
|
+
\`\`\`
|
|
5709
|
+
${boilerplate}
|
|
5710
|
+
\`\`\`
|
|
5711
|
+
`;
|
|
5712
|
+
var requestDictionary = ({
|
|
5713
|
+
sysName,
|
|
5714
|
+
modelName,
|
|
5715
|
+
constant,
|
|
5716
|
+
modelDesc,
|
|
5717
|
+
modelSchemaDesign,
|
|
5718
|
+
boilerplate,
|
|
5719
|
+
exampleFiles
|
|
5720
|
+
}) => `
|
|
5721
|
+
|
|
5722
|
+
|
|
5723
|
+
-${modelName}\uC758 \uC2A4\uD0A4\uB9C8 \uC815\uC758.
|
|
5724
|
+
\`\`\`
|
|
5725
|
+
${constant}
|
|
5726
|
+
\`\`\`
|
|
5727
|
+
|
|
5728
|
+
\uC5ED\uD560\uBD80\uC5EC
|
|
5729
|
+
- Akan.js \uC0AC\uB0B4 \uD504\uB808\uC784\uC6CC\uD06C \uAE30\uBC18 \uC720\uCC3D\uD55C \uBC88\uC5ED\uAC00.
|
|
5730
|
+
|
|
5731
|
+
\uC5C4\uACA9\uD55C \uC8FC\uC758\uC0AC\uD56D
|
|
5732
|
+
- \uBAA8\uB4E0 \uBB38\uC7A5\uC740 \uBB38\uBC95\uC801\uC73C\uB85C \uC62C\uBC14\uB974\uAC8C \uC791\uC131
|
|
5733
|
+
- \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uB0B4 signalDictionary \uBD80\uBD84\uC740 \uADF8\uB300\uB85C \uC720\uC9C0
|
|
5734
|
+
|
|
5735
|
+
\uC694\uCCAD\uC0AC\uD56D
|
|
5736
|
+
- \uC544\uB798 \uC81C\uACF5\uD560 \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uB9DE\uCDB0 \uBC88\uC5ED\uBCF8 \uC18C\uC2A4\uCF54\uB4DC \uC81C\uACF5
|
|
5737
|
+
|
|
5738
|
+
|
|
5739
|
+
|
|
5740
|
+
Application name: ${sysName}
|
|
5741
|
+
Model name: ${modelName}
|
|
5742
|
+
Model description: ${modelDesc}
|
|
5743
|
+
Model schema design: ${modelSchemaDesign}
|
|
5744
|
+
|
|
5745
|
+
Target filename: ${modelName}.dictionary.ts
|
|
5746
|
+
\`\`\`
|
|
5747
|
+
${boilerplate}
|
|
5748
|
+
\`\`\`
|
|
5749
|
+
`;
|
|
5750
|
+
var requestScalarConstant = ({
|
|
5751
|
+
sysName,
|
|
5752
|
+
modelName,
|
|
5753
|
+
modelDesc,
|
|
5754
|
+
modelSchemaDesign,
|
|
5755
|
+
boilerplate,
|
|
5756
|
+
exampleFiles
|
|
5757
|
+
}) => `
|
|
5758
|
+
\uB108\uB294 Akan.js\uB77C\uB294 \uC0AC\uB0B4 \uD504\uB808\uC784\uC6CC\uD06C\uB85C Typescript \uAE30\uBC18 \uD504\uB85C\uADF8\uB7A8\uC744 \uC791\uC131\uD558\uB294 \uC2DC\uB2C8\uC5B4 \uAC1C\uBC1C\uC790\uC57C.
|
|
5759
|
+
\uB2E4\uC74C\uC758 \uBC30\uACBD \uC815\uBCF4\uB97C \uBC14\uD0D5\uC73C\uB85C ${modelName}.constant.ts \uD30C\uC77C\uC744 \uC791\uC131\uD574\uC918.
|
|
5760
|
+
|
|
5761
|
+
1. Akan.js \uD504\uB808\uC784\uC6CC\uD06C\uC5D0 \uB300\uD55C \uAC1C\uC694
|
|
5762
|
+
${frameworkAbstract}
|
|
5763
|
+
|
|
5764
|
+
2. <model>.constant.ts \uD30C\uC77C\uC5D0 \uB300\uD55C \uAC1C\uC694
|
|
5765
|
+
${scalarConstantDescription}
|
|
5766
|
+
|
|
5767
|
+
3. <model>.constant.ts \uD30C\uC77C\uC758 Enum \uC791\uC131\uBC95
|
|
5768
|
+
${howToSetEnumInModelConstant}
|
|
5769
|
+
|
|
5770
|
+
4. <model>.constant.ts \uD30C\uC77C\uC758 Field \uC791\uC131\uBC95
|
|
5771
|
+
${howToSetFieldInModelConstant}
|
|
5772
|
+
|
|
5773
|
+
5. \uD604\uC7AC \uD504\uB85C\uC81D\uD2B8 \uB0B4 \uB2E4\uB978 constant.ts \uD30C\uC77C\uB4E4\uC5D0 \uB300\uD55C \uC608\uC2DC
|
|
5774
|
+
${exampleFiles.map(
|
|
5775
|
+
(constant) => `
|
|
5776
|
+
Example file: ${constant.filepath}
|
|
5777
|
+
\`\`\`
|
|
5778
|
+
${constant.content}
|
|
5779
|
+
\`\`\`
|
|
5780
|
+
`
|
|
5781
|
+
).join("\n")}
|
|
5782
|
+
|
|
5783
|
+
|
|
5784
|
+
\uC704 \uB0B4\uC6A9\uB4E4\uC744 \uBC14\uD0D5\uC73C\uB85C \uD30C\uC2F1\uD558\uAE30 \uC27D\uAC8C \uC544\uB798\uC5D0 \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uB9DE\uAC8C \uC815\uB9AC\uD574\uC11C \uC918
|
|
5785
|
+
|
|
5786
|
+
Application name: ${sysName}
|
|
5787
|
+
Model name: ${modelName}
|
|
5788
|
+
Model description: ${modelDesc}
|
|
5789
|
+
Model schema design: ${modelSchemaDesign}
|
|
5790
|
+
|
|
5791
|
+
Target filename: ${modelName}.constant.ts
|
|
5792
|
+
\`\`\`
|
|
5793
|
+
${boilerplate}
|
|
5794
|
+
\`\`\`
|
|
5795
|
+
`;
|
|
5796
|
+
var requestTemplate = ({
|
|
5797
|
+
sysName,
|
|
5798
|
+
modelName,
|
|
5799
|
+
ModelName,
|
|
5800
|
+
boilerplate,
|
|
5801
|
+
constant,
|
|
5802
|
+
properties,
|
|
5803
|
+
exampleFiles
|
|
5804
|
+
}) => `
|
|
5805
|
+
${componentDefaultDescription({
|
|
5806
|
+
sysName,
|
|
5807
|
+
modelName,
|
|
5808
|
+
ModelName: ModelName ?? capitalize(modelName),
|
|
5809
|
+
exampleFiles,
|
|
5810
|
+
constant,
|
|
5811
|
+
properties
|
|
5812
|
+
})}
|
|
5813
|
+
\uC5ED\uD560\uBD80\uC5EC
|
|
5814
|
+
- Akan.js \uC0AC\uB0B4 \uD504\uB808\uC784\uC6CC\uD06C \uAE30\uBC18 Typescript \uC2DC\uB2C8\uC5B4 \uD504\uB860\uD2B8\uC5D4\uB4DC \uAC1C\uBC1C\uC790.
|
|
5815
|
+
|
|
5816
|
+
\uCF54\uB529 \uADDC\uCE59
|
|
5817
|
+
- \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5818
|
+
- \uC544\uC774\uCF58: react-icons \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5819
|
+
- CSS: tailwind, DaisyUI(btn, input, badge \uAC19\uC740 \uAE30\uBCF8 \uC694\uC18C\uB9CC \uC0AC\uC6A9 \uAC00\uB2A5, card/hero \uAC19\uC740 \uBCF5\uC7A1\uD55C \uCEF4\uD3EC\uB10C\uD2B8 \uC0AC\uC6A9 X) \uC0AC\uC6A9
|
|
5820
|
+
- Ui Component: @util/ui \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5821
|
+
- \uC870\uAC74\uBD80 \uD074\uB798\uC2A4: clsx \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5822
|
+
\uCF54\uB4DC \uC2A4\uD0C0\uC77C
|
|
5823
|
+
- \uC0C9\uC0C1: \uD558\uB4DC\uCF54\uB529(bg-red) \uB300\uC2E0 \uD14C\uB9C8 \uC0C9\uC0C1(bg-primary) \uC0AC\uC6A9
|
|
5824
|
+
- \uC870\uAC74\uBD80 \uB80C\uB354\uB9C1: field && <div>... \uB300\uC2E0 field ? <div>... : null \uC0AC\uC6A9
|
|
5825
|
+
- \uBAA8\uB378 \uC811\uADFC: \uAD6C\uC870\uBD84\uD574\uD560\uB2F9 \uB300\uC2E0 ${modelName}.field \uD615\uC2DD\uC73C\uB85C \uC811\uADFC
|
|
5826
|
+
- \uD0C0\uC785 \uC548\uC804: ${modelName}.constant.ts\uC758 \uC2A4\uD0A4\uB9C8 \uCC38\uC870\uD558\uC5EC \uC5D0\uB7EC \uBC29\uC9C0
|
|
5827
|
+
\uD544\uB4DC \uC811\uADFC \uC804: \uC2A4\uD0A4\uB9C8\uC758 \uC2E4\uC81C \uD544\uB4DC \uB9AC\uC2A4\uD2B8 \uC791\uC131 \uBC0F \uAC80\uD1A0 \uD544\uC218
|
|
5828
|
+
|
|
5829
|
+
\uC5C4\uACA9\uD55C \uC8FC\uC758\uC0AC\uD56D
|
|
5830
|
+
- UI \uD0B7\uC740 \uBB38\uC11C\uC5D0 \uBA85\uC2DC\uB41C \uCEF4\uD3EC\uB10C\uD2B8\uB9CC \uC0AC\uC6A9
|
|
5831
|
+
- \uCEF4\uD3EC\uB10C\uD2B8 \uC0AC\uC6A9 \uC804 \uBB38\uC11C \uD655\uC778 \uBC0F props \uC815\uD655\uD788 \uAC80\uC99D
|
|
5832
|
+
- \uBA85\uC2DC\uB41C \uB8F0 \uC678 \uC784\uC758 \uCD94\uC0C1\uD654 \uAE08\uC9C0
|
|
5833
|
+
- dayjs \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB294 @akanjs/base\uC5D0\uC11C \uB798\uD551\uD558\uC5EC \uC81C\uACF5\uD558\uACE0 \uC788\uC74C.
|
|
5834
|
+
|
|
5835
|
+
\uC694\uCCAD\uC0AC\uD56D
|
|
5836
|
+
- \uC544\uB798 \uC81C\uACF5\uD560 \uAE30\uBCF8 \uD15C\uD50C\uB9BF \uCF54\uB4DC\uC5D0 \uCD94\uAC00\uB85C \uCEF4\uD3EC\uB10C\uD2B8 \uAC1C\uBC1C
|
|
5837
|
+
- ${ModelName}.Template.tsx \uCF54\uB4DC \uC791\uC131
|
|
5838
|
+
- \uCEF4\uD3EC\uB10C\uD2B8 \uC774\uB984\uC740 \uBAA8\uB378 \uC774\uB984\uC740 \uC2A4\uD0A4\uB9C8\uC5D0 \uAE30\uBC18\uD55C \uAE30\uB2A5\uC5D0 \uCD08\uC810\uC744 \uB450\uACE0 \uC791\uC131
|
|
5839
|
+
- \uC544\uB798 \uC81C\uACF5\uD560 \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uC788\uB294 General \uCEF4\uD3EC\uB10C\uD2B8 1\uAC1C\uB97C \uC81C\uC678\uD55C \uB514\uC790\uC778 \uCEF4\uD3EC\uB10C\uD2B8 4\uAC1C \uAC1C\uBC1C
|
|
5840
|
+
- \uCD94\uC0C1\uD654 \uD574\uC57C\uD558\uB294 \uACBD\uC6B0\uAC00 \uC788\uC744 \uACBD\uC6B0\uC5D4 \uBB38\uC11C\uB97C \uB2E4\uC2DC \uCC38\uACE0\uD558\uACE0 \uC124\uBA85\uB41C \uB0B4\uC5D0\uC11C \uD574\uACB0\uD574\uC57C\uD568.
|
|
5841
|
+
- \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uB9DE\uAC8C \uC815\uB9AC\uD574\uC11C \uC81C\uACF5
|
|
5842
|
+
-
|
|
5843
|
+
|
|
5844
|
+
Application name: ${sysName}
|
|
5845
|
+
Model name: ${modelName}
|
|
5846
|
+
Target filename: ${ModelName}.Template.tsx
|
|
5847
|
+
\`\`\`
|
|
5848
|
+
${boilerplate}
|
|
5849
|
+
\`\`\`
|
|
5850
|
+
|
|
5851
|
+
|
|
5852
|
+
`;
|
|
5853
|
+
var requestView = ({
|
|
5854
|
+
sysName,
|
|
5855
|
+
modelName,
|
|
5856
|
+
ModelName,
|
|
5857
|
+
boilerplate,
|
|
5858
|
+
constant,
|
|
5859
|
+
properties,
|
|
5860
|
+
exampleFiles
|
|
5861
|
+
}) => `
|
|
5862
|
+
${componentDefaultDescription({
|
|
5863
|
+
sysName,
|
|
5864
|
+
modelName,
|
|
5865
|
+
ModelName: ModelName ?? capitalize(modelName),
|
|
5866
|
+
exampleFiles,
|
|
5867
|
+
constant,
|
|
5868
|
+
properties
|
|
5869
|
+
})}
|
|
5870
|
+
|
|
5871
|
+
\uC5ED\uD560\uBD80\uC5EC
|
|
5872
|
+
- Akan.js \uC0AC\uB0B4 \uD504\uB808\uC784\uC6CC\uD06C \uAE30\uBC18 Typescript \uC2DC\uB2C8\uC5B4 \uD504\uB860\uD2B8\uC5D4\uB4DC \uAC1C\uBC1C\uC790.
|
|
5873
|
+
|
|
5874
|
+
\uCF54\uB529 \uADDC\uCE59
|
|
5875
|
+
- \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5876
|
+
- \uC544\uC774\uCF58: react-icons \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5877
|
+
- CSS: tailwind, DaisyUI(btn, input, badge \uAC19\uC740 \uAE30\uBCF8 \uC694\uC18C\uB9CC \uC0AC\uC6A9 \uAC00\uB2A5, card/hero \uAC19\uC740 \uBCF5\uC7A1\uD55C \uCEF4\uD3EC\uB10C\uD2B8 \uC0AC\uC6A9 X) \uC0AC\uC6A9
|
|
5878
|
+
- Ui Component: @util/ui \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5879
|
+
- \uC870\uAC74\uBD80 \uD074\uB798\uC2A4: clsx \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5880
|
+
\uCF54\uB4DC \uC2A4\uD0C0\uC77C
|
|
5881
|
+
- \uC0C9\uC0C1: \uD558\uB4DC\uCF54\uB529(bg-red) \uB300\uC2E0 \uD14C\uB9C8 \uC0C9\uC0C1(bg-primary) \uC0AC\uC6A9
|
|
5882
|
+
- \uC870\uAC74\uBD80 \uB80C\uB354\uB9C1: field && <div>... \uB300\uC2E0 field ? <div>... : null \uC0AC\uC6A9
|
|
5883
|
+
- \uBAA8\uB378 \uC811\uADFC: \uAD6C\uC870\uBD84\uD574\uD560\uB2F9 \uB300\uC2E0 ${modelName}.field \uD615\uC2DD\uC73C\uB85C \uC811\uADFC
|
|
5884
|
+
- \uD0C0\uC785 \uC548\uC804: ${modelName}.constant.ts\uC758 \uC2A4\uD0A4\uB9C8 \uCC38\uC870\uD558\uC5EC \uC5D0\uB7EC \uBC29\uC9C0
|
|
5885
|
+
\uD544\uB4DC \uC811\uADFC \uC804: \uC2A4\uD0A4\uB9C8\uC758 \uC2E4\uC81C \uD544\uB4DC \uB9AC\uC2A4\uD2B8 \uC791\uC131 \uBC0F \uAC80\uD1A0 \uD544\uC218
|
|
5886
|
+
|
|
5887
|
+
\uC5C4\uACA9\uD55C \uC8FC\uC758\uC0AC\uD56D
|
|
5888
|
+
- UI \uD0B7\uC740 \uBB38\uC11C\uC5D0 \uBA85\uC2DC\uB41C \uCEF4\uD3EC\uB10C\uD2B8\uB9CC \uC0AC\uC6A9
|
|
5889
|
+
- \uCEF4\uD3EC\uB10C\uD2B8 \uC0AC\uC6A9 \uC804 \uBB38\uC11C \uD655\uC778 \uBC0F props \uC815\uD655\uD788 \uAC80\uC99D
|
|
5890
|
+
- \uBA85\uC2DC\uB41C \uB8F0 \uC678 \uC784\uC758 \uCD94\uC0C1\uD654 \uAE08\uC9C0
|
|
5891
|
+
- dayjs \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB294 @akanjs/base\uC5D0\uC11C \uB798\uD551\uD558\uC5EC \uC81C\uACF5\uD558\uACE0 \uC788\uC74C.
|
|
5892
|
+
|
|
5893
|
+
\uC694\uCCAD\uC0AC\uD56D
|
|
5894
|
+
- \uC544\uB798 \uC81C\uACF5\uD560 \uAE30\uBCF8 \uD15C\uD50C\uB9BF \uCF54\uB4DC\uC5D0 \uCD94\uAC00\uB85C \uCEF4\uD3EC\uB10C\uD2B8 \uAC1C\uBC1C
|
|
5895
|
+
- ${ModelName}.View.tsx \uCF54\uB4DC \uC791\uC131
|
|
5896
|
+
- \uCEF4\uD3EC\uB10C\uD2B8 \uC774\uB984\uC5D0 ${ModelName}\uC740 \uC0DD\uB7B5\uD558\uBA70, \uB514\uC790\uC778 \uC911\uC810\uC758 \uC774\uB984\uC73C\uB85C \uC791\uC131
|
|
5897
|
+
- \uC544\uB798 \uC81C\uACF5\uD560 \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uC788\uB294 General \uCEF4\uD3EC\uB10C\uD2B8 1\uAC1C\uB97C \uC81C\uC678\uD55C \uB514\uC790\uC778 \uCEF4\uD3EC\uB10C\uD2B8 4\uAC1C \uAC1C\uBC1C
|
|
5898
|
+
- \uCD94\uC0C1\uD654 \uD574\uC57C\uD558\uB294 \uACBD\uC6B0\uAC00 \uC788\uC744 \uACBD\uC6B0\uC5D4 \uBB38\uC11C\uB97C \uB2E4\uC2DC \uCC38\uACE0\uD558\uACE0 \uC124\uBA85\uB41C \uB0B4\uC5D0\uC11C \uD574\uACB0\uD574\uC57C\uD568.
|
|
5899
|
+
- \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uB9DE\uAC8C \uC815\uB9AC\uD574\uC11C \uC81C\uACF5
|
|
5900
|
+
|
|
5901
|
+
|
|
5902
|
+
Application name: ${sysName}
|
|
5903
|
+
Model name: ${modelName}
|
|
5904
|
+
|
|
5905
|
+
Target filename: ${ModelName}.View.tsx
|
|
5906
|
+
\`\`\`
|
|
5907
|
+
${boilerplate}
|
|
5908
|
+
\`\`\`
|
|
5909
|
+
|
|
5910
|
+
|
|
5911
|
+
`;
|
|
5912
|
+
var requestUnit = ({
|
|
5913
|
+
sysName,
|
|
5914
|
+
modelName,
|
|
5915
|
+
ModelName,
|
|
5916
|
+
constant,
|
|
5917
|
+
properties,
|
|
5918
|
+
boilerplate,
|
|
5919
|
+
exampleFiles
|
|
5920
|
+
}) => `
|
|
5921
|
+
${componentDefaultDescription({
|
|
5922
|
+
sysName,
|
|
5923
|
+
modelName,
|
|
5924
|
+
ModelName: ModelName ?? capitalize(modelName),
|
|
5925
|
+
exampleFiles,
|
|
5926
|
+
constant,
|
|
5927
|
+
properties
|
|
5928
|
+
})}
|
|
5929
|
+
|
|
5930
|
+
\uC5ED\uD560\uBD80\uC5EC
|
|
5931
|
+
- Akan.js \uC0AC\uB0B4 \uD504\uB808\uC784\uC6CC\uD06C \uAE30\uBC18 Typescript \uC2DC\uB2C8\uC5B4 \uD504\uB860\uD2B8\uC5D4\uB4DC \uAC1C\uBC1C\uC790.
|
|
5932
|
+
|
|
5933
|
+
\uCF54\uB529 \uADDC\uCE59
|
|
5934
|
+
- \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5935
|
+
- \uC544\uC774\uCF58: react-icons \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5936
|
+
- CSS: tailwind, DaisyUI(btn, input, badge \uAC19\uC740 \uAE30\uBCF8 \uC694\uC18C\uB9CC \uC0AC\uC6A9 \uAC00\uB2A5, card/hero \uAC19\uC740 \uBCF5\uC7A1\uD55C \uCEF4\uD3EC\uB10C\uD2B8 \uC0AC\uC6A9 X) \uC0AC\uC6A9
|
|
5937
|
+
- Ui Component: @util/ui \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5938
|
+
- \uC870\uAC74\uBD80 \uD074\uB798\uC2A4: clsx \uB77C\uC774\uBE0C\uB7EC\uB9AC \uC0AC\uC6A9
|
|
5939
|
+
\uCF54\uB4DC \uC2A4\uD0C0\uC77C
|
|
5940
|
+
- \uC0C9\uC0C1: \uD558\uB4DC\uCF54\uB529(bg-red) \uB300\uC2E0 \uD14C\uB9C8 \uC0C9\uC0C1(bg-primary) \uC0AC\uC6A9
|
|
5941
|
+
- \uC870\uAC74\uBD80 \uB80C\uB354\uB9C1: field && <div>... \uB300\uC2E0 field ? <div>... : null \uC0AC\uC6A9
|
|
5942
|
+
- \uBAA8\uB378 \uC811\uADFC: \uAD6C\uC870\uBD84\uD574\uD560\uB2F9 \uB300\uC2E0 ${modelName}.field \uD615\uC2DD\uC73C\uB85C \uC811\uADFC
|
|
5943
|
+
- \uD0C0\uC785 \uC548\uC804: ${modelName}.constant.ts\uC758 \uC2A4\uD0A4\uB9C8 \uCC38\uC870\uD558\uC5EC \uC5D0\uB7EC \uBC29\uC9C0
|
|
5944
|
+
\uD544\uB4DC \uC811\uADFC \uC804: \uC2A4\uD0A4\uB9C8\uC758 \uC2E4\uC81C \uD544\uB4DC \uB9AC\uC2A4\uD2B8 \uC791\uC131 \uBC0F \uAC80\uD1A0 \uD544\uC218
|
|
5945
|
+
|
|
5946
|
+
\uC5C4\uACA9\uD55C \uC8FC\uC758\uC0AC\uD56D
|
|
5947
|
+
- UI \uD0B7\uC740 \uBB38\uC11C\uC5D0 \uBA85\uC2DC\uB41C \uCEF4\uD3EC\uB10C\uD2B8\uB9CC \uC0AC\uC6A9
|
|
5948
|
+
- \uCEF4\uD3EC\uB10C\uD2B8 \uC0AC\uC6A9 \uC804 \uBB38\uC11C \uD655\uC778 \uBC0F props \uC815\uD655\uD788 \uAC80\uC99D
|
|
5949
|
+
- \uBA85\uC2DC\uB41C \uB8F0 \uC678 \uC784\uC758 \uCD94\uC0C1\uD654 \uAE08\uC9C0
|
|
5950
|
+
- dayjs \uB77C\uC774\uBE0C\uB7EC\uB9AC\uB294 @akanjs/base\uC5D0\uC11C \uB798\uD551\uD558\uC5EC \uC81C\uACF5\uD558\uACE0 \uC788\uC74C.
|
|
5951
|
+
|
|
5952
|
+
\uC694\uCCAD\uC0AC\uD56D
|
|
5953
|
+
- \uC544\uB798 \uC81C\uACF5\uD560 \uAE30\uBCF8 \uD15C\uD50C\uB9BF \uCF54\uB4DC\uC5D0 \uCD94\uAC00\uB85C \uCEF4\uD3EC\uB10C\uD2B8 \uAC1C\uBC1C
|
|
5954
|
+
- ${ModelName}.Unit.tsx \uCF54\uB4DC \uC791\uC131
|
|
5955
|
+
- \uCEF4\uD3EC\uB10C\uD2B8 \uC774\uB984\uC5D0 ${ModelName}\uC740 \uC0DD\uB7B5\uD558\uBA70, \uB514\uC790\uC778 \uC911\uC810\uC758 \uC774\uB984\uC73C\uB85C \uC791\uC131
|
|
5956
|
+
- \uC608\uC2DC\uD30C\uC77C \uCEF4\uD3EC\uB10C\uD2B8\uC758 \uAE30\uBC18\uD558\uC5EC \uC77C\uBC18\uC801\uC73C\uB85C \uC0AC\uC6A9 \uAC00\uB2A5\uD55C \uCEF4\uD3EC\uB10C\uD2B8 1\uAC1C\uC640 \uB514\uC790\uC778\uC801 \uC694\uC18C\uAC00 \uD3EC\uD568\uB41C \uCEF4\uD3EC\uB10C\uD2B8 3\uAC1C \uAC1C\uBC1C
|
|
5957
|
+
- \uCD94\uC0C1\uD654 \uD574\uC57C\uD558\uB294 \uACBD\uC6B0\uAC00 \uC788\uC744 \uACBD\uC6B0\uC5D4 \uBB38\uC11C\uB97C \uB2E4\uC2DC \uCC38\uACE0\uD558\uACE0 \uC124\uBA85\uB41C \uB0B4\uC5D0\uC11C \uD574\uACB0\uD574\uC57C\uD568.
|
|
5958
|
+
- \uBCF4\uC77C\uB7EC\uD50C\uB808\uC774\uD2B8\uC5D0 \uB9DE\uAC8C \uC815\uB9AC\uD574\uC11C \uC81C\uACF5
|
|
5959
|
+
|
|
5960
|
+
|
|
5961
|
+
Application name: ${sysName}
|
|
5962
|
+
Model name: ${modelName}
|
|
5963
|
+
|
|
5964
|
+
Target filename: ${ModelName}.Unit.tsx
|
|
5965
|
+
\`\`\`
|
|
5966
|
+
${boilerplate}
|
|
5967
|
+
\`\`\`
|
|
5968
|
+
|
|
5969
|
+
|
|
5970
|
+
`;
|
|
5971
|
+
|
|
5758
5972
|
// pkgs/@akanjs/cli/src/module/module.runner.ts
|
|
5759
5973
|
var ModuleRunner = class {
|
|
5760
5974
|
async createModule(workspace, sysType, sysName, moduleName, description) {
|
|
5761
5975
|
}
|
|
5762
|
-
|
|
5976
|
+
removeModule(sys2, name) {
|
|
5977
|
+
sys2.removeDir(`${sys2.cwdPath}/lib/${name}`);
|
|
5763
5978
|
}
|
|
5764
5979
|
async createScalarTemplate(sys2, name) {
|
|
5765
5980
|
const akanConfig = await sys2.getConfig();
|
|
@@ -5787,11 +6002,25 @@ var ModuleRunner = class {
|
|
|
5787
6002
|
}
|
|
5788
6003
|
};
|
|
5789
6004
|
}
|
|
6005
|
+
async createDictionaryTemplate(sys2, name) {
|
|
6006
|
+
const akanConfig = await sys2.getConfig();
|
|
6007
|
+
const scanResult = await sys2.scan({ akanConfig });
|
|
6008
|
+
await sys2.applyTemplate({
|
|
6009
|
+
basePath: `./lib/${name}`,
|
|
6010
|
+
template: "dictionary",
|
|
6011
|
+
scanResult,
|
|
6012
|
+
dict: { model: name, Model: capitalize(name), sysName: sys2.name, SysName: capitalize(sys2.name) }
|
|
6013
|
+
});
|
|
6014
|
+
await sys2.scan({ akanConfig });
|
|
6015
|
+
return {
|
|
6016
|
+
dictionary: { filename: `${name}.dictionary.ts`, content: sys2.readFile(`lib/${name}/${name}.dictionary.ts`) }
|
|
6017
|
+
};
|
|
6018
|
+
}
|
|
5790
6019
|
async createComponentTemplate(sys2, name, type) {
|
|
5791
6020
|
const akanConfig = await sys2.getConfig();
|
|
5792
6021
|
const scanResult = await sys2.scan({ akanConfig });
|
|
5793
6022
|
await sys2.applyTemplate({
|
|
5794
|
-
basePath: `./lib/${name}
|
|
6023
|
+
basePath: `./lib/${name}`,
|
|
5795
6024
|
template: `module/__Model__.${capitalize(type)}.ts`,
|
|
5796
6025
|
scanResult,
|
|
5797
6026
|
dict: { model: name, Model: capitalize(name), appName: sys2.name }
|
|
@@ -5800,7 +6029,7 @@ var ModuleRunner = class {
|
|
|
5800
6029
|
return {
|
|
5801
6030
|
component: {
|
|
5802
6031
|
filename: `${name}.${capitalize(type)}.tsx`,
|
|
5803
|
-
content: sys2.readFile(`lib/${name}
|
|
6032
|
+
content: sys2.readFile(`lib/${name}/${capitalize(name)}.${capitalize(type)}.tsx`)
|
|
5804
6033
|
}
|
|
5805
6034
|
// constant: {
|
|
5806
6035
|
// filename: `${name}.constant.ts`,
|
|
@@ -5879,31 +6108,62 @@ var ModuleRunner = class {
|
|
|
5879
6108
|
// pkgs/@akanjs/cli/src/module/module.script.ts
|
|
5880
6109
|
var ModuleScript = class {
|
|
5881
6110
|
#runner = new ModuleRunner();
|
|
5882
|
-
|
|
6111
|
+
//! .command arg에 병합 필요.
|
|
6112
|
+
async createModuleTemplate(sys2, name, description) {
|
|
5883
6113
|
await this.#runner.createModuleTemplate(sys2, name);
|
|
6114
|
+
}
|
|
6115
|
+
async createModule(sys2, name, description, schemaDescription) {
|
|
6116
|
+
await AiSession.init();
|
|
6117
|
+
const session = new AiSession();
|
|
6118
|
+
const [appNames, libNames] = await sys2.workspace.getSyss();
|
|
6119
|
+
const moduleConstantExampleFiles = await sys2.workspace.getConstantFiles();
|
|
6120
|
+
const moduleDictionaryExampleFiles = await sys2.workspace.getDictionaryFiles();
|
|
6121
|
+
const { constant, dictionary } = await this.#runner.createModuleTemplate(sys2, name);
|
|
6122
|
+
sys2.log(`Module ${name} created in ${sys2.type}s/${sys2.name}/lib/${name}`);
|
|
6123
|
+
const constantContent = await session.editTypescript(
|
|
6124
|
+
requestConstant({
|
|
6125
|
+
sysName: sys2.name,
|
|
6126
|
+
modelName: name,
|
|
6127
|
+
modelDesc: description ?? "",
|
|
6128
|
+
modelSchemaDesign: schemaDescription ?? "",
|
|
6129
|
+
boilerplate: constant.content,
|
|
6130
|
+
exampleFiles: randomPicks(moduleConstantExampleFiles, Math.min(10, moduleConstantExampleFiles.length))
|
|
6131
|
+
})
|
|
6132
|
+
);
|
|
6133
|
+
sys2.writeFile(`lib/${name}/${name}.constant.ts`, constantContent);
|
|
6134
|
+
const dictionaryContent = await session.editTypescript(
|
|
6135
|
+
requestDictionary({
|
|
6136
|
+
sysName: sys2.name,
|
|
6137
|
+
modelName: name,
|
|
6138
|
+
constant: constantContent,
|
|
6139
|
+
modelDesc: description ?? "",
|
|
6140
|
+
modelSchemaDesign: schemaDescription ?? "",
|
|
6141
|
+
boilerplate: dictionary.content,
|
|
6142
|
+
exampleFiles: randomPicks(moduleConstantExampleFiles, Math.min(10, moduleConstantExampleFiles.length))
|
|
6143
|
+
})
|
|
6144
|
+
);
|
|
6145
|
+
sys2.writeFile(`lib/${name}/${name}.dictionary.ts`, dictionaryContent);
|
|
6146
|
+
await this.createView(sys2, name);
|
|
6147
|
+
await this.createUnit(sys2, name);
|
|
6148
|
+
await this.createTemplate(sys2, name);
|
|
5884
6149
|
sys2.log(`Module ${name} created in ${sys2.type}s/${sys2.name}/lib/${name}`);
|
|
5885
6150
|
}
|
|
5886
|
-
async
|
|
6151
|
+
async createModule_(sys2, name, description, schemaDescription) {
|
|
6152
|
+
await AiSession.init();
|
|
6153
|
+
const session = new AiSession();
|
|
5887
6154
|
const [appNames, libNames] = await sys2.workspace.getSyss();
|
|
5888
|
-
const
|
|
5889
|
-
|
|
5890
|
-
|
|
5891
|
-
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
path: `${appName}/${databaseModule}/${databaseModule}.constant.ts`,
|
|
5896
|
-
content: app.readFile(`lib/${databaseModule}/${databaseModule}.constant.ts`)
|
|
5897
|
-
}))
|
|
5898
|
-
);
|
|
5899
|
-
})
|
|
5900
|
-
)).flat()
|
|
5901
|
-
];
|
|
6155
|
+
const moduleConstantExampleFiles = await sys2.workspace.getConstantFiles();
|
|
6156
|
+
const moduleDictionaryExampleFiles = await sys2.workspace.getDictionaryFiles();
|
|
6157
|
+
sys2.log(`Module ${name} created in ${sys2.type}s/${sys2.name}/lib/${name}`);
|
|
6158
|
+
await this.createView(sys2, name);
|
|
6159
|
+
await this.createUnit(sys2, name);
|
|
6160
|
+
await this.createTemplate(sys2, name);
|
|
6161
|
+
sys2.log(`Module ${name} created in ${sys2.type}s/${sys2.name}/lib/${name}`);
|
|
5902
6162
|
}
|
|
5903
|
-
|
|
6163
|
+
removeModule(sys2, name) {
|
|
6164
|
+
this.#runner.removeModule(sys2, name);
|
|
5904
6165
|
}
|
|
5905
6166
|
async createScalar(sys2, name, description, schemaDescription) {
|
|
5906
|
-
await AiSession.init();
|
|
5907
6167
|
await AiSession.init();
|
|
5908
6168
|
const scalarConstantExampleFiles = await sys2.workspace.getScalarConstantFiles();
|
|
5909
6169
|
const { constant, dictionary } = await this.#runner.createScalarTemplate(sys2, name);
|
|
@@ -5915,7 +6175,7 @@ var ModuleScript = class {
|
|
|
5915
6175
|
modelDesc: description,
|
|
5916
6176
|
modelSchemaDesign: schemaDescription,
|
|
5917
6177
|
boilerplate: constant.content,
|
|
5918
|
-
|
|
6178
|
+
exampleFiles: randomPicks(scalarConstantExampleFiles, Math.min(10, scalarConstantExampleFiles.length))
|
|
5919
6179
|
})
|
|
5920
6180
|
);
|
|
5921
6181
|
sys2.writeFile(`lib/__scalar/${name}/${name}.constant.ts`, content);
|
|
@@ -5924,21 +6184,8 @@ var ModuleScript = class {
|
|
|
5924
6184
|
}
|
|
5925
6185
|
async createTest(workspace, name) {
|
|
5926
6186
|
}
|
|
5927
|
-
async createTemplate(sys2) {
|
|
6187
|
+
async createTemplate(sys2, name) {
|
|
5928
6188
|
await AiSession.init();
|
|
5929
|
-
const libs = await sys2.getModules();
|
|
5930
|
-
const lib = await (0, import_prompts8.select)({
|
|
5931
|
-
message: "Select the lib",
|
|
5932
|
-
choices: libs
|
|
5933
|
-
}).catch((e) => {
|
|
5934
|
-
Logger.error("canceled");
|
|
5935
|
-
return null;
|
|
5936
|
-
});
|
|
5937
|
-
if (!lib)
|
|
5938
|
-
return;
|
|
5939
|
-
const name = lib.split("/").pop();
|
|
5940
|
-
if (!name)
|
|
5941
|
-
return;
|
|
5942
6189
|
const { component: template } = await this.#runner.createComponentTemplate(sys2, name, "template");
|
|
5943
6190
|
const templateExampleFiles = (await sys2.getTemplatesSourceCode()).filter(
|
|
5944
6191
|
(f) => !f.filepath.includes(`${name}.Template.tsx`)
|
|
@@ -5957,25 +6204,10 @@ var ModuleScript = class {
|
|
|
5957
6204
|
exampleFiles: randomPicks(templateExampleFiles, Math.min(20, templateExampleFiles.length))
|
|
5958
6205
|
});
|
|
5959
6206
|
const content = await session.editTypescript(promptRst);
|
|
5960
|
-
|
|
5961
|
-
import_fs10.default.writeFileSync(`${sys2.cwdPath}/resultTemplate.txt`, content);
|
|
5962
|
-
sys2.writeFile(`lib/${name}__/${Name}.Template.tsx`, content);
|
|
6207
|
+
sys2.writeFile(`lib/${name}/${Name}.Template.tsx`, content);
|
|
5963
6208
|
}
|
|
5964
|
-
async createUnit(sys2) {
|
|
6209
|
+
async createUnit(sys2, name) {
|
|
5965
6210
|
await AiSession.init();
|
|
5966
|
-
const libs = await sys2.getModules();
|
|
5967
|
-
const lib = await (0, import_prompts8.select)({
|
|
5968
|
-
message: "Select the lib",
|
|
5969
|
-
choices: libs
|
|
5970
|
-
}).catch((e) => {
|
|
5971
|
-
Logger.error("canceled");
|
|
5972
|
-
return null;
|
|
5973
|
-
});
|
|
5974
|
-
if (!lib)
|
|
5975
|
-
return;
|
|
5976
|
-
const name = lib.split("/").pop();
|
|
5977
|
-
if (!name)
|
|
5978
|
-
return;
|
|
5979
6211
|
const { component: unit } = await this.#runner.createComponentTemplate(sys2, name, "unit");
|
|
5980
6212
|
const Name = capitalize(name);
|
|
5981
6213
|
const unitExampleFiles = (await sys2.getUnitsSourceCode()).filter((f) => !f.filepath.includes(`${name}.Unit.tsx`));
|
|
@@ -5992,25 +6224,10 @@ var ModuleScript = class {
|
|
|
5992
6224
|
boilerplate: unit.content
|
|
5993
6225
|
});
|
|
5994
6226
|
const content = await session.editTypescript(promptRst);
|
|
5995
|
-
|
|
5996
|
-
import_fs10.default.writeFileSync(`${sys2.cwdPath}/resultUnit.txt`, content);
|
|
5997
|
-
sys2.writeFile(`lib/${name}__/${Name}.Unit.tsx`, content);
|
|
6227
|
+
sys2.writeFile(`lib/${name}/${Name}.Unit.tsx`, content);
|
|
5998
6228
|
}
|
|
5999
|
-
async createView(sys2) {
|
|
6229
|
+
async createView(sys2, name) {
|
|
6000
6230
|
await AiSession.init();
|
|
6001
|
-
const libs = await sys2.getModules();
|
|
6002
|
-
const lib = await (0, import_prompts8.select)({
|
|
6003
|
-
message: "Select the lib",
|
|
6004
|
-
choices: libs
|
|
6005
|
-
}).catch((e) => {
|
|
6006
|
-
Logger.error("canceled");
|
|
6007
|
-
return null;
|
|
6008
|
-
});
|
|
6009
|
-
if (!lib)
|
|
6010
|
-
return;
|
|
6011
|
-
const name = lib.split("/").pop();
|
|
6012
|
-
if (!name)
|
|
6013
|
-
return;
|
|
6014
6231
|
const { component: view } = await this.#runner.createComponentTemplate(sys2, name, "view");
|
|
6015
6232
|
const viewExampleFiles = (await sys2.getViewsSourceCode()).filter((f) => !f.filepath.includes(`${name}.View.tsx`));
|
|
6016
6233
|
const Name = capitalize(name);
|
|
@@ -6027,73 +6244,82 @@ var ModuleScript = class {
|
|
|
6027
6244
|
exampleFiles: randomPicks(viewExampleFiles, Math.min(20, viewExampleFiles.length))
|
|
6028
6245
|
});
|
|
6029
6246
|
const content = await session.editTypescript(promptRst);
|
|
6030
|
-
|
|
6031
|
-
import_fs10.default.writeFileSync(`${sys2.cwdPath}/result.txt`, content);
|
|
6032
|
-
sys2.writeFile(`lib/${name}__/${Name}.View.tsx`, content);
|
|
6247
|
+
sys2.writeFile(`lib/${name}/${Name}.View.tsx`, content);
|
|
6033
6248
|
}
|
|
6034
6249
|
};
|
|
6035
6250
|
|
|
6036
6251
|
// pkgs/@akanjs/cli/src/module/module.command.ts
|
|
6037
6252
|
var ModuleCommand = class {
|
|
6038
6253
|
moduleScript = new ModuleScript();
|
|
6039
|
-
async
|
|
6040
|
-
await
|
|
6041
|
-
|
|
6042
|
-
|
|
6043
|
-
|
|
6044
|
-
|
|
6254
|
+
async selectLib(sys2) {
|
|
6255
|
+
const libs = await sys2.getModules();
|
|
6256
|
+
const lib = await (0, import_prompts8.select)({
|
|
6257
|
+
message: "Select the lib",
|
|
6258
|
+
choices: libs.map((l) => `${sys2.name}/${l}`)
|
|
6259
|
+
}).catch((e) => {
|
|
6260
|
+
Logger.error("canceled");
|
|
6261
|
+
return null;
|
|
6262
|
+
});
|
|
6263
|
+
return lib?.split("/").pop();
|
|
6045
6264
|
}
|
|
6046
|
-
async
|
|
6047
|
-
|
|
6265
|
+
async createModule(sys2, moduleName, description, schemaDescription, ai, workspace) {
|
|
6266
|
+
const name = lowerlize(moduleName.replace(/ /g, ""));
|
|
6267
|
+
if (ai) {
|
|
6268
|
+
await this.moduleScript.createModule(sys2, name, description, schemaDescription);
|
|
6269
|
+
} else {
|
|
6270
|
+
await this.moduleScript.createModuleTemplate(sys2, name);
|
|
6271
|
+
}
|
|
6048
6272
|
}
|
|
6049
|
-
async
|
|
6273
|
+
async removeModule(sys2, workspace) {
|
|
6274
|
+
const name = await this.selectLib(sys2);
|
|
6275
|
+
if (!name)
|
|
6276
|
+
return;
|
|
6277
|
+
this.moduleScript.removeModule(sys2, name);
|
|
6050
6278
|
}
|
|
6051
|
-
async
|
|
6279
|
+
async createScalar(sys2, scalarName, description, schemaDescription, workspace) {
|
|
6280
|
+
await this.moduleScript.createScalar(sys2, lowerlize(scalarName.replace(/ /g, "")), description, schemaDescription);
|
|
6052
6281
|
}
|
|
6053
6282
|
async createView(sys2, workspace) {
|
|
6054
|
-
await this.
|
|
6283
|
+
const name = await this.selectLib(sys2);
|
|
6284
|
+
if (!name)
|
|
6285
|
+
return;
|
|
6286
|
+
await this.moduleScript.createView(sys2, name);
|
|
6055
6287
|
}
|
|
6056
6288
|
async createUnit(sys2, workspace) {
|
|
6057
|
-
await this.
|
|
6289
|
+
const name = await this.selectLib(sys2);
|
|
6290
|
+
if (!name)
|
|
6291
|
+
return;
|
|
6292
|
+
await this.moduleScript.createUnit(sys2, name);
|
|
6058
6293
|
}
|
|
6059
6294
|
async createTemplate(sys2, workspace) {
|
|
6060
|
-
await this.
|
|
6295
|
+
const name = await this.selectLib(sys2);
|
|
6296
|
+
if (!name)
|
|
6297
|
+
return;
|
|
6298
|
+
await this.moduleScript.createTemplate(sys2, name);
|
|
6061
6299
|
}
|
|
6062
6300
|
};
|
|
6063
6301
|
__decorateClass([
|
|
6064
6302
|
Target.Public(),
|
|
6065
6303
|
__decorateParam(0, Sys()),
|
|
6066
|
-
__decorateParam(1,
|
|
6067
|
-
__decorateParam(2,
|
|
6304
|
+
__decorateParam(1, Argument("moduleName", { desc: "name of module" })),
|
|
6305
|
+
__decorateParam(2, Option("description", { desc: "description of module" })),
|
|
6306
|
+
__decorateParam(3, Option("schemaDescription", { desc: "schema description of module" })),
|
|
6307
|
+
__decorateParam(4, Option("ai", { type: "boolean", default: false, desc: "use ai to create module" })),
|
|
6308
|
+
__decorateParam(5, Workspace())
|
|
6068
6309
|
], ModuleCommand.prototype, "createModule", 1);
|
|
6069
6310
|
__decorateClass([
|
|
6070
6311
|
Target.Public(),
|
|
6071
|
-
__decorateParam(0,
|
|
6312
|
+
__decorateParam(0, Sys()),
|
|
6072
6313
|
__decorateParam(1, Workspace())
|
|
6073
6314
|
], ModuleCommand.prototype, "removeModule", 1);
|
|
6074
|
-
__decorateClass([
|
|
6075
|
-
Target.Public(),
|
|
6076
|
-
__decorateParam(0, Option("name", { desc: "name of module" })),
|
|
6077
|
-
__decorateParam(1, Workspace())
|
|
6078
|
-
], ModuleCommand.prototype, "scanModule", 1);
|
|
6079
6315
|
__decorateClass([
|
|
6080
6316
|
Target.Public(),
|
|
6081
6317
|
__decorateParam(0, Sys()),
|
|
6082
|
-
__decorateParam(1,
|
|
6318
|
+
__decorateParam(1, Argument("scalarName", { desc: "name of scalar module" })),
|
|
6083
6319
|
__decorateParam(2, Option("description", { desc: "description of scalar module" })),
|
|
6084
6320
|
__decorateParam(3, Option("schemaDescription", { desc: "schema description of scalar module" })),
|
|
6085
6321
|
__decorateParam(4, Workspace())
|
|
6086
6322
|
], ModuleCommand.prototype, "createScalar", 1);
|
|
6087
|
-
__decorateClass([
|
|
6088
|
-
Target.Public(),
|
|
6089
|
-
__decorateParam(0, Option("name", { desc: "name of service module" })),
|
|
6090
|
-
__decorateParam(1, Workspace())
|
|
6091
|
-
], ModuleCommand.prototype, "createService", 1);
|
|
6092
|
-
__decorateClass([
|
|
6093
|
-
Target.Public(),
|
|
6094
|
-
__decorateParam(0, Option("name", { desc: "name of test module" })),
|
|
6095
|
-
__decorateParam(1, Workspace())
|
|
6096
|
-
], ModuleCommand.prototype, "createTest", 1);
|
|
6097
6323
|
__decorateClass([
|
|
6098
6324
|
Target.Public(),
|
|
6099
6325
|
__decorateParam(0, Sys()),
|
|
@@ -6344,8 +6570,12 @@ var WorkspaceScript = class {
|
|
|
6344
6570
|
// pkgs/@akanjs/cli/src/workspace/workspace.command.ts
|
|
6345
6571
|
var WorkspaceCommand = class {
|
|
6346
6572
|
workspaceScript = new WorkspaceScript();
|
|
6347
|
-
async createWorkspace(
|
|
6348
|
-
await this.workspaceScript.createWorkspace(
|
|
6573
|
+
async createWorkspace(workspaceName, app, dir) {
|
|
6574
|
+
await this.workspaceScript.createWorkspace(
|
|
6575
|
+
workspaceName.toLowerCase().replace(/ /g, "-"),
|
|
6576
|
+
app.toLowerCase().replace(/ /g, "-"),
|
|
6577
|
+
dir
|
|
6578
|
+
);
|
|
6349
6579
|
}
|
|
6350
6580
|
async generateMongo(workspace) {
|
|
6351
6581
|
await this.workspaceScript.generateMongo(workspace);
|
|
@@ -6359,7 +6589,7 @@ var WorkspaceCommand = class {
|
|
|
6359
6589
|
};
|
|
6360
6590
|
__decorateClass([
|
|
6361
6591
|
Target.Public(),
|
|
6362
|
-
__decorateParam(0,
|
|
6592
|
+
__decorateParam(0, Argument("workspaceName", { desc: "what is the name of your organization?" })),
|
|
6363
6593
|
__decorateParam(1, Option("app", { desc: "describe your first application to create " })),
|
|
6364
6594
|
__decorateParam(2, Option("dir", { desc: "directory of workspace", default: process.env.USE_AKANJS_PKGS === "true" ? "local" : "." }))
|
|
6365
6595
|
], WorkspaceCommand.prototype, "createWorkspace", 1);
|