Skip to content

Fix multiline exports and imports#7

Closed
samvimes01 wants to merge 6 commits intometarhia:mainfrom
samvimes01:fix/multiline_requires
Closed

Fix multiline exports and imports#7
samvimes01 wants to merge 6 commits intometarhia:mainfrom
samvimes01:fix/multiline_requires

Conversation

@samvimes01
Copy link

  • Process whole file instead line by line to fix cases when multiple lines export or import encountered by builder

  • Add checks to import processing so only unique identifiers are set on top of a bundle

  • Warn if node internals are used -such esm lib would be invalid - but it's user responsibility to fix it

  • Add Generated by to header to mark that file shouldn't be edited manually instead rebuilt by this lib

  • tests and linter show no problems (npm t)

  • tests are added/updated for bug fixes and new features

  • code is properly formatted (npm run fix)

  • description of changes is added in CHANGELOG.md

  • update .d.ts typings

@samvimes01 samvimes01 force-pushed the fix/multiline_requires branch from e62d33c to ef19a82 Compare February 11, 2026 17:54
@tshemsedinov
Copy link
Member

  • Tests fails
  • High complexity of solution

Do not fix this before I will prepare tests to cover all cases we need

test at test/fixtures/lib/test4.js:1:1
✖ test/fixtures/lib/test4.js (32.617917ms)
  'test failed'
Error: Process completed with exit code 1.

@samvimes01 samvimes01 force-pushed the fix/multiline_requires branch from 2c219f0 to 8e10602 Compare February 12, 2026 17:44
const namedParts = Array.from(named);

if (defaultNames.size === 0 && namedParts.length === 0) continue;

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

decompose to functions

@samvimes01 samvimes01 force-pushed the fix/multiline_requires branch from 6c35d03 to 85aa2ce Compare March 4, 2026 18:23
@samvimes01 samvimes01 force-pushed the fix/multiline_requires branch from 85aa2ce to 191f224 Compare March 4, 2026 18:26
@samvimes01 samvimes01 force-pushed the fix/multiline_requires branch from b692c0d to 5ee3507 Compare March 4, 2026 18:50
@tshemsedinov
Copy link
Member

Closed in favour of #8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants