@famgia/omnify-cli 0.0.133 → 0.0.134

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/index.cjs CHANGED
@@ -1485,22 +1485,28 @@ async function runGenerate(options) {
1485
1485
  let schemas = await (0, import_omnify_core5.loadSchemas)(schemaPath);
1486
1486
  logger.debug(`Found ${Object.keys(schemas).length} schema(s) in main directory`);
1487
1487
  const additionalPaths = await loadRegisteredSchemaPaths(rootDir);
1488
+ let hasPackageSchemas = false;
1488
1489
  if (additionalPaths.length > 0) {
1489
1490
  logger.step(`Loading schemas from ${additionalPaths.length} registered path(s)`);
1490
1491
  for (const entry of additionalPaths) {
1491
1492
  const absolutePath = (0, import_node_path7.resolve)(rootDir, entry.path);
1492
1493
  logger.debug(` Checking: ${entry.path} \u2192 ${absolutePath}`);
1493
1494
  if ((0, import_node_fs5.existsSync)(absolutePath)) {
1494
- const packageSchemas = await (0, import_omnify_core5.loadSchemas)(absolutePath);
1495
- const count = Object.keys(packageSchemas).length;
1496
- logger.info(` \u2022 ${entry.path}: ${count} schema(s)`);
1495
+ const packageSchemas = await (0, import_omnify_core5.loadSchemas)(absolutePath, { skipPartialResolution: true });
1496
+ const count = Object.keys(packageSchemas).filter((k) => !k.startsWith("__partial__")).length;
1497
+ const partialCount = Object.keys(packageSchemas).filter((k) => k.startsWith("__partial__")).length;
1498
+ logger.info(` \u2022 ${entry.path}: ${count} schema(s)${partialCount > 0 ? ` + ${partialCount} partial(s)` : ""}`);
1497
1499
  schemas = { ...packageSchemas, ...schemas };
1500
+ hasPackageSchemas = true;
1498
1501
  } else {
1499
1502
  logger.warn(` \u2022 ${entry.path}: directory not found (skipped)`);
1500
1503
  logger.debug(` Resolved path: ${absolutePath}`);
1501
1504
  }
1502
1505
  }
1503
1506
  }
1507
+ if (hasPackageSchemas) {
1508
+ schemas = (0, import_omnify_core5.mergePartialSchemas)(schemas);
1509
+ }
1504
1510
  const schemaCount = Object.keys(schemas).length;
1505
1511
  if (schemaCount === 0) {
1506
1512
  logger.warn("No schema files found");