@famgia/omnify 0.12.8 → 1.0.0

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.
Files changed (78) hide show
  1. package/README.md +68 -102
  2. package/dist/index.cjs +101 -0
  3. package/dist/index.cjs.map +1 -0
  4. package/dist/index.d.cts +4 -0
  5. package/dist/index.d.ts +4 -7
  6. package/dist/index.js +78 -22
  7. package/dist/index.js.map +1 -1
  8. package/package.json +34 -65
  9. package/CHANGELOG.md +0 -129
  10. package/dist/__tests__/generators/contextGenerator.test.d.ts +0 -2
  11. package/dist/__tests__/generators/contextGenerator.test.d.ts.map +0 -1
  12. package/dist/__tests__/generators/contextGenerator.test.js +0 -109
  13. package/dist/__tests__/generators/contextGenerator.test.js.map +0 -1
  14. package/dist/__tests__/generators/enumGenerator.test.d.ts +0 -2
  15. package/dist/__tests__/generators/enumGenerator.test.d.ts.map +0 -1
  16. package/dist/__tests__/generators/enumGenerator.test.js +0 -151
  17. package/dist/__tests__/generators/enumGenerator.test.js.map +0 -1
  18. package/dist/__tests__/generators/modelGenerator.test.d.ts +0 -2
  19. package/dist/__tests__/generators/modelGenerator.test.d.ts.map +0 -1
  20. package/dist/__tests__/generators/modelGenerator.test.js +0 -329
  21. package/dist/__tests__/generators/modelGenerator.test.js.map +0 -1
  22. package/dist/__tests__/utils/pascalCase.test.d.ts +0 -1
  23. package/dist/__tests__/utils/pascalCase.test.d.ts.map +0 -1
  24. package/dist/__tests__/utils/pascalCase.test.js +0 -75
  25. package/dist/__tests__/utils/pascalCase.test.js.map +0 -1
  26. package/dist/__tests__/utils/typeMapper.test.d.ts +0 -2
  27. package/dist/__tests__/utils/typeMapper.test.d.ts.map +0 -1
  28. package/dist/__tests__/utils/typeMapper.test.js +0 -41
  29. package/dist/__tests__/utils/typeMapper.test.js.map +0 -1
  30. package/dist/cli.d.ts +0 -3
  31. package/dist/cli.d.ts.map +0 -1
  32. package/dist/cli.js +0 -248
  33. package/dist/cli.js.map +0 -1
  34. package/dist/generators/commonTypesGenerator.d.ts +0 -5
  35. package/dist/generators/commonTypesGenerator.d.ts.map +0 -1
  36. package/dist/generators/commonTypesGenerator.js +0 -37
  37. package/dist/generators/commonTypesGenerator.js.map +0 -1
  38. package/dist/generators/contextGenerator.d.ts +0 -3
  39. package/dist/generators/contextGenerator.d.ts.map +0 -1
  40. package/dist/generators/contextGenerator.js +0 -248
  41. package/dist/generators/contextGenerator.js.map +0 -1
  42. package/dist/generators/enumGenerator.d.ts +0 -13
  43. package/dist/generators/enumGenerator.d.ts.map +0 -1
  44. package/dist/generators/enumGenerator.js +0 -83
  45. package/dist/generators/enumGenerator.js.map +0 -1
  46. package/dist/generators/hooksGenerator.d.ts +0 -4
  47. package/dist/generators/hooksGenerator.d.ts.map +0 -1
  48. package/dist/generators/hooksGenerator.js +0 -265
  49. package/dist/generators/hooksGenerator.js.map +0 -1
  50. package/dist/generators/modelGenerator.d.ts +0 -13
  51. package/dist/generators/modelGenerator.d.ts.map +0 -1
  52. package/dist/generators/modelGenerator.js +0 -208
  53. package/dist/generators/modelGenerator.js.map +0 -1
  54. package/dist/index.d.ts.map +0 -1
  55. package/dist/runtime/hooks/useFormSubmit.d.ts +0 -36
  56. package/dist/runtime/hooks/useFormSubmit.d.ts.map +0 -1
  57. package/dist/runtime/hooks/useFormSubmit.js +0 -86
  58. package/dist/runtime/hooks/useFormSubmit.js.map +0 -1
  59. package/dist/runtime/index.d.ts +0 -5
  60. package/dist/runtime/index.d.ts.map +0 -1
  61. package/dist/runtime/index.js +0 -21
  62. package/dist/runtime/index.js.map +0 -1
  63. package/dist/runtime/lib/axios.d.ts +0 -7
  64. package/dist/runtime/lib/axios.d.ts.map +0 -1
  65. package/dist/runtime/lib/axios.js +0 -54
  66. package/dist/runtime/lib/axios.js.map +0 -1
  67. package/dist/runtime/lib/validation.d.ts +0 -50
  68. package/dist/runtime/lib/validation.d.ts.map +0 -1
  69. package/dist/runtime/lib/validation.js +0 -85
  70. package/dist/runtime/lib/validation.js.map +0 -1
  71. package/dist/types.d.ts +0 -40
  72. package/dist/types.d.ts.map +0 -1
  73. package/dist/types.js +0 -3
  74. package/dist/types.js.map +0 -1
  75. package/dist/utils/typeMapper.d.ts +0 -6
  76. package/dist/utils/typeMapper.d.ts.map +0 -1
  77. package/dist/utils/typeMapper.js +0 -85
  78. package/dist/utils/typeMapper.js.map +0 -1
