@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.
@@ -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) ? `${enumPrefix}/plugin/${enumName}${ext}` : `${enumPrefix}/${enumName}${ext}`;
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 '${enumPrefix}/plugin/${enumDef.name}${ext}';
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-2Q2T4NRP.js.map
2372
+ //# sourceMappingURL=chunk-XKUNDZDN.js.map