Skip to content

fix: generate stub types of with explicit extension import if pkg type is module#371

Merged
pi0 merged 3 commits intounjs:mainfrom
yshrsmz:esm-dts
Jun 4, 2024
Merged

fix: generate stub types of with explicit extension import if pkg type is module#371
pi0 merged 3 commits intounjs:mainfrom
yshrsmz:esm-dts

Conversation

@yshrsmz
Copy link
Contributor

@yshrsmz yshrsmz commented Feb 10, 2024

🔗 Linked issue

resolve #370

❓ Type of change

  • 📖 Documentation (updates to the documentation, readme, or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • 👌 Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

📚 Description

Updated DTS stub generation logic to check its module format so that it can work with ESM package.

I wanted to write test cases for this change, but there seems to be no stub-mode related tests and no idea how to write it 🤔

📝 Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

@yshrsmz yshrsmz force-pushed the esm-dts branch 2 times, most recently from 0609982 to f2f94ed Compare February 10, 2024 03:32
@yshrsmz
Copy link
Contributor Author

yshrsmz commented Feb 24, 2024

@pi0 Hi, sorry to bother you, but could you take a look at this PR?
I really need this fix for my project.

MaximusHaximus added a commit to LIT-Protocol/lit-scheduled-tasks that referenced this pull request Mar 26, 2024
…p to `start`

- Make dev and start build instead of stubbing :( Ref: unjs/unbuild#371
- Add link to `lit-task-auto-top-up` task def package
- Scaffolding for auto top-up task
MaximusHaximus added a commit to LIT-Protocol/lit-scheduled-tasks that referenced this pull request Mar 26, 2024
MaximusHaximus added a commit to LIT-Protocol/lit-scheduled-tasks that referenced this pull request Mar 27, 2024
…p to `start`

- Make dev and start build instead of stubbing :( Ref: unjs/unbuild#371
- Add link to `lit-task-auto-top-up` task def package
- Scaffolding for auto top-up task
MaximusHaximus added a commit to LIT-Protocol/lit-scheduled-tasks that referenced this pull request Mar 27, 2024
MaximusHaximus added a commit to LIT-Protocol/lit-scheduled-tasks that referenced this pull request Mar 27, 2024
…p to `start`

- Make dev and start build instead of stubbing :( Ref: unjs/unbuild#371
- Add link to `lit-task-auto-top-up` task def package
- Scaffolding for auto top-up task
MaximusHaximus added a commit to LIT-Protocol/lit-scheduled-tasks that referenced this pull request Mar 27, 2024
MaximusHaximus added a commit to LIT-Protocol/lit-scheduled-tasks that referenced this pull request Mar 27, 2024
…p to `start`

- Make dev and start build instead of stubbing :( Ref: unjs/unbuild#371
- Add link to `lit-task-auto-top-up` task def package
- Scaffolding for auto top-up task
MaximusHaximus added a commit to LIT-Protocol/lit-scheduled-tasks that referenced this pull request Mar 27, 2024
MaximusHaximus added a commit to LIT-Protocol/lit-scheduled-tasks that referenced this pull request Mar 27, 2024
…to `start`

- Make dev and start build instead of stubbing :( Ref: unjs/unbuild#371
- Add link to `lit-task-auto-top-up` task def package
- Scaffolding for auto top-up task
MaximusHaximus added a commit to LIT-Protocol/lit-scheduled-tasks that referenced this pull request Mar 27, 2024
@pi0 pi0 changed the title [stub] d.ts should import files with '.js' extension in ESM package fix: generate stub types of with explicit extension import if pkg type is module Jun 4, 2024
Copy link
Member

@pi0 pi0 left a comment

Choose a reason for hiding this comment

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

Thanks!

@pi0 pi0 merged commit e1e0935 into unjs:main Jun 4, 2024
pi0 added a commit to xiaoxiangmoe/unbuild that referenced this pull request Jun 4, 2024
@pi0 pi0 mentioned this pull request Jun 4, 2024
8 tasks
@yshrsmz yshrsmz deleted the esm-dts branch June 4, 2024 22:52
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.

stubbed d.ts file should import file with extension in ESM package

2 participants