@happyvertical/smrt-cli 0.51.6 → 0.51.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.
@@ -261,6 +261,15 @@ async function discoverManifests(projectRoot = process.cwd()) {
261
261
  return discovered;
262
262
  }
263
263
  /**
264
+ * Read a manifest's declared SMRT dependencies, tolerating the untrusted
265
+ * shape of a file loaded from disk.
266
+ */
267
+ function readSmrtDependencies(manifest) {
268
+ if (!Array.isArray(manifest.smrtDependencies)) return;
269
+ const dependencies = manifest.smrtDependencies.filter((dependency) => typeof dependency === "string");
270
+ return dependencies.length > 0 ? dependencies : void 0;
271
+ }
272
+ /**
264
273
  * Find manifests in project root
265
274
  */
266
275
  async function findProjectManifests(projectRoot) {
@@ -285,7 +294,8 @@ async function findProjectManifests(projectRoot) {
285
294
  packageName: manifest.packageName,
286
295
  packageVersion: manifest.version,
287
296
  objectCount: objectNames.length,
288
- objectNames
297
+ objectNames,
298
+ smrtDependencies: readSmrtDependencies(manifest)
289
299
  });
290
300
  break;
291
301
  }
@@ -845,7 +855,7 @@ function printSchemaAdvisories(advisories, options = {}) {
845
855
  log(`ℹ️ Live schema notes (${infos.length}, not applied):`);
846
856
  for (const item of infos) {
847
857
  log(` ${describeAdvisory(item)}`);
848
- if (options.verbose) {
858
+ if (options.verbose || item.type === "rename_data_pending") {
849
859
  log(` ${item.advisory.message}`);
850
860
  for (const suggestion of item.advisory.suggestedSql ?? []) log(` ↳ ${suggestion}`);
851
861
  }
@@ -2599,7 +2609,14 @@ function formatParityReport(report, options = {}) {
2599
2609
  lines.push(` ${SEVERITY_ICON[severity]} ${finding.message}`);
2600
2610
  if (options.verbose) lines.push(` → ${finding.recommendation}`);
2601
2611
  }
2602
- if (report.counts.info > 0 && !options.verbose) lines.push(` ℹ️ ${report.counts.info} informational finding(s) hidden; re-run with --verbose.`);
2612
+ const infoFindings = selectFindings(report, "info");
2613
+ const renameFindings = infoFindings.filter((finding) => finding.kind === "rename_data_pending");
2614
+ if (!options.verbose) for (const finding of renameFindings) {
2615
+ lines.push(` ${SEVERITY_ICON.info} ${finding.message}`);
2616
+ lines.push(` → ${finding.recommendation}`);
2617
+ }
2618
+ const hiddenInfoCount = options.verbose ? 0 : infoFindings.length - renameFindings.length;
2619
+ if (hiddenInfoCount > 0) lines.push(` ℹ️ ${hiddenInfoCount} informational finding(s) hidden; re-run with --verbose.`);
2603
2620
  if (report.findings.length === 0) lines.push(" ✅ Live schema matches the expected shape.");
2604
2621
  return lines;
2605
2622
  }
@@ -2642,8 +2659,24 @@ var SCHEMA_PROJECT_MANIFEST_SUFFIXES = [
2642
2659
  "/dist/manifest.json",
2643
2660
  "/src/manifest/manifest.json"
2644
2661
  ];
2662
+ /**
2663
+ * Decide whether a discovered manifest is the project-scoped build output
2664
+ * schema commands require.
2665
+ *
2666
+ * Object count alone is the wrong test. A pure-consumer project — 0 local
2667
+ * objects, every table coming from consumed package manifests, the shape
2668
+ * `template-sveltekit` documents — legitimately builds a manifest whose only
2669
+ * contribution is its `smrtDependencies` list, and the migration path creates
2670
+ * those packages' tables from `findPackageManifests()` regardless. Refusing it
2671
+ * with `missing_local_manifest` told the operator to define a local object,
2672
+ * which is the opposite of what such a project wants (issue #2925). What the
2673
+ * gate genuinely needs is evidence that the project itself was built: a
2674
+ * manifest at a current project-scoped path carrying either its own objects or
2675
+ * the consumed packages it aggregates.
2676
+ */
2645
2677
  function isSchemaProjectManifest(manifest) {
2646
- if (manifest.source !== "project" || manifest.objectCount <= 0) return false;
2678
+ if (manifest.source !== "project") return false;
2679
+ if (manifest.objectCount <= 0 && (manifest.smrtDependencies?.length ?? 0) === 0) return false;
2647
2680
  const manifestPath = manifest.path.replace(/\\/g, "/");
2648
2681
  return SCHEMA_PROJECT_MANIFEST_SUFFIXES.some((suffix) => manifestPath === suffix.slice(1) || manifestPath.endsWith(suffix));
2649
2682
  }
@@ -2750,7 +2783,7 @@ async function evaluateSchemaContract(options) {
2750
2783
  const inferredIndexes = /* @__PURE__ */ new Set();
2751
2784
  if (projectManifests.length === 0) failures.push({
2752
2785
  code: "missing_local_manifest",
2753
- message: "No local SMRT project manifest was loaded from .smrt/manifest.json, dist/manifest.json, or src/manifest/manifest.json. Package manifests from node_modules and legacy project manifest locations are not sufficient for schema commands."
2786
+ message: "No local SMRT project manifest was loaded from .smrt/manifest.json, dist/manifest.json, or src/manifest/manifest.json. Package manifests from node_modules and legacy project manifest locations are not sufficient for schema commands. A project with no local objects still qualifies once its build records the SMRT packages it consumes, so build the project before running schema commands."
2754
2787
  });
2755
2788
  const requiredObjects = (schemaContract.requiredObjects ?? []).map((ref) => {
2756
2789
  const entry = resolveClass(ref);
@@ -3014,14 +3047,6 @@ function summarizeSchemaDiff(diff) {
3014
3047
  recommendation: "Run `smrt db:migrate --drop-columns` to drop this orphan column (destructive)."
3015
3048
  });
3016
3049
  break;
3017
- case "rename_data_pending":
3018
- if (change.advisory?.severity !== "warning") break;
3019
- drift.push({
3020
- name: `${change.table}.${change.name ?? "(unknown)"}`,
3021
- type: "rename_data_pending",
3022
- recommendation: change.advisory?.message ?? "A declared column is empty while an undeclared column of a compatible type holds data — data appears to still live in the old column after a field rename. Run `smrt db:diff` for the suggested backfill SQL."
3023
- });
3024
- break;
3025
3050
  }
3026
3051
  return drift;
3027
3052
  }
package/dist/index.js CHANGED
@@ -49,63 +49,63 @@ var _playgroundCommands = null;
49
49
  var _workbenchCommands = null;
50
50
  async function getGnodeCommands() {
51
51
  if (!_gnodeCommands) {
52
- const { gnodeCommands } = await import("./commands-CCQjTTao.js");
52
+ const { gnodeCommands } = await import("./commands-D2o62iRL.js");
53
53
  _gnodeCommands = gnodeCommands;
54
54
  }
55
55
  return _gnodeCommands;
56
56
  }
57
57
  async function getGitCommands() {
58
58
  if (!_gitCommands) {
59
- const { gitCommands } = await import("./commands-CCQjTTao.js");
59
+ const { gitCommands } = await import("./commands-D2o62iRL.js");
60
60
  _gitCommands = gitCommands;
61
61
  }
62
62
  return _gitCommands;
63
63
  }
64
64
  async function getGenerateCommands() {
65
65
  if (!_generateCommands) {
66
- const { generateCommands } = await import("./commands-CCQjTTao.js");
66
+ const { generateCommands } = await import("./commands-D2o62iRL.js");
67
67
  _generateCommands = generateCommands;
68
68
  }
69
69
  return _generateCommands;
70
70
  }
71
71
  async function getInitCommands() {
72
72
  if (!_initCommands) {
73
- const { initCommands } = await import("./commands-CCQjTTao.js");
73
+ const { initCommands } = await import("./commands-D2o62iRL.js");
74
74
  _initCommands = initCommands;
75
75
  }
76
76
  return _initCommands;
77
77
  }
78
78
  async function getUtilityCommands() {
79
79
  if (!_utilityCommands) {
80
- const { utilityCommands } = await import("./commands-CCQjTTao.js");
80
+ const { utilityCommands } = await import("./commands-D2o62iRL.js");
81
81
  _utilityCommands = utilityCommands;
82
82
  }
83
83
  return _utilityCommands;
84
84
  }
85
85
  async function getDispatchCommands() {
86
86
  if (!_dispatchCommands) {
87
- const { dispatchCommands } = await import("./commands-CCQjTTao.js");
87
+ const { dispatchCommands } = await import("./commands-D2o62iRL.js");
88
88
  _dispatchCommands = dispatchCommands;
89
89
  }
90
90
  return _dispatchCommands;
91
91
  }
92
92
  async function getDocsCommands() {
93
93
  if (!_docsCommands) {
94
- const { docsCommands } = await import("./commands-CCQjTTao.js");
94
+ const { docsCommands } = await import("./commands-D2o62iRL.js");
95
95
  _docsCommands = docsCommands;
96
96
  }
97
97
  return _docsCommands;
98
98
  }
99
99
  async function getPlaygroundCommands() {
100
100
  if (!_playgroundCommands) {
101
- const { playgroundCommands } = await import("./commands-CCQjTTao.js");
101
+ const { playgroundCommands } = await import("./commands-D2o62iRL.js");
102
102
  _playgroundCommands = playgroundCommands;
103
103
  }
104
104
  return _playgroundCommands;
105
105
  }
106
106
  async function getWorkbenchCommands() {
107
107
  if (!_workbenchCommands) {
108
- const { workbenchCommands } = await import("./commands-CCQjTTao.js");
108
+ const { workbenchCommands } = await import("./commands-D2o62iRL.js");
109
109
  _workbenchCommands = workbenchCommands;
110
110
  }
111
111
  return _workbenchCommands;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happyvertical/smrt-cli",
3
- "version": "0.51.6",
3
+ "version": "0.51.8",
4
4
  "description": "Developer CLI for SMRT framework - introspection, testing, and project management",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -28,12 +28,12 @@
28
28
  "@happyvertical/ai": "^0.89.11",
29
29
  "@happyvertical/files": "^0.89.11",
30
30
  "@happyvertical/logger": "^0.89.11",
31
- "@happyvertical/smrt-agents": "0.51.6",
32
- "@happyvertical/smrt-config": "0.51.6",
33
- "@happyvertical/smrt-core": "0.51.6",
34
- "@happyvertical/smrt-dev-mcp": "0.51.6",
35
- "@happyvertical/smrt-playground": "0.51.6",
36
- "@happyvertical/smrt-types": "0.51.6",
31
+ "@happyvertical/smrt-agents": "0.51.8",
32
+ "@happyvertical/smrt-config": "0.51.8",
33
+ "@happyvertical/smrt-core": "0.51.8",
34
+ "@happyvertical/smrt-dev-mcp": "0.51.8",
35
+ "@happyvertical/smrt-playground": "0.51.8",
36
+ "@happyvertical/smrt-types": "0.51.8",
37
37
  "@happyvertical/sql": "^0.89.11",
38
38
  "@happyvertical/utils": "^0.89.11",
39
39
  "acorn": "^8.17.0",