@famgia/omnify-cli 2.0.16 → 2.0.18

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
@@ -1720,7 +1720,8 @@ function runDirectGeneration(schemas, config, rootDir, options, changes) {
1720
1720
  tableName,
1721
1721
  type: "create",
1722
1722
  schemas: migration.schemaName ? [migration.schemaName] : [],
1723
- content: migration.content
1723
+ content: migration.content,
1724
+ outputPath: config.output.laravel.migrationsPath
1724
1725
  });
1725
1726
  }
1726
1727
  }
@@ -1741,7 +1742,8 @@ function runDirectGeneration(schemas, config, rootDir, options, changes) {
1741
1742
  tableName,
1742
1743
  type: migration.type,
1743
1744
  schemas: [],
1744
- content: migration.content
1745
+ content: migration.content,
1746
+ outputPath: config.output.laravel.migrationsPath
1745
1747
  });
1746
1748
  }
1747
1749
  }
@@ -3354,12 +3356,31 @@ async function runAIGuides(options) {
3354
3356
  } catch {
3355
3357
  logger.debug("No omnify.config.ts found, using defaults");
3356
3358
  }
3357
- let categories = getAvailableCategories();
3359
+ const availableCategories = getAvailableCategories();
3360
+ let categories = availableCategories;
3358
3361
  if (options.categories) {
3359
- categories = options.categories.split(",").map((c) => c.trim());
3362
+ const requestedCategories = options.categories.split(",").map((c) => c.trim());
3363
+ const invalidCategories = requestedCategories.filter(
3364
+ (c) => !availableCategories.includes(c)
3365
+ );
3366
+ if (invalidCategories.length > 0) {
3367
+ logger.error(`Invalid category: ${invalidCategories.join(", ")}`);
3368
+ logger.error(`Available categories: ${availableCategories.join(", ")}`);
3369
+ throw new Error(`Invalid category: ${invalidCategories.join(", ")}`);
3370
+ }
3371
+ categories = requestedCategories;
3360
3372
  logger.debug(`Categories (from CLI): ${categories.join(", ")}`);
3361
3373
  } else if (configAiGuides?.categories) {
3362
- categories = [...configAiGuides.categories];
3374
+ const invalidCategories = configAiGuides.categories.filter(
3375
+ (c) => !availableCategories.includes(c)
3376
+ );
3377
+ if (invalidCategories.length > 0) {
3378
+ logger.warn(`Invalid category in config: ${invalidCategories.join(", ")}`);
3379
+ logger.warn(`Available categories: ${availableCategories.join(", ")}`);
3380
+ }
3381
+ categories = configAiGuides.categories.filter(
3382
+ (c) => availableCategories.includes(c)
3383
+ );
3363
3384
  logger.debug(`Categories (from config): ${categories.join(", ")}`);
3364
3385
  }
3365
3386
  let adapters;