@powerhousedao/config 6.2.1-dev.6 → 6.2.2-dev.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -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 +5 -2
- package/CHANGELOG.md +0 -5665
- package/src/index.ts +0 -2
- package/src/node.ts +0 -10
- package/src/packages.ts +0 -10
- package/src/powerhouse.ts +0 -64
- package/tsconfig.json +0 -14
- package/tsdown.config.ts +0 -13
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DEFAULT_CONFIG, DEFAULT_REGISTRY_URL } 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
|
+
type VetraProcessorConfigType = {
|
|
16
|
+
interactive?: boolean;
|
|
17
|
+
driveUrl: string;
|
|
18
|
+
driveId: string;
|
|
19
|
+
};
|
|
20
|
+
declare function resolveRegistryConfig(config: PowerhouseConfig, env?: Record<string, string | undefined>): {
|
|
21
|
+
registryUrl: string | undefined;
|
|
22
|
+
packageNames: string[];
|
|
23
|
+
};
|
|
24
|
+
declare const VETRA_PROCESSOR_CONFIG_KEY = "VetraConfig";
|
|
25
|
+
//#endregion
|
|
26
|
+
//#region src/packages.d.ts
|
|
27
|
+
declare const PH_PACKAGES: PowerhousePackage[];
|
|
28
|
+
//#endregion
|
|
29
|
+
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 };
|
|
30
|
+
//# 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,KAsBzC,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;;;cC7DA,WAAA,EAAa,iBAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { DEFAULT_CONFIG, DEFAULT_REGISTRY_URL } 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
|
+
function resolveRegistryConfig(config, env = {}) {
|
|
23
|
+
let registryUrl = config.packageRegistryUrl;
|
|
24
|
+
let packageNames = config.packages?.filter((p) => p.provider === "registry").map((p) => p.packageName) ?? [];
|
|
25
|
+
if (env.PH_REGISTRY_URL) registryUrl = env.PH_REGISTRY_URL;
|
|
26
|
+
if (env.PH_REGISTRY_PACKAGES) packageNames = env.PH_REGISTRY_PACKAGES.split(",").map((p) => p.trim());
|
|
27
|
+
return {
|
|
28
|
+
registryUrl,
|
|
29
|
+
packageNames
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
const VETRA_PROCESSOR_CONFIG_KEY = "VetraConfig";
|
|
33
|
+
//#endregion
|
|
34
|
+
export { DEFAULT_CONFIG, DEFAULT_REGISTRY_URL, LogLevels, PH_PACKAGES, VETRA_PROCESSOR_CONFIG_KEY, isLogLevel, resolveRegistryConfig };
|
|
35
|
+
|
|
36
|
+
//# 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 {\n DEFAULT_CONFIG,\n DEFAULT_REGISTRY_URL,\n} 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;;AA2B/C,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.2.
|
|
3
|
+
"version": "6.2.2-dev.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"private": false,
|
|
@@ -10,6 +10,9 @@
|
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/powerhouse-inc/powerhouse"
|
|
12
12
|
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
13
16
|
"exports": {
|
|
14
17
|
".": {
|
|
15
18
|
"source": "./src/index.ts",
|
|
@@ -27,7 +30,7 @@
|
|
|
27
30
|
"access": "public"
|
|
28
31
|
},
|
|
29
32
|
"dependencies": {
|
|
30
|
-
"@powerhousedao/shared": "6.2.
|
|
33
|
+
"@powerhousedao/shared": "6.2.2-dev.0"
|
|
31
34
|
},
|
|
32
35
|
"devDependencies": {
|
|
33
36
|
"tsdown": "0.21.1"
|