@akanjs/cli 0.9.60-canary.1 → 0.9.60-canary.2
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 +18 -12
- package/cjs/src/templates/__scalar/__model__/__model__.dictionary.js +6 -13
- package/cjs/src/templates/module/__model__.dictionary.js +0 -1
- package/esm/index.js +18 -12
- package/esm/src/templates/__scalar/__model__/__model__.dictionary.js +6 -13
- package/esm/src/templates/module/__model__.dictionary.js +0 -1
- package/package.json +1 -1
- package/src/scalar/scalar.command.d.ts +2 -2
- package/src/scalar/scalar.runner.d.ts +1 -0
- package/src/scalar/scalar.script.d.ts +1 -0
package/cjs/index.js
CHANGED
|
@@ -7442,6 +7442,14 @@ ${boilerplate}
|
|
|
7442
7442
|
|
|
7443
7443
|
// pkgs/@akanjs/cli/src/scalar/scalar.runner.ts
|
|
7444
7444
|
var ScalarRunner = class {
|
|
7445
|
+
async applyScalarTemplate(sys3, scalarName) {
|
|
7446
|
+
await sys3.applyTemplate({
|
|
7447
|
+
basePath: "./lib/__scalar",
|
|
7448
|
+
template: "__scalar",
|
|
7449
|
+
dict: { model: scalarName, models: (0, import_pluralize3.default)(scalarName), sysName: sys3.name },
|
|
7450
|
+
overwrite: false
|
|
7451
|
+
});
|
|
7452
|
+
}
|
|
7445
7453
|
async createScalarConstant(sys3, scalarName) {
|
|
7446
7454
|
const isContinued = sys3.exists(`lib/__scalar/${scalarName}/${scalarName}.constant.ts`);
|
|
7447
7455
|
const prompt = new ScalarPrompt(sys3, scalarName);
|
|
@@ -7450,12 +7458,7 @@ var ScalarRunner = class {
|
|
|
7450
7458
|
const writes = await session.writeTypescripts(request, sys3, { validate });
|
|
7451
7459
|
const scalarNames = writes.map(({ filePath }) => filePath.split("/").at(-2)).filter((name) => !!name);
|
|
7452
7460
|
for (const name of scalarNames)
|
|
7453
|
-
await
|
|
7454
|
-
basePath: "./lib/__scalar",
|
|
7455
|
-
template: "__scalar",
|
|
7456
|
-
dict: { model: name, models: (0, import_pluralize3.default)(name), sysName: sys3.name },
|
|
7457
|
-
overwrite: false
|
|
7458
|
-
});
|
|
7461
|
+
await this.applyScalarTemplate(sys3, name);
|
|
7459
7462
|
return { session, scalarNames, writes, prompt };
|
|
7460
7463
|
}
|
|
7461
7464
|
async updateScalarDictionaries(sys3, scalarNames, { session }) {
|
|
@@ -7475,6 +7478,9 @@ var ScalarRunner = class {
|
|
|
7475
7478
|
var ScalarScript = class {
|
|
7476
7479
|
#runner = new ScalarRunner();
|
|
7477
7480
|
async createScalar(sys3, scalarName) {
|
|
7481
|
+
await this.#runner.applyScalarTemplate(sys3, scalarName);
|
|
7482
|
+
}
|
|
7483
|
+
async createScalarWithAi(sys3, scalarName) {
|
|
7478
7484
|
const { session, scalarNames } = await this.#runner.createScalarConstant(sys3, scalarName);
|
|
7479
7485
|
await this.#runner.updateScalarDictionaries(sys3, scalarNames, { session });
|
|
7480
7486
|
}
|
|
@@ -7486,22 +7492,22 @@ var ScalarScript = class {
|
|
|
7486
7492
|
// pkgs/@akanjs/cli/src/scalar/scalar.command.ts
|
|
7487
7493
|
var ScalarCommand = class {
|
|
7488
7494
|
scalarScript = new ScalarScript();
|
|
7489
|
-
async createScalar(
|
|
7495
|
+
async createScalar(scalarName, sys3) {
|
|
7490
7496
|
await this.scalarScript.createScalar(sys3, lowerlize(scalarName.replace(/ /g, "")));
|
|
7491
7497
|
}
|
|
7492
|
-
async removeScalar(
|
|
7498
|
+
async removeScalar(scalarName, sys3) {
|
|
7493
7499
|
await this.scalarScript.removeScalar(sys3, scalarName);
|
|
7494
7500
|
}
|
|
7495
7501
|
};
|
|
7496
7502
|
__decorateClass([
|
|
7497
7503
|
Target.Public(),
|
|
7498
|
-
__decorateParam(0,
|
|
7499
|
-
__decorateParam(1,
|
|
7504
|
+
__decorateParam(0, Argument("scalarName", { desc: "name of scalar scalar" })),
|
|
7505
|
+
__decorateParam(1, Sys())
|
|
7500
7506
|
], ScalarCommand.prototype, "createScalar", 1);
|
|
7501
7507
|
__decorateClass([
|
|
7502
7508
|
Target.Public(),
|
|
7503
|
-
__decorateParam(0,
|
|
7504
|
-
__decorateParam(1,
|
|
7509
|
+
__decorateParam(0, Argument("scalarName", { desc: "name of scalar scalar" })),
|
|
7510
|
+
__decorateParam(1, Sys())
|
|
7505
7511
|
], ScalarCommand.prototype, "removeScalar", 1);
|
|
7506
7512
|
ScalarCommand = __decorateClass([
|
|
7507
7513
|
Commands()
|
|
@@ -24,21 +24,14 @@ __export(model_dictionary_exports, {
|
|
|
24
24
|
module.exports = __toCommonJS(model_dictionary_exports);
|
|
25
25
|
function getContent(scanInfo, dict) {
|
|
26
26
|
return `
|
|
27
|
-
import {
|
|
27
|
+
import { scalarDictionary } from "@akanjs/dictionary";
|
|
28
28
|
|
|
29
29
|
import type { ${dict.Model} } from "./${dict.model}.constant";
|
|
30
30
|
|
|
31
|
-
export const dictionary =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
field: ["Field", "\uD544\uB4DC"],
|
|
37
|
-
"desc-field": ["Field", "\uD544\uB4DC"],
|
|
38
|
-
// * ==================== Model ==================== * //
|
|
39
|
-
|
|
40
|
-
// * ==================== Etc ==================== * //
|
|
41
|
-
// * ==================== Etc ==================== * //
|
|
42
|
-
} satisfies ModelDictionary<${dict.Model}>;
|
|
31
|
+
export const dictionary = scalarDictionary(["en", "ko"])
|
|
32
|
+
.of((t) => t(["${dict.Model}", "${dict.Model}"]).desc(["${dict.Model} description", "${dict.Model} \uC124\uBA85"]))
|
|
33
|
+
.model<${dict.Model}>((t) => ({
|
|
34
|
+
field: t(["Field", "\uD544\uB4DC"]).desc(["Field Description", "\uD544\uB4DC \uC124\uBA85"]),
|
|
35
|
+
}));
|
|
43
36
|
`;
|
|
44
37
|
}
|
|
@@ -27,7 +27,6 @@ function getContent(scanInfo, dict) {
|
|
|
27
27
|
import { modelDictionary } from "@akanjs/dictionary";
|
|
28
28
|
|
|
29
29
|
import type { ${dict.Model}, ${dict.Model}Insight } from "./${dict.model}.constant";
|
|
30
|
-
import type { ${dict.Model}Filter } from "./${dict.model}.document";
|
|
31
30
|
import type { ${dict.Model}Endpoint, ${dict.Model}Slice } from "./${dict.model}.signal";
|
|
32
31
|
|
|
33
32
|
export const dictionary = modelDictionary(["en", "ko"])
|
package/esm/index.js
CHANGED
|
@@ -7422,6 +7422,14 @@ ${boilerplate}
|
|
|
7422
7422
|
|
|
7423
7423
|
// pkgs/@akanjs/cli/src/scalar/scalar.runner.ts
|
|
7424
7424
|
var ScalarRunner = class {
|
|
7425
|
+
async applyScalarTemplate(sys3, scalarName) {
|
|
7426
|
+
await sys3.applyTemplate({
|
|
7427
|
+
basePath: "./lib/__scalar",
|
|
7428
|
+
template: "__scalar",
|
|
7429
|
+
dict: { model: scalarName, models: pluralize2(scalarName), sysName: sys3.name },
|
|
7430
|
+
overwrite: false
|
|
7431
|
+
});
|
|
7432
|
+
}
|
|
7425
7433
|
async createScalarConstant(sys3, scalarName) {
|
|
7426
7434
|
const isContinued = sys3.exists(`lib/__scalar/${scalarName}/${scalarName}.constant.ts`);
|
|
7427
7435
|
const prompt = new ScalarPrompt(sys3, scalarName);
|
|
@@ -7430,12 +7438,7 @@ var ScalarRunner = class {
|
|
|
7430
7438
|
const writes = await session.writeTypescripts(request, sys3, { validate });
|
|
7431
7439
|
const scalarNames = writes.map(({ filePath }) => filePath.split("/").at(-2)).filter((name) => !!name);
|
|
7432
7440
|
for (const name of scalarNames)
|
|
7433
|
-
await
|
|
7434
|
-
basePath: "./lib/__scalar",
|
|
7435
|
-
template: "__scalar",
|
|
7436
|
-
dict: { model: name, models: pluralize2(name), sysName: sys3.name },
|
|
7437
|
-
overwrite: false
|
|
7438
|
-
});
|
|
7441
|
+
await this.applyScalarTemplate(sys3, name);
|
|
7439
7442
|
return { session, scalarNames, writes, prompt };
|
|
7440
7443
|
}
|
|
7441
7444
|
async updateScalarDictionaries(sys3, scalarNames, { session }) {
|
|
@@ -7455,6 +7458,9 @@ var ScalarRunner = class {
|
|
|
7455
7458
|
var ScalarScript = class {
|
|
7456
7459
|
#runner = new ScalarRunner();
|
|
7457
7460
|
async createScalar(sys3, scalarName) {
|
|
7461
|
+
await this.#runner.applyScalarTemplate(sys3, scalarName);
|
|
7462
|
+
}
|
|
7463
|
+
async createScalarWithAi(sys3, scalarName) {
|
|
7458
7464
|
const { session, scalarNames } = await this.#runner.createScalarConstant(sys3, scalarName);
|
|
7459
7465
|
await this.#runner.updateScalarDictionaries(sys3, scalarNames, { session });
|
|
7460
7466
|
}
|
|
@@ -7466,22 +7472,22 @@ var ScalarScript = class {
|
|
|
7466
7472
|
// pkgs/@akanjs/cli/src/scalar/scalar.command.ts
|
|
7467
7473
|
var ScalarCommand = class {
|
|
7468
7474
|
scalarScript = new ScalarScript();
|
|
7469
|
-
async createScalar(
|
|
7475
|
+
async createScalar(scalarName, sys3) {
|
|
7470
7476
|
await this.scalarScript.createScalar(sys3, lowerlize(scalarName.replace(/ /g, "")));
|
|
7471
7477
|
}
|
|
7472
|
-
async removeScalar(
|
|
7478
|
+
async removeScalar(scalarName, sys3) {
|
|
7473
7479
|
await this.scalarScript.removeScalar(sys3, scalarName);
|
|
7474
7480
|
}
|
|
7475
7481
|
};
|
|
7476
7482
|
__decorateClass([
|
|
7477
7483
|
Target.Public(),
|
|
7478
|
-
__decorateParam(0,
|
|
7479
|
-
__decorateParam(1,
|
|
7484
|
+
__decorateParam(0, Argument("scalarName", { desc: "name of scalar scalar" })),
|
|
7485
|
+
__decorateParam(1, Sys())
|
|
7480
7486
|
], ScalarCommand.prototype, "createScalar", 1);
|
|
7481
7487
|
__decorateClass([
|
|
7482
7488
|
Target.Public(),
|
|
7483
|
-
__decorateParam(0,
|
|
7484
|
-
__decorateParam(1,
|
|
7489
|
+
__decorateParam(0, Argument("scalarName", { desc: "name of scalar scalar" })),
|
|
7490
|
+
__decorateParam(1, Sys())
|
|
7485
7491
|
], ScalarCommand.prototype, "removeScalar", 1);
|
|
7486
7492
|
ScalarCommand = __decorateClass([
|
|
7487
7493
|
Commands()
|
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
// pkgs/@akanjs/cli/src/templates/__scalar/__model__/__model__.dictionary.ts
|
|
2
2
|
function getContent(scanInfo, dict) {
|
|
3
3
|
return `
|
|
4
|
-
import {
|
|
4
|
+
import { scalarDictionary } from "@akanjs/dictionary";
|
|
5
5
|
|
|
6
6
|
import type { ${dict.Model} } from "./${dict.model}.constant";
|
|
7
7
|
|
|
8
|
-
export const dictionary =
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
field: ["Field", "\uD544\uB4DC"],
|
|
14
|
-
"desc-field": ["Field", "\uD544\uB4DC"],
|
|
15
|
-
// * ==================== Model ==================== * //
|
|
16
|
-
|
|
17
|
-
// * ==================== Etc ==================== * //
|
|
18
|
-
// * ==================== Etc ==================== * //
|
|
19
|
-
} satisfies ModelDictionary<${dict.Model}>;
|
|
8
|
+
export const dictionary = scalarDictionary(["en", "ko"])
|
|
9
|
+
.of((t) => t(["${dict.Model}", "${dict.Model}"]).desc(["${dict.Model} description", "${dict.Model} \uC124\uBA85"]))
|
|
10
|
+
.model<${dict.Model}>((t) => ({
|
|
11
|
+
field: t(["Field", "\uD544\uB4DC"]).desc(["Field Description", "\uD544\uB4DC \uC124\uBA85"]),
|
|
12
|
+
}));
|
|
20
13
|
`;
|
|
21
14
|
}
|
|
22
15
|
export {
|
|
@@ -4,7 +4,6 @@ function getContent(scanInfo, dict) {
|
|
|
4
4
|
import { modelDictionary } from "@akanjs/dictionary";
|
|
5
5
|
|
|
6
6
|
import type { ${dict.Model}, ${dict.Model}Insight } from "./${dict.model}.constant";
|
|
7
|
-
import type { ${dict.Model}Filter } from "./${dict.model}.document";
|
|
8
7
|
import type { ${dict.Model}Endpoint, ${dict.Model}Slice } from "./${dict.model}.signal";
|
|
9
8
|
|
|
10
9
|
export const dictionary = modelDictionary(["en", "ko"])
|
package/package.json
CHANGED
|
@@ -2,6 +2,6 @@ import { Sys } from "@akanjs/devkit";
|
|
|
2
2
|
import { ScalarScript } from "./scalar.script";
|
|
3
3
|
export declare class ScalarCommand {
|
|
4
4
|
scalarScript: ScalarScript;
|
|
5
|
-
createScalar(
|
|
6
|
-
removeScalar(
|
|
5
|
+
createScalar(scalarName: string, sys: Sys): Promise<void>;
|
|
6
|
+
removeScalar(scalarName: string, sys: Sys): Promise<void>;
|
|
7
7
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { AiSession, type Sys } from "@akanjs/devkit";
|
|
2
2
|
import { ScalarPrompt } from "./scalar.prompt";
|
|
3
3
|
export declare class ScalarRunner {
|
|
4
|
+
applyScalarTemplate(sys: Sys, scalarName: string): Promise<void>;
|
|
4
5
|
createScalarConstant(sys: Sys, scalarName: string): Promise<{
|
|
5
6
|
session: AiSession;
|
|
6
7
|
scalarNames: string[];
|
|
@@ -2,5 +2,6 @@ import { type Sys } from "@akanjs/devkit";
|
|
|
2
2
|
export declare class ScalarScript {
|
|
3
3
|
#private;
|
|
4
4
|
createScalar(sys: Sys, scalarName: string): Promise<void>;
|
|
5
|
+
createScalarWithAi(sys: Sys, scalarName: string): Promise<void>;
|
|
5
6
|
removeScalar(sys: Sys, scalarName: string): Promise<void>;
|
|
6
7
|
}
|