@kubb/ast 5.0.0-beta.45 → 5.0.0-beta.46

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kubb/ast",
3
- "version": "5.0.0-beta.45",
3
+ "version": "5.0.0-beta.46",
4
4
  "description": "Spec-agnostic AST layer for Kubb. Defines the node tree, visitor pattern, factory functions, and type guards used across all code generation plugins.",
5
5
  "keywords": [
6
6
  "ast",
package/src/factory.ts CHANGED
@@ -667,7 +667,11 @@ export function createFile<TMeta extends object = object>(input: UserFileNode<TM
667
667
  .filter(Boolean)
668
668
  .join('\n\n')
669
669
  const resolvedExports = input.exports?.length ? combineExports(input.exports) : []
670
- const resolvedImports = input.imports?.length ? combineImports(input.imports, resolvedExports, source || undefined) : []
670
+ const combinedImports = input.imports?.length ? combineImports(input.imports, resolvedExports, source || undefined) : []
671
+ // Drop imports that resolve to the containing file itself. Consolidated output
672
+ // (`mode: 'group'` and `mode: 'file'`) turns former cross-file imports into self-imports.
673
+ // Bare module specifiers (`'zod'`, `'@faker-js/faker'`) never equal an absolute file path.
674
+ const resolvedImports = combinedImports.filter((imp) => imp.path !== input.path)
671
675
  const resolvedSources = input.sources?.length ? combineSources(input.sources) : []
672
676
 
673
677
  return {