@omnifyjp/ts 1.3.1 → 1.3.3
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/generator.js +10 -10
- package/dist/i18n-generator.js +1 -1
- package/dist/zod-generator.js +2 -2
- package/package.json +1 -1
package/dist/generator.js
CHANGED
|
@@ -54,18 +54,18 @@ function generateBaseInterfaceFile(schemaName, schemas, options) {
|
|
|
54
54
|
if (dateImports.date)
|
|
55
55
|
commonImports.push('DateString');
|
|
56
56
|
if (commonImports.length > 0) {
|
|
57
|
-
parts.push(`import type { ${commonImports.join(', ')} } from '../common
|
|
57
|
+
parts.push(`import type { ${commonImports.join(', ')} } from '../common';\n`);
|
|
58
58
|
}
|
|
59
59
|
// Enum imports (schema enums + plugin enums are all in ../enum/)
|
|
60
60
|
if (iface.enumDependencies && iface.enumDependencies.length > 0) {
|
|
61
61
|
for (const enumName of iface.enumDependencies) {
|
|
62
|
-
parts.push(`import { ${enumName} } from '../enum/${enumName}
|
|
62
|
+
parts.push(`import { ${enumName} } from '../enum/${enumName}';\n`);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
// Dependency imports (other schema interfaces in base/)
|
|
66
66
|
if (iface.dependencies && iface.dependencies.length > 0) {
|
|
67
67
|
for (const dep of iface.dependencies) {
|
|
68
|
-
parts.push(`import type { ${dep} } from './${dep}
|
|
68
|
+
parts.push(`import type { ${dep} } from './${dep}';\n`);
|
|
69
69
|
}
|
|
70
70
|
parts.push('\n');
|
|
71
71
|
}
|
|
@@ -170,7 +170,7 @@ function generateIndexFile(schemas, schemaEnums, pluginEnums, typeAliases) {
|
|
|
170
170
|
const parts = [generateBaseHeader()];
|
|
171
171
|
// Common types
|
|
172
172
|
parts.push(`// Common Types\n`);
|
|
173
|
-
parts.push(`export type { LocaleMap, Locale, DateTimeString, DateString } from './common
|
|
173
|
+
parts.push(`export type { LocaleMap, Locale, DateTimeString, DateString } from './common';\n\n`);
|
|
174
174
|
// I18n
|
|
175
175
|
parts.push(`// i18n (Internationalization)\n`);
|
|
176
176
|
parts.push(`export {\n`);
|
|
@@ -180,7 +180,7 @@ function generateIndexFile(schemas, schemaEnums, pluginEnums, typeAliases) {
|
|
|
180
180
|
parts.push(` validationMessages,\n`);
|
|
181
181
|
parts.push(` getMessage,\n`);
|
|
182
182
|
parts.push(` getMessages,\n`);
|
|
183
|
-
parts.push(`} from './i18n
|
|
183
|
+
parts.push(`} from './i18n';\n\n`);
|
|
184
184
|
// Schema enums
|
|
185
185
|
if (schemaEnums.length > 0) {
|
|
186
186
|
parts.push(`// Schema Enums\n`);
|
|
@@ -191,7 +191,7 @@ function generateIndexFile(schemas, schemaEnums, pluginEnums, typeAliases) {
|
|
|
191
191
|
parts.push(` is${enumDef.name},\n`);
|
|
192
192
|
parts.push(` get${enumDef.name}Label,\n`);
|
|
193
193
|
parts.push(` get${enumDef.name}Extra,\n`);
|
|
194
|
-
parts.push(`} from './enum/${enumDef.name}
|
|
194
|
+
parts.push(`} from './enum/${enumDef.name}';\n`);
|
|
195
195
|
}
|
|
196
196
|
parts.push('\n');
|
|
197
197
|
}
|
|
@@ -205,7 +205,7 @@ function generateIndexFile(schemas, schemaEnums, pluginEnums, typeAliases) {
|
|
|
205
205
|
parts.push(` is${enumDef.name},\n`);
|
|
206
206
|
parts.push(` get${enumDef.name}Label,\n`);
|
|
207
207
|
parts.push(` get${enumDef.name}Extra,\n`);
|
|
208
|
-
parts.push(`} from './enum/${enumDef.name}
|
|
208
|
+
parts.push(`} from './enum/${enumDef.name}';\n`);
|
|
209
209
|
}
|
|
210
210
|
parts.push('\n');
|
|
211
211
|
}
|
|
@@ -219,7 +219,7 @@ function generateIndexFile(schemas, schemaEnums, pluginEnums, typeAliases) {
|
|
|
219
219
|
parts.push(` is${alias.name},\n`);
|
|
220
220
|
parts.push(` get${alias.name}Label,\n`);
|
|
221
221
|
parts.push(` get${alias.name}Extra,\n`);
|
|
222
|
-
parts.push(`} from './enum/${alias.name}
|
|
222
|
+
parts.push(`} from './enum/${alias.name}';\n`);
|
|
223
223
|
}
|
|
224
224
|
parts.push('\n');
|
|
225
225
|
}
|
|
@@ -231,7 +231,7 @@ function generateIndexFile(schemas, schemaEnums, pluginEnums, typeAliases) {
|
|
|
231
231
|
if (schema.options?.hidden === true)
|
|
232
232
|
continue;
|
|
233
233
|
const lowerName = schema.name.charAt(0).toLowerCase() + schema.name.slice(1);
|
|
234
|
-
parts.push(`export type { ${schema.name}, ${schema.name}Create, ${schema.name}Update } from './${schema.name}
|
|
234
|
+
parts.push(`export type { ${schema.name}, ${schema.name}Create, ${schema.name}Update } from './${schema.name}';\n`);
|
|
235
235
|
parts.push(`export {\n`);
|
|
236
236
|
parts.push(` ${lowerName}Schemas,\n`);
|
|
237
237
|
parts.push(` ${lowerName}CreateSchema,\n`);
|
|
@@ -240,7 +240,7 @@ function generateIndexFile(schemas, schemaEnums, pluginEnums, typeAliases) {
|
|
|
240
240
|
parts.push(` get${schema.name}Label,\n`);
|
|
241
241
|
parts.push(` get${schema.name}FieldLabel,\n`);
|
|
242
242
|
parts.push(` get${schema.name}FieldPlaceholder,\n`);
|
|
243
|
-
parts.push(`} from './${schema.name}
|
|
243
|
+
parts.push(`} from './${schema.name}';\n`);
|
|
244
244
|
}
|
|
245
245
|
return {
|
|
246
246
|
filePath: 'index.ts',
|
package/dist/i18n-generator.js
CHANGED
|
@@ -80,7 +80,7 @@ export function generateI18nFileContent(options) {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
const messagesJson = JSON.stringify(filteredMessages, null, 2);
|
|
83
|
-
return `import type { LocaleMap } from './common
|
|
83
|
+
return `import type { LocaleMap } from './common';
|
|
84
84
|
|
|
85
85
|
/**
|
|
86
86
|
* Default locale for this project.
|
package/dist/zod-generator.js
CHANGED
|
@@ -489,7 +489,7 @@ export function formatZodModelFile(schemaName) {
|
|
|
489
489
|
*/
|
|
490
490
|
|
|
491
491
|
import { z } from 'zod';
|
|
492
|
-
import type { ${schemaName} as ${schemaName}Base } from './base/${schemaName}
|
|
492
|
+
import type { ${schemaName} as ${schemaName}Base } from './base/${schemaName}';
|
|
493
493
|
import {
|
|
494
494
|
base${schemaName}Schemas,
|
|
495
495
|
base${schemaName}CreateSchema,
|
|
@@ -498,7 +498,7 @@ import {
|
|
|
498
498
|
get${schemaName}Label,
|
|
499
499
|
get${schemaName}FieldLabel,
|
|
500
500
|
get${schemaName}FieldPlaceholder,
|
|
501
|
-
} from './base/${schemaName}
|
|
501
|
+
} from './base/${schemaName}';
|
|
502
502
|
|
|
503
503
|
// ============================================================================
|
|
504
504
|
// Types (extend or re-export)
|