Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add onDTSSuccess option #1024

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

NickBolles
Copy link

Fixes #700

@codesandbox
Copy link

codesandbox bot commented Oct 17, 2023

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders

Open Preview

@vercel
Copy link

vercel bot commented Oct 17, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
tsup ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 17, 2023 3:54am

Copy link

@toteto toteto left a comment

Choose a reason for hiding this comment

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

Personally would expect the fix and desired behavior to be onSuccess to be called once the command (build+dts) has completed. I think there is very little use of having callback for success DTS separate from the build success callback.

In addition to this there is no guarantee that DTS will finish after the builds

await Promise.all([dtsTask(), mainTasks()])

This makes it quite unreliable even so simple cases like "copy all files when the whole build step is completed"

@NickBolles
Copy link
Author

@toteto i think my comment on the linked fixed issue is a pretty compelling use case:

We're using onsuccess to call yalc publish for a dev command. We see the JS code get updated in the consuming app, but not the typings until the next build. calling onSuccess again when dts is complete, or having another handler for dts completion would be helpful for this usecase too.
#700 (comment)

maybe this pr doesnt completely fix #700 though because there are other use cases

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.

"onSuccess" script runs before dts compile done.
2 participants