@famgia/omnify-cli 0.0.132 → 0.0.133

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/cli.js CHANGED
@@ -1029,15 +1029,22 @@ function generateAIGuides(rootDir, _plugins) {
1029
1029
  // src/commands/generate.ts
1030
1030
  async function loadRegisteredSchemaPaths(rootDir) {
1031
1031
  const schemaPathsFile = resolve7(rootDir, "storage/omnify/schema-paths.json");
1032
+ logger.debug(`Checking for registered schema paths at: ${schemaPathsFile}`);
1032
1033
  if (!existsSync5(schemaPathsFile)) {
1034
+ logger.debug("No registered schema paths file found");
1033
1035
  return [];
1034
1036
  }
1035
1037
  try {
1036
1038
  const content = readFileSync3(schemaPathsFile, "utf-8");
1037
1039
  const data = JSON.parse(content);
1038
- return data.paths ?? [];
1039
- } catch {
1040
- logger.debug("Could not read registered schema paths file");
1040
+ if (!data.paths || data.paths.length === 0) {
1041
+ logger.debug("No paths defined in schema-paths.json");
1042
+ return [];
1043
+ }
1044
+ logger.debug(`Found ${data.paths.length} registered schema path(s) in schema-paths.json`);
1045
+ return data.paths;
1046
+ } catch (error) {
1047
+ logger.warn(`Could not read schema-paths.json: ${error.message}`);
1041
1048
  return [];
1042
1049
  }
1043
1050
  }
@@ -1479,13 +1486,16 @@ async function runGenerate(options) {
1479
1486
  if (additionalPaths.length > 0) {
1480
1487
  logger.step(`Loading schemas from ${additionalPaths.length} registered path(s)`);
1481
1488
  for (const entry of additionalPaths) {
1482
- if (existsSync5(entry.path)) {
1483
- const packageSchemas = await loadSchemas3(entry.path);
1489
+ const absolutePath = resolve7(rootDir, entry.path);
1490
+ logger.debug(` Checking: ${entry.path} \u2192 ${absolutePath}`);
1491
+ if (existsSync5(absolutePath)) {
1492
+ const packageSchemas = await loadSchemas3(absolutePath);
1484
1493
  const count = Object.keys(packageSchemas).length;
1485
- logger.debug(` \u2022 ${entry.path}: ${count} schema(s)`);
1494
+ logger.info(` \u2022 ${entry.path}: ${count} schema(s)`);
1486
1495
  schemas = { ...packageSchemas, ...schemas };
1487
1496
  } else {
1488
1497
  logger.warn(` \u2022 ${entry.path}: directory not found (skipped)`);
1498
+ logger.debug(` Resolved path: ${absolutePath}`);
1489
1499
  }
1490
1500
  }
1491
1501
  }