@famgia/omnify-cli 2.0.46 → 2.0.48

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.js CHANGED
@@ -1641,7 +1641,7 @@ function writeGeneratorOutputs(outputs, rootDir) {
1641
1641
  }
1642
1642
  return { ...counts, migrationRecords };
1643
1643
  }
1644
- async function runPluginGeneration(plugins, schemas, rootDir, verbose, changes, localeConfig) {
1644
+ async function runPluginGeneration(plugins, schemas, rootDir, verbose, changes, localeConfig, force) {
1645
1645
  const pluginManager = new PluginManager({
1646
1646
  cwd: rootDir,
1647
1647
  verbose,
@@ -1656,7 +1656,7 @@ async function runPluginGeneration(plugins, schemas, rootDir, verbose, changes,
1656
1656
  for (const plugin of plugins) {
1657
1657
  await pluginManager.register(plugin);
1658
1658
  }
1659
- const result = await pluginManager.runGenerators(schemas, changes);
1659
+ const result = await pluginManager.runGenerators(schemas, changes, { force });
1660
1660
  if (!result.success) {
1661
1661
  for (const error of result.errors) {
1662
1662
  logger.error(`Generator ${error.generatorName} failed: ${error.message}`);
@@ -2264,7 +2264,8 @@ async function runGenerate(options) {
2264
2264
  rootDir,
2265
2265
  options.verbose ?? false,
2266
2266
  comparison.changes,
2267
- config.locale
2267
+ config.locale,
2268
+ options.force
2268
2269
  );
2269
2270
  migrationsGenerated = counts.migrations;
2270
2271
  typesGenerated = counts.types;
@@ -2495,7 +2496,7 @@ async function runGenerate(options) {
2495
2496
  }
2496
2497
  }
2497
2498
  function registerGenerateCommand(program) {
2498
- program.command("generate").description("Generate Laravel migrations and TypeScript types").option("-v, --verbose", "Show detailed output").option("--migrations-only", "Only generate migrations").option("--types-only", "Only generate TypeScript types").option("-f, --force", "Generate even if no changes detected").option("--check", "CI mode: check if migrations are in sync without generating (exits with code 1 if out of sync)").option("--no-warn-stale", "Disable stale migration warnings").action(async (options) => {
2499
+ program.command("generate").description("Generate Laravel migrations and TypeScript types").option("-v, --verbose", "Show detailed output").option("--migrations-only", "Only generate migrations").option("--types-only", "Only generate TypeScript types").option("-f, --force", "Force regenerate all migrations (overwrites existing files)").option("--check", "CI mode: check if migrations are in sync without generating (exits with code 1 if out of sync)").option("--no-warn-stale", "Disable stale migration warnings").action(async (options) => {
2499
2500
  try {
2500
2501
  await runGenerate(options);
2501
2502
  } catch (error) {