@famgia/omnify-cli 0.0.132 → 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/cli.js +24 -7
- package/dist/cli.js.map +1 -1
- package/dist/index.cjs +23 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +24 -7
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -1031,15 +1031,22 @@ function generateAIGuides(rootDir, _plugins) {
|
|
|
1031
1031
|
// src/commands/generate.ts
|
|
1032
1032
|
async function loadRegisteredSchemaPaths(rootDir) {
|
|
1033
1033
|
const schemaPathsFile = (0, import_node_path7.resolve)(rootDir, "storage/omnify/schema-paths.json");
|
|
1034
|
+
logger.debug(`Checking for registered schema paths at: ${schemaPathsFile}`);
|
|
1034
1035
|
if (!(0, import_node_fs5.existsSync)(schemaPathsFile)) {
|
|
1036
|
+
logger.debug("No registered schema paths file found");
|
|
1035
1037
|
return [];
|
|
1036
1038
|
}
|
|
1037
1039
|
try {
|
|
1038
1040
|
const content = (0, import_node_fs5.readFileSync)(schemaPathsFile, "utf-8");
|
|
1039
1041
|
const data = JSON.parse(content);
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1042
|
+
if (!data.paths || data.paths.length === 0) {
|
|
1043
|
+
logger.debug("No paths defined in schema-paths.json");
|
|
1044
|
+
return [];
|
|
1045
|
+
}
|
|
1046
|
+
logger.debug(`Found ${data.paths.length} registered schema path(s) in schema-paths.json`);
|
|
1047
|
+
return data.paths;
|
|
1048
|
+
} catch (error) {
|
|
1049
|
+
logger.warn(`Could not read schema-paths.json: ${error.message}`);
|
|
1043
1050
|
return [];
|
|
1044
1051
|
}
|
|
1045
1052
|
}
|
|
@@ -1478,19 +1485,28 @@ async function runGenerate(options) {
|
|
|
1478
1485
|
let schemas = await (0, import_omnify_core5.loadSchemas)(schemaPath);
|
|
1479
1486
|
logger.debug(`Found ${Object.keys(schemas).length} schema(s) in main directory`);
|
|
1480
1487
|
const additionalPaths = await loadRegisteredSchemaPaths(rootDir);
|
|
1488
|
+
let hasPackageSchemas = false;
|
|
1481
1489
|
if (additionalPaths.length > 0) {
|
|
1482
1490
|
logger.step(`Loading schemas from ${additionalPaths.length} registered path(s)`);
|
|
1483
1491
|
for (const entry of additionalPaths) {
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1492
|
+
const absolutePath = (0, import_node_path7.resolve)(rootDir, entry.path);
|
|
1493
|
+
logger.debug(` Checking: ${entry.path} \u2192 ${absolutePath}`);
|
|
1494
|
+
if ((0, import_node_fs5.existsSync)(absolutePath)) {
|
|
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)` : ""}`);
|
|
1488
1499
|
schemas = { ...packageSchemas, ...schemas };
|
|
1500
|
+
hasPackageSchemas = true;
|
|
1489
1501
|
} else {
|
|
1490
1502
|
logger.warn(` \u2022 ${entry.path}: directory not found (skipped)`);
|
|
1503
|
+
logger.debug(` Resolved path: ${absolutePath}`);
|
|
1491
1504
|
}
|
|
1492
1505
|
}
|
|
1493
1506
|
}
|
|
1507
|
+
if (hasPackageSchemas) {
|
|
1508
|
+
schemas = (0, import_omnify_core5.mergePartialSchemas)(schemas);
|
|
1509
|
+
}
|
|
1494
1510
|
const schemaCount = Object.keys(schemas).length;
|
|
1495
1511
|
if (schemaCount === 0) {
|
|
1496
1512
|
logger.warn("No schema files found");
|