@powerhousedao/codegen 5.0.3 → 5.0.4

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 (180) hide show
  1. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/actions.esm.t +3 -3
  2. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/creators.esm.t +3 -2
  3. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/customUtils.esm.t +1 -1
  4. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/document-models.esm.t +14 -0
  5. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/document-schema.esm.t +56 -0
  6. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/document-type.esm.t +6 -0
  7. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/documentModel.esm.t +1 -1
  8. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/documentModelTest.esm.t +110 -15
  9. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/hooks.esm.t +49 -0
  10. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/index.esm.t +12 -4
  11. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/index.js +66 -7
  12. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/lib.esm.t +4 -2
  13. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/module.esm.t +22 -0
  14. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/ph-factories.esm.t +23 -23
  15. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/reducer.esm.t +16 -9
  16. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/root-utils.esm.t +11 -0
  17. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/rootActions.esm.t +13 -0
  18. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/rootIndex.esm.t +6 -26
  19. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/schema.esm.t +2 -2
  20. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/src-index.esm.t +5 -0
  21. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/types.esm.t +16 -16
  22. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/utils.esm.t +31 -10
  23. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/creators.esm.t +10 -5
  24. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/customTest.esm.t +13 -18
  25. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-module/index.js +15 -0
  26. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-subgraph/index.js +99 -4
  27. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-subgraph/resolvers.esm.t +21 -10
  28. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model-subgraph/schema.esm.t +4 -3
  29. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/components/CreateDocument.esm.t +26 -29
  30. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/components/DriveContents.esm.t +23 -0
  31. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/components/DriveExplorer.esm.t +5 -126
  32. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/components/EmptyState.esm.t +19 -0
  33. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/components/Files.esm.t +29 -0
  34. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/components/FolderTree.esm.t +1 -1
  35. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/components/Folders.esm.t +28 -0
  36. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/components/NavigationBreadcrumbs.esm.t +14 -0
  37. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/config.esm.t +2 -1
  38. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/editor.esm.t +5 -2
  39. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/editors.esm.t +14 -0
  40. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/index.js +26 -3
  41. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/lib.esm.t +4 -2
  42. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/module.esm.t +15 -0
  43. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/edit-name.esm.t +78 -0
  44. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/editor.esm.t +7 -104
  45. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/editors.esm.t +14 -0
  46. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/index.js +74 -1
  47. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/lib.esm.t +4 -2
  48. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/module.esm.t +16 -0
  49. package/dist/src/codegen/.hygen/templates/powerhouse/utils.js +46 -0
  50. package/dist/src/codegen/__tests__/config.d.ts +2 -0
  51. package/dist/src/codegen/__tests__/config.d.ts.map +1 -0
  52. package/dist/src/codegen/__tests__/config.js +2 -0
  53. package/dist/src/codegen/__tests__/config.js.map +1 -0
  54. package/dist/src/codegen/__tests__/constants.d.ts +16 -0
  55. package/dist/src/codegen/__tests__/constants.d.ts.map +1 -0
  56. package/dist/src/codegen/__tests__/constants.js +16 -0
  57. package/dist/src/codegen/__tests__/constants.js.map +1 -0
  58. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content-v3.d.ts +2 -0
  59. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content-v3.d.ts.map +1 -0
  60. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content-v3.js +9 -0
  61. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content-v3.js.map +1 -0
  62. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content.d.ts +3 -0
  63. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content.d.ts.map +1 -0
  64. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content.js +33 -0
  65. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content.js.map +1 -0
  66. package/dist/src/codegen/__tests__/fixtures/run-generated-tests.d.ts +2 -0
  67. package/dist/src/codegen/__tests__/fixtures/run-generated-tests.d.ts.map +1 -0
  68. package/dist/src/codegen/__tests__/fixtures/run-generated-tests.js +23 -0
  69. package/dist/src/codegen/__tests__/fixtures/run-generated-tests.js.map +1 -0
  70. package/dist/src/codegen/__tests__/fixtures/typecheck.d.ts +2 -0
  71. package/dist/src/codegen/__tests__/fixtures/typecheck.d.ts.map +1 -0
  72. package/dist/src/codegen/__tests__/fixtures/typecheck.js +23 -0
  73. package/dist/src/codegen/__tests__/fixtures/typecheck.js.map +1 -0
  74. package/dist/src/codegen/__tests__/generate-doc-model.test.d.ts +2 -0
  75. package/dist/src/codegen/__tests__/generate-doc-model.test.d.ts.map +1 -0
  76. package/dist/src/codegen/__tests__/generate-doc-model.test.js +206 -0
  77. package/dist/src/codegen/__tests__/generate-doc-model.test.js.map +1 -0
  78. package/dist/src/codegen/__tests__/generate-drive-editor.test.d.ts +2 -0
  79. package/dist/src/codegen/__tests__/generate-drive-editor.test.d.ts.map +1 -0
  80. package/dist/src/codegen/__tests__/generate-drive-editor.test.js +153 -0
  81. package/dist/src/codegen/__tests__/generate-drive-editor.test.js.map +1 -0
  82. package/dist/src/codegen/__tests__/generate-editor.test.d.ts +2 -0
  83. package/dist/src/codegen/__tests__/generate-editor.test.d.ts.map +1 -0
  84. package/dist/src/codegen/__tests__/generate-editor.test.js +112 -0
  85. package/dist/src/codegen/__tests__/generate-editor.test.js.map +1 -0
  86. package/dist/src/codegen/__tests__/generate-manifest.test.d.ts +2 -0
  87. package/dist/src/codegen/__tests__/generate-manifest.test.d.ts.map +1 -0
  88. package/dist/src/codegen/__tests__/generate-manifest.test.js +192 -0
  89. package/dist/src/codegen/__tests__/generate-manifest.test.js.map +1 -0
  90. package/dist/src/codegen/__tests__/generate-schemas.test.d.ts +2 -0
  91. package/dist/src/codegen/__tests__/generate-schemas.test.d.ts.map +1 -0
  92. package/dist/src/codegen/__tests__/generate-schemas.test.js +143 -0
  93. package/dist/src/codegen/__tests__/generate-schemas.test.js.map +1 -0
  94. package/dist/src/codegen/__tests__/global-setup.d.ts +2 -0
  95. package/dist/src/codegen/__tests__/global-setup.d.ts.map +1 -0
  96. package/dist/src/codegen/__tests__/global-setup.js +21 -0
  97. package/dist/src/codegen/__tests__/global-setup.js.map +1 -0
  98. package/dist/src/codegen/__tests__/ts-morph-generator.test.d.ts +2 -0
  99. package/dist/src/codegen/__tests__/ts-morph-generator.test.d.ts.map +1 -0
  100. package/dist/src/codegen/__tests__/ts-morph-generator.test.js +72 -0
  101. package/dist/src/codegen/__tests__/ts-morph-generator.test.js.map +1 -0
  102. package/dist/src/codegen/__tests__/utils.d.ts +7 -0
  103. package/dist/src/codegen/__tests__/utils.d.ts.map +1 -0
  104. package/dist/src/codegen/__tests__/utils.js +52 -0
  105. package/dist/src/codegen/__tests__/utils.js.map +1 -0
  106. package/dist/src/codegen/generate.d.ts +12 -2
  107. package/dist/src/codegen/generate.d.ts.map +1 -1
  108. package/dist/src/codegen/generate.js +26 -11
  109. package/dist/src/codegen/generate.js.map +1 -1
  110. package/dist/src/codegen/graphql.js +1 -1
  111. package/dist/src/codegen/graphql.js.map +1 -1
  112. package/dist/src/codegen/hygen.d.ts +19 -10
  113. package/dist/src/codegen/hygen.d.ts.map +1 -1
  114. package/dist/src/codegen/hygen.js +62 -16
  115. package/dist/src/codegen/hygen.js.map +1 -1
  116. package/dist/src/create-lib/checkout-project.d.ts +13 -0
  117. package/dist/src/create-lib/checkout-project.d.ts.map +1 -0
  118. package/dist/src/create-lib/checkout-project.js +47 -0
  119. package/dist/src/create-lib/checkout-project.js.map +1 -0
  120. package/dist/src/create-lib/create-project.d.ts +9 -5
  121. package/dist/src/create-lib/create-project.d.ts.map +1 -1
  122. package/dist/src/create-lib/create-project.js +37 -45
  123. package/dist/src/create-lib/create-project.js.map +1 -1
  124. package/dist/src/create-lib/feature-flags.d.ts +4 -0
  125. package/dist/src/create-lib/feature-flags.d.ts.map +1 -0
  126. package/dist/src/create-lib/feature-flags.js +4 -0
  127. package/dist/src/create-lib/feature-flags.js.map +1 -0
  128. package/dist/src/create-lib/index.d.ts +1 -0
  129. package/dist/src/create-lib/index.d.ts.map +1 -1
  130. package/dist/src/create-lib/index.js +1 -0
  131. package/dist/src/create-lib/index.js.map +1 -1
  132. package/dist/src/create-lib/utils.d.ts +7 -0
  133. package/dist/src/create-lib/utils.d.ts.map +1 -0
  134. package/dist/src/create-lib/utils.js +28 -0
  135. package/dist/src/create-lib/utils.js.map +1 -0
  136. package/dist/src/ts-morph-generator/__tests__/ReducerGenerator.test.d.ts +2 -0
  137. package/dist/src/ts-morph-generator/__tests__/ReducerGenerator.test.d.ts.map +1 -0
  138. package/dist/src/ts-morph-generator/__tests__/ReducerGenerator.test.js +491 -0
  139. package/dist/src/ts-morph-generator/__tests__/ReducerGenerator.test.js.map +1 -0
  140. package/dist/src/ts-morph-generator/core/FileGenerator.d.ts +3 -1
  141. package/dist/src/ts-morph-generator/core/FileGenerator.d.ts.map +1 -1
  142. package/dist/src/ts-morph-generator/core/FileGenerator.js +3 -1
  143. package/dist/src/ts-morph-generator/core/FileGenerator.js.map +1 -1
  144. package/dist/src/ts-morph-generator/core/GenerationContext.d.ts +1 -0
  145. package/dist/src/ts-morph-generator/core/GenerationContext.d.ts.map +1 -1
  146. package/dist/src/ts-morph-generator/core/ReducerGenerator.d.ts.map +1 -1
  147. package/dist/src/ts-morph-generator/core/ReducerGenerator.js +14 -7
  148. package/dist/src/ts-morph-generator/core/ReducerGenerator.js.map +1 -1
  149. package/dist/src/ts-morph-generator/core/TSMorphCodeGenerator.d.ts +2 -1
  150. package/dist/src/ts-morph-generator/core/TSMorphCodeGenerator.d.ts.map +1 -1
  151. package/dist/src/ts-morph-generator/core/TSMorphCodeGenerator.js +10 -3
  152. package/dist/src/ts-morph-generator/core/TSMorphCodeGenerator.js.map +1 -1
  153. package/dist/src/ts-morph-generator/utilities/DeclarationManager.d.ts +5 -0
  154. package/dist/src/ts-morph-generator/utilities/DeclarationManager.d.ts.map +1 -0
  155. package/dist/src/ts-morph-generator/utilities/DeclarationManager.js +10 -0
  156. package/dist/src/ts-morph-generator/utilities/DeclarationManager.js.map +1 -0
  157. package/dist/src/ts-morph-generator/utilities/ImportManager.d.ts +1 -0
  158. package/dist/src/ts-morph-generator/utilities/ImportManager.d.ts.map +1 -1
  159. package/dist/src/ts-morph-generator/utilities/ImportManager.js +13 -3
  160. package/dist/src/ts-morph-generator/utilities/ImportManager.js.map +1 -1
  161. package/dist/src/ts-morph-generator/utilities/index.d.ts +1 -0
  162. package/dist/src/ts-morph-generator/utilities/index.d.ts.map +1 -1
  163. package/dist/src/ts-morph-generator/utilities/index.js +1 -0
  164. package/dist/src/ts-morph-generator/utilities/index.js.map +1 -1
  165. package/dist/src/utils/validation.d.ts.map +1 -1
  166. package/dist/src/utils/validation.js +3 -4
  167. package/dist/src/utils/validation.js.map +1 -1
  168. package/dist/tsconfig.tsbuildinfo +1 -0
  169. package/dist/vitest.config.d.ts +3 -0
  170. package/dist/vitest.config.d.ts.map +1 -0
  171. package/dist/vitest.config.js +16 -0
  172. package/dist/vitest.config.js.map +1 -0
  173. package/package.json +13 -12
  174. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/lib.inject_export.esm.t +0 -7
  175. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/index.esm.t +0 -15
  176. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/lib.inject_export.esm.t +0 -7
  177. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/hooks.esm.t +0 -16
  178. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/index.esm.t +0 -15
  179. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/lib.inject_export.esm.t +0 -7
  180. package/dist/tsconfig.lib.tsbuildinfo +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-drive-editor.test.d.ts","sourceRoot":"","sources":["../../../../src/codegen/__tests__/generate-drive-editor.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,153 @@
