@powerhousedao/codegen 5.0.0 → 5.0.1-staging.11

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 (179) 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 +25 -28
  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 +4 -125
  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/Folders.esm.t +28 -0
  35. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/components/NavigationBreadcrumbs.esm.t +14 -0
  36. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/config.esm.t +1 -0
  37. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/editor.esm.t +4 -1
  38. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/editors.esm.t +14 -0
  39. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/index.js +21 -3
  40. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/lib.esm.t +4 -2
  41. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/module.esm.t +15 -0
  42. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/edit-name.esm.t +78 -0
  43. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/editor.esm.t +6 -103
  44. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/editors.esm.t +14 -0
  45. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/index.js +71 -2
  46. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/lib.esm.t +4 -2
  47. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/module.esm.t +16 -0
  48. package/dist/src/codegen/.hygen/templates/powerhouse/utils.js +43 -0
  49. package/dist/src/codegen/__tests__/config.d.ts +2 -0
  50. package/dist/src/codegen/__tests__/config.d.ts.map +1 -0
  51. package/dist/src/codegen/__tests__/config.js +2 -0
  52. package/dist/src/codegen/__tests__/config.js.map +1 -0
  53. package/dist/src/codegen/__tests__/constants.d.ts +16 -0
  54. package/dist/src/codegen/__tests__/constants.d.ts.map +1 -0
  55. package/dist/src/codegen/__tests__/constants.js +16 -0
  56. package/dist/src/codegen/__tests__/constants.js.map +1 -0
  57. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content-v3.d.ts +2 -0
  58. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content-v3.d.ts.map +1 -0
  59. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content-v3.js +9 -0
  60. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content-v3.js.map +1 -0
  61. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content.d.ts +3 -0
  62. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content.d.ts.map +1 -0
  63. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content.js +33 -0
  64. package/dist/src/codegen/__tests__/fixtures/expected-reducer-content.js.map +1 -0
  65. package/dist/src/codegen/__tests__/fixtures/run-generated-tests.d.ts +2 -0
  66. package/dist/src/codegen/__tests__/fixtures/run-generated-tests.d.ts.map +1 -0
  67. package/dist/src/codegen/__tests__/fixtures/run-generated-tests.js +23 -0
  68. package/dist/src/codegen/__tests__/fixtures/run-generated-tests.js.map +1 -0
  69. package/dist/src/codegen/__tests__/fixtures/typecheck.d.ts +2 -0
  70. package/dist/src/codegen/__tests__/fixtures/typecheck.d.ts.map +1 -0
  71. package/dist/src/codegen/__tests__/fixtures/typecheck.js +23 -0
  72. package/dist/src/codegen/__tests__/fixtures/typecheck.js.map +1 -0
  73. package/dist/src/codegen/__tests__/generate-doc-model.test.d.ts +2 -0
  74. package/dist/src/codegen/__tests__/generate-doc-model.test.d.ts.map +1 -0
  75. package/dist/src/codegen/__tests__/generate-doc-model.test.js +206 -0
  76. package/dist/src/codegen/__tests__/generate-doc-model.test.js.map +1 -0
  77. package/dist/src/codegen/__tests__/generate-drive-editor.test.d.ts +2 -0
  78. package/dist/src/codegen/__tests__/generate-drive-editor.test.d.ts.map +1 -0
  79. package/dist/src/codegen/__tests__/generate-drive-editor.test.js +153 -0
  80. package/dist/src/codegen/__tests__/generate-drive-editor.test.js.map +1 -0
  81. package/dist/src/codegen/__tests__/generate-editor.test.d.ts +2 -0
  82. package/dist/src/codegen/__tests__/generate-editor.test.d.ts.map +1 -0
  83. package/dist/src/codegen/__tests__/generate-editor.test.js +94 -0
  84. package/dist/src/codegen/__tests__/generate-editor.test.js.map +1 -0
  85. package/dist/src/codegen/__tests__/generate-manifest.test.d.ts +2 -0
  86. package/dist/src/codegen/__tests__/generate-manifest.test.d.ts.map +1 -0
  87. package/dist/src/codegen/__tests__/generate-manifest.test.js +192 -0
  88. package/dist/src/codegen/__tests__/generate-manifest.test.js.map +1 -0
  89. package/dist/src/codegen/__tests__/generate-schemas.test.d.ts +2 -0
  90. package/dist/src/codegen/__tests__/generate-schemas.test.d.ts.map +1 -0
  91. package/dist/src/codegen/__tests__/generate-schemas.test.js +143 -0
  92. package/dist/src/codegen/__tests__/generate-schemas.test.js.map +1 -0
  93. package/dist/src/codegen/__tests__/global-setup.d.ts +2 -0
  94. package/dist/src/codegen/__tests__/global-setup.d.ts.map +1 -0
  95. package/dist/src/codegen/__tests__/global-setup.js +21 -0
  96. package/dist/src/codegen/__tests__/global-setup.js.map +1 -0
  97. package/dist/src/codegen/__tests__/ts-morph-generator.test.d.ts +2 -0
  98. package/dist/src/codegen/__tests__/ts-morph-generator.test.d.ts.map +1 -0
  99. package/dist/src/codegen/__tests__/ts-morph-generator.test.js +72 -0
  100. package/dist/src/codegen/__tests__/ts-morph-generator.test.js.map +1 -0
  101. package/dist/src/codegen/__tests__/utils.d.ts +7 -0
  102. package/dist/src/codegen/__tests__/utils.d.ts.map +1 -0
  103. package/dist/src/codegen/__tests__/utils.js +52 -0
  104. package/dist/src/codegen/__tests__/utils.js.map +1 -0
  105. package/dist/src/codegen/generate.d.ts +2 -2
  106. package/dist/src/codegen/generate.d.ts.map +1 -1
  107. package/dist/src/codegen/generate.js +13 -10
  108. package/dist/src/codegen/generate.js.map +1 -1
  109. package/dist/src/codegen/graphql.js +1 -1
  110. package/dist/src/codegen/graphql.js.map +1 -1
  111. package/dist/src/codegen/hygen.d.ts +5 -7
  112. package/dist/src/codegen/hygen.d.ts.map +1 -1
  113. package/dist/src/codegen/hygen.js +51 -15
  114. package/dist/src/codegen/hygen.js.map +1 -1
  115. package/dist/src/create-lib/checkout-project.d.ts +13 -0
  116. package/dist/src/create-lib/checkout-project.d.ts.map +1 -0
  117. package/dist/src/create-lib/checkout-project.js +47 -0
  118. package/dist/src/create-lib/checkout-project.js.map +1 -0
  119. package/dist/src/create-lib/create-project.d.ts +9 -5
  120. package/dist/src/create-lib/create-project.d.ts.map +1 -1
  121. package/dist/src/create-lib/create-project.js +37 -45
  122. package/dist/src/create-lib/create-project.js.map +1 -1
  123. package/dist/src/create-lib/feature-flags.d.ts +4 -0
  124. package/dist/src/create-lib/feature-flags.d.ts.map +1 -0
  125. package/dist/src/create-lib/feature-flags.js +4 -0
  126. package/dist/src/create-lib/feature-flags.js.map +1 -0
  127. package/dist/src/create-lib/index.d.ts +1 -0
  128. package/dist/src/create-lib/index.d.ts.map +1 -1
  129. package/dist/src/create-lib/index.js +1 -0
  130. package/dist/src/create-lib/index.js.map +1 -1
  131. package/dist/src/create-lib/utils.d.ts +7 -0
  132. package/dist/src/create-lib/utils.d.ts.map +1 -0
  133. package/dist/src/create-lib/utils.js +28 -0
  134. package/dist/src/create-lib/utils.js.map +1 -0
  135. package/dist/src/ts-morph-generator/__tests__/ReducerGenerator.test.d.ts +2 -0
  136. package/dist/src/ts-morph-generator/__tests__/ReducerGenerator.test.d.ts.map +1 -0
  137. package/dist/src/ts-morph-generator/__tests__/ReducerGenerator.test.js +491 -0
  138. package/dist/src/ts-morph-generator/__tests__/ReducerGenerator.test.js.map +1 -0
  139. package/dist/src/ts-morph-generator/core/FileGenerator.d.ts +3 -1
  140. package/dist/src/ts-morph-generator/core/FileGenerator.d.ts.map +1 -1
  141. package/dist/src/ts-morph-generator/core/FileGenerator.js +3 -1
  142. package/dist/src/ts-morph-generator/core/FileGenerator.js.map +1 -1
  143. package/dist/src/ts-morph-generator/core/GenerationContext.d.ts +1 -0
  144. package/dist/src/ts-morph-generator/core/GenerationContext.d.ts.map +1 -1
  145. package/dist/src/ts-morph-generator/core/ReducerGenerator.d.ts.map +1 -1
  146. package/dist/src/ts-morph-generator/core/ReducerGenerator.js +14 -7
  147. package/dist/src/ts-morph-generator/core/ReducerGenerator.js.map +1 -1
  148. package/dist/src/ts-morph-generator/core/TSMorphCodeGenerator.d.ts +2 -1
  149. package/dist/src/ts-morph-generator/core/TSMorphCodeGenerator.d.ts.map +1 -1
  150. package/dist/src/ts-morph-generator/core/TSMorphCodeGenerator.js +10 -3
  151. package/dist/src/ts-morph-generator/core/TSMorphCodeGenerator.js.map +1 -1
  152. package/dist/src/ts-morph-generator/utilities/DeclarationManager.d.ts +5 -0
  153. package/dist/src/ts-morph-generator/utilities/DeclarationManager.d.ts.map +1 -0
  154. package/dist/src/ts-morph-generator/utilities/DeclarationManager.js +10 -0
  155. package/dist/src/ts-morph-generator/utilities/DeclarationManager.js.map +1 -0
  156. package/dist/src/ts-morph-generator/utilities/ImportManager.d.ts +1 -0
  157. package/dist/src/ts-morph-generator/utilities/ImportManager.d.ts.map +1 -1
  158. package/dist/src/ts-morph-generator/utilities/ImportManager.js +13 -3
  159. package/dist/src/ts-morph-generator/utilities/ImportManager.js.map +1 -1
  160. package/dist/src/ts-morph-generator/utilities/index.d.ts +1 -0
  161. package/dist/src/ts-morph-generator/utilities/index.d.ts.map +1 -1
  162. package/dist/src/ts-morph-generator/utilities/index.js +1 -0
  163. package/dist/src/ts-morph-generator/utilities/index.js.map +1 -1
  164. package/dist/src/utils/validation.d.ts.map +1 -1
  165. package/dist/src/utils/validation.js +3 -4
  166. package/dist/src/utils/validation.js.map +1 -1
  167. package/dist/tsconfig.tsbuildinfo +1 -0
  168. package/dist/vitest.config.d.ts +3 -0
  169. package/dist/vitest.config.d.ts.map +1 -0
  170. package/dist/vitest.config.js +16 -0
  171. package/dist/vitest.config.js.map +1 -0
  172. package/package.json +13 -12
  173. package/dist/src/codegen/.hygen/templates/powerhouse/generate-document-model/lib.inject_export.esm.t +0 -7
  174. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/index.esm.t +0 -15
  175. package/dist/src/codegen/.hygen/templates/powerhouse/generate-drive-editor/lib.inject_export.esm.t +0 -7
  176. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/hooks.esm.t +0 -16
  177. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/index.esm.t +0 -15
  178. package/dist/src/codegen/.hygen/templates/powerhouse/generate-editor/lib.inject_export.esm.t +0 -7
  179. package/dist/tsconfig.lib.tsbuildinfo +0 -1
