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

Generate types for bundles #3385

Closed
kitsonk opened this issue Nov 20, 2019 · 15 comments
Closed

Generate types for bundles #3385

kitsonk opened this issue Nov 20, 2019 · 15 comments
Assignees
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted)

Comments

@kitsonk
Copy link
Contributor

kitsonk commented Nov 20, 2019

With #3352, bundles are going to be a mechanism to distribute "libraries" in Deno. It is logical that someone might want to use a distribution bundle in another Deno workload (or consume it in other runtimes) and would want to have type safe consumption of those files, therefore we should generate the declarations along with a bundle.

Related to #2475.

@kitsonk
Copy link
Contributor Author

kitsonk commented Dec 9, 2019

Also related #2934 as the bundle should output referencing its types.

@DanielRamosAcosta
Copy link
Contributor

I'm trying to use Deno for writing a library that should be compatible with Node after bundling. Is there any way that I could help with this issue @kitsonk?

@kitsonk kitsonk mentioned this issue Jan 21, 2021
22 tasks
antonie-coetzee pushed a commit to antonie-coetzee/medley that referenced this issue Apr 25, 2021
keithamus added a commit to chaijs/assertion-error that referenced this issue Oct 24, 2021
keithamus added a commit to chaijs/assertion-error that referenced this issue Oct 25, 2021
* chore: move test/index.js to mod_test.ts

* chore: move test/typings.ts to typings_test.ts

* test: format typings_test.ts with deno

* test: refactor mod_test.ts to use Deno test

* fix(AssertionError): make stack argument optional

* build: use deno in build scripts

* test: drop test index.html

* build: add .tool-versions

* build: add coverage folder to gitignore

* build: add index.js to gitignore

* style: deno fmt

* build: drop dist files from package.json

* style: deno fmt md files

* style: deno fmt package*

* build: move dist/mod.d.ts to index.d.ts

* refactor: manually write index.d.ts for now

Refs: denoland/deno#3385

* build: fix npm files

* test: temporarily pass the typings tests

* build: add deno ci

* build: use denoland/setup-deno

* style: deno fmt

* build: remove tsconfig

Not needed for Deno

* build: remove broken coverage assertions

* build: remove node build

* style: fix all lint errors

* fix(AssertionError): captureStackTrace inside consturctor

* build: use deno lint

* style: deno fmt

* style: NAUGHTY DENO
@rojvv
Copy link
Contributor

rojvv commented Nov 25, 2021

Need this.

@Caleb-T-Owens
Copy link

Is there any progress on this? To make migrating to deno fesible I need a way of generating .d.ts file.

@kitsonk
Copy link
Contributor Author

kitsonk commented Jan 31, 2022

No, there hasn't been progress due to other priorities.

@cowboyd
Copy link

cowboyd commented Feb 11, 2022

@kitsonk Is there any way to help on this? I've made a couple of spikes using deno as the primary dev tool for some of our libraries, and this is the only thing holding us back from pulling the trigger and making it the way to go. If there's a place to get started, or some attempts that have already been made then perhaps I could have a look?

@cowboyd
Copy link

cowboyd commented Feb 14, 2022

For those coming here looking to develop their library in deno, but still publish to npm, here is a really nice tool that got me up and running quite quickly.

@olaven
Copy link

olaven commented Feb 14, 2022

For those coming here looking to develop their library in deno, but still publish to npm, here is a really nice tool that got me up and running quite quickly.

Are you missing a link here? :)

@rojvv
Copy link
Contributor

rojvv commented Feb 14, 2022

Here it is: https://github.com/fromdeno/deno2node

@UltiRequiem
Copy link
Contributor

I was thinking about https://github.com/denoland/dnt

Offical, good defaults but configurable

@rojvv
Copy link
Contributor

rojvv commented Feb 14, 2022

@UltiRequiem Officials, too: denoland/dnt#2 (comment)

@UltiRequiem
Copy link
Contributor

@UltiRequiem Officials, too: denoland/dnt#2 (comment)

Official too denoland/dnt#2 (comment) 😆

And that was months ago! I recommend dnt over deno2node

@rojvv
Copy link
Contributor

rojvv commented Feb 14, 2022

I just meant that using deno2node isn’t bad either because it started the thing, I’m not underrating dnt. We should also wait to know what @cowboyd was mentioning.

@cowboyd
Copy link

cowboyd commented Feb 14, 2022

🤦‍♂️

It was the dnt tool that I used but forgot the link. Thanks for pointing that out!

seems very promising so far…

@lucacasonato
Copy link
Member

deno bundle has been deprecated and removed for Deno 2, so this is not relevant anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cli related to cli/ dir feat new feature (which has been agreed to/accepted)
Projects
None yet
Development

No branches or pull requests

8 participants