package/README.md CHANGED
@@ -1,21 +1,6 @@
1
1
  # @famgia/omnify
2
2
 
3
- Complete Laravel + React solution: Schema-to-TypeScript generation + Runtime helpers for forms
4
-
5
- ## Features
6
-
7
- ### 🎯 Build-time (Code Generation)
8
- - ✅ Convert Omnify `schema-lock.json` to TypeScript types
9
- - ✅ Generate enum types and options
10
- - ✅ Generate model interfaces with relations
11
- - ✅ Generate Enums Context Provider with type-safe helpers
12
- - ✅ Watch mode for auto-regeneration
13
-
14
- ### 🚀 Runtime (React Helpers)
15
- - ✅ `useFormSubmit` - Auto Laravel validation error mapping
16
- - ✅ `createLaravelAxios` - Pre-configured axios for Laravel
17
- - ✅ `getCsrfCookie` - CSRF token helper
18
- - ✅ Full TypeScript support
3
+ Schema-driven database migration system with TypeScript types and Laravel migrations.
19
4
 
20
5
  ## Installation
21
6
 
@@ -23,113 +8,94 @@ Complete Laravel + React solution: Schema-to-TypeScript generation + Runtime hel
23
8
  npm install @famgia/omnify
24
9
  ```
25
10
 
26
- ## Usage
27
-
28
- ### 1. Generate Types (Build-time)
29
-
11
+ For CLI usage:
30
12
  ```bash
31
- # In frontend project
32
- npx omnify-build --output src/omnify
13
+ npm install -g @famgia/omnify-cli
14
+ ```
33
15
 
34
- # Watch mode
35
- npx omnify-build --output src/omnify --watch
16
+ ## Quick Start
17
+
18
+ ### 1. Create schema files
19
+
20
+ ```yaml
21
+ # schemas/user.yaml
22
+ name: User
23
+ properties:
24
+ email:
25
+ type: String
26
+ unique: true
27
+ name:
28
+ type: String
29
+ age:
30
+ type: Int
31
+ nullable: true
32
+ options:
33
+ timestamps: true
34
+ softDelete: true
36
35
  ```
37
36
 
38
- ### 2. Use Generated Types & Enums
37
+ ### 2. Generate migrations
39
38
 
40
- ```typescript
41
- import { User, Company } from '@/omnify/models';
42
- import { useEnums } from '@/omnify';
43
-
44
- function MyForm() {
45
- const { getOptions, getPrefecturesAsNumbers } = useEnums();
46
-
47
- const accountTypeOptions = getOptions('ApplicationForm', 'account_type');
48
- const prefectureOptions = getPrefecturesAsNumbers();
49
-
50
- return <Select options={accountTypeOptions} />;
51
- }
39
+ ```bash
40
+ omnify generate
52
41
  ```
