@powerhousedao/ph-clint-cli 0.1.0-dev.44 → 0.1.0-dev.46
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.
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { getAppDirName, getAppPackageName, getBinName, getPackageName, phAtLeast, } from '../../spec/types.js';
|
|
8
8
|
import { CLI_VERSION } from '../../config.js';
|
|
9
|
+
import { getPhVersion } from '../scaffold.js';
|
|
9
10
|
/**
|
|
10
11
|
* Derive a semver range from the running ph-clint-cli version that respects
|
|
11
12
|
* the dev / staging / production channel boundary. This is the version range
|
|
@@ -38,7 +39,14 @@ function phClintRange(version) {
|
|
|
38
39
|
}
|
|
39
40
|
/** Version range for @powerhousedao/ph-clint{,-dev} deps in scaffolded projects. */
|
|
40
41
|
const PH_CLINT_VERSION = phClintRange(CLI_VERSION);
|
|
41
|
-
const
|
|
42
|
+
const POWERHOUSE_VERSION_FALLBACK = '6.0.0-dev.170';
|
|
43
|
+
let _powerhouseVersion;
|
|
44
|
+
function getPowerhouseVersion() {
|
|
45
|
+
if (_powerhouseVersion === undefined) {
|
|
46
|
+
_powerhouseVersion = getPhVersion('ph') ?? POWERHOUSE_VERSION_FALLBACK;
|
|
47
|
+
}
|
|
48
|
+
return _powerhouseVersion;
|
|
49
|
+
}
|
|
42
50
|
export function buildCliPackageJson(spec) {
|
|
43
51
|
const { mastra, powerhouse } = spec.features;
|
|
44
52
|
const pkgName = phAtLeast(powerhouse, 'Reactor')
|
|
@@ -59,10 +67,10 @@ export function buildCliPackageJson(spec) {
|
|
|
59
67
|
const appPkg = getAppPackageName(spec);
|
|
60
68
|
const appDir = getAppDirName(spec);
|
|
61
69
|
dependencies[appPkg] = `file:../${appDir}`;
|
|
62
|
-
dependencies['@powerhousedao/reactor'] =
|
|
63
|
-
dependencies['@powerhousedao/reactor-api'] =
|
|
64
|
-
dependencies['@powerhousedao/shared'] =
|
|
65
|
-
dependencies['document-model'] =
|
|
70
|
+
dependencies['@powerhousedao/reactor'] = getPowerhouseVersion();
|
|
71
|
+
dependencies['@powerhousedao/reactor-api'] = getPowerhouseVersion();
|
|
72
|
+
dependencies['@powerhousedao/shared'] = getPowerhouseVersion();
|
|
73
|
+
dependencies['document-model'] = getPowerhouseVersion();
|
|
66
74
|
// External reactor packages (non-app) as versioned dependencies.
|
|
67
75
|
// Compare bare names (without scope) so that a spec entry with
|
|
68
76
|
// packageName "foo-app" still matches the scoped "@scope/foo-app".
|
package/dist/codegen/index.js
CHANGED
|
@@ -50,18 +50,24 @@ export async function generateProject(options) {
|
|
|
50
50
|
// Flat → split migration, if needed. Runs BEFORE we compute planned files
|
|
51
51
|
// so the hash record and on-disk state are already in split-layout shape
|
|
52
52
|
// by the time the normal reconciliation runs.
|
|
53
|
+
//
|
|
54
|
+
// Use GeneratedState (what was *actually generated* last time) rather than
|
|
55
|
+
// the on-disk spec to detect the layout flip — when the user edits the spec
|
|
56
|
+
// file before running regen, both existingSpec and spec already say "Reactor"
|
|
57
|
+
// and the old comparison would never trigger.
|
|
53
58
|
let migrated = false;
|
|
54
|
-
if (resolvedMode === 'update' &&
|
|
55
|
-
|
|
56
|
-
existingSpec
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
59
|
+
if (resolvedMode === 'update' && spec.features.powerhouse !== 'Disabled') {
|
|
60
|
+
const prev = await readGeneratedState(targetDir);
|
|
61
|
+
const wasFlatLayout = prev ? prev.cliFolderName === '' : existingSpec?.features.powerhouse === 'Disabled';
|
|
62
|
+
if (wasFlatLayout) {
|
|
63
|
+
await migrateFlatToSplit({
|
|
64
|
+
targetDir,
|
|
65
|
+
spec,
|
|
66
|
+
force: options.force,
|
|
67
|
+
onWarn: warn,
|
|
68
|
+
});
|
|
69
|
+
migrated = true;
|
|
70
|
+
}
|
|
65
71
|
}
|
|
66
72
|
// Dispatch to the mode-specific flow.
|
|
67
73
|
if (resolvedMode === 'create') {
|
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.46",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"@mastra/core": "^1.22.0",
|
|
30
30
|
"@mastra/libsql": "^1.7.4",
|
|
31
31
|
"@mastra/memory": "^1.13.1",
|
|
32
|
-
"@powerhousedao/ph-clint": "^0.1.0-dev.
|
|
33
|
-
"@powerhousedao/ph-clint-app": "^0.1.0-dev.
|
|
34
|
-
"@powerhousedao/ph-clint-dev": "^0.1.0-dev.
|
|
32
|
+
"@powerhousedao/ph-clint": "^0.1.0-dev.46",
|
|
33
|
+
"@powerhousedao/ph-clint-app": "^0.1.0-dev.46",
|
|
34
|
+
"@powerhousedao/ph-clint-dev": "^0.1.0-dev.46",
|
|
35
35
|
"@powerhousedao/reactor": "6.0.0-dev.170",
|
|
36
36
|
"@powerhousedao/reactor-api": "6.0.0-dev.170",
|
|
37
37
|
"@powerhousedao/shared": "6.0.0-dev.170",
|