@powerhousedao/ph-clint-cli 0.1.0-dev.6 → 0.1.0-dev.8

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.
@@ -10,6 +10,7 @@ export function buildCliTs(spec) {
10
10
  lines.push(' */');
11
11
  if (powerhouse.enabled) {
12
12
  lines.push(`import path from 'node:path';`);
13
+ lines.push(`import { existsSync } from 'node:fs';`);
13
14
  lines.push(`import { defineCli, buildDefaultReactor } from '@powerhousedao/ph-clint';`);
14
15
  }
15
16
  else {
@@ -30,6 +31,13 @@ export function buildCliTs(spec) {
30
31
  if (powerhouse.enabled) {
31
32
  lines.push(`const appDir = path.resolve(CLI_ROOT, '../${spec.name}-app');`);
32
33
  lines.push('');
34
+ if (powerhouse.connect) {
35
+ lines.push('function resolveConnectAssets(dir: string): string | undefined {');
36
+ lines.push(" const assetsDir = path.join(dir, 'dist', 'connect');");
37
+ lines.push(" return existsSync(path.join(assetsDir, 'index.html')) ? assetsDir : undefined;");
38
+ lines.push('}');
39
+ lines.push('');
40
+ }
33
41
  }
34
42
  lines.push('export const cli = defineCli({');
35
43
  lines.push(' name: CLI_NAME,');
@@ -105,7 +113,12 @@ export function buildCliTs(spec) {
105
113
  lines.push(` drive: { name: '${spec.name}' },`);
106
114
  lines.push(' }),');
107
115
  lines.push(` switchboard: { enabled: ${String(powerhouse.switchboard)} },`);
108
- lines.push(` connect: { enabled: ${String(powerhouse.connect)}, workdir: appDir },`);
116
+ if (powerhouse.connect) {
117
+ lines.push(` connect: { enabled: true, workdir: appDir, assetsDir: resolveConnectAssets(appDir) },`);
118
+ }
119
+ else {
120
+ lines.push(` connect: { enabled: false },`);
121
+ }
109
122
  lines.push('});');
110
123
  }
111
124
  lines.push('// @clint:end reactor');
@@ -12,9 +12,13 @@ export function buildRootPackageJson(spec) {
12
12
  const app = `${spec.name}-app`;
13
13
  const prefix = (dir, cmd) => `pnpm --prefix ${dir} ${cmd}`;
14
14
  const both = (cmd) => `${prefix(app, cmd)} && ${prefix(cli, cmd)}`;
15
+ const connectEnabled = spec.features.powerhouse.enabled && spec.features.powerhouse.connect;
16
+ const buildScript = connectEnabled
17
+ ? `${prefix(app, 'build')} && ${prefix(app, 'connect:build')} && ${prefix(cli, 'build')}`
18
+ : both('build');
15
19
  const scripts = {
16
20
  install: both('install'),
17
- build: both('build'),
21
+ build: buildScript,
18
22
  test: both('test'),
19
23
  dev: prefix(cli, 'dev'),
20
24
  start: prefix(cli, 'start'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerhousedao/ph-clint-cli",
3
- "version": "0.1.0-dev.6",
3
+ "version": "0.1.0-dev.8",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -25,8 +25,8 @@
25
25
  "mastra:start": "mastra start"
26
26
  },
27
27
  "dependencies": {
28
- "@powerhousedao/ph-clint": "^0.1.0-dev.6",
29
- "@powerhousedao/ph-clint-app": "^0.1.0-dev.6",
28
+ "@powerhousedao/ph-clint": "^0.1.0-dev.8",
29
+ "@powerhousedao/ph-clint-app": "^0.1.0-dev.8",
30
30
  "@mastra/core": "^1.22.0",
31
31
  "@mastra/libsql": "^1.7.4",
32
32
  "@mastra/memory": "^1.13.1",
@@ -37,6 +37,7 @@
37
37
  "document-model": "6.0.0-dev.170",
38
38
  "kysely": "^0.27.0",
39
39
  "kysely-pglite-dialect": "^1.3.0",
40
+ "@powerhousedao/ph-clint-dev": "^0.1.0-dev.8",
40
41
  "zod": "^4.3.6"
41
42
  },
42
43
  "pnpm": {
@@ -48,7 +49,6 @@
48
49
  "@jest/globals": "^30.2.0",
49
50
  "@types/node": "^25.5.2",
50
51
  "jest": "^30.2.0",
51
- "@powerhousedao/ph-clint-dev": "^0.1.0-dev.6",
52
52
  "ts-jest": "^29.4.6",
53
53
  "tsx": "^4.19.0",
54
54
  "typescript": "^6.0.2"