@famgia/omnify-typescript 0.0.144 → 0.0.146
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/{chunk-2Q2T4NRP.js → chunk-XKUNDZDN.js} +7 -6
- package/dist/{chunk-2Q2T4NRP.js.map → chunk-XKUNDZDN.js.map} +1 -1
- package/dist/index.cjs +6 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +11 -1
- package/dist/index.d.ts +11 -1
- package/dist/index.js +1 -1
- package/dist/plugin.cjs +79 -19
- package/dist/plugin.cjs.map +1 -1
- package/dist/plugin.d.cts +65 -8
- package/dist/plugin.d.ts +65 -8
- package/dist/plugin.js +71 -15
- package/dist/plugin.js.map +1 -1
- package/package.json +3 -3
- package/stubs/JapaneseAddressField.tsx.stub +1 -1
- package/stubs/JapaneseBankField.tsx.stub +1 -1
|
@@ -1773,8 +1773,9 @@ function generateBaseInterfaceFile(schemaName, schemas, options) {
|
|
|
1773
1773
|
const pluginEnumNames = new Set(
|
|
1774
1774
|
options.pluginEnums ? Array.from(options.pluginEnums.keys()) : []
|
|
1775
1775
|
);
|
|
1776
|
+
const pluginEnumPrefix = options.pluginEnumImportPrefix ?? `${enumPrefix}/plugin`;
|
|
1776
1777
|
for (const enumName of iface.enumDependencies) {
|
|
1777
|
-
const enumPath = pluginEnumNames.has(enumName) ? `${
|
|
1778
|
+
const enumPath = pluginEnumNames.has(enumName) ? `${pluginEnumPrefix}/${enumName}${ext}` : `${enumPrefix}/${enumName}${ext}`;
|
|
1778
1779
|
parts.push(`import { ${enumName} } from '${enumPath}';
|
|
1779
1780
|
`);
|
|
1780
1781
|
}
|
|
@@ -1810,13 +1811,12 @@ function generateEnumFile(enumDef, isPluginEnum = false) {
|
|
|
1810
1811
|
const parts = [generateBaseHeader()];
|
|
1811
1812
|
parts.push(formatEnum(enumDef));
|
|
1812
1813
|
parts.push("\n");
|
|
1813
|
-
const filePath = isPluginEnum ? `plugin/${enumDef.name}.ts` : `${enumDef.name}.ts`;
|
|
1814
1814
|
return {
|
|
1815
|
-
filePath
|
|
1815
|
+
filePath: `${enumDef.name}.ts`,
|
|
1816
1816
|
content: parts.join(""),
|
|
1817
1817
|
types: [enumDef.name],
|
|
1818
1818
|
overwrite: true,
|
|
1819
|
-
category: "enum"
|
|
1819
|
+
category: isPluginEnum ? "plugin-enum" : "enum"
|
|
1820
1820
|
};
|
|
1821
1821
|
}
|
|
1822
1822
|
function generateTypeAliasFile(alias) {
|
|
@@ -2157,6 +2157,7 @@ function generateIndexFile(schemas, enums, pluginEnums, typeAliases, options) {
|
|
|
2157
2157
|
parts.push("\n");
|
|
2158
2158
|
}
|
|
2159
2159
|
if (pluginEnums.length > 0) {
|
|
2160
|
+
const pluginEnumPrefix = options.pluginEnumImportPrefix ?? `${enumPrefix}/plugin`;
|
|
2160
2161
|
parts.push(`// Plugin Enums
|
|
2161
2162
|
`);
|
|
2162
2163
|
for (const enumDef of pluginEnums) {
|
|
@@ -2172,7 +2173,7 @@ function generateIndexFile(schemas, enums, pluginEnums, typeAliases, options) {
|
|
|
2172
2173
|
`);
|
|
2173
2174
|
parts.push(` get${enumDef.name}Extra,
|
|
2174
2175
|
`);
|
|
2175
|
-
parts.push(`} from '${
|
|
2176
|
+
parts.push(`} from '${pluginEnumPrefix}/${enumDef.name}${ext}';
|
|
2176
2177
|
`);
|
|
2177
2178
|
}
|
|
2178
2179
|
parts.push("\n");
|
|
@@ -2368,4 +2369,4 @@ export {
|
|
|
2368
2369
|
generateRulesFiles,
|
|
2369
2370
|
generateTypeScript
|
|
2370
2371
|
};
|
|
2371
|
-
//# sourceMappingURL=chunk-
|
|
2372
|
+
//# sourceMappingURL=chunk-XKUNDZDN.js.map
|