53
42
 
54
- ### 3. Use Runtime Helpers
43
+ ### 3. Use programmatically
55
44
 
56
45
  ```typescript
57
- import { useFormSubmit, getCsrfCookie } from '@famgia/omnify';
58
- import { Form, Button } from 'antd';
59
-
60
- function MyForm() {
61
- const [form] = Form.useForm();
62
- const apiUrl = process.env.NEXT_PUBLIC_API_URL;
63
-
64
- const { handleSubmit, loading } = useFormSubmit({
65
- form,
66
- submitFn: createUser,
67
- getCsrfToken: () => getCsrfCookie(apiUrl!),
68
- onSuccess: (response) => {
69
- message.success('Success!');
70
- },
71
- });
72
-
73
- return (
74
- <Form form={form} onFinish={handleSubmit}>
75
- <Form.Item name="email">
76
- <Input />
77
- </Form.Item>
78
- <Button type="primary" htmlType="submit" loading={loading}>
79
- Submit
80
- </Button>
81
- </Form>
82
- );
46
+ import {
47
+ loadSchemas,
48
+ validateSchemas,
49
+ generateMigration,
50
+ generateTypeScript,
51
+ } from '@famgia/omnify';
52
+
53
+ // Load and validate schemas
54
+ const schemas = await loadSchemas('./schemas');
55
+ const result = validateSchemas(schemas);
56
+
57
+ if (result.valid) {
58
+ // Generate Laravel migrations
59
+ const migration = generateMigration(schemas.User);
60
+
61
+ // Generate TypeScript types
62
+ const types = generateTypeScript(schemas);
83
63
  }
84
64
  ```
85
65
 
86
- ## API
87
-
88
- ### `useFormSubmit<TResponse>(options)`
66
+ ## Packages
89
67
 
90
- Hook for form submission with automatic Laravel validation error mapping.
68
+ This is the main entry point that includes:
91
69
 
