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 @types/bun to devDependencies, delete package-lock.json #63

Merged
merged 3 commits into from
Mar 9, 2025

Conversation

thorn0
Copy link
Contributor

@thorn0 thorn0 commented Mar 8, 2025

The project uses Bun, so an npm lock file isn't needed (I guess).

The project uses Bun, so an npm lock file isn't needed.
@sebastianwessel
Copy link
Owner

sebastianwessel commented Mar 8, 2025

I know. I needed to remove the bun types for the builds.

The issue is, that somehow, the bun types are preferred over the ones from node, and then referenced in the types of the build.

Example: createTimeInterval.d.ts - Bun.TimerHandler

export declare const createTimeInterval: (handler: Bun.TimerHandler, interval?: number | undefined, ...arguments: any[]) => {
    id: ReturnType<typeof setInterval> | undefined;
    clear: () => void;
    [Symbol.dispose]: () => void;
};

As far as I understand, the package.json, must be changed a bit, so that tshy is using a custom tsconfig.json:

{
[...]
   "tshy": {
        "project": "./tsconfig.build.json",
        [...]
    }
[...]
}

and the custom tsconfig.json must have

{
[...]
   "compilerOptions": {
        [...]
        "types": ["node"]
    }
[...]
}

But I did not get a working solution, as the build failed...

@thorn0
Copy link
Contributor Author

thorn0 commented Mar 9, 2025

Seems to be a manifestation of oven-sh/bun#8761

@sebastianwessel
Copy link
Owner

Hope they get this resolved asap.

@thorn0
Copy link
Contributor Author

thorn0 commented Mar 9, 2025

I've regenerated the lock file and it all seems to work fine now. No trace of Bun types in the build. Please check.

@sebastianwessel
Copy link
Owner

lgtm - thx

@sebastianwessel sebastianwessel merged commit 6c5c047 into sebastianwessel:main Mar 9, 2025
1 check passed
@thorn0 thorn0 deleted the bun branch March 9, 2025 15:53
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