@powerhousedao/shared 6.2.2-dev.61 → 6.2.2-dev.63
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/clis/args/{common-jbDGxlex.d.mts → common-B_LcTLHX.d.mts} +3 -3
- package/dist/clis/args/{common-jbDGxlex.d.mts.map → common-B_LcTLHX.d.mts.map} +1 -1
- package/dist/clis/args/common.d.mts +1 -1
- package/dist/clis/args/connect.d.mts +5 -5
- package/dist/clis/args/index.d.mts +2 -2
- package/dist/clis/args/init.d.mts +1 -1
- package/dist/clis/args/{service-C88bN_g_.d.mts → service-51afW_Hz.d.mts} +2 -2
- package/dist/clis/args/{service-C88bN_g_.d.mts.map → service-51afW_Hz.d.mts.map} +1 -1
- package/dist/clis/args/service.d.mts +1 -1
- package/dist/clis/args/vetra.d.mts +1 -1
- package/dist/clis/build-config.d.mts +3 -3
- package/dist/clis/build-config.d.mts.map +1 -1
- package/dist/clis/index.d.mts +2 -2
- package/dist/clis/index.mjs +5 -4
- package/dist/clis/index.mjs.map +1 -1
- package/dist/document-drive/index.d.ts +1 -1
- package/dist/document-drive/index.d.ts.map +1 -1
- package/dist/document-model/index.d.ts +1 -2
- package/dist/document-model/index.js +1 -2
- package/dist/document-model/index.js.map +1 -1
- package/dist/document-model/mock.d.ts +22 -2
- package/dist/document-model/mock.d.ts.map +1 -0
- package/dist/document-model/utils.d.ts +1 -2
- package/dist/document-model/utils.js +1 -2
- package/dist/{index-BJU79_T5.d.ts → index-C_iVZe7f.d.ts} +1 -1
- package/dist/index-C_iVZe7f.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/registry/index.d.ts +1 -1
- package/dist/registry/index.d.ts.map +1 -1
- package/dist/registry/index.js +4 -4
- package/dist/registry/index.js.map +1 -1
- package/dist/registry/manifest-slim.d.ts.map +1 -1
- package/dist/{types-BYjTIoUq.d.ts → types-CCSBgnLL.d.ts} +1 -1
- package/dist/{types-BYjTIoUq.d.ts.map → types-CCSBgnLL.d.ts.map} +1 -1
- package/dist/utils-DP122OSS.d.ts +18 -0
- package/dist/utils-DP122OSS.d.ts.map +1 -0
- package/dist/{utils-CTt1XRn-.js → utils-aaTmfxFW.js} +11 -2
- package/dist/{utils-CTt1XRn-.js.map → utils-aaTmfxFW.js.map} +1 -1
- package/package.json +3 -1
- package/dist/index-BJU79_T5.d.ts.map +0 -1
- package/dist/mock-BcFWPQyK.d.ts +0 -22
- package/dist/mock-BcFWPQyK.d.ts.map +0 -1
- package/dist/utils-1EXU6Qr1.d.ts +0 -9
- package/dist/utils-1EXU6Qr1.d.ts.map +0 -1
|
@@ -1,2 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region document-model/mock.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* Builds a mock value for a schema, with `overrides` taking precedence.
|
|
6
|
+
*
|
|
7
|
+
* Overridden fields are removed from the schema *before* generation rather than
|
|
8
|
+
* being overwritten afterwards. That ordering is what makes overrides usable as
|
|
9
|
+
* an escape hatch: some scalars compile to `z.custom(...)` (`AttachmentRef`,
|
|
10
|
+
* `Address`), and zocker cannot synthesise a value satisfying an arbitrary
|
|
11
|
+
* predicate — it throws. Generating first meant the throw happened before the
|
|
12
|
+
* caller's value was ever applied, so an override could not rescue the field it
|
|
13
|
+
* was written for.
|
|
14
|
+
*
|
|
15
|
+
* Only the overridden keys are skipped. A `z.custom(...)` field with no
|
|
16
|
+
* override still throws, which is correct: there is no way to invent a value
|
|
17
|
+
* for it, and the caller needs to say what it should be.
|
|
18
|
+
*/
|
|
19
|
+
declare function generateMock<TSchema extends z.ZodType>(schema: TSchema, overrides?: Partial<z.infer<TSchema>>): z.infer<TSchema>;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { generateMock };
|
|
22
|
+
//# sourceMappingURL=mock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mock.d.ts","names":[],"sources":["../../document-model/mock.ts"],"mappings":";;;;;AA0BA;;;;;;;;;;;;;iBAAgB,YAAA,iBAA6B,CAAA,CAAE,OAAA,CAAA,CAC7C,MAAA,EAAQ,OAAA,EACR,SAAA,GAAY,OAAA,CAAQ,CAAA,CAAE,KAAA,CAAM,OAAA,KAC3B,CAAA,CAAE,KAAA,CAAM,OAAA"}
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { n as generateId, t as deriveOperationId } from "../utils-1EXU6Qr1.js";
|
|
1
|
+
import { n as generateId, r as generateMock, t as deriveOperationId } from "../utils-DP122OSS.js";
|
|
3
2
|
export { deriveOperationId, generateId, generateMock };
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { n as generateId, t as deriveOperationId } from "../utils-
|
|
2
|
-
import { generateMock } from "./mock.js";
|
|
1
|
+
import { n as generateId, r as generateMock, t as deriveOperationId } from "../utils-aaTmfxFW.js";
|
|
3
2
|
export { deriveOperationId, generateId, generateMock };
|
|
@@ -4,4 +4,4 @@ declare function buildTreeUrl(sha: string): string | null;
|
|
|
4
4
|
declare function shortGitSha(sha: string): string;
|
|
5
5
|
//#endregion
|
|
6
6
|
export { buildTreeUrl as n, shortGitSha as r, GITHUB_REPO_URL as t };
|
|
7
|
-
//# sourceMappingURL=index-
|
|
7
|
+
//# sourceMappingURL=index-C_iVZe7f.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-C_iVZe7f.d.ts","names":[],"sources":["../git.ts"],"mappings":";cAAa,eAAA;AAAA,iBAEG,YAAA,CAAa,GAAA;AAAA,iBAKb,WAAA,CAAY,GAAA"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as AnalyticsSeriesInput, c as CompoundAnalyticsExpression, d as ConversionMetric, f as IAnalyticsStore, i as AnalyticsSeries, l as CompoundAnalyticsInputs, n as AnalyticsOperand, o as AnalyticsSeriesQuery, p as MultiCurrencyConversion, r as AnalyticsQuery, s as AnalyticsUpdateCallback, t as AnalyticsDimension, u as CompoundAnalyticsQuery } from "./types-C1in4fl3.js";
|
|
2
2
|
import { $ as AddRelationshipAction, $i as SetOperationErrorNameInput, $n as MutationLoadStateArgs, $r as RemoveRelationshipActionInput, $s as ProcessorStatus, $t as DocumentModelStateAction, A as PackageManagerArgs, Aa as SubgraphModule, Ai as SetInitialStateInput, An as MakeEmpty, Ar as MutationUpdateChangeLogItemInputArgs, At as DeleteOperationInput, B as ActionSigningHandler, Ba as UpdateRelationshipActionInput, Bi as SetModuleDescriptionInput, Bn as Mutation, Br as PowerhouseModule, Bt as DocumentModelInput, C as PHConnectRenownAdapters, Ca as SignalType, Ci as SchemaUndoAction, Cn as IsStateOfType, Cr as MutationSetOperationErrorTemplateArgs, Ct as DeleteModuleAction, D as PHReactorRenown, Da as SkipHeaderOperations, Di as SetAuthorWebsiteAction, Dn as LoadStateActionInput, Dr as MutationSetOperationTemplateArgs, Dt as DeleteOperationErrorInput, E as PHPackageProvider, Ea as SkipHeaderOperationIndex, Ei as SetAuthorNameInput, En as LoadStateAction, Er as MutationSetOperationSchemaArgs, Et as DeleteOperationErrorAction, F as ServiceAction, Fa as UpdateChangeLogItemAction, Fi as SetModelIdAction, Fn as Maybe, Fr as OperationIndex, Ft as DocumentModelDocument, G as AddModuleAction, Ga as User, Gi as SetNameOperation, Gn as MutationAddOperationExampleArgs, Gr as Query, Gs as IProcessorManager, Gt as DocumentModelModuleOperations, H as Actions, Ha as UpdateStateExampleInput, Hi as SetModuleNameInput, Hn as MutationAddModuleArgs, Hr as PruneAction, Hs as IProcessor, Ht as DocumentModelLocalState, I as ServiceActions, Ia as UpdateChangeLogItemInput, Ii as SetModelIdInput, In as MinimalBackupData, Ir as OperationSpecification, It as DocumentModelDocumentModelModule, J as AddOperationErrorAction, Ji as SetOperationErrorCodeAction, Jn as MutationDeleteModuleArgs, Jr as RedoActionInput, Js as ProcessorDispatchResult, Jt as DocumentModelOperationErrorOperations, K as AddModuleInput, Ka as ValidationError, Ki as SetOperationDescriptionAction, Kn as MutationAddStateExampleArgs, Kr as Redo, Ks as ProcessorApp, Kt as DocumentModelOperationAction, La as UpdateOperationExampleAction, Li as SetModelNameAction, Ln as ModuleSpecification, Lr as OperationsByScope, Lt as DocumentModelGlobalState, M as PathValidation, Ma as UndoAction, Mi as SetModelDescriptionInput, Mn as MakeOptional, Mr as MutationUpdateStateExampleArgs, Mt as DeleteStateExampleInput, N as PowerhouseConfig, Na as UndoActionInput, Ni as SetModelExtensionAction, Nn as Manifest, Nr as NOOPAction, Nt as DocumentAction, O as PHRenownPrivyAdapterConfig, Oa as State, Oi as SetAuthorWebsiteInput, On as LoadStateActionStateInput, Or as MutationSetStateSchemaArgs, Ot as DeleteOperationExampleAction, P as PowerhousePackage, Pa as UndoRedoAction, Pi as SetModelExtensionInput, Pn as MappedOperation, Pr as OperationErrorSpecification, Pt as DocumentModelAction, Q as AddOperationInput, Qi as SetOperationErrorNameAction, Qn as MutationDeleteStateExampleArgs, Qr as RemoveRelationshipAction, Qs as ProcessorRecord, Qt as DocumentModelPHState, R as ActionErrorCallback, Ra as UpdateOperationExampleInput, Ri as SetModelNameInput, Rn as MoveOperationAction, Rr as PartialRecord, Rt as DocumentModelHeaderAction, S as PHConnectRenown, Sa as SignalResults, Si as SchemaSetPreferredEditorAction, Sn as IsDocumentOfType, Sr as MutationSetOperationErrorNameArgs, St as DeleteDocumentActionInput, T as PHConnectSentry, Ta as SigningParameters, Ti as SetAuthorNameAction, Tn as LoadFromInput, Tr as MutationSetOperationReducerArgs, Tt as DeleteOperationAction, U as AddChangeLogItemAction, Ua as UpgradeDocumentAction, Ui as SetNameAction, Un as MutationAddOperationArgs, Ur as PruneActionInput, Us as IProcessorDispatch, Ut as DocumentModelModule, V as ActionVerificationHandler, Va as UpdateStateExampleAction, Vi as SetModuleNameAction, Vn as MutationAddChangeLogItemInputArgs, Vr as Prune, Vt as DocumentModelLib, W as AddChangeLogItemInput, Wa as UpgradeDocumentActionInput, Wi as SetNameActionInput, Wn as MutationAddOperationErrorArgs, Wr as Publisher, Ws as IProcessorHostModule, Wt as DocumentModelModuleAction, X as AddOperationExampleAction, Xi as SetOperationErrorDescriptionAction, Xn as MutationDeleteOperationErrorArgs, Xr as ReducerOptions, Xs as ProcessorFactoryBuilder, Xt as DocumentModelOperationExampleOperations, Y as AddOperationErrorInput, Yi as SetOperationErrorCodeInput, Yn as MutationDeleteOperationArgs, Yr as Reducer, Ys as ProcessorFactory, Yt as DocumentModelOperationExampleAction, Z as AddOperationExampleInput, Zi as SetOperationErrorDescriptionInput, Zn as MutationDeleteOperationExampleArgs, Zr as ReleaseNewVersionAction, Zs as ProcessorFilter, Zt as DocumentModelOperationOperations, _ as PHConnectPwaManifest, _a as Set_Name, _i as SchemaLoadStateAction, _n as ISignal, _r as MutationSetModuleNameArgs, _t as DeleteChangeLogItemAction, a as PHConnectApp, aa as SetOperationReducerInput, ai as ReorderModulesInput, an as DocumentSpecification, ar as MutationReorderModulesArgs, at as Author, b as PHConnectReactor, ba as SignalDispatch, bi as SchemaRedoAction, bn as Incremental, br as MutationSetOperationErrorCodeArgs, bt as DeleteChildDocumentSignal, c as PHConnectDriveSection, ca as SetOperationScopeAction, ci as ReorderOperationExamplesAction, cn as EditorModule, cr as MutationReorderStateExamplesArgs, ct as ConfigEntryType, d as PHConnectInstance, da as SetOperationTemplateInput, di as ReorderStateExamplesInput, dn as FileInput, dr as MutationSetInitialStateArgs, dt as CreateChildDocumentInput, ea as SetOperationErrorTemplateAction, ec as TrackedProcessor, ei as ReorderChangeLogItemsAction, en as DocumentModelStateOperations, er as MutationMoveOperationArgs, et as AddRelationshipActionInput, f as PHConnectPackages, fa as SetPreferredEditorAction, fi as ReplayDocumentOptions, fn as GetDocumentOptions, fr as MutationSetModelDescriptionArgs, ft as CreateChildDocumentSignal, g as PHConnectPwaIcon, ga as SetStateSchemaInput, gi as Scalars, gn as IOperation, gr as MutationSetModuleDescriptionArgs, gt as CreateState, h as PHConnectPwaFileHandler, ha as SetStateSchemaAction, hi as SaveToFileHandle, hn as IDocument, hr as MutationSetModelNameArgs, ht as CreateDocumentActionInput, i as LogLevels, ia as SetOperationReducerAction, ii as ReorderModulesAction, in as DocumentOperationsIgnoreMap, ir as MutationReorderModuleOperationsArgs, it as AssertIsStateOfType, j as ParsedCmdResult, ja as Undo, ji as SetModelDescriptionAction, jn as MakeMaybe, jr as MutationUpdateOperationExampleArgs, jt as DeleteStateExampleAction, k as PHRenownRainbowAdapterConfig, ka as StateReducer, ki as SetInitialStateAction, kn as Load_State, kr as MutationUndoArgs, kt as DeleteOperationExampleInput, l as PHConnectDriveSections, la as SetOperationScopeInput, li as ReorderOperationExamplesInput, ln as EditorProps, lr as MutationSetAuthorNameArgs, lt as CopyChildDocumentInput, m as PHConnectPwaCacheStrategy, ma as SetPreferredEditorOperation, mi as SaveToFile, mn as ID, mr as MutationSetModelIdArgs, mt as CreateDocumentAction, n as DrivePreserveStrategy, na as SetOperationNameAction, ni as ReorderModuleOperationsAction, nn as DocumentModelVersioningAction, nr as MutationRedoArgs, nt as AddStateExampleInput, o as PHConnectBranding, oa as SetOperationSchemaAction, oi as ReorderOperationErrorsAction, on as ENSInfo, or as MutationReorderOperationErrorsArgs, ot as CodeExample, p as PHConnectPwa, pa as SetPreferredEditorActionInput, pi as RevisionsFilter, pn as IAction, pr as MutationSetModelExtensionArgs, pt as CreateDocument, q as AddOperationAction, qi as SetOperationDescriptionInput, qn as MutationDeleteChangeLogItemInputArgs, qr as RedoAction, qs as ProcessorApps, qt as DocumentModelOperationErrorAction, r as LogLevel, ra as SetOperationNameInput, ri as ReorderModuleOperationsInput, rn as DocumentModelVersioningOperations, rr as MutationReorderChangeLogItemsInputArgs, rt as AssertIsDocumentOfType, s as PHConnectDefaultDrive, sa as SetOperationSchemaInput, si as ReorderOperationErrorsInput, sn as EditorDispatch, sr as MutationReorderOperationExamplesArgs, st as ConfigEntry, t as DrivePreserveStrategies, ta as SetOperationErrorTemplateInput, ti as ReorderChangeLogItemsInput, tn as DocumentModelUtils, tr as MutationPruneArgs, tt as AddStateExampleAction, u as PHConnectDrives, ua as SetOperationTemplateAction, ui as ReorderStateExamplesAction, un as Exact, ur as MutationSetAuthorWebsiteArgs, ut as CopyChildDocumentSignal, v as PHConnectPwaRuntimeCaching, va as Set_PreferredEditor, vi as SchemaNOOPAction, vn as ISignalResult, vr as MutationSetNameArgs, vt as DeleteChangeLogItemInput, w as PHConnectRuntimeConfig, wa as SignatureVerificationHandler, wi as ScopeState, wn as LoadFromFile, wr as MutationSetOperationNameArgs, wt as DeleteModuleInput, x as PHConnectReactorFeatureFlags, xa as SignalResult, xi as SchemaSetNameAction, xn as InputMaybe, xr as MutationSetOperationErrorDescriptionArgs, xt as DeleteDocumentAction, y as PHConnectPwaUrlPattern, ya as Signal, yi as SchemaPruneAction, yn as ISigner, yr as MutationSetOperationDescriptionArgs, yt as DeleteChildDocumentInput, z as ActionSignatureContext, za as UpdateRelationshipAction, zi as SetModuleDescriptionAction, zn as MoveOperationInput, zr as PartialState, zt as DocumentModelHeaderOperations } from "./types-CWwCnZQ_.js";
|
|
3
3
|
import { i as PACKAGES_DEPENDENCIES, n as APPS_DEPENDENCIES, r as CLIS_DEPENDENCIES, t as ALL_POWERHOUSE_DEPENDENCIES } from "./constants-BP_gjn8g.js";
|
|
4
|
-
import { $ as LegacySynchronizationUnit, A as TriggerData, B as RegistryPackageMap, C as RemoveTriggerInput, D as SetSharingTypeInput, E as SetDriveNameInput, F as PackageInfo, G as DriveInput, H as RegistryPackageStatus, I as PackageListItem, J as SharingType, K as GenerateNodesCopyIdGenerator, L as PackagePage, M as TriggerType, N as UpdateFileInput, O as TransmitterType, P as UpdateNodeInput, Q as LegacyAddFileInput, R as RegistryPackage, S as RemoveListenerInput, T as SetDriveIconInput, U as DocumentDrivePHState, V as RegistryPackageSource, W as DriveDocumentModelModule, X as DocumentDriveDocument, Y as DocumentDriveAction, Z as LegacyAddFileAction, _ as ListenerInput, _t as SetDriveNameAction, a as CopyNodeInput, at as DocumentDriveNodeOperations, b as PullResponderTriggerData, c as DocumentDriveLocalState, ct as UpdateNodeAction, d as FolderNode, dt as DocumentDriveDriveAction, et as AddFileAction, f as Listener, ft as DocumentDriveDriveOperations, g as ListenerFilterInput, gt as SetDriveIconAction, h as ListenerFilter, ht as SetAvailableOfflineAction, i as AddTriggerInput, it as DocumentDriveNodeAction, j as TriggerInput, k as Trigger, lt as AddListenerAction, m as ListenerCallInfoInput, mt as RemoveTriggerAction, n as AddFolderInput, nt as CopyNodeAction, o as DeleteNodeInput, ot as MoveNodeAction, p as ListenerCallInfo, pt as RemoveListenerAction, q as GenerateNodesCopySrc, r as AddListenerInput, rt as DeleteNodeAction, s as DocumentDriveGlobalState, st as UpdateFileAction, t as AddFileInput, tt as AddFolderAction, u as FileNode, ut as AddTriggerAction, v as MoveNodeInput, vt as SetSharingTypeAction, w as SetAvailableOfflineInput, x as PullResponderTriggerDataInput, y as Node, z as RegistryPackageList } from "./types-
|
|
5
|
-
import { n as buildTreeUrl, r as shortGitSha, t as GITHUB_REPO_URL } from "./index-
|
|
4
|
+
import { $ as LegacySynchronizationUnit, A as TriggerData, B as RegistryPackageMap, C as RemoveTriggerInput, D as SetSharingTypeInput, E as SetDriveNameInput, F as PackageInfo, G as DriveInput, H as RegistryPackageStatus, I as PackageListItem, J as SharingType, K as GenerateNodesCopyIdGenerator, L as PackagePage, M as TriggerType, N as UpdateFileInput, O as TransmitterType, P as UpdateNodeInput, Q as LegacyAddFileInput, R as RegistryPackage, S as RemoveListenerInput, T as SetDriveIconInput, U as DocumentDrivePHState, V as RegistryPackageSource, W as DriveDocumentModelModule, X as DocumentDriveDocument, Y as DocumentDriveAction, Z as LegacyAddFileAction, _ as ListenerInput, _t as SetDriveNameAction, a as CopyNodeInput, at as DocumentDriveNodeOperations, b as PullResponderTriggerData, c as DocumentDriveLocalState, ct as UpdateNodeAction, d as FolderNode, dt as DocumentDriveDriveAction, et as AddFileAction, f as Listener, ft as DocumentDriveDriveOperations, g as ListenerFilterInput, gt as SetDriveIconAction, h as ListenerFilter, ht as SetAvailableOfflineAction, i as AddTriggerInput, it as DocumentDriveNodeAction, j as TriggerInput, k as Trigger, lt as AddListenerAction, m as ListenerCallInfoInput, mt as RemoveTriggerAction, n as AddFolderInput, nt as CopyNodeAction, o as DeleteNodeInput, ot as MoveNodeAction, p as ListenerCallInfo, pt as RemoveListenerAction, q as GenerateNodesCopySrc, r as AddListenerInput, rt as DeleteNodeAction, s as DocumentDriveGlobalState, st as UpdateFileAction, t as AddFileInput, tt as AddFolderAction, u as FileNode, ut as AddTriggerAction, v as MoveNodeInput, vt as SetSharingTypeAction, w as SetAvailableOfflineInput, x as PullResponderTriggerDataInput, y as Node, z as RegistryPackageList } from "./types-CCSBgnLL.js";
|
|
5
|
+
import { n as buildTreeUrl, r as shortGitSha, t as GITHUB_REPO_URL } from "./index-C_iVZe7f.js";
|
|
6
6
|
export { ALL_POWERHOUSE_DEPENDENCIES, APPS_DEPENDENCIES, ActionErrorCallback, ActionSignatureContext, ActionSigningHandler, ActionVerificationHandler, Actions, AddChangeLogItemAction, AddChangeLogItemInput, AddFileAction, AddFileInput, AddFolderAction, AddFolderInput, AddListenerAction, AddListenerInput, AddModuleAction, AddModuleInput, AddOperationAction, AddOperationErrorAction, AddOperationErrorInput, AddOperationExampleAction, AddOperationExampleInput, AddOperationInput, AddRelationshipAction, AddRelationshipActionInput, AddStateExampleAction, AddStateExampleInput, AddTriggerAction, AddTriggerInput, AnalyticsDimension, AnalyticsOperand, AnalyticsQuery, AnalyticsSeries, AnalyticsSeriesInput, AnalyticsSeriesQuery, AnalyticsUpdateCallback, AssertIsDocumentOfType, AssertIsStateOfType, Author, CLIS_DEPENDENCIES, CodeExample, CompoundAnalyticsExpression, CompoundAnalyticsInputs, CompoundAnalyticsQuery, ConfigEntry, ConfigEntryType, ConversionMetric, CopyChildDocumentInput, CopyChildDocumentSignal, CopyNodeAction, CopyNodeInput, CreateChildDocumentInput, CreateChildDocumentSignal, CreateDocument, CreateDocumentAction, CreateDocumentActionInput, CreateState, DeleteChangeLogItemAction, DeleteChangeLogItemInput, DeleteChildDocumentInput, DeleteChildDocumentSignal, DeleteDocumentAction, DeleteDocumentActionInput, DeleteModuleAction, DeleteModuleInput, DeleteNodeAction, DeleteNodeInput, DeleteOperationAction, DeleteOperationErrorAction, DeleteOperationErrorInput, DeleteOperationExampleAction, DeleteOperationExampleInput, DeleteOperationInput, DeleteStateExampleAction, DeleteStateExampleInput, DocumentAction, DocumentDriveAction, DocumentDriveDocument, DocumentDriveDriveAction, DocumentDriveDriveOperations, DocumentDriveGlobalState, DocumentDriveLocalState, DocumentDriveNodeAction, DocumentDriveNodeOperations, DocumentDrivePHState, DocumentModelAction, DocumentModelDocument, DocumentModelDocumentModelModule, DocumentModelGlobalState, DocumentModelHeaderAction, DocumentModelHeaderOperations, DocumentModelInput, DocumentModelLib, DocumentModelLocalState, DocumentModelModule, DocumentModelModuleAction, DocumentModelModuleOperations, DocumentModelOperationAction, DocumentModelOperationErrorAction, DocumentModelOperationErrorOperations, DocumentModelOperationExampleAction, DocumentModelOperationExampleOperations, DocumentModelOperationOperations, DocumentModelPHState, DocumentModelStateAction, DocumentModelStateOperations, DocumentModelUtils, DocumentModelVersioningAction, DocumentModelVersioningOperations, DocumentOperationsIgnoreMap, DocumentSpecification, DriveDocumentModelModule, DriveInput, DrivePreserveStrategies, DrivePreserveStrategy, ENSInfo, EditorDispatch, EditorModule, EditorProps, Exact, FileInput, FileNode, FolderNode, GITHUB_REPO_URL, GenerateNodesCopyIdGenerator, GenerateNodesCopySrc, GetDocumentOptions, IAction, IAnalyticsStore, ID, IDocument, IOperation, IProcessor, IProcessorDispatch, IProcessorHostModule, IProcessorManager, ISignal, ISignalResult, ISigner, Incremental, InputMaybe, IsDocumentOfType, IsStateOfType, LegacyAddFileAction, LegacyAddFileInput, LegacySynchronizationUnit, Listener, ListenerCallInfo, ListenerCallInfoInput, ListenerFilter, ListenerFilterInput, ListenerInput, LoadFromFile, LoadFromInput, LoadStateAction, LoadStateActionInput, LoadStateActionStateInput, Load_State, LogLevel, LogLevels, MakeEmpty, MakeMaybe, MakeOptional, Manifest, MappedOperation, Maybe, MinimalBackupData, ModuleSpecification, MoveNodeAction, MoveNodeInput, MoveOperationAction, MoveOperationInput, MultiCurrencyConversion, Mutation, MutationAddChangeLogItemInputArgs, MutationAddModuleArgs, MutationAddOperationArgs, MutationAddOperationErrorArgs, MutationAddOperationExampleArgs, MutationAddStateExampleArgs, MutationDeleteChangeLogItemInputArgs, MutationDeleteModuleArgs, MutationDeleteOperationArgs, MutationDeleteOperationErrorArgs, MutationDeleteOperationExampleArgs, MutationDeleteStateExampleArgs, MutationLoadStateArgs, MutationMoveOperationArgs, MutationPruneArgs, MutationRedoArgs, MutationReorderChangeLogItemsInputArgs, MutationReorderModuleOperationsArgs, MutationReorderModulesArgs, MutationReorderOperationErrorsArgs, MutationReorderOperationExamplesArgs, MutationReorderStateExamplesArgs, MutationSetAuthorNameArgs, MutationSetAuthorWebsiteArgs, MutationSetInitialStateArgs, MutationSetModelDescriptionArgs, MutationSetModelExtensionArgs, MutationSetModelIdArgs, MutationSetModelNameArgs, MutationSetModuleDescriptionArgs, MutationSetModuleNameArgs, MutationSetNameArgs, MutationSetOperationDescriptionArgs, MutationSetOperationErrorCodeArgs, MutationSetOperationErrorDescriptionArgs, MutationSetOperationErrorNameArgs, MutationSetOperationErrorTemplateArgs, MutationSetOperationNameArgs, MutationSetOperationReducerArgs, MutationSetOperationSchemaArgs, MutationSetOperationTemplateArgs, MutationSetStateSchemaArgs, MutationUndoArgs, MutationUpdateChangeLogItemInputArgs, MutationUpdateOperationExampleArgs, MutationUpdateStateExampleArgs, NOOPAction, Node, OperationErrorSpecification, OperationIndex, OperationSpecification, OperationsByScope, PACKAGES_DEPENDENCIES, PHConnectApp, PHConnectBranding, PHConnectDefaultDrive, PHConnectDriveSection, PHConnectDriveSections, PHConnectDrives, PHConnectInstance, PHConnectPackages, PHConnectPwa, PHConnectPwaCacheStrategy, PHConnectPwaFileHandler, PHConnectPwaIcon, PHConnectPwaManifest, PHConnectPwaRuntimeCaching, PHConnectPwaUrlPattern, PHConnectReactor, PHConnectReactorFeatureFlags, PHConnectRenown, PHConnectRenownAdapters, PHConnectRuntimeConfig, PHConnectSentry, PHPackageProvider, PHReactorRenown, PHRenownPrivyAdapterConfig, PHRenownRainbowAdapterConfig, PackageInfo, PackageListItem, PackageManagerArgs, PackagePage, ParsedCmdResult, PartialRecord, PartialState, PathValidation, PowerhouseConfig, PowerhouseModule, PowerhousePackage, ProcessorApp, ProcessorApps, ProcessorDispatchResult, ProcessorFactory, ProcessorFactoryBuilder, ProcessorFilter, ProcessorRecord, ProcessorStatus, Prune, PruneAction, PruneActionInput, Publisher, PullResponderTriggerData, PullResponderTriggerDataInput, Query, Redo, RedoAction, RedoActionInput, Reducer, ReducerOptions, RegistryPackage, RegistryPackageList, RegistryPackageMap, RegistryPackageSource, RegistryPackageStatus, ReleaseNewVersionAction, RemoveListenerAction, RemoveListenerInput, RemoveRelationshipAction, RemoveRelationshipActionInput, RemoveTriggerAction, RemoveTriggerInput, ReorderChangeLogItemsAction, ReorderChangeLogItemsInput, ReorderModuleOperationsAction, ReorderModuleOperationsInput, ReorderModulesAction, ReorderModulesInput, ReorderOperationErrorsAction, ReorderOperationErrorsInput, ReorderOperationExamplesAction, ReorderOperationExamplesInput, ReorderStateExamplesAction, ReorderStateExamplesInput, ReplayDocumentOptions, RevisionsFilter, SaveToFile, SaveToFileHandle, Scalars, SchemaLoadStateAction, SchemaNOOPAction, SchemaPruneAction, SchemaRedoAction, SchemaSetNameAction, SchemaSetPreferredEditorAction, SchemaUndoAction, ScopeState, ServiceAction, ServiceActions, SetAuthorNameAction, SetAuthorNameInput, SetAuthorWebsiteAction, SetAuthorWebsiteInput, SetAvailableOfflineAction, SetAvailableOfflineInput, SetDriveIconAction, SetDriveIconInput, SetDriveNameAction, SetDriveNameInput, SetInitialStateAction, SetInitialStateInput, SetModelDescriptionAction, SetModelDescriptionInput, SetModelExtensionAction, SetModelExtensionInput, SetModelIdAction, SetModelIdInput, SetModelNameAction, SetModelNameInput, SetModuleDescriptionAction, SetModuleDescriptionInput, SetModuleNameAction, SetModuleNameInput, SetNameAction, SetNameActionInput, SetNameOperation, SetOperationDescriptionAction, SetOperationDescriptionInput, SetOperationErrorCodeAction, SetOperationErrorCodeInput, SetOperationErrorDescriptionAction, SetOperationErrorDescriptionInput, SetOperationErrorNameAction, SetOperationErrorNameInput, SetOperationErrorTemplateAction, SetOperationErrorTemplateInput, SetOperationNameAction, SetOperationNameInput, SetOperationReducerAction, SetOperationReducerInput, SetOperationSchemaAction, SetOperationSchemaInput, SetOperationScopeAction, SetOperationScopeInput, SetOperationTemplateAction, SetOperationTemplateInput, SetPreferredEditorAction, SetPreferredEditorActionInput, SetPreferredEditorOperation, SetSharingTypeAction, SetSharingTypeInput, SetStateSchemaAction, SetStateSchemaInput, Set_Name, Set_PreferredEditor, SharingType, Signal, SignalDispatch, SignalResult, SignalResults, SignalType, SignatureVerificationHandler, SigningParameters, SkipHeaderOperationIndex, SkipHeaderOperations, State, StateReducer, SubgraphModule, TrackedProcessor, TransmitterType, Trigger, TriggerData, TriggerInput, TriggerType, Undo, UndoAction, UndoActionInput, UndoRedoAction, UpdateChangeLogItemAction, UpdateChangeLogItemInput, UpdateFileAction, UpdateFileInput, UpdateNodeAction, UpdateNodeInput, UpdateOperationExampleAction, UpdateOperationExampleInput, UpdateRelationshipAction, UpdateRelationshipActionInput, UpdateStateExampleAction, UpdateStateExampleInput, UpgradeDocumentAction, UpgradeDocumentActionInput, User, ValidationError, buildTreeUrl, shortGitSha };
|
package/dist/registry/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { L as DEFAULT_REGISTRY_URL } from "../types-CWwCnZQ_.js";
|
|
2
|
-
import { B as RegistryPackageMap, F as PackageInfo, H as RegistryPackageStatus, I as PackageListItem, L as PackagePage, R as RegistryPackage, V as RegistryPackageSource, z as RegistryPackageList } from "../types-
|
|
2
|
+
import { B as RegistryPackageMap, F as PackageInfo, H as RegistryPackageStatus, I as PackageListItem, L as PackagePage, R as RegistryPackage, V as RegistryPackageSource, z as RegistryPackageList } from "../types-CCSBgnLL.js";
|
|
3
3
|
import { slimManifest } from "./manifest-slim.js";
|
|
4
4
|
import { toCdnUrl } from "./urls.js";
|
|
5
5
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","names":[],"sources":["../../registry/registry.ts"],"mappings":";;;;;;;;;;iBAgBgB,eAAA,CAAgB,WAAA;AAAA,UAQf,yBAAA;;EAEf,QAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../../registry/registry.ts"],"mappings":";;;;;;;;;;iBAgBgB,eAAA,CAAgB,WAAA;AAAA,UAQf,yBAAA;;EAEf,QAAA;EAV6B;EAY7B,WAAA;EAZ8B;EAc9B,GAAA,GAAM,MAAA;AAAA;;;;iBAMQ,kBAAA,CAAmB,OAAA,EAAS,yBAAA;;;;;iBAiBtB,YAAA,CAAa,WAAA,WAAsB,OAAA;AAAA,UAIxC,iBAAA;EArBiB;EAuBhC,WAAA;EAvB0C;EAyB1C,GAAA;EARoB;EAUpB,IAAA;;;EAGA,SAAA;AAAA;AAAA,UAGe,gBAAA;;EAEf,MAAA;AAAA;;;;;;AAFF;;;iBAasB,UAAA,CACpB,OAAA,EAAS,iBAAA,GACR,OAAA,CAAQ,gBAAA;;AAFX;;;;iBAiBsB,sBAAA,CACpB,WAAA,UACA,KAAA,WACC,OAAA;AAAA,UAmBc,mBAAA;EArCP;EAuCR,WAAA;EAxCS;EA0CT,GAAA;EAzCC;EA2CD,IAAA;EA3CyB;EA6CzB,IAAA;EA9BoB;EAgCpB,SAAA;AAAA;AAAA,UAGe,kBAAA;EAlCf;EAoCA,MAAA;AAAA;;;AAfF;;;iBAuBsB,YAAA,CACpB,OAAA,EAAS,mBAAA,GACR,OAAA,CAAQ,kBAAA"}
|
package/dist/registry/index.js
CHANGED
|
@@ -3,7 +3,7 @@ import { toCdnUrl } from "./urls.js";
|
|
|
3
3
|
import { promises, readFileSync } from "node:fs";
|
|
4
4
|
import { homedir } from "node:os";
|
|
5
5
|
import { join } from "node:path";
|
|
6
|
-
import
|
|
6
|
+
import spawn from "cross-spawn";
|
|
7
7
|
const DEFAULT_REGISTRY_URL = "https://registry.vetra.io";
|
|
8
8
|
const POWERHOUSE_CONFIG_FILE = "powerhouse.config.json";
|
|
9
9
|
join(homedir(), ".ph");
|
|
@@ -44,7 +44,7 @@ function getConfig(path = "./powerhouse.config.json") {
|
|
|
44
44
|
//#region clis/file-system/spawn-async.ts
|
|
45
45
|
function spawnAsync(command, args, options = {}) {
|
|
46
46
|
return new Promise((resolve, reject) => {
|
|
47
|
-
const child = spawn(
|
|
47
|
+
const child = spawn(command, args, {
|
|
48
48
|
cwd: options.cwd,
|
|
49
49
|
env: options.env,
|
|
50
50
|
stdio: [
|
|
@@ -55,10 +55,10 @@ function spawnAsync(command, args, options = {}) {
|
|
|
55
55
|
});
|
|
56
56
|
let stdout = "";
|
|
57
57
|
let stderr = "";
|
|
58
|
-
child.stdout
|
|
58
|
+
child.stdout?.on("data", (d) => {
|
|
59
59
|
stdout += d.toString();
|
|
60
60
|
});
|
|
61
|
-
child.stderr
|
|
61
|
+
child.stderr?.on("data", (d) => {
|
|
62
62
|
stderr += d.toString();
|
|
63
63
|
});
|
|
64
64
|
child.on("error", reject);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["fs"],"sources":["../../clis/constants.ts","../../clis/file-system/get-config.ts","../../clis/file-system/spawn-async.ts","../../registry/registry.ts"],"sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { Manifest } from \"../document-model/types.js\";\nimport type { PowerhouseConfig } from \"./types.js\";\n\nexport const SERVICE_ACTIONS = [\n \"start\",\n \"stop\",\n \"status\",\n \"setup\",\n \"restart\",\n] as const;\n\nexport const SECONDS_IN_DAY = 24 * 60 * 60;\nexport const DEFAULT_EXPIRY_DAYS = 7;\nexport const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;\n\nexport const DRIVES_PRESERVE_STRATEGIES = [\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n] as const;\n\nexport const LOG_LEVELS = [\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"verbose\",\n] as const;\n\nexport const DEFAULT_TIMEOUT = 300 as const;\n\nexport const DEFAULT_CONNECT_STUDIO_PORT = 3000 as const;\n\nexport const DEFAULT_VETRA_CONNECT_PORT = 3001 as const;\n\nexport const DEFAULT_CONNECT_PREVIEW_PORT = 4173 as const;\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport const DEFAULT_RENOWN_URL = \"https://www.renown.id\" as const;\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 as const;\n\nexport const DEFAULT_VETRA_DRIVE_ID = \"vetra\" as const;\n\nexport const MINIMUM_NODE_VERSION = \"24.0.0\" as const;\nexport const PH_BIN = \"ph-cli-legacy\" as const;\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\" as const;\nexport const PH_GLOBAL_DIR_NAME = \".ph\" as const;\n// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility\nexport const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;\n\nexport const HOME_DIR = homedir();\n\nexport const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, PH_GLOBAL_DIR_NAME);\n\n// Workspace packages that go in peerDependencies of every generated project.\nexport const VERSIONED_PEER_DEPENDENCIES = [\n \"document-model\",\n \"@powerhousedao/reactor-browser\",\n];\n\ntype PeerSpec = { peer: string; dev: string };\n\nexport const REACTOR_API_PACKAGE = \"@powerhousedao/reactor-api\";\nexport const ANALYTICS_ENGINE_CORE_PACKAGE =\n \"@powerhousedao/analytics-engine-core\";\nexport const GRAPHQL_PACKAGE = \"graphql\";\nexport const GRAPHQL_TAG_PACKAGE = \"graphql-tag\";\n\n// External peerDependencies of every generated project.\n// `peer` is the consumer-facing range; `dev` is the exact build-tested pin.\n// graphql / graphql-tag are always-on because the workspace packages pulled\n// in by every `ph init` project (codegen, reactor-api, reactor-browser,\n// vetra-packages) declare them as peers — even projects without subgraphs\n// need them in scope so pnpm hoists a single graphql instance.\nexport const PEER_EXTERNAL_DEPENDENCIES = {\n [GRAPHQL_PACKAGE]: { peer: \"^16\", dev: \"16.12.0\" },\n [GRAPHQL_TAG_PACKAGE]: { peer: \"^2\", dev: \"2.12.6\" },\n react: { peer: \"^19\", dev: \"19.2.6\" },\n \"react-dom\": { peer: \"^19\", dev: \"19.2.6\" },\n zod: { peer: \"^4\", dev: \"4.3.6\" },\n} as const satisfies Record<string, PeerSpec>;\n\n// Per-feature deps added dynamically by codegen when required.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n },\n} as const satisfies Record<\n string,\n { peerVersioned: readonly string[]; peerExternal: Record<string, PeerSpec> }\n>;\n\nexport const VERSIONED_DEPENDENCIES = [\n ...VERSIONED_PEER_DEPENDENCIES,\n ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,\n];\n\n// Transitive dependencies whose postinstall scripts the generated project\n// trusts. Mirrors the `allowBuilds` map in the boilerplate's\n// pnpm-workspace.yaml and is also passed as `--allow-build` flags to\n// `pnpm dlx @powerhousedao/ph-cli init` so pnpm 11's strict-dep-builds\n// default doesn't prompt during the outer dlx download.\nexport const BOILERPLATE_ALLOWED_BUILDS = [\n \"@apollo/protobufjs\",\n \"@datadog/pprof\",\n \"@parcel/watcher\",\n \"@reown/appkit\",\n \"bufferutil\",\n \"esbuild\",\n \"keccak\",\n \"protobufjs\",\n \"utf-8-validate\",\n] as const;\n\n// pnpm `overrides` written into the generated project's pnpm-workspace.yaml to\n// force a single chosen version of each, avoiding duplicates from coexisting\n// version ranges. Generated-project only — never change the monorepo catalog\n// for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_PNPM_OVERRIDES = {\n \"date-fns\": \"4.3.0\",\n vite: \"8.0.14\",\n rolldown: \"1.0.2\",\n} as const satisfies Record<string, string>;\n\nexport const VERSIONED_DEV_DEPENDENCIES = [\n \"@powerhousedao/ph-cli\",\n \"@powerhousedao/reactor\",\n \"@powerhousedao/shared\",\n \"@powerhousedao/connect\",\n \"@powerhousedao/design-system\",\n];\n\nexport const packageJsonExports = {\n \".\": {\n types: \"./dist/types/index.d.ts\",\n browser: \"./dist/browser/index.js\",\n node: \"./dist/node/index.mjs\",\n },\n \"./reactor\": {\n types: \"./dist/types/reactor/index.d.ts\",\n browser: \"./dist/browser/reactor/index.js\",\n },\n \"./document-models\": {\n types: \"./dist/types/document-models/index.d.ts\",\n browser: \"./dist/browser/document-models/index.js\",\n node: \"./dist/node/document-models/index.mjs\",\n },\n \"./document-models/*\": {\n types: \"./dist/types/document-models/*/index.d.ts\",\n browser: \"./dist/browser/document-models/*/index.js\",\n node: \"./dist/node/document-models/*/index.mjs\",\n },\n \"./editors\": {\n types: \"./dist/types/editors/index.d.ts\",\n browser: \"./dist/browser/editors/index.js\",\n node: \"./dist/node/editors/index.mjs\",\n },\n \"./editors/*\": {\n types: \"./dist/types/editors/*/editor.d.ts\",\n browser: \"./dist/browser/editors/*/editor.js\",\n node: \"./dist/node/editors/*/editor.mjs\",\n },\n \"./subgraphs\": {\n types: \"./dist/types/subgraphs/index.d.ts\",\n browser: \"./dist/browser/subgraphs/index.js\",\n node: \"./dist/node/subgraphs/index.mjs\",\n },\n \"./processors\": {\n types: \"./dist/types/processors/index.d.ts\",\n browser: \"./dist/browser/processors/index.js\",\n node: \"./dist/node/processors/index.mjs\",\n },\n \"./manifest\": \"./dist/powerhouse.manifest.json\",\n \"./style.css\": \"./dist/style.css\",\n} as const;\n\nexport const packageScripts = {\n \"test:watch\": \"vitest\",\n lint: \"oxlint --type-aware --type-check\",\n \"lint:fix\": \"oxlint --type-aware --type-check --fix\",\n format: \"oxfmt\",\n \"format:check\": \"oxfmt --check\",\n tsc: \"tsc\",\n \"tsc:watch\": \"tsc --watch\",\n generate: \"ph-cli generate\",\n connect: \"ph-cli connect\",\n build: \"ph-cli build\",\n reactor: \"ph-cli reactor\",\n service: \"ph-cli service\",\n vetra: \"ph-cli vetra\",\n \"service-startup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh\",\n \"service-unstartup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh\",\n} as const;\n\nexport const externalDependencies = {} as const;\n\n// eslint/prettier devDependencies present in projects scaffolded before the oxc migration.\n// Stripped from package.json during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_DEPENDENCIES = [\n \"@eslint/js\",\n \"eslint\",\n \"eslint-config-prettier\",\n \"eslint-plugin-prettier\",\n \"eslint-plugin-react\",\n \"eslint-plugin-react-hooks\",\n \"globals\",\n \"prettier\",\n \"typescript-eslint\",\n] as const;\n\n// Legacy lint/format config files written by eslint/prettier boilerplate.\n// Removed from the project root during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_FILES = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \".eslintrc\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.json\",\n \".eslintrc.yml\",\n \".eslintrc.yaml\",\n \".eslintignore\",\n \".prettierrc\",\n \".prettierrc.js\",\n \".prettierrc.cjs\",\n \".prettierrc.json\",\n \".prettierrc.yml\",\n \".prettierrc.yaml\",\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n \"prettier.config.mjs\",\n \".prettierignore\",\n] as const;\n\nexport const externalDevDependencies = {\n \"@electric-sql/pglite\": \"0.3.15\",\n \"@electric-sql/pglite-tools\": \"0.2.20\",\n \"@powerhousedao/document-engineering\": \"1.40.5\",\n \"@tailwindcss/cli\": \"^4.1.18\",\n \"@tailwindcss/vite\": \"^4.1.18\",\n \"@types/node\": \"^24.9.2\",\n \"@types/react\": \"^19.2.3\",\n \"@types/react-dom\": \"^19.2.3\",\n \"@vitejs/plugin-react\": \"^6.0.1\",\n \"@vitest/coverage-v8\": \"4.1.1\",\n oxfmt: \"0.55.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"^5.9.3\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"4.1.1\",\n} as const;\n\nexport const defaultManifest: Manifest = {\n name: \"\",\n description: \"\",\n category: \"\",\n publisher: {\n name: \"\",\n url: \"\",\n },\n documentModels: [],\n editors: [],\n apps: [],\n subgraphs: [],\n processors: [],\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\nconst DEFAULT_IMPORT_SCRIPTS_DIR = \"./scripts\";\nconst DEFAULT_SKIP_FORMAT = false;\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport const DEFAULT_CONFIG: PowerhouseConfig = {\n documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,\n editorsDir: DEFAULT_EDITORS_DIR,\n processorsDir: DEFAULT_PROCESSORS_DIR,\n subgraphsDir: DEFAULT_SUBGRAPHS_DIR,\n importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,\n skipFormat: DEFAULT_SKIP_FORMAT,\n logLevel: DEFAULT_LOG_LEVEL,\n auth: {\n enabled: false,\n admins: [],\n },\n};\n","import { readFileSync } from \"node:fs\";\nimport { DEFAULT_CONFIG } from \"../constants.js\";\nimport type { PowerhouseConfig } from \"../types.js\";\n\nexport function getConfig(path = \"./powerhouse.config.json\") {\n let config: PowerhouseConfig = { ...DEFAULT_CONFIG };\n try {\n const configStr = readFileSync(path, \"utf-8\");\n const userConfig = JSON.parse(configStr) as PowerhouseConfig;\n config = { ...config, ...userConfig };\n } catch {\n // console.warn(\"No powerhouse.config.json found, using defaults\");\n }\n\n return config;\n}\n","import { spawn } from \"node:child_process\";\n\nexport function spawnAsync(\n command: string,\n args: string[],\n options: {\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n } = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n const cmd =\n process.platform === \"win32\" && command === \"npm\" ? \"npm.cmd\" : command;\n\n const child = spawn(cmd, args, {\n cwd: options.cwd,\n env: options.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout.on(\"data\", (d: Buffer) => {\n stdout += d.toString();\n });\n\n child.stderr.on(\"data\", (d: Buffer) => {\n stderr += d.toString();\n });\n\n child.on(\"error\", reject);\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve(stdout.trim());\n } else {\n reject(\n new Error(stderr.trim() || `${command} exited with code ${code}`),\n );\n }\n });\n });\n}\n","import { promises as fs } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport {\n DEFAULT_REGISTRY_URL,\n POWERHOUSE_CONFIG_FILE,\n} from \"../clis/constants.js\";\nimport { getConfig } from \"../clis/file-system/get-config.js\";\nimport { spawnAsync } from \"../clis/file-system/spawn-async.js\";\n\nexport { DEFAULT_REGISTRY_URL } from \"../clis/constants.js\";\n\n/**\n * Extract the host portion of a registry URL — what npm uses as the key in\n * `~/.npmrc` for per-registry tokens (e.g. `//registry.vetra.io/`).\n */\nexport function registryAuthKey(registryUrl: string): string {\n const url = new URL(registryUrl);\n // Always trailing slash; npm's lookup is exact-match against the leading\n // path of the registry URL, with `//` prefix and trailing `/`.\n const path = url.pathname.endsWith(\"/\") ? url.pathname : `${url.pathname}/`;\n return `//${url.host}${path}:_authToken`;\n}\n\nexport interface ResolveRegistryUrlOptions {\n /** Explicit registry URL (e.g. from --registry flag). Highest priority. */\n registry?: string;\n /** Project path to read powerhouse.config.json from. */\n projectPath: string;\n /** Environment variables. Defaults to process.env. */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Resolve the registry URL with priority: flag > env > config > default.\n */\nexport function resolveRegistryUrl(options: ResolveRegistryUrlOptions): string {\n const { registry, projectPath, env = process.env } = options;\n const configPath = join(projectPath, POWERHOUSE_CONFIG_FILE);\n const config = getConfig(configPath);\n\n return (\n registry ??\n env.PH_REGISTRY_URL ??\n config.packageRegistryUrl ??\n DEFAULT_REGISTRY_URL\n );\n}\n\n/**\n * Check if the user is authenticated with the given npm registry.\n * Returns the username on success, throws on failure.\n */\nexport async function checkNpmAuth(registryUrl: string): Promise<string> {\n return spawnAsync(\"npm\", [\"whoami\", \"--registry\", registryUrl]);\n}\n\nexport interface NpmPublishOptions {\n /** Registry URL to publish to. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Additional arguments forwarded to npm publish. */\n args?: string[];\n /** Bearer token for the registry. When set, passed via a registry-scoped\n * `_authToken` config flag rather than read from the user's `.npmrc`. */\n authToken?: string;\n}\n\nexport interface NpmPublishResult {\n /** stdout from npm publish. */\n stdout: string;\n}\n\n/**\n * Run `npm publish` against the given registry.\n * Uses spawn with args array to avoid shell injection.\n *\n * When `authToken` is provided, the token is passed via a registry-scoped\n * `--//host/:_authToken=<token>` flag (npm's standard form for per-registry\n * tokens) so we never have to write to `~/.npmrc`.\n */\nexport async function npmPublish(\n options: NpmPublishOptions,\n): Promise<NpmPublishResult> {\n const { registryUrl, cwd, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\"publish\", \"--registry\", registryUrl, ...tokenArg, ...args];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n\n/**\n * Write `_authToken=<token>` for the given registry host into `~/.npmrc`,\n * preserving any other lines. Replaces the existing entry for the same key\n * if present. Returns the absolute path to the npmrc that was written.\n */\nexport async function writeRegistryAuthToken(\n registryUrl: string,\n token: string,\n): Promise<string> {\n const npmrcPath = join(homedir(), \".npmrc\");\n const key = registryAuthKey(registryUrl);\n let existing = \"\";\n try {\n existing = await fs.readFile(npmrcPath, \"utf8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n const lines = existing.split(\"\\n\");\n const filtered = lines.filter((line) => !line.startsWith(`${key}=`));\n // Also drop any trailing empties to avoid stacking blank lines on rewrite.\n while (filtered.length && filtered[filtered.length - 1] === \"\")\n filtered.pop();\n filtered.push(`${key}=${token}`);\n await fs.writeFile(npmrcPath, `${filtered.join(\"\\n\")}\\n`, \"utf8\");\n return npmrcPath;\n}\n\nexport interface NpmUnpublishOptions {\n /** Registry URL to unpublish from. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Package spec: `<name>` (whole package) or `<name>@<version>` (single version). */\n spec: string;\n /** Additional arguments forwarded to npm unpublish. */\n args?: string[];\n /** Bearer token for the registry (same semantics as `NpmPublishOptions.authToken`). */\n authToken?: string;\n}\n\nexport interface NpmUnpublishResult {\n /** stdout from npm unpublish. */\n stdout: string;\n}\n\n/**\n * Run `npm unpublish` against the given registry.\n * Always passes `--force` because npm otherwise refuses to unpublish packages\n * older than 72h (a public-npmjs safeguard that doesn't apply to private registries).\n */\nexport async function npmUnpublish(\n options: NpmUnpublishOptions,\n): Promise<NpmUnpublishResult> {\n const { registryUrl, cwd, spec, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\n \"unpublish\",\n spec,\n \"--registry\",\n registryUrl,\n \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AAS,UAAU,SAAS,SAAS,SAAS,OAAO,GAC1D,UAAS,KAAK;AAChB,UAAS,KAAK,GAAG,IAAI,GAAG,QAAQ;AAChC,OAAMA,SAAG,UAAU,WAAW,GAAG,SAAS,KAAK,KAAK,CAAC,KAAK,OAAO;AACjE,QAAO;;;;;;;AA0BT,eAAsB,aACpB,SAC6B;CAC7B,MAAM,EAAE,aAAa,KAAK,MAAM,OAAO,EAAE,EAAE,cAAc;AAczD,QAAO,EAAE,QADM,MAAM,WAAW,OAThB;EACd;EACA;EACA;EACA;EACA;EACA,GATe,YACb,CAAC,KAAK,gBAAgB,YAAY,CAAC,GAAG,YAAY,GAClD,EAAE;EAQJ,GAAG;EACJ,EAC+C,EAAE,KAAK,CAAC,EACvC"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["fs"],"sources":["../../clis/constants.ts","../../clis/file-system/get-config.ts","../../clis/file-system/spawn-async.ts","../../registry/registry.ts"],"sourcesContent":["import { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport type { Manifest } from \"../document-model/types.js\";\nimport type { PowerhouseConfig } from \"./types.js\";\n\nexport const SERVICE_ACTIONS = [\n \"start\",\n \"stop\",\n \"status\",\n \"setup\",\n \"restart\",\n] as const;\n\nexport const SECONDS_IN_DAY = 24 * 60 * 60;\nexport const DEFAULT_EXPIRY_DAYS = 7;\nexport const DEFAULT_EXPIRY_SECONDS = DEFAULT_EXPIRY_DAYS * SECONDS_IN_DAY;\n\nexport const DRIVES_PRESERVE_STRATEGIES = [\n \"preserve-all\",\n \"preserve-by-url-and-detach\",\n] as const;\n\nexport const LOG_LEVELS = [\n \"debug\",\n \"info\",\n \"warn\",\n \"error\",\n \"verbose\",\n] as const;\n\nexport const DEFAULT_TIMEOUT = 300 as const;\n\nexport const DEFAULT_CONNECT_STUDIO_PORT = 3000 as const;\n\nexport const DEFAULT_VETRA_CONNECT_PORT = 3001 as const;\n\nexport const DEFAULT_CONNECT_PREVIEW_PORT = 4173 as const;\n\nexport const DEFAULT_CONNECT_OUTDIR = \".ph/connect-build/dist/\" as const;\n\nexport const DEFAULT_RENOWN_URL = \"https://www.renown.id\" as const;\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.vetra.io\" as const;\n\nexport const DEFAULT_SWITCHBOARD_PORT = 4001 as const;\n\nexport const DEFAULT_VETRA_DRIVE_ID = \"vetra\" as const;\n\nexport const MINIMUM_NODE_VERSION = \"24.0.0\" as const;\nexport const PH_BIN = \"ph-cli-legacy\" as const;\nexport const POWERHOUSE_CONFIG_FILE = \"powerhouse.config.json\" as const;\nexport const PH_GLOBAL_DIR_NAME = \".ph\" as const;\n// Keep PH_GLOBAL_PROJECT_NAME for backwards compatibility\nexport const PH_GLOBAL_PROJECT_NAME = PH_GLOBAL_DIR_NAME;\n\nexport const HOME_DIR = homedir();\n\nexport const POWERHOUSE_GLOBAL_DIR = join(HOME_DIR, PH_GLOBAL_DIR_NAME);\n\n// Workspace packages that go in peerDependencies of every generated project.\nexport const VERSIONED_PEER_DEPENDENCIES = [\n \"document-model\",\n \"@powerhousedao/reactor-browser\",\n];\n\ntype PeerSpec = { peer: string; dev: string };\n\nexport const REACTOR_API_PACKAGE = \"@powerhousedao/reactor-api\";\nexport const ANALYTICS_ENGINE_CORE_PACKAGE =\n \"@powerhousedao/analytics-engine-core\";\nexport const GRAPHQL_PACKAGE = \"graphql\";\nexport const GRAPHQL_TAG_PACKAGE = \"graphql-tag\";\n\n// External peerDependencies of every generated project.\n// `peer` is the consumer-facing range; `dev` is the exact build-tested pin.\n// graphql / graphql-tag are always-on because the workspace packages pulled\n// in by every `ph init` project (codegen, reactor-api, reactor-browser,\n// vetra-packages) declare them as peers — even projects without subgraphs\n// need them in scope so pnpm hoists a single graphql instance.\nexport const PEER_EXTERNAL_DEPENDENCIES = {\n [GRAPHQL_PACKAGE]: { peer: \"^16\", dev: \"16.12.0\" },\n [GRAPHQL_TAG_PACKAGE]: { peer: \"^2\", dev: \"2.12.6\" },\n react: { peer: \"^19\", dev: \"19.2.6\" },\n \"react-dom\": { peer: \"^19\", dev: \"19.2.6\" },\n zod: { peer: \"^4\", dev: \"4.3.6\" },\n} as const satisfies Record<string, PeerSpec>;\n\n// Per-feature deps added dynamically by codegen when required.\nexport const FEATURE_DEPENDENCIES = {\n analyticsProcessor: {\n peerVersioned: [ANALYTICS_ENGINE_CORE_PACKAGE],\n peerExternal: {},\n },\n} as const satisfies Record<\n string,\n { peerVersioned: readonly string[]; peerExternal: Record<string, PeerSpec> }\n>;\n\nexport const VERSIONED_DEPENDENCIES = [\n ...VERSIONED_PEER_DEPENDENCIES,\n ...FEATURE_DEPENDENCIES.analyticsProcessor.peerVersioned,\n];\n\n// Transitive dependencies whose postinstall scripts the generated project\n// trusts. Mirrors the `allowBuilds` map in the boilerplate's\n// pnpm-workspace.yaml and is also passed as `--allow-build` flags to\n// `pnpm dlx @powerhousedao/ph-cli init` so pnpm 11's strict-dep-builds\n// default doesn't prompt during the outer dlx download.\nexport const BOILERPLATE_ALLOWED_BUILDS = [\n \"@apollo/protobufjs\",\n \"@datadog/pprof\",\n \"@parcel/watcher\",\n \"@reown/appkit\",\n \"bufferutil\",\n \"esbuild\",\n \"keccak\",\n \"protobufjs\",\n \"utf-8-validate\",\n] as const;\n\n// pnpm `overrides` written into the generated project's pnpm-workspace.yaml to\n// force a single chosen version of each, avoiding duplicates from coexisting\n// version ranges. Generated-project only — never change the monorepo catalog\n// for this (a re-resolution there pulls a tsc-crashing TS6 beta).\nexport const BOILERPLATE_PNPM_OVERRIDES = {\n \"date-fns\": \"4.3.0\",\n vite: \"8.0.14\",\n rolldown: \"1.0.2\",\n} as const satisfies Record<string, string>;\n\nexport const VERSIONED_DEV_DEPENDENCIES = [\n \"@powerhousedao/ph-cli\",\n \"@powerhousedao/reactor\",\n \"@powerhousedao/shared\",\n \"@powerhousedao/connect\",\n \"@powerhousedao/design-system\",\n];\n\nexport const packageJsonExports = {\n \".\": {\n types: \"./dist/types/index.d.ts\",\n browser: \"./dist/browser/index.js\",\n node: \"./dist/node/index.mjs\",\n },\n \"./reactor\": {\n types: \"./dist/types/reactor/index.d.ts\",\n browser: \"./dist/browser/reactor/index.js\",\n },\n \"./document-models\": {\n types: \"./dist/types/document-models/index.d.ts\",\n browser: \"./dist/browser/document-models/index.js\",\n node: \"./dist/node/document-models/index.mjs\",\n },\n \"./document-models/*\": {\n types: \"./dist/types/document-models/*/index.d.ts\",\n browser: \"./dist/browser/document-models/*/index.js\",\n node: \"./dist/node/document-models/*/index.mjs\",\n },\n \"./editors\": {\n types: \"./dist/types/editors/index.d.ts\",\n browser: \"./dist/browser/editors/index.js\",\n node: \"./dist/node/editors/index.mjs\",\n },\n \"./editors/*\": {\n types: \"./dist/types/editors/*/editor.d.ts\",\n browser: \"./dist/browser/editors/*/editor.js\",\n node: \"./dist/node/editors/*/editor.mjs\",\n },\n \"./subgraphs\": {\n types: \"./dist/types/subgraphs/index.d.ts\",\n browser: \"./dist/browser/subgraphs/index.js\",\n node: \"./dist/node/subgraphs/index.mjs\",\n },\n \"./processors\": {\n types: \"./dist/types/processors/index.d.ts\",\n browser: \"./dist/browser/processors/index.js\",\n node: \"./dist/node/processors/index.mjs\",\n },\n \"./manifest\": \"./dist/powerhouse.manifest.json\",\n \"./style.css\": \"./dist/style.css\",\n} as const;\n\nexport const packageScripts = {\n \"test:watch\": \"vitest\",\n lint: \"oxlint --type-aware --type-check\",\n \"lint:fix\": \"oxlint --type-aware --type-check --fix\",\n format: \"oxfmt\",\n \"format:check\": \"oxfmt --check\",\n tsc: \"tsc\",\n \"tsc:watch\": \"tsc --watch\",\n generate: \"ph-cli generate\",\n connect: \"ph-cli connect\",\n build: \"ph-cli build\",\n reactor: \"ph-cli reactor\",\n service: \"ph-cli service\",\n vetra: \"ph-cli vetra\",\n \"service-startup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-startup.sh\",\n \"service-unstartup\":\n \"bash ./node_modules/@powerhousedao/ph-cli/dist/scripts/service-unstartup.sh\",\n} as const;\n\nexport const externalDependencies = {} as const;\n\n// eslint/prettier devDependencies present in projects scaffolded before the oxc migration.\n// Stripped from package.json during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_DEPENDENCIES = [\n \"@eslint/js\",\n \"eslint\",\n \"eslint-config-prettier\",\n \"eslint-plugin-prettier\",\n \"eslint-plugin-react\",\n \"eslint-plugin-react-hooks\",\n \"globals\",\n \"prettier\",\n \"typescript-eslint\",\n] as const;\n\n// Legacy lint/format config files written by eslint/prettier boilerplate.\n// Removed from the project root during `ph migrate`.\nexport const LEGACY_LINT_FORMAT_FILES = [\n \"eslint.config.js\",\n \"eslint.config.mjs\",\n \"eslint.config.cjs\",\n \"eslint.config.ts\",\n \".eslintrc\",\n \".eslintrc.js\",\n \".eslintrc.cjs\",\n \".eslintrc.json\",\n \".eslintrc.yml\",\n \".eslintrc.yaml\",\n \".eslintignore\",\n \".prettierrc\",\n \".prettierrc.js\",\n \".prettierrc.cjs\",\n \".prettierrc.json\",\n \".prettierrc.yml\",\n \".prettierrc.yaml\",\n \"prettier.config.js\",\n \"prettier.config.cjs\",\n \"prettier.config.mjs\",\n \".prettierignore\",\n] as const;\n\nexport const externalDevDependencies = {\n \"@electric-sql/pglite\": \"0.3.15\",\n \"@electric-sql/pglite-tools\": \"0.2.20\",\n \"@powerhousedao/document-engineering\": \"1.40.5\",\n \"@tailwindcss/cli\": \"^4.1.18\",\n \"@tailwindcss/vite\": \"^4.1.18\",\n \"@types/node\": \"^24.9.2\",\n \"@types/react\": \"^19.2.3\",\n \"@types/react-dom\": \"^19.2.3\",\n \"@vitejs/plugin-react\": \"^6.0.1\",\n \"@vitest/coverage-v8\": \"4.1.1\",\n oxfmt: \"0.55.0\",\n oxlint: \"1.70.0\",\n \"oxlint-tsgolint\": \"0.23.0\",\n tailwindcss: \"^4.1.16\",\n typescript: \"^5.9.3\",\n vite: \"^8.0.10\",\n \"vite-tsconfig-paths\": \"6.1.1\",\n vitest: \"4.1.1\",\n} as const;\n\nexport const defaultManifest: Manifest = {\n name: \"\",\n description: \"\",\n category: \"\",\n publisher: {\n name: \"\",\n url: \"\",\n },\n documentModels: [],\n editors: [],\n apps: [],\n subgraphs: [],\n processors: [],\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\nconst DEFAULT_IMPORT_SCRIPTS_DIR = \"./scripts\";\nconst DEFAULT_SKIP_FORMAT = false;\nconst DEFAULT_LOG_LEVEL = \"info\";\n\nexport const DEFAULT_CONFIG: PowerhouseConfig = {\n documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,\n editorsDir: DEFAULT_EDITORS_DIR,\n processorsDir: DEFAULT_PROCESSORS_DIR,\n subgraphsDir: DEFAULT_SUBGRAPHS_DIR,\n importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,\n skipFormat: DEFAULT_SKIP_FORMAT,\n logLevel: DEFAULT_LOG_LEVEL,\n auth: {\n enabled: false,\n admins: [],\n },\n};\n","import { readFileSync } from \"node:fs\";\nimport { DEFAULT_CONFIG } from \"../constants.js\";\nimport type { PowerhouseConfig } from \"../types.js\";\n\nexport function getConfig(path = \"./powerhouse.config.json\") {\n let config: PowerhouseConfig = { ...DEFAULT_CONFIG };\n try {\n const configStr = readFileSync(path, \"utf-8\");\n const userConfig = JSON.parse(configStr) as PowerhouseConfig;\n config = { ...config, ...userConfig };\n } catch {\n // console.warn(\"No powerhouse.config.json found, using defaults\");\n }\n\n return config;\n}\n","import spawn from \"cross-spawn\";\n\nexport function spawnAsync(\n command: string,\n args: string[],\n options: {\n cwd?: string;\n env?: NodeJS.ProcessEnv;\n } = {},\n): Promise<string> {\n return new Promise((resolve, reject) => {\n // cross-spawn rather than node:child_process.spawn. On Windows npm, pnpm\n // and yarn are all `.cmd` shims, and since the fix for CVE-2024-27980\n // (Node 18.20.2 / 20.12.2 / 21.7.3 and later) `spawn` refuses to execute\n // `.bat`/`.cmd` unless `shell: true` -- it throws `spawn EINVAL`, and\n // synchronously, so an `error` listener never sees it. Passing\n // `shell: true` instead would hand the arguments to cmd.exe, which strips\n // quotes and splits on shell metacharacters. cross-spawn resolves the shim\n // and escapes the arguments itself, so the call keeps shell-less argument\n // semantics on every platform.\n const child = spawn(command, args, {\n cwd: options.cwd,\n env: options.env,\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n\n let stdout = \"\";\n let stderr = \"\";\n\n child.stdout?.on(\"data\", (d: Buffer) => {\n stdout += d.toString();\n });\n\n child.stderr?.on(\"data\", (d: Buffer) => {\n stderr += d.toString();\n });\n\n child.on(\"error\", reject);\n\n child.on(\"close\", (code) => {\n if (code === 0) {\n resolve(stdout.trim());\n } else {\n reject(\n new Error(stderr.trim() || `${command} exited with code ${code}`),\n );\n }\n });\n });\n}\n","import { promises as fs } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport {\n DEFAULT_REGISTRY_URL,\n POWERHOUSE_CONFIG_FILE,\n} from \"../clis/constants.js\";\nimport { getConfig } from \"../clis/file-system/get-config.js\";\nimport { spawnAsync } from \"../clis/file-system/spawn-async.js\";\n\nexport { DEFAULT_REGISTRY_URL } from \"../clis/constants.js\";\n\n/**\n * Extract the host portion of a registry URL — what npm uses as the key in\n * `~/.npmrc` for per-registry tokens (e.g. `//registry.vetra.io/`).\n */\nexport function registryAuthKey(registryUrl: string): string {\n const url = new URL(registryUrl);\n // Always trailing slash; npm's lookup is exact-match against the leading\n // path of the registry URL, with `//` prefix and trailing `/`.\n const path = url.pathname.endsWith(\"/\") ? url.pathname : `${url.pathname}/`;\n return `//${url.host}${path}:_authToken`;\n}\n\nexport interface ResolveRegistryUrlOptions {\n /** Explicit registry URL (e.g. from --registry flag). Highest priority. */\n registry?: string;\n /** Project path to read powerhouse.config.json from. */\n projectPath: string;\n /** Environment variables. Defaults to process.env. */\n env?: Record<string, string | undefined>;\n}\n\n/**\n * Resolve the registry URL with priority: flag > env > config > default.\n */\nexport function resolveRegistryUrl(options: ResolveRegistryUrlOptions): string {\n const { registry, projectPath, env = process.env } = options;\n const configPath = join(projectPath, POWERHOUSE_CONFIG_FILE);\n const config = getConfig(configPath);\n\n return (\n registry ??\n env.PH_REGISTRY_URL ??\n config.packageRegistryUrl ??\n DEFAULT_REGISTRY_URL\n );\n}\n\n/**\n * Check if the user is authenticated with the given npm registry.\n * Returns the username on success, throws on failure.\n */\nexport async function checkNpmAuth(registryUrl: string): Promise<string> {\n return spawnAsync(\"npm\", [\"whoami\", \"--registry\", registryUrl]);\n}\n\nexport interface NpmPublishOptions {\n /** Registry URL to publish to. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Additional arguments forwarded to npm publish. */\n args?: string[];\n /** Bearer token for the registry. When set, passed via a registry-scoped\n * `_authToken` config flag rather than read from the user's `.npmrc`. */\n authToken?: string;\n}\n\nexport interface NpmPublishResult {\n /** stdout from npm publish. */\n stdout: string;\n}\n\n/**\n * Run `npm publish` against the given registry.\n * Uses spawn with args array to avoid shell injection.\n *\n * When `authToken` is provided, the token is passed via a registry-scoped\n * `--//host/:_authToken=<token>` flag (npm's standard form for per-registry\n * tokens) so we never have to write to `~/.npmrc`.\n */\nexport async function npmPublish(\n options: NpmPublishOptions,\n): Promise<NpmPublishResult> {\n const { registryUrl, cwd, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\"publish\", \"--registry\", registryUrl, ...tokenArg, ...args];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n\n/**\n * Write `_authToken=<token>` for the given registry host into `~/.npmrc`,\n * preserving any other lines. Replaces the existing entry for the same key\n * if present. Returns the absolute path to the npmrc that was written.\n */\nexport async function writeRegistryAuthToken(\n registryUrl: string,\n token: string,\n): Promise<string> {\n const npmrcPath = join(homedir(), \".npmrc\");\n const key = registryAuthKey(registryUrl);\n let existing = \"\";\n try {\n existing = await fs.readFile(npmrcPath, \"utf8\");\n } catch (err) {\n if ((err as NodeJS.ErrnoException).code !== \"ENOENT\") throw err;\n }\n const lines = existing.split(\"\\n\");\n const filtered = lines.filter((line) => !line.startsWith(`${key}=`));\n // Also drop any trailing empties to avoid stacking blank lines on rewrite.\n while (filtered.length && filtered[filtered.length - 1] === \"\")\n filtered.pop();\n filtered.push(`${key}=${token}`);\n await fs.writeFile(npmrcPath, `${filtered.join(\"\\n\")}\\n`, \"utf8\");\n return npmrcPath;\n}\n\nexport interface NpmUnpublishOptions {\n /** Registry URL to unpublish from. */\n registryUrl: string;\n /** Working directory (project root). */\n cwd: string;\n /** Package spec: `<name>` (whole package) or `<name>@<version>` (single version). */\n spec: string;\n /** Additional arguments forwarded to npm unpublish. */\n args?: string[];\n /** Bearer token for the registry (same semantics as `NpmPublishOptions.authToken`). */\n authToken?: string;\n}\n\nexport interface NpmUnpublishResult {\n /** stdout from npm unpublish. */\n stdout: string;\n}\n\n/**\n * Run `npm unpublish` against the given registry.\n * Always passes `--force` because npm otherwise refuses to unpublish packages\n * older than 72h (a public-npmjs safeguard that doesn't apply to private registries).\n */\nexport async function npmUnpublish(\n options: NpmUnpublishOptions,\n): Promise<NpmUnpublishResult> {\n const { registryUrl, cwd, spec, args = [], authToken } = options;\n const tokenArg = authToken\n ? [`--${registryAuthKey(registryUrl)}=${authToken}`]\n : [];\n const npmArgs = [\n \"unpublish\",\n spec,\n \"--registry\",\n registryUrl,\n \"--force\",\n ...tokenArg,\n ...args,\n ];\n const stdout = await spawnAsync(\"npm\", npmArgs, { cwd });\n return { stdout };\n}\n"],"mappings":";;;;;;AA0CA,MAAa,uBAAuB;AAQpC,MAAa,yBAAyB;AAOD,KAFb,SAAS,EAES,MAA6B;AAGvE,MAAa,8BAA8B,CACzC,kBACA,iCACD;AAyBD,MAAa,uBAAuB,EAClC,oBAAoB;CAClB,eAAe,CArB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AM,WAAW,OAThB;EACd;EACA;EACA;EACA;EACA;EACA,GATe,YACb,CAAC,KAAK,gBAAgB,YAAY,CAAC,GAAG,YAAY,GAClD,EAAE;EAQJ,GAAG;EACJ,EAC+C,EAAE,KAAK,CAAC,EACvC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest-slim.d.ts","names":[],"sources":["../../registry/manifest-slim.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"manifest-slim.d.ts","names":[],"sources":["../../registry/manifest-slim.ts"],"mappings":";;;;;;;AAiDA;;;;;;iBAAgB,YAAA,CACd,QAAA,EAAU,QAAA,sBACT,QAAA"}
|
|
@@ -330,4 +330,4 @@ type UpdateNodeInput = {
|
|
|
330
330
|
};
|
|
331
331
|
//#endregion
|
|
332
332
|
export { LegacySynchronizationUnit as $, TriggerData as A, RegistryPackageMap as B, RemoveTriggerInput as C, SetSharingTypeInput as D, SetDriveNameInput as E, PackageInfo as F, DriveInput as G, RegistryPackageStatus as H, PackageListItem as I, SharingType as J, GenerateNodesCopyIdGenerator as K, PackagePage as L, TriggerType as M, UpdateFileInput as N, TransmitterType as O, UpdateNodeInput as P, LegacyAddFileInput as Q, RegistryPackage as R, RemoveListenerInput as S, SetDriveIconInput as T, DocumentDrivePHState$1 as U, RegistryPackageSource as V, DriveDocumentModelModule as W, DocumentDriveDocument as X, DocumentDriveAction as Y, LegacyAddFileAction as Z, ListenerInput as _, SetDriveNameAction as _t, CopyNodeInput as a, DocumentDriveNodeOperations as at, PullResponderTriggerData as b, DocumentDriveLocalState$1 as c, UpdateNodeAction as ct, FolderNode as d, DocumentDriveDriveAction as dt, AddFileAction as et, Listener as f, DocumentDriveDriveOperations as ft, ListenerFilterInput as g, SetDriveIconAction as gt, ListenerFilter as h, SetAvailableOfflineAction as ht, AddTriggerInput as i, DocumentDriveNodeAction as it, TriggerInput as j, Trigger as k, DocumentDrivePHState as l, AddListenerAction as lt, ListenerCallInfoInput as m, RemoveTriggerAction as mt, AddFolderInput as n, CopyNodeAction as nt, DeleteNodeInput as o, MoveNodeAction as ot, ListenerCallInfo as p, RemoveListenerAction as pt, GenerateNodesCopySrc as q, AddListenerInput as r, DeleteNodeAction as rt, DocumentDriveGlobalState as s, UpdateFileAction as st, AddFileInput as t, AddFolderAction as tt, FileNode as u, AddTriggerAction as ut, MoveNodeInput as v, SetSharingTypeAction as vt, SetAvailableOfflineInput as w, PullResponderTriggerDataInput as x, Node$1 as y, RegistryPackageList as z };
|
|
333
|
-
//# sourceMappingURL=types-
|
|
333
|
+
//# sourceMappingURL=types-CCSBgnLL.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types-
|
|
1
|
+
{"version":3,"file":"types-CCSBgnLL.d.ts","names":[],"sources":["../document-drive/gen/drive/actions.ts","../document-drive/gen/node/actions.ts","../document-drive/gen/types.ts","../document-drive/src/types.ts","../document-drive/types.ts","../registry/types.ts","../document-drive/gen/schema/types.ts"],"mappings":";;;;KAcY,kBAAA,GAAqB,MAAA;EAC/B,IAAA;EACA,KAAA,EAAO,iBAAA;AAAA;AAAA,KAEG,kBAAA,GAAqB,MAAA;EAC/B,IAAA;EACA,KAAA,EAAO,iBAAA;AAAA;AAAA,KAEG,oBAAA,GAAuB,MAAA;EACjC,IAAA;EACA,KAAA,EAAO,mBAAA;AAAA;AAAA,KAEG,yBAAA,GAA4B,MAAA;EACtC,IAAA;EACA,KAAA,EAAO,wBAAA;AAAA;AAAA,KAEG,iBAAA,GAAoB,MAAA;EAC9B,IAAA;EACA,KAAA,EAAO,gBAAA;AAAA;AAAA,KAEG,oBAAA,GAAuB,MAAA;EACjC,IAAA;EACA,KAAA,EAAO,mBAAA;AAAA;AAAA,KAEG,gBAAA,GAAmB,MAAA;EAC7B,IAAA;EACA,KAAA,EAAO,eAAA;AAAA;AAAA,KAEG,mBAAA,GAAsB,MAAA;EAChC,IAAA;EACA,KAAA,EAAO,kBAAA;AAAA;AAAA,KAGG,wBAAA,GACR,k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AA,KAGI,iBAAA;EACV,IAAA,EAAM,OAAA;AAAA;AAAA,KAGI,mBAAA;EACV,IAAA,EAAM,OAAA;AAAA;AAAA,KAGI,eAAA;AAAA,KAQA,OAAA;EACV,IAAA,EAAM,KAAA,CAAM,WAAA;EACZ,EAAA,EAAI,OAAA;EACJ,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,YAAA;EACV,IAAA,GAAO,UAAA,CAAW,6BAAA;EAClB,EAAA,EAAI,OAAA;EACJ,IAAA,EAAM,WAAA;AAAA;AAAA,KAGI,WAAA,GAAc,wBAAA;AAAA,KAEd,WAAA;AAAA,KAEA,eAAA;EACV,YAAA,GAAe,UAAA,CAAW,OAAA;EAC1B,EAAA,EAAI,OAAA;EACJ,IAAA,GAAO,UAAA,CAAW,OAAA;EAClB,YAAA,GAAe,UAAA,CAAW,OAAA;AAAA;AAAA,KAGhB,eAAA;EACV,EAAA,EAAI,OAAA;EACJ,IAAA,GAAO,UAAA,CAAW,OAAA;EAClB,YAAA,GAAe,UAAA,CAAW,OAAA;AAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
//#region document-model/utils.d.ts
|
|
4
|
+
declare function generateId(method?: "UUIDv4"): string;
|
|
5
|
+
/**
|
|
6
|
+
* Derives a deterministic operation ID from stable properties.
|
|
7
|
+
*/
|
|
8
|
+
declare function deriveOperationId(documentId: string, scope: string, branch: string, actionId: string): string;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Moved to `document-model/mock`
|
|
11
|
+
* (`@powerhousedao/shared/document-model/mock`) so runtime bundles no longer
|
|
12
|
+
* ship zocker and faker. This stub only throws; update the import or run
|
|
13
|
+
* `ph migrate`.
|
|
14
|
+
*/
|
|
15
|
+
declare function generateMock<TSchema extends z.ZodType>(_schema: TSchema, _overrides?: Partial<z.infer<TSchema>>): z.infer<TSchema>;
|
|
16
|
+
//#endregion
|
|
17
|
+
export { generateId as n, generateMock as r, deriveOperationId as t };
|
|
18
|
+
//# sourceMappingURL=utils-DP122OSS.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-DP122OSS.d.ts","names":[],"sources":["../document-model/utils.ts"],"mappings":";;;iBAGgB,UAAA,CAAW,MAAA;;AAA3B;;iBAagB,iBAAA,CACd,UAAA,UACA,KAAA,UACA,MAAA,UACA,QAAA;;;AAJF;;;;iBAgBgB,YAAA,iBAA6B,CAAA,CAAE,OAAA,CAAA,CAC7C,OAAA,EAAS,OAAA,EACT,UAAA,GAAa,OAAA,CAAQ,CAAA,CAAE,KAAA,CAAM,OAAA,KAC5B,CAAA,CAAE,KAAA,CAAM,OAAA"}
|
|
@@ -98,7 +98,16 @@ function generateId(method) {
|
|
|
98
98
|
function deriveOperationId(documentId, scope, branch, actionId) {
|
|
99
99
|
return hashBrowser(`${documentId}:${scope}:${branch}:${actionId}`, "sha1", "hex").slice(0, 32);
|
|
100
100
|
}
|
|
101
|
+
/**
|
|
102
|
+
* @deprecated Moved to `document-model/mock`
|
|
103
|
+
* (`@powerhousedao/shared/document-model/mock`) so runtime bundles no longer
|
|
104
|
+
* ship zocker and faker. This stub only throws; update the import or run
|
|
105
|
+
* `ph migrate`.
|
|
106
|
+
*/
|
|
107
|
+
function generateMock(_schema, _overrides) {
|
|
108
|
+
throw new Error("generateMock is no longer exported from \"document-model\" or \"@powerhousedao/shared/document-model\". Import it from \"document-model/mock\" instead, or run `ph migrate` to rewrite the import.");
|
|
109
|
+
}
|
|
101
110
|
//#endregion
|
|
102
|
-
export {
|
|
111
|
+
export { base58Decode as a, buildOperationSignatureParams as c, hex2ab as d, ab2hex as i, getUnixTimestamp as l, generateId as n, base64UrlToBytes as o, generateMock as r, buildOperationSignatureMessage as s, deriveOperationId as t, hashBrowser as u };
|
|
103
112
|
|
|
104
|
-
//# sourceMappingURL=utils-
|
|
113
|
+
//# sourceMappingURL=utils-aaTmfxFW.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils-
|
|
1
|
+
{"version":3,"file":"utils-aaTmfxFW.js","names":["createSha1Hash","stringifyJson"],"sources":["../document-model/crypto.ts","../document-model/utils.ts"],"sourcesContent":["import { stringify as stringifyJson } from \"safe-stable-stringify\";\nimport { createHash as createSha1Hash } from \"sha1-uint8array\";\nimport type { ActionSignatureContext } from \"./types.js\";\n\nexport const hashBrowser = (\n data: string | Uint8Array | ArrayBufferView | DataView,\n algorithm = \"sha1\",\n encoding = \"base64\",\n _params?: Record<string, unknown>,\n) => {\n if (![\"sha1\"].includes(algorithm)) {\n throw new Error(\n `Hashing algorithm not supported: \"${algorithm}\". Available: sha1`,\n );\n }\n\n if (![\"base64\", \"hex\"].includes(encoding)) {\n throw new Error(\n `Hash encoding not supported: \"${encoding}\". Available: base64, hex`,\n );\n }\n\n const hash = hashUIntArray(data, algorithm);\n\n if (encoding === \"hex\") {\n return uint8ArrayToHex(hash);\n }\n\n return uint8ArrayToBase64(hash);\n};\n\nfunction uint8ArrayToBase64(uint8Array: Uint8Array) {\n // Convert the Uint8Array to a binary string\n let binaryString = \"\";\n for (let i = 0; i < uint8Array.length; i++) {\n binaryString += String.fromCharCode(uint8Array[i]);\n }\n\n // Encode the binary string to base64\n const base64String = btoa(binaryString);\n return base64String;\n}\n\nfunction uint8ArrayToHex(uint8Array: Uint8Array) {\n return Array.from(uint8Array)\n .map((byte) => byte.toString(16).padStart(2, \"0\"))\n .join(\"\");\n}\n\nfunction hashUIntArray(\n data: string | Uint8Array | ArrayBufferView,\n algorithm = \"sha1\",\n) {\n if (![\"sha1\"].includes(algorithm)) {\n throw new Error(\"Hashing algorithm not supported: Available: sha1\");\n }\n return createSha1Hash(\"sha1\")\n .update(data as string)\n .digest();\n}\n\nexport function getUnixTimestamp(date: Date | string): string {\n return (new Date(date).getTime() / 1000).toFixed(0);\n}\n\nexport function buildOperationSignatureParams({\n documentId,\n signer,\n action,\n previousStateHash,\n}: ActionSignatureContext): [string, string, string, string] {\n const { /*id, timestamp,*/ scope, type } = action;\n return [\n /*getUnixTimestamp(timestamp)*/ getUnixTimestamp(new Date()),\n signer.app.key,\n hashBrowser(\n [documentId, scope, /*id,*/ type, stringifyJson(action.input)].join(\"\"),\n ),\n previousStateHash,\n ];\n}\n\nconst textEncode = new TextEncoder();\n\nexport function buildOperationSignatureMessage(\n params: [string, string, string, string],\n): Uint8Array {\n const message = params.join(\"\");\n const prefix = \"\\x19Signed Operation:\\n\" + message.length.toString();\n return textEncode.encode(prefix + message);\n}\n\nexport function ab2hex(ab: ArrayBuffer | ArrayBufferView): string {\n const view = ArrayBuffer.isView(ab) ? ab : new Uint8Array(ab);\n return Array.prototype.map\n .call(view, (x: number) => (\"00\" + x.toString(16)).slice(-2))\n .join(\"\");\n}\n\nexport function hex2ab(hex: string) {\n return new Uint8Array(\n hex.match(/[\\da-f]{2}/gi)?.map(function (h) {\n return parseInt(h, 16);\n }) ?? [],\n );\n}\n\nconst BASE58_ALPHABET =\n \"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz\";\n\n/**\n * Decodes a base58btc (Bitcoin/IPFS alphabet) string to bytes. Returns null on\n * any character outside the alphabet.\n */\nexport function base58Decode(input: string): Uint8Array | null {\n const bytes: number[] = [];\n for (const ch of input) {\n let carry = BASE58_ALPHABET.indexOf(ch);\n if (carry === -1) {\n return null;\n }\n for (let i = 0; i < bytes.length; i++) {\n carry += bytes[i] * 58;\n bytes[i] = carry & 0xff;\n carry >>= 8;\n }\n while (carry > 0) {\n bytes.push(carry & 0xff);\n carry >>= 8;\n }\n }\n // Each leading \"1\" is a leading zero byte.\n for (let k = 0; k < input.length && input[k] === \"1\"; k++) {\n bytes.push(0);\n }\n return Uint8Array.from(bytes.reverse());\n}\n\n/** Decodes a base64url string to bytes (portable across node, browsers, workers). */\nexport function base64UrlToBytes(input: string): Uint8Array {\n const base64 = input.replace(/-/g, \"+\").replace(/_/g, \"/\");\n const padded = base64 + \"=\".repeat((4 - (base64.length % 4)) % 4);\n let binary: string;\n if (typeof atob === \"function\") {\n binary = atob(padded);\n } else {\n binary = Buffer.from(padded, \"base64\").toString(\"binary\");\n }\n const bytes = new Uint8Array(binary.length);\n for (let i = 0; i < binary.length; i++) {\n bytes[i] = binary.charCodeAt(i);\n }\n return bytes;\n}\n","import { hashBrowser } from \"./crypto.js\";\nimport type { z } from \"zod\";\n\nexport function generateId(method?: \"UUIDv4\"): string {\n if (method && method.toString() !== \"UUIDv4\") {\n throw new Error(\n `Id generation method not supported: \"${method.toString()}\"`,\n );\n }\n\n return globalThis.crypto.randomUUID();\n}\n\n/**\n * Derives a deterministic operation ID from stable properties.\n */\nexport function deriveOperationId(\n documentId: string,\n scope: string,\n branch: string,\n actionId: string,\n): string {\n const input = `${documentId}:${scope}:${branch}:${actionId}`;\n return hashBrowser(input, \"sha1\", \"hex\").slice(0, 32);\n}\n\n/**\n * @deprecated Moved to `document-model/mock`\n * (`@powerhousedao/shared/document-model/mock`) so runtime bundles no longer\n * ship zocker and faker. This stub only throws; update the import or run\n * `ph migrate`.\n */\nexport function generateMock<TSchema extends z.ZodType>(\n _schema: TSchema,\n _overrides?: Partial<z.infer<TSchema>>,\n): z.infer<TSchema> {\n throw new Error(\n 'generateMock is no longer exported from \"document-model\" or ' +\n '\"@powerhousedao/shared/document-model\". Import it from ' +\n '\"document-model/mock\" instead, or run `ph migrate` to rewrite the import.',\n );\n}\n"],"mappings":";;;AAIA,MAAa,eACX,MACA,YAAY,QACZ,WAAW,UACX,YACG;AACH,KAAI,CAAC,CAAC,OAAO,CAAC,SAAS,UAAU,CAC/B,OAAM,IAAI,MACR,qCAAqC,UAAU,oBAChD;AAGH,KAAI,CAAC,CAAC,UAAU,MAAM,CAAC,SAAS,SAAS,CACvC,OAAM,IAAI,MACR,iCAAiC,SAAS,2BAC3C;CAGH,MAAM,OAAO,cAAc,MAAM,UAAU;AAE3C,KAAI,aAAa,MACf,QAAO,gBAAgB,KAAK;AAG9B,QAAO,mBA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MvC,SAAgB,kBACd,YACA,OACA,QACA,UACQ;AAER,QAAO,YADO,GAAG,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,YACxB,QAAQ,MAAM,CAAC,MAAM,GAAG,GAAG;;;;;;;;AASvD,SAAgB,aACd,SACA,YACkB;AAClB,OAAM,IAAI,MACR,qMAGD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/shared",
|
|
3
|
-
"version": "6.2.2-dev.
|
|
3
|
+
"version": "6.2.2-dev.63",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"publishConfig": {
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
}
|
|
106
106
|
},
|
|
107
107
|
"dependencies": {
|
|
108
|
+
"cross-spawn": "7.0.6",
|
|
108
109
|
"@sindresorhus/fnv1a": "3.1.0",
|
|
109
110
|
"chalk": "5.6.2",
|
|
110
111
|
"change-case": "5.4.4",
|
|
@@ -125,6 +126,7 @@
|
|
|
125
126
|
"zod": "4.3.6"
|
|
126
127
|
},
|
|
127
128
|
"devDependencies": {
|
|
129
|
+
"@types/cross-spawn": "6.0.6",
|
|
128
130
|
"@sentry/node-core": "^10.52.0",
|
|
129
131
|
"@types/bun": "1.3.8",
|
|
130
132
|
"@types/luxon": "3.7.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index-BJU79_T5.d.ts","names":[],"sources":["../git.ts"],"mappings":";cAAa,eAAA;AAAA,iBAEG,YAAA,CAAa,GAAA;AAAA,iBAKb,WAAA,CAAY,GAAA"}
|
package/dist/mock-BcFWPQyK.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
//#region document-model/mock.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* Builds a mock value for a schema, with `overrides` taking precedence.
|
|
6
|
-
*
|
|
7
|
-
* Overridden fields are removed from the schema *before* generation rather than
|
|
8
|
-
* being overwritten afterwards. That ordering is what makes overrides usable as
|
|
9
|
-
* an escape hatch: some scalars compile to `z.custom(...)` (`AttachmentRef`,
|
|
10
|
-
* `Address`), and zocker cannot synthesise a value satisfying an arbitrary
|
|
11
|
-
* predicate — it throws. Generating first meant the throw happened before the
|
|
12
|
-
* caller's value was ever applied, so an override could not rescue the field it
|
|
13
|
-
* was written for.
|
|
14
|
-
*
|
|
15
|
-
* Only the overridden keys are skipped. A `z.custom(...)` field with no
|
|
16
|
-
* override still throws, which is correct: there is no way to invent a value
|
|
17
|
-
* for it, and the caller needs to say what it should be.
|
|
18
|
-
*/
|
|
19
|
-
declare function generateMock<TSchema extends z.ZodType>(schema: TSchema, overrides?: Partial<z.infer<TSchema>>): z.infer<TSchema>;
|
|
20
|
-
//#endregion
|
|
21
|
-
export { generateMock as t };
|
|
22
|
-
//# sourceMappingURL=mock-BcFWPQyK.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mock-BcFWPQyK.d.ts","names":[],"sources":["../document-model/mock.ts"],"mappings":";;;;;AA0BA;;;;;;;;;;;;;iBAAgB,YAAA,iBAA6B,CAAA,CAAE,OAAA,CAAA,CAC7C,MAAA,EAAQ,OAAA,EACR,SAAA,GAAY,OAAA,CAAQ,CAAA,CAAE,KAAA,CAAM,OAAA,KAC3B,CAAA,CAAE,KAAA,CAAM,OAAA"}
|
package/dist/utils-1EXU6Qr1.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//#region document-model/utils.d.ts
|
|
2
|
-
declare function generateId(method?: "UUIDv4"): string;
|
|
3
|
-
/**
|
|
4
|
-
* Derives a deterministic operation ID from stable properties.
|
|
5
|
-
*/
|
|
6
|
-
declare function deriveOperationId(documentId: string, scope: string, branch: string, actionId: string): string;
|
|
7
|
-
//#endregion
|
|
8
|
-
export { generateId as n, deriveOperationId as t };
|
|
9
|
-
//# sourceMappingURL=utils-1EXU6Qr1.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils-1EXU6Qr1.d.ts","names":[],"sources":["../document-model/utils.ts"],"mappings":";iBAGgB,UAAA,CAAW,MAAA;;;;iBAaX,iBAAA,CACd,UAAA,UACA,KAAA,UACA,MAAA,UACA,QAAA"}
|