@akanjs/cli 1.0.1 → 1.0.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/src/templates/libRoot/tsconfig.json.template +1 -3
- package/cjs/src/templates/module/__Model__.Template.js +4 -4
- package/cjs/src/templates/module/__Model__.Zone.js +2 -1
- package/cjs/src/templates/module/__model__.document.js +1 -1
- package/cjs/src/templates/module/__model__.service.js +1 -1
- package/cjs/src/templates/module/__model__.signal.js +2 -2
- package/cjs/src/templates/module/__model__.store.js +2 -1
- package/esm/src/templates/libRoot/tsconfig.json.template +1 -3
- package/esm/src/templates/module/__Model__.Template.js +4 -4
- package/esm/src/templates/module/__Model__.Zone.js +2 -1
- package/esm/src/templates/module/__model__.document.js +1 -1
- package/esm/src/templates/module/__model__.service.js +1 -1
- package/esm/src/templates/module/__model__.signal.js +2 -2
- package/esm/src/templates/module/__model__.store.js +2 -1
- package/package.json +1 -1
|
@@ -27,16 +27,16 @@ function getContent(scanInfo, dict) {
|
|
|
27
27
|
filename: `${dict.Model}.Template.tsx`,
|
|
28
28
|
content: `
|
|
29
29
|
"use client";
|
|
30
|
+
import { Field, Layout } from "@akanjs/ui";
|
|
30
31
|
import { cnst, st, usePage } from "@${dict.sysName}/client";
|
|
31
|
-
import { Layout, Field } from "@akanjs/ui";
|
|
32
32
|
|
|
33
|
-
interface
|
|
33
|
+
interface GeneralProps {
|
|
34
34
|
className?: string;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
export const General = ({ className }:
|
|
38
|
-
const ${dict.model}Form = st.use.${dict.model}Form();
|
|
37
|
+
export const General = ({ className }: GeneralProps) => {
|
|
39
38
|
const { l } = usePage();
|
|
39
|
+
const ${dict.model}Form = st.use.${dict.model}Form();
|
|
40
40
|
return (
|
|
41
41
|
<Layout.Template className={className}>
|
|
42
42
|
<Field.Text
|
|
@@ -34,8 +34,9 @@ import { ClientInit, ClientView } from "@akanjs/signal";
|
|
|
34
34
|
interface CardProps {
|
|
35
35
|
className?: string;
|
|
36
36
|
init: ClientInit<"${dict.model}", cnst.Light${dict.Model}>;
|
|
37
|
+
sliceName?: string;
|
|
37
38
|
}
|
|
38
|
-
export const Card = ({ className, init }: CardProps) => {
|
|
39
|
+
export const Card = ({ className, init, sliceName }: CardProps) => {
|
|
39
40
|
return (
|
|
40
41
|
<Load.Units
|
|
41
42
|
className={className}
|
|
@@ -39,7 +39,7 @@ export class ${dict.Model}Model extends into(${dict.Model}, ${dict.Model}Filter,
|
|
|
39
39
|
|
|
40
40
|
export class ${dict.Model}Middleware extends beyond(${dict.Model}Model, ${dict.Model}) {
|
|
41
41
|
onSchema(schema: SchemaOf<${dict.Model}Model, ${dict.Model}>) {
|
|
42
|
-
// schema.index({
|
|
42
|
+
// schema.index({ field: 1 })
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
45
|
`;
|
|
@@ -29,6 +29,6 @@ import { serve } from "@akanjs/service";
|
|
|
29
29
|
import * as cnst from "../cnst";
|
|
30
30
|
import * as db from "../db";
|
|
31
31
|
|
|
32
|
-
export class ${dict.Model}Service extends serve(db.${dict.model}, () => ({})) {}
|
|
32
|
+
export class ${dict.Model}Service extends serve(db.${dict.model}, ({ use, service }) => ({})) {}
|
|
33
33
|
`;
|
|
34
34
|
}
|
|
@@ -30,7 +30,7 @@ import { endpoint, internal, slice } from "@akanjs/signal";
|
|
|
30
30
|
import * as cnst from "../cnst";
|
|
31
31
|
import * as srv from "../srv";
|
|
32
32
|
|
|
33
|
-
export class ${dict.Model}Internal extends internal(srv.${dict.model}, () => ({})) {}
|
|
33
|
+
export class ${dict.Model}Internal extends internal(srv.${dict.model}, ({ interval }) => ({})) {}
|
|
34
34
|
|
|
35
35
|
export class ${dict.Model}Slice extends slice(srv.${dict.model}, { guards: { root: Public, get: Public, cru: Public } }, (init) => ({
|
|
36
36
|
inPublic: init()
|
|
@@ -39,6 +39,6 @@ export class ${dict.Model}Slice extends slice(srv.${dict.model}, { guards: { roo
|
|
|
39
39
|
}),
|
|
40
40
|
})) {}
|
|
41
41
|
|
|
42
|
-
export class ${dict.Model}Endpoint extends endpoint(srv.${dict.model}, () => ({})) {}
|
|
42
|
+
export class ${dict.Model}Endpoint extends endpoint(srv.${dict.model}, ({ query, mutation }) => ({})) {}
|
|
43
43
|
`;
|
|
44
44
|
}
|
|
@@ -26,7 +26,8 @@ function getContent(scanInfo, dict) {
|
|
|
26
26
|
return `
|
|
27
27
|
import { store } from "@akanjs/store";
|
|
28
28
|
|
|
29
|
-
import
|
|
29
|
+
import * as cnst from "../cnst";
|
|
30
|
+
import { fetch, sig } from "../useClient";
|
|
30
31
|
|
|
31
32
|
export class ${dict.Model}Store extends store(sig.${dict.model}, {
|
|
32
33
|
// state
|
|
@@ -4,16 +4,16 @@ function getContent(scanInfo, dict) {
|
|
|
4
4
|
filename: `${dict.Model}.Template.tsx`,
|
|
5
5
|
content: `
|
|
6
6
|
"use client";
|
|
7
|
+
import { Field, Layout } from "@akanjs/ui";
|
|
7
8
|
import { cnst, st, usePage } from "@${dict.sysName}/client";
|
|
8
|
-
import { Layout, Field } from "@akanjs/ui";
|
|
9
9
|
|
|
10
|
-
interface
|
|
10
|
+
interface GeneralProps {
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
export const General = ({ className }:
|
|
15
|
-
const ${dict.model}Form = st.use.${dict.model}Form();
|
|
14
|
+
export const General = ({ className }: GeneralProps) => {
|
|
16
15
|
const { l } = usePage();
|
|
16
|
+
const ${dict.model}Form = st.use.${dict.model}Form();
|
|
17
17
|
return (
|
|
18
18
|
<Layout.Template className={className}>
|
|
19
19
|
<Field.Text
|
|
@@ -11,8 +11,9 @@ import { ClientInit, ClientView } from "@akanjs/signal";
|
|
|
11
11
|
interface CardProps {
|
|
12
12
|
className?: string;
|
|
13
13
|
init: ClientInit<"${dict.model}", cnst.Light${dict.Model}>;
|
|
14
|
+
sliceName?: string;
|
|
14
15
|
}
|
|
15
|
-
export const Card = ({ className, init }: CardProps) => {
|
|
16
|
+
export const Card = ({ className, init, sliceName }: CardProps) => {
|
|
16
17
|
return (
|
|
17
18
|
<Load.Units
|
|
18
19
|
className={className}
|
|
@@ -16,7 +16,7 @@ export class ${dict.Model}Model extends into(${dict.Model}, ${dict.Model}Filter,
|
|
|
16
16
|
|
|
17
17
|
export class ${dict.Model}Middleware extends beyond(${dict.Model}Model, ${dict.Model}) {
|
|
18
18
|
onSchema(schema: SchemaOf<${dict.Model}Model, ${dict.Model}>) {
|
|
19
|
-
// schema.index({
|
|
19
|
+
// schema.index({ field: 1 })
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
`;
|
|
@@ -6,7 +6,7 @@ import { serve } from "@akanjs/service";
|
|
|
6
6
|
import * as cnst from "../cnst";
|
|
7
7
|
import * as db from "../db";
|
|
8
8
|
|
|
9
|
-
export class ${dict.Model}Service extends serve(db.${dict.model}, () => ({})) {}
|
|
9
|
+
export class ${dict.Model}Service extends serve(db.${dict.model}, ({ use, service }) => ({})) {}
|
|
10
10
|
`;
|
|
11
11
|
}
|
|
12
12
|
export {
|
|
@@ -7,7 +7,7 @@ import { endpoint, internal, slice } from "@akanjs/signal";
|
|
|
7
7
|
import * as cnst from "../cnst";
|
|
8
8
|
import * as srv from "../srv";
|
|
9
9
|
|
|
10
|
-
export class ${dict.Model}Internal extends internal(srv.${dict.model}, () => ({})) {}
|
|
10
|
+
export class ${dict.Model}Internal extends internal(srv.${dict.model}, ({ interval }) => ({})) {}
|
|
11
11
|
|
|
12
12
|
export class ${dict.Model}Slice extends slice(srv.${dict.model}, { guards: { root: Public, get: Public, cru: Public } }, (init) => ({
|
|
13
13
|
inPublic: init()
|
|
@@ -16,7 +16,7 @@ export class ${dict.Model}Slice extends slice(srv.${dict.model}, { guards: { roo
|
|
|
16
16
|
}),
|
|
17
17
|
})) {}
|
|
18
18
|
|
|
19
|
-
export class ${dict.Model}Endpoint extends endpoint(srv.${dict.model}, () => ({})) {}
|
|
19
|
+
export class ${dict.Model}Endpoint extends endpoint(srv.${dict.model}, ({ query, mutation }) => ({})) {}
|
|
20
20
|
`;
|
|
21
21
|
}
|
|
22
22
|
export {
|
|
@@ -3,7 +3,8 @@ function getContent(scanInfo, dict) {
|
|
|
3
3
|
return `
|
|
4
4
|
import { store } from "@akanjs/store";
|
|
5
5
|
|
|
6
|
-
import
|
|
6
|
+
import * as cnst from "../cnst";
|
|
7
|
+
import { fetch, sig } from "../useClient";
|
|
7
8
|
|
|
8
9
|
export class ${dict.Model}Store extends store(sig.${dict.model}, {
|
|
9
10
|
// state
|