@famgia/omnify-typescript 0.0.47 → 0.0.49

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.
@@ -2,9 +2,23 @@
2
2
 
3
3
  This guide covers TypeScript-specific features and generated code patterns for Omnify.
4
4
 
5
+ ## Quick Start
6
+
7
+ ```bash
8
+ # Create new project (recommended)
9
+ npx @famgia/omnify create-laravel-project my-app
10
+ cd my-app
11
+
12
+ # Or initialize in existing project
13
+ npx @famgia/omnify init
14
+
15
+ # Generate TypeScript types
16
+ npx @famgia/omnify generate
17
+ ```
18
+
5
19
  ## Generated Files
6
20
 
7
- When you run `npx omnify generate`, the following TypeScript files are generated:
21
+ When you run `npx @famgia/omnify generate`, the following TypeScript files are generated:
8
22
 
9
23
  - `base/*.ts` - Base model interfaces
10
24
  - `enum/*.ts` - Enum types with multi-locale labels
@@ -62,10 +76,25 @@ export interface User {
62
76
  | `Boolean` | `boolean` |
63
77
  | `Date` | `Date` |
64
78
  | `DateTime` | `Date` |
79
+ | `Timestamp` | `Date` |
65
80
  | `Json` | `Record<string, unknown>` |
66
81
  | `EnumRef` | Generated enum type |
67
82
  | `Association` | Related model type / array |
68
83
 
84
+ ## Hidden Schemas
85
+
86
+ Schemas with `options.hidden: true` are skipped for TypeScript generation:
87
+
88
+ ```yaml
89
+ name: AppCache
90
+ options:
91
+ hidden: true # No TypeScript interface generated
92
+ ```
93
+
94
+ Use cases:
95
+ - System tables (cache, sessions, jobs)
96
+ - Tables that don't need frontend types
97
+
69
98
  ## Enum Generation (Multi-locale)
70
99
 
71
100
  ```yaml
@@ -229,11 +258,20 @@ function handleStatus(value: unknown) {
229
258
  ## Commands
230
259
 
231
260
  ```bash
261
+ # Create new project
262
+ npx @famgia/omnify create-laravel-project my-app
263
+
232
264
  # Generate TypeScript types
233
- npx omnify generate
265
+ npx @famgia/omnify generate
234
266
 
235
267
  # Force regenerate all files
236
- npx omnify generate --force
268
+ npx @famgia/omnify generate --force
269
+
270
+ # Only generate TypeScript types
271
+ npx @famgia/omnify generate --types-only
272
+
273
+ # Validate schemas
274
+ npx @famgia/omnify validate
237
275
  ```
238
276
 
239
277
  ## Configuration
@@ -241,18 +279,32 @@ npx omnify generate --force
241
279
  ```typescript
242
280
  // omnify.config.ts
243
281
  import { defineConfig } from '@famgia/omnify';
282
+ import typescript from '@famgia/omnify-typescript/plugin';
244
283
 
245
284
  export default defineConfig({
246
285
  schemasDir: './schemas',
247
- output: {
248
- typescript: {
249
- path: './src/types/model',
250
- generateRules: true, // Generate Ant Design validation rules
251
- },
252
- },
286
+ lockFilePath: './.omnify.lock',
287
+
288
+ plugins: [
289
+ typescript({
290
+ // Output path for TypeScript files
291
+ path: './resources/ts/types/models',
292
+
293
+ // Generate Ant Design validation rules
294
+ generateRules: true,
295
+ }),
296
+ ],
297
+
253
298
  locale: {
254
299
  locales: ['ja', 'en'],
255
300
  defaultLocale: 'ja',
256
301
  },
257
302
  });
258
303
  ```
304
+
305
+ ### Configuration Options
306
+
307
+ | Option | Type | Default | Description |
308
+ |--------|------|---------|-------------|
309
+ | `path` | `string` | `./src/types/model` | TypeScript output directory |
310
+ | `generateRules` | `boolean` | `true` | Generate Ant Design validation rules |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@famgia/omnify-typescript",
3
- "version": "0.0.47",
3
+ "version": "0.0.49",
4
4
  "description": "TypeScript type definitions generator for Omnify schemas",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -48,7 +48,7 @@
48
48
  "directory": "packages/typescript-generator"
49
49
  },
50
50
  "dependencies": {
51
- "@famgia/omnify-types": "0.0.57"
51
+ "@famgia/omnify-types": "0.0.59"
52
52
  },
53
53
  "devDependencies": {
54
54
  "tsup": "^8.5.1",