@powerhousedao/config 1.12.0 → 1.14.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/CHANGELOG.md CHANGED
@@ -1,3 +1,33 @@
1
+ ## 1.14.0 (2025-01-24)
2
+
3
+ ### 🚀 Features
4
+
5
+ - **reactor-local:** load document models from installed packages ([3d434fd7](https://github.com/powerhouse-inc/powerhouse/commit/3d434fd7))
6
+ - **config:** allow passing path to read config ([f3923c01](https://github.com/powerhouse-inc/powerhouse/commit/f3923c01))
7
+ - **ph-cli:** use getConfig in connect command ([#917](https://github.com/powerhouse-inc/powerhouse/pull/917))
8
+ - **ph-cli:** trigger release ([6624a561](https://github.com/powerhouse-inc/powerhouse/commit/6624a561))
9
+
10
+ ### 🩹 Fixes
11
+
12
+ - **ph-cmd:** read version from package.json ([#920](https://github.com/powerhouse-inc/powerhouse/pull/920))
13
+ - **ph-cli:** update connect dep ([#919](https://github.com/powerhouse-inc/powerhouse/pull/919))
14
+
15
+ ### ❤️ Thank You
16
+
17
+ - acaldas
18
+ - Frank @froid1911
19
+ - Guillermo Puente Sandoval
20
+
21
+ ## 1.13.0 (2025-01-23)
22
+
23
+ ### 🚀 Features
24
+
25
+ - push release ([642449fb](https://github.com/powerhouse-inc/powerhouse/commit/642449fb))
26
+
27
+ ### ❤️ Thank You
28
+
29
+ - Frank @froid1911
30
+
1
31
  ## 1.12.0 (2025-01-23)
2
32
 
3
33
  ### 🚀 Features
@@ -215,7 +215,7 @@ declare const designSystemPreset: {
215
215
  export { designSystemPreset }
216
216
  export { designSystemPreset as designSystemPreset_alias_1 }
217
217
 
218
- export declare function getConfig(): PowerhouseConfig;
218
+ export declare function getConfig(path?: string): PowerhouseConfig;
219
219
 
220
220
  export declare type PowerhouseConfig = {
221
221
  documentModelsDir: string;
@@ -239,6 +239,6 @@ export declare type PowerhouseConfig = {
239
239
  }[];
240
240
  };
241
241
 
242
- export declare function writeConfig(config: PowerhouseConfig): void;
242
+ export declare function writeConfig(config: PowerhouseConfig, path?: string): void;
243
243
 
244
244
  export { }
@@ -11,10 +11,10 @@ const DEFAULT_CONFIG = {
11
11
  subgraphsDir: DEFAULT_SUBGRAPHS_DIR,
12
12
  skipFormat: false
13
13
  };
14
- function getConfig() {
14
+ function getConfig(path = "./powerhouse.config.json") {
15
15
  let config = { ...DEFAULT_CONFIG };
16
16
  try {
17
- const configStr = readFileSync("./powerhouse.config.json", "utf-8");
17
+ const configStr = readFileSync(path, "utf-8");
18
18
  const userConfig = JSON.parse(configStr);
19
19
  config = { ...config, ...userConfig };
20
20
  } catch {
@@ -22,8 +22,8 @@ function getConfig() {
22
22
  }
23
23
  return config;
24
24
  }
25
- function writeConfig(config) {
26
- writeFileSync("./powerhouse.config.json", JSON.stringify(config, null, 4));
25
+ function writeConfig(config, path = "./powerhouse.config.json") {
26
+ writeFileSync(path, JSON.stringify(config, null, 4));
27
27
  }
28
28
 
29
29
  export { DEFAULT_CONFIG, getConfig, writeConfig };
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/powerhouse.ts"],"names":[],"mappings":";;AAwBA,MAAM,2BAA8B,GAAA,mBAAA;AACpC,MAAM,mBAAsB,GAAA,WAAA;AAC5B,MAAM,sBAAyB,GAAA,cAAA;AAC/B,MAAM,qBAAwB,GAAA,aAAA;AAEvB,MAAM,cAAmC,GAAA;AAAA,EAC9C,iBAAmB,EAAA,2BAAA;AAAA,EACnB,UAAY,EAAA,mBAAA;AAAA,EACZ,aAAe,EAAA,sBAAA;AAAA,EACf,YAAc,EAAA,qBAAA;AAAA,EACd,UAAY,EAAA;AACd;AAEO,SAAS,SAAY,GAAA;AAC1B,EAAI,IAAA,MAAA,GAA2B,EAAE,GAAG,cAAe,EAAA;AACnD,EAAI,IAAA;AACF,IAAM,MAAA,SAAA,GAAY,YAAa,CAAA,0BAAA,EAA4B,OAAO,CAAA;AAClE,IAAM,MAAA,UAAA,GAAa,IAAK,CAAA,KAAA,CAAM,SAAS,CAAA;AACvC,IAAA,MAAA,GAAS,EAAE,GAAG,MAAQ,EAAA,GAAG,UAAW,EAAA;AAAA,GAC9B,CAAA,MAAA;AACN,IAAA,OAAA,CAAQ,KAAK,iDAAiD,CAAA;AAAA;AAEhE,EAAO,OAAA,MAAA;AACT;AAEO,SAAS,YAAY,MAA0B,EAAA;AACpD,EAAA,aAAA,CAAc,4BAA4B,IAAK,CAAA,SAAA,CAAU,MAAQ,EAAA,IAAA,EAAM,CAAC,CAAC,CAAA;AAC3E","file":"powerhouse.js","sourcesContent":["import { readFileSync, writeFileSync } from \"node:fs\";\n\nexport type PowerhouseConfig = {\n documentModelsDir: string;\n editorsDir: string;\n processorsDir: string;\n subgraphsDir: string;\n interactive?: boolean;\n skipFormat?: boolean;\n watch?: boolean;\n reactor?: {\n port?: number;\n };\n studio?: {\n port?: number;\n host?: string;\n https: boolean;\n openBrowser?: boolean;\n };\n packages?: {\n packageName: string;\n }[];\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\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 skipFormat: false,\n};\n\nexport function getConfig() {\n let config: PowerhouseConfig = { ...DEFAULT_CONFIG };\n try {\n const configStr = readFileSync(\"./powerhouse.config.json\", \"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 return config;\n}\n\nexport function writeConfig(config: PowerhouseConfig) {\n writeFileSync(\"./powerhouse.config.json\", JSON.stringify(config, null, 4));\n}\n"]}
1
+ {"version":3,"sources":["../src/powerhouse.ts"],"names":[],"mappings":";;AAwBA,MAAM,2BAA8B,GAAA,mBAAA;AACpC,MAAM,mBAAsB,GAAA,WAAA;AAC5B,MAAM,sBAAyB,GAAA,cAAA;AAC/B,MAAM,qBAAwB,GAAA,aAAA;AAEvB,MAAM,cAAmC,GAAA;AAAA,EAC9C,iBAAmB,EAAA,2BAAA;AAAA,EACnB,UAAY,EAAA,mBAAA;AAAA,EACZ,aAAe,EAAA,sBAAA;AAAA,EACf,YAAc,EAAA,qBAAA;AAAA,EACd,UAAY,EAAA;AACd;AAEO,SAAS,SAAA,CAAU,OAAO,0BAA4B,EAAA;AAC3D,EAAI,IAAA,MAAA,GAA2B,EAAE,GAAG,cAAe,EAAA;AACnD,EAAI,IAAA;AACF,IAAM,MAAA,SAAA,GAAY,YAAa,CAAA,IAAA,EAAM,OAAO,CAAA;AAC5C,IAAM,MAAA,UAAA,GAAa,IAAK,CAAA,KAAA,CAAM,SAAS,CAAA;AACvC,IAAA,MAAA,GAAS,EAAE,GAAG,MAAQ,EAAA,GAAG,UAAW,EAAA;AAAA,GAC9B,CAAA,MAAA;AACN,IAAA,OAAA,CAAQ,KAAK,iDAAiD,CAAA;AAAA;AAEhE,EAAO,OAAA,MAAA;AACT;AAEO,SAAS,WAAA,CACd,MACA,EAAA,IAAA,GAAO,0BACP,EAAA;AACA,EAAA,aAAA,CAAc,MAAM,IAAK,CAAA,SAAA,CAAU,MAAQ,EAAA,IAAA,EAAM,CAAC,CAAC,CAAA;AACrD","file":"powerhouse.js","sourcesContent":["import { readFileSync, writeFileSync } from \"node:fs\";\n\nexport type PowerhouseConfig = {\n documentModelsDir: string;\n editorsDir: string;\n processorsDir: string;\n subgraphsDir: string;\n interactive?: boolean;\n skipFormat?: boolean;\n watch?: boolean;\n reactor?: {\n port?: number;\n };\n studio?: {\n port?: number;\n host?: string;\n https: boolean;\n openBrowser?: boolean;\n };\n packages?: {\n packageName: string;\n }[];\n};\n\nconst DEFAULT_DOCUMENT_MODELS_DIR = \"./document-models\";\nconst DEFAULT_EDITORS_DIR = \"./editors\";\nconst DEFAULT_PROCESSORS_DIR = \"./processors\";\nconst DEFAULT_SUBGRAPHS_DIR = \"./subgraphs\";\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 skipFormat: false,\n};\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 return config;\n}\n\nexport function writeConfig(\n config: PowerhouseConfig,\n path = \"./powerhouse.config.json\",\n) {\n writeFileSync(path, JSON.stringify(config, null, 4));\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/config",
3
- "version": "1.12.0",
3
+ "version": "1.14.0",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0-only",
6
6
  "private": false,
package/src/powerhouse.ts CHANGED
@@ -35,10 +35,10 @@ export const DEFAULT_CONFIG: PowerhouseConfig = {
35
35
  skipFormat: false,
36
36
  };
37
37
 
38
- export function getConfig() {
38
+ export function getConfig(path = "./powerhouse.config.json") {
39
39
  let config: PowerhouseConfig = { ...DEFAULT_CONFIG };
40
40
  try {
41
- const configStr = readFileSync("./powerhouse.config.json", "utf-8");
41
+ const configStr = readFileSync(path, "utf-8");
42
42
  const userConfig = JSON.parse(configStr) as PowerhouseConfig;
43
43
  config = { ...config, ...userConfig };
44
44
  } catch {
@@ -47,6 +47,9 @@ export function getConfig() {
47
47
  return config;
48
48
  }
49
49
 
50
- export function writeConfig(config: PowerhouseConfig) {
51
- writeFileSync("./powerhouse.config.json", JSON.stringify(config, null, 4));
50
+ export function writeConfig(
51
+ config: PowerhouseConfig,
52
+ path = "./powerhouse.config.json",
53
+ ) {
54
+ writeFileSync(path, JSON.stringify(config, null, 4));
52
55
  }