@powerhousedao/ph-clint-cli 0.1.0-dev.5 → 0.1.0-dev.7
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/codegen/builders/cli-ts.js +12 -1
- package/dist/codegen/builders/index.d.ts +1 -0
- package/dist/codegen/builders/index.js +1 -0
- package/dist/codegen/builders/publish-config-ts.d.ts +6 -0
- package/dist/codegen/builders/publish-config-ts.js +18 -0
- package/dist/codegen/builders/root-package-json.d.ts +3 -0
- package/dist/codegen/builders/root-package-json.js +19 -10
- package/dist/codegen/index.js +7 -1
- package/package.json +4 -4
|
@@ -69,10 +69,21 @@ export function buildCliTs(spec) {
|
|
|
69
69
|
lines.push('');
|
|
70
70
|
lines.push(' // @clint:begin interactive');
|
|
71
71
|
lines.push(' interactive: {');
|
|
72
|
-
|
|
72
|
+
const ctxArgs = [];
|
|
73
|
+
if (powerhouse.enabled && (powerhouse.switchboard || powerhouse.connect)) {
|
|
74
|
+
ctxArgs.push('config');
|
|
75
|
+
}
|
|
76
|
+
ctxArgs.push('workdir');
|
|
77
|
+
lines.push(` welcome: ({ ${ctxArgs.join(', ')} }) =>`);
|
|
73
78
|
lines.push(' [');
|
|
74
79
|
lines.push(' `${CLI_NAME} v${CLI_VERSION}`,');
|
|
75
80
|
lines.push(' `Workdir: ${workdir}`,');
|
|
81
|
+
if (powerhouse.enabled && powerhouse.switchboard) {
|
|
82
|
+
lines.push(' `Switchboard: http://localhost:${config.switchboardPort}`,');
|
|
83
|
+
}
|
|
84
|
+
if (powerhouse.enabled && powerhouse.connect) {
|
|
85
|
+
lines.push(' `Connect: http://localhost:${config.connectPort}`,');
|
|
86
|
+
}
|
|
76
87
|
lines.push(" '',");
|
|
77
88
|
if (mastra.enabled) {
|
|
78
89
|
lines.push(" 'Type a message to talk to the agent, or /help for commands.',");
|
|
@@ -39,5 +39,6 @@ export interface FileBuilder {
|
|
|
39
39
|
export declare const CLI_FILE_BUILDERS: FileBuilder[];
|
|
40
40
|
export { buildCliPackageJson, buildCliTs, buildConfigTs, buildMainTs, buildTsconfigJson, buildJestConfigJs, buildEslintConfigJs, buildGitignore, buildMastraIndexTs, buildBuildSkillsScript, buildAgentBaseMd, buildAgentTs, buildFrameworkGenTs, buildFrameworkTs, };
|
|
41
41
|
export { buildRootPackageJson } from './root-package-json.js';
|
|
42
|
+
export { buildPublishConfigTs } from './publish-config-ts.js';
|
|
42
43
|
export { buildReadme } from './readme-md.js';
|
|
43
44
|
export { buildAppIndexTs } from './app-index-ts.js';
|
|
@@ -56,5 +56,6 @@ export const CLI_FILE_BUILDERS = [
|
|
|
56
56
|
];
|
|
57
57
|
export { buildCliPackageJson, buildCliTs, buildConfigTs, buildMainTs, buildTsconfigJson, buildJestConfigJs, buildEslintConfigJs, buildGitignore, buildMastraIndexTs, buildBuildSkillsScript, buildAgentBaseMd, buildAgentTs, buildFrameworkGenTs, buildFrameworkTs, };
|
|
58
58
|
export { buildRootPackageJson } from './root-package-json.js';
|
|
59
|
+
export { buildPublishConfigTs } from './publish-config-ts.js';
|
|
59
60
|
export { buildReadme } from './readme-md.js';
|
|
60
61
|
export { buildAppIndexTs } from './app-index-ts.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Builds the root `publish.config.ts` for split-layout projects.
|
|
3
|
+
* Defines a single lockstep group containing both the app and cli packages.
|
|
4
|
+
*/
|
|
5
|
+
import { type ClintProjectSpec } from '../../spec/types.js';
|
|
6
|
+
export declare function buildPublishConfigTs(spec: ClintProjectSpec): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function buildPublishConfigTs(spec) {
|
|
2
|
+
const app = `${spec.name}-app`;
|
|
3
|
+
const cli = `${spec.name}-cli`;
|
|
4
|
+
return `import { definePublishConfig } from '@powerhousedao/ph-clint-dev/publish';
|
|
5
|
+
|
|
6
|
+
export default definePublishConfig({
|
|
7
|
+
groups: {
|
|
8
|
+
'${spec.name}': {
|
|
9
|
+
version: '${spec.version}',
|
|
10
|
+
packages: [
|
|
11
|
+
{ path: '${app}', category: 'app' },
|
|
12
|
+
{ path: '${cli}', category: 'cli' },
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
});
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
* Builds the *root* `package.json` for split-layout projects (Powerhouse
|
|
3
3
|
* enabled). A plain passthrough — deliberately no pnpm workspaces because
|
|
4
4
|
* they interfere with `{name}-app`'s own `pnpm build`.
|
|
5
|
+
*
|
|
6
|
+
* Uses `pnpm --prefix <dir>` for all orchestration scripts — no cwd mutation.
|
|
7
|
+
* Build order: app first, then cli (cli depends on app via `file:` dep).
|
|
5
8
|
*/
|
|
6
9
|
import { type ClintProjectSpec } from '../../spec/types.js';
|
|
7
10
|
export declare function buildRootPackageJson(spec: ClintProjectSpec): string;
|
|
@@ -2,26 +2,35 @@
|
|
|
2
2
|
* Builds the *root* `package.json` for split-layout projects (Powerhouse
|
|
3
3
|
* enabled). A plain passthrough — deliberately no pnpm workspaces because
|
|
4
4
|
* they interfere with `{name}-app`'s own `pnpm build`.
|
|
5
|
+
*
|
|
6
|
+
* Uses `pnpm --prefix <dir>` for all orchestration scripts — no cwd mutation.
|
|
7
|
+
* Build order: app first, then cli (cli depends on app via `file:` dep).
|
|
5
8
|
*/
|
|
6
9
|
import { getPackageName, } from '../../spec/types.js';
|
|
7
10
|
export function buildRootPackageJson(spec) {
|
|
8
11
|
const cli = `${spec.name}-cli`;
|
|
9
12
|
const app = `${spec.name}-app`;
|
|
13
|
+
const prefix = (dir, cmd) => `pnpm --prefix ${dir} ${cmd}`;
|
|
14
|
+
const both = (cmd) => `${prefix(app, cmd)} && ${prefix(cli, cmd)}`;
|
|
15
|
+
const scripts = {
|
|
16
|
+
install: both('install'),
|
|
17
|
+
build: both('build'),
|
|
18
|
+
test: both('test'),
|
|
19
|
+
dev: prefix(cli, 'dev'),
|
|
20
|
+
start: prefix(cli, 'start'),
|
|
21
|
+
lint: prefix(cli, 'lint'),
|
|
22
|
+
'app:dev': prefix(app, 'dev'),
|
|
23
|
+
'cli:dev': prefix(cli, 'dev'),
|
|
24
|
+
'publish:dev': `${prefix(cli, 'exec ph-publish')} dev -c ./publish.config.ts`,
|
|
25
|
+
'publish:staging': `${prefix(cli, 'exec ph-publish')} staging -c ./publish.config.ts`,
|
|
26
|
+
'publish:production': `${prefix(cli, 'exec ph-publish')} production -c ./publish.config.ts`,
|
|
27
|
+
};
|
|
10
28
|
const pkg = {
|
|
11
29
|
name: getPackageName(spec),
|
|
12
30
|
version: spec.version,
|
|
13
31
|
private: true,
|
|
14
32
|
...(spec.description ? { description: spec.description } : {}),
|
|
15
|
-
scripts
|
|
16
|
-
install: `cd ${app} && pnpm install && cd ../${cli} && pnpm install`,
|
|
17
|
-
build: `cd ${app} && pnpm build && cd ../${cli} && pnpm build`,
|
|
18
|
-
dev: `cd ${cli} && pnpm dev`,
|
|
19
|
-
start: `cd ${cli} && pnpm start`,
|
|
20
|
-
test: `cd ${app} && pnpm test && cd ../${cli} && pnpm test`,
|
|
21
|
-
lint: `cd ${cli} && pnpm lint`,
|
|
22
|
-
'app:dev': `cd ${app} && pnpm dev`,
|
|
23
|
-
'cli:dev': `cd ${cli} && pnpm dev`,
|
|
24
|
-
},
|
|
33
|
+
scripts,
|
|
25
34
|
};
|
|
26
35
|
return JSON.stringify(pkg, null, 2) + '\n';
|
|
27
36
|
}
|
package/dist/codegen/index.js
CHANGED
|
@@ -35,7 +35,7 @@ import { hashContent, hashFile, readHashes, writeHashes, } from './hashes.js';
|
|
|
35
35
|
import { hasMarkers, spliceMarkerRegions } from './markers.js';
|
|
36
36
|
import { writeFileEnsuringDir, isDirEmptyEnough } from './write.js';
|
|
37
37
|
import { migrateFlatToSplit } from './migrate/flat-to-split.js';
|
|
38
|
-
import { CLI_FILE_BUILDERS, buildReadme, buildRootPackageJson, buildAppIndexTs, } from './builders/index.js';
|
|
38
|
+
import { CLI_FILE_BUILDERS, buildReadme, buildRootPackageJson, buildPublishConfigTs, buildAppIndexTs, } from './builders/index.js';
|
|
39
39
|
/**
|
|
40
40
|
* Generate / reconcile a project at `targetDir` from the given spec.
|
|
41
41
|
*/
|
|
@@ -106,6 +106,12 @@ function planFiles(spec, targetDir) {
|
|
|
106
106
|
absolutePath: rootPkg,
|
|
107
107
|
content: buildRootPackageJson(spec),
|
|
108
108
|
});
|
|
109
|
+
const publishConfig = path.join(targetDir, 'publish.config.ts');
|
|
110
|
+
planned.push({
|
|
111
|
+
relativePath: 'publish.config.ts',
|
|
112
|
+
absolutePath: publishConfig,
|
|
113
|
+
content: buildPublishConfigTs(spec),
|
|
114
|
+
});
|
|
109
115
|
const appGitkeep = path.join(appDir, '.gitkeep');
|
|
110
116
|
planned.push({
|
|
111
117
|
relativePath: path.relative(targetDir, appGitkeep),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerhousedao/ph-clint-cli",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.7",
|
|
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.
|
|
29
|
-
"@powerhousedao/ph-clint-app": "^0.1.0-dev.
|
|
28
|
+
"@powerhousedao/ph-clint": "^0.1.0-dev.7",
|
|
29
|
+
"@powerhousedao/ph-clint-app": "^0.1.0-dev.7",
|
|
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.7",
|
|
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.5",
|
|
52
52
|
"ts-jest": "^29.4.6",
|
|
53
53
|
"tsx": "^4.19.0",
|
|
54
54
|
"typescript": "^6.0.2"
|