@famgia/omnify-laravel 0.0.91 → 0.0.93

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
@@ -4187,11 +4187,19 @@ function getExistingMigrationTables(migrationsDir) {
4187
4187
  }
4188
4188
  var LARAVEL_CONFIG_SCHEMA = {
4189
4189
  fields: [
4190
+ {
4191
+ key: "base",
4192
+ type: "path",
4193
+ label: "Laravel Base Path",
4194
+ description: 'Base directory for Laravel project (e.g., "./backend/" for monorepo). All other paths are relative to this.',
4195
+ default: "",
4196
+ group: "output"
4197
+ },
4190
4198
  {
4191
4199
  key: "migrationsPath",
4192
4200
  type: "path",
4193
4201
  label: "Migrations Path",
4194
- description: "Directory for Laravel migration files (loaded via OmnifyServiceProvider)",
4202
+ description: "Directory for Laravel migration files (relative to base)",
4195
4203
  default: "database/migrations/omnify",
4196
4204
  group: "output"
4197
4205
  },
@@ -4199,7 +4207,7 @@ var LARAVEL_CONFIG_SCHEMA = {
4199
4207
  key: "modelsPath",
4200
4208
  type: "path",
4201
4209
  label: "Models Path",
4202
- description: "Directory for user-editable model files",
4210
+ description: "Directory for user-editable model files (relative to base)",
4203
4211
  default: "app/Models",
4204
4212
  group: "output"
4205
4213
  },
@@ -4301,27 +4309,33 @@ var LARAVEL_CONFIG_SCHEMA = {
4301
4309
  }
4302
4310
  ]
4303
4311
  };
4312
+ function joinPath(base, relativePath) {
4313
+ if (!base) return relativePath;
4314
+ const normalizedBase = base.replace(/\/+$/, "");
4315
+ return `${normalizedBase}/${relativePath}`;
4316
+ }
4304
4317
  function resolveOptions5(options) {
4318
+ const base = options?.base ?? "";
4305
4319
  return {
4306
- migrationsPath: options?.migrationsPath ?? "database/migrations/omnify",
4307
- modelsPath: options?.modelsPath ?? "app/Models",
4308
- baseModelsPath: options?.baseModelsPath ?? "app/Models/OmnifyBase",
4309
- providersPath: options?.providersPath ?? "app/Providers",
4320
+ migrationsPath: options?.migrationsPath ?? joinPath(base, "database/migrations/omnify"),
4321
+ modelsPath: options?.modelsPath ?? joinPath(base, "app/Models"),
4322
+ baseModelsPath: options?.baseModelsPath ?? joinPath(base, "app/Models/OmnifyBase"),
4323
+ providersPath: options?.providersPath ?? joinPath(base, "app/Providers"),
4310
4324
  modelNamespace: options?.modelNamespace ?? "App\\Models",
4311
4325
  baseModelNamespace: options?.baseModelNamespace ?? "App\\Models\\OmnifyBase",
4312
4326
  generateModels: options?.generateModels ?? true,
4313
- factoriesPath: options?.factoriesPath ?? "database/factories",
4327
+ factoriesPath: options?.factoriesPath ?? joinPath(base, "database/factories"),
4314
4328
  generateFactories: options?.generateFactories ?? true,
4315
4329
  fakerLocale: options?.fakerLocale ?? "en_US",
4316
4330
  connection: options?.connection,
4317
4331
  timestamp: options?.timestamp,
4318
- requestsPath: options?.requestsPath ?? "app/Http/Requests",
4319
- baseRequestsPath: options?.baseRequestsPath ?? "app/Http/Requests/OmnifyBase",
4332
+ requestsPath: options?.requestsPath ?? joinPath(base, "app/Http/Requests"),
4333
+ baseRequestsPath: options?.baseRequestsPath ?? joinPath(base, "app/Http/Requests/OmnifyBase"),
4320
4334
  requestNamespace: options?.requestNamespace ?? "App\\Http\\Requests",
4321
4335
  baseRequestNamespace: options?.baseRequestNamespace ?? "App\\Http\\Requests\\OmnifyBase",
4322
4336
  generateRequests: options?.generateRequests ?? false,
4323
- resourcesPath: options?.resourcesPath ?? "app/Http/Resources",
4324
- baseResourcesPath: options?.baseResourcesPath ?? "app/Http/Resources/OmnifyBase",
4337
+ resourcesPath: options?.resourcesPath ?? joinPath(base, "app/Http/Resources"),
4338
+ baseResourcesPath: options?.baseResourcesPath ?? joinPath(base, "app/Http/Resources/OmnifyBase"),
4325
4339
  resourceNamespace: options?.resourceNamespace ?? "App\\Http\\Resources",
4326
4340
  baseResourceNamespace: options?.baseResourceNamespace ?? "App\\Http\\Resources\\OmnifyBase",
4327
4341
  generateResources: options?.generateResources ?? false