@famgia/omnify 0.12.9 → 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.
- package/README.md +68 -102
- package/dist/index.cjs +101 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4 -0
- package/dist/index.d.ts +4 -7
- package/dist/index.js +78 -22
- package/dist/index.js.map +1 -1
- package/package.json +34 -65
- package/CHANGELOG.md +0 -129
- package/dist/__tests__/generators/contextGenerator.test.d.ts +0 -2
- package/dist/__tests__/generators/contextGenerator.test.d.ts.map +0 -1
- package/dist/__tests__/generators/contextGenerator.test.js +0 -109
- package/dist/__tests__/generators/contextGenerator.test.js.map +0 -1
- package/dist/__tests__/generators/enumGenerator.test.d.ts +0 -2
- package/dist/__tests__/generators/enumGenerator.test.d.ts.map +0 -1
- package/dist/__tests__/generators/enumGenerator.test.js +0 -151
- package/dist/__tests__/generators/enumGenerator.test.js.map +0 -1
- package/dist/__tests__/generators/modelGenerator.test.d.ts +0 -2
- package/dist/__tests__/generators/modelGenerator.test.d.ts.map +0 -1
- package/dist/__tests__/generators/modelGenerator.test.js +0 -329
- package/dist/__tests__/generators/modelGenerator.test.js.map +0 -1
- package/dist/__tests__/utils/pascalCase.test.d.ts +0 -1
- package/dist/__tests__/utils/pascalCase.test.d.ts.map +0 -1
- package/dist/__tests__/utils/pascalCase.test.js +0 -75
- package/dist/__tests__/utils/pascalCase.test.js.map +0 -1
- package/dist/__tests__/utils/typeMapper.test.d.ts +0 -2
- package/dist/__tests__/utils/typeMapper.test.d.ts.map +0 -1
- package/dist/__tests__/utils/typeMapper.test.js +0 -41
- package/dist/__tests__/utils/typeMapper.test.js.map +0 -1
- package/dist/cli.d.ts +0 -3
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js +0 -248
- package/dist/cli.js.map +0 -1
- package/dist/generators/commonTypesGenerator.d.ts +0 -5
- package/dist/generators/commonTypesGenerator.d.ts.map +0 -1
- package/dist/generators/commonTypesGenerator.js +0 -37
- package/dist/generators/commonTypesGenerator.js.map +0 -1
- package/dist/generators/contextGenerator.d.ts +0 -3
- package/dist/generators/contextGenerator.d.ts.map +0 -1
- package/dist/generators/contextGenerator.js +0 -248
- package/dist/generators/contextGenerator.js.map +0 -1
- package/dist/generators/enumGenerator.d.ts +0 -13
- package/dist/generators/enumGenerator.d.ts.map +0 -1
- package/dist/generators/enumGenerator.js +0 -83
- package/dist/generators/enumGenerator.js.map +0 -1
- package/dist/generators/hooksGenerator.d.ts +0 -4
- package/dist/generators/hooksGenerator.d.ts.map +0 -1
- package/dist/generators/hooksGenerator.js +0 -265
- package/dist/generators/hooksGenerator.js.map +0 -1
- package/dist/generators/modelGenerator.d.ts +0 -13
- package/dist/generators/modelGenerator.d.ts.map +0 -1
- package/dist/generators/modelGenerator.js +0 -262
- package/dist/generators/modelGenerator.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/runtime/hooks/useFormSubmit.d.ts +0 -36
- package/dist/runtime/hooks/useFormSubmit.d.ts.map +0 -1
- package/dist/runtime/hooks/useFormSubmit.js +0 -86
- package/dist/runtime/hooks/useFormSubmit.js.map +0 -1
- package/dist/runtime/index.d.ts +0 -5
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js +0 -21
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/lib/axios.d.ts +0 -7
- package/dist/runtime/lib/axios.d.ts.map +0 -1
- package/dist/runtime/lib/axios.js +0 -54
- package/dist/runtime/lib/axios.js.map +0 -1
- package/dist/runtime/lib/validation.d.ts +0 -50
- package/dist/runtime/lib/validation.d.ts.map +0 -1
- package/dist/runtime/lib/validation.js +0 -85
- package/dist/runtime/lib/validation.js.map +0 -1
- package/dist/types.d.ts +0 -54
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -3
- package/dist/types.js.map +0 -1
- package/dist/utils/typeMapper.d.ts +0 -10
- package/dist/utils/typeMapper.d.ts.map +0 -1
- package/dist/utils/typeMapper.js +0 -119
- package/dist/utils/typeMapper.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
# @famgia/omnify
|
|
2
2
|
|
|
3
|
-
|
|
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
|
-
|
|
27
|
-
|
|
28
|
-
### 1. Generate Types (Build-time)
|
|
29
|
-
|
|
11
|
+
For CLI usage:
|
|
30
12
|
```bash
|
|
31
|
-
|
|
32
|
-
|
|
13
|
+
npm install -g @famgia/omnify-cli
|
|
14
|
+
```
|
|
33
15
|
|
|
34
|
-
|
|
35
|
-
|
|
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.
|
|
37
|
+
### 2. Generate migrations
|
|
39
38
|
|
|
40
|
-
```
|
|
41
|
-
|
|
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
|
|
43
|
+
### 3. Use programmatically
|
|
55
44
|
|
|
56
45
|
```typescript
|
|
57
|
-
import {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
##
|
|
87
|
-
|
|
88
|
-
### `useFormSubmit<TResponse>(options)`
|
|
66
|
+
## Packages
|
|
89
67
|
|
|
90
|
-
|
|
68
|
+
This is the main entry point that includes:
|
|
91
69
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
-
|
|
95
|
-
-
|
|
96
|
-
-
|
|
97
|
-
-
|
|
98
|
-
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
89
|
+
## Migration from @famgia/omnify (old)
|
|
118
90
|
|
|
119
|
-
|
|
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
|
-
|
|
93
|
+
```bash
|
|
94
|
+
npm uninstall @famgia/omnify
|
|
95
|
+
npm install @famgia/omnify-old
|
|
123
96
|
```
|
|
124
97
|
|
|
125
|
-
|
|
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":[]}
|
package/dist/index.d.cts
ADDED
|
@@ -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
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
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
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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,"
|
|
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.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
|
|
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
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
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
|
-
"
|
|
29
|
+
"migration",
|
|
23
30
|
"laravel",
|
|
24
|
-
"
|
|
31
|
+
"typescript",
|
|
32
|
+
"atlas",
|
|
33
|
+
"database"
|
|
25
34
|
],
|
|
26
|
-
"author": "
|
|
35
|
+
"author": "Famgia",
|
|
27
36
|
"license": "MIT",
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
}
|
|
35
|
-
|
|
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
|
+
}
|