@powerhousedao/codegen 6.0.0-dev.228 → 6.0.0-dev.229
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.mjs +122 -64
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -177,7 +177,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
177
177
|
"dir": "/home/runner/work/powerhouse/powerhouse/apps/academy",
|
|
178
178
|
"manifest": {
|
|
179
179
|
"name": "@powerhousedao/academy",
|
|
180
|
-
"version": "6.0.0-dev.
|
|
180
|
+
"version": "6.0.0-dev.229",
|
|
181
181
|
"homepage": "https://powerhouse.academy",
|
|
182
182
|
"packageManager": "pnpm@10.9.0",
|
|
183
183
|
"repository": {
|
|
@@ -243,7 +243,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
243
243
|
"manifest": {
|
|
244
244
|
"name": "@powerhousedao/connect",
|
|
245
245
|
"productName": "Powerhouse-Connect",
|
|
246
|
-
"version": "6.0.0-dev.
|
|
246
|
+
"version": "6.0.0-dev.229",
|
|
247
247
|
"description": "Powerhouse Connect",
|
|
248
248
|
"main": "dist/index.html",
|
|
249
249
|
"type": "module",
|
|
@@ -355,7 +355,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
355
355
|
"manifest": {
|
|
356
356
|
"name": "@powerhousedao/switchboard",
|
|
357
357
|
"type": "module",
|
|
358
|
-
"version": "6.0.0-dev.
|
|
358
|
+
"version": "6.0.0-dev.229",
|
|
359
359
|
"main": "dist/index.mjs",
|
|
360
360
|
"exports": {
|
|
361
361
|
".": {
|
|
@@ -413,7 +413,6 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
413
413
|
"@powerhousedao/reactor-api": "workspace:*",
|
|
414
414
|
"@powerhousedao/reactor-attachments": "workspace:*",
|
|
415
415
|
"@renown/sdk": "workspace:*",
|
|
416
|
-
"@pyroscope/nodejs": "^0.4.5",
|
|
417
416
|
"@sentry/node": "^9.6.1",
|
|
418
417
|
"document-model": "workspace:*",
|
|
419
418
|
"dotenv": "^16.4.7",
|
|
@@ -424,6 +423,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
424
423
|
"vite": "catalog:"
|
|
425
424
|
},
|
|
426
425
|
"devDependencies": {
|
|
426
|
+
"@pyroscope/nodejs": "^0.4.5",
|
|
427
427
|
"@types/express": "^4.17.25",
|
|
428
428
|
"@types/node": "catalog:",
|
|
429
429
|
"@types/pg": "catalog:",
|
|
@@ -440,7 +440,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
440
440
|
"dir": "/home/runner/work/powerhouse/powerhouse/clis/ph-cli",
|
|
441
441
|
"manifest": {
|
|
442
442
|
"name": "@powerhousedao/ph-cli",
|
|
443
|
-
"version": "6.0.0-dev.
|
|
443
|
+
"version": "6.0.0-dev.229",
|
|
444
444
|
"description": "",
|
|
445
445
|
"license": "AGPL-3.0-only",
|
|
446
446
|
"type": "module",
|
|
@@ -507,7 +507,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
507
507
|
"dir": "/home/runner/work/powerhouse/powerhouse/clis/ph-cmd",
|
|
508
508
|
"manifest": {
|
|
509
509
|
"name": "ph-cmd",
|
|
510
|
-
"version": "6.0.0-dev.
|
|
510
|
+
"version": "6.0.0-dev.229",
|
|
511
511
|
"description": "",
|
|
512
512
|
"license": "AGPL-3.0-only",
|
|
513
513
|
"type": "module",
|
|
@@ -554,7 +554,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
554
554
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/browser",
|
|
555
555
|
"manifest": {
|
|
556
556
|
"name": "@powerhousedao/analytics-engine-browser",
|
|
557
|
-
"version": "6.0.0-dev.
|
|
557
|
+
"version": "6.0.0-dev.229",
|
|
558
558
|
"license": "AGPL-3.0-only",
|
|
559
559
|
"repository": {
|
|
560
560
|
"type": "git",
|
|
@@ -601,7 +601,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
601
601
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/core",
|
|
602
602
|
"manifest": {
|
|
603
603
|
"name": "@powerhousedao/analytics-engine-core",
|
|
604
|
-
"version": "6.0.0-dev.
|
|
604
|
+
"version": "6.0.0-dev.229",
|
|
605
605
|
"license": "AGPL-3.0-only",
|
|
606
606
|
"repository": {
|
|
607
607
|
"type": "git",
|
|
@@ -635,7 +635,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
635
635
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/graphql",
|
|
636
636
|
"manifest": {
|
|
637
637
|
"name": "@powerhousedao/analytics-engine-graphql",
|
|
638
|
-
"version": "6.0.0-dev.
|
|
638
|
+
"version": "6.0.0-dev.229",
|
|
639
639
|
"license": "AGPL-3.0-only",
|
|
640
640
|
"repository": {
|
|
641
641
|
"type": "git",
|
|
@@ -668,7 +668,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
668
668
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/knex",
|
|
669
669
|
"manifest": {
|
|
670
670
|
"name": "@powerhousedao/analytics-engine-knex",
|
|
671
|
-
"version": "6.0.0-dev.
|
|
671
|
+
"version": "6.0.0-dev.229",
|
|
672
672
|
"license": "AGPL-3.0-only",
|
|
673
673
|
"repository": {
|
|
674
674
|
"type": "git",
|
|
@@ -706,7 +706,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
706
706
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/pg",
|
|
707
707
|
"manifest": {
|
|
708
708
|
"name": "@powerhousedao/analytics-engine-pg",
|
|
709
|
-
"version": "6.0.0-dev.
|
|
709
|
+
"version": "6.0.0-dev.229",
|
|
710
710
|
"license": "AGPL-3.0-only",
|
|
711
711
|
"repository": {
|
|
712
712
|
"type": "git",
|
|
@@ -752,7 +752,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
752
752
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/builder-tools",
|
|
753
753
|
"manifest": {
|
|
754
754
|
"name": "@powerhousedao/builder-tools",
|
|
755
|
-
"version": "6.0.0-dev.
|
|
755
|
+
"version": "6.0.0-dev.229",
|
|
756
756
|
"type": "module",
|
|
757
757
|
"license": "AGPL-3.0-only",
|
|
758
758
|
"publishConfig": { "access": "public" },
|
|
@@ -774,7 +774,6 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
774
774
|
"dependencies": {
|
|
775
775
|
"@powerhousedao/config": "workspace:*",
|
|
776
776
|
"@powerhousedao/shared": "workspace:*",
|
|
777
|
-
"@sentry/vite-plugin": "^4.3.0",
|
|
778
777
|
"@tailwindcss/vite": "catalog:",
|
|
779
778
|
"@vitejs/plugin-react": "catalog:",
|
|
780
779
|
"document-model": "workspace:*",
|
|
@@ -783,16 +782,19 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
783
782
|
"zod": "catalog:"
|
|
784
783
|
},
|
|
785
784
|
"devDependencies": {
|
|
785
|
+
"@sentry/vite-plugin": "^4.3.0",
|
|
786
786
|
"tsdown": "catalog:",
|
|
787
787
|
"tsx": "catalog:"
|
|
788
|
-
}
|
|
788
|
+
},
|
|
789
|
+
"peerDependencies": { "@sentry/vite-plugin": "^4.3.0" },
|
|
790
|
+
"peerDependenciesMeta": { "@sentry/vite-plugin": { "optional": true } }
|
|
789
791
|
}
|
|
790
792
|
},
|
|
791
793
|
{
|
|
792
794
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/codegen",
|
|
793
795
|
"manifest": {
|
|
794
796
|
"name": "@powerhousedao/codegen",
|
|
795
|
-
"version": "6.0.0-dev.
|
|
797
|
+
"version": "6.0.0-dev.229",
|
|
796
798
|
"license": "AGPL-3.0-only",
|
|
797
799
|
"private": false,
|
|
798
800
|
"type": "module",
|
|
@@ -865,7 +867,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
865
867
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/common",
|
|
866
868
|
"manifest": {
|
|
867
869
|
"name": "@powerhousedao/common",
|
|
868
|
-
"version": "6.0.0-dev.
|
|
870
|
+
"version": "6.0.0-dev.229",
|
|
869
871
|
"license": "AGPL-3.0-only",
|
|
870
872
|
"type": "module",
|
|
871
873
|
"files": ["/dist"],
|
|
@@ -917,7 +919,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
917
919
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/config",
|
|
918
920
|
"manifest": {
|
|
919
921
|
"name": "@powerhousedao/config",
|
|
920
|
-
"version": "6.0.0-dev.
|
|
922
|
+
"version": "6.0.0-dev.229",
|
|
921
923
|
"description": "",
|
|
922
924
|
"license": "AGPL-3.0-only",
|
|
923
925
|
"private": false,
|
|
@@ -952,7 +954,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
952
954
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/design-system",
|
|
953
955
|
"manifest": {
|
|
954
956
|
"name": "@powerhousedao/design-system",
|
|
955
|
-
"version": "6.0.0-dev.
|
|
957
|
+
"version": "6.0.0-dev.229",
|
|
956
958
|
"description": "",
|
|
957
959
|
"files": ["dist", "theme.css"],
|
|
958
960
|
"type": "module",
|
|
@@ -1106,7 +1108,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1106
1108
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/document-model",
|
|
1107
1109
|
"manifest": {
|
|
1108
1110
|
"name": "document-model",
|
|
1109
|
-
"version": "6.0.0-dev.
|
|
1111
|
+
"version": "6.0.0-dev.229",
|
|
1110
1112
|
"license": "AGPL-3.0-only",
|
|
1111
1113
|
"private": false,
|
|
1112
1114
|
"files": ["dist"],
|
|
@@ -1164,7 +1166,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1164
1166
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/opentelemetry-instrumentation-reactor",
|
|
1165
1167
|
"manifest": {
|
|
1166
1168
|
"name": "@powerhousedao/opentelemetry-instrumentation-reactor",
|
|
1167
|
-
"version": "6.0.0-dev.
|
|
1169
|
+
"version": "6.0.0-dev.229",
|
|
1168
1170
|
"description": "OpenTelemetry instrumentation for @powerhousedao/reactor",
|
|
1169
1171
|
"type": "module",
|
|
1170
1172
|
"sideEffects": false,
|
|
@@ -1201,7 +1203,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1201
1203
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/powerhouse-vetra-packages",
|
|
1202
1204
|
"manifest": {
|
|
1203
1205
|
"name": "@powerhousedao/powerhouse-vetra-packages",
|
|
1204
|
-
"version": "6.0.0-dev.
|
|
1206
|
+
"version": "6.0.0-dev.229",
|
|
1205
1207
|
"description": "",
|
|
1206
1208
|
"keywords": [],
|
|
1207
1209
|
"author": "",
|
|
@@ -1315,7 +1317,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1315
1317
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor",
|
|
1316
1318
|
"manifest": {
|
|
1317
1319
|
"name": "@powerhousedao/reactor",
|
|
1318
|
-
"version": "6.0.0-dev.
|
|
1320
|
+
"version": "6.0.0-dev.229",
|
|
1319
1321
|
"description": "",
|
|
1320
1322
|
"repository": {
|
|
1321
1323
|
"url": "https://github.com/powerhouse-inc/powerhouse",
|
|
@@ -1369,7 +1371,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1369
1371
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-api",
|
|
1370
1372
|
"manifest": {
|
|
1371
1373
|
"name": "@powerhousedao/reactor-api",
|
|
1372
|
-
"version": "6.0.0-dev.
|
|
1374
|
+
"version": "6.0.0-dev.229",
|
|
1373
1375
|
"description": "",
|
|
1374
1376
|
"type": "module",
|
|
1375
1377
|
"repository": {
|
|
@@ -1414,7 +1416,10 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1414
1416
|
"@apollo/subgraph": "^2.13.2",
|
|
1415
1417
|
"@as-integrations/express4": "^1.1.2",
|
|
1416
1418
|
"@electric-sql/pglite": "catalog:",
|
|
1417
|
-
"@opentelemetry/
|
|
1419
|
+
"@opentelemetry/instrumentation-express": "^0.48.0",
|
|
1420
|
+
"@opentelemetry/instrumentation-graphql": "^0.48.0",
|
|
1421
|
+
"@opentelemetry/instrumentation-http": "^0.200.0",
|
|
1422
|
+
"@opentelemetry/instrumentation-pg": "^0.52.0",
|
|
1418
1423
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.57.2",
|
|
1419
1424
|
"@opentelemetry/exporter-trace-otlp-http": "^0.57.2",
|
|
1420
1425
|
"@opentelemetry/resources": "^1.29.0",
|
|
@@ -1487,7 +1492,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1487
1492
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-attachments",
|
|
1488
1493
|
"manifest": {
|
|
1489
1494
|
"name": "@powerhousedao/reactor-attachments",
|
|
1490
|
-
"version": "6.0.0-dev.
|
|
1495
|
+
"version": "6.0.0-dev.229",
|
|
1491
1496
|
"license": "AGPL-3.0-only",
|
|
1492
1497
|
"type": "module",
|
|
1493
1498
|
"repository": {
|
|
@@ -1523,7 +1528,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1523
1528
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-browser",
|
|
1524
1529
|
"manifest": {
|
|
1525
1530
|
"name": "@powerhousedao/reactor-browser",
|
|
1526
|
-
"version": "6.0.0-dev.
|
|
1531
|
+
"version": "6.0.0-dev.229",
|
|
1527
1532
|
"license": "AGPL-3.0-only",
|
|
1528
1533
|
"type": "module",
|
|
1529
1534
|
"repository": {
|
|
@@ -1618,7 +1623,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1618
1623
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-hypercore",
|
|
1619
1624
|
"manifest": {
|
|
1620
1625
|
"name": "@powerhousedao/reactor-hypercore",
|
|
1621
|
-
"version": "6.0.0-dev.
|
|
1626
|
+
"version": "6.0.0-dev.229",
|
|
1622
1627
|
"description": "Hypercore-backed IOperationStore for the Powerhouse Reactor",
|
|
1623
1628
|
"repository": {
|
|
1624
1629
|
"url": "https://github.com/powerhouse-inc/powerhouse",
|
|
@@ -1660,7 +1665,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1660
1665
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-mcp",
|
|
1661
1666
|
"manifest": {
|
|
1662
1667
|
"name": "@powerhousedao/reactor-mcp",
|
|
1663
|
-
"version": "6.0.0-dev.
|
|
1668
|
+
"version": "6.0.0-dev.229",
|
|
1664
1669
|
"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.",
|
|
1665
1670
|
"type": "module",
|
|
1666
1671
|
"repository": {
|
|
@@ -1715,7 +1720,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1715
1720
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/registry",
|
|
1716
1721
|
"manifest": {
|
|
1717
1722
|
"name": "@powerhousedao/registry",
|
|
1718
|
-
"version": "6.0.0-dev.
|
|
1723
|
+
"version": "6.0.0-dev.229",
|
|
1719
1724
|
"description": "",
|
|
1720
1725
|
"type": "module",
|
|
1721
1726
|
"repository": {
|
|
@@ -1760,7 +1765,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1760
1765
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/renown",
|
|
1761
1766
|
"manifest": {
|
|
1762
1767
|
"name": "@renown/sdk",
|
|
1763
|
-
"version": "6.0.0-dev.
|
|
1768
|
+
"version": "6.0.0-dev.229",
|
|
1764
1769
|
"description": "",
|
|
1765
1770
|
"license": "AGPL-3.0-only",
|
|
1766
1771
|
"private": false,
|
|
@@ -1810,7 +1815,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1810
1815
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/shared",
|
|
1811
1816
|
"manifest": {
|
|
1812
1817
|
"name": "@powerhousedao/shared",
|
|
1813
|
-
"version": "6.0.0-dev.
|
|
1818
|
+
"version": "6.0.0-dev.229",
|
|
1814
1819
|
"type": "module",
|
|
1815
1820
|
"sideEffects": false,
|
|
1816
1821
|
"publishConfig": { "access": "public" },
|
|
@@ -1880,6 +1885,30 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1880
1885
|
"./clis": {
|
|
1881
1886
|
"source": "./clis/index.mts",
|
|
1882
1887
|
"import": "./dist/clis/index.mjs"
|
|
1888
|
+
},
|
|
1889
|
+
"./clis/args": {
|
|
1890
|
+
"source": "./clis/args/index.ts",
|
|
1891
|
+
"import": "./dist/clis/args/index.mjs"
|
|
1892
|
+
},
|
|
1893
|
+
"./clis/args/*": {
|
|
1894
|
+
"source": "./clis/args/*.ts",
|
|
1895
|
+
"import": "./dist/clis/args/*.mjs"
|
|
1896
|
+
},
|
|
1897
|
+
"./clis/constants": {
|
|
1898
|
+
"source": "./clis/constants.ts",
|
|
1899
|
+
"import": "./dist/clis/constants.mjs"
|
|
1900
|
+
},
|
|
1901
|
+
"./clis/utils": {
|
|
1902
|
+
"source": "./clis/utils.ts",
|
|
1903
|
+
"import": "./dist/clis/utils.mjs"
|
|
1904
|
+
},
|
|
1905
|
+
"./clis/command-names": {
|
|
1906
|
+
"source": "./clis/command-names.ts",
|
|
1907
|
+
"import": "./dist/clis/command-names.mjs"
|
|
1908
|
+
},
|
|
1909
|
+
"./clis/telemetry": {
|
|
1910
|
+
"source": "./clis/services/telemetry.ts",
|
|
1911
|
+
"import": "./dist/clis/services/telemetry.mjs"
|
|
1883
1912
|
}
|
|
1884
1913
|
},
|
|
1885
1914
|
"dependencies": {
|
|
@@ -1919,7 +1948,7 @@ async function getFullyQualifiedWorkspacePackageVersion(versionOrTag) {
|
|
|
1919
1948
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/vetra",
|
|
1920
1949
|
"manifest": {
|
|
1921
1950
|
"name": "@powerhousedao/vetra",
|
|
1922
|
-
"version": "6.0.0-dev.
|
|
1951
|
+
"version": "6.0.0-dev.229",
|
|
1923
1952
|
"license": "AGPL-3.0-only",
|
|
1924
1953
|
"type": "module",
|
|
1925
1954
|
"sideEffects": false,
|
|
@@ -2447,7 +2476,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2447
2476
|
"dir": "/home/runner/work/powerhouse/powerhouse/apps/academy",
|
|
2448
2477
|
"manifest": {
|
|
2449
2478
|
"name": "@powerhousedao/academy",
|
|
2450
|
-
"version": "6.0.0-dev.
|
|
2479
|
+
"version": "6.0.0-dev.229",
|
|
2451
2480
|
"homepage": "https://powerhouse.academy",
|
|
2452
2481
|
"packageManager": "pnpm@10.9.0",
|
|
2453
2482
|
"repository": {
|
|
@@ -2513,7 +2542,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2513
2542
|
"manifest": {
|
|
2514
2543
|
"name": "@powerhousedao/connect",
|
|
2515
2544
|
"productName": "Powerhouse-Connect",
|
|
2516
|
-
"version": "6.0.0-dev.
|
|
2545
|
+
"version": "6.0.0-dev.229",
|
|
2517
2546
|
"description": "Powerhouse Connect",
|
|
2518
2547
|
"main": "dist/index.html",
|
|
2519
2548
|
"type": "module",
|
|
@@ -2625,7 +2654,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2625
2654
|
"manifest": {
|
|
2626
2655
|
"name": "@powerhousedao/switchboard",
|
|
2627
2656
|
"type": "module",
|
|
2628
|
-
"version": "6.0.0-dev.
|
|
2657
|
+
"version": "6.0.0-dev.229",
|
|
2629
2658
|
"main": "dist/index.mjs",
|
|
2630
2659
|
"exports": {
|
|
2631
2660
|
".": {
|
|
@@ -2683,7 +2712,6 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2683
2712
|
"@powerhousedao/reactor-api": "workspace:*",
|
|
2684
2713
|
"@powerhousedao/reactor-attachments": "workspace:*",
|
|
2685
2714
|
"@renown/sdk": "workspace:*",
|
|
2686
|
-
"@pyroscope/nodejs": "^0.4.5",
|
|
2687
2715
|
"@sentry/node": "^9.6.1",
|
|
2688
2716
|
"document-model": "workspace:*",
|
|
2689
2717
|
"dotenv": "^16.4.7",
|
|
@@ -2694,6 +2722,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2694
2722
|
"vite": "catalog:"
|
|
2695
2723
|
},
|
|
2696
2724
|
"devDependencies": {
|
|
2725
|
+
"@pyroscope/nodejs": "^0.4.5",
|
|
2697
2726
|
"@types/express": "^4.17.25",
|
|
2698
2727
|
"@types/node": "catalog:",
|
|
2699
2728
|
"@types/pg": "catalog:",
|
|
@@ -2710,7 +2739,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2710
2739
|
"dir": "/home/runner/work/powerhouse/powerhouse/clis/ph-cli",
|
|
2711
2740
|
"manifest": {
|
|
2712
2741
|
"name": "@powerhousedao/ph-cli",
|
|
2713
|
-
"version": "6.0.0-dev.
|
|
2742
|
+
"version": "6.0.0-dev.229",
|
|
2714
2743
|
"description": "",
|
|
2715
2744
|
"license": "AGPL-3.0-only",
|
|
2716
2745
|
"type": "module",
|
|
@@ -2777,7 +2806,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2777
2806
|
"dir": "/home/runner/work/powerhouse/powerhouse/clis/ph-cmd",
|
|
2778
2807
|
"manifest": {
|
|
2779
2808
|
"name": "ph-cmd",
|
|
2780
|
-
"version": "6.0.0-dev.
|
|
2809
|
+
"version": "6.0.0-dev.229",
|
|
2781
2810
|
"description": "",
|
|
2782
2811
|
"license": "AGPL-3.0-only",
|
|
2783
2812
|
"type": "module",
|
|
@@ -2824,7 +2853,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2824
2853
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/browser",
|
|
2825
2854
|
"manifest": {
|
|
2826
2855
|
"name": "@powerhousedao/analytics-engine-browser",
|
|
2827
|
-
"version": "6.0.0-dev.
|
|
2856
|
+
"version": "6.0.0-dev.229",
|
|
2828
2857
|
"license": "AGPL-3.0-only",
|
|
2829
2858
|
"repository": {
|
|
2830
2859
|
"type": "git",
|
|
@@ -2871,7 +2900,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2871
2900
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/core",
|
|
2872
2901
|
"manifest": {
|
|
2873
2902
|
"name": "@powerhousedao/analytics-engine-core",
|
|
2874
|
-
"version": "6.0.0-dev.
|
|
2903
|
+
"version": "6.0.0-dev.229",
|
|
2875
2904
|
"license": "AGPL-3.0-only",
|
|
2876
2905
|
"repository": {
|
|
2877
2906
|
"type": "git",
|
|
@@ -2905,7 +2934,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2905
2934
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/graphql",
|
|
2906
2935
|
"manifest": {
|
|
2907
2936
|
"name": "@powerhousedao/analytics-engine-graphql",
|
|
2908
|
-
"version": "6.0.0-dev.
|
|
2937
|
+
"version": "6.0.0-dev.229",
|
|
2909
2938
|
"license": "AGPL-3.0-only",
|
|
2910
2939
|
"repository": {
|
|
2911
2940
|
"type": "git",
|
|
@@ -2938,7 +2967,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2938
2967
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/knex",
|
|
2939
2968
|
"manifest": {
|
|
2940
2969
|
"name": "@powerhousedao/analytics-engine-knex",
|
|
2941
|
-
"version": "6.0.0-dev.
|
|
2970
|
+
"version": "6.0.0-dev.229",
|
|
2942
2971
|
"license": "AGPL-3.0-only",
|
|
2943
2972
|
"repository": {
|
|
2944
2973
|
"type": "git",
|
|
@@ -2976,7 +3005,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
2976
3005
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/analytics-engine/pg",
|
|
2977
3006
|
"manifest": {
|
|
2978
3007
|
"name": "@powerhousedao/analytics-engine-pg",
|
|
2979
|
-
"version": "6.0.0-dev.
|
|
3008
|
+
"version": "6.0.0-dev.229",
|
|
2980
3009
|
"license": "AGPL-3.0-only",
|
|
2981
3010
|
"repository": {
|
|
2982
3011
|
"type": "git",
|
|
@@ -3022,7 +3051,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3022
3051
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/builder-tools",
|
|
3023
3052
|
"manifest": {
|
|
3024
3053
|
"name": "@powerhousedao/builder-tools",
|
|
3025
|
-
"version": "6.0.0-dev.
|
|
3054
|
+
"version": "6.0.0-dev.229",
|
|
3026
3055
|
"type": "module",
|
|
3027
3056
|
"license": "AGPL-3.0-only",
|
|
3028
3057
|
"publishConfig": { "access": "public" },
|
|
@@ -3044,7 +3073,6 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3044
3073
|
"dependencies": {
|
|
3045
3074
|
"@powerhousedao/config": "workspace:*",
|
|
3046
3075
|
"@powerhousedao/shared": "workspace:*",
|
|
3047
|
-
"@sentry/vite-plugin": "^4.3.0",
|
|
3048
3076
|
"@tailwindcss/vite": "catalog:",
|
|
3049
3077
|
"@vitejs/plugin-react": "catalog:",
|
|
3050
3078
|
"document-model": "workspace:*",
|
|
@@ -3053,16 +3081,19 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3053
3081
|
"zod": "catalog:"
|
|
3054
3082
|
},
|
|
3055
3083
|
"devDependencies": {
|
|
3084
|
+
"@sentry/vite-plugin": "^4.3.0",
|
|
3056
3085
|
"tsdown": "catalog:",
|
|
3057
3086
|
"tsx": "catalog:"
|
|
3058
|
-
}
|
|
3087
|
+
},
|
|
3088
|
+
"peerDependencies": { "@sentry/vite-plugin": "^4.3.0" },
|
|
3089
|
+
"peerDependenciesMeta": { "@sentry/vite-plugin": { "optional": true } }
|
|
3059
3090
|
}
|
|
3060
3091
|
},
|
|
3061
3092
|
{
|
|
3062
3093
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/codegen",
|
|
3063
3094
|
"manifest": {
|
|
3064
3095
|
"name": "@powerhousedao/codegen",
|
|
3065
|
-
"version": "6.0.0-dev.
|
|
3096
|
+
"version": "6.0.0-dev.229",
|
|
3066
3097
|
"license": "AGPL-3.0-only",
|
|
3067
3098
|
"private": false,
|
|
3068
3099
|
"type": "module",
|
|
@@ -3135,7 +3166,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3135
3166
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/common",
|
|
3136
3167
|
"manifest": {
|
|
3137
3168
|
"name": "@powerhousedao/common",
|
|
3138
|
-
"version": "6.0.0-dev.
|
|
3169
|
+
"version": "6.0.0-dev.229",
|
|
3139
3170
|
"license": "AGPL-3.0-only",
|
|
3140
3171
|
"type": "module",
|
|
3141
3172
|
"files": ["/dist"],
|
|
@@ -3187,7 +3218,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3187
3218
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/config",
|
|
3188
3219
|
"manifest": {
|
|
3189
3220
|
"name": "@powerhousedao/config",
|
|
3190
|
-
"version": "6.0.0-dev.
|
|
3221
|
+
"version": "6.0.0-dev.229",
|
|
3191
3222
|
"description": "",
|
|
3192
3223
|
"license": "AGPL-3.0-only",
|
|
3193
3224
|
"private": false,
|
|
@@ -3222,7 +3253,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3222
3253
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/design-system",
|
|
3223
3254
|
"manifest": {
|
|
3224
3255
|
"name": "@powerhousedao/design-system",
|
|
3225
|
-
"version": "6.0.0-dev.
|
|
3256
|
+
"version": "6.0.0-dev.229",
|
|
3226
3257
|
"description": "",
|
|
3227
3258
|
"files": ["dist", "theme.css"],
|
|
3228
3259
|
"type": "module",
|
|
@@ -3376,7 +3407,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3376
3407
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/document-model",
|
|
3377
3408
|
"manifest": {
|
|
3378
3409
|
"name": "document-model",
|
|
3379
|
-
"version": "6.0.0-dev.
|
|
3410
|
+
"version": "6.0.0-dev.229",
|
|
3380
3411
|
"license": "AGPL-3.0-only",
|
|
3381
3412
|
"private": false,
|
|
3382
3413
|
"files": ["dist"],
|
|
@@ -3434,7 +3465,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3434
3465
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/opentelemetry-instrumentation-reactor",
|
|
3435
3466
|
"manifest": {
|
|
3436
3467
|
"name": "@powerhousedao/opentelemetry-instrumentation-reactor",
|
|
3437
|
-
"version": "6.0.0-dev.
|
|
3468
|
+
"version": "6.0.0-dev.229",
|
|
3438
3469
|
"description": "OpenTelemetry instrumentation for @powerhousedao/reactor",
|
|
3439
3470
|
"type": "module",
|
|
3440
3471
|
"sideEffects": false,
|
|
@@ -3471,7 +3502,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3471
3502
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/powerhouse-vetra-packages",
|
|
3472
3503
|
"manifest": {
|
|
3473
3504
|
"name": "@powerhousedao/powerhouse-vetra-packages",
|
|
3474
|
-
"version": "6.0.0-dev.
|
|
3505
|
+
"version": "6.0.0-dev.229",
|
|
3475
3506
|
"description": "",
|
|
3476
3507
|
"keywords": [],
|
|
3477
3508
|
"author": "",
|
|
@@ -3585,7 +3616,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3585
3616
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor",
|
|
3586
3617
|
"manifest": {
|
|
3587
3618
|
"name": "@powerhousedao/reactor",
|
|
3588
|
-
"version": "6.0.0-dev.
|
|
3619
|
+
"version": "6.0.0-dev.229",
|
|
3589
3620
|
"description": "",
|
|
3590
3621
|
"repository": {
|
|
3591
3622
|
"url": "https://github.com/powerhouse-inc/powerhouse",
|
|
@@ -3639,7 +3670,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3639
3670
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-api",
|
|
3640
3671
|
"manifest": {
|
|
3641
3672
|
"name": "@powerhousedao/reactor-api",
|
|
3642
|
-
"version": "6.0.0-dev.
|
|
3673
|
+
"version": "6.0.0-dev.229",
|
|
3643
3674
|
"description": "",
|
|
3644
3675
|
"type": "module",
|
|
3645
3676
|
"repository": {
|
|
@@ -3684,7 +3715,10 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3684
3715
|
"@apollo/subgraph": "^2.13.2",
|
|
3685
3716
|
"@as-integrations/express4": "^1.1.2",
|
|
3686
3717
|
"@electric-sql/pglite": "catalog:",
|
|
3687
|
-
"@opentelemetry/
|
|
3718
|
+
"@opentelemetry/instrumentation-express": "^0.48.0",
|
|
3719
|
+
"@opentelemetry/instrumentation-graphql": "^0.48.0",
|
|
3720
|
+
"@opentelemetry/instrumentation-http": "^0.200.0",
|
|
3721
|
+
"@opentelemetry/instrumentation-pg": "^0.52.0",
|
|
3688
3722
|
"@opentelemetry/exporter-metrics-otlp-http": "^0.57.2",
|
|
3689
3723
|
"@opentelemetry/exporter-trace-otlp-http": "^0.57.2",
|
|
3690
3724
|
"@opentelemetry/resources": "^1.29.0",
|
|
@@ -3757,7 +3791,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3757
3791
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-attachments",
|
|
3758
3792
|
"manifest": {
|
|
3759
3793
|
"name": "@powerhousedao/reactor-attachments",
|
|
3760
|
-
"version": "6.0.0-dev.
|
|
3794
|
+
"version": "6.0.0-dev.229",
|
|
3761
3795
|
"license": "AGPL-3.0-only",
|
|
3762
3796
|
"type": "module",
|
|
3763
3797
|
"repository": {
|
|
@@ -3793,7 +3827,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3793
3827
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-browser",
|
|
3794
3828
|
"manifest": {
|
|
3795
3829
|
"name": "@powerhousedao/reactor-browser",
|
|
3796
|
-
"version": "6.0.0-dev.
|
|
3830
|
+
"version": "6.0.0-dev.229",
|
|
3797
3831
|
"license": "AGPL-3.0-only",
|
|
3798
3832
|
"type": "module",
|
|
3799
3833
|
"repository": {
|
|
@@ -3888,7 +3922,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3888
3922
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-hypercore",
|
|
3889
3923
|
"manifest": {
|
|
3890
3924
|
"name": "@powerhousedao/reactor-hypercore",
|
|
3891
|
-
"version": "6.0.0-dev.
|
|
3925
|
+
"version": "6.0.0-dev.229",
|
|
3892
3926
|
"description": "Hypercore-backed IOperationStore for the Powerhouse Reactor",
|
|
3893
3927
|
"repository": {
|
|
3894
3928
|
"url": "https://github.com/powerhouse-inc/powerhouse",
|
|
@@ -3930,7 +3964,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3930
3964
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/reactor-mcp",
|
|
3931
3965
|
"manifest": {
|
|
3932
3966
|
"name": "@powerhousedao/reactor-mcp",
|
|
3933
|
-
"version": "6.0.0-dev.
|
|
3967
|
+
"version": "6.0.0-dev.229",
|
|
3934
3968
|
"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.",
|
|
3935
3969
|
"type": "module",
|
|
3936
3970
|
"repository": {
|
|
@@ -3985,7 +4019,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
3985
4019
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/registry",
|
|
3986
4020
|
"manifest": {
|
|
3987
4021
|
"name": "@powerhousedao/registry",
|
|
3988
|
-
"version": "6.0.0-dev.
|
|
4022
|
+
"version": "6.0.0-dev.229",
|
|
3989
4023
|
"description": "",
|
|
3990
4024
|
"type": "module",
|
|
3991
4025
|
"repository": {
|
|
@@ -4030,7 +4064,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
4030
4064
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/renown",
|
|
4031
4065
|
"manifest": {
|
|
4032
4066
|
"name": "@renown/sdk",
|
|
4033
|
-
"version": "6.0.0-dev.
|
|
4067
|
+
"version": "6.0.0-dev.229",
|
|
4034
4068
|
"description": "",
|
|
4035
4069
|
"license": "AGPL-3.0-only",
|
|
4036
4070
|
"private": false,
|
|
@@ -4080,7 +4114,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
4080
4114
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/shared",
|
|
4081
4115
|
"manifest": {
|
|
4082
4116
|
"name": "@powerhousedao/shared",
|
|
4083
|
-
"version": "6.0.0-dev.
|
|
4117
|
+
"version": "6.0.0-dev.229",
|
|
4084
4118
|
"type": "module",
|
|
4085
4119
|
"sideEffects": false,
|
|
4086
4120
|
"publishConfig": { "access": "public" },
|
|
@@ -4150,6 +4184,30 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
4150
4184
|
"./clis": {
|
|
4151
4185
|
"source": "./clis/index.mts",
|
|
4152
4186
|
"import": "./dist/clis/index.mjs"
|
|
4187
|
+
},
|
|
4188
|
+
"./clis/args": {
|
|
4189
|
+
"source": "./clis/args/index.ts",
|
|
4190
|
+
"import": "./dist/clis/args/index.mjs"
|
|
4191
|
+
},
|
|
4192
|
+
"./clis/args/*": {
|
|
4193
|
+
"source": "./clis/args/*.ts",
|
|
4194
|
+
"import": "./dist/clis/args/*.mjs"
|
|
4195
|
+
},
|
|
4196
|
+
"./clis/constants": {
|
|
4197
|
+
"source": "./clis/constants.ts",
|
|
4198
|
+
"import": "./dist/clis/constants.mjs"
|
|
4199
|
+
},
|
|
4200
|
+
"./clis/utils": {
|
|
4201
|
+
"source": "./clis/utils.ts",
|
|
4202
|
+
"import": "./dist/clis/utils.mjs"
|
|
4203
|
+
},
|
|
4204
|
+
"./clis/command-names": {
|
|
4205
|
+
"source": "./clis/command-names.ts",
|
|
4206
|
+
"import": "./dist/clis/command-names.mjs"
|
|
4207
|
+
},
|
|
4208
|
+
"./clis/telemetry": {
|
|
4209
|
+
"source": "./clis/services/telemetry.ts",
|
|
4210
|
+
"import": "./dist/clis/services/telemetry.mjs"
|
|
4153
4211
|
}
|
|
4154
4212
|
},
|
|
4155
4213
|
"dependencies": {
|
|
@@ -4189,7 +4247,7 @@ async function migrate(version, projectDir = process.cwd()) {
|
|
|
4189
4247
|
"dir": "/home/runner/work/powerhouse/powerhouse/packages/vetra",
|
|
4190
4248
|
"manifest": {
|
|
4191
4249
|
"name": "@powerhousedao/vetra",
|
|
4192
|
-
"version": "6.0.0-dev.
|
|
4250
|
+
"version": "6.0.0-dev.229",
|
|
4193
4251
|
"license": "AGPL-3.0-only",
|
|
4194
4252
|
"type": "module",
|
|
4195
4253
|
"sideEffects": false,
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["readdirSync","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 { type DocumentModelGlobalState } from \"@powerhousedao/shared/document-model\";\nimport type { ProcessorApps } 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 { readdirSync } from \"node:fs\";\nimport {\n filter,\n isDefined,\n isIncludedIn,\n isTruthy,\n map,\n pipe,\n prop,\n unique,\n} from \"remeda\";\nimport type { Project } from \"ts-morph\";\nimport {\n getAppMetadata,\n getEditorMetadata,\n getOrCreateDirectory,\n getProcessorMetadata,\n getSubgraphMetadata,\n loadDocumentModelInDir,\n} 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 map(loadDocumentModelInDir),\n filter(isDefined),\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\n /* An editor's `id`, `name`, and `documentTypes` args can be found in the `module.ts` file */\n const editorsToAdd = pipe(\n editorsDir.getDirectories(),\n map((dir) => dir.getBaseName()),\n map((dirName) => getEditorMetadata(project, dirName)),\n filter(isTruthy),\n filter(\n ({ documentTypes }) =>\n !isIncludedIn(\"powerhouse/document-drive\", documentTypes),\n ),\n );\n\n for (const editorToAdd of editorsToAdd) {\n const {\n name: editorName,\n id: editorId,\n dirName: editorDirName,\n documentTypes,\n } = editorToAdd;\n\n await generateEditor(\n {\n editorName,\n editorId,\n editorDirName,\n documentTypes,\n },\n project,\n );\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\n /* An editor's `id`, `name`, and `documentTypes` args can be found in the `module.ts` file */\n const appsToAdd = pipe(\n editorsDir.getDirectories(),\n map((dir) => dir.getBaseName()),\n map((dirName) => getAppMetadata(project, dirName)),\n filter(isTruthy),\n );\n\n for (const appToAdd of appsToAdd) {\n const {\n name: appName,\n id: appId,\n dirName: appDirName,\n allowedDocumentTypes,\n isDragAndDropEnabled,\n } = appToAdd;\n await generateApp(\n {\n appName,\n appDirName,\n appId,\n allowedDocumentTypes,\n isDragAndDropEnabled,\n },\n project,\n );\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.getBaseName()),\n map((dirName) => getSubgraphMetadata(project, dirName)),\n map(prop(\"subgraphName\")),\n filter(isDefined),\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 processorsToGenerate = pipe(\n processorsDir.getDirectories(),\n map((dir) => dir.getBaseName()),\n map((dirName) => getProcessorMetadata(project, dirName)),\n );\n\n for (const processorArgs of processorsToGenerate) {\n await generateProcessor(processorArgs, project);\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 packageJsonExports,\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 { type PackageJson, 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 { writePackage } 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({\n cwd: projectDir,\n normalize: false,\n });\n const exports = packageJsonExports;\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 const updatedPackageJson: PackageJson = {\n ...packageJson,\n type: packageJson.type ?? \"module\",\n sideEffects: packageJson.sideEffects ?? false,\n files: packageJson.files ?? [\"/dist\"],\n exports,\n scripts,\n dependencies,\n devDependencies,\n } as PackageJson;\n await writePackage(projectDir, updatedPackageJson);\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;;;;;ACDR,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,IAAI,uBAAuB,EAC3B,OAAO,UAAU,CAClB;AAED,MAAK,MAAM,sBAAsB,wBAC/B,OAAM,sBAAsB,oBAAoB,QAAQ;;AAG5D,eAAsB,iBAAiB,UAAkB,SAAkB;AAKzE,OAAM,sBAHqB,MAAM,kBAAkB,SAAS,EAGZ,QAAQ;;AAS1D,eAAsB,eACpB,MACA,SACA;CACA,MAAM,E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E,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","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 { type DocumentModelGlobalState } from \"@powerhousedao/shared/document-model\";\nimport type { ProcessorApps } 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 { readdirSync } from \"node:fs\";\nimport {\n filter,\n isDefined,\n isIncludedIn,\n isTruthy,\n map,\n pipe,\n prop,\n unique,\n} from \"remeda\";\nimport type { Project } from \"ts-morph\";\nimport {\n getAppMetadata,\n getEditorMetadata,\n getOrCreateDirectory,\n getProcessorMetadata,\n getSubgraphMetadata,\n loadDocumentModelInDir,\n} 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 map(loadDocumentModelInDir),\n filter(isDefined),\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\n /* An editor's `id`, `name`, and `documentTypes` args can be found in the `module.ts` file */\n const editorsToAdd = pipe(\n editorsDir.getDirectories(),\n map((dir) => dir.getBaseName()),\n map((dirName) => getEditorMetadata(project, dirName)),\n filter(isTruthy),\n filter(\n ({ documentTypes }) =>\n !isIncludedIn(\"powerhouse/document-drive\", documentTypes),\n ),\n );\n\n for (const editorToAdd of editorsToAdd) {\n const {\n name: editorName,\n id: editorId,\n dirName: editorDirName,\n documentTypes,\n } = editorToAdd;\n\n await generateEditor(\n {\n editorName,\n editorId,\n editorDirName,\n documentTypes,\n },\n project,\n );\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\n /* An editor's `id`, `name`, and `documentTypes` args can be found in the `module.ts` file */\n const appsToAdd = pipe(\n editorsDir.getDirectories(),\n map((dir) => dir.getBaseName()),\n map((dirName) => getAppMetadata(project, dirName)),\n filter(isTruthy),\n );\n\n for (const appToAdd of appsToAdd) {\n const {\n name: appName,\n id: appId,\n dirName: appDirName,\n allowedDocumentTypes,\n isDragAndDropEnabled,\n } = appToAdd;\n await generateApp(\n {\n appName,\n appDirName,\n appId,\n allowedDocumentTypes,\n isDragAndDropEnabled,\n },\n project,\n );\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.getBaseName()),\n map((dirName) => getSubgraphMetadata(project, dirName)),\n map(prop(\"subgraphName\")),\n filter(isDefined),\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 processorsToGenerate = pipe(\n processorsDir.getDirectories(),\n map((dir) => dir.getBaseName()),\n map((dirName) => getProcessorMetadata(project, dirName)),\n );\n\n for (const processorArgs of processorsToGenerate) {\n await generateProcessor(processorArgs, project);\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 packageJsonExports,\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 { type PackageJson, 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 { writePackage } 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({\n cwd: projectDir,\n normalize: false,\n });\n const exports = packageJsonExports;\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 const updatedPackageJson: PackageJson = {\n ...packageJson,\n type: packageJson.type ?? \"module\",\n sideEffects: packageJson.sideEffects ?? false,\n files: packageJson.files ?? [\"/dist\"],\n exports,\n scripts,\n dependencies,\n devDependencies,\n } as PackageJson;\n await writePackage(projectDir, updatedPackageJson);\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;;;;;ACDR,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,cA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AAQ,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.
|
|
3
|
+
"version": "6.0.0-dev.229",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"private": false,
|
|
6
6
|
"type": "module",
|
|
@@ -53,8 +53,8 @@
|
|
|
53
53
|
"write-json-file": "^7.0.0",
|
|
54
54
|
"write-package": "7.2.0",
|
|
55
55
|
"zod": "4.3.6",
|
|
56
|
-
"@powerhousedao/shared": "6.0.0-dev.
|
|
57
|
-
"document-model": "6.0.0-dev.
|
|
56
|
+
"@powerhousedao/shared": "6.0.0-dev.229",
|
|
57
|
+
"document-model": "6.0.0-dev.229"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
60
60
|
"@pnpm/find-workspace-dir": "^1000.1.5",
|