@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.cjs CHANGED
@@ -1652,7 +1652,7 @@ function writeGeneratorOutputs(outputs, rootDir) {
1652
1652
  }
1653
1653
  return { ...counts, migrationRecords };
1654
1654
  }
1655
- async function runPluginGeneration(plugins, schemas, rootDir, verbose, changes, localeConfig) {
1655
+ async function runPluginGeneration(plugins, schemas, rootDir, verbose, changes, localeConfig, force) {
1656
1656
  const pluginManager = new import_omnify_core5.PluginManager({
1657
1657
  cwd: rootDir,
1658
1658
  verbose,
@@ -1667,7 +1667,7 @@ async function runPluginGeneration(plugins, schemas, rootDir, verbose, changes,
1667
1667
  for (const plugin of plugins) {
1668
1668
  await pluginManager.register(plugin);
1669
1669
  }
1670
- const result = await pluginManager.runGenerators(schemas, changes);
1670
+ const result = await pluginManager.runGenerators(schemas, changes, { force });
1671
1671
  if (!result.success) {
1672
1672
  for (const error of result.errors) {
1673
1673
  logger.error(`Generator ${error.generatorName} failed: ${error.message}`);
@@ -2275,7 +2275,8 @@ async function runGenerate(options) {
2275
2275
  rootDir,
2276
2276
  options.verbose ?? false,
2277
2277
  comparison.changes,
2278
- config.locale
2278
+ config.locale,
2279
+ options.force
2279
2280
  );
2280
2281
  migrationsGenerated = counts.migrations;
2281
2282
  typesGenerated = counts.types;
@@ -2506,7 +2507,7 @@ async function runGenerate(options) {
2506
2507
  }
2507
2508
  }
2508
2509
  function registerGenerateCommand(program) {
2509
- 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) => {
2510
+ 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) => {
2510
2511
  try {
2511
2512
  await runGenerate(options);
2512
2513
  } catch (error) {