@powerhousedao/config 6.0.0-dev.13 → 6.0.0-dev.130
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/CHANGELOG.md +1040 -2
- package/dist/src/node.d.ts +2 -2
- package/dist/src/node.d.ts.map +1 -1
- package/dist/src/node.js +3 -14
- package/dist/src/node.js.map +1 -1
- package/dist/src/powerhouse.d.ts +10 -82
- package/dist/src/powerhouse.d.ts.map +1 -1
- package/dist/src/powerhouse.js +16 -22
- package/dist/src/powerhouse.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/node.ts +3 -16
- package/src/powerhouse.ts +39 -117
- package/tsconfig.json +6 -1
package/dist/src/node.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
2
|
-
export
|
|
1
|
+
import { type PowerhouseConfig } from "@powerhousedao/shared/clis";
|
|
2
|
+
export { getConfig } from "@powerhousedao/shared/clis";
|
|
3
3
|
export declare function writeConfig(config: PowerhouseConfig, path?: string): void;
|
|
4
4
|
//# sourceMappingURL=node.d.ts.map
|
package/dist/src/node.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEnE,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,wBAAgB,WAAW,CACzB,MAAM,EAAE,gBAAgB,EACxB,IAAI,SAA6B,QAGlC"}
|
package/dist/src/node.js
CHANGED
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export
|
|
4
|
-
let config = { ...DEFAULT_CONFIG };
|
|
5
|
-
try {
|
|
6
|
-
const configStr = readFileSync(path, "utf-8");
|
|
7
|
-
const userConfig = JSON.parse(configStr);
|
|
8
|
-
config = { ...config, ...userConfig };
|
|
9
|
-
}
|
|
10
|
-
catch {
|
|
11
|
-
console.warn("No powerhouse.config.json found, using defaults");
|
|
12
|
-
}
|
|
13
|
-
return config;
|
|
14
|
-
}
|
|
1
|
+
import {} from "@powerhousedao/shared/clis";
|
|
2
|
+
import { writeFileSync } from "node:fs";
|
|
3
|
+
export { getConfig } from "@powerhousedao/shared/clis";
|
|
15
4
|
export function writeConfig(config, path = "./powerhouse.config.json") {
|
|
16
5
|
writeFileSync(path, JSON.stringify(config, null, 4));
|
|
17
6
|
}
|
package/dist/src/node.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,MAAM,4BAA4B,CAAC;AACnE,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAEvD,MAAM,UAAU,WAAW,CACzB,MAAwB,EACxB,IAAI,GAAG,0BAA0B;IAEjC,aAAa,CAAC,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;AACvD,CAAC"}
|
package/dist/src/powerhouse.d.ts
CHANGED
|
@@ -8,92 +8,20 @@ export declare const LogLevels: {
|
|
|
8
8
|
};
|
|
9
9
|
export type LogLevel = keyof typeof LogLevels;
|
|
10
10
|
export declare function isLogLevel(value: unknown): value is LogLevel;
|
|
11
|
-
|
|
12
|
-
export type PowerhousePackage
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
export type PowerhouseConfig = {
|
|
19
|
-
logLevel: LogLevel;
|
|
20
|
-
documentModelsDir: string;
|
|
21
|
-
editorsDir: string;
|
|
22
|
-
processorsDir: string;
|
|
23
|
-
subgraphsDir: string;
|
|
24
|
-
importScriptsDir: string;
|
|
25
|
-
skipFormat: boolean;
|
|
26
|
-
interactive?: boolean;
|
|
27
|
-
watch?: boolean;
|
|
28
|
-
reactor?: {
|
|
29
|
-
port?: number;
|
|
30
|
-
https?: undefined | boolean | {
|
|
31
|
-
keyPath: string;
|
|
32
|
-
certPath: string;
|
|
33
|
-
};
|
|
34
|
-
storage?: {
|
|
35
|
-
type: "filesystem" | "memory" | "postgres" | "browser";
|
|
36
|
-
filesystemPath?: string;
|
|
37
|
-
postgresUrl?: string;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
auth?: {
|
|
41
|
-
enabled?: boolean;
|
|
42
|
-
guests: string[];
|
|
43
|
-
users: string[];
|
|
44
|
-
admins: string[];
|
|
45
|
-
freeEntry?: boolean;
|
|
46
|
-
};
|
|
47
|
-
switchboard?: {
|
|
48
|
-
database?: {
|
|
49
|
-
url?: string;
|
|
50
|
-
};
|
|
51
|
-
port?: number;
|
|
52
|
-
};
|
|
53
|
-
studio?: {
|
|
54
|
-
port?: number;
|
|
55
|
-
host?: string;
|
|
56
|
-
https: boolean;
|
|
57
|
-
openBrowser?: boolean;
|
|
58
|
-
};
|
|
59
|
-
packages?: PowerhousePackage[];
|
|
60
|
-
vetra?: {
|
|
61
|
-
driveId: string;
|
|
62
|
-
driveUrl: string;
|
|
63
|
-
};
|
|
64
|
-
};
|
|
65
|
-
export declare const DEFAULT_CONFIG: PowerhouseConfig;
|
|
66
|
-
export type Module = {
|
|
67
|
-
id: string;
|
|
68
|
-
name: string;
|
|
69
|
-
documentTypes: string[];
|
|
70
|
-
};
|
|
71
|
-
export type DocumentModelModule = {
|
|
72
|
-
id: string;
|
|
73
|
-
name: string;
|
|
74
|
-
};
|
|
75
|
-
export type Publisher = {
|
|
76
|
-
name: string;
|
|
77
|
-
url: string;
|
|
78
|
-
};
|
|
79
|
-
export type PowerhouseManifest = {
|
|
80
|
-
name: string;
|
|
81
|
-
description: string;
|
|
82
|
-
category: string;
|
|
83
|
-
publisher: Publisher;
|
|
84
|
-
documentModels: DocumentModelModule[];
|
|
85
|
-
editors: Module[];
|
|
86
|
-
apps: Module[];
|
|
87
|
-
subgraphs: Module[];
|
|
88
|
-
importScripts: Module[];
|
|
89
|
-
};
|
|
90
|
-
export type PartialPowerhouseManifest = Partial<Omit<PowerhouseManifest, "publisher">> & {
|
|
91
|
-
publisher?: Partial<Publisher>;
|
|
92
|
-
};
|
|
11
|
+
import type { PowerhouseConfig } from "@powerhousedao/shared";
|
|
12
|
+
export type { PHPackageProvider, PowerhousePackage, } from "@powerhousedao/shared";
|
|
13
|
+
export type { PowerhouseConfig };
|
|
14
|
+
export declare const DEFAULT_REGISTRY_URL = "https://registry.prod.vetra.io";
|
|
15
|
+
export { DEFAULT_CONFIG } from "@powerhousedao/shared/clis";
|
|
16
|
+
export type { DocumentModelModule, Module, PartialPowerhouseManifest, PowerhouseManifest, Publisher, } from "@powerhousedao/shared";
|
|
93
17
|
export type VetraProcessorConfigType = {
|
|
94
18
|
interactive?: boolean;
|
|
95
19
|
driveUrl: string;
|
|
96
20
|
driveId: string;
|
|
97
21
|
};
|
|
22
|
+
export declare function resolveRegistryConfig(config: PowerhouseConfig, env?: Record<string, string | undefined>): {
|
|
23
|
+
registryUrl: string | undefined;
|
|
24
|
+
packageNames: string[];
|
|
25
|
+
};
|
|
98
26
|
export declare const VETRA_PROCESSOR_CONFIG_KEY = "VetraConfig";
|
|
99
27
|
//# sourceMappingURL=powerhouse.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powerhouse.d.ts","sourceRoot":"","sources":["../../src/powerhouse.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,SAAS,CAAC;AAE9C,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE5D;AACD,
|
|
1
|
+
{"version":3,"file":"powerhouse.d.ts","sourceRoot":"","sources":["../../src/powerhouse.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS;;;;;;;CAOZ,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,MAAM,OAAO,SAAS,CAAC;AAE9C,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,QAAQ,CAE5D;AACD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,YAAY,EACV,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAC/B,YAAY,EAAE,gBAAgB,EAAE,CAAC;AAEjC,eAAO,MAAM,oBAAoB,mCAAmC,CAAC;AAErE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAE5D,YAAY,EACV,mBAAmB,EACnB,MAAM,EACN,yBAAyB,EACzB,kBAAkB,EAClB,SAAS,GACV,MAAM,uBAAuB,CAAC;AAE/B,MAAM,MAAM,wBAAwB,GAAG;IACrC,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,wBAAgB,qBAAqB,CACnC,MAAM,EAAE,gBAAgB,EACxB,GAAG,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAM,GAC3C;IACD,WAAW,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB,CAgBA;AAED,eAAO,MAAM,0BAA0B,gBAAgB,CAAC"}
|
package/dist/src/powerhouse.js
CHANGED
|
@@ -9,27 +9,21 @@ export const LogLevels = {
|
|
|
9
9
|
export function isLogLevel(value) {
|
|
10
10
|
return typeof value === "string" && value in LogLevels;
|
|
11
11
|
}
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
enabled: false,
|
|
29
|
-
guests: [],
|
|
30
|
-
users: [],
|
|
31
|
-
admins: [],
|
|
32
|
-
},
|
|
33
|
-
};
|
|
12
|
+
export const DEFAULT_REGISTRY_URL = "https://registry.prod.vetra.io";
|
|
13
|
+
export { DEFAULT_CONFIG } from "@powerhousedao/shared/clis";
|
|
14
|
+
export function resolveRegistryConfig(config, env = {}) {
|
|
15
|
+
let registryUrl = config.packageRegistryUrl;
|
|
16
|
+
let packageNames = config.packages
|
|
17
|
+
?.filter((p) => p.provider === "registry")
|
|
18
|
+
.map((p) => p.packageName) ?? [];
|
|
19
|
+
// Env vars override config
|
|
20
|
+
if (env.PH_REGISTRY_URL) {
|
|
21
|
+
registryUrl = env.PH_REGISTRY_URL;
|
|
22
|
+
}
|
|
23
|
+
if (env.PH_REGISTRY_PACKAGES) {
|
|
24
|
+
packageNames = env.PH_REGISTRY_PACKAGES.split(",").map((p) => p.trim());
|
|
25
|
+
}
|
|
26
|
+
return { registryUrl, packageNames };
|
|
27
|
+
}
|
|
34
28
|
export const VETRA_PROCESSOR_CONFIG_KEY = "VetraConfig";
|
|
35
29
|
//# sourceMappingURL=powerhouse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"powerhouse.js","sourceRoot":"","sources":["../../src/powerhouse.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IAC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