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

make it available for Deno #921

Closed
hemedani opened this issue Jan 17, 2021 · 6 comments · Fixed by #946
Closed

make it available for Deno #921

hemedani opened this issue Jan 17, 2021 · 6 comments · Fixed by #946

Comments

@hemedani
Copy link

Describe the solution you'd like
Just make work this awesome lib for Deno

@dsherret
Copy link
Owner

dsherret commented Jan 22, 2021

It would be great. ts-morph was actually previously used in Deno's build system when it was still on node.

ts-morph doesn't have too many dependencies, so I don't believe this would be too hard. I think probably the easiest solution here would be to build code-block-writer for Deno (has no dependencies), then bundle ts-morph and @ts-morph/common into a single file, then implement https://github.com/dsherret/ts-morph/blob/latest/packages/common/src/fileSystem/RealFileSystemHost.ts for Deno.

@dsherret
Copy link
Owner

dsherret commented Jan 22, 2021

Opened dsherret/code-block-writer#36

Edit: This is complete now.

@dsherret
Copy link
Owner

dsherret commented Feb 18, 2021

One part about this was figuring out how to bundle the .d.ts files (aka lib files) for Deno. #934 should solve this, but I think for Deno it will have to remove the "require" and always load the lib files module in getLibFiles()

export function getLibFiles() {
const libFiles: typeof import("./data/libFiles") = require("./data/libFiles");
return libFiles.libFiles;
}

@dsherret
Copy link
Owner

dsherret commented Feb 28, 2021

ts-morph/common dependencies

ts-morph dependencies

Remaining Tasks

  • Create a Deno implementation of the Runtime interface.
  • Make a build for Deno. Can just be a single file.
  • Add some code verification to enforce putting certain stuff in a Runtime and add some basic tests for Deno.

dsherret added a commit that referenced this issue Feb 28, 2021
dsherret added a commit that referenced this issue Feb 28, 2021
This is for #921. Will add a `DenoRuntime` implementation in the future.
dsherret added a commit that referenced this issue Mar 1, 2021
…stead.

This is more work towards support Deno (#921).
@dsherret
Copy link
Owner

dsherret commented Mar 7, 2021

@hemedani this is now available here: https://deno.land/x/ts_morph

Note that I haven't developed a way to run the tests for the Deno module yet, so it might be a little bit unstable. I started using it in some of my Deno code in a different repo and seems to work well so far...

@hemedani
Copy link
Author

hemedani commented Mar 7, 2021

awesome

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.

2 participants