@famgia/omnify-laravel 0.0.58 → 0.0.60
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/{chunk-TIMQTRAC.js → chunk-VDTFK4UL.js} +7 -2
- package/dist/{chunk-TIMQTRAC.js.map → chunk-VDTFK4UL.js.map} +1 -1
- package/dist/index.cjs +10 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +42 -1
- package/dist/index.d.ts +42 -1
- package/dist/index.js +5 -1
- package/dist/plugin.cjs +4 -1
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.js +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -338,4 +338,45 @@ declare function getModelPath(model: GeneratedModel): string;
|
|
|
338
338
|
*/
|
|
339
339
|
declare function generateProviderRegistration(existingContent: string | null, laravelVersion: 'laravel11+' | 'laravel10-'): ProviderRegistrationResult | null;
|
|
340
340
|
|
|
341
|
-
|
|
341
|
+
/**
|
|
342
|
+
* Laravel Factory Generator
|
|
343
|
+
*
|
|
344
|
+
* Generates Laravel factory files for Eloquent models.
|
|
345
|
+
*/
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Options for factory generation.
|
|
349
|
+
*/
|
|
350
|
+
interface FactoryGeneratorOptions {
|
|
351
|
+
/** Model namespace */
|
|
352
|
+
modelNamespace?: string;
|
|
353
|
+
/** Factory output path */
|
|
354
|
+
factoryPath?: string;
|
|
355
|
+
/** Faker locale */
|
|
356
|
+
fakerLocale?: string;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Generated factory output.
|
|
360
|
+
*/
|
|
361
|
+
interface GeneratedFactory {
|
|
362
|
+
/** Factory class name */
|
|
363
|
+
name: string;
|
|
364
|
+
/** Schema name this factory is for */
|
|
365
|
+
schemaName: string;
|
|
366
|
+
/** Output path for the factory file */
|
|
367
|
+
path: string;
|
|
368
|
+
/** Generated factory content */
|
|
369
|
+
content: string;
|
|
370
|
+
/** Whether to overwrite if exists */
|
|
371
|
+
overwrite: boolean;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Generates factories for all schemas.
|
|
375
|
+
*/
|
|
376
|
+
declare function generateFactories(schemas: SchemaCollection, options?: FactoryGeneratorOptions): GeneratedFactory[];
|
|
377
|
+
/**
|
|
378
|
+
* Gets the output path for a factory.
|
|
379
|
+
*/
|
|
380
|
+
declare function getFactoryPath(factory: GeneratedFactory): string;
|
|
381
|
+
|
|
382
|
+
export { type ColumnMethod, type ColumnModifier, type FactoryGeneratorOptions, type ForeignKeyDefinition, type GeneratedFactory, type GeneratedModel, type IndexDefinition, type MigrationDefinition, type MigrationFile, type MigrationOperation, type MigrationOptions, type ModelGeneratorOptions, type ProviderRegistrationResult, type TableBlueprint, formatColumnMethod, formatForeignKey, formatIndex, formatMigrationFile, generateAlterMigration, generateDropMigrationForTable, generateDropTableMigration, generateFactories, generateForeignKey, generateMigrationFromSchema, generateMigrations, generateMigrationsFromChanges, generateModels, generatePrimaryKeyColumn, generateProviderRegistration, generateSoftDeleteColumn, generateTimestampColumns, getFactoryPath, getMigrationPath, getModelPath, propertyToColumnMethod, schemaToBlueprint, toColumnName, toTableName };
|
package/dist/index.d.ts
CHANGED
|
@@ -338,4 +338,45 @@ declare function getModelPath(model: GeneratedModel): string;
|
|
|
338
338
|
*/
|
|
339
339
|
declare function generateProviderRegistration(existingContent: string | null, laravelVersion: 'laravel11+' | 'laravel10-'): ProviderRegistrationResult | null;
|
|
340
340
|
|
|
341
|
-
|
|
341
|
+
/**
|
|
342
|
+
* Laravel Factory Generator
|
|
343
|
+
*
|
|
344
|
+
* Generates Laravel factory files for Eloquent models.
|
|
345
|
+
*/
|
|
346
|
+
|
|
347
|
+
/**
|
|
348
|
+
* Options for factory generation.
|
|
349
|
+
*/
|
|
350
|
+
interface FactoryGeneratorOptions {
|
|
351
|
+
/** Model namespace */
|
|
352
|
+
modelNamespace?: string;
|
|
353
|
+
/** Factory output path */
|
|
354
|
+
factoryPath?: string;
|
|
355
|
+
/** Faker locale */
|
|
356
|
+
fakerLocale?: string;
|
|
357
|
+
}
|
|
358
|
+
/**
|
|
359
|
+
* Generated factory output.
|
|
360
|
+
*/
|
|
361
|
+
interface GeneratedFactory {
|
|
362
|
+
/** Factory class name */
|
|
363
|
+
name: string;
|
|
364
|
+
/** Schema name this factory is for */
|
|
365
|
+
schemaName: string;
|
|
366
|
+
/** Output path for the factory file */
|
|
367
|
+
path: string;
|
|
368
|
+
/** Generated factory content */
|
|
369
|
+
content: string;
|
|
370
|
+
/** Whether to overwrite if exists */
|
|
371
|
+
overwrite: boolean;
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Generates factories for all schemas.
|
|
375
|
+
*/
|
|
376
|
+
declare function generateFactories(schemas: SchemaCollection, options?: FactoryGeneratorOptions): GeneratedFactory[];
|
|
377
|
+
/**
|
|
378
|
+
* Gets the output path for a factory.
|
|
379
|
+
*/
|
|
380
|
+
declare function getFactoryPath(factory: GeneratedFactory): string;
|
|
381
|
+
|
|
382
|
+
export { type ColumnMethod, type ColumnModifier, type FactoryGeneratorOptions, type ForeignKeyDefinition, type GeneratedFactory, type GeneratedModel, type IndexDefinition, type MigrationDefinition, type MigrationFile, type MigrationOperation, type MigrationOptions, type ModelGeneratorOptions, type ProviderRegistrationResult, type TableBlueprint, formatColumnMethod, formatForeignKey, formatIndex, formatMigrationFile, generateAlterMigration, generateDropMigrationForTable, generateDropTableMigration, generateFactories, generateForeignKey, generateMigrationFromSchema, generateMigrations, generateMigrationsFromChanges, generateModels, generatePrimaryKeyColumn, generateProviderRegistration, generateSoftDeleteColumn, generateTimestampColumns, getFactoryPath, getMigrationPath, getModelPath, propertyToColumnMethod, schemaToBlueprint, toColumnName, toTableName };
|
package/dist/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
generateAlterMigration,
|
|
7
7
|
generateDropMigrationForTable,
|
|
8
8
|
generateDropTableMigration,
|
|
9
|
+
generateFactories,
|
|
9
10
|
generateForeignKey,
|
|
10
11
|
generateMigrationFromSchema,
|
|
11
12
|
generateMigrations,
|
|
@@ -15,6 +16,7 @@ import {
|
|
|
15
16
|
generateProviderRegistration,
|
|
16
17
|
generateSoftDeleteColumn,
|
|
17
18
|
generateTimestampColumns,
|
|
19
|
+
getFactoryPath,
|
|
18
20
|
getMigrationPath,
|
|
19
21
|
getModelPath,
|
|
20
22
|
laravelPlugin,
|
|
@@ -22,7 +24,7 @@ import {
|
|
|
22
24
|
schemaToBlueprint,
|
|
23
25
|
toColumnName,
|
|
24
26
|
toTableName
|
|
25
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-VDTFK4UL.js";
|
|
26
28
|
export {
|
|
27
29
|
formatColumnMethod,
|
|
28
30
|
formatForeignKey,
|
|
@@ -31,6 +33,7 @@ export {
|
|
|
31
33
|
generateAlterMigration,
|
|
32
34
|
generateDropMigrationForTable,
|
|
33
35
|
generateDropTableMigration,
|
|
36
|
+
generateFactories,
|
|
34
37
|
generateForeignKey,
|
|
35
38
|
generateMigrationFromSchema,
|
|
36
39
|
generateMigrations,
|
|
@@ -40,6 +43,7 @@ export {
|
|
|
40
43
|
generateProviderRegistration,
|
|
41
44
|
generateSoftDeleteColumn,
|
|
42
45
|
generateTimestampColumns,
|
|
46
|
+
getFactoryPath,
|
|
43
47
|
getMigrationPath,
|
|
44
48
|
getModelPath,
|
|
45
49
|
laravelPlugin,
|
package/dist/plugin.cjs
CHANGED
|
@@ -2077,7 +2077,7 @@ class {{CLASS_NAME}}Locales
|
|
|
2077
2077
|
return stubs[stubName] ?? "";
|
|
2078
2078
|
}
|
|
2079
2079
|
function generateServiceProvider(schemas, options, stubContent) {
|
|
2080
|
-
const morphMap = Object.values(schemas).filter((s) => s.kind !== "enum").map((s) => {
|
|
2080
|
+
const morphMap = Object.values(schemas).filter((s) => s.kind !== "enum" && s.options?.hidden !== true).map((s) => {
|
|
2081
2081
|
const className = toPascalCase(s.name);
|
|
2082
2082
|
return ` '${s.name}' => \\${options.modelNamespace}\\${className}::class,`;
|
|
2083
2083
|
}).join("\n");
|
|
@@ -2126,6 +2126,9 @@ function generateModels(schemas, options) {
|
|
|
2126
2126
|
if (schema.kind === "enum") {
|
|
2127
2127
|
continue;
|
|
2128
2128
|
}
|
|
2129
|
+
if (schema.options?.hidden === true) {
|
|
2130
|
+
continue;
|
|
2131
|
+
}
|
|
2129
2132
|
models.push(generateLocalesClass(schema, resolved, getStubContent("locales")));
|
|
2130
2133
|
models.push(generateEntityBaseModel(
|
|
2131
2134
|
schema,
|