aiex-cli 0.0.6 → 0.0.7-beta.1

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.d.mts CHANGED
@@ -1,7 +1,7 @@
1
1
  import Conf from "conf";
2
- import { ZodError, z } from "zod";
2
+ import { z } from "zod";
3
3
 
4
- //#region src/core/doctor.d.ts
4
+ //#region src/domain/doctor/diagnostics.d.ts
5
5
  interface DoctorDiagnostics {
6
6
  cli: {
7
7
  name: string;
@@ -89,66 +89,13 @@ interface AppConfig {
89
89
  }
90
90
  declare function createConfig(): Conf<AppConfig>;
91
91
  //#endregion
92
- //#region src/core/doctor-collector.d.ts
92
+ //#region src/application/doctor/collect-diagnostics.d.ts
93
93
  interface CollectDoctorDiagnosticsOptions {
94
94
  config?: ReturnType<typeof createConfig>;
95
95
  }
96
96
  declare function collectDoctorDiagnostics(options?: CollectDoctorDiagnosticsOptions): Promise<DoctorDiagnostics>;
97
97
  //#endregion
98
- //#region src/core/schema-sqlite/types.d.ts
99
- interface ParsedColumn {
100
- name: string;
101
- drizzleType: string;
102
- isPrimary: boolean;
103
- isAutoIncrement: boolean;
104
- isNullable: boolean;
105
- isUnique: boolean;
106
- defaultValue?: string;
107
- isForeignKey?: boolean;
108
- foreignKeyRef?: {
109
- table: string;
110
- column: string;
111
- };
112
- }
113
- interface ParsedTable {
114
- name: string;
115
- columns: ParsedColumn[];
116
- }
117
- interface ParsedRelation {
118
- fromTable: string;
119
- fromColumn: string;
120
- toTable: string;
121
- toColumn: string;
122
- name: string;
123
- }
124
- interface ParsedReverseRelation {
125
- type: 'has-one' | 'has-many';
126
- fromTable: string;
127
- toTable: string;
128
- name: string;
129
- }
130
- interface ParseResult {
131
- tables: ParsedTable[];
132
- relations: ParsedRelation[];
133
- reverseRelations: ParsedReverseRelation[];
134
- warnings: string[];
135
- }
136
- interface MigrationConfig {
137
- schemaPath: string;
138
- drizzleSchemaPath: string;
139
- migrationsPath: string;
140
- databasePath: string;
141
- drizzleConfigPath: string;
142
- }
143
- //#endregion
144
- //#region src/core/schema-sqlite/generator.d.ts
145
- declare function generateDrizzleSchema(result: ParseResult): string;
146
- //#endregion
147
- //#region src/core/schema-sqlite/migrator.d.ts
148
- declare function createMigrationConfig(cwd: string): MigrationConfig;
149
- declare function generateDrizzleConfig(): string;
150
- //#endregion
151
- //#region src/core/schema-sqlite/schemas.d.ts
98
+ //#region src/domain/schema/schemas.d.ts
152
99
 
153
100
  declare const JsonSchemaDefinitionSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
154
101
  $schema: z.ZodOptional<z.ZodString>;
@@ -340,7 +287,60 @@ interface JsonSchemaProperty {
340
287
  }
341
288
  type JsonSchemaDefinition = z.infer<typeof JsonSchemaDefinitionSchema>;
342
289
  //#endregion
343
- //#region src/core/schema-sqlite/parser.d.ts
290
+ //#region src/domain/schema/types.d.ts
291
+ interface ParsedColumn {
292
+ name: string;
293
+ drizzleType: string;
294
+ isPrimary: boolean;
295
+ isAutoIncrement: boolean;
296
+ isNullable: boolean;
297
+ isUnique: boolean;
298
+ defaultValue?: string;
299
+ isForeignKey?: boolean;
300
+ foreignKeyRef?: {
301
+ table: string;
302
+ column: string;
303
+ };
304
+ }
305
+ interface ParsedTable {
306
+ name: string;
307
+ columns: ParsedColumn[];
308
+ }
309
+ interface ParsedRelation {
310
+ fromTable: string;
311
+ fromColumn: string;
312
+ toTable: string;
313
+ toColumn: string;
314
+ name: string;
315
+ }
316
+ interface ParsedReverseRelation {
317
+ type: 'has-one' | 'has-many';
318
+ fromTable: string;
319
+ toTable: string;
320
+ name: string;
321
+ }
322
+ interface ParseResult {
323
+ tables: ParsedTable[];
324
+ relations: ParsedRelation[];
325
+ reverseRelations: ParsedReverseRelation[];
326
+ warnings: string[];
327
+ }
328
+ interface MigrationConfig {
329
+ schemaPath: string;
330
+ drizzleSchemaPath: string;
331
+ migrationsPath: string;
332
+ databasePath: string;
333
+ drizzleConfigPath: string;
334
+ }
335
+ //#endregion
336
+ //#region src/domain/schema/parser.d.ts
344
337
  declare function parseJsonSchema(schema: JsonSchemaDefinition): ParseResult;
345
338
  //#endregion
339
+ //#region src/infrastructure/schema/generate-drizzle-schema.d.ts
340
+ declare function generateDrizzleSchema(result: ParseResult): string;
341
+ //#endregion
342
+ //#region src/infrastructure/schema/migration-config.d.ts
343
+ declare function createMigrationConfig(cwd: string): MigrationConfig;
344
+ declare function generateDrizzleConfig(): string;
345
+ //#endregion
346
346
  export { type DoctorDiagnostics, type JsonSchemaDefinition, JsonSchemaDefinitionSchema, type JsonSchemaProperty, type MigrationConfig, type ParseResult, type ParsedColumn, type ParsedRelation, type ParsedTable, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
package/dist/index.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { D as buildDoctorDiagnostics, O as doctorDiagnosticsTableRows, a as parseJsonSchema, i as JsonSchemaDefinitionSchema, k as formatDoctorDiagnosticsJson, n as createMigrationConfig, r as generateDrizzleConfig, s as generateDrizzleSchema, t as collectDoctorDiagnostics } from "./doctor-collector-SgMb2oQN.mjs";
1
+ import { _ as doctorDiagnosticsTableRows, g as buildDoctorDiagnostics, i as generateDrizzleConfig, m as parseJsonSchema, n as collectDoctorDiagnostics, p as JsonSchemaDefinitionSchema, r as createMigrationConfig, t as generateDrizzleSchema, v as formatDoctorDiagnosticsJson } from "./generate-drizzle-schema-D0o_j12G.mjs";
2
2
 
3
3
  export { JsonSchemaDefinitionSchema, buildDoctorDiagnostics, collectDoctorDiagnostics, createMigrationConfig, doctorDiagnosticsTableRows, formatDoctorDiagnosticsJson, generateDrizzleConfig, generateDrizzleSchema, parseJsonSchema };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "aiex-cli",
3
3
  "type": "module",
4
- "version": "0.0.6",
4
+ "version": "0.0.7-beta.1",
5
5
  "description": "JSON Schema → SQLite with AI-powered data extraction",
6
6
  "author": "OSpoon <zxin088@gmail.com>",
7
7
  "license": "MIT",
@@ -1,14 +1 @@
1
- export function sanitizeMigrationName(name?: string): string | undefined {
2
- if (!name)
3
- return undefined
4
-
5
- const slug = name
6
- .trim()
7
- .toLowerCase()
8
- .replace(/[^a-z0-9_\s-]/g, '_')
9
- .replace(/[\s-]+/g, '_')
10
- .replace(/_+/g, '_')
11
- .replace(/^_+|_+$/g, '')
12
-
13
- return slug || undefined
14
- }
1
+ export { sanitizeMigrationName } from '@/infrastructure/schema/migration-name'