@happyvertical/smrt-cli 0.39.9 → 0.39.11
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.
|
@@ -4,7 +4,7 @@ import { existsSync, lstatSync, mkdirSync, readFileSync, realpathSync, writeFile
|
|
|
4
4
|
import * as path from "node:path";
|
|
5
5
|
import { dirname, isAbsolute, join, relative, resolve } from "node:path";
|
|
6
6
|
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
7
|
-
import { ObjectRegistry, SchemaComparer, createQualifiedName, generateDDLForEngine, getClassName, isQualifiedName, parseQualifiedName } from "@happyvertical/smrt-core";
|
|
7
|
+
import { ObjectRegistry, SchemaComparer, createQualifiedName, generateDDLForEngine, getClassName, getPackageFromQualifiedName, isQualifiedName, parseQualifiedName } from "@happyvertical/smrt-core";
|
|
8
8
|
import { loadExternalManifestSync } from "@happyvertical/smrt-core/manifest";
|
|
9
9
|
import { access, cp, mkdir, readFile, rm, writeFile } from "node:fs/promises";
|
|
10
10
|
import { createLogger } from "@happyvertical/logger";
|
|
@@ -219,6 +219,9 @@ var configExportCommand = {
|
|
|
219
219
|
* - Installed packages in node_modules
|
|
220
220
|
*/
|
|
221
221
|
var logger$2 = createLogger({ level: "info" });
|
|
222
|
+
function resolveManifestEntryPackageName(name, definition, fallback) {
|
|
223
|
+
return definition.packageName || fallback || getPackageFromQualifiedName(name) || (definition.qualifiedName ? getPackageFromQualifiedName(definition.qualifiedName) : void 0);
|
|
224
|
+
}
|
|
222
225
|
/**
|
|
223
226
|
* Tracks all versions found for each @happyvertical/smrt-* package.
|
|
224
227
|
* Used to detect version conflicts that could cause runtime issues.
|
|
@@ -380,7 +383,11 @@ async function loadManifestFile(manifestPath) {
|
|
|
380
383
|
async function loadManifest(manifestPath) {
|
|
381
384
|
const manifest = await loadManifestFile(manifestPath);
|
|
382
385
|
if (!manifest?.objects) return;
|
|
383
|
-
for (const [name, objectDef] of Object.entries(manifest.objects))
|
|
386
|
+
for (const [name, objectDef] of Object.entries(manifest.objects)) {
|
|
387
|
+
const definition = objectDef;
|
|
388
|
+
const packageName = resolveManifestEntryPackageName(name, definition, manifest.packageName);
|
|
389
|
+
ObjectRegistry.registerFromManifest(name, definition, packageName);
|
|
390
|
+
}
|
|
384
391
|
}
|
|
385
392
|
/**
|
|
386
393
|
* Auto-discover and load all manifests in the project.
|
|
@@ -5919,6 +5926,16 @@ function addFinding(findings, severity, code, message) {
|
|
|
5919
5926
|
function getManifestPackageName(manifest, fallback) {
|
|
5920
5927
|
return manifest.packageName || fallback;
|
|
5921
5928
|
}
|
|
5929
|
+
function readProjectPackageName(projectRoot) {
|
|
5930
|
+
const packageJsonPath = resolve(projectRoot, "package.json");
|
|
5931
|
+
if (!existsSync(packageJsonPath)) return;
|
|
5932
|
+
try {
|
|
5933
|
+
const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf-8"));
|
|
5934
|
+
return typeof packageJson.name === "string" && packageJson.name ? packageJson.name : void 0;
|
|
5935
|
+
} catch {
|
|
5936
|
+
return;
|
|
5937
|
+
}
|
|
5938
|
+
}
|
|
5922
5939
|
function getEntryClassName(key, definition) {
|
|
5923
5940
|
if (definition.className) return definition.className;
|
|
5924
5941
|
if (isQualifiedName(key)) return parseQualifiedName(key).className;
|
|
@@ -5939,12 +5956,22 @@ function getNonSystemFieldNames(definition) {
|
|
|
5939
5956
|
function flattenManifestEntries(manifest, source, fallbackPackageName) {
|
|
5940
5957
|
const manifestPackageName = getManifestPackageName(manifest, fallbackPackageName);
|
|
5941
5958
|
return Object.entries(manifest.objects || {}).map(([key, objectDef]) => ({
|
|
5942
|
-
manifestPackageName,
|
|
5959
|
+
manifestPackageName: resolveManifestEntryPackageName(key, objectDef, manifestPackageName),
|
|
5943
5960
|
manifestSource: source,
|
|
5944
5961
|
key,
|
|
5945
5962
|
definition: objectDef
|
|
5946
5963
|
}));
|
|
5947
5964
|
}
|
|
5965
|
+
function getOwnedProjectManifest(manifest, fallbackPackageName) {
|
|
5966
|
+
const packageName = getManifestPackageName(manifest, fallbackPackageName);
|
|
5967
|
+
if (!packageName) return manifest;
|
|
5968
|
+
const objects = Object.fromEntries(Object.entries(manifest.objects || {}).filter(([key, definition]) => resolveManifestEntryPackageName(key, definition, packageName) === packageName));
|
|
5969
|
+
return {
|
|
5970
|
+
...manifest,
|
|
5971
|
+
packageName,
|
|
5972
|
+
objects
|
|
5973
|
+
};
|
|
5974
|
+
}
|
|
5948
5975
|
function findProjectManifest(manifests) {
|
|
5949
5976
|
return manifests.find((manifest) => manifest.source === "project");
|
|
5950
5977
|
}
|
|
@@ -6038,8 +6065,11 @@ async function loadDependencyManifests(rootManifest, projectRoot, findings) {
|
|
|
6038
6065
|
}
|
|
6039
6066
|
return Array.from(loaded.values(), (entry) => entry.manifest);
|
|
6040
6067
|
}
|
|
6068
|
+
function registerManifestEntries(manifest) {
|
|
6069
|
+
for (const [name, objectDef] of Object.entries(manifest.objects || {})) ObjectRegistry.registerFromManifest(name, objectDef, resolveManifestEntryPackageName(name, objectDef, manifest.packageName));
|
|
6070
|
+
}
|
|
6041
6071
|
function registerDependencyManifests(dependencyManifests) {
|
|
6042
|
-
for (const manifest of dependencyManifests)
|
|
6072
|
+
for (const manifest of dependencyManifests) registerManifestEntries(manifest);
|
|
6043
6073
|
}
|
|
6044
6074
|
function resolvePackageJsonPath(packageName, issuerResolverPath) {
|
|
6045
6075
|
const requireFromIssuer = createRequire(issuerResolverPath);
|
|
@@ -6221,9 +6251,11 @@ async function runRuntimeCheck(projectRoot = process.cwd()) {
|
|
|
6221
6251
|
};
|
|
6222
6252
|
}
|
|
6223
6253
|
const projectManifest = await loadManifestFile(projectManifestInfo.path);
|
|
6254
|
+
const projectPackageName = getManifestPackageName(projectManifest, readProjectPackageName(projectRoot));
|
|
6255
|
+
const ownedProjectManifest = getOwnedProjectManifest(projectManifest, projectPackageName);
|
|
6224
6256
|
const dependencyManifests = await loadDependencyManifests(projectManifest, projectRoot, findings);
|
|
6225
6257
|
checkConsumerRegistration(projectManifest, dependencyManifests, projectRoot, findings);
|
|
6226
|
-
const allEntries = [...flattenManifestEntries(projectManifest, "project",
|
|
6258
|
+
const allEntries = [...flattenManifestEntries(projectManifest, "project", projectPackageName), ...dependencyManifests.flatMap((manifest) => flattenManifestEntries(manifest, "dependency", manifest.packageName))];
|
|
6227
6259
|
for (const entry of allEntries) checkManifestIdentity(findings, entry);
|
|
6228
6260
|
ObjectRegistry.clear();
|
|
6229
6261
|
try {
|
|
@@ -6233,19 +6265,20 @@ async function runRuntimeCheck(projectRoot = process.cwd()) {
|
|
|
6233
6265
|
return {
|
|
6234
6266
|
projectRoot,
|
|
6235
6267
|
projectManifestPath: projectManifestInfo.path,
|
|
6236
|
-
projectPackageName
|
|
6268
|
+
projectPackageName,
|
|
6237
6269
|
discoveredManifestCount: discovered.length,
|
|
6238
6270
|
findings
|
|
6239
6271
|
};
|
|
6240
6272
|
}
|
|
6273
|
+
if (!projectManifest.packageName && projectPackageName) registerManifestEntries(ownedProjectManifest);
|
|
6241
6274
|
registerDependencyManifests(dependencyManifests);
|
|
6242
|
-
await checkRuntimeHydration(
|
|
6243
|
-
checkShadowing(
|
|
6275
|
+
await checkRuntimeHydration(ownedProjectManifest, dependencyManifests, findings);
|
|
6276
|
+
checkShadowing(ownedProjectManifest, dependencyManifests, findings);
|
|
6244
6277
|
if (!findings.some((finding) => finding.severity === "error")) addFinding(findings, "pass", "runtime-check-passed", `Validated runtime registration across ${discovered.length} discovered manifest(s).`);
|
|
6245
6278
|
return {
|
|
6246
6279
|
projectRoot,
|
|
6247
6280
|
projectManifestPath: projectManifestInfo.path,
|
|
6248
|
-
projectPackageName
|
|
6281
|
+
projectPackageName,
|
|
6249
6282
|
discoveredManifestCount: discovered.length,
|
|
6250
6283
|
findings
|
|
6251
6284
|
};
|
package/dist/index.js
CHANGED
|
@@ -36,56 +36,56 @@ var _docsCommands = null;
|
|
|
36
36
|
var _playgroundCommands = null;
|
|
37
37
|
async function getGnodeCommands() {
|
|
38
38
|
if (!_gnodeCommands) {
|
|
39
|
-
const { gnodeCommands } = await import("./commands-
|
|
39
|
+
const { gnodeCommands } = await import("./commands-Bl_ne1Uj.js");
|
|
40
40
|
_gnodeCommands = gnodeCommands;
|
|
41
41
|
}
|
|
42
42
|
return _gnodeCommands;
|
|
43
43
|
}
|
|
44
44
|
async function getGitCommands() {
|
|
45
45
|
if (!_gitCommands) {
|
|
46
|
-
const { gitCommands } = await import("./commands-
|
|
46
|
+
const { gitCommands } = await import("./commands-Bl_ne1Uj.js");
|
|
47
47
|
_gitCommands = gitCommands;
|
|
48
48
|
}
|
|
49
49
|
return _gitCommands;
|
|
50
50
|
}
|
|
51
51
|
async function getGenerateCommands() {
|
|
52
52
|
if (!_generateCommands) {
|
|
53
|
-
const { generateCommands } = await import("./commands-
|
|
53
|
+
const { generateCommands } = await import("./commands-Bl_ne1Uj.js");
|
|
54
54
|
_generateCommands = generateCommands;
|
|
55
55
|
}
|
|
56
56
|
return _generateCommands;
|
|
57
57
|
}
|
|
58
58
|
async function getInitCommands() {
|
|
59
59
|
if (!_initCommands) {
|
|
60
|
-
const { initCommands } = await import("./commands-
|
|
60
|
+
const { initCommands } = await import("./commands-Bl_ne1Uj.js");
|
|
61
61
|
_initCommands = initCommands;
|
|
62
62
|
}
|
|
63
63
|
return _initCommands;
|
|
64
64
|
}
|
|
65
65
|
async function getUtilityCommands() {
|
|
66
66
|
if (!_utilityCommands) {
|
|
67
|
-
const { utilityCommands } = await import("./commands-
|
|
67
|
+
const { utilityCommands } = await import("./commands-Bl_ne1Uj.js");
|
|
68
68
|
_utilityCommands = utilityCommands;
|
|
69
69
|
}
|
|
70
70
|
return _utilityCommands;
|
|
71
71
|
}
|
|
72
72
|
async function getDispatchCommands() {
|
|
73
73
|
if (!_dispatchCommands) {
|
|
74
|
-
const { dispatchCommands } = await import("./commands-
|
|
74
|
+
const { dispatchCommands } = await import("./commands-Bl_ne1Uj.js");
|
|
75
75
|
_dispatchCommands = dispatchCommands;
|
|
76
76
|
}
|
|
77
77
|
return _dispatchCommands;
|
|
78
78
|
}
|
|
79
79
|
async function getDocsCommands() {
|
|
80
80
|
if (!_docsCommands) {
|
|
81
|
-
const { docsCommands } = await import("./commands-
|
|
81
|
+
const { docsCommands } = await import("./commands-Bl_ne1Uj.js");
|
|
82
82
|
_docsCommands = docsCommands;
|
|
83
83
|
}
|
|
84
84
|
return _docsCommands;
|
|
85
85
|
}
|
|
86
86
|
async function getPlaygroundCommands() {
|
|
87
87
|
if (!_playgroundCommands) {
|
|
88
|
-
const { playgroundCommands } = await import("./commands-
|
|
88
|
+
const { playgroundCommands } = await import("./commands-Bl_ne1Uj.js");
|
|
89
89
|
_playgroundCommands = playgroundCommands;
|
|
90
90
|
}
|
|
91
91
|
return _playgroundCommands;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-cli",
|
|
3
|
-
"version": "0.39.
|
|
3
|
+
"version": "0.39.11",
|
|
4
4
|
"description": "Developer CLI for SMRT framework - introspection, testing, and project management",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -24,20 +24,20 @@
|
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"@happyvertical/ai": "^0.78.
|
|
28
|
-
"@happyvertical/files": "^0.78.
|
|
29
|
-
"@happyvertical/logger": "^0.78.
|
|
30
|
-
"@happyvertical/sql": "^0.78.
|
|
31
|
-
"@happyvertical/utils": "^0.78.
|
|
27
|
+
"@happyvertical/ai": "^0.78.1",
|
|
28
|
+
"@happyvertical/files": "^0.78.1",
|
|
29
|
+
"@happyvertical/logger": "^0.78.1",
|
|
30
|
+
"@happyvertical/sql": "^0.78.1",
|
|
31
|
+
"@happyvertical/utils": "^0.78.1",
|
|
32
32
|
"acorn": "^8.17.0",
|
|
33
33
|
"fast-glob": "3.3.3",
|
|
34
34
|
"tar": "^7.5.19",
|
|
35
|
-
"@happyvertical/smrt-config": "0.39.
|
|
36
|
-
"@happyvertical/smrt-
|
|
37
|
-
"@happyvertical/smrt-
|
|
38
|
-
"@happyvertical/smrt-
|
|
39
|
-
"@happyvertical/smrt-
|
|
40
|
-
"@happyvertical/smrt-types": "0.39.
|
|
35
|
+
"@happyvertical/smrt-config": "0.39.11",
|
|
36
|
+
"@happyvertical/smrt-dev-mcp": "0.39.11",
|
|
37
|
+
"@happyvertical/smrt-core": "0.39.11",
|
|
38
|
+
"@happyvertical/smrt-playground": "0.39.11",
|
|
39
|
+
"@happyvertical/smrt-agents": "0.39.11",
|
|
40
|
+
"@happyvertical/smrt-types": "0.39.11"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@types/node": "24.13.2",
|