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

suggestion: Add Deno support #59

Closed
DjDeveloperr opened this issue Dec 25, 2020 · 5 comments · Fixed by #62
Closed

suggestion: Add Deno support #59

DjDeveloperr opened this issue Dec 25, 2020 · 5 comments · Fixed by #62

Comments

@DjDeveloperr
Copy link

Hi!

After seeing comment in Pull Request in Discord API Docs repo for adding Deno support (discord/discord-api-docs#2401 (comment)), I decided to try this out.

From what I know, only import/export style has changed in Deno which makes this incompatible, which does not have anything like index.js/ts file and always requires extension of file to be in import.

I've made a script which goes through all files and makes imports/exports compatible with Deno, https://github.com/DjDeveloperr/denoify-dapi-types. There's even a working GitHub action which deploys on deno branch on every push.
You can see live version on my fork of this repo, https://github.com/DjDeveloperr/discord-api-types.

I have tested, those auto-generated types do work with Deno 😄

@advaith1
Copy link
Contributor

The modified version should be compatible with both node and deno, right? Can't we just add /index.ts to the imports in the main branch to have a simple version compatible with both?

@DjDeveloperr
Copy link
Author

DjDeveloperr commented Dec 25, 2020

I'm pretty sure if adding .ts in imports is incompatible with TypeScript (Node).
image

Edit: There's a plugin for TS to allow extension if I remember correctly.

@iCrawl
Copy link
Member

iCrawl commented Dec 25, 2020

microsoft/TypeScript#37582

@vladfrangu
Copy link
Member

I mean, personally, I'm willing to create a CD that deploys to a deno branch for the time being, fast enough! What do you think, @iCrawl, @kyranet?

@kyranet
Copy link
Member

kyranet commented Dec 26, 2020

I personally have no issue with that. the question is... how are we going to transform the imports to support Deno?

@vladfrangu vladfrangu linked a pull request Jan 1, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants