@powerhousedao/codegen 6.0.0-dev.193 → 6.0.0-dev.194

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import { a as DocumentModelDocumentTypeMetadata, c as DocumentModelVariableNames
2
2
  import { a as parseConfig, i as parseArgs, n as validateDocumentModelState, r as configSpec, t as DocumentModelStateValidationResult } from "./validation-Z3z0BJlu.mjs";
3
3
  import { DocumentModelGlobalState, ModuleSpecification, OperationErrorSpecification } from "@powerhousedao/shared/document-model";
4
4
  import { Project, SourceFile } from "ts-morph";
5
- import { Project as Project$1 } from "@pnpm/find-workspace-packages";
5
+ import { PackageJson } from "read-pkg";
6
6
  import { ProcessorApps } from "@powerhousedao/shared/processors";
7
7
  import { PHProjectDirectories as PHProjectDirectories$1 } from "@powerhousedao/codegen";
8
8
 
@@ -85,7 +85,7 @@ type DocumentTypesMap = Record<string, {
85
85
  declare global {
86
86
  const WORKSPACE_PACKAGES: {
87
87
  dir: string;
88
- manifest: Project$1["manifest"];
88
+ manifest: PackageJson;
89
89
  }[];
90
90
  } //# sourceMappingURL=types.d.ts.map
91
91
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/codegen/generate.ts","../src/codegen/graphql.ts","../src/codegen/kysely.ts","../src/codegen/migrate.ts","../src/codegen/types.ts","../src/codegen/utils.ts","../src/create-lib/checkout-project.ts","../src/create-lib/create-project.ts","../src/ts-morph-generator/core/GenerationContext.ts","../src/ts-morph-generator/utilities/DeclarationManager.ts","../src/ts-morph-generator/utilities/DirectoryManager.ts","../src/ts-morph-generator/utilities/ImportManager.ts","../src/ts-morph-generator/core/FileGenerator.ts","../src/ts-morph-generator/core/ReducerGenerator.ts","../src/ts-morph-generator/core/TSMorphCodeGenerator.ts"],"mappings":";;;;;;;;;iBAyCsB,qBAAA,CACpB,kBAAA,EAAoB,wBAAA,EACpB,OAA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AAA,QAkDA,gBAAA;EAAA,QAiCA,oBAAA;AAAA;;;cCxMG,oBAAA;EAAA,QAYD,OAAA;EAAA,QACA,SAAA;EAAA,QACA,WAAA;EAAA,QAbF,OAAA;EAAA,QACA,UAAA;EAAA,QACA,WAAA;EAAA,QAMA,WAAA;cAGE,OAAA,UACA,SAAA,EAAW,wBAAA,IACX,WAAA,UACR,OAAA,GAAS,oBAAA;EAAA,QAYH,eAAA;EAYF,gBAAA,CAAA,GAAoB,OAAA;EAKpB,WAAA,CAAA,GAAe,OAAA;EAAA,QAMP,gBAAA;EAAA,QAwBA,YAAA;EAAA,QAiCN,uBAAA;EAAA,QAwBM,qBAAA;AAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/codegen/generate.ts","../src/codegen/graphql.ts","../src/codegen/kysely.ts","../src/codegen/migrate.ts","../src/codegen/types.ts","../src/codegen/utils.ts","../src/create-lib/checkout-project.ts","../src/create-lib/create-project.ts","../src/ts-morph-generator/core/GenerationContext.ts","../src/ts-morph-generator/utilities/DeclarationManager.ts","../src/ts-morph-generator/utilities/DirectoryManager.ts","../src/ts-morph-generator/utilities/ImportManager.ts","../src/ts-morph-generator/core/FileGenerator.ts","../src/ts-morph-generator/core/ReducerGenerator.ts","../src/ts-morph-generator/core/TSMorphCodeGenerator.ts"],"mappings":";;;;;;;;;iBAyCsB,qBAAA,CACpB,kBAAA,EAAoB,wBAAA,EACpB,OAAA,EAAS,OAAA,GAAO,OAAA;AAAA,iBAMI,yBAAA,CAA0B,OAAA,EAAS,OAAA,GAAO,OAAA;AAAA,iBAyB1C,gBAAA,CAAiB,QAAA,UAAkB,OAAA,EAAS,OAAA,GAAO,OAAA;AAAA,KAQpE,kBAAA;EACH,UAAA;EACA,aAAA;EACA,QAAA;EACA,aAAA;AAAA;AAAA,iBAEoB,cAAA,CACpB,IAAA,EAAM,kBAAA,EACN,OAAA,EAAS,OAAA,GAAO,OAAA;AAAA,iBA8BI,kBAAA,CAAmB,OAAA,E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AMP,gBAAA;EAAA,QAwBA,YAAA;EAAA,QAiCN,uBAAA;EAAA,QAwBM,qBAAA;AAAA"}
package/dist/index.mjs CHANGED
@@ -17,7 +17,6 @@ import console$1 from "console";
17
17
  import npmFetch from "npm-registry-fetch";
18
18
  import { readPackage } from "read-pkg";
19
19
  import { updatePackage } from "write-package";
20
- import "@pnpm/find-workspace-packages";
21
20
  import chalk from "chalk";
22
21
  import fs$2 from "fs/promises";
23
22
  //#region src/codegen/utils.ts
@@ -216,7 +215,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
216
215
  "dir": "/home/runner/work/powerhouse/powerhouse/apps/academy",
217
216
  "manifest": {
218
217
  "name": "@powerhousedao/academy",
219
- "version": "6.0.0-dev.193",
218
+ "version": "6.0.0-dev.194",
220
219
  "homepage": "https://powerhouse.academy",
221
220
  "packageManager": "pnpm@10.9.0",
222
221
  "repository": {
@@ -282,7 +281,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
282
281
  "manifest": {
283
282
  "name": "@powerhousedao/connect",
284
283
  "productName": "Powerhouse-Connect",
285
- "version": "6.0.0-dev.193",
284
+ "version": "6.0.0-dev.194",
286
285
  "description": "Powerhouse Connect",
287
286
  "main": "dist/index.html",
288
287
  "type": "module",
@@ -394,7 +393,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
394
393
  "manifest": {
395
394
  "name": "@powerhousedao/switchboard",
396
395
  "type": "module",
397
- "version": "6.0.0-dev.193",
396
+ "version": "6.0.0-dev.194",
398
397
  "main": "dist/index.mjs",
399
398
  "exports": {
400
399
  ".": {
@@ -475,7 +474,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
475
474
  "dir": "/home/runner/work/powerhouse/powerhouse/clis/ph-cli",
476
475
  "manifest": {
477
476
  "name": "@powerhousedao/ph-cli",
478
- "version": "6.0.0-dev.193",
477
+ "version": "6.0.0-dev.194",
479
478
  "description": "",
480
479
  "license": "AGPL-3.0-only",
481
480
  "type": "module",
@@ -537,7 +536,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
537
536
  "dir": "/home/runner/work/powerhouse/powerhouse/clis/ph-cmd",
538
537
  "manifest": {
539
538
  "name": "ph-cmd",
540
- "version": "6.0.0-dev.193",
539
+ "version": "6.0.0-dev.194",
541
540
  "description": "",
542
541
  "license": "AGPL-3.0-only",
543
542
  "type": "module",
@@ -584,7 +583,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
584
583
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/browser",
585
584
  "manifest": {
586
585
  "name": "@powerhousedao/analytics-engine-browser",
587
- "version": "6.0.0-dev.193",
586
+ "version": "6.0.0-dev.194",
588
587
  "license": "AGPL-3.0-only",
589
588
  "repository": {
590
589
  "type": "git",
@@ -624,7 +623,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
624
623
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/core",
625
624
  "manifest": {
626
625
  "name": "@powerhousedao/analytics-engine-core",
627
- "version": "6.0.0-dev.193",
626
+ "version": "6.0.0-dev.194",
628
627
  "license": "AGPL-3.0-only",
629
628
  "repository": {
630
629
  "type": "git",
@@ -657,7 +656,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
657
656
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/graphql",
658
657
  "manifest": {
659
658
  "name": "@powerhousedao/analytics-engine-graphql",
660
- "version": "6.0.0-dev.193",
659
+ "version": "6.0.0-dev.194",
661
660
  "license": "AGPL-3.0-only",
662
661
  "repository": {
663
662
  "type": "git",
@@ -689,7 +688,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
689
688
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/knex",
690
689
  "manifest": {
691
690
  "name": "@powerhousedao/analytics-engine-knex",
692
- "version": "6.0.0-dev.193",
691
+ "version": "6.0.0-dev.194",
693
692
  "license": "AGPL-3.0-only",
694
693
  "repository": {
695
694
  "type": "git",
@@ -726,7 +725,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
726
725
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/pg",
727
726
  "manifest": {
728
727
  "name": "@powerhousedao/analytics-engine-pg",
729
- "version": "6.0.0-dev.193",
728
+ "version": "6.0.0-dev.194",
730
729
  "license": "AGPL-3.0-only",
731
730
  "repository": {
732
731
  "type": "git",
@@ -771,7 +770,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
771
770
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/builder-tools",
772
771
  "manifest": {
773
772
  "name": "@powerhousedao/builder-tools",
774
- "version": "6.0.0-dev.193",
773
+ "version": "6.0.0-dev.194",
775
774
  "type": "module",
776
775
  "license": "AGPL-3.0-only",
777
776
  "publishConfig": { "access": "public" },
@@ -811,7 +810,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
811
810
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/codegen",
812
811
  "manifest": {
813
812
  "name": "@powerhousedao/codegen",
814
- "version": "6.0.0-dev.193",
813
+ "version": "6.0.0-dev.194",
815
814
  "license": "AGPL-3.0-only",
816
815
  "private": false,
817
816
  "type": "module",
@@ -849,11 +848,8 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
849
848
  "build": "tsdown"
850
849
  },
851
850
  "dependencies": {
852
- "@graphql-codegen/add": "catalog:",
853
851
  "@graphql-codegen/cli": "catalog:",
854
852
  "@graphql-codegen/typescript": "catalog:",
855
- "@pnpm/find-workspace-dir": "^1000.1.5",
856
- "@pnpm/find-workspace-packages": "^6.0.9",
857
853
  "@powerhousedao/document-engineering": "catalog:",
858
854
  "@powerhousedao/shared": "workspace:*",
859
855
  "@types/node": "catalog:",
@@ -861,9 +857,6 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
861
857
  "chalk": "catalog:",
862
858
  "change-case": "catalog:",
863
859
  "document-model": "workspace:*",
864
- "enquirer": "catalog:",
865
- "execa": "^8.0.1",
866
- "get-tsconfig": "catalog:",
867
860
  "graphql": "catalog:",
868
861
  "graphql-codegen-typescript-validation-schema": "catalog:",
869
862
  "load-json-file": "^7.0.1",
@@ -871,15 +864,16 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
871
864
  "prettier": "catalog:",
872
865
  "read-pkg": "catalog:",
873
866
  "remeda": "^2.33.7",
874
- "semver": "catalog:",
875
867
  "ts-morph": "catalog:",
876
- "tsdown": "catalog:",
877
868
  "write-json-file": "^7.0.0",
878
869
  "write-package": "catalog:"
879
870
  },
880
871
  "devDependencies": {
872
+ "@pnpm/find-workspace-dir": "^1000.1.5",
873
+ "@pnpm/find-workspace-packages": "^6.0.9",
881
874
  "@tmpl/core": "npm:@jsr/tmpl__core@^0.6.3",
882
- "@types/npm-registry-fetch": "^8.0.9"
875
+ "@types/npm-registry-fetch": "^8.0.9",
876
+ "tsdown": "catalog:"
883
877
  }
884
878
  }
885
879
  },
@@ -887,7 +881,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
887
881
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/common",
888
882
  "manifest": {
889
883
  "name": "@powerhousedao/common",
890
- "version": "6.0.0-dev.193",
884
+ "version": "6.0.0-dev.194",
891
885
  "license": "AGPL-3.0-only",
892
886
  "type": "module",
893
887
  "files": ["/dist"],
@@ -953,7 +947,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
953
947
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/config",
954
948
  "manifest": {
955
949
  "name": "@powerhousedao/config",
956
- "version": "6.0.0-dev.193",
950
+ "version": "6.0.0-dev.194",
957
951
  "description": "",
958
952
  "license": "AGPL-3.0-only",
959
953
  "private": false,
@@ -987,7 +981,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
987
981
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/design-system",
988
982
  "manifest": {
989
983
  "name": "@powerhousedao/design-system",
990
- "version": "6.0.0-dev.193",
984
+ "version": "6.0.0-dev.194",
991
985
  "description": "",
992
986
  "files": ["dist", "theme.css"],
993
987
  "type": "module",
@@ -1131,7 +1125,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1131
1125
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/document-model",
1132
1126
  "manifest": {
1133
1127
  "name": "document-model",
1134
- "version": "6.0.0-dev.193",
1128
+ "version": "6.0.0-dev.194",
1135
1129
  "license": "AGPL-3.0-only",
1136
1130
  "private": false,
1137
1131
  "files": ["dist"],
@@ -1189,7 +1183,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1189
1183
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/opentelemetry-instrumentation-reactor",
1190
1184
  "manifest": {
1191
1185
  "name": "@powerhousedao/opentelemetry-instrumentation-reactor",
1192
- "version": "6.0.0-dev.193",
1186
+ "version": "6.0.0-dev.194",
1193
1187
  "description": "OpenTelemetry instrumentation for @powerhousedao/reactor",
1194
1188
  "type": "module",
1195
1189
  "repository": {
@@ -1225,7 +1219,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1225
1219
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/powerhouse-vetra-packages",
1226
1220
  "manifest": {
1227
1221
  "name": "@powerhousedao/powerhouse-vetra-packages",
1228
- "version": "6.0.0-dev.193",
1222
+ "version": "6.0.0-dev.194",
1229
1223
  "description": "",
1230
1224
  "keywords": [],
1231
1225
  "author": "",
@@ -1341,7 +1335,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1341
1335
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor",
1342
1336
  "manifest": {
1343
1337
  "name": "@powerhousedao/reactor",
1344
- "version": "6.0.0-dev.193",
1338
+ "version": "6.0.0-dev.194",
1345
1339
  "description": "",
1346
1340
  "repository": {
1347
1341
  "url": "https://github.com/powerhouse-inc/powerhouse",
@@ -1394,7 +1388,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1394
1388
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-api",
1395
1389
  "manifest": {
1396
1390
  "name": "@powerhousedao/reactor-api",
1397
- "version": "6.0.0-dev.193",
1391
+ "version": "6.0.0-dev.194",
1398
1392
  "description": "",
1399
1393
  "type": "module",
1400
1394
  "repository": {
@@ -1511,7 +1505,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1511
1505
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-browser",
1512
1506
  "manifest": {
1513
1507
  "name": "@powerhousedao/reactor-browser",
1514
- "version": "6.0.0-dev.193",
1508
+ "version": "6.0.0-dev.194",
1515
1509
  "license": "AGPL-3.0-only",
1516
1510
  "type": "module",
1517
1511
  "repository": {
@@ -1586,7 +1580,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1586
1580
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-hypercore",
1587
1581
  "manifest": {
1588
1582
  "name": "@powerhousedao/reactor-hypercore",
1589
- "version": "6.0.0-dev.193",
1583
+ "version": "6.0.0-dev.194",
1590
1584
  "description": "Hypercore-backed IOperationStore for the Powerhouse Reactor",
1591
1585
  "repository": {
1592
1586
  "url": "https://github.com/powerhouse-inc/powerhouse",
@@ -1627,7 +1621,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1627
1621
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-mcp",
1628
1622
  "manifest": {
1629
1623
  "name": "@powerhousedao/reactor-mcp",
1630
- "version": "6.0.0-dev.193",
1624
+ "version": "6.0.0-dev.194",
1631
1625
  "description": "MCP server for document model operations in the Powerhouse ecosystem. For document model creation tasks, consider using the document-model-creator agent which provides a more guided experience.",
1632
1626
  "type": "module",
1633
1627
  "repository": {
@@ -1682,7 +1676,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1682
1676
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/registry",
1683
1677
  "manifest": {
1684
1678
  "name": "@powerhousedao/registry",
1685
- "version": "6.0.0-dev.193",
1679
+ "version": "6.0.0-dev.194",
1686
1680
  "description": "",
1687
1681
  "type": "module",
1688
1682
  "repository": {
@@ -1725,7 +1719,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1725
1719
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/renown",
1726
1720
  "manifest": {
1727
1721
  "name": "@renown/sdk",
1728
- "version": "6.0.0-dev.193",
1722
+ "version": "6.0.0-dev.194",
1729
1723
  "description": "",
1730
1724
  "license": "AGPL-3.0-only",
1731
1725
  "private": false,
@@ -1775,7 +1769,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1775
1769
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/shared",
1776
1770
  "manifest": {
1777
1771
  "name": "@powerhousedao/shared",
1778
- "version": "6.0.0-dev.193",
1772
+ "version": "6.0.0-dev.194",
1779
1773
  "type": "module",
1780
1774
  "publishConfig": { "access": "public" },
1781
1775
  "files": ["dist"],
@@ -1882,7 +1876,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
1882
1876
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/vetra",
1883
1877
  "manifest": {
1884
1878
  "name": "@powerhousedao/vetra",
1885
- "version": "6.0.0-dev.193",
1879
+ "version": "6.0.0-dev.194",
1886
1880
  "license": "AGPL-3.0-only",
1887
1881
  "type": "module",
1888
1882
  "repository": {
@@ -2389,7 +2383,7 @@ async function migrate(version, projectDir = process.cwd()) {
2389
2383
  "dir": "/home/runner/work/powerhouse/powerhouse/apps/academy",
2390
2384
  "manifest": {
2391
2385
  "name": "@powerhousedao/academy",
2392
- "version": "6.0.0-dev.193",
2386
+ "version": "6.0.0-dev.194",
2393
2387
  "homepage": "https://powerhouse.academy",
2394
2388
  "packageManager": "pnpm@10.9.0",
2395
2389
  "repository": {
@@ -2455,7 +2449,7 @@ async function migrate(version, projectDir = process.cwd()) {
2455
2449
  "manifest": {
2456
2450
  "name": "@powerhousedao/connect",
2457
2451
  "productName": "Powerhouse-Connect",
2458
- "version": "6.0.0-dev.193",
2452
+ "version": "6.0.0-dev.194",
2459
2453
  "description": "Powerhouse Connect",
2460
2454
  "main": "dist/index.html",
2461
2455
  "type": "module",
@@ -2567,7 +2561,7 @@ async function migrate(version, projectDir = process.cwd()) {
2567
2561
  "manifest": {
2568
2562
  "name": "@powerhousedao/switchboard",
2569
2563
  "type": "module",
2570
- "version": "6.0.0-dev.193",
2564
+ "version": "6.0.0-dev.194",
2571
2565
  "main": "dist/index.mjs",
2572
2566
  "exports": {
2573
2567
  ".": {
@@ -2648,7 +2642,7 @@ async function migrate(version, projectDir = process.cwd()) {
2648
2642
  "dir": "/home/runner/work/powerhouse/powerhouse/clis/ph-cli",
2649
2643
  "manifest": {
2650
2644
  "name": "@powerhousedao/ph-cli",
2651
- "version": "6.0.0-dev.193",
2645
+ "version": "6.0.0-dev.194",
2652
2646
  "description": "",
2653
2647
  "license": "AGPL-3.0-only",
2654
2648
  "type": "module",
@@ -2710,7 +2704,7 @@ async function migrate(version, projectDir = process.cwd()) {
2710
2704
  "dir": "/home/runner/work/powerhouse/powerhouse/clis/ph-cmd",
2711
2705
  "manifest": {
2712
2706
  "name": "ph-cmd",
2713
- "version": "6.0.0-dev.193",
2707
+ "version": "6.0.0-dev.194",
2714
2708
  "description": "",
2715
2709
  "license": "AGPL-3.0-only",
2716
2710
  "type": "module",
@@ -2757,7 +2751,7 @@ async function migrate(version, projectDir = process.cwd()) {
2757
2751
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/browser",
2758
2752
  "manifest": {
2759
2753
  "name": "@powerhousedao/analytics-engine-browser",
2760
- "version": "6.0.0-dev.193",
2754
+ "version": "6.0.0-dev.194",
2761
2755
  "license": "AGPL-3.0-only",
2762
2756
  "repository": {
2763
2757
  "type": "git",
@@ -2797,7 +2791,7 @@ async function migrate(version, projectDir = process.cwd()) {
2797
2791
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/core",
2798
2792
  "manifest": {
2799
2793
  "name": "@powerhousedao/analytics-engine-core",
2800
- "version": "6.0.0-dev.193",
2794
+ "version": "6.0.0-dev.194",
2801
2795
  "license": "AGPL-3.0-only",
2802
2796
  "repository": {
2803
2797
  "type": "git",
@@ -2830,7 +2824,7 @@ async function migrate(version, projectDir = process.cwd()) {
2830
2824
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/graphql",
2831
2825
  "manifest": {
2832
2826
  "name": "@powerhousedao/analytics-engine-graphql",
2833
- "version": "6.0.0-dev.193",
2827
+ "version": "6.0.0-dev.194",
2834
2828
  "license": "AGPL-3.0-only",
2835
2829
  "repository": {
2836
2830
  "type": "git",
@@ -2862,7 +2856,7 @@ async function migrate(version, projectDir = process.cwd()) {
2862
2856
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/knex",
2863
2857
  "manifest": {
2864
2858
  "name": "@powerhousedao/analytics-engine-knex",
2865
- "version": "6.0.0-dev.193",
2859
+ "version": "6.0.0-dev.194",
2866
2860
  "license": "AGPL-3.0-only",
2867
2861
  "repository": {
2868
2862
  "type": "git",
@@ -2899,7 +2893,7 @@ async function migrate(version, projectDir = process.cwd()) {
2899
2893
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/pg",
2900
2894
  "manifest": {
2901
2895
  "name": "@powerhousedao/analytics-engine-pg",
2902
- "version": "6.0.0-dev.193",
2896
+ "version": "6.0.0-dev.194",
2903
2897
  "license": "AGPL-3.0-only",
2904
2898
  "repository": {
2905
2899
  "type": "git",
@@ -2944,7 +2938,7 @@ async function migrate(version, projectDir = process.cwd()) {
2944
2938
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/builder-tools",
2945
2939
  "manifest": {
2946
2940
  "name": "@powerhousedao/builder-tools",
2947
- "version": "6.0.0-dev.193",
2941
+ "version": "6.0.0-dev.194",
2948
2942
  "type": "module",
2949
2943
  "license": "AGPL-3.0-only",
2950
2944
  "publishConfig": { "access": "public" },
@@ -2984,7 +2978,7 @@ async function migrate(version, projectDir = process.cwd()) {
2984
2978
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/codegen",
2985
2979
  "manifest": {
2986
2980
  "name": "@powerhousedao/codegen",
2987
- "version": "6.0.0-dev.193",
2981
+ "version": "6.0.0-dev.194",
2988
2982
  "license": "AGPL-3.0-only",
2989
2983
  "private": false,
2990
2984
  "type": "module",
@@ -3022,11 +3016,8 @@ async function migrate(version, projectDir = process.cwd()) {
3022
3016
  "build": "tsdown"
3023
3017
  },
3024
3018
  "dependencies": {
3025
- "@graphql-codegen/add": "catalog:",
3026
3019
  "@graphql-codegen/cli": "catalog:",
3027
3020
  "@graphql-codegen/typescript": "catalog:",
3028
- "@pnpm/find-workspace-dir": "^1000.1.5",
3029
- "@pnpm/find-workspace-packages": "^6.0.9",
3030
3021
  "@powerhousedao/document-engineering": "catalog:",
3031
3022
  "@powerhousedao/shared": "workspace:*",
3032
3023
  "@types/node": "catalog:",
@@ -3034,9 +3025,6 @@ async function migrate(version, projectDir = process.cwd()) {
3034
3025
  "chalk": "catalog:",
3035
3026
  "change-case": "catalog:",
3036
3027
  "document-model": "workspace:*",
3037
- "enquirer": "catalog:",
3038
- "execa": "^8.0.1",
3039
- "get-tsconfig": "catalog:",
3040
3028
  "graphql": "catalog:",
3041
3029
  "graphql-codegen-typescript-validation-schema": "catalog:",
3042
3030
  "load-json-file": "^7.0.1",
@@ -3044,15 +3032,16 @@ async function migrate(version, projectDir = process.cwd()) {
3044
3032
  "prettier": "catalog:",
3045
3033
  "read-pkg": "catalog:",
3046
3034
  "remeda": "^2.33.7",
3047
- "semver": "catalog:",
3048
3035
  "ts-morph": "catalog:",
3049
- "tsdown": "catalog:",
3050
3036
  "write-json-file": "^7.0.0",
3051
3037
  "write-package": "catalog:"
3052
3038
  },
3053
3039
  "devDependencies": {
3040
+ "@pnpm/find-workspace-dir": "^1000.1.5",
3041
+ "@pnpm/find-workspace-packages": "^6.0.9",
3054
3042
  "@tmpl/core": "npm:@jsr/tmpl__core@^0.6.3",
3055
- "@types/npm-registry-fetch": "^8.0.9"
3043
+ "@types/npm-registry-fetch": "^8.0.9",
3044
+ "tsdown": "catalog:"
3056
3045
  }
3057
3046
  }
3058
3047
  },
@@ -3060,7 +3049,7 @@ async function migrate(version, projectDir = process.cwd()) {
3060
3049
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/common",
3061
3050
  "manifest": {
3062
3051
  "name": "@powerhousedao/common",
3063
- "version": "6.0.0-dev.193",
3052
+ "version": "6.0.0-dev.194",
3064
3053
  "license": "AGPL-3.0-only",
3065
3054
  "type": "module",
3066
3055
  "files": ["/dist"],
@@ -3126,7 +3115,7 @@ async function migrate(version, projectDir = process.cwd()) {
3126
3115
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/config",
3127
3116
  "manifest": {
3128
3117
  "name": "@powerhousedao/config",
3129
- "version": "6.0.0-dev.193",
3118
+ "version": "6.0.0-dev.194",
3130
3119
  "description": "",
3131
3120
  "license": "AGPL-3.0-only",
3132
3121
  "private": false,
@@ -3160,7 +3149,7 @@ async function migrate(version, projectDir = process.cwd()) {
3160
3149
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/design-system",
3161
3150
  "manifest": {
3162
3151
  "name": "@powerhousedao/design-system",
3163
- "version": "6.0.0-dev.193",
3152
+ "version": "6.0.0-dev.194",
3164
3153
  "description": "",
3165
3154
  "files": ["dist", "theme.css"],
3166
3155
  "type": "module",
@@ -3304,7 +3293,7 @@ async function migrate(version, projectDir = process.cwd()) {
3304
3293
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/document-model",
3305
3294
  "manifest": {
3306
3295
  "name": "document-model",
3307
- "version": "6.0.0-dev.193",
3296
+ "version": "6.0.0-dev.194",
3308
3297
  "license": "AGPL-3.0-only",
3309
3298
  "private": false,
3310
3299
  "files": ["dist"],
@@ -3362,7 +3351,7 @@ async function migrate(version, projectDir = process.cwd()) {
3362
3351
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/opentelemetry-instrumentation-reactor",
3363
3352
  "manifest": {
3364
3353
  "name": "@powerhousedao/opentelemetry-instrumentation-reactor",
3365
- "version": "6.0.0-dev.193",
3354
+ "version": "6.0.0-dev.194",
3366
3355
  "description": "OpenTelemetry instrumentation for @powerhousedao/reactor",
3367
3356
  "type": "module",
3368
3357
  "repository": {
@@ -3398,7 +3387,7 @@ async function migrate(version, projectDir = process.cwd()) {
3398
3387
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/powerhouse-vetra-packages",
3399
3388
  "manifest": {
3400
3389
  "name": "@powerhousedao/powerhouse-vetra-packages",
3401
- "version": "6.0.0-dev.193",
3390
+ "version": "6.0.0-dev.194",
3402
3391
  "description": "",
3403
3392
  "keywords": [],
3404
3393
  "author": "",
@@ -3514,7 +3503,7 @@ async function migrate(version, projectDir = process.cwd()) {
3514
3503
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor",
3515
3504
  "manifest": {
3516
3505
  "name": "@powerhousedao/reactor",
3517
- "version": "6.0.0-dev.193",
3506
+ "version": "6.0.0-dev.194",
3518
3507
  "description": "",
3519
3508
  "repository": {
3520
3509
  "url": "https://github.com/powerhouse-inc/powerhouse",
@@ -3567,7 +3556,7 @@ async function migrate(version, projectDir = process.cwd()) {
3567
3556
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-api",
3568
3557
  "manifest": {
3569
3558
  "name": "@powerhousedao/reactor-api",
3570
- "version": "6.0.0-dev.193",
3559
+ "version": "6.0.0-dev.194",
3571
3560
  "description": "",
3572
3561
  "type": "module",
3573
3562
  "repository": {
@@ -3684,7 +3673,7 @@ async function migrate(version, projectDir = process.cwd()) {
3684
3673
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-browser",
3685
3674
  "manifest": {
3686
3675
  "name": "@powerhousedao/reactor-browser",
3687
- "version": "6.0.0-dev.193",
3676
+ "version": "6.0.0-dev.194",
3688
3677
  "license": "AGPL-3.0-only",
3689
3678
  "type": "module",
3690
3679
  "repository": {
@@ -3759,7 +3748,7 @@ async function migrate(version, projectDir = process.cwd()) {
3759
3748
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-hypercore",
3760
3749
  "manifest": {
3761
3750
  "name": "@powerhousedao/reactor-hypercore",
3762
- "version": "6.0.0-dev.193",
3751
+ "version": "6.0.0-dev.194",
3763
3752
  "description": "Hypercore-backed IOperationStore for the Powerhouse Reactor",
3764
3753
  "repository": {
3765
3754
  "url": "https://github.com/powerhouse-inc/powerhouse",
@@ -3800,7 +3789,7 @@ async function migrate(version, projectDir = process.cwd()) {
3800
3789
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-mcp",
3801
3790
  "manifest": {
3802
3791
  "name": "@powerhousedao/reactor-mcp",
3803
- "version": "6.0.0-dev.193",
3792
+ "version": "6.0.0-dev.194",
3804
3793
  "description": "MCP server for document model operations in the Powerhouse ecosystem. For document model creation tasks, consider using the document-model-creator agent which provides a more guided experience.",
3805
3794
  "type": "module",
3806
3795
  "repository": {
@@ -3855,7 +3844,7 @@ async function migrate(version, projectDir = process.cwd()) {
3855
3844
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/registry",
3856
3845
  "manifest": {
3857
3846
  "name": "@powerhousedao/registry",
3858
- "version": "6.0.0-dev.193",
3847
+ "version": "6.0.0-dev.194",
3859
3848
  "description": "",
3860
3849
  "type": "module",
3861
3850
  "repository": {
@@ -3898,7 +3887,7 @@ async function migrate(version, projectDir = process.cwd()) {
3898
3887
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/renown",
3899
3888
  "manifest": {
3900
3889
  "name": "@renown/sdk",
3901
- "version": "6.0.0-dev.193",
3890
+ "version": "6.0.0-dev.194",
3902
3891
  "description": "",
3903
3892
  "license": "AGPL-3.0-only",
3904
3893
  "private": false,
@@ -3948,7 +3937,7 @@ async function migrate(version, projectDir = process.cwd()) {
3948
3937
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/shared",
3949
3938
  "manifest": {
3950
3939
  "name": "@powerhousedao/shared",
3951
- "version": "6.0.0-dev.193",
3940
+ "version": "6.0.0-dev.194",
3952
3941
  "type": "module",
3953
3942
  "publishConfig": { "access": "public" },
3954
3943
  "files": ["dist"],
@@ -4055,7 +4044,7 @@ async function migrate(version, projectDir = process.cwd()) {
4055
4044
  "dir": "/home/runner/work/powerhouse/powerhouse/packages/vetra",
4056
4045
  "manifest": {
4057
4046
  "name": "@powerhousedao/vetra",
4058
- "version": "6.0.0-dev.193",
4047
+ "version": "6.0.0-dev.194",
4059
4048
  "license": "AGPL-3.0-only",
4060
4049
  "type": "module",
4061
4050
  "repository": {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["readdirSync","join","statSync","join","path","fs","fs"],"sources":["../src/codegen/utils.ts","../src/codegen/generate.ts","../src/codegen/kysely.ts","../src/codegen/migrate.ts","../src/create-lib/checkout-project.ts","../src/create-lib/create-project.ts","../src/ts-morph-generator/core/FileGenerator.ts","../src/ts-morph-generator/core/ReducerGenerator.ts","../src/ts-morph-generator/utilities/DeclarationManager.ts","../src/ts-morph-generator/utilities/DirectoryManager.ts","../src/ts-morph-generator/utilities/ImportManager.ts","../src/ts-morph-generator/core/TSMorphCodeGenerator.ts"],"sourcesContent":["import type {\n DocumentModelDocument,\n DocumentModelGlobalState,\n} from \"@powerhousedao/shared/document-model\";\nimport { documentModelReducer } from \"@powerhousedao/shared/document-model\";\nimport { baseLoadFromFile } from \"document-model/node\";\nimport { readFile } from \"node:fs/promises\";\n\nexport async function loadDocumentModel(\n path: string,\n): Promise<DocumentModelGlobalState> {\n let documentModel: DocumentModelGlobalState;\n try {\n if (!path) {\n throw new Error(\"Document model file not specified\");\n } else if (path.endsWith(\".zip\") || path.endsWith(\".phd\")) {\n const file = await baseLoadFromFile(path, documentModelReducer);\n documentModel = file.state.global;\n } else if (path.endsWith(\".json\")) {\n const data = await readFile(path, \"utf-8\");\n const parsedData = JSON.parse(data) as DocumentModelDocument;\n if (\"state\" in parsedData) {\n documentModel = parsedData.state.global;\n } else {\n documentModel = parsedData;\n }\n } else {\n throw new Error(\"File type not supported. Must be zip, phd, or json.\");\n }\n return documentModel;\n } catch (error) {\n throw (error as { code?: string }).code === \"MODULE_NOT_FOUND\"\n ? new Error(`Document model not found.`)\n : error;\n }\n}\n","import {\n DocumentModelGlobalStateSchema,\n type DocumentModelGlobalState,\n} from \"@powerhousedao/shared/document-model\";\nimport type {\n ProcessorApp,\n ProcessorApps,\n} from \"@powerhousedao/shared/processors\";\nimport { kebabCase } from \"change-case\";\nimport {\n tsMorphGenerateApp,\n tsMorphGenerateDocumentEditor,\n tsMorphGenerateDocumentModel,\n tsMorphGenerateProcessor,\n tsMorphGenerateSubgraph,\n} from \"file-builders\";\nimport { loadJsonFileSync } from \"load-json-file\";\nimport { readdirSync, statSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport {\n conditional,\n filter,\n find,\n flatMap,\n isDefined,\n isEmpty,\n isIncludedIn,\n isString,\n isTruthy,\n map,\n pipe,\n split,\n startsWith,\n unique,\n when,\n} from \"remeda\";\nimport type { Project } from \"ts-morph\";\nimport { SyntaxKind } from \"ts-morph\";\nimport { getObjectProperty, getOrCreateDirectory } from \"utils\";\nimport { loadDocumentModel } from \"./utils.js\";\n\nexport async function generateDocumentModel(\n documentModelState: DocumentModelGlobalState,\n project: Project,\n) {\n await tsMorphGenerateDocumentModel(documentModelState, project);\n}\n\n/* Runs generate for each document model json file found in the project's `document-models` directory */\nexport async function generateAllDocumentModels(project: Project) {\n const { directory: documentModelsDir } = getOrCreateDirectory(\n project,\n \"document-models\",\n );\n const documentModelsDirPath = documentModelsDir.getPath();\n const documentModelStateFiles = pipe(\n readdirSync(documentModelsDirPath, { withFileTypes: true }),\n filter((dirent) => dirent.isDirectory()),\n map((dir) => join(dir.parentPath, `${dir.name}/${dir.name}.json`)),\n filter(\n (srcPath) =>\n statSync(srcPath, { throwIfNoEntry: false })?.isFile() ?? false,\n ),\n map((srcPath) => loadJsonFileSync(srcPath)),\n filter(\n (stateFile): stateFile is DocumentModelGlobalState =>\n DocumentModelGlobalStateSchema().safeParse(stateFile).success === true,\n ),\n );\n\n for (const documentModelState of documentModelStateFiles) {\n await generateDocumentModel(documentModelState, project);\n }\n}\nexport async function generateFromFile(filePath: string, project: Project) {\n // load document model spec from file\n const documentModelState = await loadDocumentModel(filePath);\n\n // delegate to shared generation function\n await generateDocumentModel(documentModelState, project);\n}\n\ntype GenerateEditorArgs = {\n editorName: string;\n documentTypes: string[];\n editorId?: string;\n editorDirName?: string;\n};\nexport async function generateEditor(\n args: GenerateEditorArgs,\n project: Project,\n) {\n const {\n editorName,\n documentTypes,\n editorId: editorIdArg,\n editorDirName,\n } = args;\n\n if (documentTypes.length > 1) {\n throw new Error(\"Multiple document types are not supported yet\");\n }\n\n const documentModelId = documentTypes[0];\n const editorId = editorIdArg || kebabCase(editorName);\n const editorDir = editorDirName || kebabCase(editorName);\n\n await tsMorphGenerateDocumentEditor({\n project,\n editorDir,\n documentModelId,\n editorName,\n editorId,\n });\n}\n\n/* Runs generate for all editors found in the project's `editors` directory.\n * Note: we intentionally filter out editors with the document type \"powerhouse/document-drive\".\n * These are handled separately by the `generateAllApps` function.\n */\nexport async function generateAllEditors(project: Project) {\n const { directory: editorsDir } = getOrCreateDirectory(project, \"editors\");\n const editorDirs = editorsDir.getDirectories();\n\n /* An editor's `id`, `name`, and `documentTypes` args can be found in the `module.ts` file */\n const editorsToAdd = pipe(\n editorDirs,\n map((dir) => dir.getSourceFile(\"module.ts\")),\n filter(isTruthy),\n map((sourceFile) =>\n sourceFile.getDescendantsOfKind(SyntaxKind.PropertyAssignment),\n ),\n map((propertyAssignments) => ({\n id: find(\n propertyAssignments,\n (propertyAssignment) => propertyAssignment.getName() === \"id\",\n ),\n name: find(\n propertyAssignments,\n (propertyAssignment) => propertyAssignment.getName() === \"name\",\n ),\n documentTypes: find(\n propertyAssignments,\n (propertyAssignment) =>\n propertyAssignment.getName() === \"documentTypes\",\n ),\n })),\n map(({ id, name, documentTypes }) => ({\n editorDirName: id?.getSourceFile().getDirectory().getBaseName(),\n editorId: id\n ?.getFirstDescendantByKind(SyntaxKind.StringLiteral)\n ?.getLiteralValue(),\n editorName: name\n ?.getFirstDescendantByKind(SyntaxKind.StringLiteral)\n ?.getLiteralValue(),\n documentTypes: pipe(\n documentTypes\n ?.getFirstDescendantByKind(SyntaxKind.ArrayLiteralExpression)\n ?.getElements() ?? [],\n map((element) =>\n element.asKind(SyntaxKind.StringLiteral)?.getLiteralValue(),\n ),\n filter(isString),\n ),\n })),\n filter(\n ({ documentTypes }) =>\n !documentTypes.includes(\"powerhouse/document-drive\"),\n ),\n );\n\n for (const editorToAdd of editorsToAdd) {\n if (editorToAdd.editorDirName === undefined) return;\n await generateEditor(editorToAdd as GenerateEditorArgs, project);\n }\n}\n\ntype GenerateAppArgs = {\n appName: string;\n appId?: string;\n allowedDocumentTypes?: string[];\n isDragAndDropEnabled?: boolean;\n appDirName?: string;\n};\nexport async function generateApp(args: GenerateAppArgs, project: Project) {\n const {\n appName,\n appId,\n allowedDocumentTypes,\n isDragAndDropEnabled,\n appDirName,\n } = args;\n\n await tsMorphGenerateApp({\n project,\n editorDir: appDirName || kebabCase(appName),\n editorName: appName,\n editorId: appId ?? kebabCase(appName),\n allowedDocumentModelIds: allowedDocumentTypes ?? [],\n isDragAndDropEnabled: isDragAndDropEnabled ?? true,\n });\n}\n\n/* Runs generate for all apps found in the project's `editors` directory.\n * Note: we intentionally filter out editors which do not have the document type \"powerhouse/document-drive\".\n * These are handled separately by the `generateAllEditors` function.\n */\nexport async function generateAllApps(project: Project) {\n const { directory: editorsDir } = getOrCreateDirectory(project, \"editors\");\n const editorDirs = editorsDir.getDirectories();\n\n /* An editor's `id`, `name`, and `documentTypes` args can be found in the `module.ts` file */\n const appsToAdd = pipe(\n editorDirs,\n map((dir) => dir.getSourceFile(\"module.ts\")),\n filter(isTruthy),\n map((sourceFile) =>\n sourceFile.getDescendantsOfKind(SyntaxKind.PropertyAssignment),\n ),\n map((propertyAssignments) => ({\n id: find(\n propertyAssignments,\n (propertyAssignment) => propertyAssignment.getName() === \"id\",\n ),\n name: find(\n propertyAssignments,\n (propertyAssignment) => propertyAssignment.getName() === \"name\",\n ),\n documentTypes: find(\n propertyAssignments,\n (propertyAssignment) =>\n propertyAssignment.getName() === \"documentTypes\",\n ),\n })),\n map(({ id, name, documentTypes }) => ({\n appDir: id?.getSourceFile().getDirectory(),\n appId: id\n ?.getFirstDescendantByKind(SyntaxKind.StringLiteral)\n ?.getLiteralValue(),\n appName: name\n ?.getFirstDescendantByKind(SyntaxKind.StringLiteral)\n ?.getLiteralValue(),\n documentTypes: pipe(\n documentTypes\n ?.getFirstDescendantByKind(SyntaxKind.ArrayLiteralExpression)\n ?.getElements() ?? [],\n map((element) =>\n element.asKind(SyntaxKind.StringLiteral)?.getLiteralValue(),\n ),\n filter(isString),\n ),\n })),\n filter(({ documentTypes }) =>\n documentTypes.includes(\"powerhouse/document-drive\"),\n ),\n /* The `allowedDocumentTypes` and `isDragAndDropEnabled` args can only be found in the `config.ts` file */\n map(({ appDir, ...rest }) => ({\n appDirName: appDir?.getBaseName(),\n configFilePropertyAssignments:\n appDir\n ?.getSourceFile(\"config.ts\")\n ?.getDescendantsOfKind(SyntaxKind.PropertyAssignment) ?? [],\n ...rest,\n })),\n map(({ configFilePropertyAssignments, ...rest }) => ({\n isDragAndDropEnabled: find(\n configFilePropertyAssignments,\n (propertyAssignment) =>\n propertyAssignment.getName() === \"isDragAndDropEnabled\",\n ),\n allowedDocumentTypes: find(\n configFilePropertyAssignments,\n (propertyAssignment) =>\n propertyAssignment.getName() === \"allowedDocumentTypes\",\n ),\n ...rest,\n })),\n map(({ isDragAndDropEnabled, allowedDocumentTypes, ...rest }) => ({\n isDragAndDropEnabled: when(\n isDragAndDropEnabled?.getDescendants() ?? [],\n (descendants) =>\n isDefined(\n find(descendants, (d) => d.getKind() === SyntaxKind.TrueKeyword),\n ),\n {\n onTrue: () => true,\n onFalse: () => false,\n },\n ),\n allowedDocumentTypes: pipe(\n allowedDocumentTypes\n ?.getFirstDescendantByKind(SyntaxKind.ArrayLiteralExpression)\n ?.getElements() ?? [],\n map((element) =>\n element.asKind(SyntaxKind.StringLiteral)?.getLiteralValue(),\n ),\n filter(isString),\n ),\n ...rest,\n })),\n );\n\n for (const appToAdd of appsToAdd) {\n if (appToAdd.appName === undefined) return;\n\n await generateApp(appToAdd as GenerateAppArgs, project);\n }\n}\nexport async function generateSubgraph(subgraphName: string, project: Project) {\n await tsMorphGenerateSubgraph({ subgraphName, project });\n}\n\n/* Runs generate for each directory found in the project's `subgraphs` directory */\nexport async function generateAllSubgraphs(project: Project) {\n const { directory: subgraphsDir } = getOrCreateDirectory(\n project,\n \"subgraphs\",\n );\n /* The subgraph's name is found in the `index.ts` file */\n const subgraphNames = pipe(\n subgraphsDir.getDirectories(),\n map((dir) => dir.getSourceFile(\"index.ts\")),\n flatMap((indexFile) => indexFile?.getClasses() ?? []),\n filter(\n (classDeclaration) =>\n classDeclaration.getBaseClass()?.getText().includes(\"BaseSubgraph\") ??\n false,\n ),\n map((classDeclaration) =>\n classDeclaration\n .getInstanceProperty(\"name\")\n ?.asKind(SyntaxKind.PropertyDeclaration)\n ?.getInitializerIfKind(SyntaxKind.StringLiteral)\n ?.getLiteralValue(),\n ),\n filter(isString),\n unique(),\n );\n for (const subgraphName of subgraphNames) {\n await generateSubgraph(subgraphName, project);\n }\n}\n\nexport async function generateProcessor(\n args: {\n processorName: string;\n processorType: \"analytics\" | \"relationalDb\";\n processorApps: ProcessorApps;\n documentTypes: string[];\n },\n project: Project,\n) {\n return await tsMorphGenerateProcessor({\n project,\n ...args,\n });\n}\n\n/* Runs generate for each directory found in the project's `processors` directory */\nexport async function generateAllProcessors(project: Project) {\n const { directory: processorsDir } = getOrCreateDirectory(\n project,\n \"processors\",\n );\n const connectProcessorNames = pipe(\n processorsDir.getSourceFile(\"connect.ts\"),\n (sourceFile) => sourceFile?.getImportDeclarations() ?? [],\n flatMap((importDeclaration) =>\n importDeclaration.getModuleSpecifier().getLiteralValue(),\n ),\n filter(startsWith(\"processors/\")),\n map(split(\"/\")),\n map((s) => s.at(1)),\n filter(isString),\n );\n const switchboardProcessorNames = pipe(\n processorsDir.getSourceFile(\"switchboard.ts\"),\n (sourceFile) => sourceFile?.getImportDeclarations() ?? [],\n flatMap((importDeclaration) =>\n importDeclaration.getModuleSpecifier().getLiteralValue(),\n ),\n filter(startsWith(\"processors/\")),\n map(split(\"/\")),\n map((s) => s.at(1)),\n filter(isString),\n );\n const processorsToGenerate = pipe(\n processorsDir.getDirectories(),\n map((dir) => ({\n dir,\n processorName: dir.getBaseName(),\n })),\n map(({ dir, processorName }) => ({\n processorName,\n /* We can try to determine which processors are for `connect` and for `switchboard`.\n * If we cannot, we fallback to including them in both. */\n processorApps: pipe(\n [],\n when(\n () => isIncludedIn(processorName, connectProcessorNames),\n (processorApps) => [...processorApps, \"connect\"],\n ),\n when(\n () => isIncludedIn(processorName, switchboardProcessorNames),\n (processorApps) => [...processorApps, \"switchboard\"],\n ),\n when(\n (processorApps) => isEmpty(processorApps),\n () => [\"connect\", \"switchboard\"],\n ),\n ),\n processorType: pipe(\n // handle the old `index.ts` file name if `processor.ts` has not been generated\n dir.getSourceFile(\"processor.ts\") ?? dir.getSourceFile(\"index.ts\"),\n (sourceFile) => sourceFile?.getImportDeclarations() ?? [],\n flatMap((importDeclaration) => importDeclaration.getNamedImports()),\n map((importSpecifier) => importSpecifier.getText()),\n // we have to check what type is imported to determine whether the processor is `relationalDb` or `analytics`\n conditional(\n [\n (specifiers) =>\n isDefined(\n find(specifiers, (specifier) =>\n specifier.includes(\"RelationalDbProcessor\"),\n ),\n ),\n () => \"relationalDb\",\n ],\n [\n (specifiers) =>\n isDefined(\n find(specifiers, (specifier) =>\n specifier.includes(\"IAnalyticsStore\"),\n ),\n ),\n () => \"analytics\",\n ],\n ),\n ),\n documentTypes: pipe(\n dir.getSourceFile(\"factory.ts\"),\n (sourceFile) =>\n sourceFile?.getDescendantsOfKind(\n SyntaxKind.ObjectLiteralExpression,\n ) ?? [],\n map((objectLiteralExpression) =>\n getObjectProperty(\n objectLiteralExpression,\n \"documentType\",\n SyntaxKind.ArrayLiteralExpression,\n ),\n ),\n flatMap((o) => o?.getElements()),\n map((e) => e?.asKind(SyntaxKind.StringLiteral)),\n filter(isTruthy),\n map((e) => e.getLiteralValue()),\n ),\n })),\n );\n\n for (const {\n processorName,\n processorApps,\n processorType,\n documentTypes,\n } of processorsToGenerate) {\n await generateProcessor(\n {\n processorName,\n processorApps: processorApps as ProcessorApp[],\n processorType: processorType as \"analytics\" | \"relationalDb\",\n documentTypes,\n },\n project,\n );\n }\n}\n\n/* Runs each module type's generateAll{moduleType} function for the current project */\nexport async function generateAll(project: Project) {\n await generateAllDocumentModels(project);\n await generateAllEditors(project);\n await generateAllApps(project);\n await generateAllSubgraphs(project);\n await generateAllProcessors(project);\n}\n","import { spawn } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { join, resolve } from \"node:path\";\n\nfunction getKyselyPgLiteBin(): string {\n const require = createRequire(import.meta.url);\n\n const paths = require.resolve.paths(\"kysely-pglite\");\n if (paths) {\n for (const basePath of paths) {\n const pkgRoot = join(basePath, \"kysely-pglite\");\n const binPath = join(pkgRoot, \"bin/run.js\");\n\n if (existsSync(binPath)) {\n return binPath;\n }\n }\n }\n\n throw new Error(\"Could not find kysely-pglite/bin/run.js\");\n}\n\nexport interface IOptions {\n migrationFile: string;\n schemaFile?: string;\n}\n\nfunction runCommand(\n command: string,\n args: string[],\n cwd?: string,\n): Promise<void> {\n return new Promise((resolve, reject) => {\n const child = spawn(command, args, {\n cwd,\n stdio: \"inherit\",\n shell: true,\n });\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve();\n } else {\n reject(new Error(`Command failed with exit code ${code}`));\n }\n });\n\n child.on(\"error\", (error) => {\n reject(error);\n });\n });\n}\n\nexport async function generateDBSchema({\n migrationFile,\n schemaFile,\n}: IOptions) {\n const outFile = schemaFile ?? resolve(migrationFile, \"../schema.ts\");\n\n try {\n const kyselyBinPath = getKyselyPgLiteBin();\n // Use kysely-pglite CLI to handle TypeScript compilation and module resolution\n await runCommand(\n \"node\",\n [kyselyBinPath, migrationFile, \"--outFile\", outFile],\n process.cwd(),\n );\n\n console.log(`Schema types generated at ${outFile}`);\n } catch (error) {\n console.error(\"Error running migration:\", error);\n }\n}\n","import {\n VERSIONED_DEPENDENCIES,\n VERSIONED_DEV_DEPENDENCIES,\n} from \"@powerhousedao/shared/clis\";\nimport console from \"console\";\nimport {\n externalDependencies,\n externalDevDependencies,\n makePackageJsonExports,\n packageScripts,\n writeAllGeneratedProjectFiles,\n} from \"file-builders\";\nimport { cpSync, mkdirSync, readdirSync, rmSync, statSync } from \"fs\";\nimport npmFetch from \"npm-registry-fetch\";\nimport { join } from \"path\";\nimport { readPackage } from \"read-pkg\";\nimport {\n filter,\n fromKeys,\n isTruthy,\n keys,\n map,\n mapValues,\n merge,\n omit,\n pipe,\n prop,\n} from \"remeda\";\nimport type { Project } from \"ts-morph\";\nimport { buildTsMorphProject } from \"utils\";\nimport { updatePackage } from \"write-package\";\nimport { generateAll } from \"./generate.js\";\n\n/* Uses the npm cli's fetch function to get the version for a specified tag */\nexport async function getFullyQualifiedWorkspacePackageVersion(\n versionOrTag: string,\n) {\n const isTag =\n versionOrTag === \"latest\" ||\n versionOrTag === \"staging\" ||\n versionOrTag === \"dev\";\n\n if (!isTag) return versionOrTag;\n const result = (await npmFetch.json(\n `${WORKSPACE_PACKAGES[0].manifest.name!}`,\n )) as { \"dist-tags\": Record<\"latest\" | \"staging\" | \"dev\", string> };\n return result[\"dist-tags\"][versionOrTag];\n}\n\nexport function fixLegacyImportPaths(\n project: Project,\n packageName: string | undefined,\n) {\n if (!packageName) {\n console.error(\"No package name found in package.json.\");\n return;\n }\n const sourceFiles = project.getSourceFiles();\n for (const sourceFile of sourceFiles) {\n const importStatements = sourceFile.getImportDeclarations();\n for (const importStatement of importStatements) {\n const namedImports = map(\n importStatement.getNamedImports(),\n (importSpecifier) => importSpecifier.getText(),\n );\n const moduleSpecifier = importStatement.getModuleSpecifier();\n const moduleSpecifierText = moduleSpecifier.getLiteralText();\n // remove usage of the old `package-name/` style paths\n if (moduleSpecifierText.includes(packageName)) {\n moduleSpecifier.setLiteralValue(\n moduleSpecifierText.replace(`${packageName}/`, \"\"),\n );\n }\n // I saw this invalid import enough that it seemed worthwhile to fix it here\n if (namedImports.includes(\"generateMock\")) {\n moduleSpecifier.setLiteralValue(\"document-model\");\n }\n // attempt to fix absolute import paths for document models like `../../../document-models/model/something/something.js`\n // these don't work anymore with the versioned document models, since the absolute file paths are different\n const match = moduleSpecifierText.match(\n /^(\\.\\.\\/)+document-models\\/([^/]+)(?!\\/v\\d+(?:\\/|$))(?:\\/.*)?$/,\n );\n\n if (match) {\n moduleSpecifier.setLiteralValue(`document-models/${match[2]}`);\n }\n }\n }\n}\n\nexport async function migrate(version: string, projectDir = process.cwd()) {\n const fullyQualifiedVersion =\n await getFullyQualifiedWorkspacePackageVersion(version);\n\n const packageJson = await readPackage({ cwd: projectDir });\n const exports = makePackageJsonExports();\n const scripts = merge(packageJson.scripts, packageScripts);\n const workspacePackageNames = filter(\n map(WORKSPACE_PACKAGES, prop(\"manifest\", \"name\")),\n isTruthy,\n );\n const projectDependencyNames = [\n ...VERSIONED_DEPENDENCIES,\n ...keys(externalDependencies),\n ];\n const projectDevDependencyNames = [\n ...VERSIONED_DEV_DEPENDENCIES,\n ...keys(externalDevDependencies),\n ];\n const dependencies = pipe(\n packageJson.dependencies ?? {},\n // remove dev dependencies if they are in here\n omit(projectDevDependencyNames),\n merge({\n // use the fully qualified version we just got for these\n ...fromKeys(VERSIONED_DEPENDENCIES, () => fullyQualifiedVersion),\n // use the versions defined for the other deps we need to control\n ...externalDependencies,\n }),\n // use the fully qualified version for other workspace deps the user may have added\n mapValues((value, key) =>\n workspacePackageNames.includes(key) ? fullyQualifiedVersion : value,\n ),\n );\n const devDependencies = pipe(\n packageJson.devDependencies ?? {},\n omit(projectDependencyNames),\n merge({\n ...fromKeys(VERSIONED_DEV_DEPENDENCIES, () => fullyQualifiedVersion),\n ...externalDevDependencies,\n }),\n mapValues((value, key) =>\n workspacePackageNames.includes(key) ? fullyQualifiedVersion : value,\n ),\n );\n console.log(\"Updating package.json...\");\n await updatePackage(projectDir, {\n exports,\n scripts,\n dependencies,\n devDependencies,\n });\n\n console.log(\"Overwriting project root files...\");\n await writeAllGeneratedProjectFiles(projectDir);\n console.log(\"Moving unversioned document models...\");\n moveLegacyDocumentModels(projectDir);\n const project = buildTsMorphProject(projectDir);\n console.log(\"Fixing legacy import paths...\");\n fixLegacyImportPaths(project, packageJson.name);\n console.log(\"Re-generating code...\");\n await generateAll(project);\n await project.save();\n}\n\nfunction moveLegacyDocumentModels(projectDir: string) {\n const fileNamesToDelete = [\n \"actions.ts\",\n \"hooks.ts\",\n \"module.ts\",\n \"index.ts\",\n \"utils.ts\",\n \"schema.graphql\",\n ];\n const dirNamesToCopy = [\"src\", \"gen\"];\n const dirs = pipe(\n readdirSync(join(projectDir, \"document-models\"), { withFileTypes: true }),\n filter((entry) => entry.isDirectory()),\n filter(\n (dir) =>\n statSync(join(dir.parentPath, dir.name, `${dir.name}.json`), {\n throwIfNoEntry: false,\n })?.isFile() ?? false,\n ),\n map((dir) => join(dir.parentPath, dir.name)),\n );\n\n for (const dirPath of dirs) {\n for (const name of fileNamesToDelete) {\n const filePath = join(dirPath, name);\n rmSync(filePath, { force: true });\n }\n const versionDirPath = join(dirPath, \"v1\");\n const versionDirExists =\n statSync(versionDirPath, { throwIfNoEntry: false })?.isDirectory() ??\n false;\n if (!versionDirExists) {\n mkdirSync(versionDirPath);\n }\n for (const dirName of dirNamesToCopy) {\n const srcDirPath = join(dirPath, dirName);\n const srcDirExists =\n statSync(srcDirPath, { throwIfNoEntry: false })?.isDirectory() ?? false;\n if (!srcDirExists) continue;\n const destDirPath = join(versionDirPath, dirName);\n cpSync(srcDirPath, destDirPath, {\n recursive: true,\n force: false,\n errorOnExist: false,\n });\n rmSync(srcDirPath, {\n force: true,\n recursive: true,\n });\n }\n }\n}\n","import path from \"node:path\";\nimport { runCmd } from \"@powerhousedao/shared/clis\";\n/**\n * Clones a git repository and returns the path to the cloned project.\n * @param repositoryUrl - The URL of the git repository to clone\n * @returns The absolute path to the cloned project directory\n */\nexport function cloneRepository(repositoryUrl: string): string {\n try {\n console.log(\n \"\\x1b[33m\",\n `Cloning repository from ${repositoryUrl}...`,\n \"\\x1b[0m\",\n );\n runCmd(`git clone ${repositoryUrl}`);\n\n // Extract project name from repository URL\n // e.g., https://github.com/org/repo.git -> repo\n const repoName = repositoryUrl\n .split(\"/\")\n .pop()\n ?.replace(/\\.git$/, \"\");\n\n if (!repoName) {\n throw new Error(\"Could not determine project name from repository URL\");\n }\n\n const projectPath = path.join(process.cwd(), repoName);\n return projectPath;\n } catch (error) {\n console.log(error);\n throw error;\n }\n}\n\n/**\n * Installs dependencies in a project directory using the specified package manager.\n * @param projectPath - The absolute path to the project directory\n * @param packageManager - The package manager to use (npm, pnpm, yarn, bun)\n */\nexport function installDependencies(\n projectPath: string,\n packageManager: string,\n): void {\n try {\n process.chdir(projectPath);\n\n console.log(\n \"\\x1b[34m\",\n `Installing dependencies with ${packageManager}...`,\n \"\\x1b[0m\",\n );\n runCmd(`${packageManager} install --loglevel error`);\n\n console.log(\"\\x1b[32m\", \"Dependencies installed successfully!\", \"\\x1b[0m\");\n console.log();\n } catch (error) {\n console.log(error);\n throw error;\n }\n}\n","import { runCmd, writeFileEnsuringDir } from \"@powerhousedao/shared/clis\";\nimport chalk from \"chalk\";\nimport fs from \"node:fs\";\nimport path from \"path\";\nimport { gitIgnoreTemplate } from \"templates\";\nimport { runPrettier } from \"utils\";\nimport {\n writeAllGeneratedProjectFiles,\n writeProjectRootFiles,\n} from \"file-builders\";\ntype CreateProjectArgs = {\n name: string;\n packageManager: string;\n tag?: string;\n version?: string;\n remoteDrive?: string;\n skipGitInit?: boolean;\n skipInstall?: boolean;\n};\nexport async function createProject({\n name,\n packageManager,\n tag,\n version,\n remoteDrive,\n skipGitInit,\n skipInstall,\n}: CreateProjectArgs) {\n const appPath = path.join(process.cwd(), name);\n\n try {\n fs.mkdirSync(appPath);\n } catch (err) {\n if ((err as { code: string }).code === \"EEXIST\") {\n console.error(\n `⛔ The folder \"${name}\" already exists in the current directory, please give it another name.`,\n );\n } else {\n console.error(err);\n }\n process.exit(1);\n }\n\n try {\n // Create a new directory for the project\n console.log(chalk.blue(`▶️ Creating directory for project \"${name}\"...\\n`));\n const appPath = path.join(process.cwd(), name);\n process.chdir(appPath);\n console.log(chalk.green(`✅ Project directory created\\n`));\n\n await writeFileEnsuringDir(\".gitignore\", gitIgnoreTemplate);\n if (!skipGitInit) {\n // Create a .gitignore file, then initialize the git repository\n console.log(chalk.blue(`▶️ Initializing git repository...\\n`));\n runCmd(`git init`);\n console.log(chalk.green(`\\n✅ Git repository initialized\\n`));\n }\n\n // Write the boilerplate files for the project\n console.log(chalk.blue(`▶️ Creating project boilerplate files...\\n`));\n await writeProjectRootFiles({ name, tag, version, remoteDrive });\n await writeAllGeneratedProjectFiles();\n console.log(chalk.green(`✅ Project boilerplate files created\\n`));\n\n if (!skipInstall) {\n // Install the project dependencies with the specified package manager\n console.log(\n chalk.blue(\n `▶️ Installing project dependencies with ${packageManager}...\\n`,\n ),\n );\n runCmd(`${packageManager} install`);\n console.log(chalk.green(`\\n✅ Project dependencies installed\\n`));\n }\n\n // Use the installed version of `prettier` to format the generated code\n console.log(chalk.blue(`▶️ Formatting boilerplate project files...\\n`));\n await runPrettier();\n console.log(chalk.green(`✅ Boilerplate files formatted\\n`));\n\n // Project creation complete\n console.log(chalk.bold(`🎉 Successfully created project \"${name}\" 🎉\\n`));\n } catch (error) {\n console.error(error);\n process.exit(1);\n }\n}\n","import type { DeclarationManager } from \"../utilities/DeclarationManager.js\";\nimport type { DirectoryManager } from \"../utilities/DirectoryManager.js\";\nimport type { ImportManager } from \"../utilities/ImportManager.js\";\nimport type { GenerationContext } from \"./GenerationContext.js\";\n\nexport abstract class FileGenerator {\n constructor(\n protected importManager: ImportManager,\n protected directoryManager: DirectoryManager,\n protected declarationManager: DeclarationManager,\n ) {}\n\n abstract generate(context: GenerationContext): Promise<void>;\n}\n","import { camelCase, kebabCase, pascalCase } from \"change-case\";\nimport type { OperationErrorSpecification } from \"@powerhousedao/shared/document-model\";\nimport type {\n MethodDeclaration,\n ObjectLiteralExpression,\n SourceFile,\n} from \"ts-morph\";\nimport { SyntaxKind, VariableDeclarationKind } from \"ts-morph\";\nimport { FileGenerator } from \"./FileGenerator.js\";\nimport type {\n CodegenOperation,\n GenerationContext,\n} from \"./GenerationContext.js\";\n\nexport class ReducerGenerator extends FileGenerator {\n async generate(context: GenerationContext): Promise<void> {\n // Skip if no actions to generate\n if (context.operations.length === 0) return;\n\n const filePath = this.getOutputPath(context);\n const sourceFile = await this.directoryManager.createSourceFile(\n context.project,\n filePath,\n );\n\n const packageName = context.packageName;\n // Reducer-specific import logic\n const typeImportName = `${pascalCase(context.docModel.name)}${pascalCase(context.module.name)}Operations`;\n const typeImportPath = `${packageName}/document-models/${kebabCase(context.docModel.name)}`;\n\n // Import management (shared utility)\n this.importManager.replaceImportByName(\n sourceFile,\n typeImportName,\n typeImportPath,\n true,\n );\n\n // AST logic (specific to reducers)\n this.createReducerObject(sourceFile, typeImportName, context);\n\n // Detect and import error classes used in the actual reducer code (after generation)\n this.addErrorImports(sourceFile, context);\n\n await sourceFile.save();\n }\n\n private static getDefaultReducerCode(methodName: string): string[] {\n return [\n `// TODO: Implement \"${methodName}\" reducer`,\n `throw new Error('Reducer \"${methodName}\" not yet implemented');`,\n ];\n }\n\n private addErrorImports(\n sourceFile: SourceFile,\n context: GenerationContext,\n ): void {\n // Collect all errors from all operations\n const allErrors: OperationErrorSpecification[] = [];\n\n context.operations.forEach((operation) => {\n if (Array.isArray(operation.errors)) {\n operation.errors\n .filter((error) => error.name)\n .forEach((error) => {\n // Deduplicate errors by name\n if (!allErrors.find((e) => e.name === error.name)) {\n allErrors.push(error);\n }\n });\n }\n });\n\n if (allErrors.length === 0) return;\n\n // Analyze the actual source file content to find which errors are used\n const sourceFileContent = sourceFile.getFullText();\n const usedErrors = new Set<string>();\n\n allErrors.forEach((error) => {\n // Check if error class name is mentioned anywhere in the source file\n // Look for patterns like \"new ErrorName\" or \"throw ErrorName\" or \"ErrorName(\"\n const errorPattern = new RegExp(`\\\\b${error.name}\\\\b`, \"g\");\n if (errorPattern.test(sourceFileContent)) {\n usedErrors.add(error.name!);\n }\n });\n\n // Add imports for used errors (only if they're not already imported)\n if (usedErrors.size > 0) {\n const errorImportPath = `../../gen/${kebabCase(context.module.name)}/error.js`;\n const errorClassNames = Array.from(usedErrors);\n\n // Check if imports already exist to avoid duplicates\n const existingImports = sourceFile.getImportDeclarations();\n const existingErrorImport = existingImports.find(\n (importDecl) =>\n importDecl.getModuleSpecifierValue() === errorImportPath,\n );\n\n if (existingErrorImport) {\n // Get already imported error names\n const existingNamedImports = existingErrorImport\n .getNamedImports()\n .map((namedImport) => namedImport.getName());\n\n // Only import errors that aren't already imported\n const newErrorsToImport = errorClassNames.filter(\n (errorName) => !existingNamedImports.includes(errorName),\n );\n\n if (newErrorsToImport.length > 0) {\n // Add new named imports to existing import declaration\n existingErrorImport.addNamedImports(newErrorsToImport);\n }\n } else {\n // Create new import declaration\n this.importManager.addNamedImports(\n sourceFile,\n errorClassNames,\n errorImportPath,\n );\n }\n }\n }\n\n private getOutputPath(context: GenerationContext): string {\n return this.directoryManager.getReducerPath(\n context.rootDir,\n context.docModel.name,\n context.module.name,\n );\n }\n\n private createReducerObject(\n sourceFile: SourceFile,\n typeName: string,\n context: GenerationContext,\n ): void {\n const { operations, forceUpdate } = context;\n const operationHandlersObjectName = `${camelCase(context.docModel.name)}${pascalCase(context.module.name)}Operations`;\n const legacyReducerVar = sourceFile.getVariableDeclaration(\"reducer\");\n if (legacyReducerVar) {\n this.declarationManager.renameVariable(\n sourceFile,\n \"reducer\",\n operationHandlersObjectName,\n );\n }\n let reducerVar = sourceFile.getVariableDeclaration(\n operationHandlersObjectName,\n );\n if (!reducerVar) {\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n {\n name: operationHandlersObjectName,\n type: typeName,\n initializer: \"{}\",\n },\n ],\n });\n reducerVar = sourceFile.getVariableDeclarationOrThrow(\n operationHandlersObjectName,\n );\n } else {\n // Ensure correct type\n const typeNode = reducerVar.getTypeNode();\n if (!typeNode || typeNode.getText() !== typeName) {\n reducerVar.setType(typeName);\n }\n }\n\n const initializer = reducerVar.getInitializerIfKindOrThrow(\n SyntaxKind.ObjectLiteralExpression,\n );\n\n for (const operation of operations) {\n this.addReducerMethod(initializer, operation, forceUpdate);\n }\n }\n\n private addReducerMethod(\n objectLiteral: ObjectLiteralExpression,\n operation: CodegenOperation,\n forceUpdate = false,\n ): void {\n const actionName = camelCase(operation.name ?? \"\");\n if (!actionName) return;\n\n const methodName = `${actionName}Operation`;\n\n const reducerCode = operation.reducer?.trim();\n\n const existingReducer = objectLiteral\n .getProperty(methodName)\n ?.asKind(SyntaxKind.MethodDeclaration);\n\n // if reducer already exists but forceUpdate is true, update it\n if (existingReducer) {\n if (forceUpdate && reducerCode) {\n existingReducer.setBodyText(\"\");\n this.setReducerMethodCode(existingReducer, reducerCode);\n }\n return;\n }\n\n // if reducer doesn't exist, create it and set the code with the default code if no code is provided\n const method = objectLiteral.addMethod({\n name: methodName,\n parameters: [{ name: \"state\" }, { name: \"action\" }],\n });\n this.setReducerMethodCode(method, reducerCode);\n }\n\n private setReducerMethodCode(reducer: MethodDeclaration, code?: string) {\n reducer.addStatements(\n code ? [code] : ReducerGenerator.getDefaultReducerCode(reducer.getName()),\n );\n }\n}\n","import type { SourceFile } from \"ts-morph\";\n\nexport class DeclarationManager {\n renameVariable(\n sourceFile: SourceFile,\n oldName: string,\n newName: string,\n ): void {\n const variable = sourceFile.getVariableDeclaration(oldName);\n\n if (variable) {\n variable.getNameNode().replaceWithText(newName);\n sourceFile.saveSync();\n }\n }\n}\n","import type { PHProjectDirectories } from \"@powerhousedao/codegen\";\nimport { kebabCase, pascalCase } from \"change-case\";\nimport fs from \"fs/promises\";\nimport path from \"path\";\nimport type { Project, SourceFile } from \"ts-morph\";\n\nexport class DirectoryManager {\n private directories: Required<PHProjectDirectories> = {\n documentModelDir: \"document-model\",\n editorsDir: \"editors\",\n processorsDir: \"processors\",\n subgraphsDir: \"subgraphs\",\n };\n\n constructor(directories: PHProjectDirectories = {}) {\n this.directories = {\n ...this.directories,\n ...directories,\n };\n }\n async ensureExists(dirPath: string): Promise<void> {\n try {\n await fs.mkdir(dirPath, { recursive: true });\n } catch (err) {\n console.error(`Failed to create directory: ${dirPath}`, err);\n throw err;\n }\n }\n\n // Path builders for different file types\n getReducerPath(\n rootDir: string,\n docModelName: string,\n moduleName: string,\n ): string {\n return path.join(\n rootDir,\n this.directories.documentModelDir,\n kebabCase(docModelName),\n \"src\",\n \"reducers\",\n `${kebabCase(moduleName)}.ts`,\n );\n }\n\n getActionsPath(\n rootDir: string,\n docModelName: string,\n moduleName: string,\n ): string {\n return path.join(\n rootDir,\n this.directories.documentModelDir,\n kebabCase(docModelName),\n \"src\",\n \"actions\",\n `${kebabCase(moduleName)}.ts`,\n );\n }\n\n getComponentPath(\n rootDir: string,\n docModelName: string,\n componentName: string,\n ): string {\n return path.join(\n rootDir,\n this.directories.documentModelDir,\n kebabCase(docModelName),\n \"src\",\n \"components\",\n `${pascalCase(componentName)}.tsx`,\n );\n }\n\n getTypesPath(rootDir: string, docModelName: string): string {\n return path.join(\n rootDir,\n this.directories.documentModelDir,\n kebabCase(docModelName),\n \"src\",\n \"types.ts\",\n );\n }\n\n async createSourceFile(\n project: Project,\n filePath: string,\n ): Promise<SourceFile> {\n await this.ensureExists(path.dirname(filePath));\n return (\n project.addSourceFileAtPathIfExists(filePath) ??\n project.createSourceFile(filePath, \"\", { overwrite: false })\n );\n }\n}\n","import type { ImportDeclaration, SourceFile } from \"ts-morph\";\n\nexport interface ImportSpec {\n moduleSpecifier: string;\n namedImports?: string[];\n defaultImport?: string;\n isTypeOnly?: boolean;\n}\n\nexport class ImportManager {\n addImport(sourceFile: SourceFile, spec: ImportSpec): void {\n // Check if import already exists\n const existing = sourceFile.getImportDeclaration(\n (imp) => imp.getFullText() === spec.moduleSpecifier,\n );\n if (existing) {\n this.mergeImports(existing, spec);\n } else {\n sourceFile.addImportDeclaration(spec);\n }\n }\n\n addTypeImport(sourceFile: SourceFile, typeName: string, path: string): void {\n this.addImport(sourceFile, {\n moduleSpecifier: path,\n namedImports: [typeName],\n isTypeOnly: true,\n });\n }\n\n addNamedImports(\n sourceFile: SourceFile,\n imports: string[],\n path: string,\n ): void {\n this.addImport(sourceFile, {\n moduleSpecifier: path,\n namedImports: imports,\n });\n }\n\n private mergeImports(\n existingImport: ImportDeclaration,\n newSpec: ImportSpec,\n ): void {\n // Logic to merge named imports if they don't already exist\n if (newSpec.namedImports) {\n const existingNames = existingImport\n .getNamedImports()\n .map((ni) => ni.getName());\n const newNames = newSpec.namedImports.filter(\n (name) => !existingNames.includes(name),\n );\n\n if (newNames.length > 0) {\n existingImport.addNamedImports(newNames);\n }\n }\n }\n\n replaceImportByName(\n sourceFile: SourceFile,\n name: string,\n path: string,\n isTypeOnly = false,\n ): void {\n const existing = sourceFile\n .getImportDeclarations()\n .filter((imp) =>\n imp.getNamedImports().find((ni) => ni.getName() === name),\n );\n existing.forEach((imp) => imp.remove());\n sourceFile.addImportDeclaration({\n moduleSpecifier: path,\n namedImports: [name],\n isTypeOnly,\n });\n sourceFile.saveSync();\n }\n}\n","import type {\n DocumentModelGlobalState,\n ModuleSpecification,\n} from \"@powerhousedao/shared/document-model\";\nimport fs from \"fs/promises\";\nimport { Project } from \"ts-morph\";\nimport { DeclarationManager } from \"../utilities/DeclarationManager.js\";\nimport { DirectoryManager } from \"../utilities/DirectoryManager.js\";\nimport { ImportManager } from \"../utilities/ImportManager.js\";\nimport type { FileGenerator } from \"./FileGenerator.js\";\nimport type {\n CodeGeneratorOptions,\n CodegenOperation,\n GenerationContext,\n PHProjectDirectories,\n} from \"./GenerationContext.js\";\nimport { ReducerGenerator } from \"./ReducerGenerator.js\";\n\nexport class TSMorphCodeGenerator {\n private project = new Project();\n private generators = new Map<string, FileGenerator>();\n private directories: PHProjectDirectories = {\n documentModelDir: \"document-model\",\n editorsDir: \"editors\",\n processorsDir: \"processors\",\n subgraphsDir: \"subgraphs\",\n };\n private forceUpdate = false;\n\n constructor(\n private rootDir: string,\n private docModels: DocumentModelGlobalState[],\n private packageName: string,\n options: CodeGeneratorOptions = { directories: {}, forceUpdate: false },\n ) {\n this.directories = {\n ...this.directories,\n ...options.directories,\n };\n this.packageName = packageName;\n this.forceUpdate = options.forceUpdate ?? false;\n\n this.setupGenerators();\n }\n\n private setupGenerators(): void {\n const importManager = new ImportManager();\n const directoryManager = new DirectoryManager(this.directories);\n const declarationManager = new DeclarationManager();\n // Register all generators\n this.generators.set(\n \"reducers\",\n new ReducerGenerator(importManager, directoryManager, declarationManager),\n );\n }\n\n // Generate specific file types\n async generateReducers(): Promise<void> {\n await this.generateFileType(\"reducers\");\n }\n\n // Generate everything\n async generateAll(): Promise<void> {\n for (const [type] of this.generators) {\n await this.generateFileType(type);\n }\n }\n\n private async generateFileType(type: string): Promise<void> {\n const generator = this.generators.get(type);\n if (!generator) {\n throw new Error(`No generator registered for type: ${type}`);\n }\n\n await this.setupProject();\n\n for (const docModel of this.docModels) {\n const latestSpec =\n docModel.specifications[docModel.specifications.length - 1];\n\n for (const module of latestSpec.modules) {\n const context = this.createGenerationContext(\n docModel,\n module,\n this.forceUpdate,\n );\n\n await generator.generate(context);\n }\n }\n }\n\n private async setupProject(): Promise<void> {\n // Only load files from configured directories\n const sourcePaths: string[] = [];\n\n if (this.directories.documentModelDir) {\n const dirPath = `${this.rootDir}/${this.directories.documentModelDir}`;\n await this.ensureDirectoryExists(dirPath);\n sourcePaths.push(`${dirPath}/**/*.ts`);\n }\n if (this.directories.editorsDir) {\n const dirPath = `${this.rootDir}/${this.directories.editorsDir}`;\n await this.ensureDirectoryExists(dirPath);\n sourcePaths.push(`${dirPath}/**/*.ts`);\n }\n if (this.directories.processorsDir) {\n const dirPath = `${this.rootDir}/${this.directories.processorsDir}`;\n await this.ensureDirectoryExists(dirPath);\n sourcePaths.push(`${dirPath}/**/*.ts`);\n }\n if (this.directories.subgraphsDir) {\n const dirPath = `${this.rootDir}/${this.directories.subgraphsDir}`;\n await this.ensureDirectoryExists(dirPath);\n sourcePaths.push(`${dirPath}/**/*.ts`);\n }\n\n // Exclude node_modules from all paths\n sourcePaths.push(`!${this.rootDir}/**/node_modules/**`);\n\n if (sourcePaths.length > 0) {\n this.project.addSourceFilesAtPaths(sourcePaths);\n }\n }\n\n private createGenerationContext(\n docModel: DocumentModelGlobalState,\n module: ModuleSpecification,\n forceUpdate = false,\n ): GenerationContext {\n const operations: CodegenOperation[] = module.operations.map((op) => ({\n ...op,\n hasInput: op.schema !== null,\n hasAttachment: op.schema?.includes(\": Attachment\"),\n scope: op.scope || \"global\",\n state: op.scope === \"global\" ? \"\" : op.scope,\n }));\n\n return {\n rootDir: this.rootDir,\n packageName: this.packageName,\n docModel,\n module,\n project: this.project,\n operations,\n forceUpdate,\n };\n }\n\n private async ensureDirectoryExists(dirPath: string): Promise<void> {\n try {\n await fs.mkdir(dirPath, { recursive: true });\n } catch (err) {\n console.error(`Failed to create directory: ${dirPath}`, err);\n throw err;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAQA,eAAsB,kBACpB,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C,eAAY,KAAK,GAAG,QAAQ,UAAU;;AAExC,MAAI,KAAK,YAAY,cAAc;GACjC,MAAM,UAAU,GAAG,KAAK,QAAQ,GAAG,KAAK,YAAY;AACpD,SAAM,KAAK,sBAAsB,QAAQ;AACzC,eAAY,KAAK,GAAG,QAAQ,UAAU;;AAIxC,cAAY,KAAK,IAAI,KAAK,QAAQ,qBAAqB;AAEvD,MAAI,YAAY,SAAS,EACvB,MAAK,QAAQ,sBAAsB,YAAY;;CAInD,wBACE,UACA,QACA,cAAc,OACK;EACnB,MAAM,aAAiC,OAAO,WAAW,KAAK,QAAQ;GACpE,GAAG;GACH,UAAU,GAAG,WAAW;GACxB,eAAe,GAAG,QAAQ,SAAS,eAAe;GAClD,OAAO,GAAG,SAAS;GACnB,OAAO,GAAG,UAAU,WAAW,KAAK,GAAG;GACxC,EAAE;AAEH,SAAO;GACL,SAAS,KAAK;GACd,aAAa,KAAK;GAClB;GACA;GACA,SAAS,KAAK;GACd;GACA;GACD;;CAGH,MAAc,sBAAsB,SAAgC;AAClE,MAAI;AACF,SAAMC,KAAG,MAAM,SAAS,EAAE,WAAW,MAAM,CAAC;WACrC,KAAK;AACZ,WAAQ,MAAM,+BAA+B,WAAW,IAAI;AAC5D,SAAM"}
1
+ {"version":3,"file":"index.mjs","names":["readdirSync","join","statSync","join","path","fs","fs"],"sources":["../src/codegen/utils.ts","../src/codegen/generate.ts","../src/codegen/kysely.ts","../src/codegen/migrate.ts","../src/create-lib/checkout-project.ts","../src/create-lib/create-project.ts","../src/ts-morph-generator/core/FileGenerator.ts","../src/ts-morph-generator/core/ReducerGenerator.ts","../src/ts-morph-generator/utilities/DeclarationManager.ts","../src/ts-morph-generator/utilities/DirectoryManager.ts","../src/ts-morph-generator/utilities/ImportManager.ts","../src/ts-morph-generator/core/TSMorphCodeGenerator.ts"],"sourcesContent":["import type {\n DocumentModelDocument,\n DocumentModelGlobalState,\n} from \"@powerhousedao/shared/document-model\";\nimport { documentModelReducer } from \"@powerhousedao/shared/document-model\";\nimport { baseLoadFromFile } from \"document-model/node\";\nimport { readFile } from \"node:fs/promises\";\n\nexport async function loadDocumentModel(\n path: string,\n): Promise<DocumentModelGlobalState> {\n let documentModel: DocumentModelGlobalState;\n try {\n if (!path) {\n throw new Error(\"Document model file not specified\");\n } else if (path.endsWith(\".zip\") || path.endsWith(\".phd\")) {\n const file = await baseLoadFromFile(path, documentModelReducer);\n documentModel = file.state.global;\n } else if (path.endsWith(\".json\")) {\n const data = await readFile(path, \"utf-8\");\n const parsedData = JSON.parse(data) as DocumentModelDocument;\n if (\"state\" in parsedData) {\n documentModel = parsedData.state.global;\n } else {\n documentModel = parsedData;\n }\n } else {\n throw new Error(\"File type not supported. Must be zip, phd, or json.\");\n }\n return documentModel;\n } catch (error) {\n throw (error as { code?: string }).code === \"MODULE_NOT_FOUND\"\n ? new Error(`Document model not found.`)\n : error;\n }\n}\n","import {\n DocumentModelGlobalStateSchema,\n type DocumentModelGlobalState,\n} from \"@powerhousedao/shared/document-model\";\nimport type {\n ProcessorApp,\n ProcessorApps,\n} from \"@powerhousedao/shared/processors\";\nimport { kebabCase } from \"change-case\";\nimport {\n tsMorphGenerateApp,\n tsMorphGenerateDocumentEditor,\n tsMorphGenerateDocumentModel,\n tsMorphGenerateProcessor,\n tsMorphGenerateSubgraph,\n} from \"file-builders\";\nimport { loadJsonFileSync } from \"load-json-file\";\nimport { readdirSync, statSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport {\n conditional,\n filter,\n find,\n flatMap,\n isDefined,\n isEmpty,\n isIncludedIn,\n isString,\n isTruthy,\n map,\n pipe,\n split,\n startsWith,\n unique,\n when,\n} from \"remeda\";\nimport type { Project } from \"ts-morph\";\nimport { SyntaxKind } from \"ts-morph\";\nimport { getObjectProperty, getOrCreateDirectory } from \"utils\";\nimport { loadDocumentModel } from \"./utils.js\";\n\nexport async function generateDocumentModel(\n documentModelState: DocumentModelGlobalState,\n project: Project,\n) {\n await tsMorphGenerateDocumentModel(documentModelState, project);\n}\n\n/* Runs generate for each document model json file found in the project's `document-models` directory */\nexport async function generateAllDocumentModels(project: Project) {\n const { directory: documentModelsDir } = getOrCreateDirectory(\n project,\n \"document-models\",\n );\n const documentModelsDirPath = documentModelsDir.getPath();\n const documentModelStateFiles = pipe(\n readdirSync(documentModelsDirPath, { withFileTypes: true }),\n filter((dirent) => dirent.isDirectory()),\n map((dir) => join(dir.parentPath, `${dir.name}/${dir.name}.json`)),\n filter(\n (srcPath) =>\n statSync(srcPath, { throwIfNoEntry: false })?.isFile() ?? false,\n ),\n map((srcPath) => loadJsonFileSync(srcPath)),\n filter(\n (stateFile): stateFile is DocumentModelGlobalState =>\n DocumentModelGlobalStateSchema().safeParse(stateFile).success === true,\n ),\n );\n\n for (const documentModelState of documentModelStateFiles) {\n await generateDocumentModel(documentModelState, project);\n }\n}\nexport async function generateFromFile(filePath: string, project: Project) {\n // load document model spec from file\n const documentModelState = await loadDocumentModel(filePath);\n\n // delegate to shared generation function\n await generateDocumentModel(documentModelState, project);\n}\n\ntype GenerateEditorArgs = {\n editorName: string;\n documentTypes: string[];\n editorId?: string;\n editorDirName?: string;\n};\nexport async function generateEditor(\n args: GenerateEditorArgs,\n project: Project,\n) {\n const {\n editorName,\n documentTypes,\n editorId: editorIdArg,\n editorDirName,\n } = args;\n\n if (documentTypes.length > 1) {\n throw new Error(\"Multiple document types are not supported yet\");\n }\n\n const documentModelId = documentTypes[0];\n const editorId = editorIdArg || kebabCase(editorName);\n const editorDir = editorDirName || kebabCase(editorName);\n\n await tsMorphGenerateDocumentEditor({\n project,\n editorDir,\n documentModelId,\n editorName,\n editorId,\n });\n}\n\n/* Runs generate for all editors found in the project's `editors` directory.\n * Note: we intentionally filter out editors with the document type \"powerhouse/document-drive\".\n * These are handled separately by the `generateAllApps` function.\n */\nexport async function generateAllEditors(project: Project) {\n const { directory: editorsDir } = getOrCreateDirectory(project, \"editors\");\n const editorDirs = editorsDir.getDirectories();\n\n /* An editor's `id`, `name`, and `documentTypes` args can be found in the `module.ts` file */\n const editorsToAdd = pipe(\n editorDirs,\n map((dir) => dir.getSourceFile(\"module.ts\")),\n filter(isTruthy),\n map((sourceFile) =>\n sourceFile.getDescendantsOfKind(SyntaxKind.PropertyAssignment),\n ),\n map((propertyAssignments) => ({\n id: find(\n propertyAssignments,\n (propertyAssignment) => propertyAssignment.getName() === \"id\",\n ),\n name: find(\n propertyAssignments,\n (propertyAssignment) => propertyAssignment.getName() === \"name\",\n ),\n documentTypes: find(\n propertyAssignments,\n (propertyAssignment) =>\n propertyAssignment.getName() === \"documentTypes\",\n ),\n })),\n map(({ id, name, documentTypes }) => ({\n editorDirName: id?.getSourceFile().getDirectory().getBaseName(),\n editorId: id\n ?.getFirstDescendantByKind(SyntaxKind.StringLiteral)\n ?.getLiteralValue(),\n editorName: name\n ?.getFirstDescendantByKind(SyntaxKind.StringLiteral)\n ?.getLiteralValue(),\n documentTypes: pipe(\n documentTypes\n ?.getFirstDescendantByKind(SyntaxKind.ArrayLiteralExpression)\n ?.getElements() ?? [],\n map((element) =>\n element.asKind(SyntaxKind.StringLiteral)?.getLiteralValue(),\n ),\n filter(isString),\n ),\n })),\n filter(\n ({ documentTypes }) =>\n !documentTypes.includes(\"powerhouse/document-drive\"),\n ),\n );\n\n for (const editorToAdd of editorsToAdd) {\n if (editorToAdd.editorDirName === undefined) return;\n await generateEditor(editorToAdd as GenerateEditorArgs, project);\n }\n}\n\ntype GenerateAppArgs = {\n appName: string;\n appId?: string;\n allowedDocumentTypes?: string[];\n isDragAndDropEnabled?: boolean;\n appDirName?: string;\n};\nexport async function generateApp(args: GenerateAppArgs, project: Project) {\n const {\n appName,\n appId,\n allowedDocumentTypes,\n isDragAndDropEnabled,\n appDirName,\n } = args;\n\n await tsMorphGenerateApp({\n project,\n editorDir: appDirName || kebabCase(appName),\n editorName: appName,\n editorId: appId ?? kebabCase(appName),\n allowedDocumentModelIds: allowedDocumentTypes ?? [],\n isDragAndDropEnabled: isDragAndDropEnabled ?? true,\n });\n}\n\n/* Runs generate for all apps found in the project's `editors` directory.\n * Note: we intentionally filter out editors which do not have the document type \"powerhouse/document-drive\".\n * These are handled separately by the `generateAllEditors` function.\n */\nexport async function generateAllApps(project: Project) {\n const { directory: editorsDir } = getOrCreateDirectory(project, \"editors\");\n const editorDirs = editorsDir.getDirectories();\n\n /* An editor's `id`, `name`, and `documentTypes` args can be found in the `module.ts` file */\n const appsToAdd = pipe(\n editorDirs,\n map((dir) => dir.getSourceFile(\"module.ts\")),\n filter(isTruthy),\n map((sourceFile) =>\n sourceFile.getDescendantsOfKind(SyntaxKind.PropertyAssignment),\n ),\n map((propertyAssignments) => ({\n id: find(\n propertyAssignments,\n (propertyAssignment) => propertyAssignment.getName() === \"id\",\n ),\n name: find(\n propertyAssignments,\n (propertyAssignment) => propertyAssignment.getName() === \"name\",\n ),\n documentTypes: find(\n propertyAssignments,\n (propertyAssignment) =>\n propertyAssignment.getName() === \"documentTypes\",\n ),\n })),\n map(({ id, name, documentTypes }) => ({\n appDir: id?.getSourceFile().getDirectory(),\n appId: id\n ?.getFirstDescendantByKind(SyntaxKind.StringLiteral)\n ?.getLiteralValue(),\n appName: name\n ?.getFirstDescendantByKind(SyntaxKind.StringLiteral)\n ?.getLiteralValue(),\n documentTypes: pipe(\n documentTypes\n ?.getFirstDescendantByKind(SyntaxKind.ArrayLiteralExpression)\n ?.getElements() ?? [],\n map((element) =>\n element.asKind(SyntaxKind.StringLiteral)?.getLiteralValue(),\n ),\n filter(isString),\n ),\n })),\n filter(({ documentTypes }) =>\n documentTypes.includes(\"powerhouse/document-drive\"),\n ),\n /* The `allowedDocumentTypes` and `isDragAndDropEnabled` args can only be found in the `config.ts` file */\n map(({ appDir, ...rest }) => ({\n appDirName: appDir?.getBaseName(),\n configFilePropertyAssignments:\n appDir\n ?.getSourceFile(\"config.ts\")\n ?.getDescendantsOfKind(SyntaxKind.PropertyAssignment) ?? [],\n ...rest,\n })),\n map(({ configFilePropertyAssignments, ...rest }) => ({\n isDragAndDropEnabled: find(\n configFilePropertyAssignments,\n (propertyAssignment) =>\n propertyAssignment.getName() === \"isDragAndDropEnabled\",\n ),\n allowedDocumentTypes: find(\n configFilePropertyAssignments,\n (propertyAssignment) =>\n propertyAssignment.getName() === \"allowedDocumentTypes\",\n ),\n ...rest,\n })),\n map(({ isDragAndDropEnabled, allowedDocumentTypes, ...rest }) => ({\n isDragAndDropEnabled: when(\n isDragAndDropEnabled?.getDescendants() ?? [],\n (descendants) =>\n isDefined(\n find(descendants, (d) => d.getKind() === SyntaxKind.TrueKeyword),\n ),\n {\n onTrue: () => true,\n onFalse: () => false,\n },\n ),\n allowedDocumentTypes: pipe(\n allowedDocumentTypes\n ?.getFirstDescendantByKind(SyntaxKind.ArrayLiteralExpression)\n ?.getElements() ?? [],\n map((element) =>\n element.asKind(SyntaxKind.StringLiteral)?.getLiteralValue(),\n ),\n filter(isString),\n ),\n ...rest,\n })),\n );\n\n for (const appToAdd of appsToAdd) {\n if (appToAdd.appName === undefined) return;\n\n await generateApp(appToAdd as GenerateAppArgs, project);\n }\n}\nexport async function generateSubgraph(subgraphName: string, project: Project) {\n await tsMorphGenerateSubgraph({ subgraphName, project });\n}\n\n/* Runs generate for each directory found in the project's `subgraphs` directory */\nexport async function generateAllSubgraphs(project: Project) {\n const { directory: subgraphsDir } = getOrCreateDirectory(\n project,\n \"subgraphs\",\n );\n /* The subgraph's name is found in the `index.ts` file */\n const subgraphNames = pipe(\n subgraphsDir.getDirectories(),\n map((dir) => dir.getSourceFile(\"index.ts\")),\n flatMap((indexFile) => indexFile?.getClasses() ?? []),\n filter(\n (classDeclaration) =>\n classDeclaration.getBaseClass()?.getText().includes(\"BaseSubgraph\") ??\n false,\n ),\n map((classDeclaration) =>\n classDeclaration\n .getInstanceProperty(\"name\")\n ?.asKind(SyntaxKind.PropertyDeclaration)\n ?.getInitializerIfKind(SyntaxKind.StringLiteral)\n ?.getLiteralValue(),\n ),\n filter(isString),\n unique(),\n );\n for (const subgraphName of subgraphNames) {\n await generateSubgraph(subgraphName, project);\n }\n}\n\nexport async function generateProcessor(\n args: {\n processorName: string;\n processorType: \"analytics\" | \"relationalDb\";\n processorApps: ProcessorApps;\n documentTypes: string[];\n },\n project: Project,\n) {\n return await tsMorphGenerateProcessor({\n project,\n ...args,\n });\n}\n\n/* Runs generate for each directory found in the project's `processors` directory */\nexport async function generateAllProcessors(project: Project) {\n const { directory: processorsDir } = getOrCreateDirectory(\n project,\n \"processors\",\n );\n const connectProcessorNames = pipe(\n processorsDir.getSourceFile(\"connect.ts\"),\n (sourceFile) => sourceFile?.getImportDeclarations() ?? [],\n flatMap((importDeclaration) =>\n importDeclaration.getModuleSpecifier().getLiteralValue(),\n ),\n filter(startsWith(\"processors/\")),\n map(split(\"/\")),\n map((s) => s.at(1)),\n filter(isString),\n );\n const switchboardProcessorNames = pipe(\n processorsDir.getSourceFile(\"switchboard.ts\"),\n (sourceFile) => sourceFile?.getImportDeclarations() ?? [],\n flatMap((importDeclaration) =>\n importDeclaration.getModuleSpecifier().getLiteralValue(),\n ),\n filter(startsWith(\"processors/\")),\n map(split(\"/\")),\n map((s) => s.at(1)),\n filter(isString),\n );\n const processorsToGenerate = pipe(\n processorsDir.getDirectories(),\n map((dir) => ({\n dir,\n processorName: dir.getBaseName(),\n })),\n map(({ dir, processorName }) => ({\n processorName,\n /* We can try to determine which processors are for `connect` and for `switchboard`.\n * If we cannot, we fallback to including them in both. */\n processorApps: pipe(\n [],\n when(\n () => isIncludedIn(processorName, connectProcessorNames),\n (processorApps) => [...processorApps, \"connect\"],\n ),\n when(\n () => isIncludedIn(processorName, switchboardProcessorNames),\n (processorApps) => [...processorApps, \"switchboard\"],\n ),\n when(\n (processorApps) => isEmpty(processorApps),\n () => [\"connect\", \"switchboard\"],\n ),\n ),\n processorType: pipe(\n // handle the old `index.ts` file name if `processor.ts` has not been generated\n dir.getSourceFile(\"processor.ts\") ?? dir.getSourceFile(\"index.ts\"),\n (sourceFile) => sourceFile?.getImportDeclarations() ?? [],\n flatMap((importDeclaration) => importDeclaration.getNamedImports()),\n map((importSpecifier) => importSpecifier.getText()),\n // we have to check what type is imported to determine whether the processor is `relationalDb` or `analytics`\n conditional(\n [\n (specifiers) =>\n isDefined(\n find(specifiers, (specifier) =>\n specifier.includes(\"RelationalDbProcessor\"),\n ),\n ),\n () => \"relationalDb\",\n ],\n [\n (specifiers) =>\n isDefined(\n find(specifiers, (specifier) =>\n specifier.includes(\"IAnalyticsStore\"),\n ),\n ),\n () => \"analytics\",\n ],\n ),\n ),\n documentTypes: pipe(\n dir.getSourceFile(\"factory.ts\"),\n (sourceFile) =>\n sourceFile?.getDescendantsOfKind(\n SyntaxKind.ObjectLiteralExpression,\n ) ?? [],\n map((objectLiteralExpression) =>\n getObjectProperty(\n objectLiteralExpression,\n \"documentType\",\n SyntaxKind.ArrayLiteralExpression,\n ),\n ),\n flatMap((o) => o?.getElements()),\n map((e) => e?.asKind(SyntaxKind.StringLiteral)),\n filter(isTruthy),\n map((e) => e.getLiteralValue()),\n ),\n })),\n );\n\n for (const {\n processorName,\n processorApps,\n processorType,\n documentTypes,\n } of processorsToGenerate) {\n await generateProcessor(\n {\n processorName,\n processorApps: processorApps as ProcessorApp[],\n processorType: processorType as \"analytics\" | \"relationalDb\",\n documentTypes,\n },\n project,\n );\n }\n}\n\n/* Runs each module type's generateAll{moduleType} function for the current project */\nexport async function generateAll(project: Project) {\n await generateAllDocumentModels(project);\n await generateAllEditors(project);\n await generateAllApps(project);\n await generateAllSubgraphs(project);\n await generateAllProcessors(project);\n}\n","import { spawn } from \"node:child_process\";\nimport { existsSync } from \"node:fs\";\nimport { createRequire } from \"node:module\";\nimport { join, resolve } from \"node:path\";\n\nfunction getKyselyPgLiteBin(): string {\n const require = createRequire(import.meta.url);\n\n const paths = require.resolve.paths(\"kysely-pglite\");\n if (paths) {\n for (const basePath of paths) {\n const pkgRoot = join(basePath, \"kysely-pglite\");\n const binPath = join(pkgRoot, \"bin/run.js\");\n\n if (existsSync(binPath)) {\n return binPath;\n }\n }\n }\n\n throw new Error(\"Could not find kysely-pglite/bin/run.js\");\n}\n\nexport interface IOptions {\n migrationFile: string;\n schemaFile?: string;\n}\n\nfunction runCommand(\n command: string,\n args: string[],\n cwd?: string,\n): Promise<void> {\n return new Promise((resolve, reject) => {\n const child = spawn(command, args, {\n cwd,\n stdio: \"inherit\",\n shell: true,\n });\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve();\n } else {\n reject(new Error(`Command failed with exit code ${code}`));\n }\n });\n\n child.on(\"error\", (error) => {\n reject(error);\n });\n });\n}\n\nexport async function generateDBSchema({\n migrationFile,\n schemaFile,\n}: IOptions) {\n const outFile = schemaFile ?? resolve(migrationFile, \"../schema.ts\");\n\n try {\n const kyselyBinPath = getKyselyPgLiteBin();\n // Use kysely-pglite CLI to handle TypeScript compilation and module resolution\n await runCommand(\n \"node\",\n [kyselyBinPath, migrationFile, \"--outFile\", outFile],\n process.cwd(),\n );\n\n console.log(`Schema types generated at ${outFile}`);\n } catch (error) {\n console.error(\"Error running migration:\", error);\n }\n}\n","import {\n VERSIONED_DEPENDENCIES,\n VERSIONED_DEV_DEPENDENCIES,\n} from \"@powerhousedao/shared/clis\";\nimport console from \"console\";\nimport {\n externalDependencies,\n externalDevDependencies,\n makePackageJsonExports,\n packageScripts,\n writeAllGeneratedProjectFiles,\n} from \"file-builders\";\nimport { cpSync, mkdirSync, readdirSync, rmSync, statSync } from \"fs\";\nimport npmFetch from \"npm-registry-fetch\";\nimport { join } from \"path\";\nimport { readPackage } from \"read-pkg\";\nimport {\n filter,\n fromKeys,\n isTruthy,\n keys,\n map,\n mapValues,\n merge,\n omit,\n pipe,\n prop,\n} from \"remeda\";\nimport type { Project } from \"ts-morph\";\nimport { buildTsMorphProject } from \"utils\";\nimport { updatePackage } from \"write-package\";\nimport { generateAll } from \"./generate.js\";\n\n/* Uses the npm cli's fetch function to get the version for a specified tag */\nexport async function getFullyQualifiedWorkspacePackageVersion(\n versionOrTag: string,\n) {\n const isTag =\n versionOrTag === \"latest\" ||\n versionOrTag === \"staging\" ||\n versionOrTag === \"dev\";\n\n if (!isTag) return versionOrTag;\n const result = (await npmFetch.json(\n `${WORKSPACE_PACKAGES[0].manifest.name!}`,\n )) as { \"dist-tags\": Record<\"latest\" | \"staging\" | \"dev\", string> };\n return result[\"dist-tags\"][versionOrTag];\n}\n\nexport function fixLegacyImportPaths(\n project: Project,\n packageName: string | undefined,\n) {\n if (!packageName) {\n console.error(\"No package name found in package.json.\");\n return;\n }\n const sourceFiles = project.getSourceFiles();\n for (const sourceFile of sourceFiles) {\n const importStatements = sourceFile.getImportDeclarations();\n for (const importStatement of importStatements) {\n const namedImports = map(\n importStatement.getNamedImports(),\n (importSpecifier) => importSpecifier.getText(),\n );\n const moduleSpecifier = importStatement.getModuleSpecifier();\n const moduleSpecifierText = moduleSpecifier.getLiteralText();\n // remove usage of the old `package-name/` style paths\n if (moduleSpecifierText.includes(packageName)) {\n moduleSpecifier.setLiteralValue(\n moduleSpecifierText.replace(`${packageName}/`, \"\"),\n );\n }\n // I saw this invalid import enough that it seemed worthwhile to fix it here\n if (namedImports.includes(\"generateMock\")) {\n moduleSpecifier.setLiteralValue(\"document-model\");\n }\n // attempt to fix absolute import paths for document models like `../../../document-models/model/something/something.js`\n // these don't work anymore with the versioned document models, since the absolute file paths are different\n const match = moduleSpecifierText.match(\n /^(\\.\\.\\/)+document-models\\/([^/]+)(?!\\/v\\d+(?:\\/|$))(?:\\/.*)?$/,\n );\n\n if (match) {\n moduleSpecifier.setLiteralValue(`document-models/${match[2]}`);\n }\n }\n }\n}\n\nexport async function migrate(version: string, projectDir = process.cwd()) {\n const fullyQualifiedVersion =\n await getFullyQualifiedWorkspacePackageVersion(version);\n\n const packageJson = await readPackage({ cwd: projectDir });\n const exports = makePackageJsonExports();\n const scripts = merge(packageJson.scripts, packageScripts);\n const workspacePackageNames = filter(\n map(WORKSPACE_PACKAGES, prop(\"manifest\", \"name\")),\n isTruthy,\n );\n const projectDependencyNames = [\n ...VERSIONED_DEPENDENCIES,\n ...keys(externalDependencies),\n ];\n const projectDevDependencyNames = [\n ...VERSIONED_DEV_DEPENDENCIES,\n ...keys(externalDevDependencies),\n ];\n const dependencies = pipe(\n packageJson.dependencies ?? {},\n // remove dev dependencies if they are in here\n omit(projectDevDependencyNames),\n merge({\n // use the fully qualified version we just got for these\n ...fromKeys(VERSIONED_DEPENDENCIES, () => fullyQualifiedVersion),\n // use the versions defined for the other deps we need to control\n ...externalDependencies,\n }),\n // use the fully qualified version for other workspace deps the user may have added\n mapValues((value, key) =>\n workspacePackageNames.includes(key) ? fullyQualifiedVersion : value,\n ),\n );\n const devDependencies = pipe(\n packageJson.devDependencies ?? {},\n omit(projectDependencyNames),\n merge({\n ...fromKeys(VERSIONED_DEV_DEPENDENCIES, () => fullyQualifiedVersion),\n ...externalDevDependencies,\n }),\n mapValues((value, key) =>\n workspacePackageNames.includes(key) ? fullyQualifiedVersion : value,\n ),\n );\n console.log(\"Updating package.json...\");\n await updatePackage(projectDir, {\n exports,\n scripts,\n dependencies,\n devDependencies,\n });\n\n console.log(\"Overwriting project root files...\");\n await writeAllGeneratedProjectFiles(projectDir);\n console.log(\"Moving unversioned document models...\");\n moveLegacyDocumentModels(projectDir);\n const project = buildTsMorphProject(projectDir);\n console.log(\"Fixing legacy import paths...\");\n fixLegacyImportPaths(project, packageJson.name);\n console.log(\"Re-generating code...\");\n await generateAll(project);\n await project.save();\n}\n\nfunction moveLegacyDocumentModels(projectDir: string) {\n const fileNamesToDelete = [\n \"actions.ts\",\n \"hooks.ts\",\n \"module.ts\",\n \"index.ts\",\n \"utils.ts\",\n \"schema.graphql\",\n ];\n const dirNamesToCopy = [\"src\", \"gen\"];\n const dirs = pipe(\n readdirSync(join(projectDir, \"document-models\"), { withFileTypes: true }),\n filter((entry) => entry.isDirectory()),\n filter(\n (dir) =>\n statSync(join(dir.parentPath, dir.name, `${dir.name}.json`), {\n throwIfNoEntry: false,\n })?.isFile() ?? false,\n ),\n map((dir) => join(dir.parentPath, dir.name)),\n );\n\n for (const dirPath of dirs) {\n for (const name of fileNamesToDelete) {\n const filePath = join(dirPath, name);\n rmSync(filePath, { force: true });\n }\n const versionDirPath = join(dirPath, \"v1\");\n const versionDirExists =\n statSync(versionDirPath, { throwIfNoEntry: false })?.isDirectory() ??\n false;\n if (!versionDirExists) {\n mkdirSync(versionDirPath);\n }\n for (const dirName of dirNamesToCopy) {\n const srcDirPath = join(dirPath, dirName);\n const srcDirExists =\n statSync(srcDirPath, { throwIfNoEntry: false })?.isDirectory() ?? false;\n if (!srcDirExists) continue;\n const destDirPath = join(versionDirPath, dirName);\n cpSync(srcDirPath, destDirPath, {\n recursive: true,\n force: false,\n errorOnExist: false,\n });\n rmSync(srcDirPath, {\n force: true,\n recursive: true,\n });\n }\n }\n}\n","import path from \"node:path\";\nimport { runCmd } from \"@powerhousedao/shared/clis\";\n/**\n * Clones a git repository and returns the path to the cloned project.\n * @param repositoryUrl - The URL of the git repository to clone\n * @returns The absolute path to the cloned project directory\n */\nexport function cloneRepository(repositoryUrl: string): string {\n try {\n console.log(\n \"\\x1b[33m\",\n `Cloning repository from ${repositoryUrl}...`,\n \"\\x1b[0m\",\n );\n runCmd(`git clone ${repositoryUrl}`);\n\n // Extract project name from repository URL\n // e.g., https://github.com/org/repo.git -> repo\n const repoName = repositoryUrl\n .split(\"/\")\n .pop()\n ?.replace(/\\.git$/, \"\");\n\n if (!repoName) {\n throw new Error(\"Could not determine project name from repository URL\");\n }\n\n const projectPath = path.join(process.cwd(), repoName);\n return projectPath;\n } catch (error) {\n console.log(error);\n throw error;\n }\n}\n\n/**\n * Installs dependencies in a project directory using the specified package manager.\n * @param projectPath - The absolute path to the project directory\n * @param packageManager - The package manager to use (npm, pnpm, yarn, bun)\n */\nexport function installDependencies(\n projectPath: string,\n packageManager: string,\n): void {\n try {\n process.chdir(projectPath);\n\n console.log(\n \"\\x1b[34m\",\n `Installing dependencies with ${packageManager}...`,\n \"\\x1b[0m\",\n );\n runCmd(`${packageManager} install --loglevel error`);\n\n console.log(\"\\x1b[32m\", \"Dependencies installed successfully!\", \"\\x1b[0m\");\n console.log();\n } catch (error) {\n console.log(error);\n throw error;\n }\n}\n","import { runCmd, writeFileEnsuringDir } from \"@powerhousedao/shared/clis\";\nimport chalk from \"chalk\";\nimport fs from \"node:fs\";\nimport path from \"path\";\nimport { gitIgnoreTemplate } from \"templates\";\nimport { runPrettier } from \"utils\";\nimport {\n writeAllGeneratedProjectFiles,\n writeProjectRootFiles,\n} from \"file-builders\";\ntype CreateProjectArgs = {\n name: string;\n packageManager: string;\n tag?: string;\n version?: string;\n remoteDrive?: string;\n skipGitInit?: boolean;\n skipInstall?: boolean;\n};\nexport async function createProject({\n name,\n packageManager,\n tag,\n version,\n remoteDrive,\n skipGitInit,\n skipInstall,\n}: CreateProjectArgs) {\n const appPath = path.join(process.cwd(), name);\n\n try {\n fs.mkdirSync(appPath);\n } catch (err) {\n if ((err as { code: string }).code === \"EEXIST\") {\n console.error(\n `⛔ The folder \"${name}\" already exists in the current directory, please give it another name.`,\n );\n } else {\n console.error(err);\n }\n process.exit(1);\n }\n\n try {\n // Create a new directory for the project\n console.log(chalk.blue(`▶️ Creating directory for project \"${name}\"...\\n`));\n const appPath = path.join(process.cwd(), name);\n process.chdir(appPath);\n console.log(chalk.green(`✅ Project directory created\\n`));\n\n await writeFileEnsuringDir(\".gitignore\", gitIgnoreTemplate);\n if (!skipGitInit) {\n // Create a .gitignore file, then initialize the git repository\n console.log(chalk.blue(`▶️ Initializing git repository...\\n`));\n runCmd(`git init`);\n console.log(chalk.green(`\\n✅ Git repository initialized\\n`));\n }\n\n // Write the boilerplate files for the project\n console.log(chalk.blue(`▶️ Creating project boilerplate files...\\n`));\n await writeProjectRootFiles({ name, tag, version, remoteDrive });\n await writeAllGeneratedProjectFiles();\n console.log(chalk.green(`✅ Project boilerplate files created\\n`));\n\n if (!skipInstall) {\n // Install the project dependencies with the specified package manager\n console.log(\n chalk.blue(\n `▶️ Installing project dependencies with ${packageManager}...\\n`,\n ),\n );\n runCmd(`${packageManager} install`);\n console.log(chalk.green(`\\n✅ Project dependencies installed\\n`));\n }\n\n // Use the installed version of `prettier` to format the generated code\n console.log(chalk.blue(`▶️ Formatting boilerplate project files...\\n`));\n await runPrettier();\n console.log(chalk.green(`✅ Boilerplate files formatted\\n`));\n\n // Project creation complete\n console.log(chalk.bold(`🎉 Successfully created project \"${name}\" 🎉\\n`));\n } catch (error) {\n console.error(error);\n process.exit(1);\n }\n}\n","import type { DeclarationManager } from \"../utilities/DeclarationManager.js\";\nimport type { DirectoryManager } from \"../utilities/DirectoryManager.js\";\nimport type { ImportManager } from \"../utilities/ImportManager.js\";\nimport type { GenerationContext } from \"./GenerationContext.js\";\n\nexport abstract class FileGenerator {\n constructor(\n protected importManager: ImportManager,\n protected directoryManager: DirectoryManager,\n protected declarationManager: DeclarationManager,\n ) {}\n\n abstract generate(context: GenerationContext): Promise<void>;\n}\n","import { camelCase, kebabCase, pascalCase } from \"change-case\";\nimport type { OperationErrorSpecification } from \"@powerhousedao/shared/document-model\";\nimport type {\n MethodDeclaration,\n ObjectLiteralExpression,\n SourceFile,\n} from \"ts-morph\";\nimport { SyntaxKind, VariableDeclarationKind } from \"ts-morph\";\nimport { FileGenerator } from \"./FileGenerator.js\";\nimport type {\n CodegenOperation,\n GenerationContext,\n} from \"./GenerationContext.js\";\n\nexport class ReducerGenerator extends FileGenerator {\n async generate(context: GenerationContext): Promise<void> {\n // Skip if no actions to generate\n if (context.operations.length === 0) return;\n\n const filePath = this.getOutputPath(context);\n const sourceFile = await this.directoryManager.createSourceFile(\n context.project,\n filePath,\n );\n\n const packageName = context.packageName;\n // Reducer-specific import logic\n const typeImportName = `${pascalCase(context.docModel.name)}${pascalCase(context.module.name)}Operations`;\n const typeImportPath = `${packageName}/document-models/${kebabCase(context.docModel.name)}`;\n\n // Import management (shared utility)\n this.importManager.replaceImportByName(\n sourceFile,\n typeImportName,\n typeImportPath,\n true,\n );\n\n // AST logic (specific to reducers)\n this.createReducerObject(sourceFile, typeImportName, context);\n\n // Detect and import error classes used in the actual reducer code (after generation)\n this.addErrorImports(sourceFile, context);\n\n await sourceFile.save();\n }\n\n private static getDefaultReducerCode(methodName: string): string[] {\n return [\n `// TODO: Implement \"${methodName}\" reducer`,\n `throw new Error('Reducer \"${methodName}\" not yet implemented');`,\n ];\n }\n\n private addErrorImports(\n sourceFile: SourceFile,\n context: GenerationContext,\n ): void {\n // Collect all errors from all operations\n const allErrors: OperationErrorSpecification[] = [];\n\n context.operations.forEach((operation) => {\n if (Array.isArray(operation.errors)) {\n operation.errors\n .filter((error) => error.name)\n .forEach((error) => {\n // Deduplicate errors by name\n if (!allErrors.find((e) => e.name === error.name)) {\n allErrors.push(error);\n }\n });\n }\n });\n\n if (allErrors.length === 0) return;\n\n // Analyze the actual source file content to find which errors are used\n const sourceFileContent = sourceFile.getFullText();\n const usedErrors = new Set<string>();\n\n allErrors.forEach((error) => {\n // Check if error class name is mentioned anywhere in the source file\n // Look for patterns like \"new ErrorName\" or \"throw ErrorName\" or \"ErrorName(\"\n const errorPattern = new RegExp(`\\\\b${error.name}\\\\b`, \"g\");\n if (errorPattern.test(sourceFileContent)) {\n usedErrors.add(error.name!);\n }\n });\n\n // Add imports for used errors (only if they're not already imported)\n if (usedErrors.size > 0) {\n const errorImportPath = `../../gen/${kebabCase(context.module.name)}/error.js`;\n const errorClassNames = Array.from(usedErrors);\n\n // Check if imports already exist to avoid duplicates\n const existingImports = sourceFile.getImportDeclarations();\n const existingErrorImport = existingImports.find(\n (importDecl) =>\n importDecl.getModuleSpecifierValue() === errorImportPath,\n );\n\n if (existingErrorImport) {\n // Get already imported error names\n const existingNamedImports = existingErrorImport\n .getNamedImports()\n .map((namedImport) => namedImport.getName());\n\n // Only import errors that aren't already imported\n const newErrorsToImport = errorClassNames.filter(\n (errorName) => !existingNamedImports.includes(errorName),\n );\n\n if (newErrorsToImport.length > 0) {\n // Add new named imports to existing import declaration\n existingErrorImport.addNamedImports(newErrorsToImport);\n }\n } else {\n // Create new import declaration\n this.importManager.addNamedImports(\n sourceFile,\n errorClassNames,\n errorImportPath,\n );\n }\n }\n }\n\n private getOutputPath(context: GenerationContext): string {\n return this.directoryManager.getReducerPath(\n context.rootDir,\n context.docModel.name,\n context.module.name,\n );\n }\n\n private createReducerObject(\n sourceFile: SourceFile,\n typeName: string,\n context: GenerationContext,\n ): void {\n const { operations, forceUpdate } = context;\n const operationHandlersObjectName = `${camelCase(context.docModel.name)}${pascalCase(context.module.name)}Operations`;\n const legacyReducerVar = sourceFile.getVariableDeclaration(\"reducer\");\n if (legacyReducerVar) {\n this.declarationManager.renameVariable(\n sourceFile,\n \"reducer\",\n operationHandlersObjectName,\n );\n }\n let reducerVar = sourceFile.getVariableDeclaration(\n operationHandlersObjectName,\n );\n if (!reducerVar) {\n sourceFile.addVariableStatement({\n declarationKind: VariableDeclarationKind.Const,\n isExported: true,\n declarations: [\n {\n name: operationHandlersObjectName,\n type: typeName,\n initializer: \"{}\",\n },\n ],\n });\n reducerVar = sourceFile.getVariableDeclarationOrThrow(\n operationHandlersObjectName,\n );\n } else {\n // Ensure correct type\n const typeNode = reducerVar.getTypeNode();\n if (!typeNode || typeNode.getText() !== typeName) {\n reducerVar.setType(typeName);\n }\n }\n\n const initializer = reducerVar.getInitializerIfKindOrThrow(\n SyntaxKind.ObjectLiteralExpression,\n );\n\n for (const operation of operations) {\n this.addReducerMethod(initializer, operation, forceUpdate);\n }\n }\n\n private addReducerMethod(\n objectLiteral: ObjectLiteralExpression,\n operation: CodegenOperation,\n forceUpdate = false,\n ): void {\n const actionName = camelCase(operation.name ?? \"\");\n if (!actionName) return;\n\n const methodName = `${actionName}Operation`;\n\n const reducerCode = operation.reducer?.trim();\n\n const existingReducer = objectLiteral\n .getProperty(methodName)\n ?.asKind(SyntaxKind.MethodDeclaration);\n\n // if reducer already exists but forceUpdate is true, update it\n if (existingReducer) {\n if (forceUpdate && reducerCode) {\n existingReducer.setBodyText(\"\");\n this.setReducerMethodCode(existingReducer, reducerCode);\n }\n return;\n }\n\n // if reducer doesn't exist, create it and set the code with the default code if no code is provided\n const method = objectLiteral.addMethod({\n name: methodName,\n parameters: [{ name: \"state\" }, { name: \"action\" }],\n });\n this.setReducerMethodCode(method, reducerCode);\n }\n\n private setReducerMethodCode(reducer: MethodDeclaration, code?: string) {\n reducer.addStatements(\n code ? [code] : ReducerGenerator.getDefaultReducerCode(reducer.getName()),\n );\n }\n}\n","import type { SourceFile } from \"ts-morph\";\n\nexport class DeclarationManager {\n renameVariable(\n sourceFile: SourceFile,\n oldName: string,\n newName: string,\n ): void {\n const variable = sourceFile.getVariableDeclaration(oldName);\n\n if (variable) {\n variable.getNameNode().replaceWithText(newName);\n sourceFile.saveSync();\n }\n }\n}\n","import type { PHProjectDirectories } from \"@powerhousedao/codegen\";\nimport { kebabCase, pascalCase } from \"change-case\";\nimport fs from \"fs/promises\";\nimport path from \"path\";\nimport type { Project, SourceFile } from \"ts-morph\";\n\nexport class DirectoryManager {\n private directories: Required<PHProjectDirectories> = {\n documentModelDir: \"document-model\",\n editorsDir: \"editors\",\n processorsDir: \"processors\",\n subgraphsDir: \"subgraphs\",\n };\n\n constructor(directories: PHProjectDirectories = {}) {\n this.directories = {\n ...this.directories,\n ...directories,\n };\n }\n async ensureExists(dirPath: string): Promise<void> {\n try {\n await fs.mkdir(dirPath, { recursive: true });\n } catch (err) {\n console.error(`Failed to create directory: ${dirPath}`, err);\n throw err;\n }\n }\n\n // Path builders for different file types\n getReducerPath(\n rootDir: string,\n docModelName: string,\n moduleName: string,\n ): string {\n return path.join(\n rootDir,\n this.directories.documentModelDir,\n kebabCase(docModelName),\n \"src\",\n \"reducers\",\n `${kebabCase(moduleName)}.ts`,\n );\n }\n\n getActionsPath(\n rootDir: string,\n docModelName: string,\n moduleName: string,\n ): string {\n return path.join(\n rootDir,\n this.directories.documentModelDir,\n kebabCase(docModelName),\n \"src\",\n \"actions\",\n `${kebabCase(moduleName)}.ts`,\n );\n }\n\n getComponentPath(\n rootDir: string,\n docModelName: string,\n componentName: string,\n ): string {\n return path.join(\n rootDir,\n this.directories.documentModelDir,\n kebabCase(docModelName),\n \"src\",\n \"components\",\n `${pascalCase(componentName)}.tsx`,\n );\n }\n\n getTypesPath(rootDir: string, docModelName: string): string {\n return path.join(\n rootDir,\n this.directories.documentModelDir,\n kebabCase(docModelName),\n \"src\",\n \"types.ts\",\n );\n }\n\n async createSourceFile(\n project: Project,\n filePath: string,\n ): Promise<SourceFile> {\n await this.ensureExists(path.dirname(filePath));\n return (\n project.addSourceFileAtPathIfExists(filePath) ??\n project.createSourceFile(filePath, \"\", { overwrite: false })\n );\n }\n}\n","import type { ImportDeclaration, SourceFile } from \"ts-morph\";\n\nexport interface ImportSpec {\n moduleSpecifier: string;\n namedImports?: string[];\n defaultImport?: string;\n isTypeOnly?: boolean;\n}\n\nexport class ImportManager {\n addImport(sourceFile: SourceFile, spec: ImportSpec): void {\n // Check if import already exists\n const existing = sourceFile.getImportDeclaration(\n (imp) => imp.getFullText() === spec.moduleSpecifier,\n );\n if (existing) {\n this.mergeImports(existing, spec);\n } else {\n sourceFile.addImportDeclaration(spec);\n }\n }\n\n addTypeImport(sourceFile: SourceFile, typeName: string, path: string): void {\n this.addImport(sourceFile, {\n moduleSpecifier: path,\n namedImports: [typeName],\n isTypeOnly: true,\n });\n }\n\n addNamedImports(\n sourceFile: SourceFile,\n imports: string[],\n path: string,\n ): void {\n this.addImport(sourceFile, {\n moduleSpecifier: path,\n namedImports: imports,\n });\n }\n\n private mergeImports(\n existingImport: ImportDeclaration,\n newSpec: ImportSpec,\n ): void {\n // Logic to merge named imports if they don't already exist\n if (newSpec.namedImports) {\n const existingNames = existingImport\n .getNamedImports()\n .map((ni) => ni.getName());\n const newNames = newSpec.namedImports.filter(\n (name) => !existingNames.includes(name),\n );\n\n if (newNames.length > 0) {\n existingImport.addNamedImports(newNames);\n }\n }\n }\n\n replaceImportByName(\n sourceFile: SourceFile,\n name: string,\n path: string,\n isTypeOnly = false,\n ): void {\n const existing = sourceFile\n .getImportDeclarations()\n .filter((imp) =>\n imp.getNamedImports().find((ni) => ni.getName() === name),\n );\n existing.forEach((imp) => imp.remove());\n sourceFile.addImportDeclaration({\n moduleSpecifier: path,\n namedImports: [name],\n isTypeOnly,\n });\n sourceFile.saveSync();\n }\n}\n","import type {\n DocumentModelGlobalState,\n ModuleSpecification,\n} from \"@powerhousedao/shared/document-model\";\nimport fs from \"fs/promises\";\nimport { Project } from \"ts-morph\";\nimport { DeclarationManager } from \"../utilities/DeclarationManager.js\";\nimport { DirectoryManager } from \"../utilities/DirectoryManager.js\";\nimport { ImportManager } from \"../utilities/ImportManager.js\";\nimport type { FileGenerator } from \"./FileGenerator.js\";\nimport type {\n CodeGeneratorOptions,\n CodegenOperation,\n GenerationContext,\n PHProjectDirectories,\n} from \"./GenerationContext.js\";\nimport { ReducerGenerator } from \"./ReducerGenerator.js\";\n\nexport class TSMorphCodeGenerator {\n private project = new Project();\n private generators = new Map<string, FileGenerator>();\n private directories: PHProjectDirectories = {\n documentModelDir: \"document-model\",\n editorsDir: \"editors\",\n processorsDir: \"processors\",\n subgraphsDir: \"subgraphs\",\n };\n private forceUpdate = false;\n\n constructor(\n private rootDir: string,\n private docModels: DocumentModelGlobalState[],\n private packageName: string,\n options: CodeGeneratorOptions = { directories: {}, forceUpdate: false },\n ) {\n this.directories = {\n ...this.directories,\n ...options.directories,\n };\n this.packageName = packageName;\n this.forceUpdate = options.forceUpdate ?? false;\n\n this.setupGenerators();\n }\n\n private setupGenerators(): void {\n const importManager = new ImportManager();\n const directoryManager = new DirectoryManager(this.directories);\n const declarationManager = new DeclarationManager();\n // Register all generators\n this.generators.set(\n \"reducers\",\n new ReducerGenerator(importManager, directoryManager, declarationManager),\n );\n }\n\n // Generate specific file types\n async generateReducers(): Promise<void> {\n await this.generateFileType(\"reducers\");\n }\n\n // Generate everything\n async generateAll(): Promise<void> {\n for (const [type] of this.generators) {\n await this.generateFileType(type);\n }\n }\n\n private async generateFileType(type: string): Promise<void> {\n const generator = this.generators.get(type);\n if (!generator) {\n throw new Error(`No generator registered for type: ${type}`);\n }\n\n await this.setupProject();\n\n for (const docModel of this.docModels) {\n const latestSpec =\n docModel.specifications[docModel.specifications.length - 1];\n\n for (const module of latestSpec.modules) {\n const context = this.createGenerationContext(\n docModel,\n module,\n this.forceUpdate,\n );\n\n await generator.generate(context);\n }\n }\n }\n\n private async setupProject(): Promise<void> {\n // Only load files from configured directories\n const sourcePaths: string[] = [];\n\n if (this.directories.documentModelDir) {\n const dirPath = `${this.rootDir}/${this.directories.documentModelDir}`;\n await this.ensureDirectoryExists(dirPath);\n sourcePaths.push(`${dirPath}/**/*.ts`);\n }\n if (this.directories.editorsDir) {\n const dirPath = `${this.rootDir}/${this.directories.editorsDir}`;\n await this.ensureDirectoryExists(dirPath);\n sourcePaths.push(`${dirPath}/**/*.ts`);\n }\n if (this.directories.processorsDir) {\n const dirPath = `${this.rootDir}/${this.directories.processorsDir}`;\n await this.ensureDirectoryExists(dirPath);\n sourcePaths.push(`${dirPath}/**/*.ts`);\n }\n if (this.directories.subgraphsDir) {\n const dirPath = `${this.rootDir}/${this.directories.subgraphsDir}`;\n await this.ensureDirectoryExists(dirPath);\n sourcePaths.push(`${dirPath}/**/*.ts`);\n }\n\n // Exclude node_modules from all paths\n sourcePaths.push(`!${this.rootDir}/**/node_modules/**`);\n\n if (sourcePaths.length > 0) {\n this.project.addSourceFilesAtPaths(sourcePaths);\n }\n }\n\n private createGenerationContext(\n docModel: DocumentModelGlobalState,\n module: ModuleSpecification,\n forceUpdate = false,\n ): GenerationContext {\n const operations: CodegenOperation[] = module.operations.map((op) => ({\n ...op,\n hasInput: op.schema !== null,\n hasAttachment: op.schema?.includes(\": Attachment\"),\n scope: op.scope || \"global\",\n state: op.scope === \"global\" ? \"\" : op.scope,\n }));\n\n return {\n rootDir: this.rootDir,\n packageName: this.packageName,\n docModel,\n module,\n project: this.project,\n operations,\n forceUpdate,\n };\n }\n\n private async ensureDirectoryExists(dirPath: string): Promise<void> {\n try {\n await fs.mkdir(dirPath, { recursive: true });\n } catch (err) {\n console.error(`Failed to create directory: ${dirPath}`, err);\n throw err;\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAQA,eAAsB,kBACpB,MACmC;CACnC,IAAI;AACJ,KAAI;AACF,MAAI,CAAC,KACH,OAAM,IAAI,MAAM,oCAAoC;WAC3C,KAAK,SAAS,OAAO,IAAI,KAAK,SAAS,OAAO,CAEvD,kBADa,MAAM,iBAAiB,MAAM,qBAAqB,EAC1C,MAAM;WAClB,KAAK,SAAS,QAAQ,EAAE;GACjC,MAAM,OAAO,MAAM,SAAS,MAAM,QAAQ;GAC1C,MAAM,aAAa,KAAK,MAAM,KAAK;AACnC,OAAI,WAAW,WACb,iBAAgB,WAAW,MAAM;OAEjC,iBAAgB;QAGlB,OAAM,IAAI,MAAM,sDAAsD;AAExE,SAAO;UACA,OAAO;AACd,QAAO,MAA4B,SAAS,qCACxC,IAAI,MAAM,4BAA4B,GACtC;;;;;ACQR,eAAsB,sBACpB,oBACA,SACA;AACA,OAAM,6BAA6B,oBAAoB,QAAQ;;AAIjE,eAAsB,0BAA0B,SAAkB;CAChE,MAAM,EAAE,WAAW,sBAAsB,qBACvC,SACA,kBACD;CAED,MAAM,0BAA0B,KAC9BA,cAF4B,kBAAkB,SAAS,EAEpB,EAAE,eAAe,MAAM,CAAC,EAC3D,QAAQ,WAAW,OAAO,aAAa,CAAC,EACxC,KAAK,QAAQC,OAAK,IAAI,YAAY,GAAG,IAAI,KAAK,GAAG,IAAI,KAAK,OAAO,CAAC,EAClE,QACG,YACCC,WAAS,SAAS,EAAE,gBAAgB,OAAO,CAAC,EAAE,QAAQ,IAAI,MAC7D,EACD,KAAK,YAAY,iBAAiB,QAAQ,CAAC,EAC3C,QACG,cACC,gCAAgC,CAAC,UAAU,UAAU,CAAC,YAAY,KACrE,CACF;AAED,M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,YAAY;AACpD,SAAM,KAAK,sBAAsB,QAAQ;AACzC,eAAY,KAAK,GAAG,QAAQ,UAAU;;AAExC,MAAI,KAAK,YAAY,eAAe;GAClC,MAAM,UAAU,GAAG,KAAK,QAAQ,GAAG,KAAK,YAAY;AACpD,SAAM,KAAK,sBAAsB,QAAQ;AACzC,eAAY,KAAK,GAAG,QAAQ,UAAU;;AAExC,MAAI,KAAK,YAAY,cAAc;GACjC,MAAM,UAAU,GAAG,KAAK,QAAQ,GAAG,KAAK,YAAY;AACpD,SAAM,KAAK,sBAAsB,QAAQ;AACzC,eAAY,KAAK,GAAG,QAAQ,UAAU;;AAIxC,cAAY,KAAK,IAAI,KAAK,QAAQ,qBAAqB;AAEvD,MAAI,YAAY,SAAS,EACvB,MAAK,QAAQ,sBAAsB,YAAY;;CAInD,wBACE,UACA,QACA,cAAc,OACK;EACnB,MAAM,aAAiC,OAAO,WAAW,KAAK,QAAQ;GACpE,GAAG;GACH,UAAU,GAAG,WAAW;GACxB,eAAe,GAAG,QAAQ,SAAS,eAAe;GAClD,OAAO,GAAG,SAAS;GACnB,OAAO,GAAG,UAAU,WAAW,KAAK,GAAG;GACxC,EAAE;AAEH,SAAO;GACL,SAAS,KAAK;GACd,aAAa,KAAK;GAClB;GACA;GACA,SAAS,KAAK;GACd;GACA;GACD;;CAGH,MAAc,sBAAsB,SAAgC;AAClE,MAAI;AACF,SAAMC,KAAG,MAAM,SAAS,EAAE,WAAW,MAAM,CAAC;WACrC,KAAK;AACZ,WAAQ,MAAM,+BAA+B,WAAW,IAAI;AAC5D,SAAM"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/codegen",
3
- "version": "6.0.0-dev.193",
3
+ "version": "6.0.0-dev.194",
4
4
  "license": "AGPL-3.0-only",
5
5
  "private": false,
6
6
  "type": "module",
@@ -34,19 +34,13 @@
34
34
  }
35
35
  },
36
36
  "dependencies": {
37
- "@graphql-codegen/add": "6.0.0",
38
37
  "@graphql-codegen/cli": "6.1.1",
39
38
  "@graphql-codegen/typescript": "5.0.7",
40
- "@pnpm/find-workspace-dir": "^1000.1.5",
41
- "@pnpm/find-workspace-packages": "^6.0.9",
42
39
  "@powerhousedao/document-engineering": "1.40.1",
43
40
  "@types/node": "25.2.3",
44
41
  "arg": "^5.0.2",
45
42
  "chalk": "5.6.2",
46
43
  "change-case": "5.4.4",
47
- "enquirer": "2.4.1",
48
- "execa": "^8.0.1",
49
- "get-tsconfig": "4.13.7",
50
44
  "graphql": "16.12.0",
51
45
  "graphql-codegen-typescript-validation-schema": "0.18.1",
52
46
  "load-json-file": "^7.0.1",
@@ -54,17 +48,18 @@
54
48
  "prettier": "3.8.1",
55
49
  "read-pkg": "10.1.0",
56
50
  "remeda": "^2.33.7",
57
- "semver": "7.7.4",
58
51
  "ts-morph": "27.0.2",
59
- "tsdown": "0.21.1",
60
52
  "write-json-file": "^7.0.0",
61
53
  "write-package": "7.2.0",
62
- "@powerhousedao/shared": "6.0.0-dev.193",
63
- "document-model": "6.0.0-dev.193"
54
+ "@powerhousedao/shared": "6.0.0-dev.194",
55
+ "document-model": "6.0.0-dev.194"
64
56
  },
65
57
  "devDependencies": {
58
+ "@pnpm/find-workspace-dir": "^1000.1.5",
59
+ "@pnpm/find-workspace-packages": "^6.0.9",
66
60
  "@tmpl/core": "npm:@jsr/tmpl__core@^0.6.3",
67
- "@types/npm-registry-fetch": "^8.0.9"
61
+ "@types/npm-registry-fetch": "^8.0.9",
62
+ "tsdown": "0.21.1"
68
63
  },
69
64
  "scripts": {
70
65
  "tsc": "tsc",