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

feat: allow onSuccess callback in tsup config file #657

Merged
merged 3 commits into from Jul 25, 2022

Conversation

9oelM
Copy link
Contributor

@9oelM 9oelM commented Jun 14, 2022

Resolves #637

Allows onSuccess to be a function as well as string. This option is only available from tsup config file (tsup.config.ts) for an obvious reason.

Had to do some little extra work to cancel the promise from onSuccess function because otherTasks() is used in watch mode which needs to cancel the previous process (= promise) when there's a fresh run caused by a file change. The majority of changes to src/index.ts attributes to that.

@vercel
Copy link

vercel bot commented Jun 14, 2022

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

Name Status Preview Updated
tsup ✅ Ready (Inspect) Visit Preview Jul 25, 2022 at 2:28PM (UTC)

@9oelM
Copy link
Contributor Author

9oelM commented Jun 15, 2022

@egoist could you review this PR? Thanks.

@github-actions
Copy link

🎉 This PR is included in version 6.2.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@forivall
Copy link

forivall commented Jul 26, 2022

Note that the Promise.race doesn't do anything; the onSuccess function should be passed an object with { signal: AbortSignal } so that aborting can be set up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

onSuccess as a function
3 participants