@powerhousedao/codegen 0.47.0 → 0.48.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/src/codegen/.hygen/templates/powerhouse/generate-document-model-mutations/schema.esm.t +2 -1
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/editor.esm.t +3 -3
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/index.esm.t +3 -3
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/lib.inject_export.esm.t +1 -1
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-processor-analytics/index.esm.t +5 -5
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-processor-analytics/lib.inject_export.esm.t +1 -1
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-processor-operational/index.esm.t +5 -5
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-processor-operational/lib.inject_export.esm.t +1 -1
- package/package.json +1 -1
- package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/story.esm.t +0 -31
package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-mutations/schema.esm.t
CHANGED
|
@@ -3,8 +3,9 @@ to: "<%= rootDir %>/<%= h.changeCase.param(subgraph) %>/schema.ts"
|
|
|
3
3
|
force: true
|
|
4
4
|
---
|
|
5
5
|
import { gql } from "graphql-tag";
|
|
6
|
+
import type { DocumentNode } from "graphql";
|
|
6
7
|
|
|
7
|
-
export const schema = gql`
|
|
8
|
+
export const schema: DocumentNode = gql`
|
|
8
9
|
"""
|
|
9
10
|
Subgraph definition for <%= h.changeCase.pascal(documentType) %> (<%- documentTypeId %>)
|
|
10
11
|
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
to: "<%= rootDir %>/<%= h.changeCase.param(name) %>/editor.tsx"
|
|
3
3
|
unless_exists: true
|
|
4
4
|
---
|
|
5
|
-
<% if(!documentTypes.length){ %>import {
|
|
5
|
+
<% if(!documentTypes.length){ %>import type { EditorProps, PHDocument } from 'document-model';<% } else { %>import type { EditorProps } from 'document-model';<% } %>
|
|
6
6
|
<% documentTypes.forEach(type => { _%>
|
|
7
|
-
import { <%= documentTypesMap[type].name %>Document, actions } from "<%= documentTypesMap[type].importPath
|
|
7
|
+
import { type <%= documentTypesMap[type].name %>Document, actions } from "<%= documentTypesMap[type].importPath %>/index.js";
|
|
8
8
|
%><% }); _%>
|
|
9
9
|
import { Button } from '@powerhousedao/design-system';
|
|
10
10
|
|
|
11
|
-
export type IProps = <% if(!documentTypes.length){ %>EditorProps<
|
|
11
|
+
export type IProps = <% if(!documentTypes.length){ %>EditorProps<PHDocument><% } else { %><% documentTypes.forEach((type, index) => { _%>EditorProps<<%= documentTypesMap[type].name %>Document%>%>><% if(index < documentTypes.length - 1){ %> | <% }%><% }); _%> <% } %>;
|
|
12
12
|
|
|
13
13
|
export default function Editor(props: IProps) {
|
|
14
14
|
return (
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
to: "<%= rootDir %>/<%= h.changeCase.param(name) %>/index.ts"
|
|
3
3
|
force: true
|
|
4
4
|
---
|
|
5
|
-
import { EditorModule } from 'document-model';
|
|
6
|
-
import Editor from './editor';
|
|
5
|
+
import type { EditorModule } from 'document-model';
|
|
6
|
+
import Editor from './editor.js';
|
|
7
7
|
<% documentTypes.forEach(type => { _%>
|
|
8
|
-
import { <%= documentTypesMap[type].name %>Document } from "<%= documentTypesMap[type].importPath
|
|
8
|
+
import type { <%= documentTypesMap[type].name %>Document } from "<%= documentTypesMap[type].importPath %>/index.js";
|
|
9
9
|
%><% }); _%>
|
|
10
10
|
|
|
11
11
|
export const module: <% if(!documentTypes.length){ %>EditorModule<% } else { %><% documentTypes.forEach((type, index) => { _%>EditorModule<<%= documentTypesMap[type].name %>Document%>%>> <% if(index < documentTypes.length - 1){ %>| <% }%><% }); _%> <% } %>= {
|
package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/lib.inject_export.esm.t
CHANGED
|
@@ -4,4 +4,4 @@ append: true
|
|
|
4
4
|
to: "<%= rootDir %>/index.ts"
|
|
5
5
|
skip_if: "<%= h.changeCase.pascal(name) %>"
|
|
6
6
|
---
|
|
7
|
-
export { module as <%= h.changeCase.pascal(name) %> } from './<%= h.changeCase.param(name)
|
|
7
|
+
export { module as <%= h.changeCase.pascal(name) %> } from './<%= h.changeCase.param(name) %>/index.js';
|
package/dist/src/codegen/.hygen/templates/powerhouse/generate-processor-analytics/index.esm.t
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
to: "<%= rootDir %>/<%= h.changeCase.param(name) %>/index.ts"
|
|
3
3
|
force: true
|
|
4
4
|
---
|
|
5
|
-
import { generateId } from "document-model
|
|
6
|
-
import {
|
|
5
|
+
import { generateId } from "document-model";
|
|
6
|
+
import type {
|
|
7
7
|
AnalyticsProcessor,
|
|
8
8
|
ProcessorOptions,
|
|
9
9
|
ProcessorUpdate,
|
|
10
10
|
AnalyticsPath
|
|
11
11
|
} from "@powerhousedao/reactor-api";
|
|
12
12
|
<% documentTypes.forEach(type => { _%>
|
|
13
|
-
import { <%= documentTypesMap[type].name %>Document } from "<%= documentTypesMap[type].importPath
|
|
13
|
+
import type { <%= documentTypesMap[type].name %>Document } from "<%= documentTypesMap[type].importPath %>/index.js";
|
|
14
14
|
%><% }); _%>
|
|
15
|
-
<% if(documentTypes.length === 0) { %>import {
|
|
16
|
-
type DocumentType = <% if(documentTypes.length) { %><%= documentTypes.map(type => `${documentTypesMap[type].name}Document`).join(" | ") %> <% } else { %>
|
|
15
|
+
<% if(documentTypes.length === 0) { %>import type { PHDocument } from "document-model";<% } %>
|
|
16
|
+
type DocumentType = <% if(documentTypes.length) { %><%= documentTypes.map(type => `${documentTypesMap[type].name}Document`).join(" | ") %> <% } else { %>PHDocument<% } %>;
|
|
17
17
|
|
|
18
18
|
export class <%= pascalName %>Processor extends AnalyticsProcessor<% if(documentTypes.length) { %><DocumentType><% } %> {
|
|
19
19
|
|
|
@@ -4,4 +4,4 @@ append: true
|
|
|
4
4
|
to: "<%= rootDir %>/index.ts"
|
|
5
5
|
skip_if: "<%= h.changeCase.pascal(name) %>"
|
|
6
6
|
---
|
|
7
|
-
export * as <%= h.changeCase.pascal(name) %>Processor from "./<%= h.changeCase.param(name)
|
|
7
|
+
export * as <%= h.changeCase.pascal(name) %>Processor from "./<%= h.changeCase.param(name) %>/index.js";
|
package/dist/src/codegen/.hygen/templates/powerhouse/generate-processor-operational/index.esm.t
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
to: "<%= rootDir %>/<%= h.changeCase.param(name) %>/index.ts"
|
|
3
3
|
force: true
|
|
4
4
|
---
|
|
5
|
-
import { generateId } from "document-model
|
|
6
|
-
import {
|
|
5
|
+
import { generateId } from "document-model";
|
|
6
|
+
import type {
|
|
7
7
|
OperationalProcessor,
|
|
8
8
|
ProcessorOptions,
|
|
9
9
|
ProcessorSetupArgs,
|
|
10
10
|
ProcessorUpdate,
|
|
11
11
|
} from "@powerhousedao/reactor-api";
|
|
12
12
|
<% documentTypes.forEach(type => { _%>
|
|
13
|
-
import { <%= documentTypesMap[type].name %>Document } from "<%= documentTypesMap[type].importPath
|
|
13
|
+
import type { <%= documentTypesMap[type].name %>Document } from "<%= documentTypesMap[type].importPath %>/index.js";
|
|
14
14
|
%><% }); _%>
|
|
15
|
-
<% if(documentTypes.length === 0) { %>import {
|
|
16
|
-
type DocumentType = <% if(documentTypes.length) { %><%= documentTypes.map(type => `${documentTypesMap[type].name}Document`).join(" | ") %> <% } else { %>
|
|
15
|
+
<% if(documentTypes.length === 0) { %>import { PHDocument } from "document-model";<% } %>
|
|
16
|
+
type DocumentType = <% if(documentTypes.length) { %><%= documentTypes.map(type => `${documentTypesMap[type].name}Document`).join(" | ") %> <% } else { %>PHDocument<% } %>;
|
|
17
17
|
|
|
18
18
|
export class <%= pascalName %>Processor extends OperationalProcessor<% if(documentTypes.length) { %><DocumentType><% } %> {
|
|
19
19
|
|
|
@@ -5,4 +5,4 @@ to: "<%= rootDir %>/index.ts"
|
|
|
5
5
|
skip_if: "<%= h.changeCase.pascal(name) %>"
|
|
6
6
|
force: true
|
|
7
7
|
---
|
|
8
|
-
export * as <%= h.changeCase.pascal(name) %>Processor from "./<%= h.changeCase.param(name)
|
|
8
|
+
export * as <%= h.changeCase.pascal(name) %>Processor from "./<%= h.changeCase.param(name) %>/index.js";
|
package/package.json
CHANGED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
to: "<%= rootDir %>/<%= h.changeCase.param(name) %>/<%= h.changeCase.param(name) %>.stories.tsx"
|
|
3
|
-
unless_exists: true
|
|
4
|
-
---
|
|
5
|
-
import Editor from './editor';
|
|
6
|
-
import { createDocumentStory } from 'document-model-libs/utils';
|
|
7
|
-
<% if(!documentTypes.length){ %>import { baseReducer, utils } from 'document-model';<% } %>
|
|
8
|
-
<% documentTypes.forEach(type => { _%>
|
|
9
|
-
import * as <%= documentTypesMap[type].name %>Module from "<%= documentTypesMap[type].importPath %>";
|
|
10
|
-
%><% }); _%>
|
|
11
|
-
|
|
12
|
-
<% if(!documentTypes.length){ %>
|
|
13
|
-
const { meta, CreateDocumentStory: <%= h.changeCase.pascal(name) %> } = createDocumentStory(
|
|
14
|
-
Editor,
|
|
15
|
-
(...args) => baseReducer(...args, document => document),
|
|
16
|
-
utils.createExtendedState(),
|
|
17
|
-
);
|
|
18
|
-
export { <%= h.changeCase.pascal(name) %> };
|
|
19
|
-
<% } %>
|
|
20
|
-
|
|
21
|
-
<% documentTypes.forEach((type, index) => { _%>
|
|
22
|
-
const { <% if(index === 0){ %>meta, <% } %>CreateDocumentStory: <%= documentTypesMap[type].name %> } = createDocumentStory(
|
|
23
|
-
Editor,
|
|
24
|
-
<%= documentTypesMap[type].name %>Module.reducer,
|
|
25
|
-
<%= documentTypesMap[type].name %>Module.utils.createDocument(),
|
|
26
|
-
);
|
|
27
|
-
export { <%= documentTypesMap[type].name %> }
|
|
28
|
-
|
|
29
|
-
%><% }); _%>
|
|
30
|
-
|
|
31
|
-
export default { ...meta, title: '<%= h.changeCase.title(name) %>' };
|