Skip to content

@types/webworker is not being published to npm #1482

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

Closed
StenAL opened this issue Jan 21, 2023 · 6 comments · Fixed by #1965
Closed

@types/webworker is not being published to npm #1482

StenAL opened this issue Jan 21, 2023 · 6 comments · Fixed by #1965

Comments

@StenAL
Copy link
Contributor

StenAL commented Jan 21, 2023

I'd like to override the webworker lib in my project's TypeScript installation. With other libraries, e.g. dom, this is possible because the dom.generated.d.ts file is being published to npm as @types/web.

However, I can't see webworker.generated.d.ts being published to any npm packages. In the deploy folder there is some infrastrucutre for publishing it as @types/webworker (e.g. this README), but https://www.npmjs.com/package/@types/webworker doesn't exist and returns a 404.

All the other packages published from this repo are in the packages array in deploy/createTypesPackages.

@orta
Copy link
Contributor

orta commented Jan 21, 2023

it gets shipped with typescript, but you can use https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-5.html#supporting-lib-from-node_modules to set it yourself

@StenAL
Copy link
Contributor Author

StenAL commented Jan 21, 2023

Yeah, but there's no npm package for overriding the WebWorker lib.

For the DOM lib, there's @types/web.
For service workers, there's @types/serviceworker.
For shared workers, there's @types/sharedworker.
For audio worklets, there's @types/audioworklet.
For dedicated workers, there's no package because @types/webworker is not being published.

@orta
Copy link
Contributor

orta commented Jan 21, 2023

Ish, you'd need to ship your own - you could use a locally resolved folder for example

I'd recommend re-reading how that TypeScript feature works

@StenAL
Copy link
Contributor Author

StenAL commented Jan 22, 2023

I see, though that's a lot more friction than writing npm i --save-dev @typescreipt/lib-webworker:@types/webworker. I'd have to basically make a tiny local package containing just webworker.generated.d.ts and update it manually by copying over changes from this repo whenever the types change.

Is there a reason these types aren't published? It seems like they're meant to be published considering there's even a README for the package.

@turansky
Copy link

@Bashamega thank you, it's very helpful

@Bashamega
Copy link
Contributor

@Bashamega thank you, it's very helpful

You are welcome

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 a pull request may close this issue.

4 participants