@powerhousedao/config 6.0.0-dev.17 → 6.0.0-dev.171
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 +1300 -2
- package/dist/index.d.ts +31 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +37 -0
- package/dist/index.js.map +1 -0
- package/dist/node.d.ts +7 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +10 -0
- package/dist/node.js.map +1 -0
- package/package.json +11 -7
- package/src/node.ts +3 -16
- package/src/powerhouse.ts +38 -117
- package/tsconfig.json +6 -1
- package/tsdown.config.ts +10 -0
- package/dist/src/index.d.ts +0 -3
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -3
- package/dist/src/index.js.map +0 -1
- package/dist/src/node.d.ts +0 -4
- package/dist/src/node.d.ts.map +0 -1
- package/dist/src/node.js +0 -18
- package/dist/src/node.js.map +0 -1
- package/dist/src/packages.d.ts +0 -3
- package/dist/src/packages.d.ts.map +0 -1
- package/dist/src/packages.js +0 -9
- package/dist/src/packages.js.map +0 -1
- package/dist/src/powerhouse.d.ts +0 -99
- package/dist/src/powerhouse.d.ts.map +0 -1
- package/dist/src/powerhouse.js +0 -35
- package/dist/src/powerhouse.js.map +0 -1
- package/dist/tsconfig.tsbuildinfo +0 -1
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { DEFAULT_CONFIG } from "@powerhousedao/shared/clis";
|
|
2
|
+
import { DocumentModelModule, Manifest, PHPackageProvider, PowerhouseConfig, PowerhouseModule, PowerhousePackage, Publisher } from "@powerhousedao/shared";
|
|
3
|
+
|
|
4
|
+
//#region src/powerhouse.d.ts
|
|
5
|
+
declare const LogLevels: {
|
|
6
|
+
readonly verbose: 1;
|
|
7
|
+
readonly debug: 2;
|
|
8
|
+
readonly info: 3;
|
|
9
|
+
readonly warn: 4;
|
|
10
|
+
readonly error: 5;
|
|
11
|
+
readonly silent: 6;
|
|
12
|
+
};
|
|
13
|
+
type LogLevel = keyof typeof LogLevels;
|
|
14
|
+
declare function isLogLevel(value: unknown): value is LogLevel;
|
|
15
|
+
declare const DEFAULT_REGISTRY_URL = "https://registry.prod.vetra.io";
|
|
16
|
+
type VetraProcessorConfigType = {
|
|
17
|
+
interactive?: boolean;
|
|
18
|
+
driveUrl: string;
|
|
19
|
+
driveId: string;
|
|
20
|
+
};
|
|
21
|
+
declare function resolveRegistryConfig(config: PowerhouseConfig, env?: Record<string, string | undefined>): {
|
|
22
|
+
registryUrl: string | undefined;
|
|
23
|
+
packageNames: string[];
|
|
24
|
+
};
|
|
25
|
+
declare const VETRA_PROCESSOR_CONFIG_KEY = "VetraConfig";
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/packages.d.ts
|
|
28
|
+
declare const PH_PACKAGES: PowerhousePackage[];
|
|
29
|
+
//#endregion
|
|
30
|
+
export { DEFAULT_CONFIG, DEFAULT_REGISTRY_URL, type DocumentModelModule, LogLevel, LogLevels, type Manifest, type PHPackageProvider, PH_PACKAGES, type PowerhouseConfig, type PowerhouseModule, type PowerhousePackage, type Publisher, VETRA_PROCESSOR_CONFIG_KEY, VetraProcessorConfigType, isLogLevel, resolveRegistryConfig };
|
|
31
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":[],"sources":["../src/powerhouse.ts","../src/packages.ts"],"mappings":";;;;cAAa,SAAA;EAAA;;;;;;;KASD,QAAA,gBAAwB,SAAA;AAAA,iBAEpB,UAAA,CAAW,KAAA,YAAiB,KAAA,IAAS,QAAA;AAAA,cAUxC,oBAAA;AAAA,KAWD,wBAAA;EACV,WAAA;EACA,QAAA;EACA,OAAA;AAAA;AAAA,iBAGc,qBAAA,CACd,MAAA,EAAQ,gBAAA,EACR,GAAA,GAAK,MAAA;EAEL,WAAA;EACA,YAAA;AAAA;AAAA,cAmBW,0BAAA;;;cC5DA,WAAA,EAAa,iBAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { DEFAULT_CONFIG } from "@powerhousedao/shared/clis";
|
|
2
|
+
//#region src/packages.ts
|
|
3
|
+
const PH_PACKAGES = [{
|
|
4
|
+
packageName: "@sky-ph/atlas",
|
|
5
|
+
version: "latest",
|
|
6
|
+
provider: "npm",
|
|
7
|
+
url: "https://www.npmjs.com/package/@sky-ph/atlas"
|
|
8
|
+
}];
|
|
9
|
+
//#endregion
|
|
10
|
+
//#region src/powerhouse.ts
|
|
11
|
+
const LogLevels = {
|
|
12
|
+
verbose: 1,
|
|
13
|
+
debug: 2,
|
|
14
|
+
info: 3,
|
|
15
|
+
warn: 4,
|
|
16
|
+
error: 5,
|
|
17
|
+
silent: 6
|
|
18
|
+
};
|
|
19
|
+
function isLogLevel(value) {
|
|
20
|
+
return typeof value === "string" && value in LogLevels;
|
|
21
|
+
}
|
|
22
|
+
const DEFAULT_REGISTRY_URL = "https://registry.prod.vetra.io";
|
|
23
|
+
function resolveRegistryConfig(config, env = {}) {
|
|
24
|
+
let registryUrl = config.packageRegistryUrl;
|
|
25
|
+
let packageNames = config.packages?.filter((p) => p.provider === "registry").map((p) => p.packageName) ?? [];
|
|
26
|
+
if (env.PH_REGISTRY_URL) registryUrl = env.PH_REGISTRY_URL;
|
|
27
|
+
if (env.PH_REGISTRY_PACKAGES) packageNames = env.PH_REGISTRY_PACKAGES.split(",").map((p) => p.trim());
|
|
28
|
+
return {
|
|
29
|
+
registryUrl,
|
|
30
|
+
packageNames
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
const VETRA_PROCESSOR_CONFIG_KEY = "VetraConfig";
|
|
34
|
+
//#endregion
|
|
35
|
+
export { DEFAULT_CONFIG, DEFAULT_REGISTRY_URL, LogLevels, PH_PACKAGES, VETRA_PROCESSOR_CONFIG_KEY, isLogLevel, resolveRegistryConfig };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/packages.ts","../src/powerhouse.ts"],"sourcesContent":["import type { PowerhousePackage } from \"./powerhouse.js\";\n\nexport const PH_PACKAGES: PowerhousePackage[] = [\n {\n packageName: \"@sky-ph/atlas\",\n version: \"latest\",\n provider: \"npm\",\n url: \"https://www.npmjs.com/package/@sky-ph/atlas\",\n },\n];\n","export const LogLevels = {\n verbose: 1,\n debug: 2,\n info: 3,\n warn: 4,\n error: 5,\n silent: 6,\n} as const;\n\nexport type LogLevel = keyof typeof LogLevels;\n\nexport function isLogLevel(value: unknown): value is LogLevel {\n return typeof value === \"string\" && value in LogLevels;\n}\nimport type { PowerhouseConfig } from \"@powerhousedao/shared\";\nexport type {\n PHPackageProvider,\n PowerhousePackage,\n} from \"@powerhousedao/shared\";\nexport type { PowerhouseConfig };\n\nexport const DEFAULT_REGISTRY_URL = \"https://registry.prod.vetra.io\";\n\nexport { DEFAULT_CONFIG } from \"@powerhousedao/shared/clis\";\n\nexport type {\n DocumentModelModule,\n Manifest,\n PowerhouseModule,\n Publisher,\n} from \"@powerhousedao/shared\";\n\nexport type VetraProcessorConfigType = {\n interactive?: boolean;\n driveUrl: string;\n driveId: string;\n};\n\nexport function resolveRegistryConfig(\n config: PowerhouseConfig,\n env: Record<string, string | undefined> = {},\n): {\n registryUrl: string | undefined;\n packageNames: string[];\n} {\n let registryUrl = config.packageRegistryUrl;\n let packageNames =\n config.packages\n ?.filter((p) => p.provider === \"registry\")\n .map((p) => p.packageName) ?? [];\n\n // Env vars override config\n if (env.PH_REGISTRY_URL) {\n registryUrl = env.PH_REGISTRY_URL;\n }\n if (env.PH_REGISTRY_PACKAGES) {\n packageNames = env.PH_REGISTRY_PACKAGES.split(\",\").map((p) => p.trim());\n }\n\n return { registryUrl, packageNames };\n}\n\nexport const VETRA_PROCESSOR_CONFIG_KEY = \"VetraConfig\";\n"],"mappings":";;AAEA,MAAa,cAAmC,CAC9C;CACE,aAAa;CACb,SAAS;CACT,UAAU;CACV,KAAK;CACN,CACF;;;ACTD,MAAa,YAAY;CACvB,SAAS;CACT,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO;CACP,QAAQ;CACT;AAID,SAAgB,WAAW,OAAmC;AAC5D,QAAO,OAAO,UAAU,YAAY,SAAS;;AAS/C,MAAa,uBAAuB;AAiBpC,SAAgB,sBACd,QACA,MAA0C,EAAE,EAI5C;CACA,IAAI,cAAc,OAAO;CACzB,IAAI,eACF,OAAO,UACH,QAAQ,MAAM,EAAE,aAAa,WAAW,CACzC,KAAK,MAAM,EAAE,YAAY,IAAI,EAAE;AAGpC,KAAI,IAAI,gBACN,eAAc,IAAI;AAEpB,KAAI,IAAI,qBACN,gBAAe,IAAI,qBAAqB,MAAM,IAAI,CAAC,KAAK,MAAM,EAAE,MAAM,CAAC;AAGzE,QAAO;EAAE;EAAa;EAAc;;AAGtC,MAAa,6BAA6B"}
|
package/dist/node.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { PowerhouseConfig, getConfig } from "@powerhousedao/shared/clis";
|
|
2
|
+
|
|
3
|
+
//#region src/node.d.ts
|
|
4
|
+
declare function writeConfig(config: PowerhouseConfig, path?: string): void;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { getConfig, writeConfig };
|
|
7
|
+
//# sourceMappingURL=node.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","names":[],"sources":["../src/node.ts"],"mappings":";;;iBAIgB,WAAA,CACd,MAAA,EAAQ,gBAAA,EACR,IAAA"}
|
package/dist/node.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { getConfig } from "@powerhousedao/shared/clis";
|
|
2
|
+
import { writeFileSync } from "node:fs";
|
|
3
|
+
//#region src/node.ts
|
|
4
|
+
function writeConfig(config, path = "./powerhouse.config.json") {
|
|
5
|
+
writeFileSync(path, JSON.stringify(config, null, 4));
|
|
6
|
+
}
|
|
7
|
+
//#endregion
|
|
8
|
+
export { getConfig, writeConfig };
|
|
9
|
+
|
|
10
|
+
//# sourceMappingURL=node.js.map
|
package/dist/node.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.js","names":[],"sources":["../src/node.ts"],"sourcesContent":["import { type PowerhouseConfig } from \"@powerhousedao/shared/clis\";\nimport { writeFileSync } from \"node:fs\";\nexport { getConfig } from \"@powerhousedao/shared/clis\";\n\nexport function writeConfig(\n config: PowerhouseConfig,\n path = \"./powerhouse.config.json\",\n) {\n writeFileSync(path, JSON.stringify(config, null, 4));\n}\n"],"mappings":";;;AAIA,SAAgB,YACd,QACA,OAAO,4BACP;AACA,eAAc,MAAM,KAAK,UAAU,QAAQ,MAAM,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/config",
|
|
3
|
-
"version": "6.0.0-dev.
|
|
3
|
+
"version": "6.0.0-dev.171",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"private": false,
|
|
@@ -11,22 +11,26 @@
|
|
|
11
11
|
},
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
16
|
},
|
|
17
17
|
"./node": {
|
|
18
|
-
"
|
|
19
|
-
"
|
|
18
|
+
"types": "./dist/node.d.ts",
|
|
19
|
+
"import": "./dist/node.js"
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
"types": "./dist/
|
|
22
|
+
"types": "./dist/index.d.ts",
|
|
23
23
|
"publishConfig": {
|
|
24
24
|
"access": "public"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@
|
|
27
|
+
"@powerhousedao/shared": "6.0.0-dev.171"
|
|
28
|
+
},
|
|
29
|
+
"devDependencies": {
|
|
30
|
+
"tsdown": "0.21.0"
|
|
28
31
|
},
|
|
29
32
|
"scripts": {
|
|
33
|
+
"build": "tsdown",
|
|
30
34
|
"tsc": "tsc",
|
|
31
35
|
"lint": "eslint"
|
|
32
36
|
}
|
package/src/node.ts
CHANGED
|
@@ -1,19 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
export function getConfig(path = "./powerhouse.config.json") {
|
|
6
|
-
let config: PowerhouseConfig = { ...DEFAULT_CONFIG };
|
|
7
|
-
try {
|
|
8
|
-
const configStr = readFileSync(path, "utf-8");
|
|
9
|
-
const userConfig = JSON.parse(configStr) as PowerhouseConfig;
|
|
10
|
-
config = { ...config, ...userConfig };
|
|
11
|
-
} catch {
|
|
12
|
-
console.warn("No powerhouse.config.json found, using defaults");
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return config;
|
|
16
|
-
}
|
|
1
|
+
import { type PowerhouseConfig } from "@powerhousedao/shared/clis";
|
|
2
|
+
import { writeFileSync } from "node:fs";
|
|
3
|
+
export { getConfig } from "@powerhousedao/shared/clis";
|
|
17
4
|
|
|
18
5
|
export function writeConfig(
|
|
19
6
|
config: PowerhouseConfig,
|
package/src/powerhouse.ts
CHANGED
|
@@ -12,126 +12,23 @@ export type LogLevel = keyof typeof LogLevels;
|
|
|
12
12
|
export function isLogLevel(value: unknown): value is LogLevel {
|
|
13
13
|
return typeof value === "string" && value in LogLevels;
|
|
14
14
|
}
|
|
15
|
-
|
|
15
|
+
import type { PowerhouseConfig } from "@powerhousedao/shared";
|
|
16
|
+
export type {
|
|
17
|
+
PHPackageProvider,
|
|
18
|
+
PowerhousePackage,
|
|
19
|
+
} from "@powerhousedao/shared";
|
|
20
|
+
export type { PowerhouseConfig };
|
|
16
21
|
|
|
17
|
-
export
|
|
18
|
-
packageName: string;
|
|
19
|
-
version?: string;
|
|
20
|
-
provider?: PHPackageProvider;
|
|
21
|
-
url?: string;
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type PowerhouseConfig = {
|
|
25
|
-
// required
|
|
26
|
-
logLevel: LogLevel;
|
|
27
|
-
documentModelsDir: string;
|
|
28
|
-
editorsDir: string;
|
|
29
|
-
processorsDir: string;
|
|
30
|
-
subgraphsDir: string;
|
|
31
|
-
importScriptsDir: string;
|
|
32
|
-
skipFormat: boolean;
|
|
33
|
-
|
|
34
|
-
// optional
|
|
35
|
-
interactive?: boolean;
|
|
36
|
-
watch?: boolean;
|
|
37
|
-
reactor?: {
|
|
38
|
-
port?: number;
|
|
39
|
-
https?:
|
|
40
|
-
| undefined
|
|
41
|
-
| boolean
|
|
42
|
-
| {
|
|
43
|
-
keyPath: string;
|
|
44
|
-
certPath: string;
|
|
45
|
-
};
|
|
46
|
-
storage?: {
|
|
47
|
-
type: "filesystem" | "memory" | "postgres" | "browser";
|
|
48
|
-
filesystemPath?: string;
|
|
49
|
-
postgresUrl?: string;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
auth?: {
|
|
53
|
-
enabled?: boolean;
|
|
54
|
-
guests: string[];
|
|
55
|
-
users: string[];
|
|
56
|
-
admins: string[];
|
|
57
|
-
freeEntry?: boolean;
|
|
58
|
-
};
|
|
59
|
-
switchboard?: {
|
|
60
|
-
database?: {
|
|
61
|
-
url?: string;
|
|
62
|
-
};
|
|
63
|
-
port?: number;
|
|
64
|
-
};
|
|
65
|
-
studio?: {
|
|
66
|
-
port?: number;
|
|
67
|
-
host?: string;
|
|
68
|
-
https: boolean;
|
|
69
|
-
openBrowser?: boolean;
|
|
70
|
-
};
|
|
71
|
-
packages?: PowerhousePackage[];
|
|
72
|
-
vetra?: {
|
|
73
|
-
driveId: string;
|
|
74
|
-
driveUrl: string;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
|
|
78
|
-
const DEFAULT_DOCUMENT_MODELS_DIR = "./document-models";
|
|
79
|
-
const DEFAULT_EDITORS_DIR = "./editors";
|
|
80
|
-
const DEFAULT_PROCESSORS_DIR = "./processors";
|
|
81
|
-
const DEFAULT_SUBGRAPHS_DIR = "./subgraphs";
|
|
82
|
-
const DEFAULT_IMPORT_SCRIPTS_DIR = "./scripts";
|
|
83
|
-
const DEFAULT_SKIP_FORMAT = false;
|
|
84
|
-
const DEFAULT_LOG_LEVEL = "info";
|
|
85
|
-
|
|
86
|
-
export const DEFAULT_CONFIG: PowerhouseConfig = {
|
|
87
|
-
documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,
|
|
88
|
-
editorsDir: DEFAULT_EDITORS_DIR,
|
|
89
|
-
processorsDir: DEFAULT_PROCESSORS_DIR,
|
|
90
|
-
subgraphsDir: DEFAULT_SUBGRAPHS_DIR,
|
|
91
|
-
importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,
|
|
92
|
-
skipFormat: DEFAULT_SKIP_FORMAT,
|
|
93
|
-
logLevel: DEFAULT_LOG_LEVEL,
|
|
94
|
-
auth: {
|
|
95
|
-
enabled: false,
|
|
96
|
-
guests: [],
|
|
97
|
-
users: [],
|
|
98
|
-
admins: [],
|
|
99
|
-
},
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
export type Module = {
|
|
103
|
-
id: string;
|
|
104
|
-
name: string;
|
|
105
|
-
documentTypes: string[];
|
|
106
|
-
};
|
|
22
|
+
export const DEFAULT_REGISTRY_URL = "https://registry.prod.vetra.io";
|
|
107
23
|
|
|
108
|
-
export
|
|
109
|
-
id: string;
|
|
110
|
-
name: string;
|
|
111
|
-
};
|
|
24
|
+
export { DEFAULT_CONFIG } from "@powerhousedao/shared/clis";
|
|
112
25
|
|
|
113
|
-
export type
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
name: string;
|
|
120
|
-
description: string;
|
|
121
|
-
category: string;
|
|
122
|
-
publisher: Publisher;
|
|
123
|
-
documentModels: DocumentModelModule[];
|
|
124
|
-
editors: Module[];
|
|
125
|
-
apps: Module[];
|
|
126
|
-
subgraphs: Module[];
|
|
127
|
-
importScripts: Module[];
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
export type PartialPowerhouseManifest = Partial<
|
|
131
|
-
Omit<PowerhouseManifest, "publisher">
|
|
132
|
-
> & {
|
|
133
|
-
publisher?: Partial<Publisher>;
|
|
134
|
-
};
|
|
26
|
+
export type {
|
|
27
|
+
DocumentModelModule,
|
|
28
|
+
Manifest,
|
|
29
|
+
PowerhouseModule,
|
|
30
|
+
Publisher,
|
|
31
|
+
} from "@powerhousedao/shared";
|
|
135
32
|
|
|
136
33
|
export type VetraProcessorConfigType = {
|
|
137
34
|
interactive?: boolean;
|
|
@@ -139,4 +36,28 @@ export type VetraProcessorConfigType = {
|
|
|
139
36
|
driveId: string;
|
|
140
37
|
};
|
|
141
38
|
|
|
39
|
+
export function resolveRegistryConfig(
|
|
40
|
+
config: PowerhouseConfig,
|
|
41
|
+
env: Record<string, string | undefined> = {},
|
|
42
|
+
): {
|
|
43
|
+
registryUrl: string | undefined;
|
|
44
|
+
packageNames: string[];
|
|
45
|
+
} {
|
|
46
|
+
let registryUrl = config.packageRegistryUrl;
|
|
47
|
+
let packageNames =
|
|
48
|
+
config.packages
|
|
49
|
+
?.filter((p) => p.provider === "registry")
|
|
50
|
+
.map((p) => p.packageName) ?? [];
|
|
51
|
+
|
|
52
|
+
// Env vars override config
|
|
53
|
+
if (env.PH_REGISTRY_URL) {
|
|
54
|
+
registryUrl = env.PH_REGISTRY_URL;
|
|
55
|
+
}
|
|
56
|
+
if (env.PH_REGISTRY_PACKAGES) {
|
|
57
|
+
packageNames = env.PH_REGISTRY_PACKAGES.split(",").map((p) => p.trim());
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
return { registryUrl, packageNames };
|
|
61
|
+
}
|
|
62
|
+
|
|
142
63
|
export const VETRA_PROCESSOR_CONFIG_KEY = "VetraConfig";
|
package/tsconfig.json
CHANGED
package/tsdown.config.ts
ADDED
package/dist/src/index.d.ts
DELETED
package/dist/src/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
package/dist/src/index.js
DELETED
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC"}
|
package/dist/src/node.d.ts
DELETED
package/dist/src/node.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,wBAAgB,SAAS,CAAC,IAAI,SAA6B,oBAW1D;AAED,wBAAgB,WAAW,CACzB,MAAM,EAAE,gBAAgB,EACxB,IAAI,SAA6B,QAGlC"}
|
package/dist/src/node.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import { DEFAULT_CONFIG } from "./powerhouse.js";
|
|
3
|
-
export function getConfig(path = "./powerhouse.config.json") {
|
|
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
|
-
}
|
|
15
|
-
export function writeConfig(config, path = "./powerhouse.config.json") {
|
|
16
|
-
writeFileSync(path, JSON.stringify(config, null, 4));
|
|
17
|
-
}
|
|
18
|
-
//# sourceMappingURL=node.js.map
|
package/dist/src/node.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"node.js","sourceRoot":"","sources":["../../src/node.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAEtD,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,UAAU,SAAS,CAAC,IAAI,GAAG,0BAA0B;IACzD,IAAI,MAAM,GAAqB,EAAE,GAAG,cAAc,EAAE,CAAC;IACrD,IAAI,CAAC;QACH,MAAM,SAAS,GAAG,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC9C,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,SAAS,CAAqB,CAAC;QAC7D,MAAM,GAAG,EAAE,GAAG,MAAM,EAAE,GAAG,UAAU,EAAE,CAAC;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,IAAI,CAAC,iDAAiD,CAAC,CAAC;IAClE,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,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/packages.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packages.d.ts","sourceRoot":"","sources":["../../src/packages.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAEzD,eAAO,MAAM,WAAW,EAAE,iBAAiB,EAO1C,CAAC"}
|
package/dist/src/packages.js
DELETED
package/dist/src/packages.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packages.js","sourceRoot":"","sources":["../../src/packages.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAwB;IAC9C;QACE,WAAW,EAAE,eAAe;QAC5B,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,KAAK;QACf,GAAG,EAAE,6CAA6C;KACnD;CACF,CAAC"}
|
package/dist/src/powerhouse.d.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
export declare const LogLevels: {
|
|
2
|
-
readonly verbose: 1;
|
|
3
|
-
readonly debug: 2;
|
|
4
|
-
readonly info: 3;
|
|
5
|
-
readonly warn: 4;
|
|
6
|
-
readonly error: 5;
|
|
7
|
-
readonly silent: 6;
|
|
8
|
-
};
|
|
9
|
-
export type LogLevel = keyof typeof LogLevels;
|
|
10
|
-
export declare function isLogLevel(value: unknown): value is LogLevel;
|
|
11
|
-
export type PHPackageProvider = "npm" | "github" | "local";
|
|
12
|
-
export type PowerhousePackage = {
|
|
13
|
-
packageName: string;
|
|
14
|
-
version?: string;
|
|
15
|
-
provider?: PHPackageProvider;
|
|
16
|
-
url?: string;
|
|
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
|
-
};
|
|
93
|
-
export type VetraProcessorConfigType = {
|
|
94
|
-
interactive?: boolean;
|
|
95
|
-
driveUrl: string;
|
|
96
|
-
driveId: string;
|
|
97
|
-
};
|
|
98
|
-
export declare const VETRA_PROCESSOR_CONFIG_KEY = "VetraConfig";
|
|
99
|
-
//# sourceMappingURL=powerhouse.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"powerhouse.d.ts","sourceRoot":"","sources":["../../src/powerhouse.ts"],"names":[],"mappings":"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"}
|
package/dist/src/powerhouse.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
export const LogLevels = {
|
|
2
|
-
verbose: 1,
|
|
3
|
-
debug: 2,
|
|
4
|
-
info: 3,
|
|
5
|
-
warn: 4,
|
|
6
|
-
error: 5,
|
|
7
|
-
silent: 6,
|
|
8
|
-
};
|
|
9
|
-
export function isLogLevel(value) {
|
|
10
|
-
return typeof value === "string" && value in LogLevels;
|
|
11
|
-
}
|
|
12
|
-
const DEFAULT_DOCUMENT_MODELS_DIR = "./document-models";
|
|
13
|
-
const DEFAULT_EDITORS_DIR = "./editors";
|
|
14
|
-
const DEFAULT_PROCESSORS_DIR = "./processors";
|
|
15
|
-
const DEFAULT_SUBGRAPHS_DIR = "./subgraphs";
|
|
16
|
-
const DEFAULT_IMPORT_SCRIPTS_DIR = "./scripts";
|
|
17
|
-
const DEFAULT_SKIP_FORMAT = false;
|
|
18
|
-
const DEFAULT_LOG_LEVEL = "info";
|
|
19
|
-
export const DEFAULT_CONFIG = {
|
|
20
|
-
documentModelsDir: DEFAULT_DOCUMENT_MODELS_DIR,
|
|
21
|
-
editorsDir: DEFAULT_EDITORS_DIR,
|
|
22
|
-
processorsDir: DEFAULT_PROCESSORS_DIR,
|
|
23
|
-
subgraphsDir: DEFAULT_SUBGRAPHS_DIR,
|
|
24
|
-
importScriptsDir: DEFAULT_IMPORT_SCRIPTS_DIR,
|
|
25
|
-
skipFormat: DEFAULT_SKIP_FORMAT,
|
|
26
|
-
logLevel: DEFAULT_LOG_LEVEL,
|
|
27
|
-
auth: {
|
|
28
|
-
enabled: false,
|
|
29
|
-
guests: [],
|
|
30
|
-
users: [],
|
|
31
|
-
admins: [],
|
|
32
|
-
},
|
|
33
|
-
};
|
|
34
|
-
export const VETRA_PROCESSOR_CONFIG_KEY = "VetraConfig";
|
|
35
|
-
//# sourceMappingURL=powerhouse.js.map
|
|
@@ -1 +0,0 @@
|
|
|
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;IACR,MAAM,EAAE,CAAC;CACD,CAAC;AAIX,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,IAAI,SAAS,CAAC;AACzD,CAAC;AAgED,MAAM,2BAA2B,GAAG,mBAAmB,CAAC;AACxD,MAAM,mBAAmB,GAAG,WAAW,CAAC;AACxC,MAAM,sBAAsB,GAAG,cAAc,CAAC;AAC9C,MAAM,qBAAqB,GAAG,aAAa,CAAC;AAC5C,MAAM,0BAA0B,GAAG,WAAW,CAAC;AAC/C,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAClC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AAEjC,MAAM,CAAC,MAAM,cAAc,GAAqB;IAC9C,iBAAiB,EAAE,2BAA2B;IAC9C,UAAU,EAAE,mBAAmB;IAC/B,aAAa,EAAE,sBAAsB;IACrC,YAAY,EAAE,qBAAqB;IACnC,gBAAgB,EAAE,0BAA0B;IAC5C,UAAU,EAAE,mBAAmB;IAC/B,QAAQ,EAAE,iBAAiB;IAC3B,IAAI,EAAE;QACJ,OAAO,EAAE,KAAK;QACd,MAAM,EAAE,EAAE;QACV,KAAK,EAAE,EAAE;QACT,MAAM,EAAE,EAAE;KACX;CACF,CAAC;AA0CF,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAC"}
|