@powerhousedao/codegen 5.1.0-dev.35 → 5.1.0-dev.37

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.
Files changed (145) hide show
  1. package/dist/src/create-lib/create-project.d.ts +8 -27
  2. package/dist/src/create-lib/create-project.d.ts.map +1 -1
  3. package/dist/src/create-lib/create-project.js +78 -231
  4. package/dist/src/create-lib/create-project.js.map +1 -1
  5. package/dist/src/create-lib/utils.d.ts +1 -0
  6. package/dist/src/create-lib/utils.d.ts.map +1 -1
  7. package/dist/src/create-lib/utils.js +6 -0
  8. package/dist/src/create-lib/utils.js.map +1 -1
  9. package/dist/src/file-builders/boilerplate/build-package-json.test.d.ts +2 -0
  10. package/dist/src/file-builders/boilerplate/build-package-json.test.d.ts.map +1 -0
  11. package/dist/src/file-builders/boilerplate/build-package-json.test.js +25 -0
  12. package/dist/src/file-builders/boilerplate/build-package-json.test.js.map +1 -0
  13. package/dist/src/file-builders/boilerplate/constants.d.ts +3 -0
  14. package/dist/src/file-builders/boilerplate/constants.d.ts.map +1 -0
  15. package/dist/src/file-builders/boilerplate/constants.js +19 -0
  16. package/dist/src/file-builders/boilerplate/constants.js.map +1 -0
  17. package/dist/src/file-builders/boilerplate/package-json-versions.test.d.ts +2 -0
  18. package/dist/src/file-builders/boilerplate/package-json-versions.test.d.ts.map +1 -0
  19. package/dist/src/file-builders/boilerplate/package-json-versions.test.js +34 -0
  20. package/dist/src/file-builders/boilerplate/package-json-versions.test.js.map +1 -0
  21. package/dist/src/file-builders/boilerplate/package.json.d.ts +6 -0
  22. package/dist/src/file-builders/boilerplate/package.json.d.ts.map +1 -0
  23. package/dist/src/file-builders/boilerplate/package.json.js +19 -0
  24. package/dist/src/file-builders/boilerplate/package.json.js.map +1 -0
  25. package/dist/src/file-builders/index.d.ts +4 -0
  26. package/dist/src/file-builders/index.d.ts.map +1 -0
  27. package/dist/src/file-builders/index.js +4 -0
  28. package/dist/src/file-builders/index.js.map +1 -0
  29. package/dist/src/file-builders/utils.d.ts +17 -0
  30. package/dist/src/file-builders/utils.d.ts.map +1 -0
  31. package/dist/src/file-builders/utils.js +64 -0
  32. package/dist/src/file-builders/utils.js.map +1 -0
  33. package/dist/src/templates/boilerplate/AGENTS.md.d.ts +2 -0
  34. package/dist/src/templates/boilerplate/AGENTS.md.d.ts.map +1 -0
  35. package/dist/src/templates/boilerplate/AGENTS.md.js +408 -0
  36. package/dist/src/templates/boilerplate/AGENTS.md.js.map +1 -0
  37. package/dist/src/templates/boilerplate/CLAUDE.md.d.ts +2 -0
  38. package/dist/src/templates/boilerplate/CLAUDE.md.d.ts.map +1 -0
  39. package/dist/src/templates/boilerplate/CLAUDE.md.js +408 -0
  40. package/dist/src/templates/boilerplate/CLAUDE.md.js.map +1 -0
  41. package/dist/src/templates/boilerplate/LICENSE.d.ts +2 -0
  42. package/dist/src/templates/boilerplate/LICENSE.d.ts.map +1 -0
  43. package/{LICENSE → dist/src/templates/boilerplate/LICENSE.js} +4 -1
  44. package/dist/src/templates/boilerplate/LICENSE.js.map +1 -0
  45. package/dist/src/templates/boilerplate/README.md.d.ts +2 -0
  46. package/dist/src/templates/boilerplate/README.md.d.ts.map +1 -0
  47. package/dist/src/templates/boilerplate/README.md.js +194 -0
  48. package/dist/src/templates/boilerplate/README.md.js.map +1 -0
  49. package/dist/src/templates/boilerplate/claude/settings.local.json.d.ts +2 -0
  50. package/dist/src/templates/boilerplate/claude/settings.local.json.d.ts.map +1 -0
  51. package/dist/src/templates/boilerplate/claude/settings.local.json.js +18 -0
  52. package/dist/src/templates/boilerplate/claude/settings.local.json.js.map +1 -0
  53. package/dist/src/templates/boilerplate/cursor/mcp.json.d.ts +2 -0
  54. package/dist/src/templates/boilerplate/cursor/mcp.json.d.ts.map +1 -0
  55. package/dist/src/templates/boilerplate/cursor/mcp.json.js +12 -0
  56. package/dist/src/templates/boilerplate/cursor/mcp.json.js.map +1 -0
  57. package/dist/src/templates/boilerplate/document-models/document-models.d.ts.map +1 -0
  58. package/dist/src/templates/boilerplate/document-models/document-models.js.map +1 -0
  59. package/dist/src/templates/boilerplate/document-models/index.d.ts +2 -0
  60. package/dist/src/templates/boilerplate/document-models/index.d.ts.map +1 -0
  61. package/dist/src/templates/boilerplate/document-models/index.js +2 -0
  62. package/dist/src/templates/boilerplate/document-models/index.js.map +1 -0
  63. package/dist/src/templates/boilerplate/editors/editors.d.ts.map +1 -0
  64. package/dist/src/templates/boilerplate/editors/editors.js.map +1 -0
  65. package/dist/src/templates/boilerplate/editors/index.d.ts +2 -0
  66. package/dist/src/templates/boilerplate/editors/index.d.ts.map +1 -0
  67. package/dist/src/templates/boilerplate/editors/index.js +2 -0
  68. package/dist/src/templates/boilerplate/editors/index.js.map +1 -0
  69. package/dist/src/templates/boilerplate/eslint.config.js.d.ts +2 -0
  70. package/dist/src/templates/boilerplate/eslint.config.js.d.ts.map +1 -0
  71. package/dist/src/templates/boilerplate/eslint.config.js.js +140 -0
  72. package/dist/src/templates/boilerplate/eslint.config.js.js.map +1 -0
  73. package/dist/src/templates/boilerplate/gemini/settings.json.d.ts +2 -0
  74. package/dist/src/templates/boilerplate/gemini/settings.json.d.ts.map +1 -0
  75. package/dist/src/templates/boilerplate/gemini/settings.json.js +12 -0
  76. package/dist/src/templates/boilerplate/gemini/settings.json.js.map +1 -0
  77. package/dist/src/templates/boilerplate/gitignore.d.ts +2 -0
  78. package/dist/src/templates/boilerplate/gitignore.d.ts.map +1 -0
  79. package/dist/src/templates/boilerplate/gitignore.js +11 -0
  80. package/dist/src/templates/boilerplate/gitignore.js.map +1 -0
  81. package/dist/src/templates/boilerplate/index.html.legacy.d.ts +2 -0
  82. package/dist/src/templates/boilerplate/index.html.legacy.d.ts.map +1 -0
  83. package/dist/src/templates/boilerplate/index.html.legacy.js +36 -0
  84. package/dist/src/templates/boilerplate/index.html.legacy.js.map +1 -0
  85. package/dist/src/templates/boilerplate/mcp.json.d.ts +2 -0
  86. package/dist/src/templates/boilerplate/mcp.json.d.ts.map +1 -0
  87. package/dist/src/templates/boilerplate/mcp.json.js +12 -0
  88. package/dist/src/templates/boilerplate/mcp.json.js.map +1 -0
  89. package/dist/src/templates/boilerplate/npmrc.d.ts +2 -0
  90. package/dist/src/templates/boilerplate/npmrc.d.ts.map +1 -0
  91. package/dist/src/templates/boilerplate/npmrc.js +2 -0
  92. package/dist/src/templates/boilerplate/npmrc.js.map +1 -0
  93. package/dist/src/templates/boilerplate/package.json.d.ts +1 -54
  94. package/dist/src/templates/boilerplate/package.json.d.ts.map +1 -1
  95. package/dist/src/templates/boilerplate/package.json.js +115 -54
  96. package/dist/src/templates/boilerplate/package.json.js.map +1 -1
  97. package/dist/src/templates/boilerplate/package.json.legacy.d.ts +55 -0
  98. package/dist/src/templates/boilerplate/package.json.legacy.d.ts.map +1 -0
  99. package/dist/src/templates/boilerplate/package.json.legacy.js +55 -0
  100. package/dist/src/templates/boilerplate/package.json.legacy.js.map +1 -0
  101. package/dist/src/templates/boilerplate/powerhouse.config.json.d.ts +6 -0
  102. package/dist/src/templates/boilerplate/powerhouse.config.json.d.ts.map +1 -0
  103. package/dist/src/templates/boilerplate/powerhouse.config.json.js +46 -0
  104. package/dist/src/templates/boilerplate/powerhouse.config.json.js.map +1 -0
  105. package/dist/src/templates/boilerplate/powerhouse.manifest.json.d.ts +2 -0
  106. package/dist/src/templates/boilerplate/powerhouse.manifest.json.d.ts.map +1 -0
  107. package/dist/src/templates/boilerplate/powerhouse.manifest.json.js +19 -0
  108. package/dist/src/templates/boilerplate/powerhouse.manifest.json.js.map +1 -0
  109. package/dist/src/templates/boilerplate/processors/index.d.ts +2 -0
  110. package/dist/src/templates/boilerplate/processors/index.d.ts.map +1 -0
  111. package/dist/src/templates/boilerplate/processors/index.js +2 -0
  112. package/dist/src/templates/boilerplate/processors/index.js.map +1 -0
  113. package/dist/src/templates/boilerplate/style.css.d.ts +2 -0
  114. package/dist/src/templates/boilerplate/style.css.d.ts.map +1 -0
  115. package/dist/src/templates/boilerplate/style.css.js +17 -0
  116. package/dist/src/templates/boilerplate/style.css.js.map +1 -0
  117. package/dist/src/templates/boilerplate/subgraphs/index.d.ts +2 -0
  118. package/dist/src/templates/boilerplate/subgraphs/index.d.ts.map +1 -0
  119. package/dist/src/templates/boilerplate/subgraphs/index.js +2 -0
  120. package/dist/src/templates/boilerplate/subgraphs/index.js.map +1 -0
  121. package/dist/src/templates/boilerplate/vite.config.ts.d.ts +2 -0
  122. package/dist/src/templates/boilerplate/vite.config.ts.d.ts.map +1 -0
  123. package/dist/src/templates/boilerplate/vite.config.ts.js +21 -0
  124. package/dist/src/templates/boilerplate/vite.config.ts.js.map +1 -0
  125. package/dist/src/templates/boilerplate/vitest.config.ts.d.ts +2 -0
  126. package/dist/src/templates/boilerplate/vitest.config.ts.d.ts.map +1 -0
  127. package/dist/src/templates/boilerplate/vitest.config.ts.js +21 -0
  128. package/dist/src/templates/boilerplate/vitest.config.ts.js.map +1 -0
  129. package/dist/src/templates/index.d.ts +24 -2
  130. package/dist/src/templates/index.d.ts.map +1 -1
  131. package/dist/src/templates/index.js +24 -2
  132. package/dist/src/templates/index.js.map +1 -1
  133. package/dist/tsconfig.tsbuildinfo +1 -1
  134. package/dist/vitest.config.d.ts.map +1 -1
  135. package/dist/vitest.config.js +4 -1
  136. package/dist/vitest.config.js.map +1 -1
  137. package/package.json +12 -7
  138. package/dist/src/templates/boilerplate/document-models.d.ts.map +0 -1
  139. package/dist/src/templates/boilerplate/document-models.js.map +0 -1
  140. package/dist/src/templates/boilerplate/editors.d.ts.map +0 -1
  141. package/dist/src/templates/boilerplate/editors.js.map +0 -1
  142. /package/dist/src/templates/boilerplate/{document-models.d.ts → document-models/document-models.d.ts} +0 -0
  143. /package/dist/src/templates/boilerplate/{document-models.js → document-models/document-models.js} +0 -0
  144. /package/dist/src/templates/boilerplate/{editors.d.ts → editors/editors.d.ts} +0 -0
  145. /package/dist/src/templates/boilerplate/{editors.js → editors/editors.js} +0 -0
