-
-
Notifications
You must be signed in to change notification settings - Fork 229
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
"onSuccess" script runs before dts compile done. #700
Comments
yeah this was initially added to let you run the generated js file, so we didn't wait for the dts build to succeed to call this function. can you explain why you need this? maybe we can call this function again when the dts build is ready: onSuccess: ({ isDtsReady }) => {
// isDtsReady: boolean
} |
I need let the developer knows compile success and is now waiting for change, but not done without a process exit. Maybe add a hardcoded prompt when everything’s done in watch mode is good enough. |
^ basically the same reason. Need to rename the types (https://twitter.com/robpalmer2/status/1634702219025981440?s=20). Currently doing |
I see three possible solutions here, I'd love to help/work on a PR if an option is decided
|
I'm running into this problem as well while using
|
What I ended up doing was running the build without DTS generation, then running a DTS-only build in |
One can also do something like this: (not sure though if it works in all cases) // tsup.config.ts
import { defineConfig } from 'tsup'
export default defineConfig({
...
})
process.on('beforeExit', (code) => {
if (code === 0) {
// do something here...
}
}) |
We're using onsuccess to call |
- Resolved an issue where CommonJS (CJS) type declaration files were not correctly handling the default export. The solution was to append `export = degit` to the `dist/index.d.ts` file, ensuring compatibility and correct recognition of default exports in CJS modules. - This change directly targets the problem outlined in [issue #700 on the tsup repository](egoist/tsup#700), where detailed discussion and context can be found. The modification brings our type declarations in line with expected behaviors, facilitating better interoperability and usage clarity. - Additionally, this update brings our type declarations into compliance with the standards set forth by [Are the types wrong](https://github.com/arethetypeswrong/arethetypeswrong.github.io/tree/main/packages/cli).
I'm using this to determine when it's safe for downstream code to locally npm install a package as part of my workflow. As things stand, it only pulls in the non .d.ts code which doesn't really work for Typescript consumers. |
I ran into this issue using an ESBuild plugin that generates custom Would be great to have an option to wait for the DTS stage to finish too. |
Upvote & Fund
The text was updated successfully, but these errors were encountered: