@akanjs/cli 0.0.122 → 0.0.123
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 +23 -17
- package/cjs/src/templates/module/__Model__.Template.js +1 -1
- package/cjs/src/templates/module/__Model__.Unit.js +1 -1
- package/cjs/src/templates/module/__Model__.Util.js +1 -1
- package/cjs/src/templates/module/__Model__.View.js +2 -2
- package/cjs/src/templates/module/__Model__.Zone.js +1 -1
- package/cjs/src/templates/module/__model__.document.js +1 -1
- package/cjs/src/templates/module/__model__.service.js +2 -2
- package/cjs/src/templates/module/__model__.signal.spec.js +1 -1
- package/cjs/src/templates/module/__model__.signal.test.js +2 -2
- package/esm/index.js +23 -17
- package/esm/src/templates/module/__Model__.Template.js +1 -1
- package/esm/src/templates/module/__Model__.Unit.js +1 -1
- package/esm/src/templates/module/__Model__.Util.js +1 -1
- package/esm/src/templates/module/__Model__.View.js +2 -2
- package/esm/src/templates/module/__Model__.Zone.js +1 -1
- package/esm/src/templates/module/__model__.document.js +1 -1
- package/esm/src/templates/module/__model__.service.js +2 -2
- package/esm/src/templates/module/__model__.signal.spec.js +1 -1
- package/esm/src/templates/module/__model__.signal.test.js +2 -2
- package/package.json +1 -1
- package/src/module/module.command.d.ts +1 -1
- package/src/module/module.script.d.ts +1 -0
- package/src/templates/module/__Model__.Template.d.ts +1 -1
- package/src/templates/module/__Model__.Unit.d.ts +1 -1
- package/src/templates/module/__Model__.Util.d.ts +1 -1
- package/src/templates/module/__Model__.View.d.ts +4 -2
- package/src/templates/module/__Model__.Zone.d.ts +1 -1
- package/src/templates/module/__model__.constant.d.ts +1 -1
- package/src/templates/module/__model__.dictionary.d.ts +1 -1
- package/src/templates/module/__model__.signal.d.ts +1 -1
- package/src/templates/module/__model__.signal.spec.d.ts +1 -1
- package/src/templates/module/__model__.signal.test.d.ts +1 -1
- package/src/templates/module/__model__.store.d.ts +1 -1
- package/src/templates/module/_server.d.ts +1 -1
package/cjs/index.js
CHANGED
|
@@ -5796,50 +5796,50 @@ var ModuleRunner = class {
|
|
|
5796
5796
|
basePath: `./lib/${name}`,
|
|
5797
5797
|
template: "module",
|
|
5798
5798
|
scanResult,
|
|
5799
|
-
dict: { model: name, Model: capitalize(name) }
|
|
5799
|
+
dict: { model: name, Model: capitalize(name), sysName: sys2.name, SysName: capitalize(sys2.name) }
|
|
5800
5800
|
});
|
|
5801
5801
|
await sys2.scan({ akanConfig });
|
|
5802
5802
|
return {
|
|
5803
|
-
constant: { filename: `${name}.constant.ts`, content: sys2.readFile(`lib
|
|
5803
|
+
constant: { filename: `${name}.constant.ts`, content: sys2.readFile(`lib/${name}/${name}.constant.ts`) },
|
|
5804
5804
|
dictionary: {
|
|
5805
5805
|
filename: `${name}.dictionary.ts`,
|
|
5806
|
-
content: sys2.readFile(`lib
|
|
5806
|
+
content: sys2.readFile(`lib/${name}/${name}.dictionary.ts`)
|
|
5807
5807
|
},
|
|
5808
5808
|
service: {
|
|
5809
5809
|
filename: `${name}.service.ts`,
|
|
5810
|
-
content: sys2.readFile(`lib
|
|
5810
|
+
content: sys2.readFile(`lib/${name}/${name}.service.ts`)
|
|
5811
5811
|
},
|
|
5812
5812
|
store: {
|
|
5813
5813
|
filename: `${name}.store.ts`,
|
|
5814
|
-
content: sys2.readFile(`lib
|
|
5814
|
+
content: sys2.readFile(`lib/${name}/${name}.store.ts`)
|
|
5815
5815
|
},
|
|
5816
5816
|
signal: {
|
|
5817
5817
|
filename: `${name}.signal.ts`,
|
|
5818
|
-
content: sys2.readFile(`lib
|
|
5818
|
+
content: sys2.readFile(`lib/${name}/${name}.signal.spec.ts`)
|
|
5819
5819
|
},
|
|
5820
5820
|
test: {
|
|
5821
5821
|
filename: `${name}.test.ts`,
|
|
5822
|
-
content: sys2.readFile(`lib
|
|
5822
|
+
content: sys2.readFile(`lib/${name}/${name}.signal.test.ts`)
|
|
5823
5823
|
},
|
|
5824
5824
|
unit: {
|
|
5825
5825
|
filename: `${name}.Unit.tsx`,
|
|
5826
|
-
content: sys2.readFile(`lib
|
|
5826
|
+
content: sys2.readFile(`lib/${name}/${name}.Unit.tsx`)
|
|
5827
5827
|
},
|
|
5828
5828
|
view: {
|
|
5829
5829
|
filename: `${name}.View.tsx`,
|
|
5830
|
-
content: sys2.readFile(`lib
|
|
5830
|
+
content: sys2.readFile(`lib/${name}/${name}.View.tsx`)
|
|
5831
5831
|
},
|
|
5832
5832
|
template: {
|
|
5833
5833
|
filename: `${name}.Template.tsx`,
|
|
5834
|
-
content: sys2.readFile(`lib
|
|
5834
|
+
content: sys2.readFile(`lib/${name}/${name}.Template.tsx`)
|
|
5835
5835
|
},
|
|
5836
5836
|
zone: {
|
|
5837
5837
|
filename: `${name}.Zone.tsx`,
|
|
5838
|
-
content: sys2.readFile(`lib
|
|
5838
|
+
content: sys2.readFile(`lib/${name}/${name}.Zone.tsx`)
|
|
5839
5839
|
},
|
|
5840
5840
|
util: {
|
|
5841
5841
|
filename: `${name}.Util.tsx`,
|
|
5842
|
-
content: sys2.readFile(`lib
|
|
5842
|
+
content: sys2.readFile(`lib/${name}/${name}.Util.tsx`)
|
|
5843
5843
|
}
|
|
5844
5844
|
};
|
|
5845
5845
|
}
|
|
@@ -5906,6 +5906,10 @@ var ModuleRunner = class {
|
|
|
5906
5906
|
// pkgs/@akanjs/cli/src/module/module.script.ts
|
|
5907
5907
|
var ModuleScript = class {
|
|
5908
5908
|
#runner = new ModuleRunner();
|
|
5909
|
+
async createModuleTemplate(sys2, name) {
|
|
5910
|
+
await this.#runner.createModuleTemplate(sys2, name);
|
|
5911
|
+
sys2.log(`Module ${name} created in ${sys2.type}s/${sys2.name}/lib/${name}`);
|
|
5912
|
+
}
|
|
5909
5913
|
async createModule(sys2) {
|
|
5910
5914
|
const [appNames, libNames] = await sys2.workspace.getSyss();
|
|
5911
5915
|
const constantExampleFiles = [
|
|
@@ -5926,6 +5930,7 @@ var ModuleScript = class {
|
|
|
5926
5930
|
async removeModule(workspace, name) {
|
|
5927
5931
|
}
|
|
5928
5932
|
async createScalar(sys2, name, description, schemaDescription) {
|
|
5933
|
+
await AiSession.init();
|
|
5929
5934
|
const scalarConstantExampleFiles = await sys2.workspace.getScalarConstantFiles();
|
|
5930
5935
|
const { constant, dictionary } = await this.#runner.createScalarTemplate(sys2, name);
|
|
5931
5936
|
const session = new AiSession();
|
|
@@ -6012,8 +6017,8 @@ var ModuleScript = class {
|
|
|
6012
6017
|
// pkgs/@akanjs/cli/src/module/module.command.ts
|
|
6013
6018
|
var ModuleCommand = class {
|
|
6014
6019
|
moduleScript = new ModuleScript();
|
|
6015
|
-
async createModule(sys2, workspace) {
|
|
6016
|
-
await this.moduleScript.
|
|
6020
|
+
async createModule(sys2, name, workspace) {
|
|
6021
|
+
await this.moduleScript.createModuleTemplate(sys2, name);
|
|
6017
6022
|
}
|
|
6018
6023
|
async removeModule(name, workspace) {
|
|
6019
6024
|
}
|
|
@@ -6036,7 +6041,8 @@ var ModuleCommand = class {
|
|
|
6036
6041
|
__decorateClass([
|
|
6037
6042
|
Target.Public(),
|
|
6038
6043
|
__decorateParam(0, Sys()),
|
|
6039
|
-
__decorateParam(1,
|
|
6044
|
+
__decorateParam(1, Option("name", { desc: "name of module" })),
|
|
6045
|
+
__decorateParam(2, Workspace())
|
|
6040
6046
|
], ModuleCommand.prototype, "createModule", 1);
|
|
6041
6047
|
__decorateClass([
|
|
6042
6048
|
Target.Public(),
|
|
@@ -6154,10 +6160,10 @@ PageCommand = __decorateClass([
|
|
|
6154
6160
|
], PageCommand);
|
|
6155
6161
|
|
|
6156
6162
|
// pkgs/@akanjs/cli/src/workspace/workspace.runner.ts
|
|
6157
|
-
var import_uuid2 = require("uuid");
|
|
6158
|
-
var import_lodash = require("lodash");
|
|
6159
6163
|
var import_latest_version2 = __toESM(require("latest-version"));
|
|
6164
|
+
var import_lodash = require("lodash");
|
|
6160
6165
|
var import_path5 = __toESM(require("path"));
|
|
6166
|
+
var import_uuid2 = require("uuid");
|
|
6161
6167
|
var WorkspaceRunner = class {
|
|
6162
6168
|
async createWorkspace(repoName, appName, dirname = ".") {
|
|
6163
6169
|
const cwdPath = process.cwd();
|
|
@@ -27,7 +27,7 @@ function getContent(scanResult, dict) {
|
|
|
27
27
|
filename: `${dict.Model}.Template.tsx`,
|
|
28
28
|
content: `
|
|
29
29
|
"use client";
|
|
30
|
-
import { cnst, st, usePage } from "@${dict.
|
|
30
|
+
import { cnst, st, usePage } from "@${dict.sysName}/client";
|
|
31
31
|
import { Field } from "@shared/ui";
|
|
32
32
|
import { Layout } from "@util/ui";
|
|
33
33
|
|
|
@@ -27,7 +27,7 @@ function getContent(scanResult, dict) {
|
|
|
27
27
|
filename: `${dict.Model}.Unit.tsx`,
|
|
28
28
|
content: `
|
|
29
29
|
import { ModelProps } from "@akanjs/client";
|
|
30
|
-
import { cnst, ${dict.Model} } from "@${dict.
|
|
30
|
+
import { cnst, ${dict.Model} } from "@${dict.sysName}/client";
|
|
31
31
|
import { Link } from "@util/ui";
|
|
32
32
|
|
|
33
33
|
export const Card = ({ ${dict.model}, href }: ModelProps<"${dict.model}", cnst.Light${dict.Model}>>) => {
|
|
@@ -29,7 +29,7 @@ function getContent(scanResult, dict) {
|
|
|
29
29
|
"use client";
|
|
30
30
|
import { ModelDashboardProps, ModelInsightProps } from "@akanjs/client";
|
|
31
31
|
import { getQueryMap } from "@akanjs/constant";
|
|
32
|
-
import { cnst } from "@${dict.
|
|
32
|
+
import { cnst } from "@${dict.sysName}/client";
|
|
33
33
|
import { Data } from "@shared/ui";
|
|
34
34
|
|
|
35
35
|
export const Stat = ({
|
|
@@ -22,12 +22,12 @@ __export(Model_View_exports, {
|
|
|
22
22
|
default: () => getContent
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(Model_View_exports);
|
|
25
|
-
function getContent(scanResult, dict
|
|
25
|
+
function getContent(scanResult, dict) {
|
|
26
26
|
return {
|
|
27
27
|
filename: `${dict.Model}.View.tsx`,
|
|
28
28
|
content: `
|
|
29
29
|
import { clsx } from "@akanjs/client";
|
|
30
|
-
import { cnst } from "@${dict.
|
|
30
|
+
import { cnst } from "@${dict.sysName}/client";
|
|
31
31
|
import { Image } from "@util/ui";
|
|
32
32
|
|
|
33
33
|
interface ${dict.Model}ViewProps {
|
|
@@ -29,7 +29,7 @@ function getContent(scanResult, dict) {
|
|
|
29
29
|
"use client";
|
|
30
30
|
import { Data, Load } from "@shared/ui";
|
|
31
31
|
import { ModelsProps } from "@akanjs/client";
|
|
32
|
-
import { cnst, ${dict.Model} } from "@${dict.
|
|
32
|
+
import { cnst, ${dict.Model} } from "@${dict.sysName}/client";
|
|
33
33
|
import { ClientInit, ClientView, DefaultOf } from "@akanjs/signal";
|
|
34
34
|
|
|
35
35
|
export const Admin = ({ sliceName = "${dict.model}", init, query }: ModelsProps<cnst.${dict.Model}>>) => {
|
|
@@ -35,7 +35,7 @@ export class ${dict.Model}Input extends by(cnst.${dict.Model}Input) {}
|
|
|
35
35
|
export class ${dict.Model} extends by(cnst.${dict.Model}) {}
|
|
36
36
|
|
|
37
37
|
@Database.Model(() => cnst.${dict.Model})
|
|
38
|
-
export class ${dict.Model}Model extends into(${dict.Model}, cnst.${dict.
|
|
38
|
+
export class ${dict.Model}Model extends into(${dict.Model}, cnst.${dict.model}Cnst) {
|
|
39
39
|
async getSummary(): Promise<cnst.${dict.Model}Summary> {
|
|
40
40
|
return {
|
|
41
41
|
...(await this.getDefaultSummary()),
|
|
@@ -30,10 +30,10 @@ import { cnst } from "../cnst";
|
|
|
30
30
|
import * as db from "../db";
|
|
31
31
|
|
|
32
32
|
@Service("${dict.Model}Service")
|
|
33
|
-
export class ${dict.Model}Service extends DbService(db.${dict.
|
|
33
|
+
export class ${dict.Model}Service extends DbService(db.${dict.model}Db) {
|
|
34
34
|
async summarize(): Promise<cnst.${dict.Model}Summary> {
|
|
35
35
|
return {
|
|
36
|
-
...(await this.${dict.
|
|
36
|
+
...(await this.${dict.model}Model.getSummary()),
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -25,7 +25,7 @@ module.exports = __toCommonJS(model_signal_spec_exports);
|
|
|
25
25
|
function getContent(scanResult, dict) {
|
|
26
26
|
return `
|
|
27
27
|
import * as adminSpec from "@shared/lib/admin/admin.signal.spec";
|
|
28
|
-
import * as userSpec from "@${dict.
|
|
28
|
+
import * as userSpec from "@${dict.sysName}/lib/user/user.signal.spec";
|
|
29
29
|
import { cnst } from "../cnst";
|
|
30
30
|
import { fetch } from "../fetch";
|
|
31
31
|
import { sampleOf } from "@akanjs/test";
|
|
@@ -25,8 +25,8 @@ module.exports = __toCommonJS(model_signal_test_exports);
|
|
|
25
25
|
function getContent(scanResult, dict) {
|
|
26
26
|
return `
|
|
27
27
|
import * as adminSpec from "@shared/lib/admin/admin.signal.spec";
|
|
28
|
-
import * as userSpec from "@${dict.
|
|
29
|
-
import * as ${dict.model}Spec from "@${dict.
|
|
28
|
+
import * as userSpec from "@${dict.sysName}/lib/user/user.signal.spec";
|
|
29
|
+
import * as ${dict.model}Spec from "@${dict.sysName}/lib/${dict.model}/${dict.model}.signal.spec";
|
|
30
30
|
import { cnst } from "../cnst";
|
|
31
31
|
import { fetch } from "../fetch";
|
|
32
32
|
|
package/esm/index.js
CHANGED
|
@@ -5783,50 +5783,50 @@ var ModuleRunner = class {
|
|
|
5783
5783
|
basePath: `./lib/${name}`,
|
|
5784
5784
|
template: "module",
|
|
5785
5785
|
scanResult,
|
|
5786
|
-
dict: { model: name, Model: capitalize(name) }
|
|
5786
|
+
dict: { model: name, Model: capitalize(name), sysName: sys2.name, SysName: capitalize(sys2.name) }
|
|
5787
5787
|
});
|
|
5788
5788
|
await sys2.scan({ akanConfig });
|
|
5789
5789
|
return {
|
|
5790
|
-
constant: { filename: `${name}.constant.ts`, content: sys2.readFile(`lib
|
|
5790
|
+
constant: { filename: `${name}.constant.ts`, content: sys2.readFile(`lib/${name}/${name}.constant.ts`) },
|
|
5791
5791
|
dictionary: {
|
|
5792
5792
|
filename: `${name}.dictionary.ts`,
|
|
5793
|
-
content: sys2.readFile(`lib
|
|
5793
|
+
content: sys2.readFile(`lib/${name}/${name}.dictionary.ts`)
|
|
5794
5794
|
},
|
|
5795
5795
|
service: {
|
|
5796
5796
|
filename: `${name}.service.ts`,
|
|
5797
|
-
content: sys2.readFile(`lib
|
|
5797
|
+
content: sys2.readFile(`lib/${name}/${name}.service.ts`)
|
|
5798
5798
|
},
|
|
5799
5799
|
store: {
|
|
5800
5800
|
filename: `${name}.store.ts`,
|
|
5801
|
-
content: sys2.readFile(`lib
|
|
5801
|
+
content: sys2.readFile(`lib/${name}/${name}.store.ts`)
|
|
5802
5802
|
},
|
|
5803
5803
|
signal: {
|
|
5804
5804
|
filename: `${name}.signal.ts`,
|
|
5805
|
-
content: sys2.readFile(`lib
|
|
5805
|
+
content: sys2.readFile(`lib/${name}/${name}.signal.spec.ts`)
|
|
5806
5806
|
},
|
|
5807
5807
|
test: {
|
|
5808
5808
|
filename: `${name}.test.ts`,
|
|
5809
|
-
content: sys2.readFile(`lib
|
|
5809
|
+
content: sys2.readFile(`lib/${name}/${name}.signal.test.ts`)
|
|
5810
5810
|
},
|
|
5811
5811
|
unit: {
|
|
5812
5812
|
filename: `${name}.Unit.tsx`,
|
|
5813
|
-
content: sys2.readFile(`lib
|
|
5813
|
+
content: sys2.readFile(`lib/${name}/${name}.Unit.tsx`)
|
|
5814
5814
|
},
|
|
5815
5815
|
view: {
|
|
5816
5816
|
filename: `${name}.View.tsx`,
|
|
5817
|
-
content: sys2.readFile(`lib
|
|
5817
|
+
content: sys2.readFile(`lib/${name}/${name}.View.tsx`)
|
|
5818
5818
|
},
|
|
5819
5819
|
template: {
|
|
5820
5820
|
filename: `${name}.Template.tsx`,
|
|
5821
|
-
content: sys2.readFile(`lib
|
|
5821
|
+
content: sys2.readFile(`lib/${name}/${name}.Template.tsx`)
|
|
5822
5822
|
},
|
|
5823
5823
|
zone: {
|
|
5824
5824
|
filename: `${name}.Zone.tsx`,
|
|
5825
|
-
content: sys2.readFile(`lib
|
|
5825
|
+
content: sys2.readFile(`lib/${name}/${name}.Zone.tsx`)
|
|
5826
5826
|
},
|
|
5827
5827
|
util: {
|
|
5828
5828
|
filename: `${name}.Util.tsx`,
|
|
5829
|
-
content: sys2.readFile(`lib
|
|
5829
|
+
content: sys2.readFile(`lib/${name}/${name}.Util.tsx`)
|
|
5830
5830
|
}
|
|
5831
5831
|
};
|
|
5832
5832
|
}
|
|
@@ -5893,6 +5893,10 @@ var ModuleRunner = class {
|
|
|
5893
5893
|
// pkgs/@akanjs/cli/src/module/module.script.ts
|
|
5894
5894
|
var ModuleScript = class {
|
|
5895
5895
|
#runner = new ModuleRunner();
|
|
5896
|
+
async createModuleTemplate(sys2, name) {
|
|
5897
|
+
await this.#runner.createModuleTemplate(sys2, name);
|
|
5898
|
+
sys2.log(`Module ${name} created in ${sys2.type}s/${sys2.name}/lib/${name}`);
|
|
5899
|
+
}
|
|
5896
5900
|
async createModule(sys2) {
|
|
5897
5901
|
const [appNames, libNames] = await sys2.workspace.getSyss();
|
|
5898
5902
|
const constantExampleFiles = [
|
|
@@ -5913,6 +5917,7 @@ var ModuleScript = class {
|
|
|
5913
5917
|
async removeModule(workspace, name) {
|
|
5914
5918
|
}
|
|
5915
5919
|
async createScalar(sys2, name, description, schemaDescription) {
|
|
5920
|
+
await AiSession.init();
|
|
5916
5921
|
const scalarConstantExampleFiles = await sys2.workspace.getScalarConstantFiles();
|
|
5917
5922
|
const { constant, dictionary } = await this.#runner.createScalarTemplate(sys2, name);
|
|
5918
5923
|
const session = new AiSession();
|
|
@@ -5999,8 +6004,8 @@ var ModuleScript = class {
|
|
|
5999
6004
|
// pkgs/@akanjs/cli/src/module/module.command.ts
|
|
6000
6005
|
var ModuleCommand = class {
|
|
6001
6006
|
moduleScript = new ModuleScript();
|
|
6002
|
-
async createModule(sys2, workspace) {
|
|
6003
|
-
await this.moduleScript.
|
|
6007
|
+
async createModule(sys2, name, workspace) {
|
|
6008
|
+
await this.moduleScript.createModuleTemplate(sys2, name);
|
|
6004
6009
|
}
|
|
6005
6010
|
async removeModule(name, workspace) {
|
|
6006
6011
|
}
|
|
@@ -6023,7 +6028,8 @@ var ModuleCommand = class {
|
|
|
6023
6028
|
__decorateClass([
|
|
6024
6029
|
Target.Public(),
|
|
6025
6030
|
__decorateParam(0, Sys()),
|
|
6026
|
-
__decorateParam(1,
|
|
6031
|
+
__decorateParam(1, Option("name", { desc: "name of module" })),
|
|
6032
|
+
__decorateParam(2, Workspace())
|
|
6027
6033
|
], ModuleCommand.prototype, "createModule", 1);
|
|
6028
6034
|
__decorateClass([
|
|
6029
6035
|
Target.Public(),
|
|
@@ -6141,10 +6147,10 @@ PageCommand = __decorateClass([
|
|
|
6141
6147
|
], PageCommand);
|
|
6142
6148
|
|
|
6143
6149
|
// pkgs/@akanjs/cli/src/workspace/workspace.runner.ts
|
|
6144
|
-
import { v5 as uuid } from "uuid";
|
|
6145
|
-
import { capitalize as capitalize2 } from "lodash";
|
|
6146
6150
|
import latestVersion2 from "latest-version";
|
|
6151
|
+
import { capitalize as capitalize2 } from "lodash";
|
|
6147
6152
|
import path6 from "path";
|
|
6153
|
+
import { v5 as uuid } from "uuid";
|
|
6148
6154
|
var WorkspaceRunner = class {
|
|
6149
6155
|
async createWorkspace(repoName, appName, dirname = ".") {
|
|
6150
6156
|
const cwdPath = process.cwd();
|
|
@@ -4,7 +4,7 @@ function getContent(scanResult, dict) {
|
|
|
4
4
|
filename: `${dict.Model}.Template.tsx`,
|
|
5
5
|
content: `
|
|
6
6
|
"use client";
|
|
7
|
-
import { cnst, st, usePage } from "@${dict.
|
|
7
|
+
import { cnst, st, usePage } from "@${dict.sysName}/client";
|
|
8
8
|
import { Field } from "@shared/ui";
|
|
9
9
|
import { Layout } from "@util/ui";
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ function getContent(scanResult, dict) {
|
|
|
4
4
|
filename: `${dict.Model}.Unit.tsx`,
|
|
5
5
|
content: `
|
|
6
6
|
import { ModelProps } from "@akanjs/client";
|
|
7
|
-
import { cnst, ${dict.Model} } from "@${dict.
|
|
7
|
+
import { cnst, ${dict.Model} } from "@${dict.sysName}/client";
|
|
8
8
|
import { Link } from "@util/ui";
|
|
9
9
|
|
|
10
10
|
export const Card = ({ ${dict.model}, href }: ModelProps<"${dict.model}", cnst.Light${dict.Model}>>) => {
|
|
@@ -6,7 +6,7 @@ function getContent(scanResult, dict) {
|
|
|
6
6
|
"use client";
|
|
7
7
|
import { ModelDashboardProps, ModelInsightProps } from "@akanjs/client";
|
|
8
8
|
import { getQueryMap } from "@akanjs/constant";
|
|
9
|
-
import { cnst } from "@${dict.
|
|
9
|
+
import { cnst } from "@${dict.sysName}/client";
|
|
10
10
|
import { Data } from "@shared/ui";
|
|
11
11
|
|
|
12
12
|
export const Stat = ({
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// pkgs/@akanjs/cli/src/templates/module/__Model__.View.tsx
|
|
2
|
-
function getContent(scanResult, dict
|
|
2
|
+
function getContent(scanResult, dict) {
|
|
3
3
|
return {
|
|
4
4
|
filename: `${dict.Model}.View.tsx`,
|
|
5
5
|
content: `
|
|
6
6
|
import { clsx } from "@akanjs/client";
|
|
7
|
-
import { cnst } from "@${dict.
|
|
7
|
+
import { cnst } from "@${dict.sysName}/client";
|
|
8
8
|
import { Image } from "@util/ui";
|
|
9
9
|
|
|
10
10
|
interface ${dict.Model}ViewProps {
|
|
@@ -6,7 +6,7 @@ function getContent(scanResult, dict) {
|
|
|
6
6
|
"use client";
|
|
7
7
|
import { Data, Load } from "@shared/ui";
|
|
8
8
|
import { ModelsProps } from "@akanjs/client";
|
|
9
|
-
import { cnst, ${dict.Model} } from "@${dict.
|
|
9
|
+
import { cnst, ${dict.Model} } from "@${dict.sysName}/client";
|
|
10
10
|
import { ClientInit, ClientView, DefaultOf } from "@akanjs/signal";
|
|
11
11
|
|
|
12
12
|
export const Admin = ({ sliceName = "${dict.model}", init, query }: ModelsProps<cnst.${dict.Model}>>) => {
|
|
@@ -12,7 +12,7 @@ export class ${dict.Model}Input extends by(cnst.${dict.Model}Input) {}
|
|
|
12
12
|
export class ${dict.Model} extends by(cnst.${dict.Model}) {}
|
|
13
13
|
|
|
14
14
|
@Database.Model(() => cnst.${dict.Model})
|
|
15
|
-
export class ${dict.Model}Model extends into(${dict.Model}, cnst.${dict.
|
|
15
|
+
export class ${dict.Model}Model extends into(${dict.Model}, cnst.${dict.model}Cnst) {
|
|
16
16
|
async getSummary(): Promise<cnst.${dict.Model}Summary> {
|
|
17
17
|
return {
|
|
18
18
|
...(await this.getDefaultSummary()),
|
|
@@ -7,10 +7,10 @@ import { cnst } from "../cnst";
|
|
|
7
7
|
import * as db from "../db";
|
|
8
8
|
|
|
9
9
|
@Service("${dict.Model}Service")
|
|
10
|
-
export class ${dict.Model}Service extends DbService(db.${dict.
|
|
10
|
+
export class ${dict.Model}Service extends DbService(db.${dict.model}Db) {
|
|
11
11
|
async summarize(): Promise<cnst.${dict.Model}Summary> {
|
|
12
12
|
return {
|
|
13
|
-
...(await this.${dict.
|
|
13
|
+
...(await this.${dict.model}Model.getSummary()),
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
16
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
function getContent(scanResult, dict) {
|
|
3
3
|
return `
|
|
4
4
|
import * as adminSpec from "@shared/lib/admin/admin.signal.spec";
|
|
5
|
-
import * as userSpec from "@${dict.
|
|
5
|
+
import * as userSpec from "@${dict.sysName}/lib/user/user.signal.spec";
|
|
6
6
|
import { cnst } from "../cnst";
|
|
7
7
|
import { fetch } from "../fetch";
|
|
8
8
|
import { sampleOf } from "@akanjs/test";
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
function getContent(scanResult, dict) {
|
|
3
3
|
return `
|
|
4
4
|
import * as adminSpec from "@shared/lib/admin/admin.signal.spec";
|
|
5
|
-
import * as userSpec from "@${dict.
|
|
6
|
-
import * as ${dict.model}Spec from "@${dict.
|
|
5
|
+
import * as userSpec from "@${dict.sysName}/lib/user/user.signal.spec";
|
|
6
|
+
import * as ${dict.model}Spec from "@${dict.sysName}/lib/${dict.model}/${dict.model}.signal.spec";
|
|
7
7
|
import { cnst } from "../cnst";
|
|
8
8
|
import { fetch } from "../fetch";
|
|
9
9
|
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { Sys, Workspace } from "@akanjs/devkit";
|
|
|
2
2
|
import { ModuleScript } from "./module.script";
|
|
3
3
|
export declare class ModuleCommand {
|
|
4
4
|
moduleScript: ModuleScript;
|
|
5
|
-
createModule(sys: Sys, workspace: Workspace): Promise<void>;
|
|
5
|
+
createModule(sys: Sys, name: string, workspace: Workspace): Promise<void>;
|
|
6
6
|
removeModule(name: string, workspace: Workspace): Promise<void>;
|
|
7
7
|
scanModule(name: string, workspace: Workspace): Promise<void>;
|
|
8
8
|
createScalar(sys: Sys, name: string, description: string, schemaDescription: string, workspace: Workspace): Promise<void>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type Sys, Workspace } from "@akanjs/devkit";
|
|
2
2
|
export declare class ModuleScript {
|
|
3
3
|
#private;
|
|
4
|
+
createModuleTemplate(sys: Sys, name: string): Promise<void>;
|
|
4
5
|
createModule(sys: Sys): Promise<void>;
|
|
5
6
|
removeModule(workspace: Workspace, name: string): Promise<void>;
|
|
6
7
|
createScalar(sys: Sys, name: string, description: string, schemaDescription: string): Promise<void>;
|
|
@@ -2,7 +2,7 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
|
2
2
|
interface Dict {
|
|
3
3
|
Model: string;
|
|
4
4
|
model: string;
|
|
5
|
-
|
|
5
|
+
sysName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
|
|
8
8
|
filename: string;
|
|
@@ -2,7 +2,7 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
|
2
2
|
interface Dict {
|
|
3
3
|
Model: string;
|
|
4
4
|
model: string;
|
|
5
|
-
|
|
5
|
+
sysName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
|
|
8
8
|
filename: string;
|
|
@@ -2,7 +2,7 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
|
2
2
|
interface Dict {
|
|
3
3
|
Model: string;
|
|
4
4
|
model: string;
|
|
5
|
-
|
|
5
|
+
sysName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
|
|
8
8
|
filename: string;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
2
2
|
interface Dict {
|
|
3
|
-
|
|
3
|
+
Model: string;
|
|
4
|
+
model: string;
|
|
5
|
+
sysName: string;
|
|
4
6
|
}
|
|
5
|
-
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict
|
|
7
|
+
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
|
|
6
8
|
filename: string;
|
|
7
9
|
content: string;
|
|
8
10
|
};
|
|
@@ -2,7 +2,7 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
|
2
2
|
interface Dict {
|
|
3
3
|
Model: string;
|
|
4
4
|
model: string;
|
|
5
|
-
|
|
5
|
+
sysName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): {
|
|
8
8
|
filename: string;
|
|
@@ -2,7 +2,7 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
|
2
2
|
interface Dict {
|
|
3
3
|
Model: string;
|
|
4
4
|
model: string;
|
|
5
|
-
|
|
5
|
+
sysName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): string;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
|
2
2
|
interface Dict {
|
|
3
3
|
Model: string;
|
|
4
4
|
model: string;
|
|
5
|
-
|
|
5
|
+
sysName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): string;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
|
2
2
|
interface Dict {
|
|
3
3
|
Model: string;
|
|
4
4
|
model: string;
|
|
5
|
-
|
|
5
|
+
sysName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): string;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
|
2
2
|
interface Dict {
|
|
3
3
|
Model: string;
|
|
4
4
|
model: string;
|
|
5
|
-
|
|
5
|
+
sysName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): string;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
|
2
2
|
interface Dict {
|
|
3
3
|
Model: string;
|
|
4
4
|
model: string;
|
|
5
|
-
|
|
5
|
+
sysName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): string;
|
|
8
8
|
export {};
|
|
@@ -2,7 +2,7 @@ import type { AppScanResult, LibScanResult } from "@akanjs/config";
|
|
|
2
2
|
interface Dict {
|
|
3
3
|
Model: string;
|
|
4
4
|
model: string;
|
|
5
|
-
|
|
5
|
+
sysName: string;
|
|
6
6
|
}
|
|
7
7
|
export default function getContent(scanResult: AppScanResult | LibScanResult | null, dict: Dict): string;
|
|
8
8
|
export {};
|