@@ -0,0 +1,194 @@
1
+ import { md } from "@tmpl/core";
2
+ export const readmeTemplate = md `
3
+ # Document Model Boilerplate
4
+
5
+ This Document Model Boilerplate provides code generation for scaffolding editors and models.
6
+ It ensures compatibility with host applications like Connect and the Reactors for seamless document model and editor integration.
7
+
8
+ ## Standard Document Model Workflow with help of the boilerplate.
9
+
10
+ This tutorial will guide you through the process of creating a new document model using the Document Model Editor in the Connect app.
11
+
12
+ <details>
13
+ <summary>Available NPM commands</summary>
14
+
15
+ - \`generate\`: Updates the generated code according to the JSON spec and GraphQL schema of your document model, made in Connect.
16
+ - \`lint\`: Checks for errors with ESLint and TypeScript checking.
17
+ - \`format\`: Formats the code using Prettier.
18
+ - \`build\`: Builds the library project using Vite.
19
+ - \`storybook\`: Starts Storybook in development mode.
20
+ - \`build-storybook\`: Builds Storybook.
21
+ - \`test\`: Runs Jest for testing.
22
+
23
+ </details>
24
+
25
+ ### 1. Defining Your Document Model GraphQL Schema
26
+
27
+ Start by creating your own 'Powerhouse Project' (Document model + editor).
28
+
29
+ Step 1: Run the following command to set up your project inside this directory:
30
+
31
+ ~~~bash
32
+ npm create document-model-lib
33
+ ~~~
34
+
35
+ Step 2: Use the Document Model Editor in the Connect app
36
+
37
+ The following command gives you access to all the powerhouse CLI tools available, install it globally if you are a poweruser.
38
+
39
+ ~~~bash
40
+ npm install ph-cmd
41
+ ~~~
42
+
43
+ Now you are able to launch Connect in Studio Mode (Locally):
44
+
45
+ ~~~bash
46
+ npm run connect
47
+ ~~~
48
+
49
+ Open the 'Document Model' creator at the bottom of connect to define your document mode with it's GraphQL Schema Definition.
50
+ This schema will define the structure and fields for your document model using GraphQL.
51
+ Follow one of our tutorials on Academy to get familiar with the process.
52
+
53
+ ### 2. Defining Document Model Operations
54
+
55
+ Using the Document Model Operations Editor, define the operations for your document model and their GraphQL counterparts.
56
+ These operations will handle state changes within your document model.
57
+
58
+ **Best Practices:**
59
+
60
+ - Clearly define CRUD operations (Create, Read, Update, Delete).
61
+ - Use GraphQL input types to specify the parameters for each operation.
62
+ - Ensure that operations align with user intent to maintain a clean and understandable API.
63
+
64
+ ### 3. Generating Scaffolding Code
65
+
66
+ Export your document model as a .zip file from Connect.
67
+ Import the .zip file into your project directory created in Step 1.
68
+ Run the following command to generate the scaffolding code:
69
+
70
+ ~~~bash
71
+ npm run generate YourModelName.phdm.zip
72
+ ~~~
73
+
74
+ This will create a new directory under /document-models containing:
75
+
76
+ JSON file with the document model specification.
77
+ GraphQL file with state and operation schemas.
78
+ A gen/ folder with autogenerated code.
79
+ A src/ folder for your custom code implementation.
80
+
81
+ ### 4. Implementing Reducer Code and Unit Tests
82
+
83
+ Navigate to the reducer directory:
84
+
85
+ ~~~bash
86
+ cd document-models/"YourModelName"/src/reducers
87
+ ~~~
88
+
89
+ Implement the reducer functions for each document model operation. These functions will handle state transitions.
90
+
91
+ Add utility functions in:
92
+
93
+ ~~~bash
94
+ document-models/"YourModelName"/src/utils.ts
95
+ ~~~
96
+
97
+ Write unit tests to ensure the correctness of your reducers:
98
+
99
+ Test files should be located in:
100
+
101
+ ~~~bash
102
+ document-models/"YourModelName"/src/reducers/tests
103
+ ~~~
104
+
105
+ Run the tests:
106
+
107
+ ~~~bash
108
+ npm test
109
+ ~~~
110
+
111
+ Test the editor functionality:
112
+
113
+ ~~~bash
114
+ npm run connect
115
+ ~~~
116
+
117
+ ### 5. Implementing Document Editors
118
+
119
+ Generate the editor template for your document model:
120
+
121
+ ~~~bash
122
+ npm run generate -- --editor YourModelName --document-types powerhouse/YourModelName
123
+ ~~~
124
+
125
+ The --editor flag specifies the name of your document model.
126
+ The --document-types flag links the editor to your document model type.
127
+ After generation:
128
+
129
+ Open the editor template:
130
+
131
+ ~~~bash
132
+ editors/YourModelName/editor.tsx
133
+ ~~~
134
+
135
+ Customize the editor interface to suit your document model.
136
+
137
+ ### 6. Testing the Document Editor
138
+
139
+ Run the Connect app to test your document editor:
140
+
141
+ ~~~bash
142
+ npm run connect
143
+ ~~~
144
+
145
+ Verify that the editor functions as expected.
146
+ Perform end-to-end testing to ensure smooth integration between the document model and its editor.
147
+
148
+ ### 7. Adding a Manifest File
149
+
150
+ Create a manifest file to describe your document model and editor. This enables proper integration with the host application.
151
+
152
+ **Example manifest.json:**
153
+
154
+ ~~~json
155
+ {
156
+ "name": "your-model-name",
157
+ "description": "A brief description of your document model.",
158
+ "category": "your-category", // e.g., "Finance", "People Ops", "Legal"
159
+ "publisher": {
160
+ "name": "your-publisher-name",
161
+ "url": "your-publisher-url"
162
+ },
163
+ "documentModels": [
164
+ {
165
+ "id": "your-model-id",
166
+ "name": "your-model-name"
167
+ }
168
+ ],
169
+ "editors": [
170
+ {
171
+ "id": "your-editor-id",
172
+ "name": "your-editor-name",
173
+ "documentTypes": ["your-model-id"]
174
+ }
175
+ ]
176
+ }
177
+ ~~~
178
+
179
+ ### Steps to finalize:
180
+
181
+ Place the manifest file at your project root.
182
+ Update your index.js to export your modules and include the new document model and editor.
183
+
184
+ ### Final Thoughts
185
+
186
+ You've now successfully created a Document Model and its corresponding Editor using the Connect app!
187
+
188
+ Next Steps:
189
+
190
+ - Expand functionality: Add more operations or complex logic to your document model.
191
+ - Improve UX: Enhance the document editor for a smoother user experience.
192
+ - Integrate with other systems: Use APIs or GraphQL to connect your document model with external services.
193
+ `.raw;
194
+ //# sourceMappingURL=README.md.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"README.md.js","sourceRoot":"","sources":["../../../../src/templates/boilerplate/README.md.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,MAAM,CAAC,MAAM,cAAc,GAAG,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+L/B,CAAC,GAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const claudeSettingsLocalTemplate: string;
2
+ //# sourceMappingURL=settings.local.json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.local.json.d.ts","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/claude/settings.local.json.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,2BAA2B,QAenC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { json } from "@tmpl/core";
2
+ export const claudeSettingsLocalTemplate = json `
3
+ {
4
+ "$schema": "https://json.schemastore.org/claude-code-settings.json",
5
+ "permissions": {
6
+ "allow": ["Bash(npm run tsc:*)", "Bash(npm run lint:*)"],
7
+ "deny": [
8
+ "Write(./document-models/*/gen/**)",
9
+ "Write(./.ph/**)",
10
+ "Edit(./document-models/*/gen/**)",
11
+ "Edit(./.ph/**)"
12
+ ]
13
+ },
14
+ "enableAllProjectMcpServers": true,
15
+ "enabledMcpjsonServers": ["reactor-mcp"]
16
+ }
17
+ `.raw;
18
+ //# sourceMappingURL=settings.local.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.local.json.js","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/claude/settings.local.json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAA;;;;;;;;;;;;;;;CAe9C,CAAC,GAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const cursorMcpTemplate: string;
2
+ //# sourceMappingURL=mcp.json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.json.d.ts","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/cursor/mcp.json.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,QASzB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { json } from "@tmpl/core";
2
+ export const cursorMcpTemplate = json `
3
+ {
4
+ "mcpServers": {
5
+ "reactor-mcp": {
6
+ "type": "http",
7
+ "url": "http://localhost:4001/mcp"
8
+ }
9
+ }
10
+ }
11
+ `.raw;
12
+ //# sourceMappingURL=mcp.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.json.js","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/cursor/mcp.json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAA;;;;;;;;;CASpC,CAAC,GAAG,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-models.d.ts","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/document-models/document-models.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,QAI9B,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"document-models.js","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/document-models/document-models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,CAAA;;;;CAIvC,CAAC,GAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const documentModelsIndexTemplate = "";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/document-models/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,2BAA2B,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const documentModelsIndexTemplate = "";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/document-models/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,2BAA2B,GAAG,EAAE,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editors.d.ts","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/editors/editors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,eAAe,QAIvB,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"editors.js","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/editors/editors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAA;;;;CAIhC,CAAC,GAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const editorsIndexTemplate = "";
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/editors/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,KAAK,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const editorsIndexTemplate = "";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/editors/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const eslintConfigTemplate: string;
2
+ //# sourceMappingURL=eslint.config.js.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint.config.js.d.ts","sourceRoot":"","sources":["../../../../src/templates/boilerplate/eslint.config.js.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,oBAAoB,QAyI5B,CAAC"}
@@ -0,0 +1,140 @@
1
+ import { js } from "@tmpl/core";
2
+ export const eslintConfigTemplate = js `
3
+ // @ts-check
4
+ import { default as eslint } from "@eslint/js";
5
+ import eslintPluginPrettierRecommended from "eslint-plugin-prettier/recommended";
6
+ import reactPlugin from "eslint-plugin-react";
7
+ import reactHooksPlugin from "eslint-plugin-react-hooks";
8
+ import { defineConfig, globalIgnores } from "eslint/config";
9
+ import globals from "globals";
10
+ import tseslint from "typescript-eslint";
11
+
12
+ /** These files are typically ignored by eslint by default, so there is no need to investigate why they are ignored. */
13
+ const ignoredFiles = [
14
+ "**/node_modules/",
15
+ "**/dist/",
16
+ "**/.ph/",
17
+ "**/storybook-static/",
18
+ "**/.vite/",
19
+ ];
20
+
21
+ /** Global configs for eslint ignores */
22
+ const ignored = globalIgnores(ignoredFiles);
23
+
24
+ /** Typescript (\`.ts\`) files */
25
+ const typescriptFiles = ["**/*.ts"];
26
+
27
+ /** Typescript React (\`.tsx\`) files */
28
+ const typescriptReactFiles = ["**/*.tsx"];
29
+
30
+ /** Javascript (\`.js\`, \`.cjs\`, \`.mjs\`) files */
31
+ const javascriptFiles = ["**/*.js", "**/*.cjs", "**/*.mjs"];
32
+
33
+ /** Typescript rules that we have chosen to opt out of in general */
34
+ /** @type {import("eslint").Linter.RulesRecord} */
35
+ const typescriptRules = {
36
+ "@typescript-eslint/consistent-type-imports": [
37
+ "error",
38
+ {
39
+ prefer: "type-imports",
40
+ disallowTypeAnnotations: true,
41
+ fixStyle: "separate-type-imports",
42
+ },
43
+ ],
44
+ "@typescript-eslint/no-explicit-any": "off",
45
+ "@typescript-eslint/no-unused-vars": [
46
+ "warn",
47
+ {
48
+ argsIgnorePattern: "^_",
49
+ varsIgnorePattern: "^_",
50
+ caughtErrorsIgnorePattern: "^_",
51
+ },
52
+ ],
53
+ "@typescript-eslint/no-unnecessary-condition": "warn",
54
+ "@typescript-eslint/require-await": "warn",
55
+ "@typescript-eslint/no-misused-promises": "warn",
56
+ "@typescript-eslint/no-floating-promises": "warn",
57
+ "@typescript-eslint/no-empty-object-type": "warn",
58
+ "@typescript-eslint/no-duplicate-type-constituents": "warn",
59
+ "@typescript-eslint/restrict-template-expressions": [
60
+ "warn",
61
+ {
62
+ allowNumber: true,
63
+ },
64
+ ],
65
+ };
66
+
67
+ /** Language options for typescript files
68
+ @type {import("eslint").Linter.LanguageOptions} */
69
+ const typescriptLanguageOptions = {
70
+ sourceType: "module",
71
+ ecmaVersion: "latest",
72
+ globals: {
73
+ ...globals.browser,
74
+ ...globals.node,
75
+ },
76
+ parserOptions: {
77
+ projectService: {
78
+ allowDefaultProject: ["eslint.config.js"],
79
+ },
80
+ tsconfigRootDir: import.meta.dirname,
81
+ ecmaFeatures: {
82
+ jsx: true,
83
+ },
84
+ },
85
+ };
86
+
87
+ /** React plugins */
88
+ const reactPlugins = {
89
+ react: reactPlugin,
90
+ "react-hooks": reactHooksPlugin,
91
+ };
92
+
93
+ /** React settings */
94
+ const reactSettings = {
95
+ react: {
96
+ version: "detect",
97
+ },
98
+ };
99
+
100
+ /** Typescript config for both \`.ts\` and \`.tsx\` files */
101
+ const typescriptConfig = {
102
+ files: [...typescriptFiles, ...typescriptReactFiles],
103
+ languageOptions: typescriptLanguageOptions,
104
+ rules: typescriptRules,
105
+ };
106
+
107
+ /** React config for \`.tsx\` files */
108
+ const reactConfig = {
109
+ files: typescriptReactFiles,
110
+ settings: reactSettings,
111
+ plugins: reactPlugins,
112
+ };
113
+
114
+ /** Config for javascript files */
115
+ const javascriptConfig = {
116
+ // disable type aware linting for js files
117
+ files: javascriptFiles,
118
+ extends: [tseslint.configs.disableTypeChecked],
119
+ };
120
+
121
+ /** Recommended config from eslint */
122
+ const eslintRecommendedConfig = eslint.configs.recommended;
123
+
124
+ /** Recommended config from typescript-eslint */
125
+ const typescriptEsLintRecommendedConfig = [
126
+ ...tseslint.configs.recommendedTypeChecked,
127
+ ];
128
+
129
+ /** Main config */
130
+ export default defineConfig(
131
+ ignored,
132
+ eslintRecommendedConfig,
133
+ typescriptEsLintRecommendedConfig,
134
+ typescriptConfig,
135
+ reactConfig,
136
+ javascriptConfig,
137
+ eslintPluginPrettierRecommended,
138
+ );
139
+ `.raw;
140
+ //# sourceMappingURL=eslint.config.js.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"eslint.config.js.js","sourceRoot":"","sources":["../../../../src/templates/boilerplate/eslint.config.js.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,MAAM,CAAC,MAAM,oBAAoB,GAAG,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAyIrC,CAAC,GAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const geminiSettingsTemplate: string;
2
+ //# sourceMappingURL=settings.json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.json.d.ts","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/gemini/settings.json.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,sBAAsB,QAS9B,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { json } from "@tmpl/core";
2
+ export const geminiSettingsTemplate = json `
3
+ {
4
+ "mcpServers": {
5
+ "reactor-mcp": {
6
+ "type": "http",
7
+ "url": "http://localhost:4001/mcp"
8
+ }
9
+ }
10
+ }
11
+ `.raw;
12
+ //# sourceMappingURL=settings.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.json.js","sourceRoot":"","sources":["../../../../../src/templates/boilerplate/gemini/settings.json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,sBAAsB,GAAG,IAAI,CAAA;;;;;;;;;CASzC,CAAC,GAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const gitIgnoreTemplate = "\ndist\ncoverage\nnode_modules\n.eslintcache\n.env.local\n\n.ph\nprojects-import.js\n";
2
+ //# sourceMappingURL=gitignore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitignore.d.ts","sourceRoot":"","sources":["../../../../src/templates/boilerplate/gitignore.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,0FAS7B,CAAC"}
@@ -0,0 +1,11 @@
1
+ export const gitIgnoreTemplate = `
2
+ dist
3
+ coverage
4
+ node_modules
5
+ .eslintcache
6
+ .env.local
7
+
8
+ .ph
9
+ projects-import.js
10
+ `;
11
+ //# sourceMappingURL=gitignore.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gitignore.js","sourceRoot":"","sources":["../../../../src/templates/boilerplate/gitignore.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;CAShC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const legacyIndexHtmlTemplate: string;
2
+ //# sourceMappingURL=index.html.legacy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.html.legacy.d.ts","sourceRoot":"","sources":["../../../../src/templates/boilerplate/index.html.legacy.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,uBAAuB,QAiC/B,CAAC"}
@@ -0,0 +1,36 @@
1
+ import { html } from "@tmpl/core";
2
+ export const legacyIndexHtmlTemplate = html `
3
+ <!DOCTYPE html>
4
+ <html lang="en">
5
+ <head>
6
+ <meta charset="UTF-8" />
7
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
8
+ <meta
9
+ name="description"
10
+ content="Connect is a hub for your most important documents and processes, translated into software. Easily capture data in a structured way with dedicated business process packages. Collaborate on shared documents with ease while using your preferred storage solution (decentralized, centralized, or local)."
11
+ />
12
+ <title>Powerhouse Connect</title>
13
+ <link rel="icon" href="/icon.ico" />
14
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
15
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
16
+ <link
17
+ href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap"
18
+ rel="stylesheet"
19
+ />
20
+ <style>
21
+ @import "tailwindcss";
22
+ @import "@powerhousedao/design-system/style.css";
23
+ @import "@powerhousedao/document-engineering/style.css";
24
+ @source "./node_modules/@powerhousedao/connect";
25
+ </style>
26
+ </head>
27
+ <body>
28
+ <div id="root"></div>
29
+ <script type="module">
30
+ // initializes Connect on '<div id="root"></div>'
31
+ import "@powerhousedao/connect/main.js";
32
+ </script>
33
+ </body>
34
+ </html>
35
+ `.raw;
36
+ //# sourceMappingURL=index.html.legacy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.html.legacy.js","sourceRoot":"","sources":["../../../../src/templates/boilerplate/index.html.legacy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC1C,CAAC,GAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const mcpTemplate: string;
2
+ //# sourceMappingURL=mcp.json.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.json.d.ts","sourceRoot":"","sources":["../../../../src/templates/boilerplate/mcp.json.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,WAAW,QASnB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { json } from "@tmpl/core";
2
+ export const mcpTemplate = json `
3
+ {
4
+ "mcpServers": {
5
+ "reactor-mcp": {
6
+ "type": "http",
7
+ "url": "http://localhost:4001/mcp"
8
+ }
9
+ }
10
+ }
11
+ `.raw;
12
+ //# sourceMappingURL=mcp.json.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mcp.json.js","sourceRoot":"","sources":["../../../../src/templates/boilerplate/mcp.json.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAElC,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,CAAA;;;;;;;;;CAS9B,CAAC,GAAG,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const npmrcTemplate = "@jsr:registry=https://npm.jsr.io";
2
+ //# sourceMappingURL=npmrc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npmrc.d.ts","sourceRoot":"","sources":["../../../../src/templates/boilerplate/npmrc.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,aAAa,qCAAqC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const npmrcTemplate = `@jsr:registry=https://npm.jsr.io`;
2
+ //# sourceMappingURL=npmrc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"npmrc.js","sourceRoot":"","sources":["../../../../src/templates/boilerplate/npmrc.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,aAAa,GAAG,kCAAkC,CAAC"}
@@ -1,55 +1,2 @@
1
- export declare const packageJsonScriptsTemplate: {
2
- build: string;
3
- test: string;
4
- "test:watch": string;
5
- lint: string;
6
- "lint:fix": string;
7
- tsc: string;
8
- "tsc:watch": string;
9
- tailwind: string;
10
- prepublishOnly: string;
11
- "check-circular-imports": string;
12
- generate: string;
13
- connect: string;
14
- reactor: string;
15
- service: string;
16
- vetra: string;
17
- migrate: string;
18
- "service-startup": string;
19
- "service-unstartup": string;
20
- };
21
- export declare const packageJsonExportsTemplate: {
22
- ".": {
23
- types: string;
24
- default: string;
25
- };
26
- "./document-models": {
27
- types: string;
28
- default: string;
29
- };
30
- "./editors": {
31
- types: string;
32
- default: string;
33
- };
34
- "./document-models/*": {
35
- types: string;
36
- default: string;
37
- };
38
- "./editors/*": {
39
- types: string;
40
- default: string;
41
- };
42
- "./subgraphs": {
43
- types: string;
44
- default: string;
45
- };
46
- "./processors": {
47
- types: string;
48
- default: string;
49
- };
50
- "./manifest": {
51
- default: string;
52
- };
53
- "./style.css": string;
54
- };
1
+ export declare const packageJsonTemplate: (projectName: string, versionedDependencies: string[], versionedDevDependencies: string[]) => string;
55
2
  //# sourceMappingURL=package.json.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"package.json.d.ts","sourceRoot":"","sources":["../../../../src/templates/boilerplate/package.json.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;CAqBtC,CAAC;AAEF,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiCtC,CAAC"}
1
+ {"version":3,"file":"package.json.d.ts","sourceRoot":"","sources":["../../../../src/templates/boilerplate/package.json.ts"],"names":[],"mappings":"AA4FA,eAAO,MAAM,mBAAmB,GAC9B,aAAa,MAAM,EACnB,uBAAuB,MAAM,EAAE,EAC/B,0BAA0B,MAAM,EAAE,WA6B/B,CAAC"}