1
+ import { generateDriveEditor } from "@powerhousedao/codegen";
2
+ import fs, { existsSync, rmSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { afterAll, beforeAll, describe, expect, it, } from "vitest";
5
+ import { EDITORS_TEST_PROJECT, EDITORS_TEST_PROJECT_WITH_EXISTING_EDITOR, GENERATE_DRIVE_EDITOR_TEST_OUTPUT_DIR, } from "./constants.js";
6
+ import { compile } from "./fixtures/typecheck.js";
7
+ import { copyAllFiles, getTestDataDir, getTestOutDirPath, getTestOutputDir, purgeDirAfterTest, resetDirForTest, } from "./utils.js";
8
+ describe("generateDriveEditor", () => {
9
+ const testDir = import.meta.dirname;
10
+ const outDirName = getTestOutputDir(testDir, GENERATE_DRIVE_EDITOR_TEST_OUTPUT_DIR);
11
+ const testDataDir = getTestDataDir(testDir, EDITORS_TEST_PROJECT);
12
+ let testOutDirPath = getTestOutDirPath("initial", outDirName);
13
+ const config = {
14
+ editorsDir: "",
15
+ documentModelsDir: "",
16
+ processorsDir: "",
17
+ subgraphsDir: "",
18
+ importScriptsDir: "",
19
+ skipFormat: true,
20
+ logLevel: "info",
21
+ };
22
+ async function setupTest(context, testDataDirOverride = testDataDir) {
23
+ testOutDirPath = getTestOutDirPath(context.task.name, outDirName);
24
+ await copyAllFiles(testDataDirOverride, testOutDirPath);
25
+ config.editorsDir = path.join(testOutDirPath, "editors");
26
+ config.documentModelsDir = path.join(testOutDirPath, "document-models");
27
+ }
28
+ beforeAll(() => {
29
+ resetDirForTest(outDirName);
30
+ });
31
+ afterAll(() => {
32
+ purgeDirAfterTest(outDirName);
33
+ });
34
+ it("should generate a drive editor with the correct files and content", {
35
+ timeout: 15000,
36
+ }, async (context) => {
37
+ await setupTest(context);
38
+ const name = "Atlas Drive Explorer";
39
+ await generateDriveEditor({
40
+ name,
41
+ config,
42
+ appId: "AtlasDriveExplorer",
43
+ allowedDocumentTypes: "powerhouse/test-doc",
44
+ });
45
+ const editorsDir = path.join(testOutDirPath, "editors");
46
+ expect(existsSync(editorsDir)).toBe(true);
47
+ const editorsFilePath = path.join(editorsDir, "editors.ts");
48
+ expect(existsSync(editorsFilePath)).toBe(true);
49
+ const editorsContent = fs.readFileSync(editorsFilePath, "utf-8");
50
+ expect(editorsContent).toContain(`export const editors: EditorModule[]`);
51
+ expect(editorsContent).toContain(`AtlasDriveExplorer`);
52
+ const editorDir = path.join(editorsDir, "atlas-drive-explorer");
53
+ expect(existsSync(editorDir)).toBe(true);
54
+ const moduleFilePath = path.join(editorDir, "module.ts");
55
+ expect(existsSync(moduleFilePath)).toBe(true);
56
+ const moduleContent = fs.readFileSync(moduleFilePath, "utf-8");
57
+ expect(moduleContent).toContain(`export const AtlasDriveExplorer: EditorModule`);
58
+ expect(moduleContent).toContain(`documentTypes: ["powerhouse/document-drive"]`);
59
+ expect(moduleContent).toContain(`id: "AtlasDriveExplorer"`);
60
+ expect(moduleContent).toContain(`name: "Atlas Drive Explorer"`);
61
+ const configFilePath = path.join(editorDir, "config.ts");
62
+ expect(existsSync(configFilePath)).toBe(true);
63
+ const configContent = fs.readFileSync(configFilePath, "utf-8");
64
+ expect(configContent).toContain(`export const editorConfig: PHDriveEditorConfig`);
65
+ expect(configContent).toContain(`allowedDocumentTypes: ["powerhouse/test-doc"]`);
66
+ const editorFilePath = path.join(editorDir, "editor.tsx");
67
+ expect(existsSync(editorFilePath)).toBe(true);
68
+ const editorContent = fs.readFileSync(editorFilePath, "utf-8");
69
+ expect(editorContent).toContain(`export default function Editor(props: EditorProps)`);
70
+ expect(editorContent).toContain(`<DriveExplorer {...props} />`);
71
+ expect(editorContent).toContain(`useSetPHDriveEditorConfig(editorConfig)`);
72
+ const componentsDir = path.join(editorDir, "components");
73
+ expect(existsSync(componentsDir)).toBe(true);
74
+ const driveExplorerPath = path.join(componentsDir, "DriveExplorer.tsx");
75
+ expect(existsSync(driveExplorerPath)).toBe(true);
76
+ const driveExplorerContent = fs.readFileSync(driveExplorerPath, "utf-8");
77
+ expect(driveExplorerContent).toContain(`export function DriveExplorer({ children }: EditorProps)`);
78
+ const createDocumentPath = path.join(componentsDir, "CreateDocument.tsx");
79
+ expect(existsSync(createDocumentPath)).toBe(true);
80
+ const createDocumentContent = fs.readFileSync(createDocumentPath, "utf-8");
81
+ expect(createDocumentContent).toContain(`export function CreateDocument()`);
82
+ const folderTreePath = path.join(componentsDir, "FolderTree.tsx");
83
+ expect(existsSync(folderTreePath)).toBe(true);
84
+ const folderTreeContent = fs.readFileSync(folderTreePath, "utf-8");
85
+ expect(folderTreeContent).toContain(`export function FolderTree()`);
86
+ const driveContentsPath = path.join(componentsDir, "DriveContents.tsx");
87
+ expect(existsSync(driveContentsPath)).toBe(true);
88
+ const driveContentsContent = fs.readFileSync(driveContentsPath, "utf-8");
89
+ expect(driveContentsContent).toContain(`export function DriveContents()`);
90
+ const filesPath = path.join(componentsDir, "Files.tsx");
91
+ expect(existsSync(filesPath)).toBe(true);
92
+ const filesContent = fs.readFileSync(filesPath, "utf-8");
93
+ expect(filesContent).toContain(`export function Files()`);
94
+ const foldersPath = path.join(componentsDir, "Folders.tsx");
95
+ expect(existsSync(foldersPath)).toBe(true);
96
+ const foldersContent = fs.readFileSync(foldersPath, "utf-8");
97
+ expect(foldersContent).toContain(`export function Folders()`);
98
+ const emptyStatePath = path.join(componentsDir, "EmptyState.tsx");
99
+ expect(existsSync(emptyStatePath)).toBe(true);
100
+ const emptyStateContent = fs.readFileSync(emptyStatePath, "utf-8");
101
+ expect(emptyStateContent).toContain(`export function EmptyState()`);
102
+ const navigationBreadcrumbsPath = path.join(componentsDir, "NavigationBreadcrumbs.tsx");
103
+ expect(existsSync(navigationBreadcrumbsPath)).toBe(true);
104
+ const navigationBreadcrumbsContent = fs.readFileSync(navigationBreadcrumbsPath, "utf-8");
105
+ expect(navigationBreadcrumbsContent).toContain(`export function NavigationBreadcrumbs()`);
106
+ });
107
+ it("should generate a drive editor with default id when no appId is provided", {
108
+ timeout: 15000,
109
+ }, async (context) => {
110
+ await setupTest(context, getTestDataDir(testDir, EDITORS_TEST_PROJECT_WITH_EXISTING_EDITOR));
111
+ const name = "TestApp";
112
+ await generateDriveEditor({ name, config }); // No appId provided
113
+ const editorsDir = path.join(testOutDirPath, "editors");
114
+ const editorDir = path.join(editorsDir, "test-app");
115
+ const moduleFilePath = path.join(editorDir, "module.ts");
116
+ const moduleContent = fs.readFileSync(moduleFilePath, "utf-8");
117
+ expect(moduleContent).toContain(`id: "test-app"`);
118
+ await compile(testOutDirPath);
119
+ });
120
+ it("should append new exports to existing editors.ts file", {
121
+ timeout: 15000,
122
+ }, async (context) => {
123
+ await setupTest(context, getTestDataDir(testDir, EDITORS_TEST_PROJECT_WITH_EXISTING_EDITOR));
124
+ const name = "Atlas Drive Explorer";
125
+ await generateDriveEditor({
126
+ name,
127
+ config,
128
+ appId: "AtlasDriveExplorer",
129
+ allowedDocumentTypes: "powerhouse/test-doc",
130
+ });
131
+ const editorsDir = path.join(testOutDirPath, "editors");
132
+ const editorsFilePath = path.join(editorsDir, "editors.ts");
133
+ const editorsContent = fs.readFileSync(editorsFilePath, "utf-8");
134
+ expect(editorsContent).toContain(`export const editors: EditorModule[]`);
135
+ expect(editorsContent).toContain(`AtlasDriveExplorer`);
136
+ expect(editorsContent).toContain(`TestDocEditor`);
137
+ });
138
+ it("should create the editors.ts file if it does not exist", {
139
+ timeout: 15000,
140
+ }, async (context) => {
141
+ await setupTest(context);
142
+ const name = "Atlas Drive Explorer";
143
+ const editorsDir = path.join(testOutDirPath, "editors");
144
+ const editorsFilePath = path.join(editorsDir, "editors.ts");
145
+ rmSync(editorsFilePath, { force: true });
146
+ await generateDriveEditor({ name, config });
147
+ await compile(testOutDirPath);
148
+ const editorsContent = fs.readFileSync(editorsFilePath, "utf-8");
149
+ expect(editorsContent).toContain(`export const editors: EditorModule[]`);
150
+ expect(editorsContent).toContain(`AtlasDriveExplorer`);
151
+ });
152
+ });
153
+ //# sourceMappingURL=generate-drive-editor.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-drive-editor.test.js","sourceRoot":"","sources":["../../../../src/codegen/__tests__/generate-drive-editor.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAE7D,OAAO,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,EAAE,GAEH,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,oBAAoB,EACpB,yCAAyC,EACzC,qCAAqC,GACtC,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,QAAQ,CAAC,qBAAqB,EAAE,GAAG,EAAE;IACnC,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;IACpC,MAAM,UAAU,GAAG,gBAAgB,CACjC,OAAO,EACP,qCAAqC,CACtC,CAAC;IACF,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,EAAE,oBAAoB,CAAC,CAAC;IAClE,IAAI,cAAc,GAAG,iBAAiB,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAqB;QAC/B,UAAU,EAAE,EAAE;QACd,iBAAiB,EAAE,EAAE;QACrB,aAAa,EAAE,EAAE;QACjB,YAAY,EAAE,EAAE;QAChB,gBAAgB,EAAE,EAAE;QACpB,UAAU,EAAE,IAAI;QAChB,QAAQ,EAA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QACzB,MAAM,IAAI,GAAG,sBAAsB,CAAC;QACpC,MAAM,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,SAAS,CAAC,CAAC;QACxD,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;QAC5D,MAAM,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QACzC,MAAM,mBAAmB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAC5C,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;QAC9B,MAAM,cAAc,GAAG,EAAE,CAAC,YAAY,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC;QACjE,MAAM,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,sCAAsC,CAAC,CAAC;QACzE,MAAM,CAAC,cAAc,CAAC,CAAC,SAAS,CAAC,oBAAoB,CAAC,CAAC;IACzD,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-editor.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-editor.test.d.ts","sourceRoot":"","sources":["../../../../src/codegen/__tests__/generate-editor.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,112 @@
1
+ import {} from "@powerhousedao/config";
2
+ import fs, { rmSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { afterAll, beforeAll, describe, expect, it, } from "vitest";
5
+ import { generateEditor } from "../index.js";
6
+ import { EDITORS_TEST_PROJECT, EDITORS_TEST_PROJECT_WITH_EXISTING_EDITOR, GENERATE_EDITOR_TEST_OUTPUT_DIR, TEST_PACKAGE_NAME, } from "./constants.js";
7
+ import { compile } from "./fixtures/typecheck.js";
8
+ import { copyAllFiles, getTestDataDir, getTestOutDirPath, getTestOutputDir, purgeDirAfterTest, resetDirForTest, } from "./utils.js";
9
+ describe("generateEditor", () => {
10
+ const testDir = import.meta.dirname;
11
+ const outDirName = getTestOutputDir(testDir, GENERATE_EDITOR_TEST_OUTPUT_DIR);
12
+ const testDataDir = getTestDataDir(testDir, EDITORS_TEST_PROJECT);
13
+ let testOutDirPath = getTestOutDirPath("initial", outDirName);
14
+ const config = {
15
+ editorsDir: "",
16
+ documentModelsDir: "",
17
+ processorsDir: "",
18
+ subgraphsDir: "",
19
+ importScriptsDir: "",
20
+ skipFormat: true,
21
+ logLevel: "info",
22
+ };
23
+ async function setupTest(context, testDataDirOverride = testDataDir) {
24
+ testOutDirPath = getTestOutDirPath(context.task.name, outDirName);
25
+ await copyAllFiles(testDataDirOverride, testOutDirPath);
26
+ config.editorsDir = path.join(testOutDirPath, "editors");
27
+ config.documentModelsDir = path.join(testOutDirPath, "document-models");
28
+ }
29
+ beforeAll(() => {
30
+ resetDirForTest(outDirName);
31
+ });
32
+ afterAll(() => {
33
+ purgeDirAfterTest(outDirName);
34
+ });
35
+ it("should generate a Document Model editor", {
36
+ timeout: 15000,
37
+ }, async (context) => {
38
+ await setupTest(context);
39
+ const name = "TestDocEditor";
40
+ await generateEditor({
41
+ name: name,
42
+ documentTypes: ["powerhouse/test-doc"],
43
+ config: config,
44
+ editorId: "test-document-model-editor",
45
+ specifiedPackageName: TEST_PACKAGE_NAME,
46
+ });
47
+ const editorsDir = path.join(testOutDirPath, "editors");
48
+ const editorsFilePath = path.join(editorsDir, "editors.ts");
49
+ expect(fs.existsSync(editorsFilePath)).toBe(true);
50
+ const editorsContent = fs.readFileSync(editorsFilePath, "utf-8");
51
+ expect(editorsContent).toContain(`import { TestDocEditor } from "./test-doc-editor/module.js";`);
52
+ expect(editorsContent).toContain(`export const editors: EditorModule[]`);
53
+ expect(editorsContent).toContain(`TestDocEditor`);
54
+ const editorDir = path.join(editorsDir, "test-doc-editor");
55
+ expect(fs.existsSync(editorDir)).toBe(true);
56
+ const editorPath = path.join(editorDir, "editor.tsx");
57
+ expect(fs.existsSync(editorPath)).toBe(true);
58
+ const editorContent = fs.readFileSync(editorPath, "utf-8");
59
+ expect(editorContent).toContain(`import { EditTestDocName } from "./components/EditName.js";`);
60
+ expect(editorContent).toContain(`export default function Editor()`);
61
+ expect(editorContent).toContain(`<EditTestDocName />`);
62
+ const modulePath = path.join(editorDir, "module.ts");
63
+ expect(fs.existsSync(modulePath)).toBe(true);
64
+ const moduleContent = fs.readFileSync(modulePath, "utf-8");
65
+ expect(moduleContent).toContain(`export const TestDocEditor: EditorModule`);
66
+ expect(moduleContent).toContain(`documentTypes: ["powerhouse/test-doc`);
67
+ expect(moduleContent).toContain(`id: "test-document-model-editor"`);
68
+ expect(moduleContent).toContain(`name: "TestDocEditor"`);
69
+ const componentsDir = path.join(editorDir, "components");
70
+ const editNamePath = path.join(componentsDir, "EditName.tsx");
71
+ expect(fs.existsSync(editNamePath)).toBe(true);
72
+ await compile(testOutDirPath);
73
+ });
74
+ it("should append new exports to existing editors.ts file", {
75
+ timeout: 15000,
76
+ }, async (context) => {
77
+ await setupTest(context, getTestDataDir(testDir, EDITORS_TEST_PROJECT_WITH_EXISTING_EDITOR));
78
+ const name = "TestDocEditorTwo";
79
+ await generateEditor({
80
+ name: name,
81
+ documentTypes: ["powerhouse/test-doc"],
82
+ config: config,
83
+ editorId: "test-document-model-editor-two",
84
+ specifiedPackageName: TEST_PACKAGE_NAME,
85
+ });
86
+ const editorsDir = path.join(testOutDirPath, "editors");
87
+ const editorsFilePath = path.join(editorsDir, "editors.ts");
88
+ const editorsContent = fs.readFileSync(editorsFilePath, "utf-8");
89
+ expect(editorsContent).toContain(`export const editors: EditorModule[]`);
90
+ expect(editorsContent).toContain(`TestDocEditorTwo`);
91
+ expect(editorsContent).toContain(`TestDocEditor`);
92
+ });
93
+ it("should create the editors.ts file if it doesn't exist", {
94
+ timeout: 15000,
95
+ }, async (context) => {
96
+ await setupTest(context, getTestDataDir(testDir, EDITORS_TEST_PROJECT_WITH_EXISTING_EDITOR));
97
+ const editorsFilePath = path.join(testOutDirPath, "editors", "editors.ts");
98
+ rmSync(editorsFilePath, { force: true });
99
+ await generateEditor({
100
+ name: "TestDocEditor",
101
+ documentTypes: ["powerhouse/test-doc"],
102
+ config: config,
103
+ editorId: "test-document-model-editor",
104
+ specifiedPackageName: TEST_PACKAGE_NAME,
105
+ });
106
+ await compile(testOutDirPath);
107
+ const editorsContent = fs.readFileSync(editorsFilePath, "utf-8");
108
+ expect(editorsContent).toContain(`export const editors: EditorModule[]`);
109
+ expect(editorsContent).toContain(`TestDocEditor`);
110
+ });
111
+ });
112
+ //# sourceMappingURL=generate-editor.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-editor.test.js","sourceRoot":"","sources":["../../../../src/codegen/__tests__/generate-editor.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,EAAE,GAEH,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EACL,oBAAoB,EACpB,yCAAyC,EACzC,+BAA+B,EAC/B,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAClD,OAAO,EACL,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC;IACpC,MAAM,UAAU,GAAG,gBAAgB,CAAC,OAAO,EAAE,+BAA+B,CAAC,CAAC;IAC9E,MAAM,WAAW,GAAG,cAAc,CAAC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,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-manifest.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-manifest.test.d.ts","sourceRoot":"","sources":["../../../../src/codegen/__tests__/generate-manifest.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,192 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { afterAll, beforeAll, describe, expect, it, } from "vitest";
4
+ import { generateManifest } from "../generate.js";
5
+ import { GENERATE_MANIFEST_TEST_OUTPUT_DIR, MANIFEST_TEST_PROJECT, MANIFEST_TEST_PROJECT_WITH_EXISTING_MANIFEST, } from "./constants.js";
6
+ import { copyAllFiles, getTestDataDir, getTestOutDirPath, getTestOutputDir, purgeDirAfterTest, resetDirForTest, } from "./utils.js";
7
+ describe("generateManifest", () => {
8
+ const testDir = import.meta.dirname;
9
+ const outDirName = getTestOutputDir(testDir, GENERATE_MANIFEST_TEST_OUTPUT_DIR);
10
+ let testOutDirPath = getTestOutDirPath("initial", outDirName);
11
+ async function setupTest(context, testDataDir) {
12
+ testOutDirPath = getTestOutDirPath(context.task.name, outDirName);
13
+ await copyAllFiles(testDataDir, testOutDirPath);
14
+ }
15
+ beforeAll(() => {
16
+ resetDirForTest(outDirName);
17
+ });
18
+ afterAll(() => {
19
+ purgeDirAfterTest(outDirName);
20
+ });
21
+ it("should generate a new manifest from scratch with partial data", async (context) => {
22
+ await setupTest(context, getTestDataDir(testDir, MANIFEST_TEST_PROJECT));
23
+ const manifestData = {
24
+ name: "@test/package",
25
+ description: "Test package description",
26
+ };
27
+ const manifestPath = generateManifest(manifestData, testOutDirPath);
28
+ expect(fs.existsSync(manifestPath)).toBe(true);
29
+ expect(manifestPath).toBe(path.join(testOutDirPath, "powerhouse.manifest.json"));
30
+ const content = fs.readFileSync(manifestPath, "utf-8");
31
+ const manifest = JSON.parse(content);
32
+ expect(manifest.name).toBe("@test/package");
33
+ expect(manifest.description).toBe("Test package description");
34
+ expect(manifest.category).toBe("");
35
+ expect(manifest.publisher).toEqual({ name: "", url: "" });
36
+ expect(manifest.documentModels).toEqual([]);
37
+ expect(manifest.editors).toEqual([]);
38
+ expect(manifest.apps).toEqual([]);
39
+ expect(manifest.subgraphs).toEqual([]);
40
+ expect(manifest.importScripts).toEqual([]);
41
+ });
42
+ it("should update existing manifest preserving all existing fields", async (context) => {
43
+ await setupTest(context, getTestDataDir(testDir, MANIFEST_TEST_PROJECT_WITH_EXISTING_MANIFEST));
44
+ const updateData = {
45
+ name: "@updated/package",
46
+ description: "Updated description",
47
+ };
48
+ const manifestPath = generateManifest(updateData, testOutDirPath);
49
+ const content = fs.readFileSync(manifestPath, "utf-8");
50
+ const manifest = JSON.parse(content);
51
+ expect(manifest.name).toBe("@updated/package");
52
+ expect(manifest.description).toBe("Updated description");
53
+ expect(manifest.category).toBe("test-category");
54
+ expect(manifest.publisher).toEqual({
55
+ name: "@existing",
56
+ url: "https://example.com/existing",
57
+ });
58
+ expect(manifest.documentModels).toEqual([
59
+ { id: "test/document", name: "Test Document" },
60
+ ]);
61
+ expect(manifest.editors).toEqual([
62
+ {
63
+ id: "test-editor",
64
+ name: "Test Editor",
65
+ documentTypes: ["test/document"],
66
+ },
67
+ ]);
68
+ expect(manifest.apps).toEqual([
69
+ {
70
+ id: "test-app",
71
+ name: "Test App",
72
+ documentTypes: ["test/document"],
73
+ },
74
+ ]);
75
+ expect(manifest.subgraphs).toEqual([
76
+ {
77
+ id: "test-subgraph",
78
+ name: "Test Subgraph",
79
+ documentTypes: ["test/document"],
80
+ },
81
+ ]);
82
+ expect(manifest.importScripts).toEqual([
83
+ {
84
+ id: "test-script",
85
+ name: "Test Script",
86
+ documentTypes: ["test/document"],
87
+ },
88
+ ]);
89
+ });
90
+ it("should update publisher fields partially", async (context) => {
91
+ await setupTest(context, getTestDataDir(testDir, MANIFEST_TEST_PROJECT_WITH_EXISTING_MANIFEST));
92
+ const updateData = {
93
+ publisher: {
94
+ name: "@updated",
95
+ },
96
+ };
97
+ const manifestPath = generateManifest(updateData, testOutDirPath);
98
+ const content = fs.readFileSync(manifestPath, "utf-8");
99
+ const manifest = JSON.parse(content);
100
+ expect(manifest.publisher).toEqual({
101
+ name: "@updated",
102
+ url: "https://example.com/existing",
103
+ });
104
+ });
105
+ it("should handle malformed existing manifest gracefully", async (context) => {
106
+ await setupTest(context, getTestDataDir(testDir, MANIFEST_TEST_PROJECT));
107
+ const manifestPath = path.join(testOutDirPath, "powerhouse.manifest.json");
108
+ fs.writeFileSync(manifestPath, "{ invalid json }");
109
+ const updateData = {
110
+ name: "@test/package",
111
+ description: "Test description",
112
+ };
113
+ const resultPath = generateManifest(updateData, testOutDirPath);
114
+ expect(fs.existsSync(resultPath)).toBe(true);
115
+ const content = fs.readFileSync(resultPath, "utf-8");
116
+ const manifest = JSON.parse(content);
117
+ expect(manifest.name).toBe("@test/package");
118
+ expect(manifest.description).toBe("Test description");
119
+ expect(manifest.category).toBe("");
120
+ });
121
+ it("should use current working directory when projectRoot is not provided", () => {
122
+ const originalCwd = process.cwd();
123
+ process.chdir(testDir);
124
+ try {
125
+ const manifestData = {
126
+ name: "@test/package",
127
+ description: "Test description",
128
+ };
129
+ const manifestPath = generateManifest(manifestData);
130
+ expect(manifestPath).toBe(path.join(testDir, "powerhouse.manifest.json"));
131
+ expect(fs.existsSync(manifestPath)).toBe(true);
132
+ }
133
+ finally {
134
+ fs.rmSync(path.join(testDir, "powerhouse.manifest.json"), {
135
+ force: true,
136
+ });
137
+ process.chdir(originalCwd);
138
+ }
139
+ });
140
+ it("should validate JSON structure matches expected format", async (context) => {
141
+ await setupTest(context, getTestDataDir(testDir, MANIFEST_TEST_PROJECT));
142
+ const manifestData = {
143
+ name: "@test/package",
144
+ description: "Test package",
145
+ category: "testing",
146
+ publisher: {
147
+ name: "@test",
148
+ url: "https://test.com",
149
+ },
150
+ documentModels: [{ id: "test/doc", name: "Test Doc" }],
151
+ editors: [
152
+ {
153
+ id: "test-editor",
154
+ name: "Test Editor",
155
+ documentTypes: ["test/doc"],
156
+ },
157
+ ],
158
+ apps: [
159
+ {
160
+ id: "test-app",
161
+ name: "Test App",
162
+ documentTypes: ["test/doc"],
163
+ },
164
+ ],
165
+ subgraphs: [
166
+ {
167
+ id: "test-subgraph",
168
+ name: "Test Subgraph",
169
+ documentTypes: ["test/doc"],
170
+ },
171
+ ],
172
+ importScripts: [
173
+ {
174
+ id: "test-script",
175
+ name: "Test Script",
176
+ documentTypes: ["test/doc"],
177
+ },
178
+ ],
179
+ };
180
+ const manifestPath = generateManifest(manifestData, testOutDirPath);
181
+ const content = fs.readFileSync(manifestPath, "utf-8");
182
+ // Verify it's properly formatted JSON
183
+ expect(() => JSON.parse(content)).not.toThrow();
184
+ // Verify structure
185
+ const manifest = JSON.parse(content);
186
+ expect(manifest).toEqual(manifestData);
187
+ // Verify formatting (4 spaces indentation)
188
+ expect(content).toContain(' "name":');
189
+ expect(content).toContain(' "id":');
190
+ });
191
+ });
192
+ //# sourceMappingURL=generate-manifest.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-manifest.test.js","sourceRoot":"","sources":["../../../../src/codegen/__tests__/generate-manifest.test.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,MAAM,EACN,EAAE,GAEH,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EACL,iCAAiC,EACjC,qBAAqB,EACrB,4CAA4C,GAC7C,MAAM,gBAAgB,CAAC;AACxB,OAAO,EACL,YAAY,EACZ,cAAc,EACd,iBAAiB,EACjB,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,GAChB,MAAM,YAAY,CAAC;AAEpB,QAAQ,CAAC,kBAAkB,EAAE,GAA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AAY,CAAC,CAAC;QAEvC,2CAA2C;QAC3C,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;QACzC,MAAM,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,CAAC;IAC7C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-schemas.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-schemas.test.d.ts","sourceRoot":"","sources":["../../../../src/codegen/__tests__/generate-schemas.test.ts"],"names":[],"mappings":""}