92
- **Options:**
93
- - `form: FormInstance` - Ant Design form instance
94
- - `submitFn: (values) => Promise<TResponse>` - API call function
95
- - `getCsrfToken?: () => Promise<void>` - CSRF token getter
96
- - `onSuccess?: (response, values) => void` - Success callback
97
- - `onError?: (error, values) => void` - Custom error handler
98
- - `errorMessages?: { 500?, 401?, 403?, default? }` - Custom error messages
70
+ | Package | Description |
71
+ |---------|-------------|
72
+ | [@famgia/omnify-core](https://www.npmjs.com/package/@famgia/omnify-core) | Core schema loading and validation |
73
+ | [@famgia/omnify-types](https://www.npmjs.com/package/@famgia/omnify-types) | TypeScript type definitions |
74
+ | [@famgia/omnify-laravel](https://www.npmjs.com/package/@famgia/omnify-laravel) | Laravel migration generator |
75
+ | [@famgia/omnify-atlas](https://www.npmjs.com/package/@famgia/omnify-atlas) | Atlas CLI integration |
76
+ | [@famgia/omnify-cli](https://www.npmjs.com/package/@famgia/omnify-cli) | Command-line interface |
77
+ | [@famgia/omnify-japan](https://www.npmjs.com/package/@famgia/omnify-japan) | Japan-specific types plugin |
99
78
 
100
- **Returns:**
101
- - `handleSubmit: (values) => Promise<void>` - Submit handler
102
- - `loading: boolean` - Loading state
103
- - `setLoading: (loading) => void` - Set loading manually
104
-
105
- ### `createLaravelAxios(baseURL)`
106
-
107
- Create pre-configured axios instance for Laravel API.
108
-
109
- ```typescript
110
- import { createLaravelAxios } from '@famgia/omnify';
111
-
112
- const axios = createLaravelAxios('https://api.example.com');
113
- ```
79
+ ## Features
114
80
 
115
- ### `getCsrfCookie(baseURL)`
81
+ - YAML/JSON schema definitions
82
+ - Laravel PHP migration generation
83
+ - TypeScript type generation
84
+ - Atlas HCL schema generation
85
+ - Plugin system for custom types
86
+ - Schema validation with detailed errors
87
+ - Relationship and association handling
116
88
 
117
- Get CSRF cookie for Laravel Sanctum.
89
+ ## Migration from @famgia/omnify (old)
118
90
 
119
- ```typescript
120
- import { getCsrfCookie } from '@famgia/omnify';
91
+ If you were using the old `@famgia/omnify` package (v0.12.x), it has been renamed to `@famgia/omnify-old`:
121
92
 
122
- await getCsrfCookie('https://api.example.com');
93
+ ```bash
94
+ npm uninstall @famgia/omnify
95
+ npm install @famgia/omnify-old
123
96
  ```
124
97
 
125
- ## Benefits
126
-
127
- - 🚀 Reduce 100+ lines of boilerplate per form
128
- - 🛡️ Type-safe enums and models
129
- - 🔄 Auto-sync with backend schema
130
- - 📝 Consistent error handling
131
- - ⚡ Build-time code generation
132
- - 🎯 Runtime helpers for common tasks
98
+ The old package provided runtime helpers for React/Antd forms. The new `@famgia/omnify` focuses on schema-driven code generation.
133
99
 
134
100
  ## License
135
101
 
package/dist/index.cjs ADDED
@@ -0,0 +1,101 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ Omnify: () => import_omnify_core.Omnify,
24
+ PluginManager: () => import_omnify_core.PluginManager,
25
+ compareSchemas: () => import_omnify_atlas.compareSchemas,
26
+ createOmnify: () => import_omnify_core.createOmnify,
27
+ diffHclSchemas: () => import_omnify_atlas.diffHclSchemas,
28
+ findReferencedSchemas: () => import_omnify_core.findReferencedSchemas,
29
+ findReferencingSchemas: () => import_omnify_core.findReferencingSchemas,
30
+ generateEnums: () => import_omnify_laravel.generateEnums,
31
+ generateHclSchema: () => import_omnify_atlas.generateHclSchema,
32
+ generateInterfaces: () => import_omnify_laravel.generateInterfaces,
33
+ generateMigrationFromSchema: () => import_omnify_laravel.generateMigrationFromSchema,
34
+ generateMigrations: () => import_omnify_laravel.generateMigrations,
35
+ generatePreview: () => import_omnify_atlas.generatePreview,
36
+ generateTypeScript: () => import_omnify_laravel.generateTypeScript,
37
+ generateTypeScriptFile: () => import_omnify_laravel.generateTypeScriptFile,
38
+ getEntitySchemas: () => import_omnify_core.getEntitySchemas,
39
+ getEnumSchemas: () => import_omnify_core.getEnumSchemas,
40
+ getGroups: () => import_omnify_core.getGroups,
41
+ getRelationshipGraph: () => import_omnify_core.getRelationshipGraph,
42
+ getSchemaMetadata: () => import_omnify_core.getSchemaMetadata,
43
+ getSchemaNames: () => import_omnify_core.getSchemaNames,
44
+ getSchemasByGroup: () => import_omnify_core.getSchemasByGroup,
45
+ getTopologicalOrder: () => import_omnify_core.getTopologicalOrder,
46
+ hasCircularReferences: () => import_omnify_core.hasCircularReferences,
47
+ introspectSchema: () => import_omnify_core.introspectSchema,
48
+ introspectSchemas: () => import_omnify_core.introspectSchemas,
49
+ loadSchemas: () => import_omnify_core.loadSchemas,
50
+ parseDiffOutput: () => import_omnify_atlas.parseDiffOutput,
51
+ readLockFile: () => import_omnify_atlas.readLockFile,
52
+ renderHcl: () => import_omnify_atlas.renderHcl,
53
+ runAtlasDiff: () => import_omnify_atlas.runAtlasDiff,
54
+ schemaToBlueprint: () => import_omnify_laravel.schemaToBlueprint,
55
+ schemaToInterface: () => import_omnify_laravel.schemaToInterface,
56
+ validateSchemas: () => import_omnify_core.validateSchemas,
57
+ writeLockFile: () => import_omnify_atlas.writeLockFile
58
+ });
59
+ module.exports = __toCommonJS(index_exports);
60
+ var import_omnify_core = require("@famgia/omnify-core");
61
+ var import_omnify_laravel = require("@famgia/omnify-laravel");
62
+ var import_omnify_atlas = require("@famgia/omnify-atlas");
63
+ // Annotate the CommonJS export names for ESM import in node:
64
+ 0 && (module.exports = {
65
+ Omnify,
66
+ PluginManager,
67
+ compareSchemas,
68
+ createOmnify,
69
+ diffHclSchemas,
70
+ findReferencedSchemas,
71
+ findReferencingSchemas,
72
+ generateEnums,
73
+ generateHclSchema,
74
+ generateInterfaces,
75
+ generateMigrationFromSchema,
76
+ generateMigrations,
77
+ generatePreview,
78
+ generateTypeScript,
79
+ generateTypeScriptFile,
80
+ getEntitySchemas,
81
+ getEnumSchemas,
82
+ getGroups,
83
+ getRelationshipGraph,
84
+ getSchemaMetadata,
85
+ getSchemaNames,
86
+ getSchemasByGroup,
87
+ getTopologicalOrder,
88
+ hasCircularReferences,
89
+ introspectSchema,
90
+ introspectSchemas,
91
+ loadSchemas,
92
+ parseDiffOutput,
93
+ readLockFile,
94
+ renderHcl,
95
+ runAtlasDiff,
96
+ schemaToBlueprint,
97
+ schemaToInterface,
98
+ validateSchemas,
99
+ writeLockFile
100
+ });
101
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @famgia/omnify - Schema-driven database migration system\n *\n * Main entry point that re-exports key APIs.\n */\n\n// Core exports\nexport {\n loadSchemas,\n validateSchemas,\n createOmnify,\n Omnify,\n PluginManager,\n getSchemaMetadata,\n introspectSchema,\n introspectSchemas,\n getSchemaNames,\n getEntitySchemas,\n getEnumSchemas,\n getSchemasByGroup,\n getGroups,\n findReferencingSchemas,\n findReferencedSchemas,\n getRelationshipGraph,\n hasCircularReferences,\n getTopologicalOrder,\n} from '@famgia/omnify-core';\n\n// Type exports\nexport type {\n SchemaDefinition,\n LoadedSchema,\n SchemaCollection,\n PropertyDefinition,\n AssociationDefinition,\n OmnifyPlugin,\n OmnifyConfig,\n} from '@famgia/omnify-types';\n\n// Laravel generator exports\nexport {\n generateMigrations,\n generateMigrationFromSchema,\n generateTypeScript,\n generateTypeScriptFile,\n generateInterfaces,\n generateEnums,\n schemaToBlueprint,\n schemaToInterface,\n} from '@famgia/omnify-laravel';\n\nexport type {\n MigrationFile,\n MigrationOptions,\n TypeScriptFile,\n TypeScriptOptions,\n} from '@famgia/omnify-laravel';\n\n// Atlas adapter exports\nexport {\n runAtlasDiff,\n diffHclSchemas,\n generateHclSchema,\n renderHcl,\n readLockFile,\n writeLockFile,\n compareSchemas,\n generatePreview,\n parseDiffOutput,\n} from '@famgia/omnify-atlas';\n\nexport type {\n AtlasDiffResult,\n HclSchema,\n LockFile,\n DiffResult,\n ChangePreview,\n} from '@famgia/omnify-atlas';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAOA,yBAmBO;AAcP,4BASO;AAUP,0BAUO;","names":[]}
@@ -0,0 +1,4 @@
1
+ export { Omnify, PluginManager, createOmnify, findReferencedSchemas, findReferencingSchemas, getEntitySchemas, getEnumSchemas, getGroups, getRelationshipGraph, getSchemaMetadata, getSchemaNames, getSchemasByGroup, getTopologicalOrder, hasCircularReferences, introspectSchema, introspectSchemas, loadSchemas, validateSchemas } from '@famgia/omnify-core';
2
+ export { AssociationDefinition, LoadedSchema, OmnifyConfig, OmnifyPlugin, PropertyDefinition, SchemaCollection, SchemaDefinition } from '@famgia/omnify-types';
3
+ export { MigrationFile, MigrationOptions, TypeScriptFile, TypeScriptOptions, generateEnums, generateInterfaces, generateMigrationFromSchema, generateMigrations, generateTypeScript, generateTypeScriptFile, schemaToBlueprint, schemaToInterface } from '@famgia/omnify-laravel';
4
+ export { AtlasDiffResult, ChangePreview, DiffResult, HclSchema, LockFile, compareSchemas, diffHclSchemas, generateHclSchema, generatePreview, parseDiffOutput, readLockFile, renderHcl, runAtlasDiff, writeLockFile } from '@famgia/omnify-atlas';
package/dist/index.d.ts CHANGED
@@ -1,7 +1,4 @@
1
- export * from './types';
2
- export * from './runtime';
3
- export * from './generators/enumGenerator';
4
- export * from './generators/modelGenerator';
5
- export * from './generators/contextGenerator';
6
- export * from './utils/typeMapper';
7
- //# sourceMappingURL=index.d.ts.map
1
+ export { Omnify, PluginManager, createOmnify, findReferencedSchemas, findReferencingSchemas, getEntitySchemas, getEnumSchemas, getGroups, getRelationshipGraph, getSchemaMetadata, getSchemaNames, getSchemasByGroup, getTopologicalOrder, hasCircularReferences, introspectSchema, introspectSchemas, loadSchemas, validateSchemas } from '@famgia/omnify-core';
2
+ export { AssociationDefinition, LoadedSchema, OmnifyConfig, OmnifyPlugin, PropertyDefinition, SchemaCollection, SchemaDefinition } from '@famgia/omnify-types';
3
+ export { MigrationFile, MigrationOptions, TypeScriptFile, TypeScriptOptions, generateEnums, generateInterfaces, generateMigrationFromSchema, generateMigrations, generateTypeScript, generateTypeScriptFile, schemaToBlueprint, schemaToInterface } from '@famgia/omnify-laravel';
4
+ export { AtlasDiffResult, ChangePreview, DiffResult, HclSchema, LockFile, compareSchemas, diffHclSchemas, generateHclSchema, generatePreview, parseDiffOutput, readLockFile, renderHcl, runAtlasDiff, writeLockFile } from '@famgia/omnify-atlas';
package/dist/index.js CHANGED
@@ -1,24 +1,80 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
1
+ // src/index.ts
2
+ import {
3
+ loadSchemas,
4
+ validateSchemas,
5
+ createOmnify,
6
+ Omnify,
7
+ PluginManager,
8
+ getSchemaMetadata,
9
+ introspectSchema,
10
+ introspectSchemas,
11
+ getSchemaNames,
12
+ getEntitySchemas,
13
+ getEnumSchemas,
14
+ getSchemasByGroup,
15
+ getGroups,
16
+ findReferencingSchemas,
17
+ findReferencedSchemas,
18
+ getRelationshipGraph,
19
+ hasCircularReferences,
20
+ getTopologicalOrder
21
+ } from "@famgia/omnify-core";
22
+ import {
23
+ generateMigrations,
24
+ generateMigrationFromSchema,
25
+ generateTypeScript,
26
+ generateTypeScriptFile,
27
+ generateInterfaces,
28
+ generateEnums,
29
+ schemaToBlueprint,
30
+ schemaToInterface
31
+ } from "@famgia/omnify-laravel";
32
+ import {
33
+ runAtlasDiff,
34
+ diffHclSchemas,
35
+ generateHclSchema,
36
+ renderHcl,
37
+ readLockFile,
38
+ writeLockFile,
39
+ compareSchemas,
40
+ generatePreview,
41
+ parseDiffOutput
42
+ } from "@famgia/omnify-atlas";
43
+ export {
44
+ Omnify,
45
+ PluginManager,
46
+ compareSchemas,
47
+ createOmnify,
48
+ diffHclSchemas,
49
+ findReferencedSchemas,
50
+ findReferencingSchemas,
51
+ generateEnums,
52
+ generateHclSchema,
53
+ generateInterfaces,
54
+ generateMigrationFromSchema,
55
+ generateMigrations,
56
+ generatePreview,
57
+ generateTypeScript,
58
+ generateTypeScriptFile,
59
+ getEntitySchemas,
60
+ getEnumSchemas,
61
+ getGroups,
62
+ getRelationshipGraph,
63
+ getSchemaMetadata,
64
+ getSchemaNames,
65
+ getSchemasByGroup,
66
+ getTopologicalOrder,
67
+ hasCircularReferences,
68
+ introspectSchema,
69
+ introspectSchemas,
70
+ loadSchemas,
71
+ parseDiffOutput,
72
+ readLockFile,
73
+ renderHcl,
74
+ runAtlasDiff,
75
+ schemaToBlueprint,
76
+ schemaToInterface,
77
+ validateSchemas,
78
+ writeLockFile
15
79
  };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./types"), exports);
18
- // Runtime helpers (for use in app)
19
- __exportStar(require("./runtime"), exports);
20
- __exportStar(require("./generators/enumGenerator"), exports);
21
- __exportStar(require("./generators/modelGenerator"), exports);
22
- __exportStar(require("./generators/contextGenerator"), exports);
23
- __exportStar(require("./utils/typeMapper"), exports);
24
80
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0CAAwB;AAExB,mCAAmC;AACnC,4CAA0B;AAC1B,6DAA2C;AAC3C,8DAA4C;AAC5C,gEAA8C;AAC9C,qDAAmC"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * @famgia/omnify - Schema-driven database migration system\n *\n * Main entry point that re-exports key APIs.\n */\n\n// Core exports\nexport {\n loadSchemas,\n validateSchemas,\n createOmnify,\n Omnify,\n PluginManager,\n getSchemaMetadata,\n introspectSchema,\n introspectSchemas,\n getSchemaNames,\n getEntitySchemas,\n getEnumSchemas,\n getSchemasByGroup,\n getGroups,\n findReferencingSchemas,\n findReferencedSchemas,\n getRelationshipGraph,\n hasCircularReferences,\n getTopologicalOrder,\n} from '@famgia/omnify-core';\n\n// Type exports\nexport type {\n SchemaDefinition,\n LoadedSchema,\n SchemaCollection,\n PropertyDefinition,\n AssociationDefinition,\n OmnifyPlugin,\n OmnifyConfig,\n} from '@famgia/omnify-types';\n\n// Laravel generator exports\nexport {\n generateMigrations,\n generateMigrationFromSchema,\n generateTypeScript,\n generateTypeScriptFile,\n generateInterfaces,\n generateEnums,\n schemaToBlueprint,\n schemaToInterface,\n} from '@famgia/omnify-laravel';\n\nexport type {\n MigrationFile,\n MigrationOptions,\n TypeScriptFile,\n TypeScriptOptions,\n} from '@famgia/omnify-laravel';\n\n// Atlas adapter exports\nexport {\n runAtlasDiff,\n diffHclSchemas,\n generateHclSchema,\n renderHcl,\n readLockFile,\n writeLockFile,\n compareSchemas,\n generatePreview,\n parseDiffOutput,\n} from '@famgia/omnify-atlas';\n\nexport type {\n AtlasDiffResult,\n HclSchema,\n LockFile,\n DiffResult,\n ChangePreview,\n} from '@famgia/omnify-atlas';\n"],"mappings":";AAOA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAcP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAUP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;","names":[]}
package/package.json CHANGED
@@ -1,75 +1,44 @@
1
1
  {
2
2
  "name": "@famgia/omnify",
3
- "version": "0.12.8",
4
- "description": "Complete Laravel + React solution: Schema-to-TypeScript generation + Runtime helpers for forms",
5
- "main": "dist/index.js",
6
- "types": "dist/index.d.ts",
7
- "bin": {
8
- "omnify-build": "dist/cli.js"
3
+ "version": "1.0.0",
4
+ "description": "Schema-driven database migration system with TypeScript types and Laravel migrations",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "types": "./dist/index.d.ts",
12
+ "import": "./dist/index.js",
13
+ "require": "./dist/index.cjs"
14
+ }
9
15
  },
10
- "scripts": {
11
- "build": "tsc",
12
- "test": "jest",
13
- "test:watch": "jest --watch",
14
- "test:coverage": "jest --coverage",
15
- "prepublishOnly": "npm run build"
16
+ "files": [
17
+ "dist",
18
+ "README.md"
19
+ ],
20
+ "dependencies": {
21
+ "@famgia/omnify-core": "0.0.2",
22
+ "@famgia/omnify-types": "0.0.2",
23
+ "@famgia/omnify-laravel": "0.0.2",
24
+ "@famgia/omnify-atlas": "0.0.2"
16
25
  },
17
26
  "keywords": [
18
27
  "omnify",
19
- "typescript",
20
- "generator",
21
28
  "schema",
22
- "codegen",
29
+ "migration",
23
30
  "laravel",
24
- "type-generation"
31
+ "typescript",
32
+ "atlas",
33
+ "database"
25
34
  ],
26
- "author": "Omnify JP",
35
+ "author": "Famgia",
27
36
  "license": "MIT",
28
- "repository": {
29
- "type": "git",
30
- "url": "git+https://github.com/omnifyjp/omnify.git"
31
- },
32
- "bugs": {
33
- "url": "https://github.com/omnifyjp/omnify/issues"
34
- },
35
- "homepage": "https://github.com/omnifyjp/omnify#readme",
36
- "engines": {
37
- "node": ">=16.0.0"
38
- },
39
- "devDependencies": {
40
- "@types/jest": "^30.0.0",
41
- "@types/node": "^20.19.24",
42
- "@types/react": "^19.2.2",
43
- "antd": "^5.28.0",
44
- "axios": "^1.13.2",
45
- "jest": "^30.2.0",
46
- "react": "^19.2.0",
47
- "ts-jest": "^29.4.5",
48
- "typescript": "^5.0.0"
49
- },
50
- "dependencies": {
51
- "chokidar": "^3.6.0"
52
- },
53
- "peerDependencies": {
54
- "antd": ">=5.0.0",
55
- "axios": ">=1.0.0",
56
- "react": ">=18.0.0",
57
- "typescript": ">=5.0.0"
58
- },
59
- "peerDependenciesMeta": {
60
- "react": {
61
- "optional": true
62
- },
63
- "antd": {
64
- "optional": true
65
- },
66
- "axios": {
67
- "optional": true
68
- }
69
- },
70
- "files": [
71
- "dist",
72
- "README.md",
73
- "CHANGELOG.md"
74
- ]
75
- }
37
+ "scripts": {
38
+ "build": "tsup",
39
+ "clean": "rm -rf dist",
40
+ "test": "vitest run --passWithNoTests",
41
+ "test:watch": "vitest",
42
+ "lint": "eslint src"
43
+ }
44
+ }