@powerhousedao/codegen 0.47.0 → 0.48.1

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.
@@ -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 { Action, EditorProps } from 'document-model';<% } else { %>import { EditorProps } from 'document-model';<% } %>
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<unknown, Action><% } else { %><% documentTypes.forEach((type, index) => { _%>EditorProps<<%= documentTypesMap[type].name %>Document%>%>><% if(index < documentTypes.length - 1){ %> | <% }%><% }); _%> <% } %>;
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){ %>| <% }%><% }); _%> <% } %>= {
@@ -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';
@@ -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/utils";
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 { Document } from "document-model";<% } %>
16
- type DocumentType = <% if(documentTypes.length) { %><%= documentTypes.map(type => `${documentTypesMap[type].name}Document`).join(" | ") %> <% } else { %>Document<% } %>;
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";
@@ -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/utils";
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 { Document } from "document-model";<% } %>
16
- type DocumentType = <% if(documentTypes.length) { %><%= documentTypes.map(type => `${documentTypesMap[type].name}Document`).join(" | ") %> <% } else { %>Document<% } %>;
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";