@powerhousedao/codegen 0.11.1 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/codegen/.hygen/templates/powerhouse/generate-document-model-module/customTest.esm.t
CHANGED
|
@@ -8,9 +8,15 @@ unless_exists: true
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
import { generateMock } from '@powerhousedao/codegen';
|
|
11
|
+
import { utils as documentModelUtils } from 'document-model/document';
|
|
11
12
|
|
|
12
13
|
import utils from '../../gen/utils';
|
|
13
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
z,
|
|
16
|
+
<% actions.forEach(action => { _%>
|
|
17
|
+
<%= h.changeCase.pascal(action.name) %>Input,
|
|
18
|
+
<% }); _%>
|
|
19
|
+
} from '../../gen/schema';
|
|
14
20
|
import { reducer } from '../../gen/reducer';
|
|
15
21
|
import * as creators from '../../gen/<%= module %>/creators';
|
|
16
22
|
import { <%= h.changeCase.pascal(documentType) %>Document } from '../../gen/types';
|
|
@@ -24,7 +30,13 @@ describe('<%= h.changeCase.pascal(module) %> Operations', () => {
|
|
|
24
30
|
|
|
25
31
|
<% actions.forEach(action => { _%>
|
|
26
32
|
it('should handle <%= h.changeCase.camel(action.name) %> operation', () => {
|
|
27
|
-
|
|
33
|
+
// generate a random id
|
|
34
|
+
// const id = documentModelUtils.hashKey();
|
|
35
|
+
|
|
36
|
+
const input: <%= h.changeCase.pascal(action.name) %>Input = generateMock(
|
|
37
|
+
z.<%= h.changeCase.pascal(action.name) %>InputSchema(),
|
|
38
|
+
);
|
|
39
|
+
|
|
28
40
|
const updatedDocument = reducer(
|
|
29
41
|
document,
|
|
30
42
|
creators.<%= h.changeCase.camel(action.name) %>(input),
|
|
@@ -6,9 +6,18 @@ unless_exists: true
|
|
|
6
6
|
<% documentTypes.forEach(type => { _%>
|
|
7
7
|
import { <%= documentTypesMap[type] %>State, <%= documentTypesMap[type] %>Action, <%= documentTypesMap[type] %>LocalState, actions } from "../.<%= documentModelsDir %>/<%= h.changeCase.param(documentTypesMap[type]) %>";
|
|
8
8
|
%><% }); _%>
|
|
9
|
+
import { utils as documentModelUtils } from 'document-model/document';
|
|
10
|
+
import { Button } from '@powerhousedao/design-system';
|
|
9
11
|
|
|
10
12
|
export type IProps = <% if(!documentTypes.length){ %>EditorProps<unknown, Action><% } else { %><% documentTypes.forEach((type, index) => { _%>EditorProps<<%= documentTypesMap[type] %>State, <%= documentTypesMap[type] %>Action, <%= documentTypesMap[type] %>LocalState%>%>><% if(index < documentTypes.length - 1){ %> | <% }%><% }); _%> <% } %>;
|
|
11
13
|
|
|
12
14
|
export default function Editor(props: IProps) {
|
|
13
|
-
|
|
15
|
+
// generate a random id
|
|
16
|
+
// const id = documentModelUtils.hashKey();
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div>
|
|
20
|
+
<Button onClick={() => console.log('Hello world!')}>My Button</Button>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
14
23
|
};
|