@powerhousedao/ph-cli 6.0.0-dev.240 → 6.0.0-dev.241
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/assign-env-vars-W-lZmdMi.mjs +4 -1
- package/dist/assign-env-vars-W-lZmdMi.mjs.map +1 -1
- package/dist/auth-AR3VxAIk.mjs +4 -1
- package/dist/auth-AR3VxAIk.mjs.map +1 -1
- package/dist/auth-BNkN6kS9.mjs +2 -0
- package/dist/build-CqtYNjiI.mjs +2 -0
- package/dist/build-vccTv_Jp.mjs +4 -1
- package/dist/build-vccTv_Jp.mjs.map +1 -1
- package/dist/cli.mjs +21 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/connect-build-B7I7HJu0.mjs +4 -1
- package/dist/connect-build-B7I7HJu0.mjs.map +1 -1
- package/dist/connect-preview-CNJkhtxL.mjs +4 -1
- package/dist/connect-preview-CNJkhtxL.mjs.map +1 -1
- package/dist/connect-studio-DTdSFftL.mjs +4 -1
- package/dist/connect-studio-DTdSFftL.mjs.map +1 -1
- package/dist/connect-studio-DySbZFEc.mjs +2 -0
- package/dist/generate-all-Cj8zjFhN.mjs +4 -1
- package/dist/generate-all-Cj8zjFhN.mjs.map +1 -1
- package/dist/generate-app-KE0rbE-b.mjs +4 -1
- package/dist/generate-app-KE0rbE-b.mjs.map +1 -1
- package/dist/generate-document-model-Cut44i6D.mjs +4 -1
- package/dist/generate-document-model-Cut44i6D.mjs.map +1 -1
- package/dist/generate-editor-DmSzWm3W.mjs +4 -1
- package/dist/generate-editor-DmSzWm3W.mjs.map +1 -1
- package/dist/generate-processor-BcuHtOSn.mjs +4 -1
- package/dist/generate-processor-BcuHtOSn.mjs.map +1 -1
- package/dist/generate-subgraph-sh0GWC6T.mjs +4 -1
- package/dist/generate-subgraph-sh0GWC6T.mjs.map +1 -1
- package/dist/init-Cw_5H_Z1.mjs +4 -1
- package/dist/init-Cw_5H_Z1.mjs.map +1 -1
- package/dist/inspect-BwuBW_zW.mjs +4 -1
- package/dist/inspect-BwuBW_zW.mjs.map +1 -1
- package/dist/migrate-DxITKzBR.mjs +4 -1
- package/dist/migrate-DxITKzBR.mjs.map +1 -1
- package/dist/registry-auth-CNH84uo4.mjs +4 -1
- package/dist/registry-auth-CNH84uo4.mjs.map +1 -1
- package/dist/switchboard-BsdbF-rL.mjs +4 -1
- package/dist/switchboard-BsdbF-rL.mjs.map +1 -1
- package/dist/switchboard-GTBlxiJZ.mjs +2 -0
- package/dist/switchboard-migrate-BumRp7rC.mjs +4 -1
- package/dist/switchboard-migrate-BumRp7rC.mjs.map +1 -1
- package/dist/utils-C6581aex.mjs +2 -0
- package/dist/utils-mth8NsDA.mjs +4 -1
- package/dist/utils-mth8NsDA.mjs.map +1 -1
- package/dist/vetra-_JnFPpL5.mjs +4 -1
- package/dist/vetra-_JnFPpL5.mjs.map +1 -1
- package/package.json +10 -10
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-all-Cj8zjFhN.mjs","
|
|
1
|
+
{"version":3,"file":"generate-all-Cj8zjFhN.mjs","sources":["../src/services/generate-all.ts"],"sourcesContent":["import { generateAll } from \"@powerhousedao/codegen\";\nimport { buildTsMorphProject } from \"@powerhousedao/codegen/utils\";\n\nexport async function startGenerateAll(projectDir: string) {\n const project = buildTsMorphProject(projectDir);\n await generateAll(project);\n await project.save();\n}\n"],"names":[],"mappings":";;;;;AAGA,eAAsB,iBAAiB,YAAoB;CACzD,MAAM,UAAU,oBAAoB,WAAW;AAC/C,OAAM,YAAY,QAAQ;AAC1B,OAAM,QAAQ,MAAM","debug_id":"a2438c08-9f88-5904-af8b-ac3552eff7c3"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="e0e6b657-1568-5237-863c-b7ee06da40ae")}catch(e){}}();
|
|
1
3
|
import { dirname } from "node:path";
|
|
2
4
|
import { generateAllApps, generateApp } from "@powerhousedao/codegen";
|
|
3
5
|
import { buildTsMorphProject, getAppMetadata } from "@powerhousedao/codegen/utils";
|
|
@@ -32,4 +34,5 @@ async function startGenerateApp(args, projectDir) {
|
|
|
32
34
|
//#endregion
|
|
33
35
|
export { startGenerateApp };
|
|
34
36
|
|
|
35
|
-
//# sourceMappingURL=generate-app-KE0rbE-b.mjs.map
|
|
37
|
+
//# sourceMappingURL=generate-app-KE0rbE-b.mjs.map
|
|
38
|
+
//# debugId=e0e6b657-1568-5237-863c-b7ee06da40ae
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-app-KE0rbE-b.mjs","
|
|
1
|
+
{"version":3,"file":"generate-app-KE0rbE-b.mjs","sources":["../src/services/generate-app.ts"],"sourcesContent":["import { generateAllApps, generateApp } from \"@powerhousedao/codegen\";\nimport {\n buildTsMorphProject,\n getAppMetadata,\n} from \"@powerhousedao/codegen/utils\";\nimport { dirname } from \"node:path\";\nimport type { GenerateAppArgs } from \"../types.js\";\n\nexport async function startGenerateApp(\n args: GenerateAppArgs,\n projectDir: string,\n) {\n const {\n name,\n allowedDocumentTypes = [],\n disableDragAndDrop,\n dir,\n all,\n debug,\n } = args;\n if (debug) {\n console.log({ args });\n }\n const project = buildTsMorphProject(projectDir);\n if (all) {\n await generateAllApps(project);\n } else if (name) {\n await generateApp(\n {\n appName: name,\n allowedDocumentTypes,\n isDragAndDropEnabled: !disableDragAndDrop,\n },\n project,\n );\n } else if (dir) {\n const appMetadata = getAppMetadata(project, dirname(dir));\n if (!appMetadata) {\n throw new Error(`Failed to get data for app in dir \"${dir}\"`);\n }\n const {\n name: appName,\n id: appId,\n dirName: appDirName,\n allowedDocumentTypes,\n isDragAndDropEnabled,\n } = appMetadata;\n\n await generateApp(\n {\n appName,\n appId,\n appDirName,\n allowedDocumentTypes,\n isDragAndDropEnabled,\n },\n project,\n );\n } else {\n console.log(\"Please specify either `name`, `dir`, or `all`.\");\n return;\n }\n await project.save();\n}\n"],"names":[],"mappings":";;;;;;AAQA,eAAsB,iBACpB,MACA,YACA;CACA,MAAM,EACJ,MACA,uBAAuB,EAAE,EACzB,oBACA,KACA,KACA,UACE;AACJ,KAAI,MACF,SAAQ,IAAI,EAAE,MAAM,CAAC;CAEvB,MAAM,UAAU,oBAAoB,WAAW;AAC/C,KAAI,IACF,OAAM,gBAAgB,QAAQ;UACrB,KACT,OAAM,YACJ;EACE,SAAS;EACT;EACA,sBAAsB,CAAC;EACxB,EACD,QACD;UACQ,KAAK;EACd,MAAM,cAAc,eAAe,SAAS,QAAQ,IAAI,CAAC;AACzD,MAAI,CAAC,YACH,OAAM,IAAI,MAAM,sCAAsC,IAAI,GAAG;EAE/D,MAAM,EACJ,MAAM,SACN,IAAI,OACJ,SAAS,YACT,sBACA,yBACE;AAEJ,QAAM,YACJ;GACE;GACA;GACA;GACA;GACA;GACD,EACD,QACD;QACI;AACL,UAAQ,IAAI,iDAAiD;AAC7D;;AAEF,OAAM,QAAQ,MAAM","debug_id":"e0e6b657-1568-5237-863c-b7ee06da40ae"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bdd2f811-3145-5018-8a96-767f4263e2bc")}catch(e){}}();
|
|
1
3
|
import { dirname, join } from "node:path";
|
|
2
4
|
import { generateAllDocumentModels, generateDocumentModel, loadDocumentModel } from "@powerhousedao/codegen";
|
|
3
5
|
import { buildTsMorphProject } from "@powerhousedao/codegen/utils";
|
|
@@ -18,4 +20,5 @@ async function startGenerateDocumentModel(args, projectDir) {
|
|
|
18
20
|
//#endregion
|
|
19
21
|
export { startGenerateDocumentModel };
|
|
20
22
|
|
|
21
|
-
//# sourceMappingURL=generate-document-model-Cut44i6D.mjs.map
|
|
23
|
+
//# sourceMappingURL=generate-document-model-Cut44i6D.mjs.map
|
|
24
|
+
//# debugId=bdd2f811-3145-5018-8a96-767f4263e2bc
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-document-model-Cut44i6D.mjs","
|
|
1
|
+
{"version":3,"file":"generate-document-model-Cut44i6D.mjs","sources":["../src/services/generate-document-model.ts"],"sourcesContent":["import {\n generateAllDocumentModels,\n generateDocumentModel,\n loadDocumentModel,\n} from \"@powerhousedao/codegen\";\nimport { buildTsMorphProject } from \"@powerhousedao/codegen/utils\";\nimport { dirname, join } from \"node:path\";\nimport type { GenerateDocumentModelArgs } from \"../types.js\";\n\nexport async function startGenerateDocumentModel(\n args: GenerateDocumentModelArgs,\n projectDir: string,\n) {\n const { file, dir, all, debug } = args;\n if (debug) {\n console.log({ args });\n }\n const project = buildTsMorphProject(projectDir);\n if (all) {\n await generateAllDocumentModels(project);\n } else if (file) {\n const documentModelState = await loadDocumentModel(file);\n await generateDocumentModel(documentModelState, project);\n } else if (dir) {\n const documentModelDirName = dirname(dir);\n const documentModelFileName = `${documentModelDirName}.json`;\n const documentModelFilePath = join(dir, documentModelFileName);\n const documentModelState = await loadDocumentModel(documentModelFilePath);\n await generateDocumentModel(documentModelState, project);\n } else {\n console.log(\"Please specify either `file`, `dir`, or `all`.\");\n return;\n }\n await project.save();\n}\n"],"names":[],"mappings":";;;;;;AASA,eAAsB,2BACpB,MACA,YACA;CACA,MAAM,EAAE,MAAM,KAAK,KAAK,UAAU;AAClC,KAAI,MACF,SAAQ,IAAI,EAAE,MAAM,CAAC;CAEvB,MAAM,UAAU,oBAAoB,WAAW;AAC/C,KAAI,IACF,OAAM,0BAA0B,QAAQ;UAC/B,KAET,OAAM,sBADqB,MAAM,kBAAkB,KAAK,EACR,QAAQ;UAC/C,IAKT,OAAM,sBADqB,MAAM,kBADH,KAAK,KADL,GADD,QAAQ,IAAI,CACa,OACQ,CACW,EACzB,QAAQ;MACnD;AACL,UAAQ,IAAI,iDAAiD;AAC7D;;AAEF,OAAM,QAAQ,MAAM","debug_id":"bdd2f811-3145-5018-8a96-767f4263e2bc"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f3610574-fc94-59bf-ae3d-ea3430b3aec9")}catch(e){}}();
|
|
1
3
|
import { dirname } from "node:path";
|
|
2
4
|
import { generateAllEditors, generateEditor } from "@powerhousedao/codegen";
|
|
3
5
|
import { buildTsMorphProject, getEditorMetadata } from "@powerhousedao/codegen/utils";
|
|
@@ -32,4 +34,5 @@ async function startGenerateEditor(args, projectDir) {
|
|
|
32
34
|
//#endregion
|
|
33
35
|
export { startGenerateEditor };
|
|
34
36
|
|
|
35
|
-
//# sourceMappingURL=generate-editor-DmSzWm3W.mjs.map
|
|
37
|
+
//# sourceMappingURL=generate-editor-DmSzWm3W.mjs.map
|
|
38
|
+
//# debugId=f3610574-fc94-59bf-ae3d-ea3430b3aec9
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-editor-DmSzWm3W.mjs","
|
|
1
|
+
{"version":3,"file":"generate-editor-DmSzWm3W.mjs","sources":["../src/services/generate-editor.ts"],"sourcesContent":["import { generateAllEditors, generateEditor } from \"@powerhousedao/codegen\";\nimport {\n buildTsMorphProject,\n getEditorMetadata,\n} from \"@powerhousedao/codegen/utils\";\nimport { dirname } from \"node:path\";\nimport type { GenerateEditorArgs } from \"../types.js\";\n\nexport async function startGenerateEditor(\n args: GenerateEditorArgs,\n projectDir: string,\n) {\n const { name, documentType, dir, all, debug } = args;\n if (debug) {\n console.log({ args });\n }\n const project = buildTsMorphProject(projectDir);\n if (all) {\n await generateAllEditors(project);\n } else if (name) {\n if (!documentType) {\n throw new Error(\n \"Please specify a document type for the new editor to generate.\",\n );\n }\n await generateEditor(\n { editorName: name, documentTypes: [documentType] },\n project,\n );\n } else if (dir) {\n const editorArgs = getEditorMetadata(project, dirname(dir));\n if (!editorArgs) {\n throw new Error(`Failed to get data for editor in dir \"${dir}\"`);\n }\n const {\n name: editorName,\n id: editorId,\n dirName: editorDirName,\n documentTypes,\n } = editorArgs;\n await generateEditor(\n {\n editorName,\n editorId,\n editorDirName,\n documentTypes,\n },\n project,\n );\n } else {\n console.log(\"Please specify either `name`, `dir`, or `all`.\");\n return;\n }\n await project.save();\n}\n"],"names":[],"mappings":";;;;;;AAQA,eAAsB,oBACpB,MACA,YACA;CACA,MAAM,EAAE,MAAM,cAAc,KAAK,KAAK,UAAU;AAChD,KAAI,MACF,SAAQ,IAAI,EAAE,MAAM,CAAC;CAEvB,MAAM,UAAU,oBAAoB,WAAW;AAC/C,KAAI,IACF,OAAM,mBAAmB,QAAQ;UACxB,MAAM;AACf,MAAI,CAAC,aACH,OAAM,IAAI,MACR,iEACD;AAEH,QAAM,eACJ;GAAE,YAAY;GAAM,eAAe,CAAC,aAAa;GAAE,EACnD,QACD;YACQ,KAAK;EACd,MAAM,aAAa,kBAAkB,SAAS,QAAQ,IAAI,CAAC;AAC3D,MAAI,CAAC,WACH,OAAM,IAAI,MAAM,yCAAyC,IAAI,GAAG;EAElE,MAAM,EACJ,MAAM,YACN,IAAI,UACJ,SAAS,eACT,kBACE;AACJ,QAAM,eACJ;GACE;GACA;GACA;GACA;GACD,EACD,QACD;QACI;AACL,UAAQ,IAAI,iDAAiD;AAC7D;;AAEF,OAAM,QAAQ,MAAM","debug_id":"f3610574-fc94-59bf-ae3d-ea3430b3aec9"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="9c2aa277-18b4-5d67-bc89-88877e9b9d52")}catch(e){}}();
|
|
1
3
|
import { dirname } from "node:path";
|
|
2
4
|
import { generateAllProcessors, generateProcessor } from "@powerhousedao/codegen";
|
|
3
5
|
import { buildTsMorphProject, getProcessorMetadata } from "@powerhousedao/codegen/utils";
|
|
@@ -23,4 +25,5 @@ async function startGenerateProcessor(args, projectDir) {
|
|
|
23
25
|
//#endregion
|
|
24
26
|
export { startGenerateProcessor };
|
|
25
27
|
|
|
26
|
-
//# sourceMappingURL=generate-processor-BcuHtOSn.mjs.map
|
|
28
|
+
//# sourceMappingURL=generate-processor-BcuHtOSn.mjs.map
|
|
29
|
+
//# debugId=9c2aa277-18b4-5d67-bc89-88877e9b9d52
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-processor-BcuHtOSn.mjs","
|
|
1
|
+
{"version":3,"file":"generate-processor-BcuHtOSn.mjs","sources":["../src/services/generate-processor.ts"],"sourcesContent":["import {\n generateAllProcessors,\n generateProcessor,\n} from \"@powerhousedao/codegen\";\nimport {\n buildTsMorphProject,\n getProcessorMetadata,\n} from \"@powerhousedao/codegen/utils\";\nimport { dirname } from \"node:path\";\nimport type { GenerateProcessorArgs } from \"../types.js\";\n\nexport async function startGenerateProcessor(\n args: GenerateProcessorArgs,\n projectDir: string,\n) {\n const {\n name: processorName,\n type: processorType,\n apps: processorApps,\n documentTypes,\n dir,\n all,\n debug,\n } = args;\n if (debug) {\n console.log({ args });\n }\n const project = buildTsMorphProject(projectDir);\n if (all) {\n await generateAllProcessors(project);\n } else if (processorName) {\n await generateProcessor(\n {\n processorName,\n processorApps,\n processorType,\n documentTypes,\n },\n project,\n );\n } else if (dir) {\n const processorDirName = dirname(dir);\n const processorArgs = getProcessorMetadata(project, processorDirName);\n await generateProcessor(processorArgs, project);\n } else {\n console.log(\"Please specify either `name`, `dir`, or `all`.\");\n return;\n }\n await project.save();\n}\n"],"names":[],"mappings":";;;;;;AAWA,eAAsB,uBACpB,MACA,YACA;CACA,MAAM,EACJ,MAAM,eACN,MAAM,eACN,MAAM,eACN,eACA,KACA,KACA,UACE;AACJ,KAAI,MACF,SAAQ,IAAI,EAAE,MAAM,CAAC;CAEvB,MAAM,UAAU,oBAAoB,WAAW;AAC/C,KAAI,IACF,OAAM,sBAAsB,QAAQ;UAC3B,cACT,OAAM,kBACJ;EACE;EACA;EACA;EACA;EACD,EACD,QACD;UACQ,IAGT,OAAM,kBADgB,qBAAqB,SADlB,QAAQ,IAAI,CACgC,EAC9B,QAAQ;MAC1C;AACL,UAAQ,IAAI,iDAAiD;AAC7D;;AAEF,OAAM,QAAQ,MAAM","debug_id":"9c2aa277-18b4-5d67-bc89-88877e9b9d52"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="20b332f3-615c-5ff3-aebe-468342e3fada")}catch(e){}}();
|
|
1
3
|
import { dirname } from "node:path";
|
|
2
4
|
import { generateAllSubgraphs, generateSubgraph } from "@powerhousedao/codegen";
|
|
3
5
|
import { buildTsMorphProject, getSubgraphMetadata } from "@powerhousedao/codegen/utils";
|
|
@@ -21,4 +23,5 @@ async function startGenerateSubgraph(args, projectDir) {
|
|
|
21
23
|
//#endregion
|
|
22
24
|
export { startGenerateSubgraph };
|
|
23
25
|
|
|
24
|
-
//# sourceMappingURL=generate-subgraph-sh0GWC6T.mjs.map
|
|
26
|
+
//# sourceMappingURL=generate-subgraph-sh0GWC6T.mjs.map
|
|
27
|
+
//# debugId=20b332f3-615c-5ff3-aebe-468342e3fada
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate-subgraph-sh0GWC6T.mjs","
|
|
1
|
+
{"version":3,"file":"generate-subgraph-sh0GWC6T.mjs","sources":["../src/services/generate-subgraph.ts"],"sourcesContent":["import { generateAllSubgraphs, generateSubgraph } from \"@powerhousedao/codegen\";\nimport {\n buildTsMorphProject,\n getSubgraphMetadata,\n} from \"@powerhousedao/codegen/utils\";\nimport { dirname } from \"node:path\";\nimport type { GenerateSubgraphArgs } from \"../types.js\";\n\nexport async function startGenerateSubgraph(\n args: GenerateSubgraphArgs,\n projectDir: string,\n) {\n const { name, dir, all, debug } = args;\n if (debug) {\n console.log({ args });\n }\n const project = buildTsMorphProject(projectDir);\n if (all) {\n await generateAllSubgraphs(project);\n } else if (name) {\n await generateSubgraph(name, project);\n } else if (dir) {\n const { subgraphName } = getSubgraphMetadata(project, dirname(dir));\n if (!subgraphName) {\n throw new Error(`Failed to get data for subgraph in dir \"${dir}\"`);\n }\n await generateSubgraph(subgraphName, project);\n } else {\n console.log(\"Please specify either `name`, `dir`, or `all`.\");\n return;\n }\n await project.save();\n}\n"],"names":[],"mappings":";;;;;;AAQA,eAAsB,sBACpB,MACA,YACA;CACA,MAAM,EAAE,MAAM,KAAK,KAAK,UAAU;AAClC,KAAI,MACF,SAAQ,IAAI,EAAE,MAAM,CAAC;CAEvB,MAAM,UAAU,oBAAoB,WAAW;AAC/C,KAAI,IACF,OAAM,qBAAqB,QAAQ;UAC1B,KACT,OAAM,iBAAiB,MAAM,QAAQ;UAC5B,KAAK;EACd,MAAM,EAAE,iBAAiB,oBAAoB,SAAS,QAAQ,IAAI,CAAC;AACnE,MAAI,CAAC,aACH,OAAM,IAAI,MAAM,2CAA2C,IAAI,GAAG;AAEpE,QAAM,iBAAiB,cAAc,QAAQ;QACxC;AACL,UAAQ,IAAI,iDAAiD;AAC7D;;AAEF,OAAM,QAAQ,MAAM","debug_id":"20b332f3-615c-5ff3-aebe-468342e3fada"}
|
package/dist/init-Cw_5H_Z1.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1835da68-34a4-5f33-9a4c-08c3b7cb5d9c")}catch(e){}}();
|
|
1
3
|
import { handleMutuallyExclusiveOptions, parsePackageManager, parseTag } from "@powerhousedao/shared/clis";
|
|
2
4
|
import { createProject } from "@powerhousedao/codegen";
|
|
3
5
|
import chalk from "chalk";
|
|
@@ -122,4 +124,5 @@ async function startInit(args) {
|
|
|
122
124
|
//#endregion
|
|
123
125
|
export { startInit };
|
|
124
126
|
|
|
125
|
-
//# sourceMappingURL=init-Cw_5H_Z1.mjs.map
|
|
127
|
+
//# sourceMappingURL=init-Cw_5H_Z1.mjs.map
|
|
128
|
+
//# debugId=1835da68-34a4-5f33-9a4c-08c3b7cb5d9c
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init-Cw_5H_Z1.mjs","
|
|
1
|
+
{"version":3,"file":"init-Cw_5H_Z1.mjs","sources":["../src/utils/validate-remote-drive.ts","../src/services/init.ts"],"sourcesContent":["import {\n createVetraDocument,\n getVetraDocuments,\n} from \"@powerhousedao/common/utils\";\n\n/**\n * Sets up a remote drive for initialization by validating and creating\n * a Vetra document if needed.\n * Returns true if setup succeeds, false if it should stop execution.\n */\nexport async function setupRemoteDrive(\n remoteDriveUrl: string,\n): Promise<boolean> {\n try {\n // Parse driveId from URL\n const driveId = remoteDriveUrl.split(\"/\").pop();\n\n if (!remoteDriveUrl || remoteDriveUrl.trim() === \"\") {\n console.error(\"❌ Remote drive URL is required\");\n return false;\n }\n\n // Construct GraphQL endpoint from base URL, preserving any subpath\n // prefix (e.g. when the reactor is served behind a proxy at /api/reactor).\n const url = new URL(remoteDriveUrl);\n const basePath = url.pathname.replace(/\\/d\\/[^/]+\\/?$/, \"\");\n const graphqlEndpoint = `${url.protocol}//${url.host}${basePath}/graphql`;\n\n let documents = await getVetraDocuments(graphqlEndpoint, driveId!);\n\n if (documents.length === 0) {\n console.log(\n \"No vetra package document found in the provided drive, creating one...\",\n );\n try {\n await createVetraDocument(graphqlEndpoint, driveId!, \"vetra-package\");\n\n // Re-fetch documents after creation\n documents = await getVetraDocuments(graphqlEndpoint, driveId!);\n\n if (documents.length === 0) {\n console.error(\n \"❌ Failed to create vetra package document in the remote drive\",\n );\n return false;\n }\n\n console.log(\"✅ Vetra package document created successfully\");\n } catch (createError) {\n console.error(\n \"❌ Failed to create vetra package document:\",\n createError,\n );\n return false;\n }\n }\n\n if (documents.length > 1) {\n console.warn(\n \"⚠️ Multiple vetra package documents were found in the provided remote drive, this might be an error in your remote drive\",\n );\n }\n\n const hasGithubUrl = documents.some((doc) => doc.githubUrl);\n\n if (hasGithubUrl) {\n console.error(\n \"❌ The remote drive provided already has been configured with a github url, please use the checkout command instead: ph checkout --remote-drive <remote drive url>\",\n );\n return false;\n }\n\n return true;\n } catch (error) {\n console.error(\"❌ Unable to fetch remote drive info:\", error);\n return false;\n }\n}\n","import { createProject } from \"@powerhousedao/codegen\";\nimport {\n handleMutuallyExclusiveOptions,\n parsePackageManager,\n parseTag,\n} from \"@powerhousedao/shared/clis\";\nimport chalk from \"chalk\";\nimport { kebabCase } from \"change-case\";\nimport enquirer from \"enquirer\";\nimport { clean, valid } from \"semver\";\nimport type { InitArgs } from \"../types.js\";\nimport { setupRemoteDrive } from \"../utils/validate-remote-drive.js\";\n\nexport async function startInit(args: InitArgs) {\n const {\n namePositional,\n nameOption,\n packageManager,\n npm,\n pnpm,\n yarn,\n bun,\n tag,\n version,\n dev,\n staging,\n remoteDrive,\n } = args;\n\n let name = namePositional ?? nameOption;\n if (!name) {\n const { prompt } = enquirer;\n\n const result = await prompt<{ name: string }>([\n {\n type: \"input\",\n name: \"name\",\n message: \"What is the project name?\",\n required: true,\n result: (value) => kebabCase(value),\n },\n ]);\n name = result.name;\n }\n if (!name) {\n throw new Error(\"You must provide a name for your project.\");\n }\n\n if (version !== undefined && !valid(clean(version))) {\n throw new Error(`Invalid version: ${version}`);\n }\n\n handleMutuallyExclusiveOptions(\n {\n tag,\n version,\n dev,\n staging,\n },\n \"versioning strategy\",\n );\n\n handleMutuallyExclusiveOptions(\n {\n npm,\n pnpm,\n yarn,\n bun,\n packageManager,\n },\n \"package manager\",\n );\n\n const parsedPackageManager =\n parsePackageManager({\n npm,\n pnpm,\n yarn,\n bun,\n packageManager,\n }) ?? \"npm\";\n\n const parsedTag = parseTag({\n tag,\n dev,\n staging,\n });\n\n try {\n if (remoteDrive) {\n console.log(chalk.blue(\"\\n⏳ Setting up remote drive...\\n\"));\n await setupRemoteDrive(remoteDrive);\n console.log(chalk.green(\"\\n✅ Remote drive set up.\"));\n }\n\n console.log(chalk.bold(\"\\n🚀 Initializing a new project...\\n\"));\n await createProject({\n ...args,\n name,\n packageManager: parsedPackageManager,\n tag: parsedTag,\n });\n\n if (remoteDrive) {\n console.log();\n console.log(\"To link your project to GitHub:\");\n console.log();\n console.log(\" 1. Create a new repository on GitHub\");\n console.log(` 2. cd ${name}`);\n console.log(\" 3. git add . && git commit -m 'Initial commit'\");\n console.log(\" 4. git remote add origin <your-github-url>\");\n console.log(` 5. git push -u origin main`);\n console.log();\n }\n } catch (error) {\n console.error(\"\\n❌ Failed to initialize project: \\n\");\n throw error;\n }\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAUA,eAAsB,iBACpB,gBACkB;AAClB,KAAI;EAEF,MAAM,UAAU,eAAe,MAAM,IAAI,CAAC,KAAK;AAE/C,MAAI,CAAC,kBAAkB,eAAe,MAAM,KAAK,IAAI;AACnD,WAAQ,MAAM,iCAAiC;AAC/C,UAAO;;EAKT,MAAM,MAAM,IAAI,IAAI,eAAe;EACnC,MAAM,WAAW,IAAI,SAAS,QAAQ,kBAAkB,GAAG;EAC3D,MAAM,kBAAkB,GAAG,IAAI,SA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Y,SAAS;EACzB;EACA;EACA;EACD,CAAC;AAEF,KAAI;AACF,MAAI,aAAa;AACf,WAAQ,IAAI,MAAM,KAAK,mCAAmC,CAAC;AAC3D,SAAM,iBAAiB,YAAY;AACnC,WAAQ,IAAI,MAAM,MAAM,2BAA2B,CAAC;;AAGtD,UAAQ,IAAI,MAAM,KAAK,uCAAuC,CAAC;AAC/D,QAAM,cAAc;GAClB,GAAG;GACH;GACA,gBAAgB;GAChB,KAAK;GACN,CAAC;AAEF,MAAI,aAAa;AACf,WAAQ,KAAK;AACb,WAAQ,IAAI,kCAAkC;AAC9C,WAAQ,KAAK;AACb,WAAQ,IAAI,yCAAyC;AACrD,WAAQ,IAAI,WAAW,OAAO;AAC9B,WAAQ,IAAI,mDAAmD;AAC/D,WAAQ,IAAI,+CAA+C;AAC3D,WAAQ,IAAI,+BAA+B;AAC3C,WAAQ,KAAK;;UAER,OAAO;AACd,UAAQ,MAAM,uCAAuC;AACrD,QAAM","debug_id":"1835da68-34a4-5f33-9a4c-08c3b7cb5d9c"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="f74536d7-164b-57b0-ac72-c4f52831d602")}catch(e){}}();
|
|
1
3
|
import { s as getProjectInfo } from "./utils-mth8NsDA.mjs";
|
|
2
4
|
import fs from "node:fs";
|
|
3
5
|
//#region src/services/inspect.ts
|
|
@@ -42,4 +44,5 @@ function startInspect(args) {
|
|
|
42
44
|
//#endregion
|
|
43
45
|
export { startInspect };
|
|
44
46
|
|
|
45
|
-
//# sourceMappingURL=inspect-BwuBW_zW.mjs.map
|
|
47
|
+
//# sourceMappingURL=inspect-BwuBW_zW.mjs.map
|
|
48
|
+
//# debugId=f74536d7-164b-57b0-ac72-c4f52831d602
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inspect-BwuBW_zW.mjs","
|
|
1
|
+
{"version":3,"file":"inspect-BwuBW_zW.mjs","sources":["../src/services/inspect.ts"],"sourcesContent":["import type { Manifest } from \"@powerhousedao/shared/document-model\";\nimport fs from \"node:fs\";\nimport type { InspectArgs } from \"../types.js\";\nimport { getProjectInfo } from \"../utils.js\";\nexport function startInspect(args: InspectArgs) {\n if (args.debug) {\n console.log(\">>> command arguments\", args);\n }\n\n const projectInfo = getProjectInfo(args.debug);\n const { packageName } = args;\n\n if (args.debug) {\n console.log(\"\\n>>> projectInfo\", projectInfo);\n }\n\n try {\n const loadManifest = (path: string) =>\n JSON.parse(fs.readFileSync(path, \"utf-8\")) as Manifest;\n const manifest = loadManifest(\n `${process.cwd()}/node_modules/${packageName}/dist/powerhouse.manifest.json`,\n );\n\n console.log(manifest.name);\n if (manifest.documentModels) {\n console.log(\"\\nDocument Models:\");\n manifest.documentModels.forEach((model) => {\n console.log(`- ${model.name} (${model.id})`);\n });\n }\n\n if (manifest.editors) {\n console.log(\"\\nEditors:\");\n manifest.editors.forEach((editor) => {\n console.log(`- ${editor.name} (${editor.id})`);\n });\n }\n\n if (manifest.processors) {\n console.log(\"\\nProcessors:\");\n manifest.processors.forEach((processor) => {\n console.log(`- ${processor.name} (${processor.id})`);\n });\n }\n\n if (manifest.subgraphs) {\n console.log(\"\\nSubgraphs:\");\n manifest.subgraphs.forEach((subgraph) => {\n console.log(`- ${subgraph.name} (${subgraph.id})`);\n });\n }\n } catch (e) {\n if (args.debug) {\n console.error(e);\n } else {\n console.log(\"No manifest found in the package\");\n }\n }\n}\n"],"names":[],"mappings":";;;;;AAIA,SAAgB,aAAa,MAAmB;AAC9C,KAAI,KAAK,MACP,SAAQ,IAAI,yBAAyB,KAAK;CAG5C,MAAM,cAAc,eAAe,KAAK,MAAM;CAC9C,MAAM,EAAE,gBAAgB;AAExB,KAAI,KAAK,MACP,SAAQ,IAAI,qBAAqB,YAAY;AAG/C,KAAI;EACF,MAAM,gBAAgB,SACpB,KAAK,MAAM,GAAG,aAAa,MAAM,QAAQ,CAAC;EAC5C,MAAM,WAAW,aACf,GAAG,QAAQ,KAAK,CAAC,gBAAgB,YAAY,gCAC9C;AAED,UAAQ,IAAI,SAAS,KAAK;AAC1B,MAAI,SAAS,gBAAgB;AAC3B,WAAQ,IAAI,qBAAqB;AACjC,YAAS,eAAe,SAAS,UAAU;AACzC,YAAQ,IAAI,KAAK,MAAM,KAAK,IAAI,MAAM,GAAG,GAAG;KAC5C;;AAGJ,MAAI,SAAS,SAAS;AACpB,WAAQ,IAAI,aAAa;AACzB,YAAS,QAAQ,SAAS,WAAW;AACnC,YAAQ,IAAI,KAAK,OAAO,KAAK,IAAI,OAAO,GAAG,GAAG;KAC9C;;AAGJ,MAAI,SAAS,YAAY;AACvB,WAAQ,IAAI,gBAAgB;AAC5B,YAAS,WAAW,SAAS,cAAc;AACzC,YAAQ,IAAI,KAAK,UAAU,KAAK,IAAI,UAAU,GAAG,GAAG;KACpD;;AAGJ,MAAI,SAAS,WAAW;AACtB,WAAQ,IAAI,eAAe;AAC3B,YAAS,UAAU,SAAS,aAAa;AACvC,YAAQ,IAAI,KAAK,SAAS,KAAK,IAAI,SAAS,GAAG,GAAG;KAClD;;UAEG,GAAG;AACV,MAAI,KAAK,MACP,SAAQ,MAAM,EAAE;MAEhB,SAAQ,IAAI,mCAAmC","debug_id":"f74536d7-164b-57b0-ac72-c4f52831d602"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c259b149-4fbb-5e32-9796-8de3842de095")}catch(e){}}();
|
|
1
3
|
import { execSync } from "node:child_process";
|
|
2
4
|
import { dirname, join } from "node:path";
|
|
3
5
|
import { detect, resolveCommand } from "package-manager-detector";
|
|
@@ -56,4 +58,5 @@ async function startMigrate({ versionPositional, version, force, debug }) {
|
|
|
56
58
|
//#endregion
|
|
57
59
|
export { startMigrate };
|
|
58
60
|
|
|
59
|
-
//# sourceMappingURL=migrate-DxITKzBR.mjs.map
|
|
61
|
+
//# sourceMappingURL=migrate-DxITKzBR.mjs.map
|
|
62
|
+
//# debugId=c259b149-4fbb-5e32-9796-8de3842de095
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"migrate-DxITKzBR.mjs","
|
|
1
|
+
{"version":3,"file":"migrate-DxITKzBR.mjs","sources":["../src/services/migrate.ts"],"sourcesContent":["import { fetchPackageVersionFromNpmRegistry } from \"@powerhousedao/shared/clis\";\nimport { execSync } from \"node:child_process\";\nimport { readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport { detect, resolveCommand } from \"package-manager-detector\";\nimport type { MigrateArgs } from \"../types.js\";\n\nfunction getBundledPhCliVersion(): string | undefined {\n let dir = dirname(fileURLToPath(import.meta.url));\n for (let i = 0; i < 5; i++) {\n try {\n const pkg = JSON.parse(\n readFileSync(join(dir, \"package.json\"), \"utf8\"),\n ) as { name?: string; version?: string };\n if (pkg.name === \"@powerhousedao/ph-cli\") return pkg.version;\n } catch {\n // keep walking\n }\n dir = dirname(dir);\n }\n}\n\nexport async function startMigrate({\n versionPositional,\n version,\n force,\n debug,\n}: MigrateArgs) {\n const requested = versionPositional ?? version;\n if (debug) console.log(`[migrate] requested version: ${requested}`);\n\n let targetVersion: string | undefined;\n try {\n targetVersion = await fetchPackageVersionFromNpmRegistry(\n `@powerhousedao/ph-cli@${requested}`,\n );\n } catch (error) {\n const reason = error instanceof Error ? error.message : String(error);\n if (!force) {\n throw new Error(\n `Failed to resolve \"${requested}\" from the npm registry: ${reason}\\nRe-run with --force to migrate using the installed version.`,\n );\n }\n if (debug) {\n console.log(\n `[migrate] failed to resolve target version, --force is set, falling back to bundled codegen: ${reason}`,\n );\n }\n }\n\n const bundledVersion = getBundledPhCliVersion();\n if (debug) {\n console.log(\n `[migrate] resolved target version: ${targetVersion ?? \"(unknown)\"}`,\n );\n console.log(\n `[migrate] current ph-cli version: ${bundledVersion ?? \"(unknown)\"}`,\n );\n }\n\n if (!targetVersion || force || targetVersion === bundledVersion) {\n if (debug) console.log(`[migrate] running migrate from bundled codegen`);\n const { migrate } = await import(\"@powerhousedao/codegen\");\n await migrate(targetVersion ?? requested);\n return;\n }\n\n const agent = (await detect())?.agent ?? \"npm\";\n const resolved = resolveCommand(agent, \"execute\", [\n `@powerhousedao/ph-cli@${targetVersion}`,\n \"migrate\",\n \"--version\",\n targetVersion,\n ...(debug ? [\"--debug\"] : []),\n ]);\n if (!resolved) {\n throw new Error(\n `Failed to resolve execute command for package manager \"${agent}\".`,\n );\n }\n\n const command = `${resolved.command} ${resolved.args.join(\" \")}`;\n if (debug) {\n console.log(`[migrate] detected package manager: ${agent}`);\n console.log(`[migrate] re-executing: ${command}`);\n }\n execSync(command, { stdio: \"inherit\" });\n}\n"],"names":[],"mappings":";;;;;;;;;AAQA,SAAS,yBAA6C;CACpD,IAAI,MAAM,QAAQ,cAAc,OAAO,KAAK,IAAI,CAAC;AACjD,MAAK,IAAI,IAAI,GAAG,IAAI,GAAG,KAAK;AAC1B,MAAI;GACF,MAAM,MAAM,KAAK,MACf,aAAa,KAAK,KAAK,eAAe,EAAE,OAAO,CAChD;AACD,OAAI,IAAI,SAAS,wBAAyB,QAAO,IAAI;UAC/C;AAGR,QAAM,QAAQ,IAAI;;;AAItB,eAAsB,aAAa,EACjC,mBACA,SACA,OACA,SACc;CACd,MAAM,YAAY,qBAAqB;AACvC,KAAI,MAAO,SAAQ,IAAI,gCAAgC,YAAY;CAEnE,IAAI;AACJ,KAAI;AACF,kBAAgB,MAAM,mCACpB,yBAAyB,YAC1B;UACM,OAAO;EACd,MAAM,SAAS,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM;AACrE,MAAI,CAAC,MACH,OAAM,IAAI,MACR,sBAAsB,UAAU,2BAA2B,OAAO,+DACnE;AAEH,MAAI,MACF,SAAQ,IACN,gGAAgG,SACjG;;CAIL,MAAM,iBAAiB,wBAAwB;AAC/C,KAAI,OAAO;AACT,UAAQ,IACN,sCAAsC,iBAAiB,cACxD;AACD,UAAQ,IACN,qCAAqC,kBAAkB,cACxD;;AAGH,KAAI,CAAC,iBAAiB,SAAS,kBAAkB,gBAAgB;AAC/D,MAAI,MAAO,SAAQ,IAAI,iDAAiD;EACxE,MAAM,EAAE,YAAY,MAAM,OAAO;AACjC,QAAM,QAAQ,iBAAiB,UAAU;AACzC;;CAGF,MAAM,SAAS,MAAM,QAAQ,GAAG,SAAS;CACzC,MAAM,WAAW,eAAe,OAAO,WAAW;EAChD,yBAAyB;EACzB;EACA;EACA;EACA,GAAI,QAAQ,CAAC,UAAU,GAAG,EAAE;EAC7B,CAAC;AACF,KAAI,CAAC,SACH,OAAM,IAAI,MACR,0DAA0D,MAAM,IACjE;CAGH,MAAM,UAAU,GAAG,SAAS,QAAQ,GAAG,SAAS,KAAK,KAAK,IAAI;AAC9D,KAAI,OAAO;AACT,UAAQ,IAAI,uCAAuC,QAAQ;AAC3D,UAAQ,IAAI,2BAA2B,UAAU;;AAEnD,UAAS,SAAS,EAAE,OAAO,WAAW,CAAC","debug_id":"c259b149-4fbb-5e32-9796-8de3842de095"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2e430ad3-fb2c-5578-8c85-ccce5c5a369e")}catch(e){}}();
|
|
1
3
|
import { t as getRenown } from "./auth-AR3VxAIk.mjs";
|
|
2
4
|
import { generateAccessToken } from "@renown/sdk/node";
|
|
3
5
|
//#region src/services/registry-auth.ts
|
|
@@ -19,4 +21,5 @@ async function mintRegistryAuthToken(registryUrl, expiresInSeconds) {
|
|
|
19
21
|
//#endregion
|
|
20
22
|
export { mintRegistryAuthToken };
|
|
21
23
|
|
|
22
|
-
//# sourceMappingURL=registry-auth-CNH84uo4.mjs.map
|
|
24
|
+
//# sourceMappingURL=registry-auth-CNH84uo4.mjs.map
|
|
25
|
+
//# debugId=2e430ad3-fb2c-5578-8c85-ccce5c5a369e
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry-auth-CNH84uo4.mjs","
|
|
1
|
+
{"version":3,"file":"registry-auth-CNH84uo4.mjs","sources":["../src/services/registry-auth.ts"],"sourcesContent":["import { generateAccessToken } from \"@renown/sdk/node\";\nimport { getRenown } from \"./auth.js\";\n\n/**\n * Mint a Renown bearer token bound to the given registry URL via the JWT\n * `aud` claim. Throws if the user is not authenticated (`ph login` first).\n *\n * The audience binding is what lets the registry distinguish a token minted\n * for it from one minted for a different service or registry.\n */\nexport async function mintRegistryAuthToken(\n registryUrl: string,\n expiresInSeconds: number,\n): Promise<string> {\n const renown = await getRenown();\n if (!renown.user) {\n throw new Error(\"Not authenticated with Renown. Run 'ph login' first.\");\n }\n const result = await generateAccessToken(renown, {\n expiresIn: expiresInSeconds,\n aud: registryUrl,\n });\n return result.token;\n}\n"],"names":[],"mappings":";;;;;;;;;;;;AAUA,eAAsB,sBACpB,aACA,kBACiB;CACjB,MAAM,SAAS,MAAM,WAAW;AAChC,KAAI,CAAC,OAAO,KACV,OAAM,IAAI,MAAM,uDAAuD;AAMzE,SAJe,MAAM,oBAAoB,QAAQ;EAC/C,WAAW;EACX,KAAK;EACN,CAAC,EACY","debug_id":"2e430ad3-fb2c-5578-8c85-ccce5c5a369e"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ddd7c020-503e-5f0c-a16e-0ab57367edad")}catch(e){}}();
|
|
1
3
|
import path from "node:path";
|
|
2
4
|
import { startSwitchboard } from "@powerhousedao/switchboard/server";
|
|
3
5
|
//#region src/services/switchboard.ts
|
|
@@ -69,4 +71,5 @@ async function startSwitchboard$1(options, logger) {
|
|
|
69
71
|
//#endregion
|
|
70
72
|
export { startSwitchboard$1 as n, defaultSwitchboardOptions as t };
|
|
71
73
|
|
|
72
|
-
//# sourceMappingURL=switchboard-BsdbF-rL.mjs.map
|
|
74
|
+
//# sourceMappingURL=switchboard-BsdbF-rL.mjs.map
|
|
75
|
+
//# debugId=ddd7c020-503e-5f0c-a16e-0ab57367edad
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchboard-BsdbF-rL.mjs","
|
|
1
|
+
{"version":3,"file":"switchboard-BsdbF-rL.mjs","sources":["../src/services/switchboard.ts"],"sourcesContent":["import type {\n IdentityOptions,\n StartServerOptions,\n} from \"@powerhousedao/switchboard/server\";\nimport { startSwitchboard as startSwitchboardServer } from \"@powerhousedao/switchboard/server\";\nimport type { ILogger } from \"document-model\";\nimport path from \"node:path\";\nimport type { SwitchboardArgs } from \"../types.js\";\n\nexport const defaultSwitchboardOptions = {\n port: 4001,\n dbPath: path.join(process.cwd(), \".ph/read-model.db\"),\n drive: {\n id: \"powerhouse\",\n slug: \"powerhouse\",\n global: {\n name: \"Powerhouse\",\n icon: \"https://ipfs.io/ipfs/QmcaTDBYn8X2psGaXe7iQ6qd8q6oqHLgxvMX9yXf7f9uP7\",\n },\n local: {\n availableOffline: true,\n listeners: [],\n sharingType: \"public\",\n triggers: [],\n },\n },\n mcp: true,\n} satisfies StartServerOptions;\n\nfunction getDefaultVetraSwitchboardOptions(\n vetraDriveId: string,\n): Partial<StartServerOptions> {\n return {\n port: 4001,\n dbPath: path.join(process.cwd(), \".ph/read-model.db\"),\n drive: {\n id: vetraDriveId,\n slug: vetraDriveId,\n global: {\n name: \"Vetra\",\n icon: \"https://azure-elderly-tortoise-212.mypinata.cloud/ipfs/bafkreibf2xokjqqtomqjd2w2xxmmhvogq4262csevclxh6sbrjgmjfre5u\",\n },\n preferredEditor: \"vetra-drive-app\",\n local: {\n availableOffline: true,\n listeners: [],\n sharingType: \"public\",\n triggers: [],\n },\n },\n };\n}\n\nexport async function startSwitchboard(\n options: SwitchboardArgs & {\n strictPort?: boolean;\n processorConfig?: Map<string, unknown>;\n },\n logger?: ILogger,\n) {\n const {\n packages: packagesString,\n remoteDrives,\n useVetraDrive,\n vetraDriveId,\n useIdentity,\n keypairPath,\n requireIdentity,\n ...serverOptions\n } = options;\n\n // Choose the appropriate default configuration\n const defaultOptions = useVetraDrive\n ? getDefaultVetraSwitchboardOptions(vetraDriveId)\n : defaultSwitchboardOptions;\n\n // Build identity options if enabled\n const identity: IdentityOptions | undefined =\n useIdentity || keypairPath || requireIdentity\n ? {\n keypairPath,\n requireExisting: requireIdentity,\n }\n : undefined;\n\n const packages = packagesString?.split(\",\");\n\n // Only include the default drive if no remote drives are provided\n const finalOptions =\n remoteDrives.length > 0\n ? {\n ...defaultOptions,\n drive: undefined, // Don't create default drive when syncing with remote\n ...serverOptions,\n remoteDrives,\n identity,\n packages,\n logger,\n }\n : {\n ...defaultOptions,\n ...serverOptions,\n remoteDrives,\n identity,\n packages,\n logger,\n };\n\n const reactor = await startSwitchboardServer(finalOptions);\n\n return reactor;\n}\n"],"names":["startSwitchboard","startSwitchboardServer"],"mappings":";;;;;AASA,MAAa,4BAA4B;CACvC,MAAM;CACN,QAAQ,KAAK,KAAK,QAAQ,KAAK,EAAE,oBAAoB;CACrD,OAAO;EACL,IAAI;EACJ,MAAM;EACN,QAAQ;GACN,MAAM;GACN,MAAM;GACP;EACD,OAAO;GACL,kBAAkB;GAClB,WAAW,EAAE;GACb,aAAa;GACb,UAAU,EAAE;GACb;EACF;CACD,KAAK;CACN;AAED,SAAS,kCACP,cAC6B;AAC7B,QAAO;EACL,MAAM;EACN,QAAQ,KAAK,KAAK,QAAQ,KAAK,EAAE,oBAAoB;EACrD,OAAO;GACL,IAAI;GACJ,MAAM;GACN,QAAQ;IACN,MAAM;IACN,MAAM;IACP;GACD,iBAAiB;GACjB,OAAO;IACL,kBAAkB;IAClB,WAAW,EAAE;IACb,aAAa;IACb,UAAU,EAAE;IACb;GACF;EACF;;AAGH,eAAsBA,mBACpB,SAIA,QACA;CACA,MAAM,EACJ,UAAU,gBACV,cACA,eACA,cACA,aACA,aACA,iBACA,GAAG,kBACD;CAGJ,MAAM,iBAAiB,gBACnB,kCAAkC,aAAa,GAC/C;CAGJ,MAAM,WACJ,eAAe,eAAe,kBAC1B;EACE;EACA,iBAAiB;EAClB,GACD,KAAA;CAEN,MAAM,WAAW,gBAAgB,MAAM,IAAI;AAyB3C,QAFgB,MAAMC,iBAnBpB,aAAa,SAAS,IAClB;EACE,GAAG;EACH,OAAO,KAAA;EACP,GAAG;EACH;EACA;EACA;EACA;EACD,GACD;EACE,GAAG;EACH,GAAG;EACH;EACA;EACA;EACA;EACD,CAEmD","debug_id":"ddd7c020-503e-5f0c-a16e-0ab57367edad"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { n as startSwitchboard } from "./switchboard-BsdbF-rL.mjs";
|
|
2
2
|
export { startSwitchboard };
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b723e0a9-0558-5c56-b8bb-1b5785fd8633")}catch(e){}}();
|
|
4
|
+
//# debugId=b723e0a9-0558-5c56-b8bb-1b5785fd8633
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4ec454c2-51e0-5620-85cc-296ec21997cd")}catch(e){}}();
|
|
1
3
|
import { Kysely, PostgresDialect } from "kysely";
|
|
2
4
|
import { Pool } from "pg";
|
|
3
5
|
import { REACTOR_SCHEMA, getMigrationStatus, runMigrations } from "@powerhousedao/reactor";
|
|
@@ -47,4 +49,5 @@ async function runSwitchboardMigrations(options) {
|
|
|
47
49
|
//#endregion
|
|
48
50
|
export { runSwitchboardMigrations };
|
|
49
51
|
|
|
50
|
-
//# sourceMappingURL=switchboard-migrate-BumRp7rC.mjs.map
|
|
52
|
+
//# sourceMappingURL=switchboard-migrate-BumRp7rC.mjs.map
|
|
53
|
+
//# debugId=4ec454c2-51e0-5620-85cc-296ec21997cd
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"switchboard-migrate-BumRp7rC.mjs","
|
|
1
|
+
{"version":3,"file":"switchboard-migrate-BumRp7rC.mjs","sources":["../src/services/switchboard-migrate.ts"],"sourcesContent":["import { Kysely, PostgresDialect } from \"kysely\";\nimport { Pool } from \"pg\";\nimport {\n runMigrations,\n getMigrationStatus,\n REACTOR_SCHEMA,\n} from \"@powerhousedao/reactor\";\n\ninterface MigrationOptions {\n dbPath?: string;\n statusOnly?: boolean;\n}\n\nfunction isPostgresUrl(url: string): boolean {\n return url.startsWith(\"postgresql://\") || url.startsWith(\"postgres://\");\n}\n\nexport async function runSwitchboardMigrations(\n options: MigrationOptions,\n): Promise<void> {\n const dbPath =\n options.dbPath ??\n process.env.PH_REACTOR_DATABASE_URL ??\n process.env.DATABASE_URL;\n\n if (!dbPath || !isPostgresUrl(dbPath)) {\n console.log(\"No PostgreSQL URL configured. Skipping migrations.\");\n console.log(\"(PGlite migrations are handled automatically on startup)\");\n return;\n }\n\n console.log(`Database: ${dbPath}`);\n\n const pool = new Pool({ connectionString: dbPath });\n\n const db = new Kysely<any>({\n dialect: new PostgresDialect({ pool }),\n });\n\n try {\n if (options.statusOnly) {\n console.log(\"\\nChecking migration status...\");\n const migrations = await getMigrationStatus(db, REACTOR_SCHEMA);\n\n console.log(\"\\nMigration Status:\");\n console.log(\"=================\");\n\n for (const migration of migrations) {\n const status = migration.executedAt\n ? `[OK] Executed at ${migration.executedAt.toISOString()}`\n : \"[--] Pending\";\n console.log(`${status} - ${migration.name}`);\n }\n } else {\n console.log(\"\\nRunning migrations...\");\n const result = await runMigrations(db, REACTOR_SCHEMA);\n\n if (!result.success) {\n console.error(\"Migration failed:\", result.error?.message);\n process.exit(1);\n }\n\n if (result.migrationsExecuted.length === 0) {\n console.log(\"No migrations to run - database is up to date\");\n } else {\n console.log(\n `Successfully executed ${result.migrationsExecuted.length} migration(s):`,\n );\n for (const name of result.migrationsExecuted) {\n console.log(` - ${name}`);\n }\n }\n }\n } catch (error) {\n console.error(\n \"Error:\",\n error instanceof Error ? error.message : String(error),\n );\n process.exit(1);\n } finally {\n await db.destroy();\n }\n}\n"],"names":[],"mappings":";;;;;;AAaA,SAAS,cAAc,KAAsB;AAC3C,QAAO,IAAI,WAAW,gBAAgB,IAAI,IAAI,WAAW,cAAc;;AAGzE,eAAsB,yBACpB,SACe;CACf,MAAM,SACJ,QAAQ,UACR,QAAQ,IAAI,2BACZ,QAAQ,IAAI;AAEd,KAAI,CAAC,UAAU,CAAC,cAAc,OAAO,EAAE;AACrC,UAAQ,IAAI,qDAAqD;AACjE,UAAQ,IAAI,2DAA2D;AACvE;;AAGF,SAAQ,IAAI,aAAa,SAAS;CAIlC,MAAM,KAAK,IAAI,OAAY,EACzB,SAAS,IAAI,gBAAgB,EAAE,MAHpB,IAAI,KAAK,EAAE,kBAAkB,QAAQ,CAAC,EAGZ,CAAC,EACvC,CAAC;AAEF,KAAI;AACF,MAAI,QAAQ,YAAY;AACtB,WAAQ,IAAI,iCAAiC;GAC7C,MAAM,aAAa,MAAM,mBAAmB,IAAI,eAAe;AAE/D,WAAQ,IAAI,sBAAsB;AAClC,WAAQ,IAAI,oBAAoB;AAEhC,QAAK,MAAM,aAAa,YAAY;IAClC,MAAM,SAAS,UAAU,aACrB,oBAAoB,UAAU,WAAW,aAAa,KACtD;AACJ,YAAQ,IAAI,GAAG,OAAO,KAAK,UAAU,OAAO;;SAEzC;AACL,WAAQ,IAAI,0BAA0B;GACtC,MAAM,SAAS,MAAM,cAAc,IAAI,eAAe;AAEtD,OAAI,CAAC,OAAO,SAAS;AACnB,YAAQ,MAAM,qBAAqB,OAAO,OAAO,QAAQ;AACzD,YAAQ,KAAK,EAAE;;AAGjB,OAAI,OAAO,mBAAmB,WAAW,EACvC,SAAQ,IAAI,gDAAgD;QACvD;AACL,YAAQ,IACN,yBAAyB,OAAO,mBAAmB,OAAO,gBAC3D;AACD,SAAK,MAAM,QAAQ,OAAO,mBACxB,SAAQ,IAAI,OAAO,OAAO;;;UAIzB,OAAO;AACd,UAAQ,MACN,UACA,iBAAiB,QAAQ,MAAM,UAAU,OAAO,MAAM,CACvD;AACD,UAAQ,KAAK,EAAE;WACP;AACR,QAAM,GAAG,SAAS","debug_id":"4ec454c2-51e0-5620-85cc-296ec21997cd"}
|
package/dist/utils-C6581aex.mjs
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import { d as updateConfigFile, p as updateStylesFile, u as removeStylesImports } from "./utils-mth8NsDA.mjs";
|
|
2
2
|
export { removeStylesImports, updateConfigFile, updateStylesFile };
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3d7f3fa3-6649-5585-bcb4-e764a14abfbd")}catch(e){}}();
|
|
4
|
+
//# debugId=3d7f3fa3-6649-5585-bcb4-e764a14abfbd
|
package/dist/utils-mth8NsDA.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3669863c-cb61-5078-a06d-d6092bf6e05b")}catch(e){}}();
|
|
1
3
|
import path, { dirname } from "node:path";
|
|
2
4
|
import fs from "node:fs";
|
|
3
5
|
import crypto from "node:crypto";
|
|
@@ -159,4 +161,5 @@ function removeStylesImports(dependencies, projectPath) {
|
|
|
159
161
|
//#endregion
|
|
160
162
|
export { generateProjectDriveId as a, isPowerhouseProject as c, updateConfigFile as d, updatePackagesArray as f, findNodeProjectRoot as i, packageManagers as l, POWERHOUSE_GLOBAL_DIR as n, getPackageManagerFromLockfile as o, updateStylesFile as p, defaultPathValidation as r, getProjectInfo as s, POWERHOUSE_CONFIG_FILE as t, removeStylesImports as u };
|
|
161
163
|
|
|
162
|
-
//# sourceMappingURL=utils-mth8NsDA.mjs.map
|
|
164
|
+
//# sourceMappingURL=utils-mth8NsDA.mjs.map
|
|
165
|
+
//# debugId=3669863c-cb61-5078-a06d-d6092bf6e05b
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-mth8NsDA.mjs","names":[],"sources":["../src/utils.ts"],"sourcesContent":["import type { PowerhouseConfig } from \"@powerhousedao/config\";\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport path, { dirname } from \"node:path\";\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\";\nexport const POWERHOUSE_GLOBAL_DIR = path.join(homedir(), \".ph\");\nexport const SUPPORTED_PACKAGE_MANAGERS = [\"npm\", \"yarn\", \"pnpm\", \"bun\"];\n\nexport const packageManagers = {\n bun: {\n globalPathRegexp: /[\\\\/].bun[\\\\/]/,\n installCommand: \"bun add {{dependency}}\",\n uninstallCommand: \"bun remove {{dependency}}\",\n workspaceOption: \"\",\n lockfile: \"bun.lock\",\n updateCommand: \"bun update {{dependency}}\",\n buildAffected: \"bun run build:affected\",\n },\n pnpm: {\n globalPathRegexp: /[\\\\/]pnpm[\\\\/]/,\n installCommand: \"pnpm add {{dependency}}\",\n uninstallCommand: \"pnpm remove {{dependency}}\",\n workspaceOption: \"--workspace-root\",\n lockfile: \"pnpm-lock.yaml\",\n updateCommand: \"pnpm update {{dependency}}\",\n buildAffected: \"pnpm run build:affected\",\n },\n yarn: {\n globalPathRegexp: /[\\\\/]yarn[\\\\/]/,\n installCommand: \"yarn add {{dependency}}\",\n uninstallCommand: \"yarn remove {{dependency}}\",\n workspaceOption: \"-W\",\n lockfile: \"yarn.lock\",\n updateCommand: \"yarn upgrade {{dependency}}\",\n buildAffected: \"yarn run build:affected\",\n },\n npm: {\n installCommand: \"npm install {{dependency}}\",\n uninstallCommand: \"npm uninstall {{dependency}}\",\n workspaceOption: \"\",\n lockfile: \"package-lock.json\",\n updateCommand: \"npm update {{dependency}} --save\",\n buildAffected: \"npm run build:affected\",\n },\n};\n\ntype PathValidation = (dir: string) => boolean;\n\nexport type PackageManager = \"npm\" | \"yarn\" | \"pnpm\" | \"bun\";\n\nexport type ProjectInfo = {\n isGlobal: boolean;\n path: string;\n packageManager: PackageManager;\n};\n\nexport function defaultPathValidation() {\n return true;\n}\n\nexport function isPowerhouseProject(dir: string) {\n const powerhouseConfigPath = path.join(dir, POWERHOUSE_CONFIG_FILE);\n\n return fs.existsSync(powerhouseConfigPath);\n}\n\nexport function findNodeProjectRoot(\n dir: string,\n pathValidation: PathValidation = defaultPathValidation,\n) {\n const packageJsonPath = path.join(dir, \"package.json\");\n\n if (fs.existsSync(packageJsonPath) && pathValidation(dir)) {\n return dir;\n }\n\n const parentDir = dirname(dir);\n\n if (parentDir === dir) {\n return null;\n }\n\n return findNodeProjectRoot(parentDir, pathValidation);\n}\n\nexport function getProjectInfo(debug?: boolean): ProjectInfo {\n const currentPath = process.cwd();\n\n if (debug) {\n console.log(\">>> currentPath\", currentPath);\n }\n\n const projectPath = findNodeProjectRoot(currentPath, isPowerhouseProject);\n\n if (!projectPath) {\n return {\n isGlobal: true,\n path: POWERHOUSE_GLOBAL_DIR,\n packageManager: getPackageManagerFromLockfile(POWERHOUSE_GLOBAL_DIR),\n };\n }\n\n return {\n isGlobal: false,\n path: projectPath,\n packageManager: getPackageManagerFromLockfile(projectPath),\n };\n}\n\n/**\n * Generates a unique drive ID based on the project path.\n * The same project path will always generate the same ID.\n * @param name - The name prefix for the drive ID (e.g., \"vetra\", \"powerhouse\")\n * @returns A unique drive ID in the format \"{name}-{hash}\"\n */\nexport function generateProjectDriveId(name: string): string {\n const projectInfo = getProjectInfo();\n const hash = crypto\n .createHash(\"sha256\")\n .update(projectInfo.path)\n .digest(\"hex\");\n const shortHash = hash.substring(0, 8);\n return `${name}-${shortHash}`;\n}\n\nexport function getPackageManagerFromLockfile(dir: string): PackageManager {\n if (fs.existsSync(path.join(dir, packageManagers.pnpm.lockfile))) {\n return \"pnpm\";\n } else if (fs.existsSync(path.join(dir, packageManagers.yarn.lockfile))) {\n return \"yarn\";\n } else if (fs.existsSync(path.join(dir, packageManagers.bun.lockfile))) {\n return \"bun\";\n }\n\n return \"npm\";\n}\n\nexport function updatePackagesArray(\n currentPackages: PowerhouseConfig[\"packages\"] = [],\n dependencies: { name: string; version: string | undefined }[],\n task: \"install\" | \"uninstall\" = \"install\",\n provider: \"registry\" | \"local\" = \"registry\",\n): PowerhouseConfig[\"packages\"] {\n const isInstall = task === \"install\";\n const mappedPackages = dependencies.map((dep) => ({\n packageName: dep.name,\n version: dep.version,\n provider,\n }));\n\n if (isInstall) {\n // Overwrite existing package if version is different\n const filteredPackages = currentPackages.filter(\n (pkg) => !dependencies.find((dep) => dep.name === pkg.packageName),\n );\n return [...filteredPackages, ...mappedPackages];\n }\n\n return currentPackages.filter(\n (pkg) => !dependencies.map((dep) => dep.name).includes(pkg.packageName),\n );\n}\n\n// Modify updateConfigFile to use the new function\nexport function updateConfigFile(\n dependencies: { name: string; version: string | undefined }[],\n projectPath: string,\n task: \"install\" | \"uninstall\" = \"install\",\n provider: \"registry\" | \"local\" = \"registry\",\n registryUrl?: string,\n) {\n const configPath = path.join(projectPath, POWERHOUSE_CONFIG_FILE);\n\n if (!fs.existsSync(configPath)) {\n throw new Error(\n `powerhouse.config.json file not found. projectPath: ${projectPath}`,\n );\n }\n\n const config = JSON.parse(\n fs.readFileSync(configPath, \"utf-8\"),\n ) as PowerhouseConfig;\n\n const updatedConfig: PowerhouseConfig = {\n ...config,\n packages: updatePackagesArray(\n config.packages,\n dependencies,\n task,\n provider,\n ),\n };\n\n if (\n task === \"install\" &&\n registryUrl &&\n !config.packageRegistryUrl &&\n dependencies.length > 0\n ) {\n updatedConfig.packageRegistryUrl = registryUrl;\n }\n\n fs.writeFileSync(configPath, JSON.stringify(updatedConfig, null, 2));\n}\n\n/**\n * Recursively searches for a specific file by traversing up the directory tree.\n * Starting from the given path, it checks each parent directory until it finds\n * the target file or reaches the root directory.\n *\n * @param startPath - The absolute path of the directory to start searching from\n * @param targetFile - The name of the file to search for (e.g., 'package.json', 'pnpm-workspace.yaml')\n * @returns The absolute path of the directory containing the target file, or null if not found\n *\n * @example\n * // Find the workspace root directory\n * const workspaceRoot = findContainerDirectory('/path/to/project/src', 'pnpm-workspace.yaml');\n *\n * // Find the nearest package.json\n * const packageDir = findContainerDirectory('/path/to/project/src/components', 'package.json');\n */\nexport const findContainerDirectory = (\n startPath: string,\n targetFile: string,\n): string | null => {\n const filePath = path.join(startPath, targetFile);\n\n if (fs.existsSync(filePath)) {\n return startPath;\n }\n\n const parentDir = path.dirname(startPath);\n\n //reached the root directory and haven't found the file\n if (parentDir === startPath) {\n return null;\n }\n\n return findContainerDirectory(parentDir, targetFile);\n};\n\n/**\n * Updates the styles.css file to include imports for newly installed packages\n * @param dependencies - Array of dependencies that were installed\n * @param projectPath - Path to the project root\n */\nexport function updateStylesFile(\n dependencies: { name: string; version: string | undefined }[],\n projectPath: string,\n) {\n const stylesPath = path.join(projectPath, \"style.css\");\n\n // Check if styles.css exists\n if (!fs.existsSync(stylesPath)) {\n console.warn(\"⚠️ Warning: style.css file not found in project root\");\n return;\n }\n\n const currentStyles = fs.readFileSync(stylesPath, \"utf-8\");\n let updatedStyles = currentStyles;\n\n for (const dep of dependencies) {\n const cssPath = `./node_modules/${dep.name}/dist/style.css`;\n const fullCssPath = path.join(projectPath, cssPath);\n const importStatement = `@import '${cssPath}';`;\n\n // Check if the CSS file exists\n if (!fs.existsSync(fullCssPath)) {\n console.warn(`⚠️ Warning: CSS file not found at ${cssPath}`);\n continue;\n }\n\n // Check if import already exists\n if (currentStyles.includes(importStatement)) {\n continue;\n }\n\n // Find the last @import statement\n const importLines = currentStyles\n .split(\"\\n\")\n .filter((line) => line.trim().startsWith(\"@import\"));\n const lastImport = importLines[importLines.length - 1];\n\n if (lastImport) {\n // Insert new import after the last existing import\n updatedStyles = currentStyles.replace(\n lastImport,\n `${lastImport}\\n${importStatement}`,\n );\n } else {\n // If no imports exist, add at the top of the file\n updatedStyles = `${importStatement}\\n${currentStyles}`;\n }\n }\n\n // Only write if changes were made\n if (updatedStyles !== currentStyles) {\n fs.writeFileSync(stylesPath, updatedStyles);\n }\n}\n\n/**\n * Removes CSS imports for uninstalled packages from styles.css\n */\nexport function removeStylesImports(\n dependencies: { name: string; version: string | undefined }[],\n projectPath: string,\n) {\n const stylesPath = path.join(projectPath, \"style.css\");\n\n // Check if styles.css exists\n if (!fs.existsSync(stylesPath)) {\n console.warn(\"⚠️ Warning: style.css file not found in project root\");\n return;\n }\n\n const currentStyles = fs.readFileSync(stylesPath, \"utf-8\");\n let updatedStyles = currentStyles;\n\n for (const dep of dependencies) {\n const cssPath = `./node_modules/${dep.name}/dist/style.css`;\n const importStatement = `@import '${cssPath}';`;\n\n // Remove the import line if it exists\n const lines = updatedStyles.split(\"\\n\");\n const filteredLines = lines.filter(\n (line) => !line.trim().includes(importStatement),\n );\n\n if (filteredLines.length !== lines.length) {\n updatedStyles = filteredLines.join(\"\\n\");\n }\n }\n\n // Only write if changes were made\n if (updatedStyles !== currentStyles) {\n fs.writeFileSync(stylesPath, updatedStyles);\n }\n}\n"],"mappings":";;;;;AAKA,MAAa,yBAAyB;AACtC,MAAa,wBAAwB,KAAK,KAAK,SAAS,EAAE,MAAM;AAGhE,MAAa,kBAAkB;CAC7B,KAAK;EACH,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,iBAAiB;EACjB,UAAU;EACV,eAAe;EACf,eAAe;EAChB;CACD,MAAM;EACJ,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,iBAAiB;EACjB,UAAU;EACV,eAAe;EACf,eAAe;EAChB;CACD,MAAM;EACJ,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,iBAAiB;EACjB,UAAU;EACV,eAAe;EACf,eAAe;EAChB;CACD,KAAK;EACH,gBAAgB;EAChB,kBAAkB;EAClB,iBAAiB;EACjB,UAAU;EACV,eAAe;EACf,eAAe;EAChB;CACF;AAYD,SAAgB,wBAAwB;AACtC,QAAO;;AAGT,SAAgB,oBAAoB,KAAa;CAC/C,MAAM,uBAAuB,KAAK,KAAK,KAAK,uBAAuB;AAEnE,QAAO,GAAG,WAAW,qBAAqB;;AAG5C,SAAgB,oBACd,KACA,iBAAiC,uBACjC;CACA,MAAM,kBAAkB,KAAK,KAAK,KAAK,eAAe;AAEtD,KAAI,GAAG,WAAW,gBAAgB,IAAI,eAAe,IAAI,CACvD,QAAO;CAGT,MAAM,YAAY,QAAQ,IAAI;AAE9B,KAAI,cAAc,IAChB,QAAO;AAGT,QAAO,oBAAoB,WAAW,eAAe;;AAGvD,SAAgB,eAAe,OAA8B;CAC3D,MAAM,cAAc,QAAQ,KAAK;AAEjC,KAAI,MACF,SAAQ,IAAI,mBAAmB,YAAY;CAG7C,MAAM,cAAc,oBAAoB,aAAa,oBAAoB;AAEzE,KAAI,CA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IAAI,gBAAgB;AAEpB,MAAK,MAAM,OAAO,cAAc;EAE9B,MAAM,kBAAkB,YADR,kBAAkB,IAAI,KAAK,iBACC;EAG5C,MAAM,QAAQ,cAAc,MAAM,KAAK;EACvC,MAAM,gBAAgB,MAAM,QACzB,SAAS,CAAC,KAAK,MAAM,CAAC,SAAS,gBAAgB,CACjD;AAED,MAAI,cAAc,WAAW,MAAM,OACjC,iBAAgB,cAAc,KAAK,KAAK;;AAK5C,KAAI,kBAAkB,cACpB,IAAG,cAAc,YAAY,cAAc"}
|
|
1
|
+
{"version":3,"file":"utils-mth8NsDA.mjs","sources":["../src/utils.ts"],"sourcesContent":["import type { PowerhouseConfig } from \"@powerhousedao/config\";\nimport crypto from \"node:crypto\";\nimport fs from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport path, { dirname } from \"node:path\";\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\";\nexport const POWERHOUSE_GLOBAL_DIR = path.join(homedir(), \".ph\");\nexport const SUPPORTED_PACKAGE_MANAGERS = [\"npm\", \"yarn\", \"pnpm\", \"bun\"];\n\nexport const packageManagers = {\n bun: {\n globalPathRegexp: /[\\\\/].bun[\\\\/]/,\n installCommand: \"bun add {{dependency}}\",\n uninstallCommand: \"bun remove {{dependency}}\",\n workspaceOption: \"\",\n lockfile: \"bun.lock\",\n updateCommand: \"bun update {{dependency}}\",\n buildAffected: \"bun run build:affected\",\n },\n pnpm: {\n globalPathRegexp: /[\\\\/]pnpm[\\\\/]/,\n installCommand: \"pnpm add {{dependency}}\",\n uninstallCommand: \"pnpm remove {{dependency}}\",\n workspaceOption: \"--workspace-root\",\n lockfile: \"pnpm-lock.yaml\",\n updateCommand: \"pnpm update {{dependency}}\",\n buildAffected: \"pnpm run build:affected\",\n },\n yarn: {\n globalPathRegexp: /[\\\\/]yarn[\\\\/]/,\n installCommand: \"yarn add {{dependency}}\",\n uninstallCommand: \"yarn remove {{dependency}}\",\n workspaceOption: \"-W\",\n lockfile: \"yarn.lock\",\n updateCommand: \"yarn upgrade {{dependency}}\",\n buildAffected: \"yarn run build:affected\",\n },\n npm: {\n installCommand: \"npm install {{dependency}}\",\n uninstallCommand: \"npm uninstall {{dependency}}\",\n workspaceOption: \"\",\n lockfile: \"package-lock.json\",\n updateCommand: \"npm update {{dependency}} --save\",\n buildAffected: \"npm run build:affected\",\n },\n};\n\ntype PathValidation = (dir: string) => boolean;\n\nexport type PackageManager = \"npm\" | \"yarn\" | \"pnpm\" | \"bun\";\n\nexport type ProjectInfo = {\n isGlobal: boolean;\n path: string;\n packageManager: PackageManager;\n};\n\nexport function defaultPathValidation() {\n return true;\n}\n\nexport function isPowerhouseProject(dir: string) {\n const powerhouseConfigPath = path.join(dir, POWERHOUSE_CONFIG_FILE);\n\n return fs.existsSync(powerhouseConfigPath);\n}\n\nexport function findNodeProjectRoot(\n dir: string,\n pathValidation: PathValidation = defaultPathValidation,\n) {\n const packageJsonPath = path.join(dir, \"package.json\");\n\n if (fs.existsSync(packageJsonPath) && pathValidation(dir)) {\n return dir;\n }\n\n const parentDir = dirname(dir);\n\n if (parentDir === dir) {\n return null;\n }\n\n return findNodeProjectRoot(parentDir, pathValidation);\n}\n\nexport function getProjectInfo(debug?: boolean): ProjectInfo {\n const currentPath = process.cwd();\n\n if (debug) {\n console.log(\">>> currentPath\", currentPath);\n }\n\n const projectPath = findNodeProjectRoot(currentPath, isPowerhouseProject);\n\n if (!projectPath) {\n return {\n isGlobal: true,\n path: POWERHOUSE_GLOBAL_DIR,\n packageManager: getPackageManagerFromLockfile(POWERHOUSE_GLOBAL_DIR),\n };\n }\n\n return {\n isGlobal: false,\n path: projectPath,\n packageManager: getPackageManagerFromLockfile(projectPath),\n };\n}\n\n/**\n * Generates a unique drive ID based on the project path.\n * The same project path will always generate the same ID.\n * @param name - The name prefix for the drive ID (e.g., \"vetra\", \"powerhouse\")\n * @returns A unique drive ID in the format \"{name}-{hash}\"\n */\nexport function generateProjectDriveId(name: string): string {\n const projectInfo = getProjectInfo();\n const hash = crypto\n .createHash(\"sha256\")\n .update(projectInfo.path)\n .digest(\"hex\");\n const shortHash = hash.substring(0, 8);\n return `${name}-${shortHash}`;\n}\n\nexport function getPackageManagerFromLockfile(dir: string): PackageManager {\n if (fs.existsSync(path.join(dir, packageManagers.pnpm.lockfile))) {\n return \"pnpm\";\n } else if (fs.existsSync(path.join(dir, packageManagers.yarn.lockfile))) {\n return \"yarn\";\n } else if (fs.existsSync(path.join(dir, packageManagers.bun.lockfile))) {\n return \"bun\";\n }\n\n return \"npm\";\n}\n\nexport function updatePackagesArray(\n currentPackages: PowerhouseConfig[\"packages\"] = [],\n dependencies: { name: string; version: string | undefined }[],\n task: \"install\" | \"uninstall\" = \"install\",\n provider: \"registry\" | \"local\" = \"registry\",\n): PowerhouseConfig[\"packages\"] {\n const isInstall = task === \"install\";\n const mappedPackages = dependencies.map((dep) => ({\n packageName: dep.name,\n version: dep.version,\n provider,\n }));\n\n if (isInstall) {\n // Overwrite existing package if version is different\n const filteredPackages = currentPackages.filter(\n (pkg) => !dependencies.find((dep) => dep.name === pkg.packageName),\n );\n return [...filteredPackages, ...mappedPackages];\n }\n\n return currentPackages.filter(\n (pkg) => !dependencies.map((dep) => dep.name).includes(pkg.packageName),\n );\n}\n\n// Modify updateConfigFile to use the new function\nexport function updateConfigFile(\n dependencies: { name: string; version: string | undefined }[],\n projectPath: string,\n task: \"install\" | \"uninstall\" = \"install\",\n provider: \"registry\" | \"local\" = \"registry\",\n registryUrl?: string,\n) {\n const configPath = path.join(projectPath, POWERHOUSE_CONFIG_FILE);\n\n if (!fs.existsSync(configPath)) {\n throw new Error(\n `powerhouse.config.json file not found. projectPath: ${projectPath}`,\n );\n }\n\n const config = JSON.parse(\n fs.readFileSync(configPath, \"utf-8\"),\n ) as PowerhouseConfig;\n\n const updatedConfig: PowerhouseConfig = {\n ...config,\n packages: updatePackagesArray(\n config.packages,\n dependencies,\n task,\n provider,\n ),\n };\n\n if (\n task === \"install\" &&\n registryUrl &&\n !config.packageRegistryUrl &&\n dependencies.length > 0\n ) {\n updatedConfig.packageRegistryUrl = registryUrl;\n }\n\n fs.writeFileSync(configPath, JSON.stringify(updatedConfig, null, 2));\n}\n\n/**\n * Recursively searches for a specific file by traversing up the directory tree.\n * Starting from the given path, it checks each parent directory until it finds\n * the target file or reaches the root directory.\n *\n * @param startPath - The absolute path of the directory to start searching from\n * @param targetFile - The name of the file to search for (e.g., 'package.json', 'pnpm-workspace.yaml')\n * @returns The absolute path of the directory containing the target file, or null if not found\n *\n * @example\n * // Find the workspace root directory\n * const workspaceRoot = findContainerDirectory('/path/to/project/src', 'pnpm-workspace.yaml');\n *\n * // Find the nearest package.json\n * const packageDir = findContainerDirectory('/path/to/project/src/components', 'package.json');\n */\nexport const findContainerDirectory = (\n startPath: string,\n targetFile: string,\n): string | null => {\n const filePath = path.join(startPath, targetFile);\n\n if (fs.existsSync(filePath)) {\n return startPath;\n }\n\n const parentDir = path.dirname(startPath);\n\n //reached the root directory and haven't found the file\n if (parentDir === startPath) {\n return null;\n }\n\n return findContainerDirectory(parentDir, targetFile);\n};\n\n/**\n * Updates the styles.css file to include imports for newly installed packages\n * @param dependencies - Array of dependencies that were installed\n * @param projectPath - Path to the project root\n */\nexport function updateStylesFile(\n dependencies: { name: string; version: string | undefined }[],\n projectPath: string,\n) {\n const stylesPath = path.join(projectPath, \"style.css\");\n\n // Check if styles.css exists\n if (!fs.existsSync(stylesPath)) {\n console.warn(\"⚠️ Warning: style.css file not found in project root\");\n return;\n }\n\n const currentStyles = fs.readFileSync(stylesPath, \"utf-8\");\n let updatedStyles = currentStyles;\n\n for (const dep of dependencies) {\n const cssPath = `./node_modules/${dep.name}/dist/style.css`;\n const fullCssPath = path.join(projectPath, cssPath);\n const importStatement = `@import '${cssPath}';`;\n\n // Check if the CSS file exists\n if (!fs.existsSync(fullCssPath)) {\n console.warn(`⚠️ Warning: CSS file not found at ${cssPath}`);\n continue;\n }\n\n // Check if import already exists\n if (currentStyles.includes(importStatement)) {\n continue;\n }\n\n // Find the last @import statement\n const importLines = currentStyles\n .split(\"\\n\")\n .filter((line) => line.trim().startsWith(\"@import\"));\n const lastImport = importLines[importLines.length - 1];\n\n if (lastImport) {\n // Insert new import after the last existing import\n updatedStyles = currentStyles.replace(\n lastImport,\n `${lastImport}\\n${importStatement}`,\n );\n } else {\n // If no imports exist, add at the top of the file\n updatedStyles = `${importStatement}\\n${currentStyles}`;\n }\n }\n\n // Only write if changes were made\n if (updatedStyles !== currentStyles) {\n fs.writeFileSync(stylesPath, updatedStyles);\n }\n}\n\n/**\n * Removes CSS imports for uninstalled packages from styles.css\n */\nexport function removeStylesImports(\n dependencies: { name: string; version: string | undefined }[],\n projectPath: string,\n) {\n const stylesPath = path.join(projectPath, \"style.css\");\n\n // Check if styles.css exists\n if (!fs.existsSync(stylesPath)) {\n console.warn(\"⚠️ Warning: style.css file not found in project root\");\n return;\n }\n\n const currentStyles = fs.readFileSync(stylesPath, \"utf-8\");\n let updatedStyles = currentStyles;\n\n for (const dep of dependencies) {\n const cssPath = `./node_modules/${dep.name}/dist/style.css`;\n const importStatement = `@import '${cssPath}';`;\n\n // Remove the import line if it exists\n const lines = updatedStyles.split(\"\\n\");\n const filteredLines = lines.filter(\n (line) => !line.trim().includes(importStatement),\n );\n\n if (filteredLines.length !== lines.length) {\n updatedStyles = filteredLines.join(\"\\n\");\n }\n }\n\n // Only write if changes were made\n if (updatedStyles !== currentStyles) {\n fs.writeFileSync(stylesPath, updatedStyles);\n }\n}\n"],"names":[],"mappings":";;;;;;;AAKA,MAAa,yBAAyB;AACtC,MAAa,wBAAwB,KAAK,KAAK,SAAS,EAAE,MAAM;AAGhE,MAAa,kBAAkB;CAC7B,KAAK;EACH,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,iBAAiB;EACjB,UAAU;EACV,eAAe;EACf,eAAe;EAChB;CACD,MAAM;EACJ,kBAAkB;EAClB,gBAAgB;EAChB,kBAAkB;EAClB,iBAAiB;EACjB,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
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="26f73a8c-cf44-5042-983b-8af212371af2")}catch(e){}}();
|
|
1
3
|
import "./assign-env-vars-W-lZmdMi.mjs";
|
|
2
4
|
import { t as runConnectStudio } from "./connect-studio-DTdSFftL.mjs";
|
|
3
5
|
import { a as generateProjectDriveId } from "./utils-mth8NsDA.mjs";
|
|
@@ -417,4 +419,5 @@ async function startVetra(args) {
|
|
|
417
419
|
//#endregion
|
|
418
420
|
export { startVetra };
|
|
419
421
|
|
|
420
|
-
//# sourceMappingURL=vetra-_JnFPpL5.mjs.map
|
|
422
|
+
//# sourceMappingURL=vetra-_JnFPpL5.mjs.map
|
|
423
|
+
//# debugId=26f73a8c-cf44-5042-983b-8af212371af2
|