@@ -0,0 +1,16 @@
1
+ ---
2
+ to: "<%= rootDir %>/<%= h.changeCase.param(name) %>/module.ts"
3
+ force: true
4
+ ---
5
+ import type { EditorModule } from "document-model";
6
+ import { lazy } from "react";
7
+
8
+ /** Document editor module for the Todo List document type */
9
+ export const <%= pascalCaseEditorName %>: EditorModule = {
10
+ Component: lazy(() => import("./editor.js")),
11
+ documentTypes: [<% if(!documentTypes.length){ %>"*"<% } else { %><% documentTypes.forEach(type => { _%>"<%= type %>", %><% }); _%> <% } %>],
12
+ config: {
13
+ id: "<%= editorId || paramCaseEditorName %>",
14
+ name: "<%= name || pascalCaseEditorName %>",
15
+ },
16
+ };
@@ -0,0 +1,43 @@
1
+ const {
2
+ pascalCase,
3
+ paramCase,
4
+ capitalCase,
5
+ camelCase,
6
+ } = require("change-case");
7
+ const { readdirSync, readFileSync } = require("fs");
8
+ const { join } = require("path");
9
+
10
+ function getModuleExports(dirPath, matcher, newEntry) {
11
+ const entries = readdirSync(dirPath, { withFileTypes: true });
12
+ const moduleExports = [];
13
+
14
+ for (const entry of entries) {
15
+ if (!entry.isDirectory()) continue;
16
+
17
+ try {
18
+ const modulePath = join(dirPath, entry.name, "module.ts");
19
+ const content = readFileSync(modulePath, "utf8");
20
+
21
+ const match = content.match(matcher);
22
+
23
+ if (match) {
24
+ moduleExports.push({
25
+ paramCaseName: entry.name,
26
+ pascalCaseName: match[1],
27
+ });
28
+ }
29
+ } catch (_) {
30
+ continue;
31
+ }
32
+ }
33
+
34
+ if (!moduleExports.find(me => me.paramCaseName === newEntry.paramCaseName)) {
35
+ moduleExports.push(newEntry);
36
+ }
37
+
38
+ return moduleExports;
39
+ }
40
+
41
+ module.exports = {
42
+ getModuleExports,
43
+ };
@@ -0,0 +1,2 @@
1
+ export declare const PURGE_AFTER_TEST: boolean;
2
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../../src/codegen/__tests__/config.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,SAA0C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export const PURGE_AFTER_TEST = process.env.KEEP_TEST_OUTPUT !== "true";
2
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../../../src/codegen/__tests__/config.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,KAAK,MAAM,CAAC"}
@@ -0,0 +1,16 @@
1
+ export declare const TEST_PACKAGE_NAME = "test";
2
+ export declare const TEST_OUTPUT_DIR = ".test-output";
3
+ export declare const TEST_DATA_DIR = "data";
4
+ export declare const GENERATE_DOC_MODEL_TEST_OUTPUT_DIR = "generate-doc-model";
5
+ export declare const GENERATE_EDITOR_TEST_OUTPUT_DIR = "generate-editor";
6
+ export declare const GENERATE_DRIVE_EDITOR_TEST_OUTPUT_DIR = "generate-drive-editor";
7
+ export declare const TS_MORPH_GENERATOR_TEST_OUTPUT_DIR = "ts-morph-generator";
8
+ export declare const GENERATE_SCHEMAS_TEST_OUTPUT_DIR = "generate-schemas";
9
+ export declare const GENERATE_MANIFEST_TEST_OUTPUT_DIR = "generate-manifest";
10
+ export declare const DOCUMENT_MODELS_TEST_PROJECT = "document-models-test-project";
11
+ export declare const EDITORS_TEST_PROJECT = "editors-test-project";
12
+ export declare const EDITORS_TEST_PROJECT_WITH_EXISTING_EDITOR = "editors-test-project-with-existing-editor";
13
+ export declare const MANIFEST_TEST_PROJECT = "manifest-test-project";
14
+ export declare const MANIFEST_TEST_PROJECT_WITH_EXISTING_MANIFEST = "manifest-test-project-with-existing-manifest";
15
+ export declare const SCHEMAS_TEST_PROJECT = "schemas-test-project";
16
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../../../src/codegen/__tests__/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,SAAS,CAAC;AACxC,eAAO,MAAM,eAAe,iBAAiB,CAAC;AAC9C,eAAO,MAAM,aAAa,SAAS,CAAC;AACpC,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,+BAA+B,oBAAoB,CAAC;AACjE,eAAO,MAAM,qCAAqC,0BAA0B,CAAC;AAC7E,eAAO,MAAM,kCAAkC,uBAAuB,CAAC;AACvE,eAAO,MAAM,gCAAgC,qBAAqB,CAAC;AACnE,eAAO,MAAM,iCAAiC,sBAAsB,CAAC;AACrE,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,oBAAoB,yBAAyB,CAAC;AAC3D,eAAO,MAAM,yCAAyC,8CACT,CAAC;AAC9C,eAAO,MAAM,qBAAqB,0BAA0B,CAAC;AAC7D,eAAO,MAAM,4CAA4C,iDACT,CAAC;AACjD,eAAO,MAAM,oBAAoB,yBAAyB,CAAC"}
@@ -0,0 +1,16 @@
1
+ export const TEST_PACKAGE_NAME = "test";
2
+ export const TEST_OUTPUT_DIR = ".test-output";
3
+ export const TEST_DATA_DIR = "data";
4
+ export const GENERATE_DOC_MODEL_TEST_OUTPUT_DIR = "generate-doc-model";
5
+ export const GENERATE_EDITOR_TEST_OUTPUT_DIR = "generate-editor";
6
+ export const GENERATE_DRIVE_EDITOR_TEST_OUTPUT_DIR = "generate-drive-editor";
7
+ export const TS_MORPH_GENERATOR_TEST_OUTPUT_DIR = "ts-morph-generator";
8
+ export const GENERATE_SCHEMAS_TEST_OUTPUT_DIR = "generate-schemas";
9
+ export const GENERATE_MANIFEST_TEST_OUTPUT_DIR = "generate-manifest";
10
+ export const DOCUMENT_MODELS_TEST_PROJECT = "document-models-test-project";
11
+ export const EDITORS_TEST_PROJECT = "editors-test-project";
12
+ export const EDITORS_TEST_PROJECT_WITH_EXISTING_EDITOR = "editors-test-project-with-existing-editor";
13
+ export const MANIFEST_TEST_PROJECT = "manifest-test-project";
14
+ export const MANIFEST_TEST_PROJECT_WITH_EXISTING_MANIFEST = "manifest-test-project-with-existing-manifest";
15
+ export const SCHEMAS_TEST_PROJECT = "schemas-test-project";
16
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../../src/codegen/__tests__/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AACxC,MAAM,CAAC,MAAM,eAAe,GAAG,cAAc,CAAC;AAC9C,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC;AACpC,MAAM,CAAC,MAAM,kCAAkC,GAAG,oBAAoB,CAAC;AACvE,MAAM,CAAC,MAAM,+BAA+B,GAAG,iBAAiB,CAAC;AACjE,MAAM,CAAC,MAAM,qCAAqC,GAAG,uBAAuB,CAAC;AAC7E,MAAM,CAAC,MAAM,kCAAkC,GAAG,oBAAoB,CAAC;AACvE,MAAM,CAAC,MAAM,gCAAgC,GAAG,kBAAkB,CAAC;AACnE,MAAM,CAAC,MAAM,iCAAiC,GAAG,mBAAmB,CAAC;AACrE,MAAM,CAAC,MAAM,4BAA4B,GAAG,8BAA8B,CAAC;AAC3E,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC;AAC3D,MAAM,CAAC,MAAM,yCAAyC,GACpD,2CAA2C,CAAC;AAC9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAC7D,MAAM,CAAC,MAAM,4CAA4C,GACvD,8CAA8C,CAAC;AACjD,MAAM,CAAC,MAAM,oBAAoB,GAAG,sBAAsB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const expectedProOperationsV3Content = "import type { TestDocProOperationsOperations } from \"test/document-models/test-doc\";\n\nexport const testDocProOperationsOperations: TestDocProOperationsOperations = {\n setNameAndValueOperation(state, action) {\n // TODO: Implement \"setNameAndValueOperation\" reducer\n throw new Error('Reducer \"setNameAndValueOperation\" not yet implemented');\n }\n};";
2
+ //# sourceMappingURL=expected-reducer-content-v3.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expected-reducer-content-v3.d.ts","sourceRoot":"","sources":["../../../../../src/codegen/__tests__/fixtures/expected-reducer-content-v3.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,+XAOxC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export const expectedProOperationsV3Content = `import type { TestDocProOperationsOperations } from "test/document-models/test-doc";
2
+
3
+ export const testDocProOperationsOperations: TestDocProOperationsOperations = {
4
+ setNameAndValueOperation(state, action) {
5
+ // TODO: Implement "setNameAndValueOperation" reducer
6
+ throw new Error('Reducer "setNameAndValueOperation" not yet implemented');
7
+ }
8
+ };`;
9
+ //# sourceMappingURL=expected-reducer-content-v3.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expected-reducer-content-v3.js","sourceRoot":"","sources":["../../../../../src/codegen/__tests__/fixtures/expected-reducer-content-v3.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,8BAA8B,GAAG;;;;;;;GAO3C,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare const expectedBaseOperationsContent = "import type { TestDocBaseOperationsOperations } from \"test/document-models/test-doc\";\n\nexport const testDocBaseOperationsOperations: TestDocBaseOperationsOperations = {\n setTestIdOperation(state, action) {\n // TODO: Implement \"setTestIdOperation\" reducer\n throw new Error('Reducer \"setTestIdOperation\" not yet implemented');\n },\n setTestNameOperation(state, action) {\n // TODO: Implement \"setTestNameOperation\" reducer\n throw new Error('Reducer \"setTestNameOperation\" not yet implemented');\n },\n setTestDescriptionOperation(state, action) {\n // TODO: Implement \"setTestDescriptionOperation\" reducer\n throw new Error('Reducer \"setTestDescriptionOperation\" not yet implemented');\n },\n setTestValueOperation(state, action) {\n // TODO: Implement \"setTestValueOperation\" reducer\n throw new Error('Reducer \"setTestValueOperation\" not yet implemented');\n }\n};";
2
+ export declare const expectedProOperationsContent = "import type { TestDocProOperationsOperations } from \"test/document-models/test-doc\";\n\nexport const testDocProOperationsOperations: TestDocProOperationsOperations = {\n setNameAndValueOperation(state, action) {\n // TODO: Implement \"setNameAndValueOperation\" reducer\n throw new Error('Reducer \"setNameAndValueOperation\" not yet implemented');\n },\n setIdAndDescriptionOperation(state, action) {\n // TODO: Implement \"setIdAndDescriptionOperation\" reducer\n throw new Error('Reducer \"setIdAndDescriptionOperation\" not yet implemented');\n }\n};";
3
+ //# sourceMappingURL=expected-reducer-content.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expected-reducer-content.d.ts","sourceRoot":"","sources":["../../../../../src/codegen/__tests__/fixtures/expected-reducer-content.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,6BAA6B,88BAmBvC,CAAC;AAEJ,eAAO,MAAM,4BAA4B,ylBAWtC,CAAC"}
@@ -0,0 +1,33 @@
1
+ export const expectedBaseOperationsContent = `import type { TestDocBaseOperationsOperations } from "test/document-models/test-doc";
2
+
3
+ export const testDocBaseOperationsOperations: TestDocBaseOperationsOperations = {
4
+ setTestIdOperation(state, action) {
5
+ // TODO: Implement "setTestIdOperation" reducer
6
+ throw new Error('Reducer "setTestIdOperation" not yet implemented');
7
+ },
8
+ setTestNameOperation(state, action) {
9
+ // TODO: Implement "setTestNameOperation" reducer
10
+ throw new Error('Reducer "setTestNameOperation" not yet implemented');
11
+ },
12
+ setTestDescriptionOperation(state, action) {
13
+ // TODO: Implement "setTestDescriptionOperation" reducer
14
+ throw new Error('Reducer "setTestDescriptionOperation" not yet implemented');
15
+ },
16
+ setTestValueOperation(state, action) {
17
+ // TODO: Implement "setTestValueOperation" reducer
18
+ throw new Error('Reducer "setTestValueOperation" not yet implemented');
19
+ }
20
+ };`;
21
+ export const expectedProOperationsContent = `import type { TestDocProOperationsOperations } from "test/document-models/test-doc";
22
+
23
+ export const testDocProOperationsOperations: TestDocProOperationsOperations = {
24
+ setNameAndValueOperation(state, action) {
25
+ // TODO: Implement "setNameAndValueOperation" reducer
26
+ throw new Error('Reducer "setNameAndValueOperation" not yet implemented');
27
+ },
28
+ setIdAndDescriptionOperation(state, action) {
29
+ // TODO: Implement "setIdAndDescriptionOperation" reducer
30
+ throw new Error('Reducer "setIdAndDescriptionOperation" not yet implemented');
31
+ }
32
+ };`;
33
+ //# sourceMappingURL=expected-reducer-content.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"expected-reducer-content.js","sourceRoot":"","sources":["../../../../../src/codegen/__tests__/fixtures/expected-reducer-content.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,6BAA6B,GAAG;;;;;;;;;;;;;;;;;;;GAmB1C,CAAC;AAEJ,MAAM,CAAC,MAAM,4BAA4B,GAAG;;;;;;;;;;;GAWzC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const runGeneratedTests: (testOutDirPath: string) => Promise<unknown>;
2
+ //# sourceMappingURL=run-generated-tests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-generated-tests.d.ts","sourceRoot":"","sources":["../../../../../src/codegen/__tests__/fixtures/run-generated-tests.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,iBAAiB,GAAI,gBAAgB,MAAM,qBAwBpD,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { exec } from "node:child_process";
2
+ export const runGeneratedTests = (testOutDirPath) => new Promise((resolve, reject) => {
3
+ const output = {
4
+ stdout: [],
5
+ stderr: [],
6
+ };
7
+ const child = exec(`npx vitest run`, { cwd: testOutDirPath });
8
+ child.stdout?.on("data", (data) => {
9
+ output.stdout.push(data);
10
+ });
11
+ child.stderr?.on("data", (data) => {
12
+ output.stderr.push(data);
13
+ });
14
+ child.on("close", (code) => {
15
+ if (code === 0) {
16
+ resolve(true);
17
+ }
18
+ else {
19
+ reject(new Error(`tsc failed with code ${code}:\n${output.stdout.join("")}\n${output.stderr.join("")}`));
20
+ }
21
+ });
22
+ });
23
+ //# sourceMappingURL=run-generated-tests.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-generated-tests.js","sourceRoot":"","sources":["../../../../../src/codegen/__tests__/fixtures/run-generated-tests.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,cAAsB,EAAE,EAAE,CAC1D,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,MAAM,MAAM,GAA2C;QACrD,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,EAAE;KACX,CAAC;IACF,MAAM,KAAK,GAAG,IAAI,CAAC,gBAAgB,EAAE,EAAE,GAAG,EAAE,cAAc,EAAE,CAAC,CAAC;IAC9D,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;QACxC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;QACxC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QACzB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;aAAM,CAAC;YACN,MAAM,CACJ,IAAI,KAAK,CACP,wBAAwB,IAAI,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CACtF,CACF,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const compile: (testDir: string) => Promise<unknown>;
2
+ //# sourceMappingURL=typecheck.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typecheck.d.ts","sourceRoot":"","sources":["../../../../../src/codegen/__tests__/fixtures/typecheck.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,OAAO,GAAI,SAAS,MAAM,qBAwBnC,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { exec } from "node:child_process";
2
+ export const compile = (testDir) => new Promise((resolve, reject) => {
3
+ const output = {
4
+ stdout: [],
5
+ stderr: [],
6
+ };
7
+ const child = exec(`npm install && npx tsc`, { cwd: testDir });
8
+ child.stdout?.on("data", (data) => {
9
+ output.stdout.push(data);
10
+ });
11
+ child.stderr?.on("data", (data) => {
12
+ output.stderr.push(data);
13
+ });
14
+ child.on("close", (code) => {
15
+ if (code === 0) {
16
+ resolve(true);
17
+ }
18
+ else {
19
+ reject(new Error(`tsc failed with code ${code}:\n${output.stdout.join("")}\n${output.stderr.join("")}`));
20
+ }
21
+ });
22
+ });
23
+ //# sourceMappingURL=typecheck.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typecheck.js","sourceRoot":"","sources":["../../../../../src/codegen/__tests__/fixtures/typecheck.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAE1C,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,OAAe,EAAE,EAAE,CACzC,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;IAC9B,MAAM,MAAM,GAA2C;QACrD,MAAM,EAAE,EAAE;QACV,MAAM,EAAE,EAAE;KACX,CAAC;IACF,MAAM,KAAK,GAAG,IAAI,CAAC,wBAAwB,EAAE,EAAE,GAAG,EAAE,OAAO,EAAE,CAAC,CAAC;IAC/D,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;QACxC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,IAAY,EAAE,EAAE;QACxC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC,CAAC,CAAC;IACH,KAAK,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,EAAE;QACzB,IAAI,IAAI,KAAK,CAAC,EAAE,CAAC;YACf,OAAO,CAAC,IAAI,CAAC,CAAC;QAChB,CAAC;aAAM,CAAC;YACN,MAAM,CACJ,IAAI,KAAK,CACP,wBAAwB,IAAI,MAAM,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CACtF,CACF,CAAC;QACJ,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-doc-model.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-doc-model.test.d.ts","sourceRoot":"","sources":["../../../../src/codegen/__tests__/generate-doc-model.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,206 @@
1
+ import { generateSchemas, hygenGenerateDocumentModel, hygenGenerateProcessor, loadDocumentModel, } from "@powerhousedao/codegen";
2
+ import { readFileSync, rmSync } from "node:fs";
3
+ import path from "node:path";
4
+ import { afterAll, beforeAll, beforeEach, describe, expect, it, } from "vitest";
5
+ import { DOCUMENT_MODELS_TEST_PROJECT, GENERATE_DOC_MODEL_TEST_OUTPUT_DIR, TEST_PACKAGE_NAME, } from "./constants.js";
6
+ import { runGeneratedTests } from "./fixtures/run-generated-tests.js";
7
+ import { compile } from "./fixtures/typecheck.js";
8
+ import { copyAllFiles, getTestDataDir, getTestOutDirPath, getTestOutputDir, purgeDirAfterTest, resetDirForTest, } from "./utils.js";
9
+ describe("document model", () => {
10
+ const testDir = import.meta.dirname;
11
+ const outDirName = getTestOutputDir(testDir, GENERATE_DOC_MODEL_TEST_OUTPUT_DIR);
12
+ const testDataDir = getTestDataDir(testDir, DOCUMENT_MODELS_TEST_PROJECT);
13
+ let testOutDirPath = getTestOutDirPath("initial", outDirName);
14
+ const documentModelsSrcPath = path.join(testDir, "data", "document-models");
15
+ let documentModelsDirName = path.join(testOutDirPath, "document-models");
16
+ let processorsDirName = path.join(testOutDirPath, "processors");
17
+ async function setupTest(context) {
18
+ testOutDirPath = getTestOutDirPath(context.task.name, outDirName);
19
+ await copyAllFiles(testDataDir, testOutDirPath);
20
+ documentModelsDirName = path.join(testOutDirPath, "document-models");
21
+ processorsDirName = path.join(testOutDirPath, "processors");
22
+ }
23
+ beforeEach(async (context) => {
24
+ await setupTest(context);
25
+ });
26
+ beforeAll(() => {
27
+ resetDirForTest(outDirName);
28
+ });
29
+ afterAll(() => {
30
+ purgeDirAfterTest(outDirName);
31
+ });
32
+ const generate = async () => {
33
+ await generateSchemas(documentModelsSrcPath, {
34
+ skipFormat: true,
35
+ outDir: documentModelsDirName,
36
+ });
37
+ const billingStatementDocumentModel = await loadDocumentModel(path.join(documentModelsSrcPath, "billing-statement", "billing-statement.json"));
38
+ await hygenGenerateDocumentModel(billingStatementDocumentModel, documentModelsDirName, TEST_PACKAGE_NAME, { skipFormat: true });
39
+ const testDocDocumentModel = await loadDocumentModel(path.join(documentModelsSrcPath, "test-doc", "test-doc.json"));
40
+ await hygenGenerateDocumentModel(testDocDocumentModel, documentModelsDirName, TEST_PACKAGE_NAME, { skipFormat: true });
41
+ };
42
+ it("should generate a document model", {
43
+ timeout: 30000,
44
+ }, async () => {
45
+ await generate();
46
+ await compile(testOutDirPath);
47
+ await runGeneratedTests(testOutDirPath);
48
+ });
49
+ it("should generate an analytics processor and factory", {
50
+ timeout: 10000,
51
+ }, async () => {
52
+ await generate();
53
+ await hygenGenerateProcessor("test-analytics-processor", ["billing-statement"], path.join(testOutDirPath, processorsDirName), "analytics", {
54
+ skipFormat: true,
55
+ });
56
+ await compile(testOutDirPath);
57
+ });
58
+ it("should generate multiple analytics processors with composable factories", {
59
+ timeout: 10000,
60
+ }, async () => {
61
+ await generate();
62
+ await hygenGenerateProcessor("test1", ["billing-statement"], path.join(testOutDirPath, processorsDirName), "analytics", {
63
+ skipFormat: true,
64
+ });
65
+ await hygenGenerateProcessor("test2", ["billing-statement"], path.join(testOutDirPath, processorsDirName), "analytics", {
66
+ skipFormat: true,
67
+ });
68
+ await hygenGenerateProcessor("test3", ["billing-statement"], path.join(testOutDirPath, processorsDirName), "analytics", {
69
+ skipFormat: true,
70
+ });
71
+ await compile(testOutDirPath);
72
+ });
73
+ it("should generate a relational db processor and factory", {
74
+ timeout: 10000,
75
+ }, async () => {
76
+ await generate();
77
+ await hygenGenerateProcessor("test-relational-processor", ["billing-statement"], path.join(testOutDirPath, processorsDirName), "relationalDb", {
78
+ skipFormat: true,
79
+ });
80
+ await compile(testOutDirPath);
81
+ });
82
+ it("should generate multiple relational db processors with composable factories", {
83
+ timeout: 10000,
84
+ }, async () => {
85
+ await generate();
86
+ await hygenGenerateProcessor("test1", ["billing-statement"], path.join(testOutDirPath, processorsDirName), "relationalDb", {
87
+ skipFormat: true,
88
+ });
89
+ await hygenGenerateProcessor("test2", ["billing-statement"], path.join(testOutDirPath, processorsDirName), "relationalDb", {
90
+ skipFormat: true,
91
+ });
92
+ await hygenGenerateProcessor("test3", ["billing-statement"], path.join(testOutDirPath, processorsDirName), "relationalDb", {
93
+ skipFormat: true,
94
+ });
95
+ await compile(testOutDirPath);
96
+ });
97
+ it("should create the document-models.ts file if it does not exist", {
98
+ timeout: 15000,
99
+ }, async () => {
100
+ const documentModelsFilePath = path.join(documentModelsDirName, "document-models.ts");
101
+ rmSync(documentModelsFilePath, { force: true });
102
+ await generate();
103
+ await compile(testOutDirPath);
104
+ const documentModelsContent = readFileSync(documentModelsFilePath, "utf-8");
105
+ // Check that both models are exported
106
+ expect(documentModelsContent).toContain(`import { BillingStatement } from "./billing-statement/module.js";`);
107
+ expect(documentModelsContent).toContain(`import { TestDoc } from "./test-doc/module.js";`);
108
+ expect(documentModelsContent).toContain("export const documentModels: DocumentModelModule<any>[] = [");
109
+ expect(documentModelsContent).toContain("BillingStatement,");
110
+ expect(documentModelsContent).toContain("TestDoc,");
111
+ expect(documentModelsContent).toContain("]");
112
+ });
113
+ it("should generate multiple document models and export both in document-models.ts", {
114
+ timeout: 15000,
115
+ }, async () => {
116
+ await generate();
117
+ await compile(testOutDirPath);
118
+ const documentModelsFilePath = path.join(documentModelsDirName, "document-models.ts");
119
+ const documentModelsContent = readFileSync(documentModelsFilePath, "utf-8");
120
+ // Check that both models are exported
121
+ expect(documentModelsContent).toContain(`import { BillingStatement } from "./billing-statement/module.js";`);
122
+ expect(documentModelsContent).toContain(`import { TestDoc } from "./test-doc/module.js";`);
123
+ expect(documentModelsContent).toContain("export const documentModels: DocumentModelModule<any>[] = [");
124
+ expect(documentModelsContent).toContain("BillingStatement,");
125
+ expect(documentModelsContent).toContain("TestDoc,");
126
+ expect(documentModelsContent).toContain("]");
127
+ });
128
+ it("should generate an updated version of test-doc", { timeout: 10000 }, async () => {
129
+ await generate();
130
+ await compile(testOutDirPath);
131
+ const testDocDocumentModelV2 = await loadDocumentModel(path.join(documentModelsSrcPath, "..", "test-doc-versions", "test-doc-v2", "test-doc.json"));
132
+ // TODO: this is a hack to get the test to pass, we should be able to update the reducer file once is generated
133
+ // remove .out/document-model/test-doc/src/reducers/base-operations.ts file
134
+ rmSync(path.join(documentModelsDirName, "test-doc", "src", "reducers", "base-operations.ts"), { force: true });
135
+ await hygenGenerateDocumentModel(testDocDocumentModelV2, documentModelsDirName, TEST_PACKAGE_NAME, { skipFormat: true });
136
+ // expect .out/document-model/test-doc/src/reducers/base-operations.ts to contain setTestIdOperation, setTestNameOperation, setTestDescriptionOperation and setTestValueOperation
137
+ const baseOperationsPath = path.join(documentModelsDirName, "test-doc", "src", "reducers", "base-operations.ts");
138
+ const baseOperationsContent = readFileSync(baseOperationsPath, "utf-8");
139
+ expect(baseOperationsContent).toContain("setTestIdOperation");
140
+ expect(baseOperationsContent).toContain("setTestNameOperation");
141
+ expect(baseOperationsContent).toContain("setTestDescriptionOperation");
142
+ expect(baseOperationsContent).toContain("setTestValueOperation");
143
+ });
144
+ it("should generate error classes and types from billing statement errors", { timeout: 10000 }, async () => {
145
+ await generate();
146
+ await compile(testOutDirPath);
147
+ // Check general module errors
148
+ const generalErrorPath = path.join(documentModelsDirName, "billing-statement", "gen", "general", "error.ts");
149
+ const generalErrorContent = readFileSync(generalErrorPath, "utf-8");
150
+ // Check that InvalidStatusTransition error is generated
151
+ expect(generalErrorContent).toContain("export type ErrorCode =");
152
+ expect(generalErrorContent).toContain("'InvalidStatusTransition'");
153
+ expect(generalErrorContent).toContain("export class InvalidStatusTransition extends Error implements ReducerError");
154
+ expect(generalErrorContent).toContain("errorCode = 'InvalidStatusTransition' as ErrorCode");
155
+ // Check line_items module errors
156
+ const lineItemsErrorPath = path.join(documentModelsDirName, "billing-statement", "gen", "line-items", "error.ts");
157
+ const lineItemsErrorContent = readFileSync(lineItemsErrorPath, "utf-8");
158
+ // Check that both DuplicateLineItem and InvalidStatusTransition errors are generated (but deduplicated)
159
+ expect(lineItemsErrorContent).toContain("export type ErrorCode =");
160
+ expect(lineItemsErrorContent).toContain("'DuplicateLineItem'");
161
+ expect(lineItemsErrorContent).toContain("'InvalidStatusTransition'");
162
+ expect(lineItemsErrorContent).toContain("export class DuplicateLineItem extends Error implements ReducerError");
163
+ expect(lineItemsErrorContent).toContain("export class InvalidStatusTransition extends Error implements ReducerError");
164
+ // Verify that InvalidStatusTransition only appears once in the ErrorCode type (deduplication test)
165
+ const errorCodeMatches = lineItemsErrorContent.match(/'InvalidStatusTransition'/g);
166
+ expect(errorCodeMatches?.length).toBe(3); // Once in type definition, once in each class
167
+ });
168
+ it("should automatically import error classes in reducer files when used", { timeout: 10000 }, async () => {
169
+ await generate();
170
+ await compile(testOutDirPath);
171
+ // Check that the general module reducer imports InvalidStatusTransition
172
+ const generalReducerPath = path.join(documentModelsDirName, "billing-statement", "src", "reducers", "general.ts");
173
+ const generalReducerContent = readFileSync(generalReducerPath, "utf-8");
174
+ // Should have import for both InvalidStatusTransition and StatusAlreadySet errors in single import
175
+ expect(generalReducerContent).toContain('import { InvalidStatusTransition, StatusAlreadySet } from "../../gen/general/error.js";');
176
+ // Should contain the reducer code with both error usages
177
+ expect(generalReducerContent).toContain("throw new InvalidStatusTransition");
178
+ expect(generalReducerContent).toContain("throw new StatusAlreadySet");
179
+ // Check that the line-items module reducer imports DuplicateLineItem
180
+ const lineItemsReducerPath = path.join(documentModelsDirName, "billing-statement", "src", "reducers", "line-items.ts");
181
+ const lineItemsReducerContent = readFileSync(lineItemsReducerPath, "utf-8");
182
+ // Should have import for DuplicateLineItem error
183
+ expect(lineItemsReducerContent).toContain('import { DuplicateLineItem } from "../../gen/line-items/error.js";');
184
+ // Should contain the reducer code with error usage
185
+ expect(lineItemsReducerContent).toContain("throw new DuplicateLineItem");
186
+ });
187
+ it("should generate error codes for legacy documents with empty error codes", { timeout: 10000 }, async () => {
188
+ await generate();
189
+ const testEmptyCodesDocumentModel = await loadDocumentModel(path.join(documentModelsSrcPath, "test-empty-error-codes", "test-empty-error-codes.json"));
190
+ await hygenGenerateDocumentModel(testEmptyCodesDocumentModel, documentModelsDirName, TEST_PACKAGE_NAME, { skipFormat: true });
191
+ // Check that error codes are generated from error names
192
+ const testOperationsErrorPath = path.join(documentModelsDirName, "test-empty-codes", "gen", "test-operations", "error.ts");
193
+ const testOperationsErrorContent = readFileSync(testOperationsErrorPath, "utf-8");
194
+ // Check that error codes are generated from names in PascalCase when empty
195
+ expect(testOperationsErrorContent).toContain("export type ErrorCode =");
196
+ expect(testOperationsErrorContent).toContain("'InvalidValue'");
197
+ expect(testOperationsErrorContent).toContain("'EmptyValue'");
198
+ // Check that error classes are generated
199
+ expect(testOperationsErrorContent).toContain("export class InvalidValue extends Error implements ReducerError");
200
+ expect(testOperationsErrorContent).toContain("export class EmptyValue extends Error implements ReducerError");
201
+ // Verify error code constants are set properly in PascalCase
202
+ expect(testOperationsErrorContent).toContain("errorCode = 'InvalidValue' as ErrorCode");
203
+ expect(testOperationsErrorContent).toContain("errorCode = 'EmptyValue' as ErrorCode");
204
+ });
205
+ });
206
+ //# sourceMappingURL=generate-doc-model.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate-doc-model.test.js","sourceRoot":"","sources":["../../../../src/codegen/__tests__/generate-doc-model.test.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,0BAA0B,EAC1B,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,QAAQ,EACR,MAAM,EACN,EAAE,GAEH,MAAM,QAAQ,CAAC;AAChB,OAAO,EACL,4BAA4B,EAC5B,kCAAkC,EAClC,iBAAiB,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,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,CACjC,OAAO,EACP,kCAAkC,CACnC,CAAC;IACF,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,EAAE,4BAA4B,CAAC,CAAC;IAE1E,IAAI,cAAc,GAAG,iBAAiB,CAAC,S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CAAC,CAAC;QAE7D,yCAAyC;QACzC,MAAM,CAAC,0BAA0B,CAAC,CAAC,SAAS,CAC1C,iEAAiE,CAClE,CAAC;QACF,MAAM,CAAC,0BAA0B,CAAC,CAAC,SAAS,CAC1C,+DAA+D,CAChE,CAAC;QAEF,6DAA6D;QAC7D,MAAM,CAAC,0BAA0B,CAAC,CAAC,SAAS,CAC1C,yCAAyC,CAC1C,CAAC;QACF,MAAM,CAAC,0BAA0B,CAAC,CAAC,SAAS,CAC1C,uCAAuC,CACxC,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=generate-drive-editor.test.d.ts.map
@@ -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":""}